@univerjs/sheets-drawing-ui 0.7.0-nightly.202505081607 → 0.7.0-nightly.202505091607
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 +3 -6
- package/lib/es/index.js +344 -346
- package/lib/index.css +1 -1
- package/lib/index.js +344 -346
- package/lib/umd/index.js +4 -7
- package/package.json +13 -13
package/lib/es/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
var Nr = Object.defineProperty;
|
|
2
2
|
var kr = (i, t, e) => t in i ? Nr(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
3
|
var te = (i, t, e) => kr(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
-
import { CommandType as J, ICommandService as G, IUndoRedoService as Le, sequenceExecute as Ln, LocaleService as nt, IUniverInstanceService as Se, Inject as A, Injector as Ye, IContextService as Yn, IImageIoService as Wr, RxDisposable as jr, UniverInstanceType as
|
|
4
|
+
import { CommandType as J, ICommandService as G, IUndoRedoService as Le, sequenceExecute as Ln, LocaleService as nt, IUniverInstanceService as Se, Inject as A, Injector as Ye, IContextService as Yn, IImageIoService as Wr, RxDisposable as jr, UniverInstanceType as x, FOCUSING_COMMON_DRAWINGS as xe, DrawingTypeEnum as j, Disposable as ie, ArrangeTypeEnum as pt, createDocumentModelWithStyle as Ht, ObjectRelativeFromV as pn, ObjectRelativeFromH as wn, WrapTextType as _n, PositionedObjectLayoutType as vn, BooleanNumber as Sn, BuildTextUtils as zt, ImageSourceType as In, generateRandomId as bt, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as qe, DOCS_ZEN_EDITOR_UNIT_ID_KEY as Be, InterceptorEffectEnum as Br, ObjectMatrix as $r, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as xr, Tools as Re, IPermissionService as Fr, UserManagerService as Lr, LifecycleService as Yr, LifecycleStages as Gr, DisposableCollection as wt, fromEventSubject as Xr, PRINT_CHART_COMPONENT_KEY as Vr, Rectangle as Hr, Direction as ve, FOCUSING_FX_BAR_EDITOR as zr, EDITOR_ACTIVATED as Kr, FOCUSING_PANEL_EDITOR as Zr, DependentOn as Jr, IConfigService as qr, Plugin as Qr, merge as ei, registerDependencies as ti, touchDependencies as Ft } from "@univerjs/core";
|
|
5
5
|
import { DocDrawingController as ni, UniverDocsDrawingPlugin as ri } from "@univerjs/docs-drawing";
|
|
6
6
|
import { SetDrawingSelectedOperation as Nt, IDrawingManagerService as se, IImageIoService as ii, DRAWING_IMAGE_ALLOW_IMAGE_LIST as Cn, DRAWING_IMAGE_COUNT_LIMIT as Dn, ImageUploadStatusType as Pe, DRAWING_IMAGE_ALLOW_SIZE as bn, getImageSize as Lt, DRAWING_IMAGE_WIDTH_LIMIT as Rn, DRAWING_IMAGE_HEIGHT_LIMIT as Mn, ImageSourceType as si, getDrawingShapeKeyByDrawingSearch as Ie, UniverDrawingPlugin as oi } from "@univerjs/drawing";
|
|
7
7
|
import { ImageCropperObject as ai, COMPONENT_IMAGE_POPUP_MENU as ci, OpenImageCropOperation as di, ImageResetSizeOperation as li, DrawingRenderService as Gn, DrawingCommonPanel as ui, UniverDrawingUIPlugin as hi } from "@univerjs/drawing-ui";
|
|
8
8
|
import { IRenderManagerService as q, CURSOR_TYPE as gi, precisionTo as _t, transformObjectOutOfGroup as fi, getGroupState as mi, getCurrentTypeOfRenderer as on, RENDER_CLASS_TYPE as Ae, Rect as Ne, ObjectType as yn, DRAWING_OBJECT_LAYER_INDEX as Yt, SHEET_VIEWPORT_KEY as Xn } from "@univerjs/engine-render";
|
|
9
9
|
import { ISheetDrawingService as oe, DrawingApplyType as U, SetDrawingApplyMutation as P, SheetDrawingAnchorType as O, UniverSheetsDrawingPlugin as pi } from "@univerjs/sheets-drawing";
|
|
10
|
-
import { MessageType as we, render as wi, unmount as _i,
|
|
11
|
-
import { SheetCanvasPopManagerService as
|
|
12
|
-
import { ISidebarService as
|
|
13
|
-
import { takeUntil as Un, throttleTime as
|
|
14
|
-
import { SheetInterceptorService as kt, getSheetCommandTarget as ae, SheetsSelectionsService as dn, SetRangeValuesCommand as kn, INTERCEPTOR_POINT as
|
|
15
|
-
import { docDrawingPositionToTransform as Bn, ReplaceSnapshotCommand as
|
|
10
|
+
import { MessageType as we, render as wi, unmount as _i, clsx as vi, RadioGroup as Si, Radio as Gt, borderTopClassName as Ii } from "@univerjs/design";
|
|
11
|
+
import { SheetCanvasPopManagerService as Ci, HoverManagerService as Di, SheetSkeletonManagerService as V, convertPositionSheetOverGridToAbsolute as bi, ISheetSelectionRenderService as Ge, attachRangeWithCoord as Vn, IEditorBridgeService as Ri, IAutoFillService as Mi, EditingRenderController as yi, SetCellEditVisibleOperation as En, PREDEFINED_HOOK_NAME as $e, COPY_TYPE as Ce, discreteRangeToRange as Tn, virtualizeDiscreteRanges as Ei, ISheetClipboardService as Ti, SetZoomRatioOperation as On, SetScrollOperation as Oi, SheetPrintInterceptorService as Ui, getCurrentRangeDisable$ as Pi } from "@univerjs/sheets-ui";
|
|
12
|
+
import { ISidebarService as Ai, IMessageService as Hn, ILocalFileService as Ni, IDialogService as ki, IClipboardInterfaceService as Wi, CanvasFloatDomService as ji, PrintFloatDomSingle as Bi, ComponentManager as zn, connectInjector as $i, getMenuHiddenObservable as an, MenuItemType as cn, useDependency as Qe, RibbonStartGroup as xi, KeyCode as Fe, IMenuManagerService as Fi, IShortcutService as Li } from "@univerjs/ui";
|
|
13
|
+
import { takeUntil as Un, throttleTime as Yi, combineLatest as vt, switchMap as _e, EMPTY as me, tap as Pn, map as Me, distinctUntilChanged as An, Subject as Xt, filter as Gi, take as Xi, BehaviorSubject as je, of as Nn } from "rxjs";
|
|
14
|
+
import { SheetInterceptorService as kt, getSheetCommandTarget as ae, SheetsSelectionsService as dn, SetRangeValuesCommand as kn, INTERCEPTOR_POINT as Vi, InterceptCellContentPriority as Hi, WorkbookViewPermission as Wn, WorksheetViewPermission as jn, WorkbookEditablePermission as Kt, WorksheetEditPermission as Zt, SetFrozenMutation as zi, SetWorksheetRowAutoHeightMutation as Ki, COMMAND_LISTENER_SKELETON_CHANGE as Zi, InsertRowCommand as Kn, InsertColCommand as Zn, RemoveRowCommand as Jn, RemoveColCommand as qn, DeleteRangeMoveLeftCommand as Qn, DeleteRangeMoveUpCommand as er, InsertRangeMoveDownCommand as tr, InsertRangeMoveRightCommand as nr, DeltaRowHeightCommand as Jt, SetRowHeightCommand as qt, DeltaColumnWidthCommand as rr, SetColWidthCommand as ir, SetRowHiddenCommand as sr, SetSpecificRowsVisibleCommand as or, SetSpecificColsVisibleCommand as ar, SetColHiddenCommand as cr, MoveColsCommand as dr, MoveRowsCommand as lr, MoveRangeCommand as ur, 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";
|
|
15
|
+
import { docDrawingPositionToTransform as Bn, ReplaceSnapshotCommand as ss, InnerPasteCommand as os } from "@univerjs/docs-ui";
|
|
16
16
|
import { jsx as Z, jsxs as Qt } from "react/jsx-runtime";
|
|
17
|
-
import { useMemo as
|
|
18
|
-
const
|
|
17
|
+
import { useMemo as as, forwardRef as hr, useRef as cs, createElement as gr, useState as en, useEffect as fr } from "react";
|
|
18
|
+
const ds = "sheets-drawing-ui.config", $n = {}, L = {
|
|
19
19
|
id: "sheet.operation.clear-drawing-transformer",
|
|
20
20
|
type: J.MUTATION,
|
|
21
21
|
handler: (i, t) => {
|
|
@@ -29,7 +29,7 @@ const as = "sheets-drawing-ui.config", $n = {}, L = {
|
|
|
29
29
|
id: "sheet.command.remove-sheet-image",
|
|
30
30
|
type: J.COMMAND,
|
|
31
31
|
handler: (i, t) => {
|
|
32
|
-
var S,
|
|
32
|
+
var S, I, b;
|
|
33
33
|
const e = i.get(G), n = i.get(Le), r = i.get(kt), s = i.get(oe);
|
|
34
34
|
if (!t) return !1;
|
|
35
35
|
const { drawings: o } = t, a = [];
|
|
@@ -41,7 +41,7 @@ const as = "sheets-drawing-ui.config", $n = {}, L = {
|
|
|
41
41
|
return Ln([...(S = m.preRedos) != null ? S : [], p, ...m.redos], e) ? (n.pushUndoRedo({
|
|
42
42
|
unitID: u,
|
|
43
43
|
undoMutations: [
|
|
44
|
-
...(
|
|
44
|
+
...(I = m.preUndos) != null ? I : [],
|
|
45
45
|
f,
|
|
46
46
|
...m.undos,
|
|
47
47
|
{ id: L.id, params: a }
|
|
@@ -58,7 +58,7 @@ const as = "sheets-drawing-ui.config", $n = {}, L = {
|
|
|
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(Ai), n = i.get(nt), r = i.get(Se), s = i.get(G);
|
|
62
62
|
if (!ae(r)) return !1;
|
|
63
63
|
switch (t.value) {
|
|
64
64
|
case "open":
|
|
@@ -86,8 +86,8 @@ const as = "sheets-drawing-ui.config", $n = {}, L = {
|
|
|
86
86
|
return t == null ? !1 : (e.syncExecuteCommand(Nt.id, [t]), e.executeCommand(pr.id, { value: "open" }), !0);
|
|
87
87
|
}
|
|
88
88
|
};
|
|
89
|
-
var
|
|
90
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
89
|
+
var ls = Object.getOwnPropertyDescriptor, us = (i, t, e, n) => {
|
|
90
|
+
for (var r = n > 1 ? void 0 : n ? ls(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
91
91
|
(o = i[s]) && (r = o(r) || r);
|
|
92
92
|
return r;
|
|
93
93
|
}, de = (i, t) => (e, n) => t(e, n, i);
|
|
@@ -98,7 +98,7 @@ let Rt = class extends jr {
|
|
|
98
98
|
this._injector = t, this._localeService = e, this._drawingManagerService = n, this._canvasPopManagerService = r, this._renderManagerService = s, this._univerInstanceService = o, this._messageService = a, this._contextService = d, this._ioService = u, this._commandService = c, this._init();
|
|
99
99
|
}
|
|
100
100
|
_init() {
|
|
101
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
101
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(x.UNIVER_SHEET).pipe(Un(this.dispose$)).subscribe((t) => this._create(t)), this._univerInstanceService.getTypeOfUnitDisposed$(x.UNIVER_SHEET).pipe(Un(this.dispose$)).subscribe((t) => this._dispose(t)), this._univerInstanceService.getAllUnitsForType(x.UNIVER_SHEET).forEach((t) => this._create(t)), this._setupLoadingStatus();
|
|
102
102
|
}
|
|
103
103
|
_setupLoadingStatus() {
|
|
104
104
|
const t = "image-upload-loading";
|
|
@@ -215,11 +215,11 @@ let Rt = class extends jr {
|
|
|
215
215
|
];
|
|
216
216
|
}
|
|
217
217
|
};
|
|
218
|
-
Rt =
|
|
218
|
+
Rt = us([
|
|
219
219
|
de(0, A(Ye)),
|
|
220
220
|
de(1, A(nt)),
|
|
221
221
|
de(2, se),
|
|
222
|
-
de(3, A(
|
|
222
|
+
de(3, A(Ci)),
|
|
223
223
|
de(4, q),
|
|
224
224
|
de(5, Se),
|
|
225
225
|
de(6, Hn),
|
|
@@ -227,8 +227,8 @@ Rt = ds([
|
|
|
227
227
|
de(8, Wr),
|
|
228
228
|
de(9, G)
|
|
229
229
|
], Rt);
|
|
230
|
-
var
|
|
231
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
230
|
+
var hs = Object.getOwnPropertyDescriptor, gs = (i, t, e, n) => {
|
|
231
|
+
for (var r = n > 1 ? void 0 : n ? hs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
232
232
|
(o = i[s]) && (r = o(r) || r);
|
|
233
233
|
return r;
|
|
234
234
|
}, St = (i, t) => (e, n) => t(e, n, i);
|
|
@@ -239,7 +239,7 @@ let tn = class extends ie {
|
|
|
239
239
|
this._context = t, this._hoverManagerService = e, this._selectionsService = n, this._drawingRenderService = r, this._sheetSkeletonManagerService = s, this._initHover(), this._initImageClick();
|
|
240
240
|
}
|
|
241
241
|
_initHover() {
|
|
242
|
-
this.disposeWithMe(this._hoverManagerService.currentRichTextNoDistinct$.pipe(
|
|
242
|
+
this.disposeWithMe(this._hoverManagerService.currentRichTextNoDistinct$.pipe(Yi(33)).subscribe((t) => {
|
|
243
243
|
var n, r;
|
|
244
244
|
let e = [];
|
|
245
245
|
t !== null && (e = this._selectionsService.getWorkbookSelections(this._context.unitId).getCurrentSelections()), e.length > 0 && (t == null ? void 0 : t.unitId) === this._context.unitId && (t != null && t.drawing) && e.length === 1 && ((n = e[0].primary) == null ? void 0 : n.actualRow) === t.row && ((r = e[0].primary) == null ? void 0 : r.actualColumn) === t.col ? (this._isSetCursor = !0, this._context.scene.setCursor(gi.ZOOM_IN)) : this._isSetCursor && (this._isSetCursor = !1, this._context.scene.resetCursor());
|
|
@@ -256,8 +256,8 @@ let tn = class extends ie {
|
|
|
256
256
|
}));
|
|
257
257
|
}
|
|
258
258
|
};
|
|
259
|
-
tn =
|
|
260
|
-
St(1, A(
|
|
259
|
+
tn = gs([
|
|
260
|
+
St(1, A(Di)),
|
|
261
261
|
St(2, A(dn)),
|
|
262
262
|
St(3, A(Gn)),
|
|
263
263
|
St(4, A(V))
|
|
@@ -266,7 +266,7 @@ function z(i, t, e) {
|
|
|
266
266
|
const { from: n, to: r, flipY: s = !1, flipX: o = !1, angle: a = 0, skewX: d = 0, skewY: u = 0 } = i, c = e.getCurrent();
|
|
267
267
|
if (c == null)
|
|
268
268
|
return;
|
|
269
|
-
const l =
|
|
269
|
+
const l = bi(
|
|
270
270
|
c.unitId,
|
|
271
271
|
c.sheetId,
|
|
272
272
|
{ from: n, to: r },
|
|
@@ -286,7 +286,7 @@ function z(i, t, e) {
|
|
|
286
286
|
height: p
|
|
287
287
|
};
|
|
288
288
|
}
|
|
289
|
-
function
|
|
289
|
+
function $(i, t) {
|
|
290
290
|
const { left: e = 0, top: n = 0, width: r = 0, height: s = 0, flipY: o = !1, flipX: a = !1, angle: d = 0, skewX: u = 0, skewY: c = 0 } = i, l = t.getCellWithCoordByOffset(e, n);
|
|
291
291
|
if (l == null)
|
|
292
292
|
return;
|
|
@@ -314,8 +314,8 @@ function x(i, t) {
|
|
|
314
314
|
to: m
|
|
315
315
|
};
|
|
316
316
|
}
|
|
317
|
-
var
|
|
318
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
317
|
+
var fs = Object.getOwnPropertyDescriptor, ms = (i, t, e, n) => {
|
|
318
|
+
for (var r = n > 1 ? void 0 : n ? fs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
319
319
|
(o = i[s]) && (r = o(r) || r);
|
|
320
320
|
return r;
|
|
321
321
|
}, It = (i, t) => (e, n) => t(e, n, i);
|
|
@@ -333,19 +333,19 @@ let nn = class extends ie {
|
|
|
333
333
|
const e = i[t];
|
|
334
334
|
for (const n in e.data) {
|
|
335
335
|
const r = e.data[n];
|
|
336
|
-
r.transform = z(r.sheetTransform, this._sheetSelectionRenderService, this._sheetSkeletonManagerService);
|
|
336
|
+
r.sheetTransform && (r.transform = z(r.sheetTransform, this._sheetSelectionRenderService, this._sheetSkeletonManagerService));
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
339
|
this._drawingManagerService.registerDrawingData(this._context.unitId, this._sheetDrawingService.getDrawingDataForUnit(this._context.unitId)), this._drawingManagerService.initializeNotification(this._context.unitId);
|
|
340
340
|
}
|
|
341
341
|
};
|
|
342
|
-
nn =
|
|
342
|
+
nn = ms([
|
|
343
343
|
It(1, oe),
|
|
344
344
|
It(2, se),
|
|
345
345
|
It(3, A(Ge)),
|
|
346
346
|
It(4, A(V))
|
|
347
347
|
], nn);
|
|
348
|
-
function
|
|
348
|
+
function ps(i) {
|
|
349
349
|
const t = [];
|
|
350
350
|
return i.forEach((e) => {
|
|
351
351
|
const { parent: n, children: r } = e, { unitId: s, subUnitId: o, drawingId: a } = n, d = mi(0, 0, r.map((l) => l.transform || {})), u = r.map((l) => {
|
|
@@ -374,7 +374,7 @@ function fs(i) {
|
|
|
374
374
|
});
|
|
375
375
|
}), t;
|
|
376
376
|
}
|
|
377
|
-
function
|
|
377
|
+
function ws(i) {
|
|
378
378
|
const t = [];
|
|
379
379
|
return i.forEach((e) => {
|
|
380
380
|
const { parent: n, children: r } = e, { unitId: s, subUnitId: o, drawingId: a, transform: d = { width: 0, height: 0 } } = n;
|
|
@@ -421,7 +421,7 @@ const _r = {
|
|
|
421
421
|
return e.syncExecuteCommand(P.id, { op: c, unitId: a, subUnitId: d, objects: l, type: U.GROUP }) ? (n.pushUndoRedo({
|
|
422
422
|
unitID: a,
|
|
423
423
|
undoMutations: [
|
|
424
|
-
{ id: P.id, params: { op: u, unitId: a, subUnitId: d, objects:
|
|
424
|
+
{ id: P.id, params: { op: u, unitId: a, subUnitId: d, objects: ws(l), type: U.UNGROUP } },
|
|
425
425
|
{ id: L.id, params: s }
|
|
426
426
|
],
|
|
427
427
|
redoMutations: [
|
|
@@ -434,14 +434,14 @@ const _r = {
|
|
|
434
434
|
id: "sheet.command.insert-sheet-image",
|
|
435
435
|
type: J.COMMAND,
|
|
436
436
|
handler: (i, t) => {
|
|
437
|
-
var S,
|
|
437
|
+
var S, I, b;
|
|
438
438
|
const e = i.get(G), n = i.get(Le), r = i.get(oe), s = i.get(kt);
|
|
439
439
|
if (!t) return !1;
|
|
440
440
|
const o = t.drawings, a = o.map((v) => v.unitId), d = r.getBatchAddOp(o), { unitId: u, subUnitId: c, undo: l, redo: g, objects: h } = d, m = s.onCommandExecute({ id: Wt.id, params: t }), p = { id: P.id, params: { op: g, unitId: u, subUnitId: c, objects: h, type: U.INSERT } }, f = { id: P.id, params: { op: l, unitId: u, subUnitId: c, objects: h, type: U.REMOVE } };
|
|
441
441
|
return Ln([...(S = m.preRedos) != null ? S : [], p, ...m.redos], e) ? (n.pushUndoRedo({
|
|
442
442
|
unitID: u,
|
|
443
443
|
undoMutations: [
|
|
444
|
-
...(
|
|
444
|
+
...(I = m.preUndos) != null ? I : [],
|
|
445
445
|
f,
|
|
446
446
|
...m.undos,
|
|
447
447
|
{ id: L.id, params: a }
|
|
@@ -510,7 +510,7 @@ const _r = {
|
|
|
510
510
|
return e.syncExecuteCommand(P.id, { op: c, unitId: a, subUnitId: d, objects: l, type: U.UNGROUP }) ? (n.pushUndoRedo({
|
|
511
511
|
unitID: a,
|
|
512
512
|
undoMutations: [
|
|
513
|
-
{ id: P.id, params: { op: u, unitId: a, subUnitId: d, objects:
|
|
513
|
+
{ id: P.id, params: { op: u, unitId: a, subUnitId: d, objects: ps(l), type: U.GROUP } },
|
|
514
514
|
{ id: L.id, params: s }
|
|
515
515
|
],
|
|
516
516
|
redoMutations: [
|
|
@@ -520,18 +520,18 @@ const _r = {
|
|
|
520
520
|
}), !0) : !1;
|
|
521
521
|
}
|
|
522
522
|
};
|
|
523
|
-
var
|
|
524
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
523
|
+
var _s = Object.getOwnPropertyDescriptor, vs = (i, t, e, n) => {
|
|
524
|
+
for (var r = n > 1 ? void 0 : n ? _s(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
525
525
|
(o = i[s]) && (r = o(r) || r);
|
|
526
526
|
return r;
|
|
527
527
|
}, ne = (i, t) => (e, n) => t(e, n, i);
|
|
528
|
-
function
|
|
528
|
+
function Ss(i, t, e) {
|
|
529
529
|
const n = e * Math.PI / 180, r = Math.abs(i * Math.cos(n)) + Math.abs(t * Math.sin(n)), s = Math.abs(i * Math.sin(n)) + Math.abs(t * Math.cos(n));
|
|
530
530
|
return { rotatedWidth: r, rotatedHeight: s };
|
|
531
531
|
}
|
|
532
532
|
function rn(i, t, e, n, r) {
|
|
533
533
|
var S;
|
|
534
|
-
const { rotatedHeight: s, rotatedWidth: o } =
|
|
534
|
+
const { rotatedHeight: s, rotatedWidth: o } = Ss(e, n, r), d = i.get(q).getRenderById(t.unitId);
|
|
535
535
|
if (!d)
|
|
536
536
|
return !1;
|
|
537
537
|
const c = (S = d.with(V).getSkeletonParam(t.subUnitId)) == null ? void 0 : S.skeleton;
|
|
@@ -574,14 +574,14 @@ let et = class extends ie {
|
|
|
574
574
|
try {
|
|
575
575
|
e = await this._imageIoService.saveImage(t);
|
|
576
576
|
} catch (S) {
|
|
577
|
-
const
|
|
578
|
-
|
|
577
|
+
const I = S.message;
|
|
578
|
+
I === Pe.ERROR_EXCEED_SIZE ? this._messageService.show({
|
|
579
579
|
type: we.Error,
|
|
580
580
|
content: this._localeService.t("update-status.exceedMaxSize", String(bn / (1024 * 1024)))
|
|
581
|
-
}) :
|
|
581
|
+
}) : I === Pe.ERROR_IMAGE_TYPE ? this._messageService.show({
|
|
582
582
|
type: we.Error,
|
|
583
583
|
content: this._localeService.t("update-status.invalidImageType")
|
|
584
|
-
}) :
|
|
584
|
+
}) : I === Pe.ERROR_IMAGE && this._messageService.show({
|
|
585
585
|
type: we.Error,
|
|
586
586
|
content: this._localeService.t("update-status.invalidImage")
|
|
587
587
|
});
|
|
@@ -592,8 +592,8 @@ let et = class extends ie {
|
|
|
592
592
|
this._imageIoService.addImageSourceCache(d, a, g);
|
|
593
593
|
let p = 1;
|
|
594
594
|
if (c > Rn || l > Mn) {
|
|
595
|
-
const S = Rn / c,
|
|
596
|
-
p = Math.max(S,
|
|
595
|
+
const S = Rn / c, I = Mn / l;
|
|
596
|
+
p = Math.max(S, I);
|
|
597
597
|
}
|
|
598
598
|
const f = this._getImagePosition(c * p, l * p, h, m);
|
|
599
599
|
if (f == null)
|
|
@@ -619,8 +619,8 @@ let et = class extends ie {
|
|
|
619
619
|
let n;
|
|
620
620
|
try {
|
|
621
621
|
n = await this._imageIoService.saveImage(t);
|
|
622
|
-
} catch (
|
|
623
|
-
const b =
|
|
622
|
+
} catch (I) {
|
|
623
|
+
const b = I.message;
|
|
624
624
|
b === Pe.ERROR_EXCEED_SIZE ? this._messageService.show({
|
|
625
625
|
type: we.Error,
|
|
626
626
|
content: this._localeService.t("update-status.exceedMaxSize", String(bn / (1024 * 1024)))
|
|
@@ -851,7 +851,7 @@ let et = class extends ie {
|
|
|
851
851
|
const u = this._sheetDrawingService.getDrawingByParam({ unitId: r, subUnitId: s, drawingId: o });
|
|
852
852
|
if (u == null || u.unitId !== this._context.unitId)
|
|
853
853
|
return;
|
|
854
|
-
const c =
|
|
854
|
+
const c = $({ ...u.transform, ...d }, this._selectionRenderService);
|
|
855
855
|
if (c == null)
|
|
856
856
|
return;
|
|
857
857
|
const l = {
|
|
@@ -883,12 +883,12 @@ let et = class extends ie {
|
|
|
883
883
|
);
|
|
884
884
|
}
|
|
885
885
|
};
|
|
886
|
-
et =
|
|
886
|
+
et = vs([
|
|
887
887
|
ne(1, A(V)),
|
|
888
888
|
ne(2, G),
|
|
889
889
|
ne(3, Ge),
|
|
890
890
|
ne(4, ii),
|
|
891
|
-
ne(5,
|
|
891
|
+
ne(5, Ni),
|
|
892
892
|
ne(6, oe),
|
|
893
893
|
ne(7, se),
|
|
894
894
|
ne(8, Yn),
|
|
@@ -897,8 +897,8 @@ et = ws([
|
|
|
897
897
|
ne(11, A(dn)),
|
|
898
898
|
ne(12, A(Ye))
|
|
899
899
|
], et);
|
|
900
|
-
var
|
|
901
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
900
|
+
var Is = Object.getOwnPropertyDescriptor, Cs = (i, t, e, n) => {
|
|
901
|
+
for (var r = n > 1 ? void 0 : n ? Is(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
902
902
|
(o = i[s]) && (r = o(r) || r);
|
|
903
903
|
return r;
|
|
904
904
|
}, ke = (i, t) => (e, n) => t(e, n, i);
|
|
@@ -930,16 +930,16 @@ let Mt = class extends ie {
|
|
|
930
930
|
this.disposeWithMe(this._editorBridgeService.visible$.subscribe((i) => {
|
|
931
931
|
i.visible ? i.visible && (this._drawingManagerService.removeDrawingDataForUnit(qe), this._docDrawingController.loadDrawingDataForUnit(qe), this._drawingManagerService.initializeNotification(qe)) : this._drawingManagerService.removeDrawingDataForUnit(qe);
|
|
932
932
|
})), this.disposeWithMe(this._commandService.onCommandExecuted((i) => {
|
|
933
|
-
i.id ===
|
|
933
|
+
i.id === ss.id && i.params.unitId === Be && (this._drawingManagerService.removeDrawingDataForUnit(Be), this._docDrawingController.loadDrawingDataForUnit(Be), this._drawingManagerService.initializeNotification(Be));
|
|
934
934
|
}));
|
|
935
935
|
}
|
|
936
936
|
_initCellContentInterceptor() {
|
|
937
937
|
this.disposeWithMe(
|
|
938
938
|
this._sheetInterceptorService.intercept(
|
|
939
|
-
|
|
939
|
+
Vi.CELL_CONTENT,
|
|
940
940
|
{
|
|
941
941
|
effect: Br.Style,
|
|
942
|
-
priority:
|
|
942
|
+
priority: Hi.CELL_IMAGE,
|
|
943
943
|
handler: (i, t, e) => {
|
|
944
944
|
var n;
|
|
945
945
|
return i != null && i.p && ((n = i.p.drawingsOrder) != null && n.length) && (i.interceptorStyle || (i.interceptorStyle = {}), i.interceptorStyle.tr = { a: 0 }, Ir(this._injector, { unitId: t.unitId, subUnitId: t.subUnitId, row: t.row, col: t.col }, i)), e(i);
|
|
@@ -949,16 +949,16 @@ let Mt = class extends ie {
|
|
|
949
949
|
);
|
|
950
950
|
}
|
|
951
951
|
};
|
|
952
|
-
Mt =
|
|
952
|
+
Mt = Cs([
|
|
953
953
|
ke(0, G),
|
|
954
954
|
ke(1, A(kt)),
|
|
955
955
|
ke(2, A(Ye)),
|
|
956
956
|
ke(3, se),
|
|
957
957
|
ke(4, A(ni)),
|
|
958
|
-
ke(5, A(
|
|
958
|
+
ke(5, A(Ri))
|
|
959
959
|
], Mt);
|
|
960
|
-
var
|
|
961
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
960
|
+
var Ds = Object.getOwnPropertyDescriptor, bs = (i, t, e, n) => {
|
|
961
|
+
for (var r = n > 1 ? void 0 : n ? Ds(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
962
962
|
(o = i[s]) && (r = o(r) || r);
|
|
963
963
|
return r;
|
|
964
964
|
}, xn = (i, t) => (e, n) => t(e, n, i);
|
|
@@ -979,16 +979,16 @@ let yt = class extends ie {
|
|
|
979
979
|
);
|
|
980
980
|
}
|
|
981
981
|
};
|
|
982
|
-
yt =
|
|
983
|
-
xn(0, A(
|
|
982
|
+
yt = bs([
|
|
983
|
+
xn(0, A(Mi)),
|
|
984
984
|
xn(1, A(Ye))
|
|
985
985
|
], yt);
|
|
986
|
-
var
|
|
987
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
986
|
+
var Rs = Object.getOwnPropertyDescriptor, Ms = (i, t, e, n) => {
|
|
987
|
+
for (var r = n > 1 ? void 0 : n ? Rs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
988
988
|
(o = i[s]) && (r = o(r) || r);
|
|
989
989
|
return r;
|
|
990
990
|
}, ze = (i, t) => (e, n) => t(e, n, i);
|
|
991
|
-
const
|
|
991
|
+
const ys = [
|
|
992
992
|
qe,
|
|
993
993
|
xr,
|
|
994
994
|
Be
|
|
@@ -999,7 +999,7 @@ let Et = class extends ie {
|
|
|
999
999
|
}
|
|
1000
1000
|
_setCellImage(i) {
|
|
1001
1001
|
var r;
|
|
1002
|
-
const t = Ht("", {}), e = (r = on(
|
|
1002
|
+
const t = Ht("", {}), e = (r = on(x.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : r.with(yi), n = zt.drawing.add({
|
|
1003
1003
|
documentDataModel: t,
|
|
1004
1004
|
drawings: [i],
|
|
1005
1005
|
selection: {
|
|
@@ -1014,12 +1014,12 @@ let Et = class extends ie {
|
|
|
1014
1014
|
this.disposeWithMe(
|
|
1015
1015
|
this._commandService.beforeCommandExecuted((i) => {
|
|
1016
1016
|
var t, e;
|
|
1017
|
-
if (i.id ===
|
|
1018
|
-
const n = i.params, { doc: r } = n, s = this._univerInstanceService.getCurrentUnitOfType(
|
|
1017
|
+
if (i.id === os.id) {
|
|
1018
|
+
const n = i.params, { doc: r } = n, s = this._univerInstanceService.getCurrentUnitOfType(x.UNIVER_DOC);
|
|
1019
1019
|
if (s == null || !Object.keys((t = r.drawings) != null ? t : {}).length)
|
|
1020
1020
|
return;
|
|
1021
1021
|
const o = s.getUnitId();
|
|
1022
|
-
if (
|
|
1022
|
+
if (ys.includes(o)) {
|
|
1023
1023
|
if (o !== Be) {
|
|
1024
1024
|
const a = () => {
|
|
1025
1025
|
this._dialogService.close("sheet-cell-image-copy-paste"), this._commandService.syncExecuteCommand(En.id, {
|
|
@@ -1055,10 +1055,10 @@ let Et = class extends ie {
|
|
|
1055
1055
|
);
|
|
1056
1056
|
}
|
|
1057
1057
|
};
|
|
1058
|
-
Et =
|
|
1058
|
+
Et = Ms([
|
|
1059
1059
|
ze(0, G),
|
|
1060
1060
|
ze(1, Se),
|
|
1061
|
-
ze(2,
|
|
1061
|
+
ze(2, ki),
|
|
1062
1062
|
ze(3, q),
|
|
1063
1063
|
ze(4, A(nt))
|
|
1064
1064
|
], Et);
|
|
@@ -1068,7 +1068,7 @@ const Bt = {
|
|
|
1068
1068
|
handler: async (i, t) => {
|
|
1069
1069
|
var o, a;
|
|
1070
1070
|
const e = i.get(Se), n = i.get(q), r = (o = on(
|
|
1071
|
-
|
|
1071
|
+
x.UNIVER_SHEET,
|
|
1072
1072
|
e,
|
|
1073
1073
|
n
|
|
1074
1074
|
)) == null ? void 0 : o.with(et);
|
|
@@ -1088,31 +1088,31 @@ const Bt = {
|
|
|
1088
1088
|
var n, r;
|
|
1089
1089
|
const t = i.get(Se), e = i.get(q);
|
|
1090
1090
|
return (r = (n = on(
|
|
1091
|
-
|
|
1091
|
+
x.UNIVER_SHEET,
|
|
1092
1092
|
t,
|
|
1093
1093
|
e
|
|
1094
1094
|
)) == null ? void 0 : n.with(et).insertCellImage()) != null ? r : !1;
|
|
1095
1095
|
}
|
|
1096
1096
|
};
|
|
1097
|
-
var
|
|
1098
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1097
|
+
var Es = Object.getOwnPropertyDescriptor, Ts = (i, t, e, n) => {
|
|
1098
|
+
for (var r = n > 1 ? void 0 : n ? Es(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
1099
1099
|
(o = i[s]) && (r = o(r) || r);
|
|
1100
1100
|
return r;
|
|
1101
1101
|
}, Ke = (i, t) => (e, n) => t(e, n, i);
|
|
1102
1102
|
const Cr = "image/png";
|
|
1103
|
-
function
|
|
1103
|
+
function Os(i) {
|
|
1104
1104
|
const t = i.split(","), e = atob(t[1]), n = e.length, r = new Uint8Array(n);
|
|
1105
1105
|
for (let s = 0; s < n; s++)
|
|
1106
1106
|
r[s] = e.charCodeAt(s);
|
|
1107
1107
|
return new Blob([r], { type: Cr });
|
|
1108
1108
|
}
|
|
1109
|
-
function
|
|
1110
|
-
const t = new ClipboardItem({ [Cr]:
|
|
1109
|
+
function Us(i) {
|
|
1110
|
+
const t = new ClipboardItem({ [Cr]: Os(i) });
|
|
1111
1111
|
navigator.clipboard.write([t]).catch((e) => {
|
|
1112
1112
|
console.error("Could not copy image using clipboard API: ", e);
|
|
1113
1113
|
});
|
|
1114
1114
|
}
|
|
1115
|
-
function
|
|
1115
|
+
function Ps() {
|
|
1116
1116
|
function i() {
|
|
1117
1117
|
const n = document.createElement("input");
|
|
1118
1118
|
return n.style.position = "absolute", n.style.height = "1px", n.style.width = "1px", n.style.opacity = "0", n;
|
|
@@ -1153,8 +1153,8 @@ let Tt = class extends ie {
|
|
|
1153
1153
|
this._commandService.executeCommand(rt.id, d);
|
|
1154
1154
|
}
|
|
1155
1155
|
setTimeout(() => {
|
|
1156
|
-
const d =
|
|
1157
|
-
o.drawingType === j.DRAWING_IMAGE && o.imageSourceType === si.BASE64 ?
|
|
1156
|
+
const d = Ps();
|
|
1157
|
+
o.drawingType === j.DRAWING_IMAGE && o.imageSourceType === si.BASE64 ? Us(o.source) : this._clipboardInterfaceService.writeText(""), d();
|
|
1158
1158
|
}, 200);
|
|
1159
1159
|
const a = {
|
|
1160
1160
|
unitId: o.unitId,
|
|
@@ -1207,11 +1207,11 @@ let Tt = class extends ie {
|
|
|
1207
1207
|
const m = c[h], { transform: p } = m;
|
|
1208
1208
|
if (m.anchorType !== O.Both || !p)
|
|
1209
1209
|
return;
|
|
1210
|
-
const { left: f = 0, top: _ = 0, width: S = 0, height:
|
|
1210
|
+
const { left: f = 0, top: _ = 0, width: S = 0, height: I = 0 } = p, { drawingStartX: b, drawingEndX: v, drawingStartY: D, drawingEndY: w } = {
|
|
1211
1211
|
drawingStartX: f,
|
|
1212
1212
|
drawingEndX: f + S,
|
|
1213
1213
|
drawingStartY: _,
|
|
1214
|
-
drawingEndY: _ +
|
|
1214
|
+
drawingEndY: _ + I
|
|
1215
1215
|
};
|
|
1216
1216
|
o <= b && v <= a && d <= D && w <= u && l.push(m);
|
|
1217
1217
|
}), l.length)
|
|
@@ -1248,7 +1248,7 @@ let Tt = class extends ie {
|
|
|
1248
1248
|
};
|
|
1249
1249
|
return {
|
|
1250
1250
|
transform: _,
|
|
1251
|
-
sheetTransform: (S =
|
|
1251
|
+
sheetTransform: (S = $(_, c)) != null ? S : p
|
|
1252
1252
|
};
|
|
1253
1253
|
}
|
|
1254
1254
|
});
|
|
@@ -1322,30 +1322,30 @@ let Tt = class extends ie {
|
|
|
1322
1322
|
pasteTo: { unitId: n, subUnitId: r, range: Tn(o) },
|
|
1323
1323
|
pasteType: s
|
|
1324
1324
|
}, d);
|
|
1325
|
-
const { ranges: [l, g], mapFunc: h } =
|
|
1325
|
+
const { ranges: [l, g], mapFunc: h } = Ei([a, o]), { row: m, col: p } = h(l.startRow, l.startColumn), { row: f, col: _ } = h(g.startRow, g.startColumn), S = u.attachRangeWithCoord({
|
|
1326
1326
|
startRow: m,
|
|
1327
1327
|
endRow: m,
|
|
1328
1328
|
startColumn: p,
|
|
1329
1329
|
endColumn: p
|
|
1330
|
-
}),
|
|
1330
|
+
}), I = u.attachRangeWithCoord({
|
|
1331
1331
|
startRow: f,
|
|
1332
1332
|
endRow: f,
|
|
1333
1333
|
startColumn: _,
|
|
1334
1334
|
endColumn: _
|
|
1335
1335
|
});
|
|
1336
|
-
if (!S || !
|
|
1336
|
+
if (!S || !I || !this._copyInfo)
|
|
1337
1337
|
return { redos: [], undos: [] };
|
|
1338
|
-
const b =
|
|
1338
|
+
const b = I.startX - S.startX, v = I.startY - S.startY, D = f - m, w = _ - p;
|
|
1339
1339
|
return this._generateMutations(c, {
|
|
1340
1340
|
unitId: n,
|
|
1341
1341
|
subUnitId: r,
|
|
1342
|
-
getTransform: (
|
|
1342
|
+
getTransform: (C, E) => {
|
|
1343
1343
|
var T, M;
|
|
1344
1344
|
return {
|
|
1345
1345
|
transform: {
|
|
1346
|
-
...
|
|
1347
|
-
left: ((T =
|
|
1348
|
-
top: ((M =
|
|
1346
|
+
...C,
|
|
1347
|
+
left: ((T = C == null ? void 0 : C.left) != null ? T : 0) + b,
|
|
1348
|
+
top: ((M = C == null ? void 0 : C.top) != null ? M : 0) + v
|
|
1349
1349
|
},
|
|
1350
1350
|
sheetTransform: {
|
|
1351
1351
|
...E,
|
|
@@ -1366,15 +1366,15 @@ let Tt = class extends ie {
|
|
|
1366
1366
|
});
|
|
1367
1367
|
}
|
|
1368
1368
|
};
|
|
1369
|
-
Tt =
|
|
1370
|
-
Ke(0,
|
|
1369
|
+
Tt = Ts([
|
|
1370
|
+
Ke(0, Ti),
|
|
1371
1371
|
Ke(1, q),
|
|
1372
1372
|
Ke(2, se),
|
|
1373
|
-
Ke(3,
|
|
1373
|
+
Ke(3, Wi),
|
|
1374
1374
|
Ke(4, G)
|
|
1375
1375
|
], Tt);
|
|
1376
|
-
var
|
|
1377
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1376
|
+
var As = Object.getOwnPropertyDescriptor, Ns = (i, t, e, n) => {
|
|
1377
|
+
for (var r = n > 1 ? void 0 : n ? As(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
1378
1378
|
(o = i[s]) && (r = o(r) || r);
|
|
1379
1379
|
return r;
|
|
1380
1380
|
}, Ze = (i, t) => (e, n) => t(e, n, i);
|
|
@@ -1383,7 +1383,7 @@ let Ot = class extends ie {
|
|
|
1383
1383
|
super(), this._drawingManagerService = i, this._renderManagerService = t, this._permissionService = e, this._univerInstanceService = n, this._userManagerService = r, this._initDrawingVisible(), this._initDrawingEditable(), this._initViewPermissionChange(), this._initEditPermissionChange();
|
|
1384
1384
|
}
|
|
1385
1385
|
_initDrawingVisible() {
|
|
1386
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1386
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(x.UNIVER_SHEET), t = this._userManagerService.currentUser$, e = vt([i, t]);
|
|
1387
1387
|
this.disposeWithMe(
|
|
1388
1388
|
e.pipe(
|
|
1389
1389
|
_e(([n, r]) => n ? n.activeSheet$.pipe(
|
|
@@ -1412,7 +1412,7 @@ let Ot = class extends ie {
|
|
|
1412
1412
|
});
|
|
1413
1413
|
}
|
|
1414
1414
|
_initDrawingEditable() {
|
|
1415
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1415
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(x.UNIVER_SHEET), t = this._userManagerService.currentUser$, e = vt([i, t]);
|
|
1416
1416
|
this.disposeWithMe(
|
|
1417
1417
|
e.pipe(
|
|
1418
1418
|
_e(([n, r]) => n ? n.activeSheet$.pipe(
|
|
@@ -1441,7 +1441,7 @@ let Ot = class extends ie {
|
|
|
1441
1441
|
});
|
|
1442
1442
|
}
|
|
1443
1443
|
_initViewPermissionChange() {
|
|
1444
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1444
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(x.UNIVER_SHEET), t = this._userManagerService.currentUser$;
|
|
1445
1445
|
this.disposeWithMe(
|
|
1446
1446
|
vt([i, t]).pipe(
|
|
1447
1447
|
_e(([e, n]) => e ? e.activeSheet$.pipe(
|
|
@@ -1479,7 +1479,7 @@ let Ot = class extends ie {
|
|
|
1479
1479
|
},
|
|
1480
1480
|
complete: () => {
|
|
1481
1481
|
this._drawingManagerService.setDrawingVisible(!0);
|
|
1482
|
-
const e = this._univerInstanceService.getCurrentUnitForType(
|
|
1482
|
+
const e = this._univerInstanceService.getCurrentUnitForType(x.UNIVER_SHEET), n = e == null ? void 0 : e.getActiveSheet(), r = e == null ? void 0 : e.getUnitId(), s = n == null ? void 0 : n.getSheetId();
|
|
1483
1483
|
if (!r || !s)
|
|
1484
1484
|
return;
|
|
1485
1485
|
const o = this._drawingManagerService.getDrawingData(r, s), a = Object.values(o);
|
|
@@ -1489,7 +1489,7 @@ let Ot = class extends ie {
|
|
|
1489
1489
|
);
|
|
1490
1490
|
}
|
|
1491
1491
|
_initEditPermissionChange() {
|
|
1492
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1492
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(x.UNIVER_SHEET), t = this._userManagerService.currentUser$;
|
|
1493
1493
|
this.disposeWithMe(
|
|
1494
1494
|
vt([i, t]).pipe(
|
|
1495
1495
|
_e(([e, n]) => e ? e.activeSheet$.pipe(
|
|
@@ -1528,7 +1528,7 @@ let Ot = class extends ie {
|
|
|
1528
1528
|
}), r.clearSelectedObjects());
|
|
1529
1529
|
},
|
|
1530
1530
|
complete: () => {
|
|
1531
|
-
const e = this._univerInstanceService.getCurrentUnitForType(
|
|
1531
|
+
const e = this._univerInstanceService.getCurrentUnitForType(x.UNIVER_SHEET);
|
|
1532
1532
|
if (!e)
|
|
1533
1533
|
return;
|
|
1534
1534
|
const n = e.getUnitId(), r = e.getActiveSheet();
|
|
@@ -1546,15 +1546,15 @@ let Ot = class extends ie {
|
|
|
1546
1546
|
);
|
|
1547
1547
|
}
|
|
1548
1548
|
};
|
|
1549
|
-
Ot =
|
|
1549
|
+
Ot = Ns([
|
|
1550
1550
|
Ze(0, se),
|
|
1551
1551
|
Ze(1, q),
|
|
1552
1552
|
Ze(2, Fr),
|
|
1553
1553
|
Ze(3, Se),
|
|
1554
1554
|
Ze(4, A(Lr))
|
|
1555
1555
|
], Ot);
|
|
1556
|
-
var
|
|
1557
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1556
|
+
var ks = Object.getOwnPropertyDescriptor, Ws = (i, t, e, n) => {
|
|
1557
|
+
for (var r = n > 1 ? void 0 : n ? ks(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
1558
1558
|
(o = i[s]) && (r = o(r) || r);
|
|
1559
1559
|
return r;
|
|
1560
1560
|
}, De = (i, t) => (e, n) => t(e, n, i);
|
|
@@ -1570,18 +1570,18 @@ function Dr(i, t, e, n, r, s = !1) {
|
|
|
1570
1570
|
absolute: m
|
|
1571
1571
|
};
|
|
1572
1572
|
const { left: p, right: f, top: _, bottom: S } = i;
|
|
1573
|
-
let { top:
|
|
1574
|
-
const { boundsOfViewArea: w, scrollDirectionResponse: y } = r || {}, { rowHeaderWidth:
|
|
1573
|
+
let { top: I, left: b, viewportScrollX: v, viewportScrollY: D } = d;
|
|
1574
|
+
const { boundsOfViewArea: w, scrollDirectionResponse: y } = r || {}, { rowHeaderWidth: C, columnHeaderHeight: E } = e, T = {
|
|
1575
1575
|
top: s ? 0 : E,
|
|
1576
|
-
left: s ? 0 :
|
|
1576
|
+
left: s ? 0 : C
|
|
1577
1577
|
};
|
|
1578
1578
|
w && (Re.isDefine(T.top) && (T.top = w.top), Re.isDefine(T.left) && (T.left = w.left)), y === "HORIZONTAL" && (D = 0), y === "VERTICAL" && (v = 0);
|
|
1579
1579
|
let M = 0, R = 0;
|
|
1580
|
-
const N = e.rowStartY(l - h) + E,
|
|
1580
|
+
const N = e.rowStartY(l - h) + E, F = e.colStartX(c - g) + C, Q = e.rowStartY(l) + E, H = e.colStartX(c) + C;
|
|
1581
1581
|
if (g === 0)
|
|
1582
1582
|
m.left = !1, M = (p - v) * o, R = (f - v) * o;
|
|
1583
1583
|
else {
|
|
1584
|
-
const k = p - (
|
|
1584
|
+
const k = p - (F - C), ce = f - (F - C);
|
|
1585
1585
|
f < H ? (M = k * o, R = ce * o) : p <= H && f >= H ? (M = k * o, R = Math.max(b, (f - v) * o)) : p > H && (m.left = !1, M = Math.max((p - v) * o, b), R = Math.max((f - v) * o, b));
|
|
1586
1586
|
}
|
|
1587
1587
|
let X = 0, Y = 0;
|
|
@@ -1589,7 +1589,7 @@ function Dr(i, t, e, n, r, s = !1) {
|
|
|
1589
1589
|
m.top = !1, X = (_ - D) * a, Y = (S - D) * a;
|
|
1590
1590
|
else {
|
|
1591
1591
|
const k = _ - (N - E), ce = S - (N - E);
|
|
1592
|
-
S < Q ? (X = k * a, Y = ce * a) : _ <= Q && S >= Q ? (X = k * a, Y = Math.max(
|
|
1592
|
+
S < Q ? (X = k * a, Y = ce * a) : _ <= Q && S >= Q ? (X = k * a, Y = Math.max(I, (S - D) * a)) : _ > Q && (m.top = !1, X = Math.max((_ - D) * a, I), Y = Math.max((S - D) * a, I));
|
|
1593
1593
|
}
|
|
1594
1594
|
return M = Math.max(M, T.left), X = Math.max(X, T.top), R = Math.max(R, T.left), Y = Math.max(Y, T.top), {
|
|
1595
1595
|
left: M,
|
|
@@ -1633,7 +1633,7 @@ let tt = class extends ie {
|
|
|
1633
1633
|
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();
|
|
1634
1634
|
}
|
|
1635
1635
|
_bindScrollEvent() {
|
|
1636
|
-
this._lifecycleService.lifecycle$.pipe(
|
|
1636
|
+
this._lifecycleService.lifecycle$.pipe(Gi((t) => t === Gr.Rendered), Xi(1)).subscribe(() => {
|
|
1637
1637
|
this._scrollUpdateListener();
|
|
1638
1638
|
});
|
|
1639
1639
|
}
|
|
@@ -1659,7 +1659,7 @@ let tt = class extends ie {
|
|
|
1659
1659
|
this._drawingManagerService.add$.subscribe((t) => {
|
|
1660
1660
|
t.forEach((e) => {
|
|
1661
1661
|
var K;
|
|
1662
|
-
const { unitId: n, subUnitId: r, drawingId: s } = e, o = ae(this._univerInstanceService, { unitId: n, subUnitId: r }), a = this._drawingManagerService.getDrawingByParam(e), d = this._univerInstanceService.getUnit(n,
|
|
1662
|
+
const { unitId: n, subUnitId: r, drawingId: s } = e, o = ae(this._univerInstanceService, { unitId: n, subUnitId: r }), a = this._drawingManagerService.getDrawingByParam(e), d = this._univerInstanceService.getUnit(n, x.UNIVER_SHEET);
|
|
1663
1663
|
if (!d)
|
|
1664
1664
|
return;
|
|
1665
1665
|
const u = d.getActiveSheet().getSheetId();
|
|
@@ -1679,15 +1679,15 @@ let tt = class extends ie {
|
|
|
1679
1679
|
return !0;
|
|
1680
1680
|
if (u !== r)
|
|
1681
1681
|
return;
|
|
1682
|
-
const { left: _, top: S, width:
|
|
1682
|
+
const { left: _, top: S, width: I, height: b, angle: v, flipX: D, flipY: w, skewX: y, skewY: C } = l, E = Ie({ unitId: n, subUnitId: r, drawingId: s }), T = p.getObject(E);
|
|
1683
1683
|
if (T != null) {
|
|
1684
|
-
T.transformByState({ left: _, top: S, width:
|
|
1684
|
+
T.transformByState({ left: _, top: S, width: I, height: b, angle: v, flipX: D, flipY: w, skewX: y, skewY: C });
|
|
1685
1685
|
return;
|
|
1686
1686
|
}
|
|
1687
1687
|
const M = {
|
|
1688
1688
|
left: _,
|
|
1689
1689
|
top: S,
|
|
1690
|
-
width:
|
|
1690
|
+
width: I,
|
|
1691
1691
|
height: b,
|
|
1692
1692
|
zIndex: this._drawingManagerService.getDrawingOrder(n, r).length - 1
|
|
1693
1693
|
}, R = g === j.DRAWING_CHART;
|
|
@@ -1697,8 +1697,8 @@ let tt = class extends ie {
|
|
|
1697
1697
|
}
|
|
1698
1698
|
const N = new Ne(E, M);
|
|
1699
1699
|
R && N.setObjectType(yn.CHART), p.addObject(N, Yt), a.allowTransform !== !1 && p.attachTransformerTo(N);
|
|
1700
|
-
const
|
|
1701
|
-
dispose:
|
|
1700
|
+
const F = new wt(), Q = fe(N, m.renderUnit.scene, c.skeleton, o.worksheet), H = new je(Q), X = {
|
|
1701
|
+
dispose: F,
|
|
1702
1702
|
rect: N,
|
|
1703
1703
|
position$: H,
|
|
1704
1704
|
unitId: n,
|
|
@@ -1730,9 +1730,9 @@ let tt = class extends ie {
|
|
|
1730
1730
|
k
|
|
1731
1731
|
);
|
|
1732
1732
|
});
|
|
1733
|
-
|
|
1733
|
+
F.add(() => {
|
|
1734
1734
|
this._canvasFloatDomService.removeFloatDom(s);
|
|
1735
|
-
}), Y &&
|
|
1735
|
+
}), Y && F.add(Y), this._domLayerInfoMap.set(s, X);
|
|
1736
1736
|
});
|
|
1737
1737
|
})
|
|
1738
1738
|
), this.disposeWithMe(
|
|
@@ -1761,7 +1761,7 @@ let tt = class extends ie {
|
|
|
1761
1761
|
});
|
|
1762
1762
|
};
|
|
1763
1763
|
this.disposeWithMe(
|
|
1764
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1764
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(x.UNIVER_SHEET).pipe(
|
|
1765
1765
|
_e((e) => e ? e.activeSheet$ : Nn(null)),
|
|
1766
1766
|
Me((e) => {
|
|
1767
1767
|
if (!e) return null;
|
|
@@ -1782,7 +1782,7 @@ let tt = class extends ie {
|
|
|
1782
1782
|
Array.from(this._domLayerInfoMap.values()).filter((o) => o.unitId === r).map((o) => o.subUnitId).forEach((o) => {
|
|
1783
1783
|
t(r, o);
|
|
1784
1784
|
});
|
|
1785
|
-
} else if (e.id ===
|
|
1785
|
+
} else if (e.id === zi.id) {
|
|
1786
1786
|
const { unitId: n, subUnitId: r } = e.params;
|
|
1787
1787
|
t(n, r);
|
|
1788
1788
|
}
|
|
@@ -1916,7 +1916,7 @@ let tt = class extends ie {
|
|
|
1916
1916
|
const { componentKey: l, data: g, allowTransform: h = !0 } = e, m = r != null ? r : bt(), { position: p, position$: f } = this._createRangePositionObserver(t, u, c.skeleton);
|
|
1917
1917
|
if (this._getPosition(p, o) == null)
|
|
1918
1918
|
return;
|
|
1919
|
-
const S = d.scene, { scaleX:
|
|
1919
|
+
const S = d.scene, { scaleX: I } = S.getAncestorScale(), b = Ct(p, n, I), v = {
|
|
1920
1920
|
unitId: o,
|
|
1921
1921
|
subUnitId: a,
|
|
1922
1922
|
drawingId: m,
|
|
@@ -1932,13 +1932,13 @@ let tt = class extends ie {
|
|
|
1932
1932
|
allowTransform: h
|
|
1933
1933
|
};
|
|
1934
1934
|
{
|
|
1935
|
-
const { unitId:
|
|
1935
|
+
const { unitId: C, subUnitId: E, drawingId: T } = v, M = ae(this._univerInstanceService, { unitId: C, subUnitId: E }), R = v, N = this._univerInstanceService.getUnit(C, x.UNIVER_SHEET);
|
|
1936
1936
|
if (!N)
|
|
1937
1937
|
return;
|
|
1938
|
-
const
|
|
1938
|
+
const F = N.getActiveSheet().getSheetId();
|
|
1939
1939
|
if (!R || !M)
|
|
1940
1940
|
return;
|
|
1941
|
-
const Q = (w = this._renderManagerService.getRenderById(
|
|
1941
|
+
const Q = (w = this._renderManagerService.getRenderById(C)) == null ? void 0 : w.with(V);
|
|
1942
1942
|
if (!Q)
|
|
1943
1943
|
return;
|
|
1944
1944
|
const H = Q.getWorksheetSkeleton(E);
|
|
@@ -1947,13 +1947,13 @@ let tt = class extends ie {
|
|
|
1947
1947
|
const { transform: X, drawingType: Y, data: K } = R;
|
|
1948
1948
|
if (Y !== j.DRAWING_DOM && Y !== j.DRAWING_CHART)
|
|
1949
1949
|
return;
|
|
1950
|
-
const k = this._getSceneAndTransformerByDrawingSearch(
|
|
1950
|
+
const k = this._getSceneAndTransformerByDrawingSearch(C);
|
|
1951
1951
|
if (k == null)
|
|
1952
1952
|
return;
|
|
1953
1953
|
const { scene: ce, canvas: ye } = k;
|
|
1954
|
-
if (X == null ||
|
|
1954
|
+
if (X == null || F !== E)
|
|
1955
1955
|
return;
|
|
1956
|
-
const { left: ot, top: at, width: ct, height: dt, angle: $t, flipX: xt, flipY: lt, skewX: ut, skewY: Ee } = X, ht = Ie({ unitId:
|
|
1956
|
+
const { left: ot, top: at, width: ct, height: dt, angle: $t, flipX: xt, flipY: lt, skewX: ut, skewY: Ee } = X, ht = Ie({ unitId: C, subUnitId: E, drawingId: T }), le = ce.getObject(ht);
|
|
1957
1957
|
if (le != null) {
|
|
1958
1958
|
le.transformByState({ left: ot, top: at, width: ct, height: dt, angle: $t, flipX: xt, flipY: lt, skewX: ut, skewY: Ee });
|
|
1959
1959
|
return;
|
|
@@ -1964,7 +1964,7 @@ let tt = class extends ie {
|
|
|
1964
1964
|
top: at,
|
|
1965
1965
|
width: ct,
|
|
1966
1966
|
height: dt,
|
|
1967
|
-
zIndex: this._drawingManagerService.getDrawingOrder(
|
|
1967
|
+
zIndex: this._drawingManagerService.getDrawingOrder(C, E).length - 1
|
|
1968
1968
|
}, Te = Y === j.DRAWING_CHART;
|
|
1969
1969
|
if (Te) {
|
|
1970
1970
|
const W = K ? K.backgroundColor : "white";
|
|
@@ -1982,9 +1982,9 @@ let tt = class extends ie {
|
|
|
1982
1982
|
rect: ue,
|
|
1983
1983
|
boundsOfViewArea: ft,
|
|
1984
1984
|
domAnchor: n,
|
|
1985
|
-
unitId:
|
|
1985
|
+
unitId: C,
|
|
1986
1986
|
subUnitId: E
|
|
1987
|
-
},
|
|
1987
|
+
}, B = fe(ue, k.renderUnit.scene, H.skeleton, M.worksheet, ge), Ue = new je(B);
|
|
1988
1988
|
ge.position$ = Ue;
|
|
1989
1989
|
let Ve = {
|
|
1990
1990
|
position$: Ue,
|
|
@@ -2000,7 +2000,7 @@ let tt = class extends ie {
|
|
|
2000
2000
|
ye.dispatchEvent(new WheelEvent(W.type, W));
|
|
2001
2001
|
},
|
|
2002
2002
|
data: K,
|
|
2003
|
-
unitId:
|
|
2003
|
+
unitId: C
|
|
2004
2004
|
};
|
|
2005
2005
|
e.eventPassThrough && (Ve = {
|
|
2006
2006
|
...Ve,
|
|
@@ -2026,16 +2026,16 @@ let tt = class extends ie {
|
|
|
2026
2026
|
left: p.absolute.left,
|
|
2027
2027
|
top: p.absolute.top
|
|
2028
2028
|
}
|
|
2029
|
-
}, n), Ur = Ie({ unitId:
|
|
2029
|
+
}, n), Ur = Ie({ unitId: C, subUnitId: E, drawingId: T }), Pr = new Ne(Ur, {
|
|
2030
2030
|
left: un.startX,
|
|
2031
2031
|
top: un.startY,
|
|
2032
2032
|
width: (fn = n.width) != null ? fn : W.width,
|
|
2033
2033
|
height: (mn = n.height) != null ? mn : W.height,
|
|
2034
|
-
zIndex: this._drawingManagerService.getDrawingOrder(
|
|
2034
|
+
zIndex: this._drawingManagerService.getDrawingOrder(C, E).length - 1
|
|
2035
2035
|
}), Ar = fe(Pr, k.renderUnit.scene, H.skeleton, M.worksheet, ge);
|
|
2036
2036
|
Ue.next(Ar);
|
|
2037
2037
|
}));
|
|
2038
|
-
const He = (y = this._renderManagerService.getRenderById(
|
|
2038
|
+
const He = (y = this._renderManagerService.getRenderById(C)) == null ? void 0 : y.with(V);
|
|
2039
2039
|
He == null || He.currentSkeleton$.subscribe((W) => {
|
|
2040
2040
|
W && H.sheetId !== W.sheetId && this._removeDom(m, !0);
|
|
2041
2041
|
});
|
|
@@ -2079,7 +2079,7 @@ let tt = class extends ie {
|
|
|
2079
2079
|
}, u, c.skeleton), _ = p;
|
|
2080
2080
|
if (_.startY = 0, this._getPosition(p, o) == null)
|
|
2081
2081
|
return;
|
|
2082
|
-
const
|
|
2082
|
+
const I = {
|
|
2083
2083
|
unitId: o,
|
|
2084
2084
|
subUnitId: a,
|
|
2085
2085
|
drawingId: m,
|
|
@@ -2095,7 +2095,7 @@ let tt = class extends ie {
|
|
|
2095
2095
|
allowTransform: h
|
|
2096
2096
|
};
|
|
2097
2097
|
{
|
|
2098
|
-
const { unitId: w, subUnitId: y, drawingId:
|
|
2098
|
+
const { unitId: w, subUnitId: y, drawingId: C } = I, E = ae(this._univerInstanceService, { unitId: w, subUnitId: y }), T = I, M = this._univerInstanceService.getUnit(w, x.UNIVER_SHEET);
|
|
2099
2099
|
if (!M)
|
|
2100
2100
|
return;
|
|
2101
2101
|
const R = M.getActiveSheet().getSheetId();
|
|
@@ -2104,8 +2104,8 @@ let tt = class extends ie {
|
|
|
2104
2104
|
const N = (v = this._renderManagerService.getRenderById(w)) == null ? void 0 : v.with(V);
|
|
2105
2105
|
if (!N)
|
|
2106
2106
|
return;
|
|
2107
|
-
const
|
|
2108
|
-
if (!
|
|
2107
|
+
const F = N.getWorksheetSkeleton(y);
|
|
2108
|
+
if (!F)
|
|
2109
2109
|
return;
|
|
2110
2110
|
const { transform: Q, data: H } = T, X = this._getSceneAndTransformerByDrawingSearch(w);
|
|
2111
2111
|
if (X == null)
|
|
@@ -2113,7 +2113,7 @@ let tt = class extends ie {
|
|
|
2113
2113
|
const { scene: Y, canvas: K } = X;
|
|
2114
2114
|
if (Q == null || R !== y)
|
|
2115
2115
|
return;
|
|
2116
|
-
const { left: k, top: ce, width: ye, height: ot, angle: at, flipX: ct, flipY: dt, skewX: $t, skewY: xt } = Q, lt = Ie({ unitId: w, subUnitId: y, drawingId:
|
|
2116
|
+
const { left: k, top: ce, width: ye, height: ot, angle: at, flipX: ct, flipY: dt, skewX: $t, skewY: xt } = Q, lt = Ie({ unitId: w, subUnitId: y, drawingId: C }), ut = Y.getObject(lt);
|
|
2117
2117
|
if (ut != null) {
|
|
2118
2118
|
ut.transformByState({ left: k, top: ce, width: ye, height: ot, angle: at, flipX: ct, flipY: dt, skewX: $t, skewY: xt });
|
|
2119
2119
|
return;
|
|
@@ -2153,11 +2153,11 @@ let tt = class extends ie {
|
|
|
2153
2153
|
domAnchor: n,
|
|
2154
2154
|
scrollDirectionResponse: "HORIZONTAL"
|
|
2155
2155
|
/* HORIZONTAL */
|
|
2156
|
-
}, gt = fe(le, X.renderUnit.scene,
|
|
2156
|
+
}, gt = fe(le, X.renderUnit.scene, F.skeleton, E.worksheet, he), Oe = new je(gt);
|
|
2157
2157
|
he.position$ = Oe;
|
|
2158
2158
|
let Xe = {
|
|
2159
2159
|
position$: Oe,
|
|
2160
|
-
id:
|
|
2160
|
+
id: C,
|
|
2161
2161
|
componentKey: T.componentKey,
|
|
2162
2162
|
onPointerDown: () => {
|
|
2163
2163
|
},
|
|
@@ -2165,57 +2165,57 @@ let tt = class extends ie {
|
|
|
2165
2165
|
},
|
|
2166
2166
|
onPointerUp: () => {
|
|
2167
2167
|
},
|
|
2168
|
-
onWheel: (
|
|
2169
|
-
K.dispatchEvent(new WheelEvent(
|
|
2168
|
+
onWheel: (B) => {
|
|
2169
|
+
K.dispatchEvent(new WheelEvent(B.type, B));
|
|
2170
2170
|
},
|
|
2171
2171
|
data: H,
|
|
2172
2172
|
unitId: w
|
|
2173
2173
|
};
|
|
2174
2174
|
e.eventPassThrough && (Xe = {
|
|
2175
2175
|
...Xe,
|
|
2176
|
-
onPointerDown: (
|
|
2177
|
-
K.dispatchEvent(new PointerEvent(
|
|
2176
|
+
onPointerDown: (B) => {
|
|
2177
|
+
K.dispatchEvent(new PointerEvent(B.type, B));
|
|
2178
2178
|
},
|
|
2179
|
-
onPointerMove: (
|
|
2180
|
-
K.dispatchEvent(new PointerEvent(
|
|
2179
|
+
onPointerMove: (B) => {
|
|
2180
|
+
K.dispatchEvent(new PointerEvent(B.type, B));
|
|
2181
2181
|
},
|
|
2182
|
-
onPointerUp: (
|
|
2183
|
-
K.dispatchEvent(new PointerEvent(
|
|
2182
|
+
onPointerUp: (B) => {
|
|
2183
|
+
K.dispatchEvent(new PointerEvent(B.type, B));
|
|
2184
2184
|
}
|
|
2185
2185
|
}), this._canvasFloatDomService.addFloatDom(Xe);
|
|
2186
2186
|
const ft = le.onTransformChange$.subscribeEvent(() => {
|
|
2187
|
-
const
|
|
2187
|
+
const B = fe(le, X.renderUnit.scene, F.skeleton, E.worksheet, he);
|
|
2188
2188
|
Oe.next(
|
|
2189
|
-
|
|
2189
|
+
B
|
|
2190
2190
|
);
|
|
2191
2191
|
});
|
|
2192
|
-
this.disposeWithMe(f.subscribe((
|
|
2192
|
+
this.disposeWithMe(f.subscribe((B) => {
|
|
2193
2193
|
const Ue = Ct({
|
|
2194
|
-
startX:
|
|
2194
|
+
startX: B.startX,
|
|
2195
2195
|
startY: 0,
|
|
2196
|
-
endX:
|
|
2197
|
-
endY:
|
|
2196
|
+
endX: B.endX,
|
|
2197
|
+
endY: B.endY,
|
|
2198
2198
|
width: n.width,
|
|
2199
2199
|
height: n.height,
|
|
2200
2200
|
absolute: {
|
|
2201
2201
|
left: p.absolute.left,
|
|
2202
2202
|
top: p.absolute.top
|
|
2203
2203
|
}
|
|
2204
|
-
}, n), Ve = Ie({ unitId: w, subUnitId: y, drawingId:
|
|
2204
|
+
}, n), Ve = Ie({ unitId: w, subUnitId: y, drawingId: C }), He = new Ne(Ve, {
|
|
2205
2205
|
left: Ue.startX,
|
|
2206
2206
|
top: 0,
|
|
2207
2207
|
width: n.width,
|
|
2208
2208
|
height: n.height,
|
|
2209
2209
|
zIndex: this._drawingManagerService.getDrawingOrder(w, y).length - 1
|
|
2210
|
-
}), mt = fe(He, X.renderUnit.scene,
|
|
2210
|
+
}), mt = fe(He, X.renderUnit.scene, F.skeleton, E.worksheet, he);
|
|
2211
2211
|
Oe.next(mt);
|
|
2212
2212
|
}));
|
|
2213
2213
|
const ge = (D = this._renderManagerService.getRenderById(w)) == null ? void 0 : D.with(V);
|
|
2214
|
-
ge == null || ge.currentSkeleton$.subscribe((
|
|
2215
|
-
|
|
2214
|
+
ge == null || ge.currentSkeleton$.subscribe((B) => {
|
|
2215
|
+
B && c.sheetId !== B.sheetId && this._removeDom(m, !0);
|
|
2216
2216
|
}), ee.add(() => {
|
|
2217
|
-
this._canvasFloatDomService.removeFloatDom(
|
|
2218
|
-
}), ft && ee.add(ft), this._domLayerInfoMap.set(
|
|
2217
|
+
this._canvasFloatDomService.removeFloatDom(C);
|
|
2218
|
+
}), ft && ee.add(ft), this._domLayerInfoMap.set(C, he);
|
|
2219
2219
|
}
|
|
2220
2220
|
return {
|
|
2221
2221
|
id: m,
|
|
@@ -2242,11 +2242,11 @@ let tt = class extends ie {
|
|
|
2242
2242
|
a.next(f), u.next(_);
|
|
2243
2243
|
}, l = new wt();
|
|
2244
2244
|
l.add(e.engine.clientRect$.subscribe(() => c())), l.add(this._commandService.onCommandExecuted((f) => {
|
|
2245
|
-
if (f.id ===
|
|
2245
|
+
if (f.id === Ki.id && f.params.rowsAutoHeightInfo.findIndex((S) => S.row === r) > -1) {
|
|
2246
2246
|
c();
|
|
2247
2247
|
return;
|
|
2248
2248
|
}
|
|
2249
|
-
(
|
|
2249
|
+
(Zi.indexOf(f.id) > -1 || f.id === Oi.id || f.id === On.id) && c();
|
|
2250
2250
|
}));
|
|
2251
2251
|
const g = (f, _) => {
|
|
2252
2252
|
r = f, s = _, c();
|
|
@@ -2290,12 +2290,12 @@ let tt = class extends ie {
|
|
|
2290
2290
|
};
|
|
2291
2291
|
}
|
|
2292
2292
|
};
|
|
2293
|
-
tt =
|
|
2293
|
+
tt = Ws([
|
|
2294
2294
|
De(0, A(q)),
|
|
2295
2295
|
De(1, Se),
|
|
2296
2296
|
De(2, A(G)),
|
|
2297
2297
|
De(3, se),
|
|
2298
|
-
De(4, A(
|
|
2298
|
+
De(4, A(ji)),
|
|
2299
2299
|
De(5, oe),
|
|
2300
2300
|
De(6, A(Yr))
|
|
2301
2301
|
], tt);
|
|
@@ -2345,8 +2345,8 @@ function Dt(i, t) {
|
|
|
2345
2345
|
const e = Number.parseFloat(i);
|
|
2346
2346
|
return t * e / 100;
|
|
2347
2347
|
}
|
|
2348
|
-
const
|
|
2349
|
-
const { floatDomInfos: t, scene: e, skeleton: n, worksheet: r } = i, s =
|
|
2348
|
+
const js = (i) => {
|
|
2349
|
+
const { floatDomInfos: t, scene: e, skeleton: n, worksheet: r } = i, s = as(() => t.map((o) => {
|
|
2350
2350
|
const { width: a, height: d, angle: u, left: c, top: l } = o.transform, g = Dr(
|
|
2351
2351
|
{
|
|
2352
2352
|
left: c != null ? c : 0,
|
|
@@ -2386,10 +2386,10 @@ const ks = (i) => {
|
|
|
2386
2386
|
};
|
|
2387
2387
|
return [o.drawingId, f];
|
|
2388
2388
|
}), [t, e, n, r]);
|
|
2389
|
-
return /* @__PURE__ */ Z("div", { style: { position: "absolute", top: 0, left: 0 }, children: s.map(([o, a]) => /* @__PURE__ */ Z(
|
|
2389
|
+
return /* @__PURE__ */ Z("div", { style: { position: "absolute", top: 0, left: 0 }, children: s.map(([o, a]) => /* @__PURE__ */ Z(Bi, { layer: a, id: o, position: a.position }, o)) });
|
|
2390
2390
|
};
|
|
2391
|
-
var
|
|
2392
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
2391
|
+
var Bs = Object.getOwnPropertyDescriptor, $s = (i, t, e, n) => {
|
|
2392
|
+
for (var r = n > 1 ? void 0 : n ? Bs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
2393
2393
|
(o = i[s]) && (r = o(r) || r);
|
|
2394
2394
|
return r;
|
|
2395
2395
|
}, be = (i, t) => (e, n) => t(e, n, i);
|
|
@@ -2460,7 +2460,7 @@ let Ut = class extends ie {
|
|
|
2460
2460
|
};
|
|
2461
2461
|
}
|
|
2462
2462
|
return null;
|
|
2463
|
-
}).filter(Boolean), d =
|
|
2463
|
+
}).filter(Boolean), d = $i(js, this._injector);
|
|
2464
2464
|
return wi(
|
|
2465
2465
|
/* @__PURE__ */ Z(d, { floatDomInfos: a, scene: t.scene, skeleton: t.skeleton, worksheet: t.worksheet }),
|
|
2466
2466
|
t.root
|
|
@@ -2474,8 +2474,8 @@ let Ut = class extends ie {
|
|
|
2474
2474
|
);
|
|
2475
2475
|
}
|
|
2476
2476
|
};
|
|
2477
|
-
Ut =
|
|
2478
|
-
be(0, A(
|
|
2477
|
+
Ut = $s([
|
|
2478
|
+
be(0, A(Ui)),
|
|
2479
2479
|
be(1, A(Gn)),
|
|
2480
2480
|
be(2, se),
|
|
2481
2481
|
be(3, q),
|
|
@@ -2483,12 +2483,12 @@ Ut = js([
|
|
|
2483
2483
|
be(5, A(zn)),
|
|
2484
2484
|
be(6, A(Ye))
|
|
2485
2485
|
], Ut);
|
|
2486
|
-
var
|
|
2487
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
2486
|
+
var xs = Object.getOwnPropertyDescriptor, Fs = (i, t, e, n) => {
|
|
2487
|
+
for (var r = n > 1 ? void 0 : n ? xs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
2488
2488
|
(o = i[s]) && (r = o(r) || r);
|
|
2489
2489
|
return r;
|
|
2490
2490
|
}, pe = (i, t) => (e, n) => t(e, n, i);
|
|
2491
|
-
const
|
|
2491
|
+
const Ls = [
|
|
2492
2492
|
Kn.id,
|
|
2493
2493
|
Zn.id,
|
|
2494
2494
|
Jn.id,
|
|
@@ -2508,13 +2508,13 @@ const xs = [
|
|
|
2508
2508
|
dr.id,
|
|
2509
2509
|
lr.id,
|
|
2510
2510
|
ur.id
|
|
2511
|
-
],
|
|
2512
|
-
Ki.id,
|
|
2513
|
-
Zi.id,
|
|
2511
|
+
], Ys = [
|
|
2514
2512
|
Ji.id,
|
|
2515
2513
|
qi.id,
|
|
2516
2514
|
Qi.id,
|
|
2517
|
-
es.id
|
|
2515
|
+
es.id,
|
|
2516
|
+
ts.id,
|
|
2517
|
+
ns.id
|
|
2518
2518
|
];
|
|
2519
2519
|
let sn = class extends ie {
|
|
2520
2520
|
constructor(i, t, e, n, r, s, o, a, d) {
|
|
@@ -2524,7 +2524,7 @@ let sn = class extends ie {
|
|
|
2524
2524
|
this.disposeWithMe(
|
|
2525
2525
|
this._sheetInterceptorService.interceptCommand({
|
|
2526
2526
|
getMutations: (i) => {
|
|
2527
|
-
if (!
|
|
2527
|
+
if (!Ls.includes(i.id))
|
|
2528
2528
|
return { redos: [], undos: [] };
|
|
2529
2529
|
if (i.params == null)
|
|
2530
2530
|
return { redos: [], undos: [] };
|
|
@@ -2612,16 +2612,16 @@ let sn = class extends ie {
|
|
|
2612
2612
|
updateDrawings: n,
|
|
2613
2613
|
deleteDrawings: r
|
|
2614
2614
|
};
|
|
2615
|
-
const { startRow: _, endRow: S, startColumn:
|
|
2615
|
+
const { startRow: _, endRow: S, startColumn: I, endColumn: b } = i;
|
|
2616
2616
|
let v = null, D = null;
|
|
2617
2617
|
if (t === 0 && h >= _ && p <= S)
|
|
2618
|
-
if (m >=
|
|
2618
|
+
if (m >= I && f <= b)
|
|
2619
2619
|
r.push({ unitId: d, subUnitId: u, drawingId: c });
|
|
2620
2620
|
else {
|
|
2621
|
-
const w = this._shrinkCol(s, a,
|
|
2621
|
+
const w = this._shrinkCol(s, a, I, b, o);
|
|
2622
2622
|
v = w == null ? void 0 : w.newSheetTransform, D = w == null ? void 0 : w.newTransform;
|
|
2623
2623
|
}
|
|
2624
|
-
else if (t === 1 && m >=
|
|
2624
|
+
else if (t === 1 && m >= I && f <= b)
|
|
2625
2625
|
if (h >= _ && p <= S)
|
|
2626
2626
|
r.push({ unitId: d, subUnitId: u, drawingId: c });
|
|
2627
2627
|
else {
|
|
@@ -2632,7 +2632,7 @@ let sn = class extends ie {
|
|
|
2632
2632
|
const w = this._expandRow(s, a, _, S, o);
|
|
2633
2633
|
v = w == null ? void 0 : w.newSheetTransform, D = w == null ? void 0 : w.newTransform;
|
|
2634
2634
|
} else if (t === 3) {
|
|
2635
|
-
const w = this._expandCol(s, a,
|
|
2635
|
+
const w = this._expandCol(s, a, I, b, o);
|
|
2636
2636
|
v = w == null ? void 0 : w.newSheetTransform, D = w == null ? void 0 : w.newTransform;
|
|
2637
2637
|
}
|
|
2638
2638
|
if (v != null && D != null) {
|
|
@@ -2642,7 +2642,7 @@ let sn = class extends ie {
|
|
|
2642
2642
|
return { updateDrawings: n, deleteDrawings: r };
|
|
2643
2643
|
}
|
|
2644
2644
|
_remainDrawingSize(i, t, e) {
|
|
2645
|
-
const n =
|
|
2645
|
+
const n = $({ ...i }, this._selectionRenderService);
|
|
2646
2646
|
n != null && t.push({
|
|
2647
2647
|
...e,
|
|
2648
2648
|
sheetTransform: n
|
|
@@ -2656,30 +2656,30 @@ let sn = class extends ie {
|
|
|
2656
2656
|
if (m === O.None)
|
|
2657
2657
|
this._remainDrawingSize(h, r, l);
|
|
2658
2658
|
else {
|
|
2659
|
-
const { from: p, to: f } = g, { row: _, column: S } = p, { row:
|
|
2659
|
+
const { from: p, to: f } = g, { row: _, column: S } = p, { row: I, column: b } = f;
|
|
2660
2660
|
for (let v = 0; v < e.length; v++) {
|
|
2661
|
-
const D = e[v], { startRow: w, endRow: y, startColumn:
|
|
2662
|
-
if (b <
|
|
2661
|
+
const D = e[v], { startRow: w, endRow: y, startColumn: C, endColumn: E } = D;
|
|
2662
|
+
if (b < C)
|
|
2663
2663
|
continue;
|
|
2664
2664
|
if (m === O.Position) {
|
|
2665
2665
|
let R = null, N = null;
|
|
2666
|
-
if (S >=
|
|
2667
|
-
const
|
|
2668
|
-
if (
|
|
2666
|
+
if (S >= C && S <= E) {
|
|
2667
|
+
const F = this._skeletonManagerService.attachRangeWithCoord({ startColumn: S, endColumn: E, startRow: p.row, endRow: f.row });
|
|
2668
|
+
if (F == null)
|
|
2669
2669
|
return;
|
|
2670
|
-
N = { ...h, left:
|
|
2670
|
+
N = { ...h, left: F.startX };
|
|
2671
2671
|
}
|
|
2672
|
-
if (N != null && (R =
|
|
2672
|
+
if (N != null && (R = $(N, this._selectionRenderService), R != null && N != null)) {
|
|
2673
2673
|
r.push({ ...l, sheetTransform: R, transform: N });
|
|
2674
2674
|
break;
|
|
2675
2675
|
}
|
|
2676
2676
|
this._remainDrawingSize(h, r, l);
|
|
2677
2677
|
continue;
|
|
2678
2678
|
}
|
|
2679
|
-
if (S >=
|
|
2679
|
+
if (S >= C && b <= E)
|
|
2680
2680
|
continue;
|
|
2681
2681
|
let T = null, M = null;
|
|
2682
|
-
if (S >=
|
|
2682
|
+
if (S >= C && S <= E) {
|
|
2683
2683
|
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: S, endColumn: E, startRow: p.row, endRow: f.row });
|
|
2684
2684
|
if (R == null)
|
|
2685
2685
|
return;
|
|
@@ -2688,8 +2688,8 @@ let sn = class extends ie {
|
|
|
2688
2688
|
left: (R == null ? void 0 : R.startX) || 0,
|
|
2689
2689
|
width: ((h == null ? void 0 : h.width) || 0) - R.endX + R.startX
|
|
2690
2690
|
};
|
|
2691
|
-
} else if (b >=
|
|
2692
|
-
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn:
|
|
2691
|
+
} else if (b >= C && b <= E) {
|
|
2692
|
+
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: C, endColumn: b, startRow: p.row, endRow: f.row });
|
|
2693
2693
|
if (R == null)
|
|
2694
2694
|
return;
|
|
2695
2695
|
M = {
|
|
@@ -2697,18 +2697,18 @@ let sn = class extends ie {
|
|
|
2697
2697
|
left: R.startX - ((h == null ? void 0 : h.width) || 0)
|
|
2698
2698
|
};
|
|
2699
2699
|
} else {
|
|
2700
|
-
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn:
|
|
2700
|
+
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: C, endColumn: E, startRow: p.row, endRow: f.row });
|
|
2701
2701
|
if (R == null)
|
|
2702
2702
|
return;
|
|
2703
2703
|
if (M = {
|
|
2704
2704
|
...h,
|
|
2705
2705
|
width: ((h == null ? void 0 : h.width) || 0) - R.endX + R.startX
|
|
2706
|
-
}, T =
|
|
2706
|
+
}, T = $(M, this._selectionRenderService), T != null && M != null) {
|
|
2707
2707
|
s.push({ ...l, sheetTransform: T, transform: M });
|
|
2708
2708
|
break;
|
|
2709
2709
|
}
|
|
2710
2710
|
}
|
|
2711
|
-
if (M != null && (T =
|
|
2711
|
+
if (M != null && (T = $(M, this._selectionRenderService)), M != null && T != null) {
|
|
2712
2712
|
r.push({ ...l, sheetTransform: T, transform: M });
|
|
2713
2713
|
break;
|
|
2714
2714
|
} else
|
|
@@ -2750,27 +2750,27 @@ let sn = class extends ie {
|
|
|
2750
2750
|
if (m === O.None)
|
|
2751
2751
|
this._remainDrawingSize(h, r, l);
|
|
2752
2752
|
else {
|
|
2753
|
-
const { from: p, to: f } = g, { row: _, column: S } = p, { row:
|
|
2753
|
+
const { from: p, to: f } = g, { row: _, column: S } = p, { row: I, column: b } = f;
|
|
2754
2754
|
for (let v = 0; v < e.length; v++) {
|
|
2755
|
-
const D = e[v], { startRow: w, endRow: y, startColumn:
|
|
2756
|
-
if (
|
|
2755
|
+
const D = e[v], { startRow: w, endRow: y, startColumn: C, endColumn: E } = D;
|
|
2756
|
+
if (I < w)
|
|
2757
2757
|
continue;
|
|
2758
2758
|
if (m === O.Position) {
|
|
2759
2759
|
let R = null, N = null;
|
|
2760
2760
|
if (_ >= w && _ <= y) {
|
|
2761
|
-
const
|
|
2762
|
-
if (
|
|
2761
|
+
const F = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: f.column, startRow: _, endRow: y });
|
|
2762
|
+
if (F == null)
|
|
2763
2763
|
return;
|
|
2764
|
-
N = { ...h, top:
|
|
2764
|
+
N = { ...h, top: F.startY };
|
|
2765
2765
|
}
|
|
2766
|
-
if (N != null && (R =
|
|
2766
|
+
if (N != null && (R = $(N, this._selectionRenderService), R != null && N != null)) {
|
|
2767
2767
|
r.push({ ...l, sheetTransform: R, transform: N });
|
|
2768
2768
|
break;
|
|
2769
2769
|
}
|
|
2770
2770
|
this._remainDrawingSize(h, r, l);
|
|
2771
2771
|
continue;
|
|
2772
2772
|
}
|
|
2773
|
-
if (_ >= w &&
|
|
2773
|
+
if (_ >= w && I <= y)
|
|
2774
2774
|
continue;
|
|
2775
2775
|
let T = null, M = null;
|
|
2776
2776
|
if (_ >= w && _ <= y) {
|
|
@@ -2782,8 +2782,8 @@ let sn = class extends ie {
|
|
|
2782
2782
|
top: (R == null ? void 0 : R.startY) || 0,
|
|
2783
2783
|
height: ((h == null ? void 0 : h.height) || 0) - R.endY + R.startY
|
|
2784
2784
|
};
|
|
2785
|
-
} else if (
|
|
2786
|
-
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: f.column, startRow: w, endRow:
|
|
2785
|
+
} else if (I >= w && I <= y) {
|
|
2786
|
+
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: f.column, startRow: w, endRow: I });
|
|
2787
2787
|
if (R == null)
|
|
2788
2788
|
return;
|
|
2789
2789
|
M = {
|
|
@@ -2797,12 +2797,12 @@ let sn = class extends ie {
|
|
|
2797
2797
|
if (M = {
|
|
2798
2798
|
...h,
|
|
2799
2799
|
height: ((h == null ? void 0 : h.height) || 0) - R.endY + R.startY
|
|
2800
|
-
}, T =
|
|
2800
|
+
}, T = $(M, this._selectionRenderService), T != null && M != null) {
|
|
2801
2801
|
s.push({ ...l, sheetTransform: T, transform: M });
|
|
2802
2802
|
break;
|
|
2803
2803
|
}
|
|
2804
2804
|
}
|
|
2805
|
-
if (M != null && (T =
|
|
2805
|
+
if (M != null && (T = $(M, this._selectionRenderService)), M != null && T != null) {
|
|
2806
2806
|
r.push({ ...l, sheetTransform: T, transform: M });
|
|
2807
2807
|
break;
|
|
2808
2808
|
} else
|
|
@@ -2832,10 +2832,10 @@ let sn = class extends ie {
|
|
|
2832
2832
|
else {
|
|
2833
2833
|
const { from: l, to: g } = d, { row: h, column: m } = l, { row: p, column: f } = g;
|
|
2834
2834
|
for (let _ = 0; _ < e.length; _++) {
|
|
2835
|
-
const S = e[_], { startRow:
|
|
2836
|
-
if (p <
|
|
2835
|
+
const S = e[_], { startRow: I, endRow: b, startColumn: v, endColumn: D } = S;
|
|
2836
|
+
if (p < I || f < v)
|
|
2837
2837
|
continue;
|
|
2838
|
-
if (c === O.Position && (h <=
|
|
2838
|
+
if (c === O.Position && (h <= I && p >= b || m <= v && f >= D)) {
|
|
2839
2839
|
this._remainDrawingSize(u, s, a);
|
|
2840
2840
|
continue;
|
|
2841
2841
|
}
|
|
@@ -2864,11 +2864,11 @@ let sn = class extends ie {
|
|
|
2864
2864
|
return { unitId: e, subUnitId: n };
|
|
2865
2865
|
}
|
|
2866
2866
|
_moveRangeInterceptor(i) {
|
|
2867
|
-
var
|
|
2867
|
+
var I, b;
|
|
2868
2868
|
const { toRange: t, fromRange: e } = i, n = ae(this._univerInstanceService);
|
|
2869
2869
|
if (!n)
|
|
2870
2870
|
return { redos: [], undos: [] };
|
|
2871
|
-
const { unitId: r, subUnitId: s } = n, o = (b = (
|
|
2871
|
+
const { unitId: r, subUnitId: s } = n, o = (b = (I = this._renderManagerService.getRenderById(r)) == null ? void 0 : I.with(V)) == null ? void 0 : b.getCurrentSkeleton();
|
|
2872
2872
|
if (!o)
|
|
2873
2873
|
return { redos: [], undos: [] };
|
|
2874
2874
|
const a = Vn(o, e);
|
|
@@ -2882,13 +2882,13 @@ let sn = class extends ie {
|
|
|
2882
2882
|
const { transform: w } = D;
|
|
2883
2883
|
if (!w)
|
|
2884
2884
|
return;
|
|
2885
|
-
const { left: y = 0, top:
|
|
2885
|
+
const { left: y = 0, top: C = 0, width: E = 0, height: T = 0 } = w, { drawingStartX: M, drawingEndX: R, drawingStartY: N, drawingEndY: F } = {
|
|
2886
2886
|
drawingStartX: y,
|
|
2887
2887
|
drawingEndX: y + E,
|
|
2888
|
-
drawingStartY:
|
|
2889
|
-
drawingEndY:
|
|
2888
|
+
drawingStartY: C,
|
|
2889
|
+
drawingEndY: C + T
|
|
2890
2890
|
};
|
|
2891
|
-
d <= M && R <= u && c <= N &&
|
|
2891
|
+
d <= M && R <= u && c <= N && F <= l && h.push(D);
|
|
2892
2892
|
});
|
|
2893
2893
|
const m = [], p = [], f = t.startRow - e.startRow, _ = t.startColumn - e.startColumn, S = h.map((v) => {
|
|
2894
2894
|
const D = v.sheetTransform, w = {
|
|
@@ -2918,22 +2918,22 @@ let sn = class extends ie {
|
|
|
2918
2918
|
const m = c[h], { sheetTransform: p, transform: f, anchorType: _ = O.Position } = m;
|
|
2919
2919
|
if (p == null || f == null)
|
|
2920
2920
|
return;
|
|
2921
|
-
let S,
|
|
2921
|
+
let S, I;
|
|
2922
2922
|
if (t === "insert") {
|
|
2923
2923
|
const v = this._expandRow(p, f, o, a, _);
|
|
2924
|
-
S = v == null ? void 0 : v.newSheetTransform,
|
|
2924
|
+
S = v == null ? void 0 : v.newSheetTransform, I = v == null ? void 0 : v.newTransform;
|
|
2925
2925
|
} else {
|
|
2926
2926
|
const { from: v, to: D } = p, { row: w } = v, { row: y } = D;
|
|
2927
2927
|
if (_ === O.Both && w >= o && y <= a)
|
|
2928
2928
|
g.push({ unitId: n, subUnitId: r, drawingId: h });
|
|
2929
2929
|
else {
|
|
2930
|
-
const
|
|
2931
|
-
S =
|
|
2930
|
+
const C = this._shrinkRow(p, f, o, a, _);
|
|
2931
|
+
S = C == null ? void 0 : C.newSheetTransform, I = C == null ? void 0 : C.newTransform;
|
|
2932
2932
|
}
|
|
2933
2933
|
}
|
|
2934
|
-
if (!S || !
|
|
2934
|
+
if (!S || !I)
|
|
2935
2935
|
return;
|
|
2936
|
-
const b = { unitId: n, subUnitId: r, drawingId: h, transform:
|
|
2936
|
+
const b = { unitId: n, subUnitId: r, drawingId: h, transform: I, sheetTransform: S };
|
|
2937
2937
|
l.push(b);
|
|
2938
2938
|
}), l.length === 0 && g.length === 0)
|
|
2939
2939
|
return { redos: [], undos: [] };
|
|
@@ -2959,22 +2959,22 @@ let sn = class extends ie {
|
|
|
2959
2959
|
const m = c[h], { sheetTransform: p, transform: f, anchorType: _ = O.Position } = m;
|
|
2960
2960
|
if (p == null || f == null)
|
|
2961
2961
|
return;
|
|
2962
|
-
let S,
|
|
2962
|
+
let S, I;
|
|
2963
2963
|
if (t === "insert") {
|
|
2964
2964
|
const v = this._expandCol(p, f, o, a, _);
|
|
2965
|
-
S = v == null ? void 0 : v.newSheetTransform,
|
|
2965
|
+
S = v == null ? void 0 : v.newSheetTransform, I = v == null ? void 0 : v.newTransform;
|
|
2966
2966
|
} else {
|
|
2967
2967
|
const { from: v, to: D } = p, { column: w } = v, { column: y } = D;
|
|
2968
2968
|
if (_ === O.Both && w >= o && y <= a)
|
|
2969
2969
|
g.push({ unitId: n, subUnitId: r, drawingId: h });
|
|
2970
2970
|
else {
|
|
2971
|
-
const
|
|
2972
|
-
S =
|
|
2971
|
+
const C = this._shrinkCol(p, f, o, a, _);
|
|
2972
|
+
S = C == null ? void 0 : C.newSheetTransform, I = C == null ? void 0 : C.newTransform;
|
|
2973
2973
|
}
|
|
2974
2974
|
}
|
|
2975
|
-
if (!S || !
|
|
2975
|
+
if (!S || !I)
|
|
2976
2976
|
return;
|
|
2977
|
-
const b = { unitId: n, subUnitId: r, drawingId: h, transform:
|
|
2977
|
+
const b = { unitId: n, subUnitId: r, drawingId: h, transform: I, sheetTransform: S };
|
|
2978
2978
|
l.push(b);
|
|
2979
2979
|
}), l.length === 0 && g.length === 0)
|
|
2980
2980
|
return { redos: [], undos: [] };
|
|
@@ -2992,7 +2992,7 @@ let sn = class extends ie {
|
|
|
2992
2992
|
const s = n - e + 1, { from: o, to: a } = i, { column: d } = o, { column: u } = a;
|
|
2993
2993
|
if (r === O.None)
|
|
2994
2994
|
return {
|
|
2995
|
-
newSheetTransform:
|
|
2995
|
+
newSheetTransform: $({ ...t }, this._selectionRenderService),
|
|
2996
2996
|
newTransform: t
|
|
2997
2997
|
};
|
|
2998
2998
|
let c = null, l = null;
|
|
@@ -3000,7 +3000,7 @@ let sn = class extends ie {
|
|
|
3000
3000
|
const g = this._skeletonManagerService.attachRangeWithCoord({ startColumn: e, endColumn: n, startRow: o.row, endRow: a.row });
|
|
3001
3001
|
if (g == null)
|
|
3002
3002
|
return;
|
|
3003
|
-
l = { ...t, left: (t.left || 0) + g.endX - g.startX }, c =
|
|
3003
|
+
l = { ...t, left: (t.left || 0) + g.endX - g.startX }, c = $(l, this._selectionRenderService);
|
|
3004
3004
|
} else if (u >= n)
|
|
3005
3005
|
if (r === O.Both)
|
|
3006
3006
|
c = {
|
|
@@ -3009,7 +3009,7 @@ let sn = class extends ie {
|
|
|
3009
3009
|
}, l = z(c, this._selectionRenderService, this._skeletonManagerService);
|
|
3010
3010
|
else
|
|
3011
3011
|
return {
|
|
3012
|
-
newSheetTransform:
|
|
3012
|
+
newSheetTransform: $({ ...t }, this._selectionRenderService),
|
|
3013
3013
|
newTransform: t
|
|
3014
3014
|
};
|
|
3015
3015
|
return c != null && l != null ? {
|
|
@@ -3021,7 +3021,7 @@ let sn = class extends ie {
|
|
|
3021
3021
|
const s = n - e + 1, { from: o, to: a } = i, { column: d } = o, { column: u } = a;
|
|
3022
3022
|
if (r === O.None)
|
|
3023
3023
|
return {
|
|
3024
|
-
newSheetTransform:
|
|
3024
|
+
newSheetTransform: $({ ...t }, this._selectionRenderService),
|
|
3025
3025
|
newTransform: t
|
|
3026
3026
|
};
|
|
3027
3027
|
let c = null, l = null;
|
|
@@ -3041,7 +3041,7 @@ let sn = class extends ie {
|
|
|
3041
3041
|
}, l = z(c, this._selectionRenderService, this._skeletonManagerService);
|
|
3042
3042
|
else
|
|
3043
3043
|
return {
|
|
3044
|
-
newSheetTransform:
|
|
3044
|
+
newSheetTransform: $({ ...t }, this._selectionRenderService),
|
|
3045
3045
|
newTransform: t
|
|
3046
3046
|
};
|
|
3047
3047
|
else if (d >= e && d <= n) {
|
|
@@ -3053,7 +3053,7 @@ let sn = class extends ie {
|
|
|
3053
3053
|
return;
|
|
3054
3054
|
l = { ...t, left: (t.left || 0) - g.endX + g.startX - i.from.columnOffset };
|
|
3055
3055
|
}
|
|
3056
|
-
c =
|
|
3056
|
+
c = $(l, this._selectionRenderService);
|
|
3057
3057
|
} else if (u >= e && u <= n && r === O.Both) {
|
|
3058
3058
|
const g = this._skeletonManagerService.attachRangeWithCoord({
|
|
3059
3059
|
startColumn: e - 1,
|
|
@@ -3078,7 +3078,7 @@ let sn = class extends ie {
|
|
|
3078
3078
|
const s = n - e + 1, { from: o, to: a } = i, { row: d } = o, { row: u } = a;
|
|
3079
3079
|
if (r === O.None)
|
|
3080
3080
|
return {
|
|
3081
|
-
newSheetTransform:
|
|
3081
|
+
newSheetTransform: $({ ...t }, this._selectionRenderService),
|
|
3082
3082
|
newTransform: t
|
|
3083
3083
|
};
|
|
3084
3084
|
let c = null, l = null;
|
|
@@ -3086,7 +3086,7 @@ let sn = class extends ie {
|
|
|
3086
3086
|
const g = this._skeletonManagerService.attachRangeWithCoord({ startRow: e, endRow: n, startColumn: o.column, endColumn: a.column });
|
|
3087
3087
|
if (g == null)
|
|
3088
3088
|
return;
|
|
3089
|
-
l = { ...t, top: (t.top || 0) + g.endY - g.startY }, c =
|
|
3089
|
+
l = { ...t, top: (t.top || 0) + g.endY - g.startY }, c = $(l, this._selectionRenderService);
|
|
3090
3090
|
} else if (u >= n)
|
|
3091
3091
|
if (r === O.Both)
|
|
3092
3092
|
c = {
|
|
@@ -3098,7 +3098,7 @@ let sn = class extends ie {
|
|
|
3098
3098
|
}, l = z(c, this._selectionRenderService, this._skeletonManagerService);
|
|
3099
3099
|
else
|
|
3100
3100
|
return {
|
|
3101
|
-
newSheetTransform:
|
|
3101
|
+
newSheetTransform: $({ ...t }, this._selectionRenderService),
|
|
3102
3102
|
newTransform: t
|
|
3103
3103
|
};
|
|
3104
3104
|
return c != null && l != null ? {
|
|
@@ -3110,7 +3110,7 @@ let sn = class extends ie {
|
|
|
3110
3110
|
const s = n - e + 1, { from: o, to: a } = i, { row: d } = o, { row: u } = a;
|
|
3111
3111
|
if (r === O.None)
|
|
3112
3112
|
return {
|
|
3113
|
-
newSheetTransform:
|
|
3113
|
+
newSheetTransform: $({ ...t }, this._selectionRenderService),
|
|
3114
3114
|
newTransform: t
|
|
3115
3115
|
};
|
|
3116
3116
|
let c = null, l = null;
|
|
@@ -3130,7 +3130,7 @@ let sn = class extends ie {
|
|
|
3130
3130
|
}, l = z(c, this._selectionRenderService, this._skeletonManagerService);
|
|
3131
3131
|
else
|
|
3132
3132
|
return {
|
|
3133
|
-
newSheetTransform:
|
|
3133
|
+
newSheetTransform: $({ ...t }, this._selectionRenderService),
|
|
3134
3134
|
newTransform: t
|
|
3135
3135
|
};
|
|
3136
3136
|
else if (d >= e && d <= n) {
|
|
@@ -3142,7 +3142,7 @@ let sn = class extends ie {
|
|
|
3142
3142
|
return;
|
|
3143
3143
|
l = { ...t, top: (t.top || 0) - g.endY + g.startY - i.from.rowOffset };
|
|
3144
3144
|
}
|
|
3145
|
-
c =
|
|
3145
|
+
c = $(l, this._selectionRenderService);
|
|
3146
3146
|
} else if (u >= e && u <= n && r === O.Both) {
|
|
3147
3147
|
const g = this._skeletonManagerService.attachRangeWithCoord({ startColumn: o.column, endColumn: o.column, startRow: e - 1, endRow: e - 1 });
|
|
3148
3148
|
if (g == null)
|
|
@@ -3164,7 +3164,7 @@ let sn = class extends ie {
|
|
|
3164
3164
|
// but the skeleton changes like other render modules. These two signals are not equivalent.
|
|
3165
3165
|
// As a temp solution, I subscribed to activate$ here.
|
|
3166
3166
|
this._commandService.onCommandExecuted((i) => {
|
|
3167
|
-
if (i.id ===
|
|
3167
|
+
if (i.id === rs.id) {
|
|
3168
3168
|
const { unitId: t, subUnitId: e } = i.params;
|
|
3169
3169
|
this._updateDrawings(t, e);
|
|
3170
3170
|
}
|
|
@@ -3215,7 +3215,7 @@ let sn = class extends ie {
|
|
|
3215
3215
|
_sheetRefreshListener() {
|
|
3216
3216
|
this.disposeWithMe(
|
|
3217
3217
|
this._commandService.onCommandExecuted((i) => {
|
|
3218
|
-
|
|
3218
|
+
Ys.includes(i.id) && requestIdleCallback(() => {
|
|
3219
3219
|
const t = i.params, { unitId: e, subUnitId: n, ranges: r } = t;
|
|
3220
3220
|
this._refreshDrawingTransform(e, n, r);
|
|
3221
3221
|
});
|
|
@@ -3230,11 +3230,11 @@ let sn = class extends ie {
|
|
|
3230
3230
|
return !0;
|
|
3231
3231
|
const { from: c, to: l } = a, { row: g, column: h } = c, { row: m, column: p } = l;
|
|
3232
3232
|
for (let f = 0; f < e.length; f++) {
|
|
3233
|
-
const _ = e[f], { startRow: S, endRow:
|
|
3233
|
+
const _ = e[f], { startRow: S, endRow: I, startColumn: b, endColumn: v } = _;
|
|
3234
3234
|
if (Hr.intersects(
|
|
3235
3235
|
{
|
|
3236
3236
|
startRow: S,
|
|
3237
|
-
endRow:
|
|
3237
|
+
endRow: I,
|
|
3238
3238
|
startColumn: b,
|
|
3239
3239
|
endColumn: v
|
|
3240
3240
|
},
|
|
@@ -3244,7 +3244,7 @@ let sn = class extends ie {
|
|
|
3244
3244
|
startColumn: h,
|
|
3245
3245
|
endColumn: p
|
|
3246
3246
|
}
|
|
3247
|
-
) || g >
|
|
3247
|
+
) || g > I || h > v) {
|
|
3248
3248
|
const D = u === O.Position, w = z(a, this._selectionRenderService, this._skeletonManagerService);
|
|
3249
3249
|
r.push({
|
|
3250
3250
|
...o,
|
|
@@ -3260,7 +3260,7 @@ let sn = class extends ie {
|
|
|
3260
3260
|
}), r.length !== 0 && (this._drawingManagerService.refreshTransform(r), this._commandService.syncExecuteCommand(L.id, [i]));
|
|
3261
3261
|
}
|
|
3262
3262
|
};
|
|
3263
|
-
sn =
|
|
3263
|
+
sn = Fs([
|
|
3264
3264
|
pe(1, q),
|
|
3265
3265
|
pe(2, G),
|
|
3266
3266
|
pe(3, Ge),
|
|
@@ -3278,7 +3278,7 @@ var re = function() {
|
|
|
3278
3278
|
}
|
|
3279
3279
|
return i;
|
|
3280
3280
|
}, re.apply(this, arguments);
|
|
3281
|
-
},
|
|
3281
|
+
}, Gs = function(i, t) {
|
|
3282
3282
|
var e = {};
|
|
3283
3283
|
for (var n in i) Object.prototype.hasOwnProperty.call(i, n) && t.indexOf(n) < 0 && (e[n] = i[n]);
|
|
3284
3284
|
if (i != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -3286,15 +3286,15 @@ var re = function() {
|
|
|
3286
3286
|
t.indexOf(n[r]) < 0 && Object.prototype.propertyIsEnumerable.call(i, n[r]) && (e[n[r]] = i[n[r]]);
|
|
3287
3287
|
return e;
|
|
3288
3288
|
}, br = hr(function(i, t) {
|
|
3289
|
-
var e = i.icon, n = i.id, r = i.className, s = i.extend, o =
|
|
3289
|
+
var e = i.icon, n = i.id, r = i.className, s = i.extend, o = Gs(i, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(n, " ").concat(r || "").trim(), d = cs("_".concat(Hs()));
|
|
3290
3290
|
return Rr(e, "".concat(n), { defIds: e.defIds, idSuffix: d.current }, re({ ref: t, className: a }, o), s);
|
|
3291
3291
|
});
|
|
3292
3292
|
function Rr(i, t, e, n, r) {
|
|
3293
|
-
return gr(i.tag, re(re({ key: t },
|
|
3293
|
+
return gr(i.tag, re(re({ key: t }, Xs(i, e, r)), n), (Vs(i, e).children || []).map(function(s, o) {
|
|
3294
3294
|
return Rr(s, "".concat(t, "-").concat(i.tag, "-").concat(o), e, void 0, r);
|
|
3295
3295
|
}));
|
|
3296
3296
|
}
|
|
3297
|
-
function
|
|
3297
|
+
function Xs(i, t, e) {
|
|
3298
3298
|
var n = re({}, i.attrs);
|
|
3299
3299
|
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) {
|
|
3300
3300
|
var o = s[0], a = s[1];
|
|
@@ -3306,21 +3306,21 @@ function Ys(i, t, e) {
|
|
|
3306
3306
|
typeof a == "string" && (n[o] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
|
|
3307
3307
|
})), n;
|
|
3308
3308
|
}
|
|
3309
|
-
function
|
|
3309
|
+
function Vs(i, t) {
|
|
3310
3310
|
var e, n = t.defIds;
|
|
3311
3311
|
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) {
|
|
3312
3312
|
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;
|
|
3313
3313
|
}) }) : i;
|
|
3314
3314
|
}
|
|
3315
|
-
function
|
|
3315
|
+
function Hs() {
|
|
3316
3316
|
return Math.random().toString(36).substring(2, 8);
|
|
3317
3317
|
}
|
|
3318
3318
|
br.displayName = "UniverIcon";
|
|
3319
|
-
var
|
|
3319
|
+
var zs = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M2.2498 3.65005C2.2498 2.87685 2.87661 2.25005 3.64981 2.25005H7.9998C8.33118 2.25005 8.5998 1.98142 8.5998 1.65005C8.5998 1.31868 8.33118 1.05005 7.9998 1.05005H3.64981C2.21387 1.05005 1.0498 2.21411 1.0498 3.65005V12.35C1.0498 13.786 2.21386 14.95 3.6498 14.95H12.3498C13.7857 14.95 14.9498 13.786 14.9498 12.3501V8.00005C14.9498 7.66868 14.6812 7.40005 14.3498 7.40005C14.0184 7.40005 13.7498 7.66868 13.7498 8.00005V9.23974L12.2385 8.1063C11.7252 7.72129 11.0068 7.7723 10.5531 8.22605L9.00869 9.77041L6.73916 7.8251C6.24387 7.40055 5.5095 7.41278 5.02864 7.85359L2.2498 10.4009V3.65005ZM2.2498 12.0287V12.35C2.2498 13.1232 2.87661 13.75 3.6498 13.75H12.3498C13.123 13.75 13.7498 13.1232 13.7498 12.3501V10.7397L11.5186 9.06631C11.4829 9.03956 11.433 9.04314 11.4016 9.07458L9.92249 10.5537L11.1015 11.5642C11.3531 11.7799 11.3822 12.1587 11.1666 12.4103C10.9509 12.6619 10.5721 12.691 10.3205 12.4753L5.9582 8.7362C5.92384 8.70674 5.87288 8.70758 5.83952 8.73816L2.2498 12.0287Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M11.8097 1.14783C12.1411 1.14783 12.4097 1.41646 12.4097 1.74783V3.297H14.1541C14.4855 3.297 14.7541 3.56563 14.7541 3.897C14.7541 4.22837 14.4855 4.497 14.1541 4.497H12.4097V6.24167C12.4097 6.57304 12.1411 6.84167 11.8097 6.84167C11.4783 6.84167 11.2097 6.57304 11.2097 6.24167V4.497H9.6603C9.32893 4.497 9.0603 4.22837 9.0603 3.897C9.0603 3.56563 9.32893 3.297 9.6603 3.297H11.2097V1.74783C11.2097 1.41646 11.4783 1.14783 11.8097 1.14783Z" } }] }, Mr = hr(function(i, t) {
|
|
3320
3320
|
return gr(br, Object.assign({}, i, {
|
|
3321
3321
|
id: "add-image-single",
|
|
3322
3322
|
ref: t,
|
|
3323
|
-
icon:
|
|
3323
|
+
icon: zs
|
|
3324
3324
|
}));
|
|
3325
3325
|
});
|
|
3326
3326
|
Mr.displayName = "AddImageSingle";
|
|
@@ -3360,7 +3360,7 @@ const yr = {
|
|
|
3360
3360
|
return s === ve.UP ? g.top = m - 1 : s === ve.DOWN ? g.top = m + 1 : s === ve.LEFT ? g.left = h - 1 : s === ve.RIGHT && (g.left = h + 1), {
|
|
3361
3361
|
...c,
|
|
3362
3362
|
transform: g,
|
|
3363
|
-
sheetTransform:
|
|
3363
|
+
sheetTransform: $(g, r)
|
|
3364
3364
|
};
|
|
3365
3365
|
}).filter((c) => c != null);
|
|
3366
3366
|
return e.syncExecuteCommand(jt.id, {
|
|
@@ -3369,100 +3369,98 @@ const yr = {
|
|
|
3369
3369
|
}) ? (e.syncExecuteCommand(L.id, [a]), !0) : !1;
|
|
3370
3370
|
}
|
|
3371
3371
|
}, Er = "addition-and-subtraction-single", Tr = "sheet.menu.image";
|
|
3372
|
-
function
|
|
3372
|
+
function Ks(i) {
|
|
3373
3373
|
return {
|
|
3374
3374
|
id: Tr,
|
|
3375
3375
|
type: cn.SUBITEMS,
|
|
3376
3376
|
icon: Er,
|
|
3377
3377
|
tooltip: "sheetImage.title",
|
|
3378
|
-
hidden$: an(i,
|
|
3379
|
-
disabled$:
|
|
3378
|
+
hidden$: an(i, x.UNIVER_SHEET),
|
|
3379
|
+
disabled$: Pi(i, { workbookTypes: [Kt], worksheetTypes: [Zt], rangeTypes: [is] })
|
|
3380
3380
|
};
|
|
3381
3381
|
}
|
|
3382
|
-
function
|
|
3382
|
+
function Zs(i) {
|
|
3383
3383
|
return {
|
|
3384
3384
|
id: Bt.id,
|
|
3385
3385
|
title: "sheetImage.upload.float",
|
|
3386
3386
|
type: cn.BUTTON,
|
|
3387
|
-
hidden$: an(i,
|
|
3387
|
+
hidden$: an(i, x.UNIVER_SHEET)
|
|
3388
3388
|
};
|
|
3389
3389
|
}
|
|
3390
|
-
function
|
|
3390
|
+
function Js(i) {
|
|
3391
3391
|
return {
|
|
3392
3392
|
id: ln.id,
|
|
3393
3393
|
title: "sheetImage.upload.cell",
|
|
3394
3394
|
type: cn.BUTTON,
|
|
3395
|
-
hidden$: an(i,
|
|
3395
|
+
hidden$: an(i, x.UNIVER_SHEET)
|
|
3396
3396
|
};
|
|
3397
3397
|
}
|
|
3398
|
-
const
|
|
3399
|
-
var
|
|
3398
|
+
const qs = (i) => {
|
|
3399
|
+
var S;
|
|
3400
3400
|
const t = Qe(G), e = Qe(nt), n = Qe(se), r = Qe(q), { drawings: s } = i, o = s[0];
|
|
3401
3401
|
if (o == null)
|
|
3402
3402
|
return;
|
|
3403
3403
|
const { unitId: a } = o, d = r.getRenderById(a), u = d == null ? void 0 : d.scene;
|
|
3404
3404
|
if (u == null)
|
|
3405
3405
|
return;
|
|
3406
|
-
const c = u.getTransformerByCreate(), [l, g] = en(!0), h = (
|
|
3407
|
-
function f(
|
|
3408
|
-
const
|
|
3409
|
-
return
|
|
3410
|
-
const { oKey:
|
|
3411
|
-
if (
|
|
3412
|
-
return
|
|
3413
|
-
const { unitId:
|
|
3414
|
-
|
|
3415
|
-
unitId:
|
|
3416
|
-
subUnitId:
|
|
3417
|
-
drawingId:
|
|
3418
|
-
anchorType:
|
|
3419
|
-
sheetTransform:
|
|
3420
|
-
drawingType:
|
|
3406
|
+
const c = u.getTransformerByCreate(), [l, g] = en(!0), h = (S = o.anchorType) != null ? S : O.Position, [m, p] = en(h);
|
|
3407
|
+
function f(I, b) {
|
|
3408
|
+
const v = [];
|
|
3409
|
+
return I.forEach((D) => {
|
|
3410
|
+
const { oKey: w } = D, y = b.getDrawingOKey(w);
|
|
3411
|
+
if (y == null)
|
|
3412
|
+
return v.push(null), !0;
|
|
3413
|
+
const { unitId: C, subUnitId: E, drawingId: T, drawingType: M, anchorType: R, sheetTransform: N } = y;
|
|
3414
|
+
v.push({
|
|
3415
|
+
unitId: C,
|
|
3416
|
+
subUnitId: E,
|
|
3417
|
+
drawingId: T,
|
|
3418
|
+
anchorType: R,
|
|
3419
|
+
sheetTransform: N,
|
|
3420
|
+
drawingType: M
|
|
3421
3421
|
});
|
|
3422
|
-
}),
|
|
3422
|
+
}), v;
|
|
3423
3423
|
}
|
|
3424
3424
|
fr(() => {
|
|
3425
|
-
const
|
|
3426
|
-
|
|
3427
|
-
}),
|
|
3428
|
-
var
|
|
3429
|
-
const { objects:
|
|
3430
|
-
if (
|
|
3425
|
+
const I = c.clearControl$.subscribe((v) => {
|
|
3426
|
+
v === !0 && g(!1);
|
|
3427
|
+
}), b = c.changeStart$.subscribe((v) => {
|
|
3428
|
+
var y;
|
|
3429
|
+
const { objects: D } = v, w = f(D, n);
|
|
3430
|
+
if (w.length === 0)
|
|
3431
3431
|
g(!1);
|
|
3432
|
-
else if (
|
|
3432
|
+
else if (w.length >= 1) {
|
|
3433
3433
|
g(!0);
|
|
3434
|
-
const
|
|
3435
|
-
p(
|
|
3434
|
+
const C = ((y = w[0]) == null ? void 0 : y.anchorType) || O.Position;
|
|
3435
|
+
p(C);
|
|
3436
3436
|
}
|
|
3437
3437
|
});
|
|
3438
3438
|
return () => {
|
|
3439
|
-
|
|
3439
|
+
b.unsubscribe(), I.unsubscribe();
|
|
3440
3440
|
};
|
|
3441
3441
|
}, []);
|
|
3442
|
-
function _(
|
|
3443
|
-
p(
|
|
3444
|
-
const
|
|
3445
|
-
if (
|
|
3442
|
+
function _(I) {
|
|
3443
|
+
p(I);
|
|
3444
|
+
const b = n.getFocusDrawings();
|
|
3445
|
+
if (b.length === 0)
|
|
3446
3446
|
return;
|
|
3447
|
-
const
|
|
3448
|
-
unitId:
|
|
3449
|
-
subUnitId:
|
|
3450
|
-
drawingId:
|
|
3451
|
-
anchorType:
|
|
3447
|
+
const v = b.map((D) => ({
|
|
3448
|
+
unitId: D.unitId,
|
|
3449
|
+
subUnitId: D.subUnitId,
|
|
3450
|
+
drawingId: D.drawingId,
|
|
3451
|
+
anchorType: I
|
|
3452
3452
|
}));
|
|
3453
3453
|
t.executeCommand(jt.id, {
|
|
3454
|
-
unitId:
|
|
3455
|
-
drawings:
|
|
3454
|
+
unitId: b[0].unitId,
|
|
3455
|
+
drawings: v
|
|
3456
3456
|
});
|
|
3457
3457
|
}
|
|
3458
3458
|
return /* @__PURE__ */ Qt(
|
|
3459
3459
|
"div",
|
|
3460
3460
|
{
|
|
3461
|
-
className:
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
`,
|
|
3465
|
-
style: { display: ((b) => b ? "block" : "none")(l) },
|
|
3461
|
+
className: vi("univer-relative univer-mt-5 univer-w-full", Ii, {
|
|
3462
|
+
"univer-hidden": !l
|
|
3463
|
+
}),
|
|
3466
3464
|
children: [
|
|
3467
3465
|
/* @__PURE__ */ Z(
|
|
3468
3466
|
"div",
|
|
@@ -3479,7 +3477,7 @@ const Zs = (i) => {
|
|
|
3479
3477
|
className: `
|
|
3480
3478
|
univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start univer-justify-start
|
|
3481
3479
|
`,
|
|
3482
|
-
children: /* @__PURE__ */ Z("div", { className: "univer-flex univer-items-center univer-gap-1", children: /* @__PURE__ */ Qt(
|
|
3480
|
+
children: /* @__PURE__ */ Z("div", { className: "univer-flex univer-items-center univer-gap-1", children: /* @__PURE__ */ Qt(Si, { value: m, onChange: _, direction: "vertical", children: [
|
|
3483
3481
|
/* @__PURE__ */ Z(Gt, { value: O.Both, children: e.t("drawing-anchor.both") }),
|
|
3484
3482
|
/* @__PURE__ */ Z(Gt, { value: O.Position, children: e.t("drawing-anchor.position") }),
|
|
3485
3483
|
/* @__PURE__ */ Z(Gt, { value: O.None, children: e.t("drawing-anchor.none") })
|
|
@@ -3489,7 +3487,7 @@ const Zs = (i) => {
|
|
|
3489
3487
|
]
|
|
3490
3488
|
}
|
|
3491
3489
|
);
|
|
3492
|
-
},
|
|
3490
|
+
}, Qs = () => {
|
|
3493
3491
|
const i = Qe(se), t = i.getFocusDrawings(), [e, n] = en(t);
|
|
3494
3492
|
return fr(() => {
|
|
3495
3493
|
const r = i.focus$.subscribe((s) => {
|
|
@@ -3500,20 +3498,20 @@ const Zs = (i) => {
|
|
|
3500
3498
|
};
|
|
3501
3499
|
}, []), !!(e != null && e.length) && /* @__PURE__ */ Qt("div", { className: "univer-p-2 univer-text-center univer-text-sm", children: [
|
|
3502
3500
|
/* @__PURE__ */ Z(ui, { drawings: e }),
|
|
3503
|
-
/* @__PURE__ */ Z(
|
|
3501
|
+
/* @__PURE__ */ Z(qs, { drawings: e })
|
|
3504
3502
|
] });
|
|
3505
|
-
},
|
|
3506
|
-
[
|
|
3503
|
+
}, eo = {
|
|
3504
|
+
[xi.FORMULAS_INSERT]: {
|
|
3507
3505
|
[Tr]: {
|
|
3508
3506
|
order: 3,
|
|
3509
|
-
menuItemFactory:
|
|
3507
|
+
menuItemFactory: Ks,
|
|
3510
3508
|
[Bt.id]: {
|
|
3511
3509
|
order: 0,
|
|
3512
|
-
menuItemFactory:
|
|
3510
|
+
menuItemFactory: Zs
|
|
3513
3511
|
},
|
|
3514
3512
|
[ln.id]: {
|
|
3515
3513
|
order: 1,
|
|
3516
|
-
menuItemFactory:
|
|
3514
|
+
menuItemFactory: Js
|
|
3517
3515
|
}
|
|
3518
3516
|
}
|
|
3519
3517
|
}
|
|
@@ -3521,7 +3519,7 @@ const Zs = (i) => {
|
|
|
3521
3519
|
function st(i) {
|
|
3522
3520
|
return !i.getContextValue(zr) && !i.getContextValue(Kr) && !i.getContextValue(Zr) && i.getContextValue(xe);
|
|
3523
3521
|
}
|
|
3524
|
-
const
|
|
3522
|
+
const to = {
|
|
3525
3523
|
id: it.id,
|
|
3526
3524
|
description: "shortcut.drawing-move-down",
|
|
3527
3525
|
group: "4_drawing-view",
|
|
@@ -3531,7 +3529,7 @@ const Qs = {
|
|
|
3531
3529
|
staticParameters: {
|
|
3532
3530
|
direction: ve.DOWN
|
|
3533
3531
|
}
|
|
3534
|
-
},
|
|
3532
|
+
}, no = {
|
|
3535
3533
|
id: it.id,
|
|
3536
3534
|
description: "shortcut.drawing-move-up",
|
|
3537
3535
|
group: "4_drawing-view",
|
|
@@ -3541,7 +3539,7 @@ const Qs = {
|
|
|
3541
3539
|
staticParameters: {
|
|
3542
3540
|
direction: ve.UP
|
|
3543
3541
|
}
|
|
3544
|
-
},
|
|
3542
|
+
}, ro = {
|
|
3545
3543
|
id: it.id,
|
|
3546
3544
|
description: "shortcut.drawing-move-left",
|
|
3547
3545
|
group: "4_drawing-view",
|
|
@@ -3551,7 +3549,7 @@ const Qs = {
|
|
|
3551
3549
|
staticParameters: {
|
|
3552
3550
|
direction: ve.LEFT
|
|
3553
3551
|
}
|
|
3554
|
-
},
|
|
3552
|
+
}, io = {
|
|
3555
3553
|
id: it.id,
|
|
3556
3554
|
description: "shortcut.drawing-move-right",
|
|
3557
3555
|
group: "4_drawing-view",
|
|
@@ -3561,7 +3559,7 @@ const Qs = {
|
|
|
3561
3559
|
staticParameters: {
|
|
3562
3560
|
direction: ve.RIGHT
|
|
3563
3561
|
}
|
|
3564
|
-
},
|
|
3562
|
+
}, so = {
|
|
3565
3563
|
id: yr.id,
|
|
3566
3564
|
description: "shortcut.drawing-delete",
|
|
3567
3565
|
group: "4_drawing-view",
|
|
@@ -3570,8 +3568,8 @@ const Qs = {
|
|
|
3570
3568
|
binding: Fe.DELETE,
|
|
3571
3569
|
mac: Fe.BACKSPACE
|
|
3572
3570
|
};
|
|
3573
|
-
var
|
|
3574
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
3571
|
+
var oo = Object.getOwnPropertyDescriptor, ao = (i, t, e, n) => {
|
|
3572
|
+
for (var r = n > 1 ? void 0 : n ? oo(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
3575
3573
|
(o = i[s]) && (r = o(r) || r);
|
|
3576
3574
|
return r;
|
|
3577
3575
|
}, We = (i, t) => (e, n) => t(e, n, i);
|
|
@@ -3581,10 +3579,10 @@ let Pt = class extends ie {
|
|
|
3581
3579
|
}
|
|
3582
3580
|
_initCustomComponents() {
|
|
3583
3581
|
const i = this._componentManager;
|
|
3584
|
-
this.disposeWithMe(i.register(Er, Mr)), this.disposeWithMe(i.register(mr,
|
|
3582
|
+
this.disposeWithMe(i.register(Er, Mr)), this.disposeWithMe(i.register(mr, Qs));
|
|
3585
3583
|
}
|
|
3586
3584
|
_initMenus() {
|
|
3587
|
-
this._menuManagerService.mergeMenu(
|
|
3585
|
+
this._menuManagerService.mergeMenu(eo);
|
|
3588
3586
|
}
|
|
3589
3587
|
_initCommands() {
|
|
3590
3588
|
[
|
|
@@ -3606,11 +3604,11 @@ let Pt = class extends ie {
|
|
|
3606
3604
|
_initShortcuts() {
|
|
3607
3605
|
[
|
|
3608
3606
|
// sheet drawing shortcuts
|
|
3609
|
-
Qs,
|
|
3610
|
-
eo,
|
|
3611
3607
|
to,
|
|
3612
3608
|
no,
|
|
3613
|
-
ro
|
|
3609
|
+
ro,
|
|
3610
|
+
io,
|
|
3611
|
+
so
|
|
3614
3612
|
].forEach((i) => {
|
|
3615
3613
|
this.disposeWithMe(this._shortcutService.registerShortcut(i));
|
|
3616
3614
|
});
|
|
@@ -3619,20 +3617,20 @@ let Pt = class extends ie {
|
|
|
3619
3617
|
this._initCommands(), this._initCustomComponents(), this._initMenus(), this._initShortcuts();
|
|
3620
3618
|
}
|
|
3621
3619
|
};
|
|
3622
|
-
Pt =
|
|
3620
|
+
Pt = ao([
|
|
3623
3621
|
We(0, A(zn)),
|
|
3624
|
-
We(1,
|
|
3622
|
+
We(1, Fi),
|
|
3625
3623
|
We(2, G),
|
|
3626
|
-
We(3,
|
|
3624
|
+
We(3, Li),
|
|
3627
3625
|
We(4, se),
|
|
3628
3626
|
We(5, A(dn))
|
|
3629
3627
|
], Pt);
|
|
3630
|
-
var
|
|
3631
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
3628
|
+
var co = Object.defineProperty, lo = Object.getOwnPropertyDescriptor, uo = (i, t, e) => t in i ? co(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, ho = (i, t, e, n) => {
|
|
3629
|
+
for (var r = n > 1 ? void 0 : n ? lo(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
3632
3630
|
(o = i[s]) && (r = o(r) || r);
|
|
3633
3631
|
return r;
|
|
3634
|
-
}, Vt = (i, t) => (e, n) => t(e, n, i), Or = (i, t, e) =>
|
|
3635
|
-
const
|
|
3632
|
+
}, Vt = (i, t) => (e, n) => t(e, n, i), Or = (i, t, e) => uo(i, typeof t != "symbol" ? t + "" : t, e);
|
|
3633
|
+
const go = "SHEET_IMAGE_UI_PLUGIN";
|
|
3636
3634
|
let At = class extends Qr {
|
|
3637
3635
|
constructor(i = $n, t, e, n) {
|
|
3638
3636
|
super(), this._config = i, this._injector = t, this._renderManagerService = e, this._configService = n;
|
|
@@ -3641,7 +3639,7 @@ let At = class extends Qr {
|
|
|
3641
3639
|
$n,
|
|
3642
3640
|
this._config
|
|
3643
3641
|
);
|
|
3644
|
-
r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(
|
|
3642
|
+
r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(ds, s);
|
|
3645
3643
|
}
|
|
3646
3644
|
onStarting() {
|
|
3647
3645
|
ti(this._injector, [
|
|
@@ -3683,13 +3681,13 @@ let At = class extends Qr {
|
|
|
3683
3681
|
[nn],
|
|
3684
3682
|
[tn]
|
|
3685
3683
|
].forEach((i) => {
|
|
3686
|
-
this.disposeWithMe(this._renderManagerService.registerRenderModule(
|
|
3684
|
+
this.disposeWithMe(this._renderManagerService.registerRenderModule(x.UNIVER_SHEET, i));
|
|
3687
3685
|
});
|
|
3688
3686
|
}
|
|
3689
3687
|
};
|
|
3690
|
-
Or(At, "type",
|
|
3691
|
-
Or(At, "pluginName",
|
|
3692
|
-
At =
|
|
3688
|
+
Or(At, "type", x.UNIVER_SHEET);
|
|
3689
|
+
Or(At, "pluginName", go);
|
|
3690
|
+
At = ho([
|
|
3693
3691
|
Jr(oi, ri, hi, pi),
|
|
3694
3692
|
Vt(1, A(Ye)),
|
|
3695
3693
|
Vt(2, q),
|