@univerjs/sheets-drawing-ui 0.7.0-nightly.202505071607 → 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 +346 -347
- package/lib/index.css +1 -1
- package/lib/index.js +346 -347
- 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,19 +1730,20 @@ 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(
|
|
1739
1739
|
this._drawingManagerService.remove$.subscribe((t) => {
|
|
1740
1740
|
t.forEach((e) => {
|
|
1741
|
+
var l;
|
|
1741
1742
|
const { unitId: n, subUnitId: r, drawingId: s } = e, o = Ie({ unitId: n, subUnitId: r, drawingId: s }), a = this._getSceneAndTransformerByDrawingSearch(n);
|
|
1742
1743
|
if (a == null)
|
|
1743
1744
|
return;
|
|
1744
1745
|
const { transformer: d, scene: u } = a, c = u.getObject(o);
|
|
1745
|
-
c != null && c.oKey && d.clearControlByIds([c == null ? void 0 : c.oKey]);
|
|
1746
|
+
c != null && c.oKey && (d.clearControlByIds([c == null ? void 0 : c.oKey]), (l = u.getTransformer()) == null || l.clearSelectedObjects());
|
|
1746
1747
|
});
|
|
1747
1748
|
})
|
|
1748
1749
|
);
|
|
@@ -1760,7 +1761,7 @@ let tt = class extends ie {
|
|
|
1760
1761
|
});
|
|
1761
1762
|
};
|
|
1762
1763
|
this.disposeWithMe(
|
|
1763
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1764
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(x.UNIVER_SHEET).pipe(
|
|
1764
1765
|
_e((e) => e ? e.activeSheet$ : Nn(null)),
|
|
1765
1766
|
Me((e) => {
|
|
1766
1767
|
if (!e) return null;
|
|
@@ -1781,7 +1782,7 @@ let tt = class extends ie {
|
|
|
1781
1782
|
Array.from(this._domLayerInfoMap.values()).filter((o) => o.unitId === r).map((o) => o.subUnitId).forEach((o) => {
|
|
1782
1783
|
t(r, o);
|
|
1783
1784
|
});
|
|
1784
|
-
} else if (e.id ===
|
|
1785
|
+
} else if (e.id === zi.id) {
|
|
1785
1786
|
const { unitId: n, subUnitId: r } = e.params;
|
|
1786
1787
|
t(n, r);
|
|
1787
1788
|
}
|
|
@@ -1915,7 +1916,7 @@ let tt = class extends ie {
|
|
|
1915
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);
|
|
1916
1917
|
if (this._getPosition(p, o) == null)
|
|
1917
1918
|
return;
|
|
1918
|
-
const S = d.scene, { scaleX:
|
|
1919
|
+
const S = d.scene, { scaleX: I } = S.getAncestorScale(), b = Ct(p, n, I), v = {
|
|
1919
1920
|
unitId: o,
|
|
1920
1921
|
subUnitId: a,
|
|
1921
1922
|
drawingId: m,
|
|
@@ -1931,13 +1932,13 @@ let tt = class extends ie {
|
|
|
1931
1932
|
allowTransform: h
|
|
1932
1933
|
};
|
|
1933
1934
|
{
|
|
1934
|
-
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);
|
|
1935
1936
|
if (!N)
|
|
1936
1937
|
return;
|
|
1937
|
-
const
|
|
1938
|
+
const F = N.getActiveSheet().getSheetId();
|
|
1938
1939
|
if (!R || !M)
|
|
1939
1940
|
return;
|
|
1940
|
-
const Q = (w = this._renderManagerService.getRenderById(
|
|
1941
|
+
const Q = (w = this._renderManagerService.getRenderById(C)) == null ? void 0 : w.with(V);
|
|
1941
1942
|
if (!Q)
|
|
1942
1943
|
return;
|
|
1943
1944
|
const H = Q.getWorksheetSkeleton(E);
|
|
@@ -1946,13 +1947,13 @@ let tt = class extends ie {
|
|
|
1946
1947
|
const { transform: X, drawingType: Y, data: K } = R;
|
|
1947
1948
|
if (Y !== j.DRAWING_DOM && Y !== j.DRAWING_CHART)
|
|
1948
1949
|
return;
|
|
1949
|
-
const k = this._getSceneAndTransformerByDrawingSearch(
|
|
1950
|
+
const k = this._getSceneAndTransformerByDrawingSearch(C);
|
|
1950
1951
|
if (k == null)
|
|
1951
1952
|
return;
|
|
1952
1953
|
const { scene: ce, canvas: ye } = k;
|
|
1953
|
-
if (X == null ||
|
|
1954
|
+
if (X == null || F !== E)
|
|
1954
1955
|
return;
|
|
1955
|
-
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);
|
|
1956
1957
|
if (le != null) {
|
|
1957
1958
|
le.transformByState({ left: ot, top: at, width: ct, height: dt, angle: $t, flipX: xt, flipY: lt, skewX: ut, skewY: Ee });
|
|
1958
1959
|
return;
|
|
@@ -1963,7 +1964,7 @@ let tt = class extends ie {
|
|
|
1963
1964
|
top: at,
|
|
1964
1965
|
width: ct,
|
|
1965
1966
|
height: dt,
|
|
1966
|
-
zIndex: this._drawingManagerService.getDrawingOrder(
|
|
1967
|
+
zIndex: this._drawingManagerService.getDrawingOrder(C, E).length - 1
|
|
1967
1968
|
}, Te = Y === j.DRAWING_CHART;
|
|
1968
1969
|
if (Te) {
|
|
1969
1970
|
const W = K ? K.backgroundColor : "white";
|
|
@@ -1981,9 +1982,9 @@ let tt = class extends ie {
|
|
|
1981
1982
|
rect: ue,
|
|
1982
1983
|
boundsOfViewArea: ft,
|
|
1983
1984
|
domAnchor: n,
|
|
1984
|
-
unitId:
|
|
1985
|
+
unitId: C,
|
|
1985
1986
|
subUnitId: E
|
|
1986
|
-
},
|
|
1987
|
+
}, B = fe(ue, k.renderUnit.scene, H.skeleton, M.worksheet, ge), Ue = new je(B);
|
|
1987
1988
|
ge.position$ = Ue;
|
|
1988
1989
|
let Ve = {
|
|
1989
1990
|
position$: Ue,
|
|
@@ -1999,7 +2000,7 @@ let tt = class extends ie {
|
|
|
1999
2000
|
ye.dispatchEvent(new WheelEvent(W.type, W));
|
|
2000
2001
|
},
|
|
2001
2002
|
data: K,
|
|
2002
|
-
unitId:
|
|
2003
|
+
unitId: C
|
|
2003
2004
|
};
|
|
2004
2005
|
e.eventPassThrough && (Ve = {
|
|
2005
2006
|
...Ve,
|
|
@@ -2025,16 +2026,16 @@ let tt = class extends ie {
|
|
|
2025
2026
|
left: p.absolute.left,
|
|
2026
2027
|
top: p.absolute.top
|
|
2027
2028
|
}
|
|
2028
|
-
}, n), Ur = Ie({ unitId:
|
|
2029
|
+
}, n), Ur = Ie({ unitId: C, subUnitId: E, drawingId: T }), Pr = new Ne(Ur, {
|
|
2029
2030
|
left: un.startX,
|
|
2030
2031
|
top: un.startY,
|
|
2031
2032
|
width: (fn = n.width) != null ? fn : W.width,
|
|
2032
2033
|
height: (mn = n.height) != null ? mn : W.height,
|
|
2033
|
-
zIndex: this._drawingManagerService.getDrawingOrder(
|
|
2034
|
+
zIndex: this._drawingManagerService.getDrawingOrder(C, E).length - 1
|
|
2034
2035
|
}), Ar = fe(Pr, k.renderUnit.scene, H.skeleton, M.worksheet, ge);
|
|
2035
2036
|
Ue.next(Ar);
|
|
2036
2037
|
}));
|
|
2037
|
-
const He = (y = this._renderManagerService.getRenderById(
|
|
2038
|
+
const He = (y = this._renderManagerService.getRenderById(C)) == null ? void 0 : y.with(V);
|
|
2038
2039
|
He == null || He.currentSkeleton$.subscribe((W) => {
|
|
2039
2040
|
W && H.sheetId !== W.sheetId && this._removeDom(m, !0);
|
|
2040
2041
|
});
|
|
@@ -2078,7 +2079,7 @@ let tt = class extends ie {
|
|
|
2078
2079
|
}, u, c.skeleton), _ = p;
|
|
2079
2080
|
if (_.startY = 0, this._getPosition(p, o) == null)
|
|
2080
2081
|
return;
|
|
2081
|
-
const
|
|
2082
|
+
const I = {
|
|
2082
2083
|
unitId: o,
|
|
2083
2084
|
subUnitId: a,
|
|
2084
2085
|
drawingId: m,
|
|
@@ -2094,7 +2095,7 @@ let tt = class extends ie {
|
|
|
2094
2095
|
allowTransform: h
|
|
2095
2096
|
};
|
|
2096
2097
|
{
|
|
2097
|
-
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);
|
|
2098
2099
|
if (!M)
|
|
2099
2100
|
return;
|
|
2100
2101
|
const R = M.getActiveSheet().getSheetId();
|
|
@@ -2103,8 +2104,8 @@ let tt = class extends ie {
|
|
|
2103
2104
|
const N = (v = this._renderManagerService.getRenderById(w)) == null ? void 0 : v.with(V);
|
|
2104
2105
|
if (!N)
|
|
2105
2106
|
return;
|
|
2106
|
-
const
|
|
2107
|
-
if (!
|
|
2107
|
+
const F = N.getWorksheetSkeleton(y);
|
|
2108
|
+
if (!F)
|
|
2108
2109
|
return;
|
|
2109
2110
|
const { transform: Q, data: H } = T, X = this._getSceneAndTransformerByDrawingSearch(w);
|
|
2110
2111
|
if (X == null)
|
|
@@ -2112,7 +2113,7 @@ let tt = class extends ie {
|
|
|
2112
2113
|
const { scene: Y, canvas: K } = X;
|
|
2113
2114
|
if (Q == null || R !== y)
|
|
2114
2115
|
return;
|
|
2115
|
-
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);
|
|
2116
2117
|
if (ut != null) {
|
|
2117
2118
|
ut.transformByState({ left: k, top: ce, width: ye, height: ot, angle: at, flipX: ct, flipY: dt, skewX: $t, skewY: xt });
|
|
2118
2119
|
return;
|
|
@@ -2152,11 +2153,11 @@ let tt = class extends ie {
|
|
|
2152
2153
|
domAnchor: n,
|
|
2153
2154
|
scrollDirectionResponse: "HORIZONTAL"
|
|
2154
2155
|
/* HORIZONTAL */
|
|
2155
|
-
}, gt = fe(le, X.renderUnit.scene,
|
|
2156
|
+
}, gt = fe(le, X.renderUnit.scene, F.skeleton, E.worksheet, he), Oe = new je(gt);
|
|
2156
2157
|
he.position$ = Oe;
|
|
2157
2158
|
let Xe = {
|
|
2158
2159
|
position$: Oe,
|
|
2159
|
-
id:
|
|
2160
|
+
id: C,
|
|
2160
2161
|
componentKey: T.componentKey,
|
|
2161
2162
|
onPointerDown: () => {
|
|
2162
2163
|
},
|
|
@@ -2164,57 +2165,57 @@ let tt = class extends ie {
|
|
|
2164
2165
|
},
|
|
2165
2166
|
onPointerUp: () => {
|
|
2166
2167
|
},
|
|
2167
|
-
onWheel: (
|
|
2168
|
-
K.dispatchEvent(new WheelEvent(
|
|
2168
|
+
onWheel: (B) => {
|
|
2169
|
+
K.dispatchEvent(new WheelEvent(B.type, B));
|
|
2169
2170
|
},
|
|
2170
2171
|
data: H,
|
|
2171
2172
|
unitId: w
|
|
2172
2173
|
};
|
|
2173
2174
|
e.eventPassThrough && (Xe = {
|
|
2174
2175
|
...Xe,
|
|
2175
|
-
onPointerDown: (
|
|
2176
|
-
K.dispatchEvent(new PointerEvent(
|
|
2176
|
+
onPointerDown: (B) => {
|
|
2177
|
+
K.dispatchEvent(new PointerEvent(B.type, B));
|
|
2177
2178
|
},
|
|
2178
|
-
onPointerMove: (
|
|
2179
|
-
K.dispatchEvent(new PointerEvent(
|
|
2179
|
+
onPointerMove: (B) => {
|
|
2180
|
+
K.dispatchEvent(new PointerEvent(B.type, B));
|
|
2180
2181
|
},
|
|
2181
|
-
onPointerUp: (
|
|
2182
|
-
K.dispatchEvent(new PointerEvent(
|
|
2182
|
+
onPointerUp: (B) => {
|
|
2183
|
+
K.dispatchEvent(new PointerEvent(B.type, B));
|
|
2183
2184
|
}
|
|
2184
2185
|
}), this._canvasFloatDomService.addFloatDom(Xe);
|
|
2185
2186
|
const ft = le.onTransformChange$.subscribeEvent(() => {
|
|
2186
|
-
const
|
|
2187
|
+
const B = fe(le, X.renderUnit.scene, F.skeleton, E.worksheet, he);
|
|
2187
2188
|
Oe.next(
|
|
2188
|
-
|
|
2189
|
+
B
|
|
2189
2190
|
);
|
|
2190
2191
|
});
|
|
2191
|
-
this.disposeWithMe(f.subscribe((
|
|
2192
|
+
this.disposeWithMe(f.subscribe((B) => {
|
|
2192
2193
|
const Ue = Ct({
|
|
2193
|
-
startX:
|
|
2194
|
+
startX: B.startX,
|
|
2194
2195
|
startY: 0,
|
|
2195
|
-
endX:
|
|
2196
|
-
endY:
|
|
2196
|
+
endX: B.endX,
|
|
2197
|
+
endY: B.endY,
|
|
2197
2198
|
width: n.width,
|
|
2198
2199
|
height: n.height,
|
|
2199
2200
|
absolute: {
|
|
2200
2201
|
left: p.absolute.left,
|
|
2201
2202
|
top: p.absolute.top
|
|
2202
2203
|
}
|
|
2203
|
-
}, n), Ve = Ie({ unitId: w, subUnitId: y, drawingId:
|
|
2204
|
+
}, n), Ve = Ie({ unitId: w, subUnitId: y, drawingId: C }), He = new Ne(Ve, {
|
|
2204
2205
|
left: Ue.startX,
|
|
2205
2206
|
top: 0,
|
|
2206
2207
|
width: n.width,
|
|
2207
2208
|
height: n.height,
|
|
2208
2209
|
zIndex: this._drawingManagerService.getDrawingOrder(w, y).length - 1
|
|
2209
|
-
}), mt = fe(He, X.renderUnit.scene,
|
|
2210
|
+
}), mt = fe(He, X.renderUnit.scene, F.skeleton, E.worksheet, he);
|
|
2210
2211
|
Oe.next(mt);
|
|
2211
2212
|
}));
|
|
2212
2213
|
const ge = (D = this._renderManagerService.getRenderById(w)) == null ? void 0 : D.with(V);
|
|
2213
|
-
ge == null || ge.currentSkeleton$.subscribe((
|
|
2214
|
-
|
|
2214
|
+
ge == null || ge.currentSkeleton$.subscribe((B) => {
|
|
2215
|
+
B && c.sheetId !== B.sheetId && this._removeDom(m, !0);
|
|
2215
2216
|
}), ee.add(() => {
|
|
2216
|
-
this._canvasFloatDomService.removeFloatDom(
|
|
2217
|
-
}), ft && ee.add(ft), this._domLayerInfoMap.set(
|
|
2217
|
+
this._canvasFloatDomService.removeFloatDom(C);
|
|
2218
|
+
}), ft && ee.add(ft), this._domLayerInfoMap.set(C, he);
|
|
2218
2219
|
}
|
|
2219
2220
|
return {
|
|
2220
2221
|
id: m,
|
|
@@ -2241,11 +2242,11 @@ let tt = class extends ie {
|
|
|
2241
2242
|
a.next(f), u.next(_);
|
|
2242
2243
|
}, l = new wt();
|
|
2243
2244
|
l.add(e.engine.clientRect$.subscribe(() => c())), l.add(this._commandService.onCommandExecuted((f) => {
|
|
2244
|
-
if (f.id ===
|
|
2245
|
+
if (f.id === Ki.id && f.params.rowsAutoHeightInfo.findIndex((S) => S.row === r) > -1) {
|
|
2245
2246
|
c();
|
|
2246
2247
|
return;
|
|
2247
2248
|
}
|
|
2248
|
-
(
|
|
2249
|
+
(Zi.indexOf(f.id) > -1 || f.id === Oi.id || f.id === On.id) && c();
|
|
2249
2250
|
}));
|
|
2250
2251
|
const g = (f, _) => {
|
|
2251
2252
|
r = f, s = _, c();
|
|
@@ -2289,12 +2290,12 @@ let tt = class extends ie {
|
|
|
2289
2290
|
};
|
|
2290
2291
|
}
|
|
2291
2292
|
};
|
|
2292
|
-
tt =
|
|
2293
|
+
tt = Ws([
|
|
2293
2294
|
De(0, A(q)),
|
|
2294
2295
|
De(1, Se),
|
|
2295
2296
|
De(2, A(G)),
|
|
2296
2297
|
De(3, se),
|
|
2297
|
-
De(4, A(
|
|
2298
|
+
De(4, A(ji)),
|
|
2298
2299
|
De(5, oe),
|
|
2299
2300
|
De(6, A(Yr))
|
|
2300
2301
|
], tt);
|
|
@@ -2344,8 +2345,8 @@ function Dt(i, t) {
|
|
|
2344
2345
|
const e = Number.parseFloat(i);
|
|
2345
2346
|
return t * e / 100;
|
|
2346
2347
|
}
|
|
2347
|
-
const
|
|
2348
|
-
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) => {
|
|
2349
2350
|
const { width: a, height: d, angle: u, left: c, top: l } = o.transform, g = Dr(
|
|
2350
2351
|
{
|
|
2351
2352
|
left: c != null ? c : 0,
|
|
@@ -2385,10 +2386,10 @@ const ks = (i) => {
|
|
|
2385
2386
|
};
|
|
2386
2387
|
return [o.drawingId, f];
|
|
2387
2388
|
}), [t, e, n, r]);
|
|
2388
|
-
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)) });
|
|
2389
2390
|
};
|
|
2390
|
-
var
|
|
2391
|
-
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--)
|
|
2392
2393
|
(o = i[s]) && (r = o(r) || r);
|
|
2393
2394
|
return r;
|
|
2394
2395
|
}, be = (i, t) => (e, n) => t(e, n, i);
|
|
@@ -2459,7 +2460,7 @@ let Ut = class extends ie {
|
|
|
2459
2460
|
};
|
|
2460
2461
|
}
|
|
2461
2462
|
return null;
|
|
2462
|
-
}).filter(Boolean), d =
|
|
2463
|
+
}).filter(Boolean), d = $i(js, this._injector);
|
|
2463
2464
|
return wi(
|
|
2464
2465
|
/* @__PURE__ */ Z(d, { floatDomInfos: a, scene: t.scene, skeleton: t.skeleton, worksheet: t.worksheet }),
|
|
2465
2466
|
t.root
|
|
@@ -2473,8 +2474,8 @@ let Ut = class extends ie {
|
|
|
2473
2474
|
);
|
|
2474
2475
|
}
|
|
2475
2476
|
};
|
|
2476
|
-
Ut =
|
|
2477
|
-
be(0, A(
|
|
2477
|
+
Ut = $s([
|
|
2478
|
+
be(0, A(Ui)),
|
|
2478
2479
|
be(1, A(Gn)),
|
|
2479
2480
|
be(2, se),
|
|
2480
2481
|
be(3, q),
|
|
@@ -2482,12 +2483,12 @@ Ut = js([
|
|
|
2482
2483
|
be(5, A(zn)),
|
|
2483
2484
|
be(6, A(Ye))
|
|
2484
2485
|
], Ut);
|
|
2485
|
-
var
|
|
2486
|
-
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--)
|
|
2487
2488
|
(o = i[s]) && (r = o(r) || r);
|
|
2488
2489
|
return r;
|
|
2489
2490
|
}, pe = (i, t) => (e, n) => t(e, n, i);
|
|
2490
|
-
const
|
|
2491
|
+
const Ls = [
|
|
2491
2492
|
Kn.id,
|
|
2492
2493
|
Zn.id,
|
|
2493
2494
|
Jn.id,
|
|
@@ -2507,13 +2508,13 @@ const xs = [
|
|
|
2507
2508
|
dr.id,
|
|
2508
2509
|
lr.id,
|
|
2509
2510
|
ur.id
|
|
2510
|
-
],
|
|
2511
|
-
Ki.id,
|
|
2512
|
-
Zi.id,
|
|
2511
|
+
], Ys = [
|
|
2513
2512
|
Ji.id,
|
|
2514
2513
|
qi.id,
|
|
2515
2514
|
Qi.id,
|
|
2516
|
-
es.id
|
|
2515
|
+
es.id,
|
|
2516
|
+
ts.id,
|
|
2517
|
+
ns.id
|
|
2517
2518
|
];
|
|
2518
2519
|
let sn = class extends ie {
|
|
2519
2520
|
constructor(i, t, e, n, r, s, o, a, d) {
|
|
@@ -2523,7 +2524,7 @@ let sn = class extends ie {
|
|
|
2523
2524
|
this.disposeWithMe(
|
|
2524
2525
|
this._sheetInterceptorService.interceptCommand({
|
|
2525
2526
|
getMutations: (i) => {
|
|
2526
|
-
if (!
|
|
2527
|
+
if (!Ls.includes(i.id))
|
|
2527
2528
|
return { redos: [], undos: [] };
|
|
2528
2529
|
if (i.params == null)
|
|
2529
2530
|
return { redos: [], undos: [] };
|
|
@@ -2611,16 +2612,16 @@ let sn = class extends ie {
|
|
|
2611
2612
|
updateDrawings: n,
|
|
2612
2613
|
deleteDrawings: r
|
|
2613
2614
|
};
|
|
2614
|
-
const { startRow: _, endRow: S, startColumn:
|
|
2615
|
+
const { startRow: _, endRow: S, startColumn: I, endColumn: b } = i;
|
|
2615
2616
|
let v = null, D = null;
|
|
2616
2617
|
if (t === 0 && h >= _ && p <= S)
|
|
2617
|
-
if (m >=
|
|
2618
|
+
if (m >= I && f <= b)
|
|
2618
2619
|
r.push({ unitId: d, subUnitId: u, drawingId: c });
|
|
2619
2620
|
else {
|
|
2620
|
-
const w = this._shrinkCol(s, a,
|
|
2621
|
+
const w = this._shrinkCol(s, a, I, b, o);
|
|
2621
2622
|
v = w == null ? void 0 : w.newSheetTransform, D = w == null ? void 0 : w.newTransform;
|
|
2622
2623
|
}
|
|
2623
|
-
else if (t === 1 && m >=
|
|
2624
|
+
else if (t === 1 && m >= I && f <= b)
|
|
2624
2625
|
if (h >= _ && p <= S)
|
|
2625
2626
|
r.push({ unitId: d, subUnitId: u, drawingId: c });
|
|
2626
2627
|
else {
|
|
@@ -2631,7 +2632,7 @@ let sn = class extends ie {
|
|
|
2631
2632
|
const w = this._expandRow(s, a, _, S, o);
|
|
2632
2633
|
v = w == null ? void 0 : w.newSheetTransform, D = w == null ? void 0 : w.newTransform;
|
|
2633
2634
|
} else if (t === 3) {
|
|
2634
|
-
const w = this._expandCol(s, a,
|
|
2635
|
+
const w = this._expandCol(s, a, I, b, o);
|
|
2635
2636
|
v = w == null ? void 0 : w.newSheetTransform, D = w == null ? void 0 : w.newTransform;
|
|
2636
2637
|
}
|
|
2637
2638
|
if (v != null && D != null) {
|
|
@@ -2641,7 +2642,7 @@ let sn = class extends ie {
|
|
|
2641
2642
|
return { updateDrawings: n, deleteDrawings: r };
|
|
2642
2643
|
}
|
|
2643
2644
|
_remainDrawingSize(i, t, e) {
|
|
2644
|
-
const n =
|
|
2645
|
+
const n = $({ ...i }, this._selectionRenderService);
|
|
2645
2646
|
n != null && t.push({
|
|
2646
2647
|
...e,
|
|
2647
2648
|
sheetTransform: n
|
|
@@ -2655,30 +2656,30 @@ let sn = class extends ie {
|
|
|
2655
2656
|
if (m === O.None)
|
|
2656
2657
|
this._remainDrawingSize(h, r, l);
|
|
2657
2658
|
else {
|
|
2658
|
-
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;
|
|
2659
2660
|
for (let v = 0; v < e.length; v++) {
|
|
2660
|
-
const D = e[v], { startRow: w, endRow: y, startColumn:
|
|
2661
|
-
if (b <
|
|
2661
|
+
const D = e[v], { startRow: w, endRow: y, startColumn: C, endColumn: E } = D;
|
|
2662
|
+
if (b < C)
|
|
2662
2663
|
continue;
|
|
2663
2664
|
if (m === O.Position) {
|
|
2664
2665
|
let R = null, N = null;
|
|
2665
|
-
if (S >=
|
|
2666
|
-
const
|
|
2667
|
-
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)
|
|
2668
2669
|
return;
|
|
2669
|
-
N = { ...h, left:
|
|
2670
|
+
N = { ...h, left: F.startX };
|
|
2670
2671
|
}
|
|
2671
|
-
if (N != null && (R =
|
|
2672
|
+
if (N != null && (R = $(N, this._selectionRenderService), R != null && N != null)) {
|
|
2672
2673
|
r.push({ ...l, sheetTransform: R, transform: N });
|
|
2673
2674
|
break;
|
|
2674
2675
|
}
|
|
2675
2676
|
this._remainDrawingSize(h, r, l);
|
|
2676
2677
|
continue;
|
|
2677
2678
|
}
|
|
2678
|
-
if (S >=
|
|
2679
|
+
if (S >= C && b <= E)
|
|
2679
2680
|
continue;
|
|
2680
2681
|
let T = null, M = null;
|
|
2681
|
-
if (S >=
|
|
2682
|
+
if (S >= C && S <= E) {
|
|
2682
2683
|
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: S, endColumn: E, startRow: p.row, endRow: f.row });
|
|
2683
2684
|
if (R == null)
|
|
2684
2685
|
return;
|
|
@@ -2687,8 +2688,8 @@ let sn = class extends ie {
|
|
|
2687
2688
|
left: (R == null ? void 0 : R.startX) || 0,
|
|
2688
2689
|
width: ((h == null ? void 0 : h.width) || 0) - R.endX + R.startX
|
|
2689
2690
|
};
|
|
2690
|
-
} else if (b >=
|
|
2691
|
-
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 });
|
|
2692
2693
|
if (R == null)
|
|
2693
2694
|
return;
|
|
2694
2695
|
M = {
|
|
@@ -2696,18 +2697,18 @@ let sn = class extends ie {
|
|
|
2696
2697
|
left: R.startX - ((h == null ? void 0 : h.width) || 0)
|
|
2697
2698
|
};
|
|
2698
2699
|
} else {
|
|
2699
|
-
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn:
|
|
2700
|
+
const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: C, endColumn: E, startRow: p.row, endRow: f.row });
|
|
2700
2701
|
if (R == null)
|
|
2701
2702
|
return;
|
|
2702
2703
|
if (M = {
|
|
2703
2704
|
...h,
|
|
2704
2705
|
width: ((h == null ? void 0 : h.width) || 0) - R.endX + R.startX
|
|
2705
|
-
}, T =
|
|
2706
|
+
}, T = $(M, this._selectionRenderService), T != null && M != null) {
|
|
2706
2707
|
s.push({ ...l, sheetTransform: T, transform: M });
|
|
2707
2708
|
break;
|
|
2708
2709
|
}
|
|
2709
2710
|
}
|
|
2710
|
-
if (M != null && (T =
|
|
2711
|
+
if (M != null && (T = $(M, this._selectionRenderService)), M != null && T != null) {
|
|
2711
2712
|
r.push({ ...l, sheetTransform: T, transform: M });
|
|
2712
2713
|
break;
|
|
2713
2714
|
} else
|
|
@@ -2749,27 +2750,27 @@ let sn = class extends ie {
|
|
|
2749
2750
|
if (m === O.None)
|
|
2750
2751
|
this._remainDrawingSize(h, r, l);
|
|
2751
2752
|
else {
|
|
2752
|
-
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;
|
|
2753
2754
|
for (let v = 0; v < e.length; v++) {
|
|
2754
|
-
const D = e[v], { startRow: w, endRow: y, startColumn:
|
|
2755
|
-
if (
|
|
2755
|
+
const D = e[v], { startRow: w, endRow: y, startColumn: C, endColumn: E } = D;
|
|
2756
|
+
if (I < w)
|
|
2756
2757
|
continue;
|
|
2757
2758
|
if (m === O.Position) {
|
|
2758
2759
|
let R = null, N = null;
|
|
2759
2760
|
if (_ >= w && _ <= y) {
|
|
2760
|
-
const
|
|
2761
|
-
if (
|
|
2761
|
+
const F = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: f.column, startRow: _, endRow: y });
|
|
2762
|
+
if (F == null)
|
|
2762
2763
|
return;
|
|
2763
|
-
N = { ...h, top:
|
|
2764
|
+
N = { ...h, top: F.startY };
|
|
2764
2765
|
}
|
|
2765
|
-
if (N != null && (R =
|
|
2766
|
+
if (N != null && (R = $(N, this._selectionRenderService), R != null && N != null)) {
|
|
2766
2767
|
r.push({ ...l, sheetTransform: R, transform: N });
|
|
2767
2768
|
break;
|
|
2768
2769
|
}
|
|
2769
2770
|
this._remainDrawingSize(h, r, l);
|
|
2770
2771
|
continue;
|
|
2771
2772
|
}
|
|
2772
|
-
if (_ >= w &&
|
|
2773
|
+
if (_ >= w && I <= y)
|
|
2773
2774
|
continue;
|
|
2774
2775
|
let T = null, M = null;
|
|
2775
2776
|
if (_ >= w && _ <= y) {
|
|
@@ -2781,8 +2782,8 @@ let sn = class extends ie {
|
|
|
2781
2782
|
top: (R == null ? void 0 : R.startY) || 0,
|
|
2782
2783
|
height: ((h == null ? void 0 : h.height) || 0) - R.endY + R.startY
|
|
2783
2784
|
};
|
|
2784
|
-
} else if (
|
|
2785
|
-
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 });
|
|
2786
2787
|
if (R == null)
|
|
2787
2788
|
return;
|
|
2788
2789
|
M = {
|
|
@@ -2796,12 +2797,12 @@ let sn = class extends ie {
|
|
|
2796
2797
|
if (M = {
|
|
2797
2798
|
...h,
|
|
2798
2799
|
height: ((h == null ? void 0 : h.height) || 0) - R.endY + R.startY
|
|
2799
|
-
}, T =
|
|
2800
|
+
}, T = $(M, this._selectionRenderService), T != null && M != null) {
|
|
2800
2801
|
s.push({ ...l, sheetTransform: T, transform: M });
|
|
2801
2802
|
break;
|
|
2802
2803
|
}
|
|
2803
2804
|
}
|
|
2804
|
-
if (M != null && (T =
|
|
2805
|
+
if (M != null && (T = $(M, this._selectionRenderService)), M != null && T != null) {
|
|
2805
2806
|
r.push({ ...l, sheetTransform: T, transform: M });
|
|
2806
2807
|
break;
|
|
2807
2808
|
} else
|
|
@@ -2831,10 +2832,10 @@ let sn = class extends ie {
|
|
|
2831
2832
|
else {
|
|
2832
2833
|
const { from: l, to: g } = d, { row: h, column: m } = l, { row: p, column: f } = g;
|
|
2833
2834
|
for (let _ = 0; _ < e.length; _++) {
|
|
2834
|
-
const S = e[_], { startRow:
|
|
2835
|
-
if (p <
|
|
2835
|
+
const S = e[_], { startRow: I, endRow: b, startColumn: v, endColumn: D } = S;
|
|
2836
|
+
if (p < I || f < v)
|
|
2836
2837
|
continue;
|
|
2837
|
-
if (c === O.Position && (h <=
|
|
2838
|
+
if (c === O.Position && (h <= I && p >= b || m <= v && f >= D)) {
|
|
2838
2839
|
this._remainDrawingSize(u, s, a);
|
|
2839
2840
|
continue;
|
|
2840
2841
|
}
|
|
@@ -2863,11 +2864,11 @@ let sn = class extends ie {
|
|
|
2863
2864
|
return { unitId: e, subUnitId: n };
|
|
2864
2865
|
}
|
|
2865
2866
|
_moveRangeInterceptor(i) {
|
|
2866
|
-
var
|
|
2867
|
+
var I, b;
|
|
2867
2868
|
const { toRange: t, fromRange: e } = i, n = ae(this._univerInstanceService);
|
|
2868
2869
|
if (!n)
|
|
2869
2870
|
return { redos: [], undos: [] };
|
|
2870
|
-
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();
|
|
2871
2872
|
if (!o)
|
|
2872
2873
|
return { redos: [], undos: [] };
|
|
2873
2874
|
const a = Vn(o, e);
|
|
@@ -2881,13 +2882,13 @@ let sn = class extends ie {
|
|
|
2881
2882
|
const { transform: w } = D;
|
|
2882
2883
|
if (!w)
|
|
2883
2884
|
return;
|
|
2884
|
-
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 } = {
|
|
2885
2886
|
drawingStartX: y,
|
|
2886
2887
|
drawingEndX: y + E,
|
|
2887
|
-
drawingStartY:
|
|
2888
|
-
drawingEndY:
|
|
2888
|
+
drawingStartY: C,
|
|
2889
|
+
drawingEndY: C + T
|
|
2889
2890
|
};
|
|
2890
|
-
d <= M && R <= u && c <= N &&
|
|
2891
|
+
d <= M && R <= u && c <= N && F <= l && h.push(D);
|
|
2891
2892
|
});
|
|
2892
2893
|
const m = [], p = [], f = t.startRow - e.startRow, _ = t.startColumn - e.startColumn, S = h.map((v) => {
|
|
2893
2894
|
const D = v.sheetTransform, w = {
|
|
@@ -2917,22 +2918,22 @@ let sn = class extends ie {
|
|
|
2917
2918
|
const m = c[h], { sheetTransform: p, transform: f, anchorType: _ = O.Position } = m;
|
|
2918
2919
|
if (p == null || f == null)
|
|
2919
2920
|
return;
|
|
2920
|
-
let S,
|
|
2921
|
+
let S, I;
|
|
2921
2922
|
if (t === "insert") {
|
|
2922
2923
|
const v = this._expandRow(p, f, o, a, _);
|
|
2923
|
-
S = v == null ? void 0 : v.newSheetTransform,
|
|
2924
|
+
S = v == null ? void 0 : v.newSheetTransform, I = v == null ? void 0 : v.newTransform;
|
|
2924
2925
|
} else {
|
|
2925
2926
|
const { from: v, to: D } = p, { row: w } = v, { row: y } = D;
|
|
2926
2927
|
if (_ === O.Both && w >= o && y <= a)
|
|
2927
2928
|
g.push({ unitId: n, subUnitId: r, drawingId: h });
|
|
2928
2929
|
else {
|
|
2929
|
-
const
|
|
2930
|
-
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;
|
|
2931
2932
|
}
|
|
2932
2933
|
}
|
|
2933
|
-
if (!S || !
|
|
2934
|
+
if (!S || !I)
|
|
2934
2935
|
return;
|
|
2935
|
-
const b = { unitId: n, subUnitId: r, drawingId: h, transform:
|
|
2936
|
+
const b = { unitId: n, subUnitId: r, drawingId: h, transform: I, sheetTransform: S };
|
|
2936
2937
|
l.push(b);
|
|
2937
2938
|
}), l.length === 0 && g.length === 0)
|
|
2938
2939
|
return { redos: [], undos: [] };
|
|
@@ -2958,22 +2959,22 @@ let sn = class extends ie {
|
|
|
2958
2959
|
const m = c[h], { sheetTransform: p, transform: f, anchorType: _ = O.Position } = m;
|
|
2959
2960
|
if (p == null || f == null)
|
|
2960
2961
|
return;
|
|
2961
|
-
let S,
|
|
2962
|
+
let S, I;
|
|
2962
2963
|
if (t === "insert") {
|
|
2963
2964
|
const v = this._expandCol(p, f, o, a, _);
|
|
2964
|
-
S = v == null ? void 0 : v.newSheetTransform,
|
|
2965
|
+
S = v == null ? void 0 : v.newSheetTransform, I = v == null ? void 0 : v.newTransform;
|
|
2965
2966
|
} else {
|
|
2966
2967
|
const { from: v, to: D } = p, { column: w } = v, { column: y } = D;
|
|
2967
2968
|
if (_ === O.Both && w >= o && y <= a)
|
|
2968
2969
|
g.push({ unitId: n, subUnitId: r, drawingId: h });
|
|
2969
2970
|
else {
|
|
2970
|
-
const
|
|
2971
|
-
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;
|
|
2972
2973
|
}
|
|
2973
2974
|
}
|
|
2974
|
-
if (!S || !
|
|
2975
|
+
if (!S || !I)
|
|
2975
2976
|
return;
|
|
2976
|
-
const b = { unitId: n, subUnitId: r, drawingId: h, transform:
|
|
2977
|
+
const b = { unitId: n, subUnitId: r, drawingId: h, transform: I, sheetTransform: S };
|
|
2977
2978
|
l.push(b);
|
|
2978
2979
|
}), l.length === 0 && g.length === 0)
|
|
2979
2980
|
return { redos: [], undos: [] };
|
|
@@ -2991,7 +2992,7 @@ let sn = class extends ie {
|
|
|
2991
2992
|
const s = n - e + 1, { from: o, to: a } = i, { column: d } = o, { column: u } = a;
|
|
2992
2993
|
if (r === O.None)
|
|
2993
2994
|
return {
|
|
2994
|
-
newSheetTransform:
|
|
2995
|
+
newSheetTransform: $({ ...t }, this._selectionRenderService),
|
|
2995
2996
|
newTransform: t
|
|
2996
2997
|
};
|
|
2997
2998
|
let c = null, l = null;
|
|
@@ -2999,7 +3000,7 @@ let sn = class extends ie {
|
|
|
2999
3000
|
const g = this._skeletonManagerService.attachRangeWithCoord({ startColumn: e, endColumn: n, startRow: o.row, endRow: a.row });
|
|
3000
3001
|
if (g == null)
|
|
3001
3002
|
return;
|
|
3002
|
-
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);
|
|
3003
3004
|
} else if (u >= n)
|
|
3004
3005
|
if (r === O.Both)
|
|
3005
3006
|
c = {
|
|
@@ -3008,7 +3009,7 @@ let sn = class extends ie {
|
|
|
3008
3009
|
}, l = z(c, this._selectionRenderService, this._skeletonManagerService);
|
|
3009
3010
|
else
|
|
3010
3011
|
return {
|
|
3011
|
-
newSheetTransform:
|
|
3012
|
+
newSheetTransform: $({ ...t }, this._selectionRenderService),
|
|
3012
3013
|
newTransform: t
|
|
3013
3014
|
};
|
|
3014
3015
|
return c != null && l != null ? {
|
|
@@ -3020,7 +3021,7 @@ let sn = class extends ie {
|
|
|
3020
3021
|
const s = n - e + 1, { from: o, to: a } = i, { column: d } = o, { column: u } = a;
|
|
3021
3022
|
if (r === O.None)
|
|
3022
3023
|
return {
|
|
3023
|
-
newSheetTransform:
|
|
3024
|
+
newSheetTransform: $({ ...t }, this._selectionRenderService),
|
|
3024
3025
|
newTransform: t
|
|
3025
3026
|
};
|
|
3026
3027
|
let c = null, l = null;
|
|
@@ -3040,7 +3041,7 @@ let sn = class extends ie {
|
|
|
3040
3041
|
}, l = z(c, this._selectionRenderService, this._skeletonManagerService);
|
|
3041
3042
|
else
|
|
3042
3043
|
return {
|
|
3043
|
-
newSheetTransform:
|
|
3044
|
+
newSheetTransform: $({ ...t }, this._selectionRenderService),
|
|
3044
3045
|
newTransform: t
|
|
3045
3046
|
};
|
|
3046
3047
|
else if (d >= e && d <= n) {
|
|
@@ -3052,7 +3053,7 @@ let sn = class extends ie {
|
|
|
3052
3053
|
return;
|
|
3053
3054
|
l = { ...t, left: (t.left || 0) - g.endX + g.startX - i.from.columnOffset };
|
|
3054
3055
|
}
|
|
3055
|
-
c =
|
|
3056
|
+
c = $(l, this._selectionRenderService);
|
|
3056
3057
|
} else if (u >= e && u <= n && r === O.Both) {
|
|
3057
3058
|
const g = this._skeletonManagerService.attachRangeWithCoord({
|
|
3058
3059
|
startColumn: e - 1,
|
|
@@ -3077,7 +3078,7 @@ let sn = class extends ie {
|
|
|
3077
3078
|
const s = n - e + 1, { from: o, to: a } = i, { row: d } = o, { row: u } = a;
|
|
3078
3079
|
if (r === O.None)
|
|
3079
3080
|
return {
|
|
3080
|
-
newSheetTransform:
|
|
3081
|
+
newSheetTransform: $({ ...t }, this._selectionRenderService),
|
|
3081
3082
|
newTransform: t
|
|
3082
3083
|
};
|
|
3083
3084
|
let c = null, l = null;
|
|
@@ -3085,7 +3086,7 @@ let sn = class extends ie {
|
|
|
3085
3086
|
const g = this._skeletonManagerService.attachRangeWithCoord({ startRow: e, endRow: n, startColumn: o.column, endColumn: a.column });
|
|
3086
3087
|
if (g == null)
|
|
3087
3088
|
return;
|
|
3088
|
-
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);
|
|
3089
3090
|
} else if (u >= n)
|
|
3090
3091
|
if (r === O.Both)
|
|
3091
3092
|
c = {
|
|
@@ -3097,7 +3098,7 @@ let sn = class extends ie {
|
|
|
3097
3098
|
}, l = z(c, this._selectionRenderService, this._skeletonManagerService);
|
|
3098
3099
|
else
|
|
3099
3100
|
return {
|
|
3100
|
-
newSheetTransform:
|
|
3101
|
+
newSheetTransform: $({ ...t }, this._selectionRenderService),
|
|
3101
3102
|
newTransform: t
|
|
3102
3103
|
};
|
|
3103
3104
|
return c != null && l != null ? {
|
|
@@ -3109,7 +3110,7 @@ let sn = class extends ie {
|
|
|
3109
3110
|
const s = n - e + 1, { from: o, to: a } = i, { row: d } = o, { row: u } = a;
|
|
3110
3111
|
if (r === O.None)
|
|
3111
3112
|
return {
|
|
3112
|
-
newSheetTransform:
|
|
3113
|
+
newSheetTransform: $({ ...t }, this._selectionRenderService),
|
|
3113
3114
|
newTransform: t
|
|
3114
3115
|
};
|
|
3115
3116
|
let c = null, l = null;
|
|
@@ -3129,7 +3130,7 @@ let sn = class extends ie {
|
|
|
3129
3130
|
}, l = z(c, this._selectionRenderService, this._skeletonManagerService);
|
|
3130
3131
|
else
|
|
3131
3132
|
return {
|
|
3132
|
-
newSheetTransform:
|
|
3133
|
+
newSheetTransform: $({ ...t }, this._selectionRenderService),
|
|
3133
3134
|
newTransform: t
|
|
3134
3135
|
};
|
|
3135
3136
|
else if (d >= e && d <= n) {
|
|
@@ -3141,7 +3142,7 @@ let sn = class extends ie {
|
|
|
3141
3142
|
return;
|
|
3142
3143
|
l = { ...t, top: (t.top || 0) - g.endY + g.startY - i.from.rowOffset };
|
|
3143
3144
|
}
|
|
3144
|
-
c =
|
|
3145
|
+
c = $(l, this._selectionRenderService);
|
|
3145
3146
|
} else if (u >= e && u <= n && r === O.Both) {
|
|
3146
3147
|
const g = this._skeletonManagerService.attachRangeWithCoord({ startColumn: o.column, endColumn: o.column, startRow: e - 1, endRow: e - 1 });
|
|
3147
3148
|
if (g == null)
|
|
@@ -3163,7 +3164,7 @@ let sn = class extends ie {
|
|
|
3163
3164
|
// but the skeleton changes like other render modules. These two signals are not equivalent.
|
|
3164
3165
|
// As a temp solution, I subscribed to activate$ here.
|
|
3165
3166
|
this._commandService.onCommandExecuted((i) => {
|
|
3166
|
-
if (i.id ===
|
|
3167
|
+
if (i.id === rs.id) {
|
|
3167
3168
|
const { unitId: t, subUnitId: e } = i.params;
|
|
3168
3169
|
this._updateDrawings(t, e);
|
|
3169
3170
|
}
|
|
@@ -3214,7 +3215,7 @@ let sn = class extends ie {
|
|
|
3214
3215
|
_sheetRefreshListener() {
|
|
3215
3216
|
this.disposeWithMe(
|
|
3216
3217
|
this._commandService.onCommandExecuted((i) => {
|
|
3217
|
-
|
|
3218
|
+
Ys.includes(i.id) && requestIdleCallback(() => {
|
|
3218
3219
|
const t = i.params, { unitId: e, subUnitId: n, ranges: r } = t;
|
|
3219
3220
|
this._refreshDrawingTransform(e, n, r);
|
|
3220
3221
|
});
|
|
@@ -3229,11 +3230,11 @@ let sn = class extends ie {
|
|
|
3229
3230
|
return !0;
|
|
3230
3231
|
const { from: c, to: l } = a, { row: g, column: h } = c, { row: m, column: p } = l;
|
|
3231
3232
|
for (let f = 0; f < e.length; f++) {
|
|
3232
|
-
const _ = e[f], { startRow: S, endRow:
|
|
3233
|
+
const _ = e[f], { startRow: S, endRow: I, startColumn: b, endColumn: v } = _;
|
|
3233
3234
|
if (Hr.intersects(
|
|
3234
3235
|
{
|
|
3235
3236
|
startRow: S,
|
|
3236
|
-
endRow:
|
|
3237
|
+
endRow: I,
|
|
3237
3238
|
startColumn: b,
|
|
3238
3239
|
endColumn: v
|
|
3239
3240
|
},
|
|
@@ -3243,7 +3244,7 @@ let sn = class extends ie {
|
|
|
3243
3244
|
startColumn: h,
|
|
3244
3245
|
endColumn: p
|
|
3245
3246
|
}
|
|
3246
|
-
) || g >
|
|
3247
|
+
) || g > I || h > v) {
|
|
3247
3248
|
const D = u === O.Position, w = z(a, this._selectionRenderService, this._skeletonManagerService);
|
|
3248
3249
|
r.push({
|
|
3249
3250
|
...o,
|
|
@@ -3259,7 +3260,7 @@ let sn = class extends ie {
|
|
|
3259
3260
|
}), r.length !== 0 && (this._drawingManagerService.refreshTransform(r), this._commandService.syncExecuteCommand(L.id, [i]));
|
|
3260
3261
|
}
|
|
3261
3262
|
};
|
|
3262
|
-
sn =
|
|
3263
|
+
sn = Fs([
|
|
3263
3264
|
pe(1, q),
|
|
3264
3265
|
pe(2, G),
|
|
3265
3266
|
pe(3, Ge),
|
|
@@ -3277,7 +3278,7 @@ var re = function() {
|
|
|
3277
3278
|
}
|
|
3278
3279
|
return i;
|
|
3279
3280
|
}, re.apply(this, arguments);
|
|
3280
|
-
},
|
|
3281
|
+
}, Gs = function(i, t) {
|
|
3281
3282
|
var e = {};
|
|
3282
3283
|
for (var n in i) Object.prototype.hasOwnProperty.call(i, n) && t.indexOf(n) < 0 && (e[n] = i[n]);
|
|
3283
3284
|
if (i != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -3285,15 +3286,15 @@ var re = function() {
|
|
|
3285
3286
|
t.indexOf(n[r]) < 0 && Object.prototype.propertyIsEnumerable.call(i, n[r]) && (e[n[r]] = i[n[r]]);
|
|
3286
3287
|
return e;
|
|
3287
3288
|
}, br = hr(function(i, t) {
|
|
3288
|
-
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()));
|
|
3289
3290
|
return Rr(e, "".concat(n), { defIds: e.defIds, idSuffix: d.current }, re({ ref: t, className: a }, o), s);
|
|
3290
3291
|
});
|
|
3291
3292
|
function Rr(i, t, e, n, r) {
|
|
3292
|
-
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) {
|
|
3293
3294
|
return Rr(s, "".concat(t, "-").concat(i.tag, "-").concat(o), e, void 0, r);
|
|
3294
3295
|
}));
|
|
3295
3296
|
}
|
|
3296
|
-
function
|
|
3297
|
+
function Xs(i, t, e) {
|
|
3297
3298
|
var n = re({}, i.attrs);
|
|
3298
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) {
|
|
3299
3300
|
var o = s[0], a = s[1];
|
|
@@ -3305,21 +3306,21 @@ function Ys(i, t, e) {
|
|
|
3305
3306
|
typeof a == "string" && (n[o] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
|
|
3306
3307
|
})), n;
|
|
3307
3308
|
}
|
|
3308
|
-
function
|
|
3309
|
+
function Vs(i, t) {
|
|
3309
3310
|
var e, n = t.defIds;
|
|
3310
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) {
|
|
3311
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;
|
|
3312
3313
|
}) }) : i;
|
|
3313
3314
|
}
|
|
3314
|
-
function
|
|
3315
|
+
function Hs() {
|
|
3315
3316
|
return Math.random().toString(36).substring(2, 8);
|
|
3316
3317
|
}
|
|
3317
3318
|
br.displayName = "UniverIcon";
|
|
3318
|
-
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) {
|
|
3319
3320
|
return gr(br, Object.assign({}, i, {
|
|
3320
3321
|
id: "add-image-single",
|
|
3321
3322
|
ref: t,
|
|
3322
|
-
icon:
|
|
3323
|
+
icon: zs
|
|
3323
3324
|
}));
|
|
3324
3325
|
});
|
|
3325
3326
|
Mr.displayName = "AddImageSingle";
|
|
@@ -3359,7 +3360,7 @@ const yr = {
|
|
|
3359
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), {
|
|
3360
3361
|
...c,
|
|
3361
3362
|
transform: g,
|
|
3362
|
-
sheetTransform:
|
|
3363
|
+
sheetTransform: $(g, r)
|
|
3363
3364
|
};
|
|
3364
3365
|
}).filter((c) => c != null);
|
|
3365
3366
|
return e.syncExecuteCommand(jt.id, {
|
|
@@ -3368,100 +3369,98 @@ const yr = {
|
|
|
3368
3369
|
}) ? (e.syncExecuteCommand(L.id, [a]), !0) : !1;
|
|
3369
3370
|
}
|
|
3370
3371
|
}, Er = "addition-and-subtraction-single", Tr = "sheet.menu.image";
|
|
3371
|
-
function
|
|
3372
|
+
function Ks(i) {
|
|
3372
3373
|
return {
|
|
3373
3374
|
id: Tr,
|
|
3374
3375
|
type: cn.SUBITEMS,
|
|
3375
3376
|
icon: Er,
|
|
3376
3377
|
tooltip: "sheetImage.title",
|
|
3377
|
-
hidden$: an(i,
|
|
3378
|
-
disabled$:
|
|
3378
|
+
hidden$: an(i, x.UNIVER_SHEET),
|
|
3379
|
+
disabled$: Pi(i, { workbookTypes: [Kt], worksheetTypes: [Zt], rangeTypes: [is] })
|
|
3379
3380
|
};
|
|
3380
3381
|
}
|
|
3381
|
-
function
|
|
3382
|
+
function Zs(i) {
|
|
3382
3383
|
return {
|
|
3383
3384
|
id: Bt.id,
|
|
3384
3385
|
title: "sheetImage.upload.float",
|
|
3385
3386
|
type: cn.BUTTON,
|
|
3386
|
-
hidden$: an(i,
|
|
3387
|
+
hidden$: an(i, x.UNIVER_SHEET)
|
|
3387
3388
|
};
|
|
3388
3389
|
}
|
|
3389
|
-
function
|
|
3390
|
+
function Js(i) {
|
|
3390
3391
|
return {
|
|
3391
3392
|
id: ln.id,
|
|
3392
3393
|
title: "sheetImage.upload.cell",
|
|
3393
3394
|
type: cn.BUTTON,
|
|
3394
|
-
hidden$: an(i,
|
|
3395
|
+
hidden$: an(i, x.UNIVER_SHEET)
|
|
3395
3396
|
};
|
|
3396
3397
|
}
|
|
3397
|
-
const
|
|
3398
|
-
var
|
|
3398
|
+
const qs = (i) => {
|
|
3399
|
+
var S;
|
|
3399
3400
|
const t = Qe(G), e = Qe(nt), n = Qe(se), r = Qe(q), { drawings: s } = i, o = s[0];
|
|
3400
3401
|
if (o == null)
|
|
3401
3402
|
return;
|
|
3402
3403
|
const { unitId: a } = o, d = r.getRenderById(a), u = d == null ? void 0 : d.scene;
|
|
3403
3404
|
if (u == null)
|
|
3404
3405
|
return;
|
|
3405
|
-
const c = u.getTransformerByCreate(), [l, g] = en(!0), h = (
|
|
3406
|
-
function f(
|
|
3407
|
-
const
|
|
3408
|
-
return
|
|
3409
|
-
const { oKey:
|
|
3410
|
-
if (
|
|
3411
|
-
return
|
|
3412
|
-
const { unitId:
|
|
3413
|
-
|
|
3414
|
-
unitId:
|
|
3415
|
-
subUnitId:
|
|
3416
|
-
drawingId:
|
|
3417
|
-
anchorType:
|
|
3418
|
-
sheetTransform:
|
|
3419
|
-
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
|
|
3420
3421
|
});
|
|
3421
|
-
}),
|
|
3422
|
+
}), v;
|
|
3422
3423
|
}
|
|
3423
3424
|
fr(() => {
|
|
3424
|
-
const
|
|
3425
|
-
|
|
3426
|
-
}),
|
|
3427
|
-
var
|
|
3428
|
-
const { objects:
|
|
3429
|
-
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)
|
|
3430
3431
|
g(!1);
|
|
3431
|
-
else if (
|
|
3432
|
+
else if (w.length >= 1) {
|
|
3432
3433
|
g(!0);
|
|
3433
|
-
const
|
|
3434
|
-
p(
|
|
3434
|
+
const C = ((y = w[0]) == null ? void 0 : y.anchorType) || O.Position;
|
|
3435
|
+
p(C);
|
|
3435
3436
|
}
|
|
3436
3437
|
});
|
|
3437
3438
|
return () => {
|
|
3438
|
-
|
|
3439
|
+
b.unsubscribe(), I.unsubscribe();
|
|
3439
3440
|
};
|
|
3440
3441
|
}, []);
|
|
3441
|
-
function _(
|
|
3442
|
-
p(
|
|
3443
|
-
const
|
|
3444
|
-
if (
|
|
3442
|
+
function _(I) {
|
|
3443
|
+
p(I);
|
|
3444
|
+
const b = n.getFocusDrawings();
|
|
3445
|
+
if (b.length === 0)
|
|
3445
3446
|
return;
|
|
3446
|
-
const
|
|
3447
|
-
unitId:
|
|
3448
|
-
subUnitId:
|
|
3449
|
-
drawingId:
|
|
3450
|
-
anchorType:
|
|
3447
|
+
const v = b.map((D) => ({
|
|
3448
|
+
unitId: D.unitId,
|
|
3449
|
+
subUnitId: D.subUnitId,
|
|
3450
|
+
drawingId: D.drawingId,
|
|
3451
|
+
anchorType: I
|
|
3451
3452
|
}));
|
|
3452
3453
|
t.executeCommand(jt.id, {
|
|
3453
|
-
unitId:
|
|
3454
|
-
drawings:
|
|
3454
|
+
unitId: b[0].unitId,
|
|
3455
|
+
drawings: v
|
|
3455
3456
|
});
|
|
3456
3457
|
}
|
|
3457
3458
|
return /* @__PURE__ */ Qt(
|
|
3458
3459
|
"div",
|
|
3459
3460
|
{
|
|
3460
|
-
className:
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
`,
|
|
3464
|
-
style: { display: ((b) => b ? "block" : "none")(l) },
|
|
3461
|
+
className: vi("univer-relative univer-mt-5 univer-w-full", Ii, {
|
|
3462
|
+
"univer-hidden": !l
|
|
3463
|
+
}),
|
|
3465
3464
|
children: [
|
|
3466
3465
|
/* @__PURE__ */ Z(
|
|
3467
3466
|
"div",
|
|
@@ -3478,7 +3477,7 @@ const Zs = (i) => {
|
|
|
3478
3477
|
className: `
|
|
3479
3478
|
univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start univer-justify-start
|
|
3480
3479
|
`,
|
|
3481
|
-
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: [
|
|
3482
3481
|
/* @__PURE__ */ Z(Gt, { value: O.Both, children: e.t("drawing-anchor.both") }),
|
|
3483
3482
|
/* @__PURE__ */ Z(Gt, { value: O.Position, children: e.t("drawing-anchor.position") }),
|
|
3484
3483
|
/* @__PURE__ */ Z(Gt, { value: O.None, children: e.t("drawing-anchor.none") })
|
|
@@ -3488,7 +3487,7 @@ const Zs = (i) => {
|
|
|
3488
3487
|
]
|
|
3489
3488
|
}
|
|
3490
3489
|
);
|
|
3491
|
-
},
|
|
3490
|
+
}, Qs = () => {
|
|
3492
3491
|
const i = Qe(se), t = i.getFocusDrawings(), [e, n] = en(t);
|
|
3493
3492
|
return fr(() => {
|
|
3494
3493
|
const r = i.focus$.subscribe((s) => {
|
|
@@ -3499,20 +3498,20 @@ const Zs = (i) => {
|
|
|
3499
3498
|
};
|
|
3500
3499
|
}, []), !!(e != null && e.length) && /* @__PURE__ */ Qt("div", { className: "univer-p-2 univer-text-center univer-text-sm", children: [
|
|
3501
3500
|
/* @__PURE__ */ Z(ui, { drawings: e }),
|
|
3502
|
-
/* @__PURE__ */ Z(
|
|
3501
|
+
/* @__PURE__ */ Z(qs, { drawings: e })
|
|
3503
3502
|
] });
|
|
3504
|
-
},
|
|
3505
|
-
[
|
|
3503
|
+
}, eo = {
|
|
3504
|
+
[xi.FORMULAS_INSERT]: {
|
|
3506
3505
|
[Tr]: {
|
|
3507
3506
|
order: 3,
|
|
3508
|
-
menuItemFactory:
|
|
3507
|
+
menuItemFactory: Ks,
|
|
3509
3508
|
[Bt.id]: {
|
|
3510
3509
|
order: 0,
|
|
3511
|
-
menuItemFactory:
|
|
3510
|
+
menuItemFactory: Zs
|
|
3512
3511
|
},
|
|
3513
3512
|
[ln.id]: {
|
|
3514
3513
|
order: 1,
|
|
3515
|
-
menuItemFactory:
|
|
3514
|
+
menuItemFactory: Js
|
|
3516
3515
|
}
|
|
3517
3516
|
}
|
|
3518
3517
|
}
|
|
@@ -3520,7 +3519,7 @@ const Zs = (i) => {
|
|
|
3520
3519
|
function st(i) {
|
|
3521
3520
|
return !i.getContextValue(zr) && !i.getContextValue(Kr) && !i.getContextValue(Zr) && i.getContextValue(xe);
|
|
3522
3521
|
}
|
|
3523
|
-
const
|
|
3522
|
+
const to = {
|
|
3524
3523
|
id: it.id,
|
|
3525
3524
|
description: "shortcut.drawing-move-down",
|
|
3526
3525
|
group: "4_drawing-view",
|
|
@@ -3530,7 +3529,7 @@ const Qs = {
|
|
|
3530
3529
|
staticParameters: {
|
|
3531
3530
|
direction: ve.DOWN
|
|
3532
3531
|
}
|
|
3533
|
-
},
|
|
3532
|
+
}, no = {
|
|
3534
3533
|
id: it.id,
|
|
3535
3534
|
description: "shortcut.drawing-move-up",
|
|
3536
3535
|
group: "4_drawing-view",
|
|
@@ -3540,7 +3539,7 @@ const Qs = {
|
|
|
3540
3539
|
staticParameters: {
|
|
3541
3540
|
direction: ve.UP
|
|
3542
3541
|
}
|
|
3543
|
-
},
|
|
3542
|
+
}, ro = {
|
|
3544
3543
|
id: it.id,
|
|
3545
3544
|
description: "shortcut.drawing-move-left",
|
|
3546
3545
|
group: "4_drawing-view",
|
|
@@ -3550,7 +3549,7 @@ const Qs = {
|
|
|
3550
3549
|
staticParameters: {
|
|
3551
3550
|
direction: ve.LEFT
|
|
3552
3551
|
}
|
|
3553
|
-
},
|
|
3552
|
+
}, io = {
|
|
3554
3553
|
id: it.id,
|
|
3555
3554
|
description: "shortcut.drawing-move-right",
|
|
3556
3555
|
group: "4_drawing-view",
|
|
@@ -3560,7 +3559,7 @@ const Qs = {
|
|
|
3560
3559
|
staticParameters: {
|
|
3561
3560
|
direction: ve.RIGHT
|
|
3562
3561
|
}
|
|
3563
|
-
},
|
|
3562
|
+
}, so = {
|
|
3564
3563
|
id: yr.id,
|
|
3565
3564
|
description: "shortcut.drawing-delete",
|
|
3566
3565
|
group: "4_drawing-view",
|
|
@@ -3569,8 +3568,8 @@ const Qs = {
|
|
|
3569
3568
|
binding: Fe.DELETE,
|
|
3570
3569
|
mac: Fe.BACKSPACE
|
|
3571
3570
|
};
|
|
3572
|
-
var
|
|
3573
|
-
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--)
|
|
3574
3573
|
(o = i[s]) && (r = o(r) || r);
|
|
3575
3574
|
return r;
|
|
3576
3575
|
}, We = (i, t) => (e, n) => t(e, n, i);
|
|
@@ -3580,10 +3579,10 @@ let Pt = class extends ie {
|
|
|
3580
3579
|
}
|
|
3581
3580
|
_initCustomComponents() {
|
|
3582
3581
|
const i = this._componentManager;
|
|
3583
|
-
this.disposeWithMe(i.register(Er, Mr)), this.disposeWithMe(i.register(mr,
|
|
3582
|
+
this.disposeWithMe(i.register(Er, Mr)), this.disposeWithMe(i.register(mr, Qs));
|
|
3584
3583
|
}
|
|
3585
3584
|
_initMenus() {
|
|
3586
|
-
this._menuManagerService.mergeMenu(
|
|
3585
|
+
this._menuManagerService.mergeMenu(eo);
|
|
3587
3586
|
}
|
|
3588
3587
|
_initCommands() {
|
|
3589
3588
|
[
|
|
@@ -3605,11 +3604,11 @@ let Pt = class extends ie {
|
|
|
3605
3604
|
_initShortcuts() {
|
|
3606
3605
|
[
|
|
3607
3606
|
// sheet drawing shortcuts
|
|
3608
|
-
Qs,
|
|
3609
|
-
eo,
|
|
3610
3607
|
to,
|
|
3611
3608
|
no,
|
|
3612
|
-
ro
|
|
3609
|
+
ro,
|
|
3610
|
+
io,
|
|
3611
|
+
so
|
|
3613
3612
|
].forEach((i) => {
|
|
3614
3613
|
this.disposeWithMe(this._shortcutService.registerShortcut(i));
|
|
3615
3614
|
});
|
|
@@ -3618,20 +3617,20 @@ let Pt = class extends ie {
|
|
|
3618
3617
|
this._initCommands(), this._initCustomComponents(), this._initMenus(), this._initShortcuts();
|
|
3619
3618
|
}
|
|
3620
3619
|
};
|
|
3621
|
-
Pt =
|
|
3620
|
+
Pt = ao([
|
|
3622
3621
|
We(0, A(zn)),
|
|
3623
|
-
We(1,
|
|
3622
|
+
We(1, Fi),
|
|
3624
3623
|
We(2, G),
|
|
3625
|
-
We(3,
|
|
3624
|
+
We(3, Li),
|
|
3626
3625
|
We(4, se),
|
|
3627
3626
|
We(5, A(dn))
|
|
3628
3627
|
], Pt);
|
|
3629
|
-
var
|
|
3630
|
-
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--)
|
|
3631
3630
|
(o = i[s]) && (r = o(r) || r);
|
|
3632
3631
|
return r;
|
|
3633
|
-
}, Vt = (i, t) => (e, n) => t(e, n, i), Or = (i, t, e) =>
|
|
3634
|
-
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";
|
|
3635
3634
|
let At = class extends Qr {
|
|
3636
3635
|
constructor(i = $n, t, e, n) {
|
|
3637
3636
|
super(), this._config = i, this._injector = t, this._renderManagerService = e, this._configService = n;
|
|
@@ -3640,7 +3639,7 @@ let At = class extends Qr {
|
|
|
3640
3639
|
$n,
|
|
3641
3640
|
this._config
|
|
3642
3641
|
);
|
|
3643
|
-
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);
|
|
3644
3643
|
}
|
|
3645
3644
|
onStarting() {
|
|
3646
3645
|
ti(this._injector, [
|
|
@@ -3682,13 +3681,13 @@ let At = class extends Qr {
|
|
|
3682
3681
|
[nn],
|
|
3683
3682
|
[tn]
|
|
3684
3683
|
].forEach((i) => {
|
|
3685
|
-
this.disposeWithMe(this._renderManagerService.registerRenderModule(
|
|
3684
|
+
this.disposeWithMe(this._renderManagerService.registerRenderModule(x.UNIVER_SHEET, i));
|
|
3686
3685
|
});
|
|
3687
3686
|
}
|
|
3688
3687
|
};
|
|
3689
|
-
Or(At, "type",
|
|
3690
|
-
Or(At, "pluginName",
|
|
3691
|
-
At =
|
|
3688
|
+
Or(At, "type", x.UNIVER_SHEET);
|
|
3689
|
+
Or(At, "pluginName", go);
|
|
3690
|
+
At = ho([
|
|
3692
3691
|
Jr(oi, ri, hi, pi),
|
|
3693
3692
|
Vt(1, A(Ye)),
|
|
3694
3693
|
Vt(2, q),
|