@univerjs/sheets-drawing-ui 0.9.1-nightly.202507101607 → 0.9.2-nightly.202507111607
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +2 -2
- package/lib/es/index.js +551 -544
- package/lib/index.js +551 -544
- package/lib/types/services/canvas-float-dom-manager.service.d.ts +1 -0
- package/lib/umd/index.js +1 -1
- package/package.json +13 -13
package/lib/es/index.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
var yr = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var ee = (i, t, e) =>
|
|
4
|
-
import { precisionTo as mt, IRenderManagerService as J, transformObjectOutOfGroup as
|
|
5
|
-
import { convertPositionSheetOverGridToAbsolute as Pr, SheetSkeletonManagerService as V, ISheetSelectionRenderService as
|
|
6
|
-
import { CommandType as Z, ICommandService as G, IUndoRedoService as
|
|
2
|
+
var Tr = (i, t, e) => t in i ? yr(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
+
var ee = (i, t, e) => Tr(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { precisionTo as mt, IRenderManagerService as J, transformObjectOutOfGroup as Er, getGroupState as Or, getCurrentTypeOfRenderer as sn, CURSOR_TYPE as Ur, RENDER_CLASS_TYPE as Ue, Rect as Pe, ObjectType as mn, DRAWING_OBJECT_LAYER_INDEX as Ft, SHEET_VIEWPORT_KEY as xn } from "@univerjs/engine-render";
|
|
5
|
+
import { convertPositionSheetOverGridToAbsolute as Pr, SheetSkeletonManagerService as V, ISheetSelectionRenderService as xe, attachRangeWithCoord as Yn, SheetCanvasPopManagerService as Ar, HoverManagerService as Nr, IEditorBridgeService as kr, IAutoFillService as Wr, EditingRenderController as Br, SetCellEditVisibleOperation as pn, PREDEFINED_HOOK_NAME as Be, COPY_TYPE as ve, discreteRangeToRange as wn, virtualizeDiscreteRanges as jr, ISheetClipboardService as $r, SetZoomRatioOperation as _n, SetScrollOperation as Fr, SheetPrintInterceptorService as xr, getCurrentRangeDisable$ as Yr } from "@univerjs/sheets-ui";
|
|
6
|
+
import { CommandType as Z, ICommandService as G, IUndoRedoService as Ye, sequenceExecute as Xn, DrawingTypeEnum as B, ArrangeTypeEnum as pt, Inject as A, IContextService as Gn, LocaleService as tt, Injector as Xe, Disposable as ne, createDocumentModelWithStyle as Vt, ObjectRelativeFromV as Sn, ObjectRelativeFromH as vn, WrapTextType as In, PositionedObjectLayoutType as Cn, BooleanNumber as Dn, BuildTextUtils as Ht, ImageSourceType as Rn, generateRandomId as Dt, FOCUSING_COMMON_DRAWINGS as $e, IUniverInstanceService as Se, UniverInstanceType as F, Direction as _e, IImageIoService as Xr, RxDisposable as Gr, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as Ze, DOCS_ZEN_EDITOR_UNIT_ID_KEY as je, InterceptorEffectEnum as Lr, ObjectMatrix as Vr, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as Hr, Tools as Re, IPermissionService as zr, UserManagerService as Kr, LifecycleService as Jr, LifecycleStages as Zr, DisposableCollection as wt, fromEventSubject as qr, PRINT_CHART_COMPONENT_KEY as Qr, Rectangle as ei, FOCUSING_FX_BAR_EDITOR as ti, EDITOR_ACTIVATED as ni, FOCUSING_PANEL_EDITOR as ri, DependentOn as ii, IConfigService as si, Plugin as oi, merge as ai, registerDependencies as ci, touchDependencies as xt } from "@univerjs/core";
|
|
7
7
|
import { ISheetDrawingService as re, DrawingApplyType as U, SetDrawingApplyMutation as P, SheetDrawingAnchorType as O, UniverSheetsDrawingPlugin as di } from "@univerjs/sheets-drawing";
|
|
8
8
|
import { SheetInterceptorService as At, SheetsSelectionsService as on, SetRangeValuesCommand as bn, getSheetCommandTarget as se, INTERCEPTOR_POINT as li, InterceptCellContentPriority as ui, WorkbookViewPermission as Mn, WorksheetViewPermission as yn, WorkbookEditablePermission as zt, WorksheetEditPermission as Kt, SetFrozenMutation as hi, SetWorksheetRowAutoHeightMutation as gi, COMMAND_LISTENER_SKELETON_CHANGE as fi, InsertRowCommand as Ln, InsertColCommand as Vn, RemoveRowCommand as Hn, RemoveColCommand as zn, DeleteRangeMoveLeftCommand as Kn, DeleteRangeMoveUpCommand as Jn, InsertRangeMoveDownCommand as Zn, InsertRangeMoveRightCommand as qn, DeltaRowHeightCommand as Jt, SetRowHeightCommand as Zt, DeltaColumnWidthCommand as Qn, SetColWidthCommand as er, SetRowHiddenCommand as tr, SetSpecificRowsVisibleCommand as nr, SetSpecificColsVisibleCommand as rr, SetColHiddenCommand as ir, MoveColsCommand as sr, MoveRowsCommand as or, MoveRangeCommand as ar, SetRowVisibleMutation as mi, SetRowHiddenMutation as pi, SetColVisibleMutation as wi, SetColHiddenMutation as _i, SetWorksheetRowHeightMutation as Si, SetWorksheetColWidthMutation as vi, SetWorksheetActiveOperation as Ii, RangeProtectionPermissionEditPoint as Ci } from "@univerjs/sheets";
|
|
9
9
|
import { MessageType as pe, render as Di, unmount as Ri, clsx as bi, RadioGroup as Mi, Radio as Yt } from "@univerjs/design";
|
|
10
|
-
import { docDrawingPositionToTransform as
|
|
11
|
-
import { IImageIoService as
|
|
12
|
-
import { ILocalFileService as Pi, IMessageService as cr, ISidebarService as Ai, IDialogService as Ni, IClipboardInterfaceService as ki, CanvasFloatDomService as Wi, PrintFloatDomSingle as Bi, ComponentManager as dr, connectInjector as ji, useDependency as qe, getMenuHiddenObservable as an, MenuItemType as cn, RibbonInsertGroup as $i, KeyCode as
|
|
10
|
+
import { docDrawingPositionToTransform as Tn, ReplaceSnapshotCommand as yi, InnerPasteCommand as Ti } from "@univerjs/docs-ui";
|
|
11
|
+
import { IImageIoService as Ei, IDrawingManagerService as ie, DRAWING_IMAGE_ALLOW_IMAGE_LIST as En, DRAWING_IMAGE_COUNT_LIMIT as On, ImageUploadStatusType as Ae, DRAWING_IMAGE_ALLOW_SIZE as Un, getImageSize as Xt, SetDrawingSelectedOperation as Nt, DRAWING_IMAGE_WIDTH_LIMIT as Pn, DRAWING_IMAGE_HEIGHT_LIMIT as An, ImageSourceType as Oi, getDrawingShapeKeyByDrawingSearch as Ie, UniverDrawingPlugin as Ui } from "@univerjs/drawing";
|
|
12
|
+
import { ILocalFileService as Pi, IMessageService as cr, ISidebarService as Ai, IDialogService as Ni, IClipboardInterfaceService as ki, CanvasFloatDomService as Wi, PrintFloatDomSingle as Bi, ComponentManager as dr, connectInjector as ji, useDependency as qe, getMenuHiddenObservable as an, MenuItemType as cn, RibbonInsertGroup as $i, KeyCode as Fe, IMenuManagerService as Fi, IShortcutService as xi } from "@univerjs/ui";
|
|
13
13
|
import { DocDrawingController as Yi, UniverDocsDrawingPlugin as Xi } from "@univerjs/docs-drawing";
|
|
14
14
|
import { ImageCropperObject as Gi, COMPONENT_IMAGE_POPUP_MENU as Li, OpenImageCropOperation as Vi, ImageResetSizeOperation as Hi, DrawingRenderService as lr, DrawingCommonPanel as zi, UniverDrawingUIPlugin as Ki } from "@univerjs/drawing-ui";
|
|
15
|
-
import { takeUntil as Nn, throttleTime as Ji, combineLatest as _t, switchMap as we, EMPTY as fe, tap as kn, map as
|
|
15
|
+
import { takeUntil as Nn, throttleTime as Ji, combineLatest as _t, switchMap as we, EMPTY as fe, tap as kn, map as be, distinctUntilChanged as Wn, Subject as Gt, filter as Zi, take as qi, BehaviorSubject as We, of as Bn } from "rxjs";
|
|
16
16
|
import { jsx as oe, jsxs as qt } from "react/jsx-runtime";
|
|
17
17
|
import { useMemo as Qi, useState as Qt, useEffect as ur } from "react";
|
|
18
18
|
function z(i, t, e) {
|
|
19
|
-
const { from: n, to: r, flipY: s = !1, flipX: o = !1, angle: a = 0, skewX:
|
|
19
|
+
const { from: n, to: r, flipY: s = !1, flipX: o = !1, angle: a = 0, skewX: d = 0, skewY: u = 0 } = i, c = e.getCurrent();
|
|
20
20
|
if (c == null)
|
|
21
21
|
return;
|
|
22
|
-
const
|
|
22
|
+
const l = Pr(
|
|
23
23
|
c.unitId,
|
|
24
24
|
c.sheetId,
|
|
25
25
|
{ from: n, to: r },
|
|
26
26
|
e
|
|
27
27
|
);
|
|
28
|
-
let { left: g, top: h, width: f, height: p } =
|
|
28
|
+
let { left: g, top: h, width: f, height: p } = l;
|
|
29
29
|
const m = e.getCurrentSkeleton(), _ = m.rowHeaderWidth + m.columnTotalWidth, v = m.columnHeaderHeight + m.rowTotalHeight;
|
|
30
30
|
return g + f > _ && (g = _ - f), h + p > v && (h = v - p), {
|
|
31
31
|
flipY: s,
|
|
32
32
|
flipX: o,
|
|
33
33
|
angle: a,
|
|
34
|
-
skewX:
|
|
34
|
+
skewX: d,
|
|
35
35
|
skewY: u,
|
|
36
36
|
left: g,
|
|
37
37
|
top: h,
|
|
@@ -40,14 +40,14 @@ function z(i, t, e) {
|
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
42
|
function $(i, t) {
|
|
43
|
-
const { left: e = 0, top: n = 0, width: r = 0, height: s = 0, flipY: o = !1, flipX: a = !1, angle:
|
|
44
|
-
if (
|
|
43
|
+
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);
|
|
44
|
+
if (l == null)
|
|
45
45
|
return;
|
|
46
46
|
const g = {
|
|
47
|
-
column:
|
|
48
|
-
columnOffset: mt(e -
|
|
49
|
-
row:
|
|
50
|
-
rowOffset: mt(n -
|
|
47
|
+
column: l.actualColumn,
|
|
48
|
+
columnOffset: mt(e - l.startX, 1),
|
|
49
|
+
row: l.actualRow,
|
|
50
|
+
rowOffset: mt(n - l.startY, 1)
|
|
51
51
|
}, h = t.getCellWithCoordByOffset(e + r, n + s);
|
|
52
52
|
if (h == null)
|
|
53
53
|
return;
|
|
@@ -60,7 +60,7 @@ function $(i, t) {
|
|
|
60
60
|
return {
|
|
61
61
|
flipY: o,
|
|
62
62
|
flipX: a,
|
|
63
|
-
angle:
|
|
63
|
+
angle: d,
|
|
64
64
|
skewX: u,
|
|
65
65
|
skewY: c,
|
|
66
66
|
from: g,
|
|
@@ -82,14 +82,14 @@ const Y = {
|
|
|
82
82
|
type: Z.COMMAND,
|
|
83
83
|
handler: (i, t) => {
|
|
84
84
|
var v, I, R;
|
|
85
|
-
const e = i.get(G), n = i.get(
|
|
85
|
+
const e = i.get(G), n = i.get(Ye), r = i.get(At), s = i.get(re);
|
|
86
86
|
if (!t) return !1;
|
|
87
87
|
const { drawings: o } = t, a = [];
|
|
88
88
|
o.forEach((S) => {
|
|
89
89
|
const { unitId: C } = S;
|
|
90
90
|
a.push(C);
|
|
91
91
|
});
|
|
92
|
-
const
|
|
92
|
+
const d = s.getBatchRemoveOp(o), { unitId: u, subUnitId: c, undo: l, redo: g, objects: h } = d, f = r.onCommandExecute({ id: nt.id, params: t }), p = { id: P.id, params: { unitId: u, subUnitId: c, op: g, objects: h, type: U.REMOVE } }, m = { id: P.id, params: { unitId: u, subUnitId: c, op: l, objects: h, type: U.INSERT } };
|
|
93
93
|
return Xn([...(v = f.preRedos) != null ? v : [], p, ...f.redos], e) ? (n.pushUndoRedo({
|
|
94
94
|
unitID: u,
|
|
95
95
|
undoMutations: [
|
|
@@ -114,10 +114,10 @@ const Y = {
|
|
|
114
114
|
if (n.length === 0)
|
|
115
115
|
return !1;
|
|
116
116
|
const r = n[0].unitId, s = n.map((o) => {
|
|
117
|
-
const { unitId: a, subUnitId:
|
|
117
|
+
const { unitId: a, subUnitId: d, drawingId: u, drawingType: c } = o;
|
|
118
118
|
return {
|
|
119
119
|
unitId: a,
|
|
120
|
-
subUnitId:
|
|
120
|
+
subUnitId: d,
|
|
121
121
|
drawingId: u,
|
|
122
122
|
drawingType: c
|
|
123
123
|
};
|
|
@@ -131,16 +131,16 @@ const Y = {
|
|
|
131
131
|
function es(i) {
|
|
132
132
|
const t = [];
|
|
133
133
|
return i.forEach((e) => {
|
|
134
|
-
const { parent: n, children: r } = e, { unitId: s, subUnitId: o, drawingId: a } = n,
|
|
135
|
-
const g =
|
|
134
|
+
const { parent: n, children: r } = e, { unitId: s, subUnitId: o, drawingId: a } = n, d = Or(0, 0, r.map((l) => l.transform || {})), u = r.map((l) => {
|
|
135
|
+
const g = l.transform || { left: 0, top: 0 }, { unitId: h, subUnitId: f, drawingId: p } = l;
|
|
136
136
|
return {
|
|
137
137
|
unitId: h,
|
|
138
138
|
subUnitId: f,
|
|
139
139
|
drawingId: p,
|
|
140
140
|
transform: {
|
|
141
141
|
...g,
|
|
142
|
-
left: g.left -
|
|
143
|
-
top: g.top -
|
|
142
|
+
left: g.left - d.left,
|
|
143
|
+
top: g.top - d.top
|
|
144
144
|
},
|
|
145
145
|
groupId: a
|
|
146
146
|
};
|
|
@@ -149,7 +149,7 @@ function es(i) {
|
|
|
149
149
|
subUnitId: o,
|
|
150
150
|
drawingId: a,
|
|
151
151
|
drawingType: B.DRAWING_GROUP,
|
|
152
|
-
transform:
|
|
152
|
+
transform: d
|
|
153
153
|
};
|
|
154
154
|
t.push({
|
|
155
155
|
parent: c,
|
|
@@ -160,11 +160,11 @@ function es(i) {
|
|
|
160
160
|
function ts(i) {
|
|
161
161
|
const t = [];
|
|
162
162
|
return i.forEach((e) => {
|
|
163
|
-
const { parent: n, children: r } = e, { unitId: s, subUnitId: o, drawingId: a, transform:
|
|
164
|
-
if (
|
|
163
|
+
const { parent: n, children: r } = e, { unitId: s, subUnitId: o, drawingId: a, transform: d = { width: 0, height: 0 } } = n;
|
|
164
|
+
if (d == null)
|
|
165
165
|
return;
|
|
166
|
-
const u = r.map((
|
|
167
|
-
const { transform: g } =
|
|
166
|
+
const u = r.map((l) => {
|
|
167
|
+
const { transform: g } = l, { unitId: h, subUnitId: f, drawingId: p } = l, m = Er(g || {}, d, d.width || 0, d.height || 0);
|
|
168
168
|
return {
|
|
169
169
|
unitId: h,
|
|
170
170
|
subUnitId: f,
|
|
@@ -192,7 +192,7 @@ const gr = {
|
|
|
192
192
|
id: "sheet.command.group-sheet-image",
|
|
193
193
|
type: Z.COMMAND,
|
|
194
194
|
handler: (i, t) => {
|
|
195
|
-
const e = i.get(G), n = i.get(
|
|
195
|
+
const e = i.get(G), n = i.get(Ye), r = i.get(re);
|
|
196
196
|
if (!t) return !1;
|
|
197
197
|
const s = [];
|
|
198
198
|
t.forEach(({ parent: h, children: f }) => {
|
|
@@ -200,15 +200,15 @@ const gr = {
|
|
|
200
200
|
s.push(p.unitId);
|
|
201
201
|
});
|
|
202
202
|
});
|
|
203
|
-
const o = r.getGroupDrawingOp(t), { unitId: a, subUnitId:
|
|
204
|
-
return e.syncExecuteCommand(P.id, { op: c, unitId: a, subUnitId:
|
|
203
|
+
const o = r.getGroupDrawingOp(t), { unitId: a, subUnitId: d, undo: u, redo: c, objects: l } = o;
|
|
204
|
+
return e.syncExecuteCommand(P.id, { op: c, unitId: a, subUnitId: d, objects: l, type: U.GROUP }) ? (n.pushUndoRedo({
|
|
205
205
|
unitID: a,
|
|
206
206
|
undoMutations: [
|
|
207
|
-
{ id: P.id, params: { op: u, unitId: a, subUnitId:
|
|
207
|
+
{ id: P.id, params: { op: u, unitId: a, subUnitId: d, objects: ts(l), type: U.UNGROUP } },
|
|
208
208
|
{ id: Y.id, params: s }
|
|
209
209
|
],
|
|
210
210
|
redoMutations: [
|
|
211
|
-
{ id: P.id, params: { op: c, unitId: a, subUnitId:
|
|
211
|
+
{ id: P.id, params: { op: c, unitId: a, subUnitId: d, objects: l, type: U.GROUP } },
|
|
212
212
|
{ id: Y.id, params: s }
|
|
213
213
|
]
|
|
214
214
|
}), !0) : !1;
|
|
@@ -218,9 +218,9 @@ const gr = {
|
|
|
218
218
|
type: Z.COMMAND,
|
|
219
219
|
handler: (i, t) => {
|
|
220
220
|
var v, I, R;
|
|
221
|
-
const e = i.get(G), n = i.get(
|
|
221
|
+
const e = i.get(G), n = i.get(Ye), r = i.get(re), s = i.get(At);
|
|
222
222
|
if (!t) return !1;
|
|
223
|
-
const o = t.drawings, a = o.map((S) => S.unitId),
|
|
223
|
+
const o = t.drawings, a = o.map((S) => S.unitId), d = r.getBatchAddOp(o), { unitId: u, subUnitId: c, undo: l, redo: g, objects: h } = d, f = s.onCommandExecute({ id: kt.id, params: t }), p = { id: P.id, params: { op: g, unitId: u, subUnitId: c, objects: h, type: U.INSERT } }, m = { id: P.id, params: { op: l, unitId: u, subUnitId: c, objects: h, type: U.REMOVE } };
|
|
224
224
|
return Xn([...(v = f.preRedos) != null ? v : [], p, ...f.redos], e) ? (n.pushUndoRedo({
|
|
225
225
|
unitID: u,
|
|
226
226
|
undoMutations: [
|
|
@@ -241,20 +241,20 @@ const gr = {
|
|
|
241
241
|
id: "sheet.command.set-drawing-arrange",
|
|
242
242
|
type: Z.COMMAND,
|
|
243
243
|
handler: (i, t) => {
|
|
244
|
-
const e = i.get(G), n = i.get(
|
|
244
|
+
const e = i.get(G), n = i.get(Ye);
|
|
245
245
|
if (!t) return !1;
|
|
246
|
-
const r = i.get(re), { unitId: s, subUnitId: o, drawingIds: a, arrangeType:
|
|
246
|
+
const r = i.get(re), { unitId: s, subUnitId: o, drawingIds: a, arrangeType: d } = t, u = { unitId: s, subUnitId: o, drawingIds: a };
|
|
247
247
|
let c;
|
|
248
|
-
if (
|
|
248
|
+
if (d === pt.forward ? c = r.getForwardDrawingsOp(u) : d === pt.backward ? c = r.getBackwardDrawingOp(u) : d === pt.front ? c = r.getFrontDrawingsOp(u) : d === pt.back && (c = r.getBackDrawingsOp(u)), c == null)
|
|
249
249
|
return !1;
|
|
250
|
-
const { objects:
|
|
251
|
-
return e.syncExecuteCommand(P.id, { op: g, unitId: s, subUnitId: o, objects:
|
|
250
|
+
const { objects: l, redo: g, undo: h } = c;
|
|
251
|
+
return e.syncExecuteCommand(P.id, { op: g, unitId: s, subUnitId: o, objects: l, type: U.ARRANGE }) ? (n.pushUndoRedo({
|
|
252
252
|
unitID: s,
|
|
253
253
|
undoMutations: [
|
|
254
|
-
{ id: P.id, params: { op: h, unitId: s, subUnitId: o, objects:
|
|
254
|
+
{ id: P.id, params: { op: h, unitId: s, subUnitId: o, objects: l, type: U.ARRANGE } }
|
|
255
255
|
],
|
|
256
256
|
redoMutations: [
|
|
257
|
-
{ id: P.id, params: { op: g, unitId: s, subUnitId: o, objects:
|
|
257
|
+
{ id: P.id, params: { op: g, unitId: s, subUnitId: o, objects: l, type: U.ARRANGE } }
|
|
258
258
|
]
|
|
259
259
|
}), !0) : !1;
|
|
260
260
|
}
|
|
@@ -262,17 +262,17 @@ const gr = {
|
|
|
262
262
|
id: "sheet.command.set-sheet-image",
|
|
263
263
|
type: Z.COMMAND,
|
|
264
264
|
handler: (i, t) => {
|
|
265
|
-
const e = i.get(G), n = i.get(
|
|
265
|
+
const e = i.get(G), n = i.get(Ye), r = i.get(re);
|
|
266
266
|
if (!t) return !1;
|
|
267
|
-
const { drawings: s } = t, o = r.getBatchUpdateOp(s), { unitId: a, subUnitId:
|
|
268
|
-
return e.syncExecuteCommand(P.id, { unitId: a, subUnitId:
|
|
267
|
+
const { drawings: s } = t, o = r.getBatchUpdateOp(s), { unitId: a, subUnitId: d, undo: u, redo: c, objects: l } = o;
|
|
268
|
+
return e.syncExecuteCommand(P.id, { unitId: a, subUnitId: d, op: c, objects: l, type: U.UPDATE }) ? (n.pushUndoRedo({
|
|
269
269
|
unitID: a,
|
|
270
270
|
undoMutations: [
|
|
271
|
-
{ id: P.id, params: { unitId: a, subUnitId:
|
|
271
|
+
{ id: P.id, params: { unitId: a, subUnitId: d, op: u, objects: l, type: U.UPDATE } },
|
|
272
272
|
{ id: Y.id, params: [a] }
|
|
273
273
|
],
|
|
274
274
|
redoMutations: [
|
|
275
|
-
{ id: P.id, params: { unitId: a, subUnitId:
|
|
275
|
+
{ id: P.id, params: { unitId: a, subUnitId: d, op: c, objects: l, type: U.UPDATE } },
|
|
276
276
|
{ id: Y.id, params: [a] }
|
|
277
277
|
]
|
|
278
278
|
}), !0) : !1;
|
|
@@ -281,7 +281,7 @@ const gr = {
|
|
|
281
281
|
id: "sheet.command.ungroup-sheet-image",
|
|
282
282
|
type: Z.COMMAND,
|
|
283
283
|
handler: (i, t) => {
|
|
284
|
-
const e = i.get(G), n = i.get(
|
|
284
|
+
const e = i.get(G), n = i.get(Ye), r = i.get(re);
|
|
285
285
|
if (!t) return !1;
|
|
286
286
|
const s = [];
|
|
287
287
|
t.forEach(({ parent: h, children: f }) => {
|
|
@@ -289,15 +289,15 @@ const gr = {
|
|
|
289
289
|
s.push(p.unitId);
|
|
290
290
|
});
|
|
291
291
|
});
|
|
292
|
-
const o = r.getUngroupDrawingOp(t), { unitId: a, subUnitId:
|
|
293
|
-
return e.syncExecuteCommand(P.id, { op: c, unitId: a, subUnitId:
|
|
292
|
+
const o = r.getUngroupDrawingOp(t), { unitId: a, subUnitId: d, undo: u, redo: c, objects: l } = o;
|
|
293
|
+
return e.syncExecuteCommand(P.id, { op: c, unitId: a, subUnitId: d, objects: l, type: U.UNGROUP }) ? (n.pushUndoRedo({
|
|
294
294
|
unitID: a,
|
|
295
295
|
undoMutations: [
|
|
296
|
-
{ id: P.id, params: { op: u, unitId: a, subUnitId:
|
|
296
|
+
{ id: P.id, params: { op: u, unitId: a, subUnitId: d, objects: es(l), type: U.GROUP } },
|
|
297
297
|
{ id: Y.id, params: s }
|
|
298
298
|
],
|
|
299
299
|
redoMutations: [
|
|
300
|
-
{ id: P.id, params: { op: c, unitId: a, subUnitId:
|
|
300
|
+
{ id: P.id, params: { op: c, unitId: a, subUnitId: d, objects: l, type: U.UNGROUP } },
|
|
301
301
|
{ id: Y.id, params: s }
|
|
302
302
|
]
|
|
303
303
|
}), !0) : !1;
|
|
@@ -314,28 +314,28 @@ function is(i, t, e) {
|
|
|
314
314
|
}
|
|
315
315
|
function en(i, t, e, n, r) {
|
|
316
316
|
var v;
|
|
317
|
-
const { rotatedHeight: s, rotatedWidth: o } = is(e, n, r),
|
|
318
|
-
if (!
|
|
317
|
+
const { rotatedHeight: s, rotatedWidth: o } = is(e, n, r), d = i.get(J).getRenderById(t.unitId);
|
|
318
|
+
if (!d)
|
|
319
319
|
return !1;
|
|
320
|
-
const c = (v =
|
|
320
|
+
const c = (v = d.with(V).getSkeletonParam(t.subUnitId)) == null ? void 0 : v.skeleton;
|
|
321
321
|
if (c == null)
|
|
322
322
|
return !1;
|
|
323
|
-
const
|
|
323
|
+
const l = c.getCellByIndex(t.row, t.col), g = l.mergeInfo.endX - l.mergeInfo.startX - 2, h = l.mergeInfo.endY - l.mergeInfo.startY - 2, f = o / s, m = Math.ceil(Math.min(g, h * f)) / o, _ = !m || Number.isNaN(m) ? 1e-3 : m;
|
|
324
324
|
return {
|
|
325
325
|
width: e * _,
|
|
326
326
|
height: n * _
|
|
327
327
|
};
|
|
328
328
|
}
|
|
329
329
|
let Qe = class extends ne {
|
|
330
|
-
constructor(t, e, n, r, s, o, a,
|
|
330
|
+
constructor(t, e, n, r, s, o, a, d, u, c, l, g, h) {
|
|
331
331
|
super();
|
|
332
332
|
ee(this, "_workbookSelections");
|
|
333
|
-
this._context = t, this._skeletonManagerService = e, this._commandService = n, this._selectionRenderService = r, this._imageIoService = s, this._fileOpenerService = o, this._sheetDrawingService = a, this._drawingManagerService =
|
|
333
|
+
this._context = t, this._skeletonManagerService = e, this._commandService = n, this._selectionRenderService = r, this._imageIoService = s, this._fileOpenerService = o, this._sheetDrawingService = a, this._drawingManagerService = d, this._contextService = u, this._messageService = c, this._localeService = l, this._injector = h, this._workbookSelections = g.getWorkbookSelections(this._context.unitId), this._updateImageListener(), this._updateOrderListener(), this._groupDrawingListener(), this._focusDrawingListener();
|
|
334
334
|
}
|
|
335
335
|
async insertFloatImage() {
|
|
336
336
|
const t = await this._fileOpenerService.openFile({
|
|
337
337
|
multiple: !0,
|
|
338
|
-
accept:
|
|
338
|
+
accept: En.map((n) => `.${n.replace("image/", "")}`).join(",")
|
|
339
339
|
}), e = t.length;
|
|
340
340
|
return e > On ? (this._messageService.show({
|
|
341
341
|
type: pe.Error,
|
|
@@ -345,7 +345,7 @@ let Qe = class extends ne {
|
|
|
345
345
|
async insertCellImage() {
|
|
346
346
|
const e = (await this._fileOpenerService.openFile({
|
|
347
347
|
multiple: !1,
|
|
348
|
-
accept:
|
|
348
|
+
accept: En.map((n) => `.${n.replace("image/", "")}`).join(",")
|
|
349
349
|
}))[0];
|
|
350
350
|
return e ? (await this._insertCellImage(e), !0) : !1;
|
|
351
351
|
}
|
|
@@ -358,27 +358,27 @@ let Qe = class extends ne {
|
|
|
358
358
|
e = await this._imageIoService.saveImage(t);
|
|
359
359
|
} catch (v) {
|
|
360
360
|
const I = v.message;
|
|
361
|
-
I ===
|
|
361
|
+
I === Ae.ERROR_EXCEED_SIZE ? this._messageService.show({
|
|
362
362
|
type: pe.Error,
|
|
363
363
|
content: this._localeService.t("update-status.exceedMaxSize", String(Un / (1024 * 1024)))
|
|
364
|
-
}) : I ===
|
|
364
|
+
}) : I === Ae.ERROR_IMAGE_TYPE ? this._messageService.show({
|
|
365
365
|
type: pe.Error,
|
|
366
366
|
content: this._localeService.t("update-status.invalidImageType")
|
|
367
|
-
}) : I ===
|
|
367
|
+
}) : I === Ae.ERROR_IMAGE && this._messageService.show({
|
|
368
368
|
type: pe.Error,
|
|
369
369
|
content: this._localeService.t("update-status.invalidImage")
|
|
370
370
|
});
|
|
371
371
|
}
|
|
372
372
|
if (e == null)
|
|
373
373
|
return;
|
|
374
|
-
const n = this._getUnitInfo(), { unitId: r, subUnitId: s } = n, { imageId: o, imageSourceType: a, source:
|
|
375
|
-
this._imageIoService.addImageSourceCache(
|
|
374
|
+
const n = this._getUnitInfo(), { unitId: r, subUnitId: s } = n, { imageId: o, imageSourceType: a, source: d, base64Cache: u } = e, { width: c, height: l, image: g } = await Xt(u || ""), { width: h, height: f } = this._context.scene;
|
|
375
|
+
this._imageIoService.addImageSourceCache(d, a, g);
|
|
376
376
|
let p = 1;
|
|
377
|
-
if (c > Pn ||
|
|
378
|
-
const v = Pn / c, I = An /
|
|
377
|
+
if (c > Pn || l > An) {
|
|
378
|
+
const v = Pn / c, I = An / l;
|
|
379
379
|
p = Math.max(v, I);
|
|
380
380
|
}
|
|
381
|
-
const m = this._getImagePosition(c * p,
|
|
381
|
+
const m = this._getImagePosition(c * p, l * p, h, f);
|
|
382
382
|
if (m == null)
|
|
383
383
|
return;
|
|
384
384
|
const _ = {
|
|
@@ -387,7 +387,7 @@ let Qe = class extends ne {
|
|
|
387
387
|
drawingId: o,
|
|
388
388
|
drawingType: B.DRAWING_IMAGE,
|
|
389
389
|
imageSourceType: a,
|
|
390
|
-
source:
|
|
390
|
+
source: d,
|
|
391
391
|
transform: z(m, this._selectionRenderService, this._skeletonManagerService),
|
|
392
392
|
sheetTransform: m
|
|
393
393
|
};
|
|
@@ -404,26 +404,26 @@ let Qe = class extends ne {
|
|
|
404
404
|
n = await this._imageIoService.saveImage(t);
|
|
405
405
|
} catch (S) {
|
|
406
406
|
const C = S.message;
|
|
407
|
-
C ===
|
|
407
|
+
C === Ae.ERROR_EXCEED_SIZE ? this._messageService.show({
|
|
408
408
|
type: pe.Error,
|
|
409
409
|
content: this._localeService.t("update-status.exceedMaxSize", String(Un / (1024 * 1024)))
|
|
410
|
-
}) : C ===
|
|
410
|
+
}) : C === Ae.ERROR_IMAGE_TYPE ? this._messageService.show({
|
|
411
411
|
type: pe.Error,
|
|
412
412
|
content: this._localeService.t("update-status.invalidImageType")
|
|
413
|
-
}) : C ===
|
|
413
|
+
}) : C === Ae.ERROR_IMAGE && this._messageService.show({
|
|
414
414
|
type: pe.Error,
|
|
415
415
|
content: this._localeService.t("update-status.invalidImage")
|
|
416
416
|
});
|
|
417
417
|
}
|
|
418
418
|
if (n == null)
|
|
419
419
|
return !1;
|
|
420
|
-
const { imageId: r, imageSourceType: s, source: o, base64Cache: a } = n, { width:
|
|
420
|
+
const { imageId: r, imageSourceType: s, source: o, base64Cache: a } = n, { width: d, height: u, image: c } = await Xt(a || "");
|
|
421
421
|
this._imageIoService.addImageSourceCache(o, s, c);
|
|
422
|
-
const
|
|
423
|
-
if (!
|
|
422
|
+
const l = this._workbookSelections.getCurrentLastSelection();
|
|
423
|
+
if (!l)
|
|
424
424
|
return !1;
|
|
425
|
-
let g =
|
|
426
|
-
|
|
425
|
+
let g = l.primary.actualRow, h = l.primary.actualColumn;
|
|
426
|
+
l.primary.isMerged && (g = l.primary.startRow, h = l.primary.startColumn);
|
|
427
427
|
const f = Vt("", {}), p = en(
|
|
428
428
|
this._injector,
|
|
429
429
|
{
|
|
@@ -432,7 +432,7 @@ let Qe = class extends ne {
|
|
|
432
432
|
row: g,
|
|
433
433
|
col: h
|
|
434
434
|
},
|
|
435
|
-
|
|
435
|
+
d,
|
|
436
436
|
u,
|
|
437
437
|
0
|
|
438
438
|
);
|
|
@@ -459,7 +459,7 @@ let Qe = class extends ne {
|
|
|
459
459
|
drawingType: B.DRAWING_IMAGE,
|
|
460
460
|
imageSourceType: s,
|
|
461
461
|
source: o,
|
|
462
|
-
transform:
|
|
462
|
+
transform: Tn(m),
|
|
463
463
|
docTransform: m,
|
|
464
464
|
behindDoc: Dn.FALSE,
|
|
465
465
|
title: "",
|
|
@@ -501,7 +501,7 @@ let Qe = class extends ne {
|
|
|
501
501
|
const o = this._workbookSelections.getCurrentLastSelection();
|
|
502
502
|
if (!o)
|
|
503
503
|
return !1;
|
|
504
|
-
const a = Vt("", {}),
|
|
504
|
+
const a = Vt("", {}), d = en(
|
|
505
505
|
this._injector,
|
|
506
506
|
{
|
|
507
507
|
unitId: this._context.unitId,
|
|
@@ -513,12 +513,12 @@ let Qe = class extends ne {
|
|
|
513
513
|
r,
|
|
514
514
|
0
|
|
515
515
|
);
|
|
516
|
-
if (!
|
|
516
|
+
if (!d)
|
|
517
517
|
return !1;
|
|
518
518
|
const u = {
|
|
519
519
|
size: {
|
|
520
|
-
width:
|
|
521
|
-
height:
|
|
520
|
+
width: d.width,
|
|
521
|
+
height: d.height
|
|
522
522
|
},
|
|
523
523
|
positionH: {
|
|
524
524
|
relativeFrom: vn.PAGE,
|
|
@@ -536,7 +536,7 @@ let Qe = class extends ne {
|
|
|
536
536
|
drawingType: B.DRAWING_IMAGE,
|
|
537
537
|
imageSourceType: Rn.URL,
|
|
538
538
|
source: t,
|
|
539
|
-
transform:
|
|
539
|
+
transform: Tn(u),
|
|
540
540
|
docTransform: u,
|
|
541
541
|
behindDoc: Dn.FALSE,
|
|
542
542
|
title: "",
|
|
@@ -548,7 +548,7 @@ let Qe = class extends ne {
|
|
|
548
548
|
distL: 0,
|
|
549
549
|
distR: 0,
|
|
550
550
|
distT: 0
|
|
551
|
-
},
|
|
551
|
+
}, l = Ht.drawing.add({
|
|
552
552
|
documentDataModel: a,
|
|
553
553
|
drawings: [c],
|
|
554
554
|
selection: {
|
|
@@ -557,7 +557,7 @@ let Qe = class extends ne {
|
|
|
557
557
|
endOffset: 0
|
|
558
558
|
}
|
|
559
559
|
});
|
|
560
|
-
return
|
|
560
|
+
return l ? (a.apply(l), this._commandService.syncExecuteCommand(bn.id, {
|
|
561
561
|
value: {
|
|
562
562
|
[(g = e == null ? void 0 : e.row) != null ? g : o.primary.actualRow]: {
|
|
563
563
|
[(h = e == null ? void 0 : e.col) != null ? h : o.primary.actualColumn]: {
|
|
@@ -589,26 +589,26 @@ let Qe = class extends ne {
|
|
|
589
589
|
const a = Yn(this._skeletonManagerService.getCurrent().skeleton, o);
|
|
590
590
|
if (a == null)
|
|
591
591
|
return;
|
|
592
|
-
let { startColumn:
|
|
593
|
-
if (c + t > n && (c = n - t, c < 0 && (c = 0, t = n), g = !0),
|
|
594
|
-
const m = this._selectionRenderService.getCellWithCoordByOffset(c,
|
|
592
|
+
let { startColumn: d, startRow: u, startX: c, startY: l } = a, g = !1;
|
|
593
|
+
if (c + t > n && (c = n - t, c < 0 && (c = 0, t = n), g = !0), l + e > r && (l = r - e, l < 0 && (l = 0, e = r), g = !0), g) {
|
|
594
|
+
const m = this._selectionRenderService.getCellWithCoordByOffset(c, l);
|
|
595
595
|
if (m == null)
|
|
596
596
|
return;
|
|
597
|
-
c = m.startX,
|
|
597
|
+
c = m.startX, l = m.startY, d = m.actualColumn, u = m.actualRow;
|
|
598
598
|
}
|
|
599
599
|
const h = {
|
|
600
|
-
column:
|
|
600
|
+
column: d,
|
|
601
601
|
columnOffset: 0,
|
|
602
602
|
row: u,
|
|
603
603
|
rowOffset: 0
|
|
604
|
-
}, f = this._selectionRenderService.getCellWithCoordByOffset(c + t,
|
|
604
|
+
}, f = this._selectionRenderService.getCellWithCoordByOffset(c + t, l + e);
|
|
605
605
|
if (f == null)
|
|
606
606
|
return;
|
|
607
607
|
const p = {
|
|
608
608
|
column: f.actualColumn,
|
|
609
609
|
columnOffset: c + t - f.startX,
|
|
610
610
|
row: f.actualRow,
|
|
611
|
-
rowOffset:
|
|
611
|
+
rowOffset: l + e - f.startY
|
|
612
612
|
};
|
|
613
613
|
return {
|
|
614
614
|
from: h,
|
|
@@ -630,21 +630,21 @@ let Qe = class extends ne {
|
|
|
630
630
|
this.disposeWithMe(this._drawingManagerService.featurePluginUpdate$.subscribe((t) => {
|
|
631
631
|
const e = [];
|
|
632
632
|
t.length !== 0 && (t.forEach((n) => {
|
|
633
|
-
const { unitId: r, subUnitId: s, drawingId: o, drawingType: a, transform:
|
|
634
|
-
if (
|
|
633
|
+
const { unitId: r, subUnitId: s, drawingId: o, drawingType: a, transform: d } = n;
|
|
634
|
+
if (d == null)
|
|
635
635
|
return;
|
|
636
636
|
const u = this._sheetDrawingService.getDrawingByParam({ unitId: r, subUnitId: s, drawingId: o });
|
|
637
637
|
if (u == null || u.unitId !== this._context.unitId)
|
|
638
638
|
return;
|
|
639
|
-
const c = $({ ...u.transform, ...
|
|
639
|
+
const c = $({ ...u.transform, ...d }, this._selectionRenderService);
|
|
640
640
|
if (c == null)
|
|
641
641
|
return;
|
|
642
|
-
const
|
|
642
|
+
const l = {
|
|
643
643
|
...n,
|
|
644
|
-
transform: { ...u.transform, ...
|
|
644
|
+
transform: { ...u.transform, ...d, ...z(c, this._selectionRenderService, this._skeletonManagerService) },
|
|
645
645
|
sheetTransform: { ...c }
|
|
646
646
|
};
|
|
647
|
-
e.push(
|
|
647
|
+
e.push(l);
|
|
648
648
|
}), e.length > 0 && this._commandService.executeCommand(Wt.id, {
|
|
649
649
|
unitId: t[0].unitId,
|
|
650
650
|
drawings: e
|
|
@@ -663,7 +663,7 @@ let Qe = class extends ne {
|
|
|
663
663
|
_focusDrawingListener() {
|
|
664
664
|
this.disposeWithMe(
|
|
665
665
|
this._drawingManagerService.focus$.subscribe((t) => {
|
|
666
|
-
t == null || t.length === 0 ? (this._contextService.setContextValue(
|
|
666
|
+
t == null || t.length === 0 ? (this._contextService.setContextValue($e, !1), this._sheetDrawingService.focusDrawing([])) : (this._contextService.setContextValue($e, !0), this._sheetDrawingService.focusDrawing(t));
|
|
667
667
|
})
|
|
668
668
|
);
|
|
669
669
|
}
|
|
@@ -671,8 +671,8 @@ let Qe = class extends ne {
|
|
|
671
671
|
Qe = rs([
|
|
672
672
|
te(1, A(V)),
|
|
673
673
|
te(2, G),
|
|
674
|
-
te(3,
|
|
675
|
-
te(4,
|
|
674
|
+
te(3, xe),
|
|
675
|
+
te(4, Ei),
|
|
676
676
|
te(5, Pi),
|
|
677
677
|
te(6, re),
|
|
678
678
|
te(7, ie),
|
|
@@ -680,7 +680,7 @@ Qe = rs([
|
|
|
680
680
|
te(9, cr),
|
|
681
681
|
te(10, A(tt)),
|
|
682
682
|
te(11, A(on)),
|
|
683
|
-
te(12, A(
|
|
683
|
+
te(12, A(Xe))
|
|
684
684
|
], Qe);
|
|
685
685
|
const Bt = {
|
|
686
686
|
id: "sheet.command.insert-float-image",
|
|
@@ -696,8 +696,8 @@ const Bt = {
|
|
|
696
696
|
return !1;
|
|
697
697
|
const s = t == null ? void 0 : t.files;
|
|
698
698
|
if (s) {
|
|
699
|
-
const
|
|
700
|
-
return (await Promise.all(
|
|
699
|
+
const d = s.map((u) => r.insertFloatImageByFile(u));
|
|
700
|
+
return (await Promise.all(d)).every((u) => u);
|
|
701
701
|
} else
|
|
702
702
|
return (a = r.insertFloatImage()) != null ? a : !1;
|
|
703
703
|
}
|
|
@@ -717,14 +717,14 @@ const Bt = {
|
|
|
717
717
|
id: "sheet.command.move-drawing",
|
|
718
718
|
type: Z.COMMAND,
|
|
719
719
|
handler: (i, t) => {
|
|
720
|
-
const e = i.get(G), n = i.get(re), r = i.get(
|
|
720
|
+
const e = i.get(G), n = i.get(re), r = i.get(xe), { direction: s } = t, o = n.getFocusDrawings();
|
|
721
721
|
if (o.length === 0)
|
|
722
722
|
return !1;
|
|
723
|
-
const a = o[0].unitId,
|
|
724
|
-
const { transform:
|
|
725
|
-
if (
|
|
723
|
+
const a = o[0].unitId, d = o.map((c) => {
|
|
724
|
+
const { transform: l } = c;
|
|
725
|
+
if (l == null)
|
|
726
726
|
return null;
|
|
727
|
-
const g = { ...
|
|
727
|
+
const g = { ...l }, { left: h = 0, top: f = 0 } = l;
|
|
728
728
|
return s === _e.UP ? g.top = f - 1 : s === _e.DOWN ? g.top = f + 1 : s === _e.LEFT ? g.left = h - 1 : s === _e.RIGHT && (g.left = h + 1), {
|
|
729
729
|
...c,
|
|
730
730
|
transform: g,
|
|
@@ -733,7 +733,7 @@ const Bt = {
|
|
|
733
733
|
}).filter((c) => c != null);
|
|
734
734
|
return e.syncExecuteCommand(Wt.id, {
|
|
735
735
|
unitId: a,
|
|
736
|
-
drawings:
|
|
736
|
+
drawings: d
|
|
737
737
|
}) ? (e.syncExecuteCommand(Y.id, [a]), !0) : !1;
|
|
738
738
|
}
|
|
739
739
|
}, pr = "COMPONENT_SHEET_DRAWING_PANEL", wr = {
|
|
@@ -774,10 +774,10 @@ var os = Object.getOwnPropertyDescriptor, as = (i, t, e, n) => {
|
|
|
774
774
|
return r;
|
|
775
775
|
}, ce = (i, t) => (e, n) => t(e, n, i);
|
|
776
776
|
let Rt = class extends Gr {
|
|
777
|
-
constructor(t, e, n, r, s, o, a,
|
|
777
|
+
constructor(t, e, n, r, s, o, a, d, u, c) {
|
|
778
778
|
super();
|
|
779
779
|
ee(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
|
|
780
|
-
this._injector = t, this._localeService = e, this._drawingManagerService = n, this._canvasPopManagerService = r, this._renderManagerService = s, this._univerInstanceService = o, this._messageService = a, this._contextService =
|
|
780
|
+
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();
|
|
781
781
|
}
|
|
782
782
|
_init() {
|
|
783
783
|
this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET).pipe(Nn(this.dispose$)).subscribe((t) => this._create(t)), this._univerInstanceService.getTypeOfUnitDisposed$(F.UNIVER_SHEET).pipe(Nn(this.dispose$)).subscribe((t) => this._dispose(t)), this._univerInstanceService.getAllUnitsForType(F.UNIVER_SHEET).forEach((t) => this._create(t)), this._setupLoadingStatus();
|
|
@@ -823,7 +823,7 @@ let Rt = class extends Gr {
|
|
|
823
823
|
let r;
|
|
824
824
|
this.disposeWithMe(
|
|
825
825
|
n.createControl$.subscribe(() => {
|
|
826
|
-
if (this._contextService.setContextValue(
|
|
826
|
+
if (this._contextService.setContextValue($e, !0), this._hasCropObject(e))
|
|
827
827
|
return;
|
|
828
828
|
const o = n.getSelectedObjectMap();
|
|
829
829
|
if (o.size > 1) {
|
|
@@ -833,30 +833,30 @@ let Rt = class extends Gr {
|
|
|
833
833
|
const a = o.values().next().value;
|
|
834
834
|
if (!a)
|
|
835
835
|
return;
|
|
836
|
-
const
|
|
836
|
+
const d = a.oKey, u = this._drawingManagerService.getDrawingOKey(d);
|
|
837
837
|
if (!u)
|
|
838
838
|
return;
|
|
839
|
-
const { unitId: c, subUnitId:
|
|
839
|
+
const { unitId: c, subUnitId: l, drawingId: g, drawingType: h } = u, f = u.data;
|
|
840
840
|
if (f && f.disablePopup)
|
|
841
841
|
return;
|
|
842
842
|
r == null || r.dispose();
|
|
843
|
-
const p = this._canvasPopManagerService.getFeatureMenu(c,
|
|
843
|
+
const p = this._canvasPopManagerService.getFeatureMenu(c, l, g, h);
|
|
844
844
|
r = this.disposeWithMe(this._canvasPopManagerService.attachPopupToObject(a, {
|
|
845
845
|
componentKey: Li,
|
|
846
846
|
direction: "horizontal",
|
|
847
847
|
offset: [2, 0],
|
|
848
848
|
extraProps: {
|
|
849
|
-
menuItems: p || this._getImageMenuItems(c,
|
|
849
|
+
menuItems: p || this._getImageMenuItems(c, l, g, h)
|
|
850
850
|
}
|
|
851
851
|
}));
|
|
852
852
|
})
|
|
853
853
|
), this.disposeWithMe(
|
|
854
854
|
n.clearControl$.subscribe(() => {
|
|
855
|
-
r == null || r.dispose(), this._contextService.setContextValue(
|
|
855
|
+
r == null || r.dispose(), this._contextService.setContextValue($e, !1), this._commandService.syncExecuteCommand(Nt.id, []);
|
|
856
856
|
})
|
|
857
857
|
), this.disposeWithMe(
|
|
858
858
|
this._contextService.contextChanged$.subscribe((o) => {
|
|
859
|
-
o[
|
|
859
|
+
o[$e] === !1 && (r == null || r.dispose());
|
|
860
860
|
})
|
|
861
861
|
), this.disposeWithMe(
|
|
862
862
|
n.changing$.subscribe(() => {
|
|
@@ -898,7 +898,7 @@ let Rt = class extends Gr {
|
|
|
898
898
|
}
|
|
899
899
|
};
|
|
900
900
|
Rt = as([
|
|
901
|
-
ce(0, A(
|
|
901
|
+
ce(0, A(Xe)),
|
|
902
902
|
ce(1, A(tt)),
|
|
903
903
|
ce(2, ie),
|
|
904
904
|
ce(3, A(Ar)),
|
|
@@ -972,18 +972,18 @@ let nn = class extends ne {
|
|
|
972
972
|
nn = us([
|
|
973
973
|
vt(1, re),
|
|
974
974
|
vt(2, ie),
|
|
975
|
-
vt(3, A(
|
|
975
|
+
vt(3, A(xe)),
|
|
976
976
|
vt(4, A(V))
|
|
977
977
|
], nn);
|
|
978
978
|
var hs = Object.getOwnPropertyDescriptor, gs = (i, t, e, n) => {
|
|
979
979
|
for (var r = n > 1 ? void 0 : n ? hs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
980
980
|
(o = i[s]) && (r = o(r) || r);
|
|
981
981
|
return r;
|
|
982
|
-
},
|
|
982
|
+
}, Ne = (i, t) => (e, n) => t(e, n, i);
|
|
983
983
|
function Sr(i, t, e) {
|
|
984
984
|
var n, r, s, o;
|
|
985
985
|
if (((r = (n = e == null ? void 0 : e.p) == null ? void 0 : n.body) == null ? void 0 : r.dataStream.length) === 3 && ((o = (s = e.p) == null ? void 0 : s.drawingsOrder) == null ? void 0 : o.length) === 1) {
|
|
986
|
-
const a = e.p.drawings[e.p.drawingsOrder[0]],
|
|
986
|
+
const a = e.p.drawings[e.p.drawingsOrder[0]], d = en(
|
|
987
987
|
i,
|
|
988
988
|
{
|
|
989
989
|
unitId: t.unitId,
|
|
@@ -995,8 +995,8 @@ function Sr(i, t, e) {
|
|
|
995
995
|
a.docTransform.size.height,
|
|
996
996
|
a.docTransform.angle
|
|
997
997
|
);
|
|
998
|
-
if (
|
|
999
|
-
return a.transform.width =
|
|
998
|
+
if (d)
|
|
999
|
+
return a.transform.width = d.width, a.transform.height = d.height, a.docTransform.size.width = d.width, a.docTransform.size.height = d.height, a.transform.left = 0, a.transform.top = 0, a.docTransform.positionH.posOffset = 0, a.docTransform.positionV.posOffset = 0, e.p.documentStyle.pageSize.width = 1 / 0, e.p.documentStyle.pageSize.height = 1 / 0, !0;
|
|
1000
1000
|
}
|
|
1001
1001
|
return !1;
|
|
1002
1002
|
}
|
|
@@ -1008,7 +1008,7 @@ let bt = class extends ne {
|
|
|
1008
1008
|
this.disposeWithMe(this._editorBridgeService.visible$.subscribe((i) => {
|
|
1009
1009
|
i.visible ? i.visible && (this._drawingManagerService.removeDrawingDataForUnit(Ze), this._docDrawingController.loadDrawingDataForUnit(Ze), this._drawingManagerService.initializeNotification(Ze)) : this._drawingManagerService.removeDrawingDataForUnit(Ze);
|
|
1010
1010
|
})), this.disposeWithMe(this._commandService.onCommandExecuted((i) => {
|
|
1011
|
-
i.id === yi.id && i.params.unitId ===
|
|
1011
|
+
i.id === yi.id && i.params.unitId === je && (this._drawingManagerService.removeDrawingDataForUnit(je), this._docDrawingController.loadDrawingDataForUnit(je), this._drawingManagerService.initializeNotification(je));
|
|
1012
1012
|
}));
|
|
1013
1013
|
}
|
|
1014
1014
|
_initCellContentInterceptor() {
|
|
@@ -1028,12 +1028,12 @@ let bt = class extends ne {
|
|
|
1028
1028
|
}
|
|
1029
1029
|
};
|
|
1030
1030
|
bt = gs([
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1031
|
+
Ne(0, G),
|
|
1032
|
+
Ne(1, A(At)),
|
|
1033
|
+
Ne(2, A(Xe)),
|
|
1034
|
+
Ne(3, ie),
|
|
1035
|
+
Ne(4, A(Yi)),
|
|
1036
|
+
Ne(5, A(kr))
|
|
1037
1037
|
], bt);
|
|
1038
1038
|
var fs = Object.getOwnPropertyDescriptor, ms = (i, t, e, n) => {
|
|
1039
1039
|
for (var r = n > 1 ? void 0 : n ? fs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
@@ -1059,7 +1059,7 @@ let Mt = class extends ne {
|
|
|
1059
1059
|
};
|
|
1060
1060
|
Mt = ms([
|
|
1061
1061
|
$n(0, A(Wr)),
|
|
1062
|
-
$n(1, A(
|
|
1062
|
+
$n(1, A(Xe))
|
|
1063
1063
|
], Mt);
|
|
1064
1064
|
var ps = Object.getOwnPropertyDescriptor, ws = (i, t, e, n) => {
|
|
1065
1065
|
for (var r = n > 1 ? void 0 : n ? ps(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
@@ -1069,7 +1069,7 @@ var ps = Object.getOwnPropertyDescriptor, ws = (i, t, e, n) => {
|
|
|
1069
1069
|
const _s = [
|
|
1070
1070
|
Ze,
|
|
1071
1071
|
Hr,
|
|
1072
|
-
|
|
1072
|
+
je
|
|
1073
1073
|
];
|
|
1074
1074
|
let yt = class extends ne {
|
|
1075
1075
|
constructor(i, t, e, n, r) {
|
|
@@ -1092,13 +1092,13 @@ let yt = class extends ne {
|
|
|
1092
1092
|
this.disposeWithMe(
|
|
1093
1093
|
this._commandService.beforeCommandExecuted((i) => {
|
|
1094
1094
|
var t, e;
|
|
1095
|
-
if (i.id ===
|
|
1095
|
+
if (i.id === Ti.id) {
|
|
1096
1096
|
const n = i.params, { doc: r } = n, s = this._univerInstanceService.getCurrentUnitOfType(F.UNIVER_DOC);
|
|
1097
1097
|
if (s == null || !Object.keys((t = r.drawings) != null ? t : {}).length)
|
|
1098
1098
|
return;
|
|
1099
1099
|
const o = s.getUnitId();
|
|
1100
1100
|
if (_s.includes(o)) {
|
|
1101
|
-
if (o !==
|
|
1101
|
+
if (o !== je) {
|
|
1102
1102
|
const a = () => {
|
|
1103
1103
|
this._dialogService.close("sheet-cell-image-copy-paste"), this._commandService.syncExecuteCommand(pn.id, {
|
|
1104
1104
|
visible: !1
|
|
@@ -1169,12 +1169,12 @@ function Ds() {
|
|
|
1169
1169
|
};
|
|
1170
1170
|
}
|
|
1171
1171
|
const Fn = [
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1172
|
+
Be.SPECIAL_PASTE_COL_WIDTH,
|
|
1173
|
+
Be.SPECIAL_PASTE_VALUE,
|
|
1174
|
+
Be.SPECIAL_PASTE_FORMAT,
|
|
1175
|
+
Be.SPECIAL_PASTE_FORMULA
|
|
1176
1176
|
];
|
|
1177
|
-
let
|
|
1177
|
+
let Tt = class extends ne {
|
|
1178
1178
|
constructor(t, e, n, r, s) {
|
|
1179
1179
|
super();
|
|
1180
1180
|
ee(this, "_copyInfo");
|
|
@@ -1192,15 +1192,15 @@ let Et = class extends ne {
|
|
|
1192
1192
|
if (s.length > 0) {
|
|
1193
1193
|
const [o] = s;
|
|
1194
1194
|
if (r === ve.CUT) {
|
|
1195
|
-
const
|
|
1195
|
+
const d = {
|
|
1196
1196
|
unitId: t,
|
|
1197
1197
|
drawings: [o]
|
|
1198
1198
|
};
|
|
1199
|
-
this._commandService.executeCommand(nt.id,
|
|
1199
|
+
this._commandService.executeCommand(nt.id, d);
|
|
1200
1200
|
}
|
|
1201
1201
|
setTimeout(() => {
|
|
1202
|
-
const
|
|
1203
|
-
o.drawingType === B.DRAWING_IMAGE && o.imageSourceType === Oi.BASE64 ? Cs(o.source) : this._clipboardInterfaceService.writeText(""),
|
|
1202
|
+
const d = Ds();
|
|
1203
|
+
o.drawingType === B.DRAWING_IMAGE && o.imageSourceType === Oi.BASE64 ? Cs(o.source) : this._clipboardInterfaceService.writeText(""), d();
|
|
1204
1204
|
}, 200);
|
|
1205
1205
|
const a = {
|
|
1206
1206
|
unitId: o.unitId,
|
|
@@ -1216,14 +1216,14 @@ let Et = class extends ne {
|
|
|
1216
1216
|
onPasteCells: (t, e, n, r) => {
|
|
1217
1217
|
if (!this._copyInfo)
|
|
1218
1218
|
return { redos: [], undos: [] };
|
|
1219
|
-
const { copyType: s = ve.COPY, pasteType: o } = r, { range: a } = t || {}, { range:
|
|
1220
|
-
return this._copyInfo.copyRange ? this._generateRangeDrawingsPasteMutations({ pasteType: o, unitId: u, subUnitId: c, pasteRange:
|
|
1219
|
+
const { copyType: s = ve.COPY, pasteType: o } = r, { range: a } = t || {}, { range: d, unitId: u, subUnitId: c } = e;
|
|
1220
|
+
return this._copyInfo.copyRange ? this._generateRangeDrawingsPasteMutations({ pasteType: o, unitId: u, subUnitId: c, pasteRange: d }, { copyRange: a, copyType: s }) : this._generateSingleDrawingPasteMutations({ pasteTo: e, pasteType: o }, ve.COPY);
|
|
1221
1221
|
},
|
|
1222
1222
|
onPastePlainText: (t, e) => ({ undos: [], redos: [] }),
|
|
1223
|
-
onPasteUnrecognized: (t) => this._copyInfo ? this._generateSingleDrawingPasteMutations({ pasteTo: t, pasteType:
|
|
1223
|
+
onPasteUnrecognized: (t) => this._copyInfo ? this._generateSingleDrawingPasteMutations({ pasteTo: t, pasteType: Be.DEFAULT_PASTE }, ve.COPY) : { undos: [], redos: [] },
|
|
1224
1224
|
onPasteFiles: (t, e) => {
|
|
1225
1225
|
if (this._copyInfo)
|
|
1226
|
-
return this._generateSingleDrawingPasteMutations({ pasteTo: t, pasteType:
|
|
1226
|
+
return this._generateSingleDrawingPasteMutations({ pasteTo: t, pasteType: Be.DEFAULT_PASTE }, ve.COPY);
|
|
1227
1227
|
{
|
|
1228
1228
|
const n = e.filter((r) => r.type.includes("image"));
|
|
1229
1229
|
if (n.length)
|
|
@@ -1248,7 +1248,7 @@ let Et = class extends ne {
|
|
|
1248
1248
|
const s = r.attachRangeWithCoord(n);
|
|
1249
1249
|
if (!s)
|
|
1250
1250
|
return;
|
|
1251
|
-
const { startX: o, endX: a, startY:
|
|
1251
|
+
const { startX: o, endX: a, startY: d, endY: u } = s, c = this._drawingService.getDrawingData(t, e), l = this._focusedDrawings.slice();
|
|
1252
1252
|
if (Object.keys(c).forEach((h) => {
|
|
1253
1253
|
const f = c[h], { transform: p } = f;
|
|
1254
1254
|
if (f.anchorType !== O.Both || !p)
|
|
@@ -1259,11 +1259,11 @@ let Et = class extends ne {
|
|
|
1259
1259
|
drawingStartY: _,
|
|
1260
1260
|
drawingEndY: _ + I
|
|
1261
1261
|
};
|
|
1262
|
-
o <= R && S <= a &&
|
|
1263
|
-
}),
|
|
1262
|
+
o <= R && S <= a && d <= C && w <= u && l.push(f);
|
|
1263
|
+
}), l.length)
|
|
1264
1264
|
return {
|
|
1265
1265
|
copyRange: n,
|
|
1266
|
-
drawings:
|
|
1266
|
+
drawings: l,
|
|
1267
1267
|
unitId: t,
|
|
1268
1268
|
subUnitId: e
|
|
1269
1269
|
};
|
|
@@ -1272,10 +1272,10 @@ let Et = class extends ne {
|
|
|
1272
1272
|
const { pasteType: n, pasteTo: r } = t;
|
|
1273
1273
|
if (Fn.includes(n))
|
|
1274
1274
|
return { redos: [], undos: [] };
|
|
1275
|
-
const { unitId: s, subUnitId: o, range: a } = r,
|
|
1275
|
+
const { unitId: s, subUnitId: o, range: a } = r, d = this._renderManagerService.getRenderById(s), u = d == null ? void 0 : d.with(V), c = d == null ? void 0 : d.with(xe), l = this._copyInfo;
|
|
1276
1276
|
if (!u || !c)
|
|
1277
1277
|
return { redos: [], undos: [] };
|
|
1278
|
-
const { drawings: g } =
|
|
1278
|
+
const { drawings: g } = l, h = wn(a);
|
|
1279
1279
|
return this._generateMutations(g, {
|
|
1280
1280
|
unitId: s,
|
|
1281
1281
|
subUnitId: o,
|
|
@@ -1305,16 +1305,16 @@ let Et = class extends ne {
|
|
|
1305
1305
|
subUnitId: r,
|
|
1306
1306
|
getTransform: s,
|
|
1307
1307
|
isCut: o
|
|
1308
|
-
} = e, a = [],
|
|
1308
|
+
} = e, a = [], d = [], { _drawingService: u } = this;
|
|
1309
1309
|
return t.forEach((c) => {
|
|
1310
|
-
const { transform:
|
|
1311
|
-
if (!
|
|
1310
|
+
const { transform: l, sheetTransform: g } = c;
|
|
1311
|
+
if (!l)
|
|
1312
1312
|
return;
|
|
1313
|
-
const h = s(
|
|
1313
|
+
const h = s(l, g), f = {
|
|
1314
1314
|
...c,
|
|
1315
1315
|
unitId: n,
|
|
1316
1316
|
subUnitId: r,
|
|
1317
|
-
drawingId: o ? c.drawingId :
|
|
1317
|
+
drawingId: o ? c.drawingId : Re.generateRandomId(),
|
|
1318
1318
|
transform: h.transform,
|
|
1319
1319
|
sheetTransform: h.sheetTransform
|
|
1320
1320
|
};
|
|
@@ -1329,7 +1329,7 @@ let Et = class extends ne {
|
|
|
1329
1329
|
op: m,
|
|
1330
1330
|
objects: _
|
|
1331
1331
|
}
|
|
1332
|
-
}),
|
|
1332
|
+
}), d.push({
|
|
1333
1333
|
id: P.id,
|
|
1334
1334
|
params: {
|
|
1335
1335
|
unitId: n,
|
|
@@ -1341,9 +1341,9 @@ let Et = class extends ne {
|
|
|
1341
1341
|
});
|
|
1342
1342
|
} else {
|
|
1343
1343
|
const { undo: p, redo: m, objects: _ } = u.getBatchAddOp([f]);
|
|
1344
|
-
a.push({ id: P.id, params: { op: m, unitId: n, subUnitId: r, objects: _, type: U.INSERT } }),
|
|
1344
|
+
a.push({ id: P.id, params: { op: m, unitId: n, subUnitId: r, objects: _, type: U.INSERT } }), d.push({ id: P.id, params: { op: p, unitId: n, subUnitId: r, objects: _, type: U.REMOVE } });
|
|
1345
1345
|
}
|
|
1346
|
-
}), { redos: a, undos:
|
|
1346
|
+
}), { redos: a, undos: d };
|
|
1347
1347
|
}
|
|
1348
1348
|
// eslint-disable-next-line max-lines-per-function
|
|
1349
1349
|
_generateRangeDrawingsPasteMutations(t, e) {
|
|
@@ -1355,7 +1355,7 @@ let Et = class extends ne {
|
|
|
1355
1355
|
pasteRange: o
|
|
1356
1356
|
} = t, {
|
|
1357
1357
|
copyRange: a,
|
|
1358
|
-
copyType:
|
|
1358
|
+
copyType: d
|
|
1359
1359
|
} = e;
|
|
1360
1360
|
if (Fn.includes(s))
|
|
1361
1361
|
return { redos: [], undos: [] };
|
|
@@ -1367,8 +1367,8 @@ let Et = class extends ne {
|
|
|
1367
1367
|
return this._generateSingleDrawingPasteMutations({
|
|
1368
1368
|
pasteTo: { unitId: n, subUnitId: r, range: wn(o) },
|
|
1369
1369
|
pasteType: s
|
|
1370
|
-
},
|
|
1371
|
-
const { ranges: [
|
|
1370
|
+
}, d);
|
|
1371
|
+
const { ranges: [l, g], mapFunc: h } = jr([a, o]), { row: f, col: p } = h(l.startRow, l.startColumn), { row: m, col: _ } = h(g.startRow, g.startColumn), v = u.attachRangeWithCoord({
|
|
1372
1372
|
startRow: f,
|
|
1373
1373
|
endRow: f,
|
|
1374
1374
|
startColumn: p,
|
|
@@ -1385,46 +1385,46 @@ let Et = class extends ne {
|
|
|
1385
1385
|
return this._generateMutations(c, {
|
|
1386
1386
|
unitId: n,
|
|
1387
1387
|
subUnitId: r,
|
|
1388
|
-
getTransform: (D,
|
|
1389
|
-
var
|
|
1388
|
+
getTransform: (D, T) => {
|
|
1389
|
+
var E, M;
|
|
1390
1390
|
return {
|
|
1391
1391
|
transform: {
|
|
1392
1392
|
...D,
|
|
1393
|
-
left: ((
|
|
1393
|
+
left: ((E = D == null ? void 0 : D.left) != null ? E : 0) + R,
|
|
1394
1394
|
top: ((M = D == null ? void 0 : D.top) != null ? M : 0) + S
|
|
1395
1395
|
},
|
|
1396
1396
|
sheetTransform: {
|
|
1397
|
-
...
|
|
1397
|
+
...T,
|
|
1398
1398
|
to: {
|
|
1399
|
-
...
|
|
1400
|
-
row:
|
|
1401
|
-
column:
|
|
1399
|
+
...T.to,
|
|
1400
|
+
row: T.to.row + C,
|
|
1401
|
+
column: T.to.column + w
|
|
1402
1402
|
},
|
|
1403
1403
|
from: {
|
|
1404
|
-
...
|
|
1405
|
-
row:
|
|
1406
|
-
column:
|
|
1404
|
+
...T.from,
|
|
1405
|
+
row: T.from.row + C,
|
|
1406
|
+
column: T.from.column + w
|
|
1407
1407
|
}
|
|
1408
1408
|
}
|
|
1409
1409
|
};
|
|
1410
1410
|
},
|
|
1411
|
-
isCut:
|
|
1411
|
+
isCut: d === ve.CUT
|
|
1412
1412
|
});
|
|
1413
1413
|
}
|
|
1414
1414
|
};
|
|
1415
|
-
|
|
1415
|
+
Tt = vs([
|
|
1416
1416
|
ze(0, $r),
|
|
1417
1417
|
ze(1, J),
|
|
1418
1418
|
ze(2, ie),
|
|
1419
1419
|
ze(3, ki),
|
|
1420
1420
|
ze(4, G)
|
|
1421
|
-
],
|
|
1421
|
+
], Tt);
|
|
1422
1422
|
var Rs = Object.getOwnPropertyDescriptor, bs = (i, t, e, n) => {
|
|
1423
1423
|
for (var r = n > 1 ? void 0 : n ? Rs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
1424
1424
|
(o = i[s]) && (r = o(r) || r);
|
|
1425
1425
|
return r;
|
|
1426
1426
|
}, Ke = (i, t) => (e, n) => t(e, n, i);
|
|
1427
|
-
let
|
|
1427
|
+
let Et = class extends ne {
|
|
1428
1428
|
constructor(i, t, e, n, r) {
|
|
1429
1429
|
super(), this._drawingManagerService = i, this._renderManagerService = t, this._permissionService = e, this._univerInstanceService = n, this._userManagerService = r, this._initDrawingVisible(), this._initDrawingEditable(), this._initViewPermissionChange(), this._initEditPermissionChange();
|
|
1430
1430
|
}
|
|
@@ -1454,7 +1454,7 @@ let Tt = class extends ne {
|
|
|
1454
1454
|
if (!a)
|
|
1455
1455
|
return;
|
|
1456
1456
|
a.getAllObjectsByOrder().forEach((u) => {
|
|
1457
|
-
u.classType ===
|
|
1457
|
+
u.classType === Ue.IMAGE && s.some((c) => u.oKey.includes(c.drawingId)) && a.removeObject(u);
|
|
1458
1458
|
});
|
|
1459
1459
|
}
|
|
1460
1460
|
_initDrawingEditable() {
|
|
@@ -1483,7 +1483,7 @@ let Tt = class extends ne {
|
|
|
1483
1483
|
if (!a)
|
|
1484
1484
|
return;
|
|
1485
1485
|
a.getAllObjectsByOrder().forEach((u) => {
|
|
1486
|
-
u.classType ===
|
|
1486
|
+
u.classType === Ue.IMAGE && s.some((c) => u.oKey.includes(c.drawingId)) && a.detachTransformerFrom(u);
|
|
1487
1487
|
});
|
|
1488
1488
|
}
|
|
1489
1489
|
_initViewPermissionChange() {
|
|
@@ -1494,20 +1494,20 @@ let Tt = class extends ne {
|
|
|
1494
1494
|
we((r) => {
|
|
1495
1495
|
if (!r)
|
|
1496
1496
|
return fe;
|
|
1497
|
-
const s = e.getUnitId(), o = r.getSheetId(), a = this._renderManagerService.getRenderById(s),
|
|
1498
|
-
if (!
|
|
1497
|
+
const s = e.getUnitId(), o = r.getSheetId(), a = this._renderManagerService.getRenderById(s), d = a == null ? void 0 : a.scene;
|
|
1498
|
+
if (!d)
|
|
1499
1499
|
return fe;
|
|
1500
|
-
const u =
|
|
1500
|
+
const u = d.getTransformerByCreate();
|
|
1501
1501
|
return this._permissionService.composePermission$([
|
|
1502
1502
|
new Mn(s).id,
|
|
1503
1503
|
new yn(s, o).id
|
|
1504
1504
|
]).pipe(
|
|
1505
|
-
|
|
1505
|
+
be((l) => l.every((g) => g.value)),
|
|
1506
1506
|
Wn()
|
|
1507
1507
|
).pipe(
|
|
1508
|
-
|
|
1509
|
-
permission:
|
|
1510
|
-
scene:
|
|
1508
|
+
be((l) => ({
|
|
1509
|
+
permission: l,
|
|
1510
|
+
scene: d,
|
|
1511
1511
|
transformer: u,
|
|
1512
1512
|
unitId: s,
|
|
1513
1513
|
subUnitId: o
|
|
@@ -1518,9 +1518,9 @@ let Tt = class extends ne {
|
|
|
1518
1518
|
).subscribe({
|
|
1519
1519
|
next: ({ permission: e, scene: n, transformer: r, unitId: s, subUnitId: o }) => {
|
|
1520
1520
|
this._drawingManagerService.setDrawingVisible(e);
|
|
1521
|
-
const a = n.getAllObjectsByOrder(),
|
|
1521
|
+
const a = n.getAllObjectsByOrder(), d = this._drawingManagerService.getDrawingData(s, o), u = Object.values(d);
|
|
1522
1522
|
e ? this._drawingManagerService.addNotification(u) : (a.forEach((c) => {
|
|
1523
|
-
c.classType ===
|
|
1523
|
+
c.classType === Ue.IMAGE && u.some((l) => c.oKey.includes(l.drawingId)) && n.removeObject(c);
|
|
1524
1524
|
}), r.clearSelectedObjects());
|
|
1525
1525
|
},
|
|
1526
1526
|
complete: () => {
|
|
@@ -1542,20 +1542,20 @@ let Tt = class extends ne {
|
|
|
1542
1542
|
we((r) => {
|
|
1543
1543
|
if (!r)
|
|
1544
1544
|
return fe;
|
|
1545
|
-
const s = e.getUnitId(), o = r.getSheetId(), a = this._renderManagerService.getRenderById(s),
|
|
1546
|
-
if (!
|
|
1545
|
+
const s = e.getUnitId(), o = r.getSheetId(), a = this._renderManagerService.getRenderById(s), d = a == null ? void 0 : a.scene;
|
|
1546
|
+
if (!d)
|
|
1547
1547
|
return fe;
|
|
1548
|
-
const u =
|
|
1548
|
+
const u = d.getTransformerByCreate();
|
|
1549
1549
|
return this._permissionService.composePermission$([
|
|
1550
1550
|
new zt(s).id,
|
|
1551
1551
|
new Kt(s, o).id
|
|
1552
1552
|
]).pipe(
|
|
1553
|
-
|
|
1553
|
+
be((l) => l.every((g) => g.value)),
|
|
1554
1554
|
Wn()
|
|
1555
1555
|
).pipe(
|
|
1556
|
-
|
|
1557
|
-
permission:
|
|
1558
|
-
scene:
|
|
1556
|
+
be((l) => ({
|
|
1557
|
+
permission: l,
|
|
1558
|
+
scene: d,
|
|
1559
1559
|
transformer: u,
|
|
1560
1560
|
unitId: s,
|
|
1561
1561
|
subUnitId: o
|
|
@@ -1566,11 +1566,11 @@ let Tt = class extends ne {
|
|
|
1566
1566
|
).subscribe({
|
|
1567
1567
|
next: ({ permission: e, scene: n, transformer: r, unitId: s, subUnitId: o }) => {
|
|
1568
1568
|
this._drawingManagerService.setDrawingEditable(e);
|
|
1569
|
-
const a = n.getAllObjectsByOrder(),
|
|
1569
|
+
const a = n.getAllObjectsByOrder(), d = this._drawingManagerService.getDrawingData(s, o), u = Object.values(d);
|
|
1570
1570
|
e ? (a.forEach((c) => {
|
|
1571
|
-
c.classType ===
|
|
1571
|
+
c.classType === Ue.IMAGE && u.some((l) => c.oKey.includes(l.drawingId)) && n.attachTransformerTo(c);
|
|
1572
1572
|
}), this._drawingManagerService.addNotification(u)) : (a.forEach((c) => {
|
|
1573
|
-
c.classType ===
|
|
1573
|
+
c.classType === Ue.IMAGE && u.some((l) => c.oKey.includes(l.drawingId)) && n.detachTransformerFrom(c);
|
|
1574
1574
|
}), r.clearSelectedObjects());
|
|
1575
1575
|
},
|
|
1576
1576
|
complete: () => {
|
|
@@ -1583,47 +1583,47 @@ let Tt = class extends ne {
|
|
|
1583
1583
|
const s = r.getSheetId(), o = this._renderManagerService.getRenderById(n), a = o == null ? void 0 : o.scene;
|
|
1584
1584
|
if (!a)
|
|
1585
1585
|
return;
|
|
1586
|
-
const
|
|
1587
|
-
this._drawingManagerService.setDrawingEditable(!0), a.getAllObjectsByOrder().forEach((
|
|
1588
|
-
|
|
1586
|
+
const d = this._drawingManagerService.getDrawingData(n, s), u = Object.values(d);
|
|
1587
|
+
this._drawingManagerService.setDrawingEditable(!0), a.getAllObjectsByOrder().forEach((l) => {
|
|
1588
|
+
l.classType === Ue.IMAGE && u.some((g) => l.oKey.includes(g.drawingId)) && a.detachTransformerFrom(l);
|
|
1589
1589
|
});
|
|
1590
1590
|
}
|
|
1591
1591
|
})
|
|
1592
1592
|
);
|
|
1593
1593
|
}
|
|
1594
1594
|
};
|
|
1595
|
-
|
|
1595
|
+
Et = bs([
|
|
1596
1596
|
Ke(0, ie),
|
|
1597
1597
|
Ke(1, J),
|
|
1598
1598
|
Ke(2, zr),
|
|
1599
1599
|
Ke(3, Se),
|
|
1600
1600
|
Ke(4, A(Kr))
|
|
1601
|
-
],
|
|
1601
|
+
], Et);
|
|
1602
1602
|
var Ms = Object.getOwnPropertyDescriptor, ys = (i, t, e, n) => {
|
|
1603
1603
|
for (var r = n > 1 ? void 0 : n ? Ms(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
1604
1604
|
(o = i[s]) && (r = o(r) || r);
|
|
1605
1605
|
return r;
|
|
1606
|
-
},
|
|
1606
|
+
}, Ce = (i, t) => (e, n) => t(e, n, i);
|
|
1607
1607
|
function Ir(i, t, e, n, r, s = !1) {
|
|
1608
|
-
const { scaleX: o, scaleY: a } = t.getAncestorScale(),
|
|
1608
|
+
const { scaleX: o, scaleY: a } = t.getAncestorScale(), d = t.getViewport(xn.VIEW_MAIN), u = n.getFreeze(), { startColumn: c, startRow: l, xSplit: g, ySplit: h } = u, f = {
|
|
1609
1609
|
left: !0,
|
|
1610
1610
|
// left means the left of pic is in a viewMainLeft
|
|
1611
1611
|
top: !0
|
|
1612
1612
|
};
|
|
1613
|
-
if (!
|
|
1613
|
+
if (!d)
|
|
1614
1614
|
return {
|
|
1615
1615
|
...i,
|
|
1616
1616
|
absolute: f
|
|
1617
1617
|
};
|
|
1618
1618
|
const { left: p, right: m, top: _, bottom: v } = i;
|
|
1619
|
-
let { top: I, left: R, viewportScrollX: S, viewportScrollY: C } =
|
|
1620
|
-
const { boundsOfViewArea: w, scrollDirectionResponse: y } = r || {}, { rowHeaderWidth: D, columnHeaderHeight:
|
|
1621
|
-
top: s ? 0 :
|
|
1619
|
+
let { top: I, left: R, viewportScrollX: S, viewportScrollY: C } = d;
|
|
1620
|
+
const { boundsOfViewArea: w, scrollDirectionResponse: y } = r || {}, { rowHeaderWidth: D, columnHeaderHeight: T } = e, E = {
|
|
1621
|
+
top: s ? 0 : T,
|
|
1622
1622
|
left: s ? 0 : D
|
|
1623
1623
|
};
|
|
1624
|
-
w && (
|
|
1624
|
+
w && (Re.isDefine(E.top) && (E.top = w.top), Re.isDefine(E.left) && (E.left = w.left)), y === "HORIZONTAL" && (C = 0), y === "VERTICAL" && (S = 0);
|
|
1625
1625
|
let M = 0, b = 0;
|
|
1626
|
-
const N = e.rowStartY(
|
|
1626
|
+
const N = e.rowStartY(l - h) + T, x = e.colStartX(c - g) + D, q = e.rowStartY(l) + T, H = e.colStartX(c) + D;
|
|
1627
1627
|
if (g === 0)
|
|
1628
1628
|
f.left = !1, M = (p - S) * o, b = (m - S) * o;
|
|
1629
1629
|
else {
|
|
@@ -1634,10 +1634,10 @@ function Ir(i, t, e, n, r, s = !1) {
|
|
|
1634
1634
|
if (h === 0)
|
|
1635
1635
|
f.top = !1, L = (_ - C) * a, X = (v - C) * a;
|
|
1636
1636
|
else {
|
|
1637
|
-
const k = _ - (N -
|
|
1637
|
+
const k = _ - (N - T), ae = v - (N - T);
|
|
1638
1638
|
v < q ? (L = k * a, X = ae * a) : _ <= q && v >= q ? (L = k * a, X = Math.max(I, (v - C) * a)) : _ > q && (f.top = !1, L = Math.max((_ - C) * a, I), X = Math.max((v - C) * a, I));
|
|
1639
1639
|
}
|
|
1640
|
-
return M = Math.max(M,
|
|
1640
|
+
return M = Math.max(M, E.left), L = Math.max(L, E.top), b = Math.max(b, E.left), X = Math.max(X, E.top), {
|
|
1641
1641
|
left: M,
|
|
1642
1642
|
right: b,
|
|
1643
1643
|
top: L,
|
|
@@ -1646,21 +1646,21 @@ function Ir(i, t, e, n, r, s = !1) {
|
|
|
1646
1646
|
};
|
|
1647
1647
|
}
|
|
1648
1648
|
const ge = (i, t, e, n, r) => {
|
|
1649
|
-
const { left: s, top: o, width: a, height:
|
|
1649
|
+
const { left: s, top: o, width: a, height: d, angle: u } = i, c = {
|
|
1650
1650
|
left: s,
|
|
1651
1651
|
right: s + a,
|
|
1652
1652
|
top: o,
|
|
1653
|
-
bottom: o +
|
|
1654
|
-
},
|
|
1653
|
+
bottom: o + d
|
|
1654
|
+
}, l = Ir(c, t, e, n, r), { scaleX: g, scaleY: h } = t.getAncestorScale();
|
|
1655
1655
|
return {
|
|
1656
|
-
startX:
|
|
1657
|
-
endX:
|
|
1658
|
-
startY:
|
|
1659
|
-
endY:
|
|
1656
|
+
startX: l.left,
|
|
1657
|
+
endX: l.right,
|
|
1658
|
+
startY: l.top,
|
|
1659
|
+
endY: l.bottom,
|
|
1660
1660
|
rotate: u,
|
|
1661
1661
|
width: a * g,
|
|
1662
|
-
height:
|
|
1663
|
-
absolute:
|
|
1662
|
+
height: d * h,
|
|
1663
|
+
absolute: l.absolute
|
|
1664
1664
|
};
|
|
1665
1665
|
};
|
|
1666
1666
|
let et = class extends ne {
|
|
@@ -1705,29 +1705,29 @@ let et = class extends ne {
|
|
|
1705
1705
|
this._drawingManagerService.add$.subscribe((t) => {
|
|
1706
1706
|
t.forEach((e) => {
|
|
1707
1707
|
var K;
|
|
1708
|
-
const { unitId: n, subUnitId: r, drawingId: s } = e, o = se(this._univerInstanceService, { unitId: n, subUnitId: r }), a = this._drawingManagerService.getDrawingByParam(e),
|
|
1709
|
-
if (!
|
|
1708
|
+
const { unitId: n, subUnitId: r, drawingId: s } = e, o = se(this._univerInstanceService, { unitId: n, subUnitId: r }), a = this._drawingManagerService.getDrawingByParam(e), d = this._univerInstanceService.getUnit(n, F.UNIVER_SHEET);
|
|
1709
|
+
if (!d)
|
|
1710
1710
|
return;
|
|
1711
|
-
const u =
|
|
1711
|
+
const u = d.getActiveSheet().getSheetId();
|
|
1712
1712
|
if (!a || !o)
|
|
1713
1713
|
return;
|
|
1714
1714
|
const c = (K = this._renderManagerService.getRenderById(n)) == null ? void 0 : K.with(V).getSkeletonParam(r);
|
|
1715
1715
|
if (!c)
|
|
1716
1716
|
return;
|
|
1717
|
-
const { transform:
|
|
1717
|
+
const { transform: l, drawingType: g, data: h } = a;
|
|
1718
1718
|
if (g !== B.DRAWING_DOM && g !== B.DRAWING_CHART)
|
|
1719
1719
|
return;
|
|
1720
1720
|
const f = this._getSceneAndTransformerByDrawingSearch(n);
|
|
1721
1721
|
if (f == null)
|
|
1722
1722
|
return;
|
|
1723
1723
|
const { scene: p, canvas: m } = f;
|
|
1724
|
-
if (
|
|
1724
|
+
if (l == null)
|
|
1725
1725
|
return !0;
|
|
1726
1726
|
if (u !== r)
|
|
1727
1727
|
return;
|
|
1728
|
-
const { left: _, top: v, width: I, height: R, angle: S, flipX: C, flipY: w, skewX: y, skewY: D } =
|
|
1729
|
-
if (
|
|
1730
|
-
|
|
1728
|
+
const { left: _, top: v, width: I, height: R, angle: S, flipX: C, flipY: w, skewX: y, skewY: D } = l, T = Ie({ unitId: n, subUnitId: r, drawingId: s }), E = p.getObject(T);
|
|
1729
|
+
if (E != null) {
|
|
1730
|
+
E.transformByState({ left: _, top: v, width: I, height: R, angle: S, flipX: C, flipY: w, skewX: y, skewY: D });
|
|
1731
1731
|
return;
|
|
1732
1732
|
}
|
|
1733
1733
|
const M = {
|
|
@@ -1741,9 +1741,9 @@ let et = class extends ne {
|
|
|
1741
1741
|
const k = h ? h.backgroundColor : "white";
|
|
1742
1742
|
M.fill = k, h && h.border && (M.stroke = h.border), M.paintFirst = "stroke", M.strokeWidth = 1, M.borderEnabled = !1, M.radius = 8;
|
|
1743
1743
|
}
|
|
1744
|
-
const N = new
|
|
1744
|
+
const N = new Pe(T, M);
|
|
1745
1745
|
b && N.setObjectType(mn.CHART), p.addObject(N, Ft), a.allowTransform !== !1 && p.attachTransformerTo(N);
|
|
1746
|
-
const x = new wt(), q = ge(N, f.renderUnit.scene, c.skeleton, o.worksheet), H = new
|
|
1746
|
+
const x = new wt(), q = ge(N, f.renderUnit.scene, c.skeleton, o.worksheet), H = new We(q), L = {
|
|
1747
1747
|
dispose: x,
|
|
1748
1748
|
rect: N,
|
|
1749
1749
|
position$: H,
|
|
@@ -1784,38 +1784,38 @@ let et = class extends ne {
|
|
|
1784
1784
|
), this.disposeWithMe(
|
|
1785
1785
|
this._drawingManagerService.remove$.subscribe((t) => {
|
|
1786
1786
|
t.forEach((e) => {
|
|
1787
|
-
var
|
|
1788
|
-
const { unitId: n, subUnitId: r, drawingId: s } = e, o =
|
|
1787
|
+
var l;
|
|
1788
|
+
const { unitId: n, subUnitId: r, drawingId: s } = e, o = Ie({ unitId: n, subUnitId: r, drawingId: s }), a = this._getSceneAndTransformerByDrawingSearch(n);
|
|
1789
1789
|
if (a == null)
|
|
1790
1790
|
return;
|
|
1791
|
-
const { transformer:
|
|
1792
|
-
c != null && c.oKey && (
|
|
1791
|
+
const { transformer: d, scene: u } = a, c = u.getObject(o);
|
|
1792
|
+
c != null && c.oKey && (d.clearControlByIds([c == null ? void 0 : c.oKey]), (l = u.getTransformer()) == null || l.clearSelectedObjects());
|
|
1793
1793
|
});
|
|
1794
1794
|
})
|
|
1795
1795
|
);
|
|
1796
1796
|
}
|
|
1797
1797
|
_scrollUpdateListener() {
|
|
1798
1798
|
const t = (e, n) => {
|
|
1799
|
-
var
|
|
1800
|
-
const r = this._getSceneAndTransformerByDrawingSearch(e), s = Array.from(this._domLayerInfoMap.keys()).map((u) => ({ id: u, ...this._domLayerInfoMap.get(u) })).filter((u) => u.subUnitId === n && u.unitId === e).map((u) => u.id), o = se(this._univerInstanceService, { unitId: e, subUnitId: n }), a = (
|
|
1799
|
+
var d;
|
|
1800
|
+
const r = this._getSceneAndTransformerByDrawingSearch(e), s = Array.from(this._domLayerInfoMap.keys()).map((u) => ({ id: u, ...this._domLayerInfoMap.get(u) })).filter((u) => u.subUnitId === n && u.unitId === e).map((u) => u.id), o = se(this._univerInstanceService, { unitId: e, subUnitId: n }), a = (d = this._renderManagerService.getRenderById(e)) == null ? void 0 : d.with(V).getSkeletonParam(n);
|
|
1801
1801
|
!r || !o || !a || s.forEach((u) => {
|
|
1802
1802
|
const c = this._domLayerInfoMap.get(u);
|
|
1803
1803
|
if (c) {
|
|
1804
|
-
const
|
|
1805
|
-
c.position$.next(
|
|
1804
|
+
const l = ge(c.rect, r.renderUnit.scene, a.skeleton, o.worksheet, c);
|
|
1805
|
+
c.position$.next(l);
|
|
1806
1806
|
}
|
|
1807
1807
|
});
|
|
1808
1808
|
};
|
|
1809
1809
|
this.disposeWithMe(
|
|
1810
1810
|
this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET).pipe(
|
|
1811
1811
|
we((e) => e ? e.activeSheet$ : Bn(null)),
|
|
1812
|
-
|
|
1812
|
+
be((e) => {
|
|
1813
1813
|
if (!e) return null;
|
|
1814
1814
|
const n = e.getUnitId(), r = this._renderManagerService.getRenderById(n);
|
|
1815
1815
|
return r ? { render: r, unitId: n, subUnitId: e.getSheetId() } : null;
|
|
1816
1816
|
}),
|
|
1817
1817
|
we(
|
|
1818
|
-
(e) => e ? qr(e.render.scene.getViewport(xn.VIEW_MAIN).onScrollAfter$).pipe(
|
|
1818
|
+
(e) => e ? qr(e.render.scene.getViewport(xn.VIEW_MAIN).onScrollAfter$).pipe(be(() => ({ unitId: e.unitId, subUnitId: e.subUnitId }))) : Bn(null)
|
|
1819
1819
|
)
|
|
1820
1820
|
).subscribe((e) => {
|
|
1821
1821
|
if (!e) return;
|
|
@@ -1834,23 +1834,30 @@ let et = class extends ne {
|
|
|
1834
1834
|
}
|
|
1835
1835
|
}));
|
|
1836
1836
|
}
|
|
1837
|
+
updateFloatDomProps(t, e, n, r) {
|
|
1838
|
+
const s = this._domLayerInfoMap.get(n), o = this._getSceneAndTransformerByDrawingSearch(t);
|
|
1839
|
+
if (s && o) {
|
|
1840
|
+
const { scene: a } = o, d = Ie({ unitId: t, subUnitId: e, drawingId: n }), u = a.getObject(d);
|
|
1841
|
+
u && u instanceof Pe && u.setProps(r);
|
|
1842
|
+
}
|
|
1843
|
+
}
|
|
1837
1844
|
_getPosition(t, e) {
|
|
1838
1845
|
var g;
|
|
1839
|
-
const { startX: n, endX: r, startY: s, endY: o } = t, a = (g = this._renderManagerService.getRenderById(e)) == null ? void 0 : g.with(
|
|
1846
|
+
const { startX: n, endX: r, startY: s, endY: o } = t, a = (g = this._renderManagerService.getRenderById(e)) == null ? void 0 : g.with(xe);
|
|
1840
1847
|
if (a == null)
|
|
1841
1848
|
return;
|
|
1842
|
-
const
|
|
1843
|
-
if (
|
|
1849
|
+
const d = a.getCellWithCoordByOffset(n, s);
|
|
1850
|
+
if (d == null)
|
|
1844
1851
|
return;
|
|
1845
1852
|
const u = {
|
|
1846
|
-
column:
|
|
1847
|
-
columnOffset: n -
|
|
1848
|
-
row:
|
|
1849
|
-
rowOffset: s -
|
|
1853
|
+
column: d.actualColumn,
|
|
1854
|
+
columnOffset: n - d.startX,
|
|
1855
|
+
row: d.actualRow,
|
|
1856
|
+
rowOffset: s - d.startY
|
|
1850
1857
|
}, c = a.getCellWithCoordByOffset(r, o);
|
|
1851
1858
|
if (c == null)
|
|
1852
1859
|
return;
|
|
1853
|
-
const
|
|
1860
|
+
const l = {
|
|
1854
1861
|
column: c.actualColumn,
|
|
1855
1862
|
columnOffset: r - c.startX,
|
|
1856
1863
|
row: c.actualRow,
|
|
@@ -1858,7 +1865,7 @@ let et = class extends ne {
|
|
|
1858
1865
|
};
|
|
1859
1866
|
return {
|
|
1860
1867
|
from: u,
|
|
1861
|
-
to:
|
|
1868
|
+
to: l
|
|
1862
1869
|
};
|
|
1863
1870
|
}
|
|
1864
1871
|
_featureUpdateListener() {
|
|
@@ -1900,8 +1907,8 @@ let et = class extends ne {
|
|
|
1900
1907
|
});
|
|
1901
1908
|
if (!n)
|
|
1902
1909
|
throw new Error("cannot find current target!");
|
|
1903
|
-
const { unitId: r, subUnitId: s } = n, { initPosition: o, componentKey: a, data:
|
|
1904
|
-
if (
|
|
1910
|
+
const { unitId: r, subUnitId: s } = n, { initPosition: o, componentKey: a, data: d, allowTransform: u = !0 } = t, c = e != null ? e : Dt(), l = this._getPosition(o, r);
|
|
1911
|
+
if (l == null)
|
|
1905
1912
|
return;
|
|
1906
1913
|
const g = {
|
|
1907
1914
|
unitId: r,
|
|
@@ -1909,14 +1916,14 @@ let et = class extends ne {
|
|
|
1909
1916
|
drawingId: c,
|
|
1910
1917
|
drawingType: t.type || B.DRAWING_DOM,
|
|
1911
1918
|
componentKey: a,
|
|
1912
|
-
sheetTransform:
|
|
1919
|
+
sheetTransform: l,
|
|
1913
1920
|
transform: {
|
|
1914
1921
|
left: o.startX,
|
|
1915
1922
|
top: o.startY,
|
|
1916
1923
|
width: o.endX - o.startX,
|
|
1917
1924
|
height: o.endY - o.startY
|
|
1918
1925
|
},
|
|
1919
|
-
data:
|
|
1926
|
+
data: d,
|
|
1920
1927
|
allowTransform: u
|
|
1921
1928
|
};
|
|
1922
1929
|
return this._commandService.executeCommand(kt.id, {
|
|
@@ -1940,7 +1947,7 @@ let et = class extends ne {
|
|
|
1940
1947
|
const a = this._drawingManagerService.getDrawingByParam({ unitId: r, subUnitId: s, drawingId: t });
|
|
1941
1948
|
if (!a)
|
|
1942
1949
|
return;
|
|
1943
|
-
const
|
|
1950
|
+
const d = this._sheetDrawingService.getBatchRemoveOp([a]), { redo: u, objects: c } = d;
|
|
1944
1951
|
this._commandService.syncExecuteCommand(P.id, { unitId: r, subUnitId: s, op: u, objects: c, type: U.REMOVE });
|
|
1945
1952
|
}
|
|
1946
1953
|
}
|
|
@@ -1953,21 +1960,21 @@ let et = class extends ne {
|
|
|
1953
1960
|
});
|
|
1954
1961
|
if (!s)
|
|
1955
1962
|
throw new Error("cannot find current target!");
|
|
1956
|
-
const { unitId: o, subUnitId: a } = s,
|
|
1957
|
-
if (!
|
|
1963
|
+
const { unitId: o, subUnitId: a } = s, d = this._getSceneAndTransformerByDrawingSearch(o);
|
|
1964
|
+
if (!d) return;
|
|
1958
1965
|
const u = this._renderManagerService.getRenderById(o);
|
|
1959
1966
|
if (!u) return;
|
|
1960
1967
|
const c = (C = this._renderManagerService.getRenderById(o)) == null ? void 0 : C.with(V).getWorksheetSkeleton(a);
|
|
1961
1968
|
if (!c) return;
|
|
1962
|
-
const { componentKey:
|
|
1969
|
+
const { componentKey: l, data: g, allowTransform: h = !0 } = e, f = r != null ? r : Dt(), { position: p, position$: m } = this._createRangePositionObserver(t, u, c.skeleton);
|
|
1963
1970
|
if (this._getPosition(p, o) == null)
|
|
1964
1971
|
return;
|
|
1965
|
-
const v =
|
|
1972
|
+
const v = d.scene, { scaleX: I } = v.getAncestorScale(), R = It(p, n, I), S = {
|
|
1966
1973
|
unitId: o,
|
|
1967
1974
|
subUnitId: a,
|
|
1968
1975
|
drawingId: f,
|
|
1969
1976
|
drawingType: e.type || B.DRAWING_DOM,
|
|
1970
|
-
componentKey:
|
|
1977
|
+
componentKey: l,
|
|
1971
1978
|
transform: {
|
|
1972
1979
|
left: R.startX,
|
|
1973
1980
|
top: R.startY,
|
|
@@ -1978,7 +1985,7 @@ let et = class extends ne {
|
|
|
1978
1985
|
allowTransform: h
|
|
1979
1986
|
};
|
|
1980
1987
|
{
|
|
1981
|
-
const { unitId: D, subUnitId:
|
|
1988
|
+
const { unitId: D, subUnitId: T, drawingId: E } = S, M = se(this._univerInstanceService, { unitId: D, subUnitId: T }), b = S, N = this._univerInstanceService.getUnit(D, F.UNIVER_SHEET);
|
|
1982
1989
|
if (!N)
|
|
1983
1990
|
return;
|
|
1984
1991
|
const x = N.getActiveSheet().getSheetId();
|
|
@@ -1987,7 +1994,7 @@ let et = class extends ne {
|
|
|
1987
1994
|
const q = (w = this._renderManagerService.getRenderById(D)) == null ? void 0 : w.with(V);
|
|
1988
1995
|
if (!q)
|
|
1989
1996
|
return;
|
|
1990
|
-
const H = q.getWorksheetSkeleton(
|
|
1997
|
+
const H = q.getWorksheetSkeleton(T);
|
|
1991
1998
|
if (!H)
|
|
1992
1999
|
return;
|
|
1993
2000
|
const { transform: L, drawingType: X, data: K } = b;
|
|
@@ -1996,12 +2003,12 @@ let et = class extends ne {
|
|
|
1996
2003
|
const k = this._getSceneAndTransformerByDrawingSearch(D);
|
|
1997
2004
|
if (k == null)
|
|
1998
2005
|
return;
|
|
1999
|
-
const { scene: ae, canvas:
|
|
2000
|
-
if (L == null || x !==
|
|
2006
|
+
const { scene: ae, canvas: Me } = k;
|
|
2007
|
+
if (L == null || x !== T)
|
|
2001
2008
|
return;
|
|
2002
|
-
const { left: st, top: ot, width: at, height: ct, angle: jt, flipX: $t, flipY: dt, skewX: lt, skewY:
|
|
2009
|
+
const { left: st, top: ot, width: at, height: ct, angle: jt, flipX: $t, flipY: dt, skewX: lt, skewY: ye } = L, ut = Ie({ unitId: D, subUnitId: T, drawingId: E }), de = ae.getObject(ut);
|
|
2003
2010
|
if (de != null) {
|
|
2004
|
-
de.transformByState({ left: st, top: ot, width: at, height: ct, angle: jt, flipX: $t, flipY: dt, skewX: lt, skewY:
|
|
2011
|
+
de.transformByState({ left: st, top: ot, width: at, height: ct, angle: jt, flipX: $t, flipY: dt, skewX: lt, skewY: ye });
|
|
2005
2012
|
return;
|
|
2006
2013
|
}
|
|
2007
2014
|
const Q = {
|
|
@@ -2010,16 +2017,16 @@ let et = class extends ne {
|
|
|
2010
2017
|
top: ot,
|
|
2011
2018
|
width: at,
|
|
2012
2019
|
height: ct,
|
|
2013
|
-
zIndex: this._drawingManagerService.getDrawingOrder(D,
|
|
2014
|
-
},
|
|
2015
|
-
if (
|
|
2020
|
+
zIndex: this._drawingManagerService.getDrawingOrder(D, T).length - 1
|
|
2021
|
+
}, Te = X === B.DRAWING_CHART;
|
|
2022
|
+
if (Te) {
|
|
2016
2023
|
const W = K ? K.backgroundColor : "white";
|
|
2017
2024
|
Q.fill = W, Q.rotateEnabled = !1, K && K.border && (Q.stroke = K.border), Q.paintFirst = "stroke", Q.strokeWidth = 1, Q.borderEnabled = !1, Q.radius = 8;
|
|
2018
2025
|
}
|
|
2019
|
-
const le = new
|
|
2020
|
-
|
|
2021
|
-
const ue = new wt(), ht = ae.getMainViewport(), { rowHeaderWidth: Ee, columnHeaderHeight:
|
|
2022
|
-
top:
|
|
2026
|
+
const le = new Pe(ut, Q);
|
|
2027
|
+
Te && le.setObjectType(mn.CHART), ae.addObject(le, Ft), b.allowTransform !== !1 && ae.attachTransformerTo(le);
|
|
2028
|
+
const ue = new wt(), ht = ae.getMainViewport(), { rowHeaderWidth: Ee, columnHeaderHeight: Ge } = H.skeleton, gt = {
|
|
2029
|
+
top: Ge,
|
|
2023
2030
|
left: Ee,
|
|
2024
2031
|
bottom: ht.bottom,
|
|
2025
2032
|
right: ht.right
|
|
@@ -2029,12 +2036,12 @@ let et = class extends ne {
|
|
|
2029
2036
|
boundsOfViewArea: gt,
|
|
2030
2037
|
domAnchor: n,
|
|
2031
2038
|
unitId: D,
|
|
2032
|
-
subUnitId:
|
|
2033
|
-
}, j = ge(le, k.renderUnit.scene, H.skeleton, M.worksheet, he),
|
|
2034
|
-
he.position$ =
|
|
2035
|
-
let
|
|
2036
|
-
position$:
|
|
2037
|
-
id:
|
|
2039
|
+
subUnitId: T
|
|
2040
|
+
}, j = ge(le, k.renderUnit.scene, H.skeleton, M.worksheet, he), Oe = new We(j);
|
|
2041
|
+
he.position$ = Oe;
|
|
2042
|
+
let Le = {
|
|
2043
|
+
position$: Oe,
|
|
2044
|
+
id: E,
|
|
2038
2045
|
componentKey: b.componentKey,
|
|
2039
2046
|
onPointerDown: () => {
|
|
2040
2047
|
},
|
|
@@ -2043,23 +2050,23 @@ let et = class extends ne {
|
|
|
2043
2050
|
onPointerUp: () => {
|
|
2044
2051
|
},
|
|
2045
2052
|
onWheel: (W) => {
|
|
2046
|
-
|
|
2053
|
+
Me.dispatchEvent(new WheelEvent(W.type, W));
|
|
2047
2054
|
},
|
|
2048
2055
|
data: K,
|
|
2049
2056
|
unitId: D
|
|
2050
2057
|
};
|
|
2051
|
-
e.eventPassThrough && (
|
|
2052
|
-
...
|
|
2058
|
+
e.eventPassThrough && (Le = {
|
|
2059
|
+
...Le,
|
|
2053
2060
|
onPointerDown: (W) => {
|
|
2054
|
-
|
|
2061
|
+
Me.dispatchEvent(new PointerEvent(W.type, W));
|
|
2055
2062
|
},
|
|
2056
2063
|
onPointerMove: (W) => {
|
|
2057
|
-
|
|
2064
|
+
Me.dispatchEvent(new PointerEvent(W.type, W));
|
|
2058
2065
|
},
|
|
2059
2066
|
onPointerUp: (W) => {
|
|
2060
|
-
|
|
2067
|
+
Me.dispatchEvent(new PointerEvent(W.type, W));
|
|
2061
2068
|
}
|
|
2062
|
-
}), this._canvasFloatDomService.addFloatDom(
|
|
2069
|
+
}), this._canvasFloatDomService.addFloatDom(Le), this.disposeWithMe(m.subscribe((W) => {
|
|
2063
2070
|
var un, hn, gn, fn;
|
|
2064
2071
|
const ln = It({
|
|
2065
2072
|
startX: W.startX,
|
|
@@ -2072,28 +2079,28 @@ let et = class extends ne {
|
|
|
2072
2079
|
left: p.absolute.left,
|
|
2073
2080
|
top: p.absolute.top
|
|
2074
2081
|
}
|
|
2075
|
-
}, n), Rr =
|
|
2082
|
+
}, n), Rr = Ie({ unitId: D, subUnitId: T, drawingId: E }), br = new Pe(Rr, {
|
|
2076
2083
|
left: ln.startX,
|
|
2077
2084
|
top: ln.startY,
|
|
2078
2085
|
width: (gn = n.width) != null ? gn : W.width,
|
|
2079
2086
|
height: (fn = n.height) != null ? fn : W.height,
|
|
2080
|
-
zIndex: this._drawingManagerService.getDrawingOrder(D,
|
|
2087
|
+
zIndex: this._drawingManagerService.getDrawingOrder(D, T).length - 1
|
|
2081
2088
|
}), Mr = ge(br, k.renderUnit.scene, H.skeleton, M.worksheet, he);
|
|
2082
|
-
|
|
2089
|
+
Oe.next(Mr);
|
|
2083
2090
|
}));
|
|
2084
|
-
const
|
|
2085
|
-
|
|
2091
|
+
const Ve = (y = this._renderManagerService.getRenderById(D)) == null ? void 0 : y.with(V);
|
|
2092
|
+
Ve == null || Ve.currentSkeleton$.subscribe((W) => {
|
|
2086
2093
|
W && H.sheetId !== W.sheetId && this._removeDom(f, !0);
|
|
2087
2094
|
});
|
|
2088
2095
|
const ft = le.onTransformChange$.subscribeEvent(() => {
|
|
2089
2096
|
const W = ge(le, k.renderUnit.scene, H.skeleton, M.worksheet, he);
|
|
2090
|
-
|
|
2097
|
+
Oe.next(
|
|
2091
2098
|
W
|
|
2092
2099
|
);
|
|
2093
2100
|
});
|
|
2094
2101
|
ue.add(() => {
|
|
2095
|
-
this._canvasFloatDomService.removeFloatDom(
|
|
2096
|
-
}), ft && ue.add(ft), this._domLayerInfoMap.set(
|
|
2102
|
+
this._canvasFloatDomService.removeFloatDom(E);
|
|
2103
|
+
}), ft && ue.add(ft), this._domLayerInfoMap.set(E, he);
|
|
2097
2104
|
}
|
|
2098
2105
|
return {
|
|
2099
2106
|
id: f,
|
|
@@ -2117,7 +2124,7 @@ let et = class extends ne {
|
|
|
2117
2124
|
if (!u) return;
|
|
2118
2125
|
const c = (R = this._renderManagerService.getRenderById(o)) == null ? void 0 : R.with(V).getWorksheetSkeleton(a);
|
|
2119
2126
|
if (!c) return;
|
|
2120
|
-
const { componentKey:
|
|
2127
|
+
const { componentKey: l, data: g, allowTransform: h = !0 } = e, f = r != null ? r : Dt(), { position: p, position$: m } = this._createRangePositionObserver({
|
|
2121
2128
|
startRow: 0,
|
|
2122
2129
|
endRow: 0,
|
|
2123
2130
|
startColumn: t,
|
|
@@ -2130,7 +2137,7 @@ let et = class extends ne {
|
|
|
2130
2137
|
subUnitId: a,
|
|
2131
2138
|
drawingId: f,
|
|
2132
2139
|
drawingType: e.type || B.DRAWING_DOM,
|
|
2133
|
-
componentKey:
|
|
2140
|
+
componentKey: l,
|
|
2134
2141
|
transform: {
|
|
2135
2142
|
left: _.startX,
|
|
2136
2143
|
top: _.startY,
|
|
@@ -2141,11 +2148,11 @@ let et = class extends ne {
|
|
|
2141
2148
|
allowTransform: h
|
|
2142
2149
|
};
|
|
2143
2150
|
{
|
|
2144
|
-
const { unitId: w, subUnitId: y, drawingId: D } = I,
|
|
2151
|
+
const { unitId: w, subUnitId: y, drawingId: D } = I, T = se(this._univerInstanceService, { unitId: w, subUnitId: y }), E = I, M = this._univerInstanceService.getUnit(w, F.UNIVER_SHEET);
|
|
2145
2152
|
if (!M)
|
|
2146
2153
|
return;
|
|
2147
2154
|
const b = M.getActiveSheet().getSheetId();
|
|
2148
|
-
if (!
|
|
2155
|
+
if (!E || !T)
|
|
2149
2156
|
return;
|
|
2150
2157
|
const N = (S = this._renderManagerService.getRenderById(w)) == null ? void 0 : S.with(V);
|
|
2151
2158
|
if (!N)
|
|
@@ -2153,18 +2160,18 @@ let et = class extends ne {
|
|
|
2153
2160
|
const x = N.getWorksheetSkeleton(y);
|
|
2154
2161
|
if (!x)
|
|
2155
2162
|
return;
|
|
2156
|
-
const { transform: q, data: H } =
|
|
2163
|
+
const { transform: q, data: H } = E, L = this._getSceneAndTransformerByDrawingSearch(w);
|
|
2157
2164
|
if (L == null)
|
|
2158
2165
|
return;
|
|
2159
2166
|
const { scene: X, canvas: K } = L;
|
|
2160
2167
|
if (q == null || b !== y)
|
|
2161
2168
|
return;
|
|
2162
|
-
const { left: k, top: ae, width:
|
|
2169
|
+
const { left: k, top: ae, width: Me, height: st, angle: ot, flipX: at, flipY: ct, skewX: jt, skewY: $t } = q, dt = Ie({ unitId: w, subUnitId: y, drawingId: D }), lt = X.getObject(dt);
|
|
2163
2170
|
if (lt != null) {
|
|
2164
|
-
lt.transformByState({ left: k, top: ae, width:
|
|
2171
|
+
lt.transformByState({ left: k, top: ae, width: Me, height: st, angle: ot, flipX: at, flipY: ct, skewX: jt, skewY: $t });
|
|
2165
2172
|
return;
|
|
2166
2173
|
}
|
|
2167
|
-
const
|
|
2174
|
+
const ye = It({
|
|
2168
2175
|
startX: _.startX,
|
|
2169
2176
|
startY: 0,
|
|
2170
2177
|
endX: p.endX,
|
|
@@ -2176,19 +2183,19 @@ let et = class extends ne {
|
|
|
2176
2183
|
top: p.absolute.top
|
|
2177
2184
|
}
|
|
2178
2185
|
}, n), ut = {
|
|
2179
|
-
left:
|
|
2180
|
-
top:
|
|
2181
|
-
width:
|
|
2182
|
-
height:
|
|
2186
|
+
left: ye.startX,
|
|
2187
|
+
top: ye.startY,
|
|
2188
|
+
width: ye.width,
|
|
2189
|
+
height: ye.height,
|
|
2183
2190
|
zIndex: this._drawingManagerService.getDrawingOrder(w, y).length - 1
|
|
2184
|
-
}, de = new
|
|
2185
|
-
X.addObject(de, Ft),
|
|
2186
|
-
const Q = new wt(),
|
|
2191
|
+
}, de = new Pe(dt, ut);
|
|
2192
|
+
X.addObject(de, Ft), E.allowTransform !== !1 && X.attachTransformerTo(de);
|
|
2193
|
+
const Q = new wt(), Te = X.getMainViewport(), le = {
|
|
2187
2194
|
top: 0,
|
|
2188
2195
|
//viewMain.top,
|
|
2189
|
-
left:
|
|
2190
|
-
bottom:
|
|
2191
|
-
right:
|
|
2196
|
+
left: Te.left,
|
|
2197
|
+
bottom: Te.bottom,
|
|
2198
|
+
right: Te.right
|
|
2192
2199
|
}, ue = {
|
|
2193
2200
|
dispose: Q,
|
|
2194
2201
|
rect: de,
|
|
@@ -2199,12 +2206,12 @@ let et = class extends ne {
|
|
|
2199
2206
|
domAnchor: n,
|
|
2200
2207
|
scrollDirectionResponse: "HORIZONTAL"
|
|
2201
2208
|
/* HORIZONTAL */
|
|
2202
|
-
}, ht = ge(de, L.renderUnit.scene, x.skeleton,
|
|
2209
|
+
}, ht = ge(de, L.renderUnit.scene, x.skeleton, T.worksheet, ue), Ee = new We(ht);
|
|
2203
2210
|
ue.position$ = Ee;
|
|
2204
|
-
let
|
|
2211
|
+
let Ge = {
|
|
2205
2212
|
position$: Ee,
|
|
2206
2213
|
id: D,
|
|
2207
|
-
componentKey:
|
|
2214
|
+
componentKey: E.componentKey,
|
|
2208
2215
|
onPointerDown: () => {
|
|
2209
2216
|
},
|
|
2210
2217
|
onPointerMove: () => {
|
|
@@ -2217,8 +2224,8 @@ let et = class extends ne {
|
|
|
2217
2224
|
data: H,
|
|
2218
2225
|
unitId: w
|
|
2219
2226
|
};
|
|
2220
|
-
e.eventPassThrough && (
|
|
2221
|
-
...
|
|
2227
|
+
e.eventPassThrough && (Ge = {
|
|
2228
|
+
...Ge,
|
|
2222
2229
|
onPointerDown: (j) => {
|
|
2223
2230
|
K.dispatchEvent(new PointerEvent(j.type, j));
|
|
2224
2231
|
},
|
|
@@ -2228,15 +2235,15 @@ let et = class extends ne {
|
|
|
2228
2235
|
onPointerUp: (j) => {
|
|
2229
2236
|
K.dispatchEvent(new PointerEvent(j.type, j));
|
|
2230
2237
|
}
|
|
2231
|
-
}), this._canvasFloatDomService.addFloatDom(
|
|
2238
|
+
}), this._canvasFloatDomService.addFloatDom(Ge);
|
|
2232
2239
|
const gt = de.onTransformChange$.subscribeEvent(() => {
|
|
2233
|
-
const j = ge(de, L.renderUnit.scene, x.skeleton,
|
|
2240
|
+
const j = ge(de, L.renderUnit.scene, x.skeleton, T.worksheet, ue);
|
|
2234
2241
|
Ee.next(
|
|
2235
2242
|
j
|
|
2236
2243
|
);
|
|
2237
2244
|
});
|
|
2238
2245
|
this.disposeWithMe(m.subscribe((j) => {
|
|
2239
|
-
const
|
|
2246
|
+
const Oe = It({
|
|
2240
2247
|
startX: j.startX,
|
|
2241
2248
|
startY: 0,
|
|
2242
2249
|
endX: j.endX,
|
|
@@ -2247,13 +2254,13 @@ let et = class extends ne {
|
|
|
2247
2254
|
left: p.absolute.left,
|
|
2248
2255
|
top: p.absolute.top
|
|
2249
2256
|
}
|
|
2250
|
-
}, n),
|
|
2251
|
-
left:
|
|
2257
|
+
}, n), Le = Ie({ unitId: w, subUnitId: y, drawingId: D }), Ve = new Pe(Le, {
|
|
2258
|
+
left: Oe.startX,
|
|
2252
2259
|
top: 0,
|
|
2253
2260
|
width: n.width,
|
|
2254
2261
|
height: n.height,
|
|
2255
2262
|
zIndex: this._drawingManagerService.getDrawingOrder(w, y).length - 1
|
|
2256
|
-
}), ft = ge(
|
|
2263
|
+
}), ft = ge(Ve, L.renderUnit.scene, x.skeleton, T.worksheet, ue);
|
|
2257
2264
|
Ee.next(ft);
|
|
2258
2265
|
}));
|
|
2259
2266
|
const he = (C = this._renderManagerService.getRenderById(w)) == null ? void 0 : C.with(V);
|
|
@@ -2283,11 +2290,11 @@ let et = class extends ne {
|
|
|
2283
2290
|
// eslint-disable-next-line max-lines-per-function
|
|
2284
2291
|
_createRangePositionObserver(t, e, n) {
|
|
2285
2292
|
let { startRow: r, startColumn: s } = t;
|
|
2286
|
-
const o = Je(r, s, n), a = new
|
|
2293
|
+
const o = Je(r, s, n), a = new We(o), d = Je(t.endRow, t.endColumn, n), u = new We(d), c = () => {
|
|
2287
2294
|
const m = Je(r, s, n), _ = Je(t.endRow, t.endColumn, n);
|
|
2288
2295
|
a.next(m), u.next(_);
|
|
2289
|
-
},
|
|
2290
|
-
|
|
2296
|
+
}, l = new wt();
|
|
2297
|
+
l.add(e.engine.clientRect$.subscribe(() => c())), l.add(this._commandService.onCommandExecuted((m) => {
|
|
2291
2298
|
if (m.id === gi.id && m.params.rowsAutoHeightInfo.findIndex((v) => v.row === r) > -1) {
|
|
2292
2299
|
c();
|
|
2293
2300
|
return;
|
|
@@ -2298,18 +2305,18 @@ let et = class extends ne {
|
|
|
2298
2305
|
r = m, s = _, c();
|
|
2299
2306
|
}, h = () => ({
|
|
2300
2307
|
rotate: 0,
|
|
2301
|
-
width:
|
|
2302
|
-
height:
|
|
2308
|
+
width: d.right - o.left,
|
|
2309
|
+
height: d.bottom - o.top,
|
|
2303
2310
|
absolute: {
|
|
2304
2311
|
left: !0,
|
|
2305
2312
|
top: !0
|
|
2306
2313
|
},
|
|
2307
2314
|
startX: o.left,
|
|
2308
2315
|
startY: o.top,
|
|
2309
|
-
endX:
|
|
2310
|
-
endY:
|
|
2316
|
+
endX: d.right,
|
|
2317
|
+
endY: d.bottom
|
|
2311
2318
|
}), f = a.pipe(
|
|
2312
|
-
|
|
2319
|
+
be((m) => {
|
|
2313
2320
|
const _ = Je(t.endRow, t.endColumn, n);
|
|
2314
2321
|
return {
|
|
2315
2322
|
rotate: 0,
|
|
@@ -2332,18 +2339,18 @@ let et = class extends ne {
|
|
|
2332
2339
|
updateRowCol: g,
|
|
2333
2340
|
topLeftPos$: a,
|
|
2334
2341
|
rightBottomPos$: u,
|
|
2335
|
-
disposable:
|
|
2342
|
+
disposable: l
|
|
2336
2343
|
};
|
|
2337
2344
|
}
|
|
2338
2345
|
};
|
|
2339
2346
|
et = ys([
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
+
Ce(0, A(J)),
|
|
2348
|
+
Ce(1, Se),
|
|
2349
|
+
Ce(2, A(G)),
|
|
2350
|
+
Ce(3, ie),
|
|
2351
|
+
Ce(4, A(Wi)),
|
|
2352
|
+
Ce(5, re),
|
|
2353
|
+
Ce(6, A(Jr))
|
|
2347
2354
|
], et);
|
|
2348
2355
|
function Je(i, t, e) {
|
|
2349
2356
|
const n = e.getCellWithCoordByIndex(i, t), r = n.isMergedMainCell ? n.mergeInfo : n;
|
|
@@ -2358,23 +2365,23 @@ function It(i, t, e) {
|
|
|
2358
2365
|
var u, c;
|
|
2359
2366
|
e = e != null ? e : 1;
|
|
2360
2367
|
const n = i.endX - i.startX, r = i.endY - i.startY, s = (u = t == null ? void 0 : t.width) != null ? u : n, o = (c = t == null ? void 0 : t.height) != null ? c : r;
|
|
2361
|
-
let a = 0,
|
|
2368
|
+
let a = 0, d = 0;
|
|
2362
2369
|
if (t) {
|
|
2363
2370
|
if (t.horizonOffsetAlign === "right") {
|
|
2364
|
-
const
|
|
2365
|
-
a = i.endX -
|
|
2371
|
+
const l = Ct(t.marginX, n * e);
|
|
2372
|
+
a = i.endX - l - s;
|
|
2366
2373
|
} else
|
|
2367
2374
|
a = i.startX + Ct(t.marginX, n);
|
|
2368
2375
|
if (t.verticalOffsetAlign === "bottom") {
|
|
2369
|
-
const
|
|
2370
|
-
|
|
2376
|
+
const l = Ct(t.marginY, r * e);
|
|
2377
|
+
d = i.endY - l - o;
|
|
2371
2378
|
} else
|
|
2372
|
-
|
|
2379
|
+
d = i.startY + Ct(t.marginY, r);
|
|
2373
2380
|
}
|
|
2374
2381
|
return {
|
|
2375
2382
|
rotate: 0,
|
|
2376
2383
|
startX: a,
|
|
2377
|
-
startY:
|
|
2384
|
+
startY: d,
|
|
2378
2385
|
endX: i.endX,
|
|
2379
2386
|
endY: i.endY,
|
|
2380
2387
|
width: s,
|
|
@@ -2391,14 +2398,14 @@ function Ct(i, t) {
|
|
|
2391
2398
|
const e = Number.parseFloat(i);
|
|
2392
2399
|
return t * e / 100;
|
|
2393
2400
|
}
|
|
2394
|
-
const
|
|
2401
|
+
const Ts = (i) => {
|
|
2395
2402
|
const { floatDomInfos: t, scene: e, skeleton: n, worksheet: r } = i, s = Qi(() => t.map((o) => {
|
|
2396
|
-
const { width: a, height:
|
|
2403
|
+
const { width: a, height: d, angle: u, left: c, top: l } = o.transform, g = Ir(
|
|
2397
2404
|
{
|
|
2398
2405
|
left: c != null ? c : 0,
|
|
2399
2406
|
right: (c != null ? c : 0) + (a != null ? a : 0),
|
|
2400
|
-
top:
|
|
2401
|
-
bottom: (
|
|
2407
|
+
top: l != null ? l : 0,
|
|
2408
|
+
bottom: (l != null ? l : 0) + (d != null ? d : 0)
|
|
2402
2409
|
},
|
|
2403
2410
|
e,
|
|
2404
2411
|
n,
|
|
@@ -2412,10 +2419,10 @@ const Es = (i) => {
|
|
|
2412
2419
|
endY: g.bottom,
|
|
2413
2420
|
rotate: u,
|
|
2414
2421
|
width: a * h,
|
|
2415
|
-
height:
|
|
2422
|
+
height: d * f,
|
|
2416
2423
|
absolute: g.absolute
|
|
2417
2424
|
}, m = {
|
|
2418
|
-
position$: new
|
|
2425
|
+
position$: new We(p),
|
|
2419
2426
|
position: p,
|
|
2420
2427
|
id: o.drawingId,
|
|
2421
2428
|
componentKey: o.componentKey,
|
|
@@ -2434,11 +2441,11 @@ const Es = (i) => {
|
|
|
2434
2441
|
}), [t, e, n, r]);
|
|
2435
2442
|
return /* @__PURE__ */ oe("div", { style: { position: "absolute", top: 0, left: 0 }, children: s.map(([o, a]) => /* @__PURE__ */ oe(Bi, { layer: a, id: o, position: a.position }, o)) });
|
|
2436
2443
|
};
|
|
2437
|
-
var
|
|
2438
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
2444
|
+
var Es = Object.getOwnPropertyDescriptor, Os = (i, t, e, n) => {
|
|
2445
|
+
for (var r = n > 1 ? void 0 : n ? Es(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
2439
2446
|
(o = i[s]) && (r = o(r) || r);
|
|
2440
2447
|
return r;
|
|
2441
|
-
},
|
|
2448
|
+
}, De = (i, t) => (e, n) => t(e, n, i);
|
|
2442
2449
|
let Ot = class extends ne {
|
|
2443
2450
|
constructor(i, t, e, n, r, s, o) {
|
|
2444
2451
|
super(), this._sheetPrintInterceptorService = i, this._drawingRenderService = t, this._drawingManagerService = e, this._renderManagerService = n, this._canvasFloatDomManagerService = r, this._componetManager = s, this._injector = o, this._initPrinting(), this._initPrintingDom();
|
|
@@ -2450,8 +2457,8 @@ let Ot = class extends ne {
|
|
|
2450
2457
|
{
|
|
2451
2458
|
handler: (i, t, e) => {
|
|
2452
2459
|
const { unitId: n, scene: r, subUnitId: s } = t, o = this._drawingManagerService.getDrawingDataForUnit(n), a = o == null ? void 0 : o[s];
|
|
2453
|
-
return a && a.order.forEach((
|
|
2454
|
-
const u = a.data[
|
|
2460
|
+
return a && a.order.forEach((d) => {
|
|
2461
|
+
const u = a.data[d];
|
|
2455
2462
|
u.drawingType !== B.DRAWING_CHART && u.drawingType !== B.DRAWING_DOM && this._drawingRenderService.renderDrawing(u, r);
|
|
2456
2463
|
}), e();
|
|
2457
2464
|
}
|
|
@@ -2468,16 +2475,16 @@ let Ot = class extends ne {
|
|
|
2468
2475
|
const o = s.with(V).getSkeletonParam(r);
|
|
2469
2476
|
if (!o)
|
|
2470
2477
|
return e(i);
|
|
2471
|
-
const a = this._drawingManagerService.getDrawingDataForUnit(n),
|
|
2472
|
-
if (!
|
|
2478
|
+
const a = this._drawingManagerService.getDrawingDataForUnit(n), d = a == null ? void 0 : a[t.subUnitId];
|
|
2479
|
+
if (!d)
|
|
2473
2480
|
return e(i);
|
|
2474
|
-
const { scaleX: u, scaleY: c } = s.scene,
|
|
2481
|
+
const { scaleX: u, scaleY: c } = s.scene, l = i ? { ...i } : { startColumn: 0, endColumn: 0, endRow: 0, startRow: 0 }, g = d.order.map((h) => d.data[h]);
|
|
2475
2482
|
return g.length ? (g.forEach((h) => {
|
|
2476
|
-
if (!h.groupId && h.transform &&
|
|
2483
|
+
if (!h.groupId && h.transform && Re.isDefine(h.transform.left) && Re.isDefine(h.transform.top) && Re.isDefine(h.transform.width) && Re.isDefine(h.transform.height)) {
|
|
2477
2484
|
const f = o.skeleton.getCellIndexByOffset(h.transform.left, h.transform.top, u, c, { x: 0, y: 0 }), p = o.skeleton.getCellIndexByOffset(h.transform.left + h.transform.width, h.transform.top + h.transform.height, u, c, { x: 0, y: 0 });
|
|
2478
|
-
f.column <
|
|
2485
|
+
f.column < l.startColumn && (l.startColumn = f.column), f.row < l.startRow && (l.startRow = f.row), l.endRow < p.row && (l.endRow = p.row), l.endColumn < p.column && (l.endColumn = p.column);
|
|
2479
2486
|
}
|
|
2480
|
-
}), e(
|
|
2487
|
+
}), e(l)) : e(i);
|
|
2481
2488
|
}
|
|
2482
2489
|
}
|
|
2483
2490
|
)
|
|
@@ -2499,16 +2506,16 @@ let Ot = class extends ne {
|
|
|
2499
2506
|
componentKey: this._componetManager.get(Qr)
|
|
2500
2507
|
};
|
|
2501
2508
|
if (c.drawingType === B.DRAWING_DOM) {
|
|
2502
|
-
const
|
|
2509
|
+
const l = this._sheetPrintInterceptorService.getPrintComponent(c.componentKey);
|
|
2503
2510
|
return {
|
|
2504
2511
|
...c,
|
|
2505
|
-
componentKey: this._componetManager.get(
|
|
2512
|
+
componentKey: this._componetManager.get(l || c.componentKey)
|
|
2506
2513
|
};
|
|
2507
2514
|
}
|
|
2508
2515
|
return null;
|
|
2509
|
-
}).filter(Boolean),
|
|
2516
|
+
}).filter(Boolean), d = ji(Ts, this._injector);
|
|
2510
2517
|
return Di(
|
|
2511
|
-
/* @__PURE__ */ oe(
|
|
2518
|
+
/* @__PURE__ */ oe(d, { floatDomInfos: a, scene: t.scene, skeleton: t.skeleton, worksheet: t.worksheet }),
|
|
2512
2519
|
t.root
|
|
2513
2520
|
), i == null || i.add(() => {
|
|
2514
2521
|
Ri(t.root);
|
|
@@ -2521,13 +2528,13 @@ let Ot = class extends ne {
|
|
|
2521
2528
|
}
|
|
2522
2529
|
};
|
|
2523
2530
|
Ot = Os([
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
+
De(0, A(xr)),
|
|
2532
|
+
De(1, A(lr)),
|
|
2533
|
+
De(2, ie),
|
|
2534
|
+
De(3, J),
|
|
2535
|
+
De(4, A(et)),
|
|
2536
|
+
De(5, A(dr)),
|
|
2537
|
+
De(6, A(Xe))
|
|
2531
2538
|
], Ot);
|
|
2532
2539
|
var Us = Object.getOwnPropertyDescriptor, Ps = (i, t, e, n) => {
|
|
2533
2540
|
for (var r = n > 1 ? void 0 : n ? Us(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
@@ -2563,8 +2570,8 @@ const As = [
|
|
|
2563
2570
|
vi.id
|
|
2564
2571
|
];
|
|
2565
2572
|
let rn = class extends ne {
|
|
2566
|
-
constructor(i, t, e, n, r, s, o, a,
|
|
2567
|
-
super(), this._context = i, this._renderManagerService = t, this._commandService = e, this._selectionRenderService = n, this._skeletonManagerService = r, this._sheetInterceptorService = s, this._sheetDrawingService = o, this._drawingManagerService = a, this._univerInstanceService =
|
|
2573
|
+
constructor(i, t, e, n, r, s, o, a, d) {
|
|
2574
|
+
super(), this._context = i, this._renderManagerService = t, this._commandService = e, this._selectionRenderService = n, this._skeletonManagerService = r, this._sheetInterceptorService = s, this._sheetDrawingService = o, this._drawingManagerService = a, this._univerInstanceService = d, this._sheetInterceptorListener(), this._commandListener(), this._sheetRefreshListener();
|
|
2568
2575
|
}
|
|
2569
2576
|
_sheetInterceptorListener() {
|
|
2570
2577
|
this.disposeWithMe(
|
|
@@ -2632,19 +2639,19 @@ let rn = class extends ne {
|
|
|
2632
2639
|
const e = se(this._univerInstanceService);
|
|
2633
2640
|
if (e == null)
|
|
2634
2641
|
return { redos: [], undos: [] };
|
|
2635
|
-
const n = e.unitId, r = e.subUnitId, s = [], o = [], a = this._sheetDrawingService.getDrawingData(n, r),
|
|
2642
|
+
const n = e.unitId, r = e.subUnitId, s = [], o = [], a = this._sheetDrawingService.getDrawingData(n, r), d = [], u = [];
|
|
2636
2643
|
if (Object.keys(a).forEach((c) => {
|
|
2637
|
-
const
|
|
2638
|
-
|
|
2639
|
-
}),
|
|
2644
|
+
const l = a[c], { updateDrawings: g, deleteDrawings: h } = this._getUpdateOrDeleteDrawings(i, t, l);
|
|
2645
|
+
d.push(...g), u.push(...h);
|
|
2646
|
+
}), d.length === 0 && u.length === 0)
|
|
2640
2647
|
return { redos: [], undos: [] };
|
|
2641
|
-
if (
|
|
2642
|
-
const c = this._sheetDrawingService.getBatchUpdateOp(
|
|
2643
|
-
s.push({ id: P.id, params: { unitId: n, subUnitId: r, op: g, objects: h, type: U.UPDATE } }), o.push({ id: P.id, params: { unitId: n, subUnitId: r, op:
|
|
2648
|
+
if (d.length > 0) {
|
|
2649
|
+
const c = this._sheetDrawingService.getBatchUpdateOp(d), { undo: l, redo: g, objects: h } = c;
|
|
2650
|
+
s.push({ id: P.id, params: { unitId: n, subUnitId: r, op: g, objects: h, type: U.UPDATE } }), o.push({ id: P.id, params: { unitId: n, subUnitId: r, op: l, objects: h, type: U.UPDATE } });
|
|
2644
2651
|
}
|
|
2645
2652
|
if (u.length > 0) {
|
|
2646
|
-
const c = this._sheetDrawingService.getBatchRemoveOp(u),
|
|
2647
|
-
s.push({ id: P.id, params: { unitId: n, subUnitId: r, op: g, objects: h, type: U.REMOVE } }), o.push({ id: P.id, params: { unitId: n, subUnitId: r, op:
|
|
2653
|
+
const c = this._sheetDrawingService.getBatchRemoveOp(u), l = c.undo, g = c.redo, h = c.objects;
|
|
2654
|
+
s.push({ id: P.id, params: { unitId: n, subUnitId: r, op: g, objects: h, type: U.REMOVE } }), o.push({ id: P.id, params: { unitId: n, subUnitId: r, op: l, objects: h, type: U.INSERT } });
|
|
2648
2655
|
}
|
|
2649
2656
|
return s.push({ id: Y.id, params: [n] }), o.push({ id: Y.id, params: [n] }), {
|
|
2650
2657
|
redos: s,
|
|
@@ -2652,7 +2659,7 @@ let rn = class extends ne {
|
|
|
2652
2659
|
};
|
|
2653
2660
|
}
|
|
2654
2661
|
_getUpdateOrDeleteDrawings(i, t, e) {
|
|
2655
|
-
const n = [], r = [], { sheetTransform: s, anchorType: o = O.Position, transform: a, unitId:
|
|
2662
|
+
const n = [], r = [], { sheetTransform: s, anchorType: o = O.Position, transform: a, unitId: d, subUnitId: u, drawingId: c } = e, { from: l, to: g } = s, { row: h, column: f } = l, { row: p, column: m } = g;
|
|
2656
2663
|
if (s == null || a == null)
|
|
2657
2664
|
return {
|
|
2658
2665
|
updateDrawings: n,
|
|
@@ -2662,14 +2669,14 @@ let rn = class extends ne {
|
|
|
2662
2669
|
let S = null, C = null;
|
|
2663
2670
|
if (t === 0 && h >= _ && p <= v)
|
|
2664
2671
|
if (f >= I && m <= R)
|
|
2665
|
-
r.push({ unitId:
|
|
2672
|
+
r.push({ unitId: d, subUnitId: u, drawingId: c });
|
|
2666
2673
|
else {
|
|
2667
2674
|
const w = this._shrinkCol(s, a, I, R, o);
|
|
2668
2675
|
S = w == null ? void 0 : w.newSheetTransform, C = w == null ? void 0 : w.newTransform;
|
|
2669
2676
|
}
|
|
2670
2677
|
else if (t === 1 && f >= I && m <= R)
|
|
2671
2678
|
if (h >= _ && p <= v)
|
|
2672
|
-
r.push({ unitId:
|
|
2679
|
+
r.push({ unitId: d, subUnitId: u, drawingId: c });
|
|
2673
2680
|
else {
|
|
2674
2681
|
const w = this._shrinkRow(s, a, _, v, o);
|
|
2675
2682
|
S = w == null ? void 0 : w.newSheetTransform, C = w == null ? void 0 : w.newTransform;
|
|
@@ -2698,35 +2705,35 @@ let rn = class extends ne {
|
|
|
2698
2705
|
_getDrawingUndoForColVisible(i, t, e) {
|
|
2699
2706
|
const n = this._drawingManagerService.getDrawingData(i, t), r = [], s = [];
|
|
2700
2707
|
if (Object.keys(n).forEach((c) => {
|
|
2701
|
-
const
|
|
2708
|
+
const l = n[c], { sheetTransform: g, transform: h, anchorType: f = O.Position } = l;
|
|
2702
2709
|
if (f === O.None)
|
|
2703
|
-
this._remainDrawingSize(h, r,
|
|
2710
|
+
this._remainDrawingSize(h, r, l);
|
|
2704
2711
|
else {
|
|
2705
2712
|
const { from: p, to: m } = g, { row: _, column: v } = p, { row: I, column: R } = m;
|
|
2706
2713
|
for (let S = 0; S < e.length; S++) {
|
|
2707
|
-
const C = e[S], { startRow: w, endRow: y, startColumn: D, endColumn:
|
|
2714
|
+
const C = e[S], { startRow: w, endRow: y, startColumn: D, endColumn: T } = C;
|
|
2708
2715
|
if (R < D)
|
|
2709
2716
|
continue;
|
|
2710
2717
|
if (f === O.Position) {
|
|
2711
2718
|
let b = null, N = null;
|
|
2712
|
-
if (v >= D && v <=
|
|
2713
|
-
const x = this._skeletonManagerService.attachRangeWithCoord({ startColumn: v, endColumn:
|
|
2719
|
+
if (v >= D && v <= T) {
|
|
2720
|
+
const x = this._skeletonManagerService.attachRangeWithCoord({ startColumn: v, endColumn: T, startRow: p.row, endRow: m.row });
|
|
2714
2721
|
if (x == null)
|
|
2715
2722
|
return;
|
|
2716
2723
|
N = { ...h, left: x.startX };
|
|
2717
2724
|
}
|
|
2718
2725
|
if (N != null && (b = $(N, this._selectionRenderService), b != null && N != null)) {
|
|
2719
|
-
r.push({ ...
|
|
2726
|
+
r.push({ ...l, sheetTransform: b, transform: N });
|
|
2720
2727
|
break;
|
|
2721
2728
|
}
|
|
2722
|
-
this._remainDrawingSize(h, r,
|
|
2729
|
+
this._remainDrawingSize(h, r, l);
|
|
2723
2730
|
continue;
|
|
2724
2731
|
}
|
|
2725
|
-
if (v >= D && R <=
|
|
2732
|
+
if (v >= D && R <= T)
|
|
2726
2733
|
continue;
|
|
2727
|
-
let
|
|
2728
|
-
if (v >= D && v <=
|
|
2729
|
-
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: v, endColumn:
|
|
2734
|
+
let E = null, M = null;
|
|
2735
|
+
if (v >= D && v <= T) {
|
|
2736
|
+
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: v, endColumn: T, startRow: p.row, endRow: m.row });
|
|
2730
2737
|
if (b == null)
|
|
2731
2738
|
return;
|
|
2732
2739
|
M = {
|
|
@@ -2734,7 +2741,7 @@ let rn = class extends ne {
|
|
|
2734
2741
|
left: (b == null ? void 0 : b.startX) || 0,
|
|
2735
2742
|
width: ((h == null ? void 0 : h.width) || 0) - b.endX + b.startX
|
|
2736
2743
|
};
|
|
2737
|
-
} else if (R >= D && R <=
|
|
2744
|
+
} else if (R >= D && R <= T) {
|
|
2738
2745
|
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: D, endColumn: R, startRow: p.row, endRow: m.row });
|
|
2739
2746
|
if (b == null)
|
|
2740
2747
|
return;
|
|
@@ -2743,35 +2750,35 @@ let rn = class extends ne {
|
|
|
2743
2750
|
left: b.startX - ((h == null ? void 0 : h.width) || 0)
|
|
2744
2751
|
};
|
|
2745
2752
|
} else {
|
|
2746
|
-
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: D, endColumn:
|
|
2753
|
+
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: D, endColumn: T, startRow: p.row, endRow: m.row });
|
|
2747
2754
|
if (b == null)
|
|
2748
2755
|
return;
|
|
2749
2756
|
if (M = {
|
|
2750
2757
|
...h,
|
|
2751
2758
|
width: ((h == null ? void 0 : h.width) || 0) - b.endX + b.startX
|
|
2752
|
-
},
|
|
2753
|
-
s.push({ ...
|
|
2759
|
+
}, E = $(M, this._selectionRenderService), E != null && M != null) {
|
|
2760
|
+
s.push({ ...l, sheetTransform: E, transform: M });
|
|
2754
2761
|
break;
|
|
2755
2762
|
}
|
|
2756
2763
|
}
|
|
2757
|
-
if (M != null && (
|
|
2758
|
-
r.push({ ...
|
|
2764
|
+
if (M != null && (E = $(M, this._selectionRenderService)), M != null && E != null) {
|
|
2765
|
+
r.push({ ...l, sheetTransform: E, transform: M });
|
|
2759
2766
|
break;
|
|
2760
2767
|
} else
|
|
2761
|
-
this._remainDrawingSize(h, r,
|
|
2768
|
+
this._remainDrawingSize(h, r, l);
|
|
2762
2769
|
}
|
|
2763
2770
|
}
|
|
2764
2771
|
}), r.length === 0 && s.length === 0)
|
|
2765
2772
|
return { redos: [], undos: [] };
|
|
2766
|
-
const { redos: o, undos: a } = this._createUndoAndRedoMutation(i, t, r),
|
|
2773
|
+
const { redos: o, undos: a } = this._createUndoAndRedoMutation(i, t, r), d = [], u = [];
|
|
2767
2774
|
if (s.length > 0) {
|
|
2768
|
-
const { redos: c, undos:
|
|
2769
|
-
|
|
2775
|
+
const { redos: c, undos: l } = this._createUndoAndRedoMutation(i, t, s);
|
|
2776
|
+
d.push(...c), u.push(...l);
|
|
2770
2777
|
}
|
|
2771
2778
|
return {
|
|
2772
2779
|
redos: o,
|
|
2773
2780
|
undos: a,
|
|
2774
|
-
preRedos:
|
|
2781
|
+
preRedos: d,
|
|
2775
2782
|
preUndos: u
|
|
2776
2783
|
};
|
|
2777
2784
|
}
|
|
@@ -2779,26 +2786,26 @@ let rn = class extends ne {
|
|
|
2779
2786
|
const n = this._sheetDrawingService.getBatchUpdateOp(e), { undo: r, redo: s, objects: o } = n, a = [
|
|
2780
2787
|
{ id: P.id, params: { unitId: i, subUnitId: t, op: s, objects: o, type: U.UPDATE } },
|
|
2781
2788
|
{ id: Y.id, params: [i] }
|
|
2782
|
-
],
|
|
2789
|
+
], d = [
|
|
2783
2790
|
{ id: P.id, params: { unitId: i, subUnitId: t, op: r, objects: o, type: U.UPDATE } },
|
|
2784
2791
|
{ id: Y.id, params: [i] }
|
|
2785
2792
|
];
|
|
2786
2793
|
return {
|
|
2787
2794
|
redos: a,
|
|
2788
|
-
undos:
|
|
2795
|
+
undos: d
|
|
2789
2796
|
};
|
|
2790
2797
|
}
|
|
2791
2798
|
// eslint-disable-next-line max-lines-per-function
|
|
2792
2799
|
_getDrawingUndoForRowVisible(i, t, e) {
|
|
2793
2800
|
const n = this._drawingManagerService.getDrawingData(i, t), r = [], s = [];
|
|
2794
2801
|
if (Object.keys(n).forEach((c) => {
|
|
2795
|
-
const
|
|
2802
|
+
const l = n[c], { sheetTransform: g, transform: h, anchorType: f = O.Position } = l;
|
|
2796
2803
|
if (f === O.None)
|
|
2797
|
-
this._remainDrawingSize(h, r,
|
|
2804
|
+
this._remainDrawingSize(h, r, l);
|
|
2798
2805
|
else {
|
|
2799
2806
|
const { from: p, to: m } = g, { row: _, column: v } = p, { row: I, column: R } = m;
|
|
2800
2807
|
for (let S = 0; S < e.length; S++) {
|
|
2801
|
-
const C = e[S], { startRow: w, endRow: y, startColumn: D, endColumn:
|
|
2808
|
+
const C = e[S], { startRow: w, endRow: y, startColumn: D, endColumn: T } = C;
|
|
2802
2809
|
if (I < w)
|
|
2803
2810
|
continue;
|
|
2804
2811
|
if (f === O.Position) {
|
|
@@ -2810,15 +2817,15 @@ let rn = class extends ne {
|
|
|
2810
2817
|
N = { ...h, top: x.startY };
|
|
2811
2818
|
}
|
|
2812
2819
|
if (N != null && (b = $(N, this._selectionRenderService), b != null && N != null)) {
|
|
2813
|
-
r.push({ ...
|
|
2820
|
+
r.push({ ...l, sheetTransform: b, transform: N });
|
|
2814
2821
|
break;
|
|
2815
2822
|
}
|
|
2816
|
-
this._remainDrawingSize(h, r,
|
|
2823
|
+
this._remainDrawingSize(h, r, l);
|
|
2817
2824
|
continue;
|
|
2818
2825
|
}
|
|
2819
2826
|
if (_ >= w && I <= y)
|
|
2820
2827
|
continue;
|
|
2821
|
-
let
|
|
2828
|
+
let E = null, M = null;
|
|
2822
2829
|
if (_ >= w && _ <= y) {
|
|
2823
2830
|
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: m.column, startRow: _, endRow: y });
|
|
2824
2831
|
if (b == null)
|
|
@@ -2843,40 +2850,40 @@ let rn = class extends ne {
|
|
|
2843
2850
|
if (M = {
|
|
2844
2851
|
...h,
|
|
2845
2852
|
height: ((h == null ? void 0 : h.height) || 0) - b.endY + b.startY
|
|
2846
|
-
},
|
|
2847
|
-
s.push({ ...
|
|
2853
|
+
}, E = $(M, this._selectionRenderService), E != null && M != null) {
|
|
2854
|
+
s.push({ ...l, sheetTransform: E, transform: M });
|
|
2848
2855
|
break;
|
|
2849
2856
|
}
|
|
2850
2857
|
}
|
|
2851
|
-
if (M != null && (
|
|
2852
|
-
r.push({ ...
|
|
2858
|
+
if (M != null && (E = $(M, this._selectionRenderService)), M != null && E != null) {
|
|
2859
|
+
r.push({ ...l, sheetTransform: E, transform: M });
|
|
2853
2860
|
break;
|
|
2854
2861
|
} else
|
|
2855
|
-
this._remainDrawingSize(h, r,
|
|
2862
|
+
this._remainDrawingSize(h, r, l);
|
|
2856
2863
|
}
|
|
2857
2864
|
}
|
|
2858
2865
|
}), r.length === 0 && s.length === 0)
|
|
2859
2866
|
return { redos: [], undos: [] };
|
|
2860
|
-
const { redos: o, undos: a } = this._createUndoAndRedoMutation(i, t, r),
|
|
2867
|
+
const { redos: o, undos: a } = this._createUndoAndRedoMutation(i, t, r), d = [], u = [];
|
|
2861
2868
|
if (s.length > 0) {
|
|
2862
|
-
const { redos: c, undos:
|
|
2863
|
-
|
|
2869
|
+
const { redos: c, undos: l } = this._createUndoAndRedoMutation(i, t, s);
|
|
2870
|
+
d.push(...c), u.push(...l);
|
|
2864
2871
|
}
|
|
2865
2872
|
return {
|
|
2866
2873
|
redos: o,
|
|
2867
2874
|
undos: a,
|
|
2868
|
-
preRedos:
|
|
2875
|
+
preRedos: d,
|
|
2869
2876
|
preUndos: u
|
|
2870
2877
|
};
|
|
2871
2878
|
}
|
|
2872
2879
|
_getDrawingUndoForRowAndColSize(i, t, e, n) {
|
|
2873
2880
|
const r = this._drawingManagerService.getDrawingData(i, t), s = [];
|
|
2874
2881
|
return Object.keys(r).forEach((o) => {
|
|
2875
|
-
const a = r[o], { sheetTransform:
|
|
2882
|
+
const a = r[o], { sheetTransform: d, transform: u, anchorType: c = O.Position } = a;
|
|
2876
2883
|
if (c === O.None)
|
|
2877
2884
|
this._remainDrawingSize(u, s, a);
|
|
2878
2885
|
else {
|
|
2879
|
-
const { from:
|
|
2886
|
+
const { from: l, to: g } = d, { row: h, column: f } = l, { row: p, column: m } = g;
|
|
2880
2887
|
for (let _ = 0; _ < e.length; _++) {
|
|
2881
2888
|
const v = e[_], { startRow: I, endRow: R, startColumn: S, endColumn: C } = v;
|
|
2882
2889
|
if (p < I || m < S)
|
|
@@ -2885,7 +2892,7 @@ let rn = class extends ne {
|
|
|
2885
2892
|
this._remainDrawingSize(u, s, a);
|
|
2886
2893
|
continue;
|
|
2887
2894
|
}
|
|
2888
|
-
const w = z({ ...
|
|
2895
|
+
const w = z({ ...d }, this._selectionRenderService, this._skeletonManagerService);
|
|
2889
2896
|
if (w != null) {
|
|
2890
2897
|
s.push({
|
|
2891
2898
|
...a,
|
|
@@ -2920,7 +2927,7 @@ let rn = class extends ne {
|
|
|
2920
2927
|
const a = Yn(o, e);
|
|
2921
2928
|
if (!a)
|
|
2922
2929
|
return { redos: [], undos: [] };
|
|
2923
|
-
const { startX:
|
|
2930
|
+
const { startX: d, endX: u, startY: c, endY: l } = a, g = this._sheetDrawingService.getDrawingData(r, s), h = [];
|
|
2924
2931
|
Object.keys(g).forEach((S) => {
|
|
2925
2932
|
const C = g[S];
|
|
2926
2933
|
if (C.anchorType !== O.Both)
|
|
@@ -2928,13 +2935,13 @@ let rn = class extends ne {
|
|
|
2928
2935
|
const { transform: w } = C;
|
|
2929
2936
|
if (!w)
|
|
2930
2937
|
return;
|
|
2931
|
-
const { left: y = 0, top: D = 0, width:
|
|
2938
|
+
const { left: y = 0, top: D = 0, width: T = 0, height: E = 0 } = w, { drawingStartX: M, drawingEndX: b, drawingStartY: N, drawingEndY: x } = {
|
|
2932
2939
|
drawingStartX: y,
|
|
2933
|
-
drawingEndX: y +
|
|
2940
|
+
drawingEndX: y + T,
|
|
2934
2941
|
drawingStartY: D,
|
|
2935
|
-
drawingEndY: D +
|
|
2942
|
+
drawingEndY: D + E
|
|
2936
2943
|
};
|
|
2937
|
-
|
|
2944
|
+
d <= M && b <= u && c <= N && x <= l && h.push(C);
|
|
2938
2945
|
});
|
|
2939
2946
|
const f = [], p = [], m = t.startRow - e.startRow, _ = t.startColumn - e.startColumn, v = h.map((S) => {
|
|
2940
2947
|
const C = S.sheetTransform, w = {
|
|
@@ -2959,7 +2966,7 @@ let rn = class extends ne {
|
|
|
2959
2966
|
const e = this._getUnitIdAndSubUnitId(i, t);
|
|
2960
2967
|
if (e == null)
|
|
2961
2968
|
return { redos: [], undos: [] };
|
|
2962
|
-
const { unitId: n, subUnitId: r } = e, { range: s } = i, o = s.startRow, a = s.endRow,
|
|
2969
|
+
const { unitId: n, subUnitId: r } = e, { range: s } = i, o = s.startRow, a = s.endRow, d = [], u = [], c = this._sheetDrawingService.getDrawingData(n, r), l = [], g = [];
|
|
2963
2970
|
if (Object.keys(c).forEach((h) => {
|
|
2964
2971
|
const f = c[h], { sheetTransform: p, transform: m, anchorType: _ = O.Position } = f;
|
|
2965
2972
|
if (p == null || m == null)
|
|
@@ -2980,19 +2987,19 @@ let rn = class extends ne {
|
|
|
2980
2987
|
if (!v || !I)
|
|
2981
2988
|
return;
|
|
2982
2989
|
const R = { unitId: n, subUnitId: r, drawingId: h, transform: I, sheetTransform: v };
|
|
2983
|
-
|
|
2984
|
-
}),
|
|
2990
|
+
l.push(R);
|
|
2991
|
+
}), l.length === 0 && g.length === 0)
|
|
2985
2992
|
return { redos: [], undos: [] };
|
|
2986
|
-
if (
|
|
2987
|
-
const h = this._sheetDrawingService.getBatchUpdateOp(
|
|
2988
|
-
|
|
2993
|
+
if (l.length > 0) {
|
|
2994
|
+
const h = this._sheetDrawingService.getBatchUpdateOp(l), { undo: f, redo: p, objects: m } = h;
|
|
2995
|
+
d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: p, objects: m, type: U.UPDATE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: m, type: U.UPDATE } });
|
|
2989
2996
|
}
|
|
2990
2997
|
if (g.length > 0) {
|
|
2991
2998
|
const h = this._sheetDrawingService.getBatchRemoveOp(g), f = h.undo, p = h.redo, m = h.objects;
|
|
2992
|
-
|
|
2999
|
+
d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: p, objects: m, type: U.REMOVE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: m, type: U.INSERT } });
|
|
2993
3000
|
}
|
|
2994
|
-
return
|
|
2995
|
-
redos:
|
|
3001
|
+
return d.push({ id: Y.id, params: [n] }), u.push({ id: Y.id, params: [n] }), {
|
|
3002
|
+
redos: d,
|
|
2996
3003
|
undos: u
|
|
2997
3004
|
};
|
|
2998
3005
|
}
|
|
@@ -3000,7 +3007,7 @@ let rn = class extends ne {
|
|
|
3000
3007
|
const e = this._getUnitIdAndSubUnitId(i, t);
|
|
3001
3008
|
if (e == null)
|
|
3002
3009
|
return { redos: [], undos: [] };
|
|
3003
|
-
const { unitId: n, subUnitId: r } = e, { range: s } = i, o = s.startColumn, a = s.endColumn,
|
|
3010
|
+
const { unitId: n, subUnitId: r } = e, { range: s } = i, o = s.startColumn, a = s.endColumn, d = [], u = [], c = this._sheetDrawingService.getDrawingData(n, r), l = [], g = [];
|
|
3004
3011
|
if (Object.keys(c).forEach((h) => {
|
|
3005
3012
|
const f = c[h], { sheetTransform: p, transform: m, anchorType: _ = O.Position } = f;
|
|
3006
3013
|
if (p == null || m == null)
|
|
@@ -3021,85 +3028,85 @@ let rn = class extends ne {
|
|
|
3021
3028
|
if (!v || !I)
|
|
3022
3029
|
return;
|
|
3023
3030
|
const R = { unitId: n, subUnitId: r, drawingId: h, transform: I, sheetTransform: v };
|
|
3024
|
-
|
|
3025
|
-
}),
|
|
3031
|
+
l.push(R);
|
|
3032
|
+
}), l.length === 0 && g.length === 0)
|
|
3026
3033
|
return { redos: [], undos: [] };
|
|
3027
|
-
if (
|
|
3028
|
-
const h = this._sheetDrawingService.getBatchUpdateOp(
|
|
3029
|
-
|
|
3034
|
+
if (l.length > 0) {
|
|
3035
|
+
const h = this._sheetDrawingService.getBatchUpdateOp(l), { undo: f, redo: p, objects: m } = h;
|
|
3036
|
+
d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: p, objects: m, type: U.UPDATE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: m, type: U.UPDATE } });
|
|
3030
3037
|
}
|
|
3031
3038
|
if (g.length > 0) {
|
|
3032
3039
|
const h = this._sheetDrawingService.getBatchRemoveOp(g), f = h.undo, p = h.redo, m = h.objects;
|
|
3033
|
-
|
|
3040
|
+
d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: p, objects: m, type: U.REMOVE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: m, type: U.INSERT } });
|
|
3034
3041
|
}
|
|
3035
|
-
return
|
|
3042
|
+
return d.push({ id: Y.id, params: [n] }), u.push({ id: Y.id, params: [n] }), { redos: d, undos: u };
|
|
3036
3043
|
}
|
|
3037
3044
|
_expandCol(i, t, e, n, r = O.Position) {
|
|
3038
|
-
const s = n - e + 1, { from: o, to: a } = i, { column:
|
|
3045
|
+
const s = n - e + 1, { from: o, to: a } = i, { column: d } = o, { column: u } = a;
|
|
3039
3046
|
if (r === O.None)
|
|
3040
3047
|
return {
|
|
3041
3048
|
newSheetTransform: $({ ...t }, this._selectionRenderService),
|
|
3042
3049
|
newTransform: t
|
|
3043
3050
|
};
|
|
3044
|
-
let c = null,
|
|
3045
|
-
if (
|
|
3051
|
+
let c = null, l = null;
|
|
3052
|
+
if (d >= e) {
|
|
3046
3053
|
const g = this._skeletonManagerService.attachRangeWithCoord({ startColumn: e, endColumn: n, startRow: o.row, endRow: a.row });
|
|
3047
3054
|
if (g == null)
|
|
3048
3055
|
return;
|
|
3049
|
-
|
|
3056
|
+
l = { ...t, left: (t.left || 0) + g.endX - g.startX }, c = $(l, this._selectionRenderService);
|
|
3050
3057
|
} else if (u >= n)
|
|
3051
3058
|
if (r === O.Both)
|
|
3052
3059
|
c = {
|
|
3053
3060
|
from: { ...o },
|
|
3054
3061
|
to: { ...a, column: u + s }
|
|
3055
|
-
},
|
|
3062
|
+
}, l = z(c, this._selectionRenderService, this._skeletonManagerService);
|
|
3056
3063
|
else
|
|
3057
3064
|
return {
|
|
3058
3065
|
newSheetTransform: $({ ...t }, this._selectionRenderService),
|
|
3059
3066
|
newTransform: t
|
|
3060
3067
|
};
|
|
3061
|
-
return c != null &&
|
|
3068
|
+
return c != null && l != null ? {
|
|
3062
3069
|
newSheetTransform: c,
|
|
3063
|
-
newTransform:
|
|
3070
|
+
newTransform: l
|
|
3064
3071
|
} : null;
|
|
3065
3072
|
}
|
|
3066
3073
|
_shrinkCol(i, t, e, n, r = O.Position) {
|
|
3067
|
-
const s = n - e + 1, { from: o, to: a } = i, { column:
|
|
3074
|
+
const s = n - e + 1, { from: o, to: a } = i, { column: d } = o, { column: u } = a;
|
|
3068
3075
|
if (r === O.None)
|
|
3069
3076
|
return {
|
|
3070
3077
|
newSheetTransform: $({ ...t }, this._selectionRenderService),
|
|
3071
3078
|
newTransform: t
|
|
3072
3079
|
};
|
|
3073
|
-
let c = null,
|
|
3074
|
-
if (
|
|
3080
|
+
let c = null, l = null;
|
|
3081
|
+
if (d > n)
|
|
3075
3082
|
c = {
|
|
3076
|
-
from: { ...o, column:
|
|
3083
|
+
from: { ...o, column: d - s },
|
|
3077
3084
|
to: { ...a, column: u - s }
|
|
3078
|
-
},
|
|
3085
|
+
}, l = z(c, this._selectionRenderService, this._skeletonManagerService);
|
|
3079
3086
|
else {
|
|
3080
|
-
if (
|
|
3087
|
+
if (d >= e && u <= n)
|
|
3081
3088
|
return null;
|
|
3082
|
-
if (
|
|
3089
|
+
if (d < e && u > n)
|
|
3083
3090
|
if (r === O.Both)
|
|
3084
3091
|
c = {
|
|
3085
3092
|
from: { ...o },
|
|
3086
3093
|
to: { ...a, column: u - s }
|
|
3087
|
-
},
|
|
3094
|
+
}, l = z(c, this._selectionRenderService, this._skeletonManagerService);
|
|
3088
3095
|
else
|
|
3089
3096
|
return {
|
|
3090
3097
|
newSheetTransform: $({ ...t }, this._selectionRenderService),
|
|
3091
3098
|
newTransform: t
|
|
3092
3099
|
};
|
|
3093
|
-
else if (
|
|
3094
|
-
if (
|
|
3095
|
-
|
|
3100
|
+
else if (d >= e && d <= n) {
|
|
3101
|
+
if (d === e)
|
|
3102
|
+
l = { ...t, left: (t.left || 0) - i.from.columnOffset };
|
|
3096
3103
|
else {
|
|
3097
|
-
const g = this._skeletonManagerService.attachRangeWithCoord({ startColumn: e, endColumn:
|
|
3104
|
+
const g = this._skeletonManagerService.attachRangeWithCoord({ startColumn: e, endColumn: d - 1, startRow: o.row, endRow: a.row });
|
|
3098
3105
|
if (g == null)
|
|
3099
3106
|
return;
|
|
3100
|
-
|
|
3107
|
+
l = { ...t, left: (t.left || 0) - g.endX + g.startX - i.from.columnOffset };
|
|
3101
3108
|
}
|
|
3102
|
-
c = $(
|
|
3109
|
+
c = $(l, this._selectionRenderService);
|
|
3103
3110
|
} else if (u >= e && u <= n && r === O.Both) {
|
|
3104
3111
|
const g = this._skeletonManagerService.attachRangeWithCoord({
|
|
3105
3112
|
startColumn: e - 1,
|
|
@@ -3112,27 +3119,27 @@ let rn = class extends ne {
|
|
|
3112
3119
|
c = {
|
|
3113
3120
|
from: { ...o },
|
|
3114
3121
|
to: { ...a, column: e - 1, columnOffset: g.endX - g.startX }
|
|
3115
|
-
},
|
|
3122
|
+
}, l = z(c, this._selectionRenderService, this._skeletonManagerService);
|
|
3116
3123
|
}
|
|
3117
3124
|
}
|
|
3118
|
-
return c != null &&
|
|
3125
|
+
return c != null && l != null ? {
|
|
3119
3126
|
newSheetTransform: c,
|
|
3120
|
-
newTransform:
|
|
3127
|
+
newTransform: l
|
|
3121
3128
|
} : null;
|
|
3122
3129
|
}
|
|
3123
3130
|
_expandRow(i, t, e, n, r = O.Position) {
|
|
3124
|
-
const s = n - e + 1, { from: o, to: a } = i, { row:
|
|
3131
|
+
const s = n - e + 1, { from: o, to: a } = i, { row: d } = o, { row: u } = a;
|
|
3125
3132
|
if (r === O.None)
|
|
3126
3133
|
return {
|
|
3127
3134
|
newSheetTransform: $({ ...t }, this._selectionRenderService),
|
|
3128
3135
|
newTransform: t
|
|
3129
3136
|
};
|
|
3130
|
-
let c = null,
|
|
3131
|
-
if (
|
|
3137
|
+
let c = null, l = null;
|
|
3138
|
+
if (d >= e) {
|
|
3132
3139
|
const g = this._skeletonManagerService.attachRangeWithCoord({ startRow: e, endRow: n, startColumn: o.column, endColumn: a.column });
|
|
3133
3140
|
if (g == null)
|
|
3134
3141
|
return;
|
|
3135
|
-
|
|
3142
|
+
l = { ...t, top: (t.top || 0) + g.endY - g.startY }, c = $(l, this._selectionRenderService);
|
|
3136
3143
|
} else if (u >= n)
|
|
3137
3144
|
if (r === O.Both)
|
|
3138
3145
|
c = {
|
|
@@ -3141,54 +3148,54 @@ let rn = class extends ne {
|
|
|
3141
3148
|
...a,
|
|
3142
3149
|
row: u + s
|
|
3143
3150
|
}
|
|
3144
|
-
},
|
|
3151
|
+
}, l = z(c, this._selectionRenderService, this._skeletonManagerService);
|
|
3145
3152
|
else
|
|
3146
3153
|
return {
|
|
3147
3154
|
newSheetTransform: $({ ...t }, this._selectionRenderService),
|
|
3148
3155
|
newTransform: t
|
|
3149
3156
|
};
|
|
3150
|
-
return c != null &&
|
|
3157
|
+
return c != null && l != null ? {
|
|
3151
3158
|
newSheetTransform: c,
|
|
3152
|
-
newTransform:
|
|
3159
|
+
newTransform: l
|
|
3153
3160
|
} : null;
|
|
3154
3161
|
}
|
|
3155
3162
|
_shrinkRow(i, t, e, n, r = O.Position) {
|
|
3156
|
-
const s = n - e + 1, { from: o, to: a } = i, { row:
|
|
3163
|
+
const s = n - e + 1, { from: o, to: a } = i, { row: d } = o, { row: u } = a;
|
|
3157
3164
|
if (r === O.None)
|
|
3158
3165
|
return {
|
|
3159
3166
|
newSheetTransform: $({ ...t }, this._selectionRenderService),
|
|
3160
3167
|
newTransform: t
|
|
3161
3168
|
};
|
|
3162
|
-
let c = null,
|
|
3163
|
-
if (
|
|
3169
|
+
let c = null, l = null;
|
|
3170
|
+
if (d > n)
|
|
3164
3171
|
c = {
|
|
3165
|
-
from: { ...o, row:
|
|
3172
|
+
from: { ...o, row: d - s },
|
|
3166
3173
|
to: { ...a, row: u - s }
|
|
3167
|
-
},
|
|
3174
|
+
}, l = z(c, this._selectionRenderService, this._skeletonManagerService);
|
|
3168
3175
|
else {
|
|
3169
|
-
if (
|
|
3176
|
+
if (d >= e && u <= n)
|
|
3170
3177
|
return null;
|
|
3171
|
-
if (
|
|
3178
|
+
if (d < e && u > n)
|
|
3172
3179
|
if (r === O.Both)
|
|
3173
3180
|
c = {
|
|
3174
3181
|
from: { ...o },
|
|
3175
3182
|
to: { ...a, row: u - s }
|
|
3176
|
-
},
|
|
3183
|
+
}, l = z(c, this._selectionRenderService, this._skeletonManagerService);
|
|
3177
3184
|
else
|
|
3178
3185
|
return {
|
|
3179
3186
|
newSheetTransform: $({ ...t }, this._selectionRenderService),
|
|
3180
3187
|
newTransform: t
|
|
3181
3188
|
};
|
|
3182
|
-
else if (
|
|
3183
|
-
if (
|
|
3184
|
-
|
|
3189
|
+
else if (d >= e && d <= n) {
|
|
3190
|
+
if (d === e)
|
|
3191
|
+
l = { ...t, top: (t.top || 0) - i.from.rowOffset };
|
|
3185
3192
|
else {
|
|
3186
|
-
const g = this._skeletonManagerService.attachRangeWithCoord({ startRow: e, endRow:
|
|
3193
|
+
const g = this._skeletonManagerService.attachRangeWithCoord({ startRow: e, endRow: d - 1, startColumn: o.column, endColumn: a.column });
|
|
3187
3194
|
if (g == null)
|
|
3188
3195
|
return;
|
|
3189
|
-
|
|
3196
|
+
l = { ...t, top: (t.top || 0) - g.endY + g.startY - i.from.rowOffset };
|
|
3190
3197
|
}
|
|
3191
|
-
c = $(
|
|
3198
|
+
c = $(l, this._selectionRenderService);
|
|
3192
3199
|
} else if (u >= e && u <= n && r === O.Both) {
|
|
3193
3200
|
const g = this._skeletonManagerService.attachRangeWithCoord({ startColumn: o.column, endColumn: o.column, startRow: e - 1, endRow: e - 1 });
|
|
3194
3201
|
if (g == null)
|
|
@@ -3196,12 +3203,12 @@ let rn = class extends ne {
|
|
|
3196
3203
|
c = {
|
|
3197
3204
|
from: { ...o },
|
|
3198
3205
|
to: { ...a, row: e - 1, rowOffset: g.endY - g.startY }
|
|
3199
|
-
},
|
|
3206
|
+
}, l = z(c, this._selectionRenderService, this._skeletonManagerService);
|
|
3200
3207
|
}
|
|
3201
3208
|
}
|
|
3202
|
-
return c != null &&
|
|
3209
|
+
return c != null && l != null ? {
|
|
3203
3210
|
newSheetTransform: c,
|
|
3204
|
-
newTransform:
|
|
3211
|
+
newTransform: l
|
|
3205
3212
|
} : null;
|
|
3206
3213
|
}
|
|
3207
3214
|
_commandListener() {
|
|
@@ -3246,13 +3253,13 @@ let rn = class extends ne {
|
|
|
3246
3253
|
Object.keys(e).forEach((s) => {
|
|
3247
3254
|
const o = e[s];
|
|
3248
3255
|
o != null && Object.keys(o).forEach((a) => {
|
|
3249
|
-
const
|
|
3250
|
-
|
|
3256
|
+
const d = o[a].data;
|
|
3257
|
+
d != null && Object.keys(d).forEach((u) => {
|
|
3251
3258
|
if (s === i && a === t) {
|
|
3252
|
-
const c =
|
|
3253
|
-
c.transform = z(c.sheetTransform, this._selectionRenderService, this._skeletonManagerService), n.push(
|
|
3259
|
+
const c = d[u];
|
|
3260
|
+
c.transform = z(c.sheetTransform, this._selectionRenderService, this._skeletonManagerService), n.push(d[u]);
|
|
3254
3261
|
} else
|
|
3255
|
-
r.push(
|
|
3262
|
+
r.push(d[u]);
|
|
3256
3263
|
});
|
|
3257
3264
|
});
|
|
3258
3265
|
}), this._drawingManagerService.removeNotification(r), this._drawingManagerService.addNotification(n);
|
|
@@ -3271,10 +3278,10 @@ let rn = class extends ne {
|
|
|
3271
3278
|
_refreshDrawingTransform(i, t, e) {
|
|
3272
3279
|
const n = this._drawingManagerService.getDrawingData(i, t), r = [];
|
|
3273
3280
|
Object.keys(n).forEach((s) => {
|
|
3274
|
-
const o = n[s], { sheetTransform: a, transform:
|
|
3281
|
+
const o = n[s], { sheetTransform: a, transform: d, anchorType: u = O.Position } = o;
|
|
3275
3282
|
if (u === O.None)
|
|
3276
3283
|
return !0;
|
|
3277
|
-
const { from: c, to:
|
|
3284
|
+
const { from: c, to: l } = a, { row: g, column: h } = c, { row: f, column: p } = l;
|
|
3278
3285
|
for (let m = 0; m < e.length; m++) {
|
|
3279
3286
|
const _ = e[m], { startRow: v, endRow: I, startColumn: R, endColumn: S } = _;
|
|
3280
3287
|
if (ei.intersects(
|
|
@@ -3296,8 +3303,8 @@ let rn = class extends ne {
|
|
|
3296
3303
|
...o,
|
|
3297
3304
|
transform: {
|
|
3298
3305
|
...w,
|
|
3299
|
-
width: C ?
|
|
3300
|
-
height: C ?
|
|
3306
|
+
width: C ? d == null ? void 0 : d.width : w == null ? void 0 : w.width,
|
|
3307
|
+
height: C ? d == null ? void 0 : d.height : w == null ? void 0 : w.height
|
|
3301
3308
|
}
|
|
3302
3309
|
});
|
|
3303
3310
|
break;
|
|
@@ -3309,7 +3316,7 @@ let rn = class extends ne {
|
|
|
3309
3316
|
rn = Ps([
|
|
3310
3317
|
me(1, J),
|
|
3311
3318
|
me(2, G),
|
|
3312
|
-
me(3,
|
|
3319
|
+
me(3, xe),
|
|
3313
3320
|
me(4, A(V)),
|
|
3314
3321
|
me(5, A(At)),
|
|
3315
3322
|
me(6, re),
|
|
@@ -3321,21 +3328,21 @@ const ks = (i) => {
|
|
|
3321
3328
|
const t = qe(G), e = qe(tt), n = qe(ie), r = qe(J), { drawings: s } = i, o = s[0];
|
|
3322
3329
|
if (o == null)
|
|
3323
3330
|
return;
|
|
3324
|
-
const { unitId: a } = o,
|
|
3331
|
+
const { unitId: a } = o, d = r.getRenderById(a), u = d == null ? void 0 : d.scene;
|
|
3325
3332
|
if (u == null)
|
|
3326
3333
|
return;
|
|
3327
|
-
const c = u.getTransformerByCreate(), [
|
|
3334
|
+
const c = u.getTransformerByCreate(), [l, g] = Qt(!0), h = (v = o.anchorType) != null ? v : O.Position, [f, p] = Qt(h);
|
|
3328
3335
|
function m(I, R) {
|
|
3329
3336
|
const S = [];
|
|
3330
3337
|
return I.forEach((C) => {
|
|
3331
3338
|
const { oKey: w } = C, y = R.getDrawingOKey(w);
|
|
3332
3339
|
if (y == null)
|
|
3333
3340
|
return S.push(null), !0;
|
|
3334
|
-
const { unitId: D, subUnitId:
|
|
3341
|
+
const { unitId: D, subUnitId: T, drawingId: E, drawingType: M, anchorType: b, sheetTransform: N } = y;
|
|
3335
3342
|
S.push({
|
|
3336
3343
|
unitId: D,
|
|
3337
|
-
subUnitId:
|
|
3338
|
-
drawingId:
|
|
3344
|
+
subUnitId: T,
|
|
3345
|
+
drawingId: E,
|
|
3339
3346
|
anchorType: b,
|
|
3340
3347
|
sheetTransform: N,
|
|
3341
3348
|
drawingType: M
|
|
@@ -3380,7 +3387,7 @@ const ks = (i) => {
|
|
|
3380
3387
|
"div",
|
|
3381
3388
|
{
|
|
3382
3389
|
className: bi("univer-grid univer-gap-2 univer-py-2 univer-text-gray-400", {
|
|
3383
|
-
"univer-hidden": !
|
|
3390
|
+
"univer-hidden": !l
|
|
3384
3391
|
}),
|
|
3385
3392
|
children: [
|
|
3386
3393
|
/* @__PURE__ */ oe(
|
|
@@ -3455,13 +3462,13 @@ const Fs = {
|
|
|
3455
3462
|
}
|
|
3456
3463
|
};
|
|
3457
3464
|
function it(i) {
|
|
3458
|
-
return !i.getContextValue(ti) && !i.getContextValue(ni) && !i.getContextValue(ri) && i.getContextValue(
|
|
3465
|
+
return !i.getContextValue(ti) && !i.getContextValue(ni) && !i.getContextValue(ri) && i.getContextValue($e);
|
|
3459
3466
|
}
|
|
3460
3467
|
const xs = {
|
|
3461
3468
|
id: rt.id,
|
|
3462
3469
|
description: "shortcut.drawing-move-down",
|
|
3463
3470
|
group: "4_drawing-view",
|
|
3464
|
-
binding:
|
|
3471
|
+
binding: Fe.ARROW_DOWN,
|
|
3465
3472
|
priority: 100,
|
|
3466
3473
|
preconditions: it,
|
|
3467
3474
|
staticParameters: {
|
|
@@ -3471,7 +3478,7 @@ const xs = {
|
|
|
3471
3478
|
id: rt.id,
|
|
3472
3479
|
description: "shortcut.drawing-move-up",
|
|
3473
3480
|
group: "4_drawing-view",
|
|
3474
|
-
binding:
|
|
3481
|
+
binding: Fe.ARROW_UP,
|
|
3475
3482
|
priority: 100,
|
|
3476
3483
|
preconditions: it,
|
|
3477
3484
|
staticParameters: {
|
|
@@ -3481,7 +3488,7 @@ const xs = {
|
|
|
3481
3488
|
id: rt.id,
|
|
3482
3489
|
description: "shortcut.drawing-move-left",
|
|
3483
3490
|
group: "4_drawing-view",
|
|
3484
|
-
binding:
|
|
3491
|
+
binding: Fe.ARROW_LEFT,
|
|
3485
3492
|
priority: 100,
|
|
3486
3493
|
preconditions: it,
|
|
3487
3494
|
staticParameters: {
|
|
@@ -3491,7 +3498,7 @@ const xs = {
|
|
|
3491
3498
|
id: rt.id,
|
|
3492
3499
|
description: "shortcut.drawing-move-right",
|
|
3493
3500
|
group: "4_drawing-view",
|
|
3494
|
-
binding:
|
|
3501
|
+
binding: Fe.ARROW_RIGHT,
|
|
3495
3502
|
priority: 100,
|
|
3496
3503
|
preconditions: it,
|
|
3497
3504
|
staticParameters: {
|
|
@@ -3503,14 +3510,14 @@ const xs = {
|
|
|
3503
3510
|
group: "4_drawing-view",
|
|
3504
3511
|
// when focusing on any other input tag do not trigger this shortcut
|
|
3505
3512
|
preconditions: it,
|
|
3506
|
-
binding:
|
|
3507
|
-
mac:
|
|
3513
|
+
binding: Fe.DELETE,
|
|
3514
|
+
mac: Fe.BACKSPACE
|
|
3508
3515
|
};
|
|
3509
3516
|
var Vs = Object.getOwnPropertyDescriptor, Hs = (i, t, e, n) => {
|
|
3510
3517
|
for (var r = n > 1 ? void 0 : n ? Vs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
3511
3518
|
(o = i[s]) && (r = o(r) || r);
|
|
3512
3519
|
return r;
|
|
3513
|
-
},
|
|
3520
|
+
}, ke = (i, t) => (e, n) => t(e, n, i);
|
|
3514
3521
|
let Ut = class extends ne {
|
|
3515
3522
|
constructor(i, t, e, n, r, s) {
|
|
3516
3523
|
super(), this._componentManager = i, this._menuManagerService = t, this._commandService = e, this._shortcutService = n, this._drawingManagerService = r, this._sheetsSelectionsService = s, this._init();
|
|
@@ -3556,12 +3563,12 @@ let Ut = class extends ne {
|
|
|
3556
3563
|
}
|
|
3557
3564
|
};
|
|
3558
3565
|
Ut = Hs([
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3566
|
+
ke(0, A(dr)),
|
|
3567
|
+
ke(1, Fi),
|
|
3568
|
+
ke(2, G),
|
|
3569
|
+
ke(3, xi),
|
|
3570
|
+
ke(4, ie),
|
|
3571
|
+
ke(5, A(on))
|
|
3565
3572
|
], Ut);
|
|
3566
3573
|
var zs = Object.defineProperty, Ks = Object.getOwnPropertyDescriptor, Js = (i, t, e) => t in i ? zs(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, Zs = (i, t, e, n) => {
|
|
3567
3574
|
for (var r = n > 1 ? void 0 : n ? Ks(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
@@ -3585,8 +3592,8 @@ let Pt = class extends oi {
|
|
|
3585
3592
|
[Ut],
|
|
3586
3593
|
[Rt],
|
|
3587
3594
|
[Ot],
|
|
3588
|
-
[Tt],
|
|
3589
3595
|
[Et],
|
|
3596
|
+
[Tt],
|
|
3590
3597
|
[bt],
|
|
3591
3598
|
[Mt],
|
|
3592
3599
|
[yt]
|
|
@@ -3596,13 +3603,13 @@ let Pt = class extends oi {
|
|
|
3596
3603
|
}
|
|
3597
3604
|
onReady() {
|
|
3598
3605
|
xt(this._injector, [
|
|
3599
|
-
[
|
|
3606
|
+
[Tt],
|
|
3600
3607
|
[yt]
|
|
3601
3608
|
]);
|
|
3602
3609
|
}
|
|
3603
3610
|
onRendered() {
|
|
3604
3611
|
this._registerRenderModules(), xt(this._injector, [
|
|
3605
|
-
[
|
|
3612
|
+
[Et],
|
|
3606
3613
|
[Ot],
|
|
3607
3614
|
[Ut],
|
|
3608
3615
|
[bt],
|
|
@@ -3627,7 +3634,7 @@ Dr(Pt, "type", F.UNIVER_SHEET);
|
|
|
3627
3634
|
Dr(Pt, "pluginName", qs);
|
|
3628
3635
|
Pt = Zs([
|
|
3629
3636
|
ii(Ui, Xi, Ki, di),
|
|
3630
|
-
Lt(1, A(
|
|
3637
|
+
Lt(1, A(Xe)),
|
|
3631
3638
|
Lt(2, J),
|
|
3632
3639
|
Lt(3, si)
|
|
3633
3640
|
], Pt);
|