@univerjs/sheets-drawing-ui 0.12.3 → 0.12.4-experimental.20251210-8d33c6e
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/facade.js +1 -1
- package/lib/cjs/index.js +2 -2
- package/lib/cjs/locale/ca-ES.js +1 -1
- package/lib/cjs/locale/en-US.js +1 -1
- package/lib/cjs/locale/es-ES.js +1 -1
- package/lib/cjs/locale/fa-IR.js +1 -1
- package/lib/cjs/locale/fr-FR.js +1 -1
- package/lib/cjs/locale/ja-JP.js +1 -1
- package/lib/cjs/locale/ko-KR.js +1 -1
- package/lib/cjs/locale/ru-RU.js +1 -1
- package/lib/cjs/locale/vi-VN.js +1 -1
- package/lib/cjs/locale/zh-CN.js +1 -1
- package/lib/cjs/locale/zh-TW.js +1 -1
- package/lib/es/facade.js +439 -395
- package/lib/es/index.js +1758 -1284
- package/lib/es/locale/ca-ES.js +15 -2
- package/lib/es/locale/en-US.js +13 -0
- package/lib/es/locale/es-ES.js +13 -0
- package/lib/es/locale/fa-IR.js +13 -0
- package/lib/es/locale/fr-FR.js +13 -0
- package/lib/es/locale/ja-JP.js +13 -0
- package/lib/es/locale/ko-KR.js +13 -0
- package/lib/es/locale/ru-RU.js +13 -0
- package/lib/es/locale/vi-VN.js +13 -0
- package/lib/es/locale/zh-CN.js +13 -0
- package/lib/es/locale/zh-TW.js +17 -4
- package/lib/facade.js +439 -395
- package/lib/index.css +1 -1
- package/lib/index.js +1758 -1284
- package/lib/locale/ca-ES.js +15 -2
- package/lib/locale/en-US.js +13 -0
- package/lib/locale/es-ES.js +13 -0
- package/lib/locale/fa-IR.js +13 -0
- package/lib/locale/fr-FR.js +13 -0
- package/lib/locale/ja-JP.js +13 -0
- package/lib/locale/ko-KR.js +13 -0
- package/lib/locale/ru-RU.js +13 -0
- package/lib/locale/vi-VN.js +13 -0
- package/lib/locale/zh-CN.js +13 -0
- package/lib/locale/zh-TW.js +17 -4
- package/lib/types/commands/commands/save-cell-images.command.d.ts +2 -0
- package/lib/types/facade/f-range.d.ts +40 -0
- package/lib/types/facade/f-worksheet.d.ts +29 -0
- package/lib/types/index.d.ts +3 -1
- package/lib/types/locale/en-US.d.ts +13 -0
- package/lib/types/services/batch-save-images.service.d.ts +148 -0
- package/lib/types/services/canvas-float-dom-manager.service.d.ts +2 -0
- package/lib/types/views/batch-save-images/BatchSaveImagesDialog.d.ts +16 -0
- package/lib/types/views/batch-save-images/component-name.d.ts +16 -0
- package/lib/types/views/batch-save-images/index.d.ts +17 -0
- package/lib/types/views/menu/save-images.menu.d.ts +4 -0
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +2 -2
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +15 -15
- package/LICENSE +0 -176
package/lib/es/index.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { precisionTo as
|
|
5
|
-
import { convertPositionSheetOverGridToAbsolute as
|
|
6
|
-
import { CommandType as
|
|
7
|
-
import { ISheetDrawingService as
|
|
8
|
-
import { SheetInterceptorService as
|
|
9
|
-
import { MessageType as
|
|
10
|
-
import { docDrawingPositionToTransform as
|
|
11
|
-
import { IImageIoService as
|
|
12
|
-
import { ILocalFileService as
|
|
13
|
-
import { DocDrawingController as
|
|
14
|
-
import { ImageCropperObject as
|
|
15
|
-
import { takeUntil as
|
|
16
|
-
import { jsx as
|
|
17
|
-
import { useMemo as
|
|
18
|
-
function
|
|
1
|
+
var Kr = Object.defineProperty;
|
|
2
|
+
var Jr = (i, t, e) => t in i ? Kr(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
+
var re = (i, t, e) => Jr(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { precisionTo as bt, IRenderManagerService as Q, transformObjectOutOfGroup as Zr, getGroupState as qr, getCurrentTypeOfRenderer as Dn, CURSOR_TYPE as Qr, RENDER_CLASS_TYPE as ke, Rect as $e, ObjectType as An, DRAWING_OBJECT_LAYER_INDEX as qt, SHEET_VIEWPORT_KEY as cr } from "@univerjs/engine-render";
|
|
5
|
+
import { convertPositionSheetOverGridToAbsolute as ei, SheetSkeletonManagerService as X, ISheetSelectionRenderService as Je, attachRangeWithCoord as dr, SheetCanvasPopManagerService as ti, HoverManagerService as ni, IEditorBridgeService as ri, IAutoFillService as ii, EditingRenderController as si, SetCellEditVisibleOperation as Nn, PREDEFINED_HOOK_NAME as Le, COPY_TYPE as Re, discreteRangeToRange as kn, virtualizeDiscreteRanges as oi, ISheetClipboardService as ai, SetZoomRatioOperation as $n, SetScrollOperation as ci, SheetPrintInterceptorService as di, useHighlightRange as li, getCurrentRangeDisable$ as ui } from "@univerjs/sheets-ui";
|
|
6
|
+
import { CommandType as q, ICommandService as Y, IUndoRedoService as Ze, sequenceExecute as lr, DrawingTypeEnum as x, ArrangeTypeEnum as Mt, Inject as A, IContextService as ur, LocaleService as Te, Injector as qe, Disposable as ee, createDocumentModelWithStyle as un, ObjectRelativeFromV as xn, ObjectRelativeFromH as Wn, WrapTextType as Bn, PositionedObjectLayoutType as jn, BooleanNumber as Fn, BuildTextUtils as hn, ImageSourceType as Ce, generateRandomId as He, FOCUSING_COMMON_DRAWINGS as Ge, IUniverInstanceService as de, UniverInstanceType as k, Direction as ve, createIdentifier as hi, IImageIoService as hr, RxDisposable as gi, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as ot, DOCS_ZEN_EDITOR_UNIT_ID_KEY as Ve, InterceptorEffectEnum as mi, ObjectMatrix as fi, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as pi, IPermissionService as wi, UserManagerService as _i, LifecycleService as Si, LifecycleStages as vi, DisposableCollection as yt, fromEventSubject as Ii, Tools as Ye, PRINT_CHART_COMPONENT_KEY as Ci, Rectangle as Ri, FOCUSING_FX_BAR_EDITOR as Di, EDITOR_ACTIVATED as bi, FOCUSING_PANEL_EDITOR as Mi, DependentOn as yi, IConfigService as Ei, Plugin as Ti, merge as Oi, registerDependencies as Ui, touchDependencies as Qt } from "@univerjs/core";
|
|
7
|
+
import { ISheetDrawingService as se, DrawingApplyType as U, SetDrawingApplyMutation as P, SheetDrawingAnchorType as O, UniverSheetsDrawingPlugin as Pi } from "@univerjs/sheets-drawing";
|
|
8
|
+
import { SheetInterceptorService as Ht, SheetsSelectionsService as ut, SetRangeValuesCommand as Ln, getSheetCommandTarget as ae, INTERCEPTOR_POINT as Ai, InterceptCellContentPriority as Ni, WorkbookViewPermission as Hn, WorksheetViewPermission as Vn, WorkbookEditablePermission as gn, WorksheetEditPermission as mn, SetFrozenMutation as ki, SetSelectionsOperation as $i, SetWorksheetRowAutoHeightMutation as xi, COMMAND_LISTENER_SKELETON_CHANGE as Wi, InsertRowCommand as gr, InsertColCommand as mr, RemoveRowCommand as fr, RemoveColCommand as pr, DeleteRangeMoveLeftCommand as wr, DeleteRangeMoveUpCommand as _r, InsertRangeMoveDownCommand as Sr, InsertRangeMoveRightCommand as vr, DeltaRowHeightCommand as fn, SetRowHeightCommand as pn, DeltaColumnWidthCommand as Ir, SetColWidthCommand as Cr, SetRowHiddenCommand as Rr, SetSpecificRowsVisibleCommand as Dr, SetSpecificColsVisibleCommand as br, SetColHiddenCommand as Mr, MoveColsCommand as yr, MoveRowsCommand as Er, MoveRangeCommand as Tr, SetRowVisibleMutation as Bi, SetRowHiddenMutation as ji, SetColVisibleMutation as Fi, SetColHiddenMutation as Li, SetWorksheetRowHeightMutation as Hi, SetWorksheetColWidthMutation as Vi, SetWorksheetActiveOperation as Yi, RangeProtectionPermissionEditPoint as Gi } from "@univerjs/sheets";
|
|
9
|
+
import { MessageType as Se, render as Xi, unmount as zi, FormLayout as en, CheckboxGroup as Ki, Checkbox as Yn, Select as Ji, Button as Gn, clsx as Zi, RadioGroup as qi, Radio as tn } from "@univerjs/design";
|
|
10
|
+
import { docDrawingPositionToTransform as Xn, ReplaceSnapshotCommand as Qi, InnerPasteCommand as es } from "@univerjs/docs-ui";
|
|
11
|
+
import { IImageIoService as ts, IDrawingManagerService as oe, DRAWING_IMAGE_ALLOW_IMAGE_LIST as zn, DRAWING_IMAGE_COUNT_LIMIT as Kn, ImageUploadStatusType as xe, DRAWING_IMAGE_ALLOW_SIZE as Jn, getImageSize as nn, SetDrawingSelectedOperation as Vt, DRAWING_IMAGE_WIDTH_LIMIT as Zn, DRAWING_IMAGE_HEIGHT_LIMIT as qn, ImageSourceType as ns, getDrawingShapeKeyByDrawingSearch as De, UniverDrawingPlugin as rs } from "@univerjs/drawing";
|
|
12
|
+
import { ILocalFileService as is, IMessageService as Or, IDialogService as bn, ISidebarService as ss, IClipboardInterfaceService as os, CanvasFloatDomService as as, PrintFloatDomSingle as cs, ComponentManager as Ur, connectInjector as ds, useDependency as Ie, getMenuHiddenObservable as Yt, MenuItemType as Gt, ContextMenuPosition as rn, ContextMenuGroup as sn, RibbonInsertGroup as ls, KeyCode as Ke, IMenuManagerService as us, IShortcutService as hs } from "@univerjs/ui";
|
|
13
|
+
import { DocDrawingController as gs, UniverDocsDrawingPlugin as ms } from "@univerjs/docs-drawing";
|
|
14
|
+
import { ImageCropperObject as fs, COMPONENT_IMAGE_POPUP_MENU as ps, OpenImageCropOperation as ws, ImageResetSizeOperation as _s, DrawingRenderService as Pr, DrawingCommonPanel as Ss, UniverDrawingUIPlugin as vs } from "@univerjs/drawing-ui";
|
|
15
|
+
import { takeUntil as Qn, throttleTime as Is, combineLatest as at, switchMap as fe, EMPTY as we, tap as er, map as pe, distinctUntilChanged as tr, Subject as on, filter as Cs, take as Rs, BehaviorSubject as je, of as wn } from "rxjs";
|
|
16
|
+
import { jsx as L, jsxs as Xe } from "react/jsx-runtime";
|
|
17
|
+
import { useMemo as Fe, useState as Ee, useCallback as Et, useEffect as Ar } from "react";
|
|
18
|
+
function J(i, t, e) {
|
|
19
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 l =
|
|
22
|
+
const l = ei(
|
|
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:
|
|
29
|
-
const
|
|
30
|
-
return g +
|
|
28
|
+
let { left: g, top: h, width: m, height: f } = l;
|
|
29
|
+
const p = e.getCurrentSkeleton(), w = p.rowHeaderWidth + p.columnTotalWidth, S = p.columnHeaderHeight + p.rowTotalHeight;
|
|
30
|
+
return g + m > w && (g = w - m), h + f > S && (h = S - f), {
|
|
31
31
|
flipY: s,
|
|
32
32
|
flipX: o,
|
|
33
33
|
angle: a,
|
|
@@ -35,27 +35,27 @@ function z(i, t, e) {
|
|
|
35
35
|
skewY: u,
|
|
36
36
|
left: g,
|
|
37
37
|
top: h,
|
|
38
|
-
width:
|
|
39
|
-
height:
|
|
38
|
+
width: m,
|
|
39
|
+
height: f
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function j(i, t) {
|
|
43
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
44
|
if (l == null)
|
|
45
45
|
return;
|
|
46
46
|
const g = {
|
|
47
47
|
column: l.actualColumn,
|
|
48
|
-
columnOffset:
|
|
48
|
+
columnOffset: bt(e - l.startX, 1),
|
|
49
49
|
row: l.actualRow,
|
|
50
|
-
rowOffset:
|
|
50
|
+
rowOffset: bt(n - l.startY, 1)
|
|
51
51
|
}, h = t.getCellWithCoordByOffset(e + r, n + s);
|
|
52
52
|
if (h == null)
|
|
53
53
|
return;
|
|
54
|
-
const
|
|
54
|
+
const m = {
|
|
55
55
|
column: h.actualColumn,
|
|
56
|
-
columnOffset:
|
|
56
|
+
columnOffset: bt(e + r - h.startX, 1),
|
|
57
57
|
row: h.actualRow,
|
|
58
|
-
rowOffset:
|
|
58
|
+
rowOffset: bt(n + s - h.startY, 1)
|
|
59
59
|
};
|
|
60
60
|
return {
|
|
61
61
|
flipY: o,
|
|
@@ -64,53 +64,53 @@ function $(i, t) {
|
|
|
64
64
|
skewX: u,
|
|
65
65
|
skewY: c,
|
|
66
66
|
from: g,
|
|
67
|
-
to:
|
|
67
|
+
to: m
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
|
-
const
|
|
70
|
+
const H = {
|
|
71
71
|
id: "sheet.operation.clear-drawing-transformer",
|
|
72
|
-
type:
|
|
72
|
+
type: q.MUTATION,
|
|
73
73
|
handler: (i, t) => {
|
|
74
|
-
const e = i.get(
|
|
74
|
+
const e = i.get(Q);
|
|
75
75
|
return t.forEach((n) => {
|
|
76
76
|
var r, s;
|
|
77
77
|
(s = (r = e.getRenderById(n)) == null ? void 0 : r.scene.getTransformer()) == null || s.debounceRefreshControls();
|
|
78
78
|
}), !0;
|
|
79
79
|
}
|
|
80
|
-
},
|
|
80
|
+
}, ht = {
|
|
81
81
|
id: "sheet.command.remove-sheet-image",
|
|
82
|
-
type:
|
|
82
|
+
type: q.COMMAND,
|
|
83
83
|
handler: (i, t) => {
|
|
84
|
-
var
|
|
85
|
-
const e = i.get(
|
|
84
|
+
var S, I, D;
|
|
85
|
+
const e = i.get(Y), n = i.get(Ze), r = i.get(Ht), s = i.get(se);
|
|
86
86
|
if (!t) return !1;
|
|
87
87
|
const { drawings: o } = t, a = [];
|
|
88
|
-
o.forEach((
|
|
89
|
-
const { unitId: C } =
|
|
88
|
+
o.forEach((v) => {
|
|
89
|
+
const { unitId: C } = v;
|
|
90
90
|
a.push(C);
|
|
91
91
|
});
|
|
92
|
-
const d = s.getBatchRemoveOp(o), { unitId: u, subUnitId: c, undo: l, redo: g, objects: h } = d,
|
|
93
|
-
return
|
|
92
|
+
const d = s.getBatchRemoveOp(o), { unitId: u, subUnitId: c, undo: l, redo: g, objects: h } = d, m = r.onCommandExecute({ id: ht.id, params: t }), f = { id: P.id, params: { unitId: u, subUnitId: c, op: g, objects: h, type: U.REMOVE } }, p = { id: P.id, params: { unitId: u, subUnitId: c, op: l, objects: h, type: U.INSERT } };
|
|
93
|
+
return lr([...(S = m.preRedos) != null ? S : [], f, ...m.redos], e) ? (n.pushUndoRedo({
|
|
94
94
|
unitID: u,
|
|
95
95
|
undoMutations: [
|
|
96
|
-
...(I =
|
|
97
|
-
|
|
98
|
-
...
|
|
99
|
-
{ id:
|
|
96
|
+
...(I = m.preUndos) != null ? I : [],
|
|
97
|
+
p,
|
|
98
|
+
...m.undos,
|
|
99
|
+
{ id: H.id, params: a }
|
|
100
100
|
],
|
|
101
101
|
redoMutations: [
|
|
102
|
-
...(
|
|
103
|
-
|
|
104
|
-
...
|
|
105
|
-
{ id:
|
|
102
|
+
...(D = m.preRedos) != null ? D : [],
|
|
103
|
+
f,
|
|
104
|
+
...m.redos,
|
|
105
|
+
{ id: H.id, params: a }
|
|
106
106
|
]
|
|
107
107
|
}), !0) : !1;
|
|
108
108
|
}
|
|
109
|
-
},
|
|
109
|
+
}, Nr = {
|
|
110
110
|
id: "sheet.command.delete-drawing",
|
|
111
|
-
type:
|
|
111
|
+
type: q.COMMAND,
|
|
112
112
|
handler: (i) => {
|
|
113
|
-
const t = i.get(
|
|
113
|
+
const t = i.get(Y), n = i.get(se).getFocusDrawings();
|
|
114
114
|
if (n.length === 0)
|
|
115
115
|
return !1;
|
|
116
116
|
const r = n[0].unitId, s = n.map((o) => {
|
|
@@ -122,21 +122,21 @@ const Y = {
|
|
|
122
122
|
drawingType: c
|
|
123
123
|
};
|
|
124
124
|
});
|
|
125
|
-
return t.executeCommand(
|
|
125
|
+
return t.executeCommand(ht.id, {
|
|
126
126
|
unitId: r,
|
|
127
127
|
drawings: s
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
130
|
};
|
|
131
|
-
function
|
|
131
|
+
function Ds(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, d =
|
|
135
|
-
const g = l.transform || { left: 0, top: 0 }, { unitId: h, subUnitId:
|
|
134
|
+
const { parent: n, children: r } = e, { unitId: s, subUnitId: o, drawingId: a } = n, d = qr(0, 0, r.map((l) => l.transform || {})), u = r.map((l) => {
|
|
135
|
+
const g = l.transform || { left: 0, top: 0 }, { unitId: h, subUnitId: m, drawingId: f } = l;
|
|
136
136
|
return {
|
|
137
137
|
unitId: h,
|
|
138
|
-
subUnitId:
|
|
139
|
-
drawingId:
|
|
138
|
+
subUnitId: m,
|
|
139
|
+
drawingId: f,
|
|
140
140
|
transform: {
|
|
141
141
|
...g,
|
|
142
142
|
left: g.left - d.left,
|
|
@@ -148,7 +148,7 @@ function es(i) {
|
|
|
148
148
|
unitId: s,
|
|
149
149
|
subUnitId: o,
|
|
150
150
|
drawingId: a,
|
|
151
|
-
drawingType:
|
|
151
|
+
drawingType: x.DRAWING_GROUP,
|
|
152
152
|
transform: d
|
|
153
153
|
};
|
|
154
154
|
t.push({
|
|
@@ -157,26 +157,26 @@ function es(i) {
|
|
|
157
157
|
});
|
|
158
158
|
}), t;
|
|
159
159
|
}
|
|
160
|
-
function
|
|
160
|
+
function bs(i) {
|
|
161
161
|
const t = [];
|
|
162
162
|
return i.forEach((e) => {
|
|
163
163
|
const { parent: n, children: r } = e, { unitId: s, subUnitId: o, drawingId: a, transform: d = { width: 0, height: 0 } } = n;
|
|
164
164
|
if (d == null)
|
|
165
165
|
return;
|
|
166
166
|
const u = r.map((l) => {
|
|
167
|
-
const { transform: g } = l, { unitId: h, subUnitId:
|
|
167
|
+
const { transform: g } = l, { unitId: h, subUnitId: m, drawingId: f } = l, p = Zr(g || {}, d, d.width || 0, d.height || 0);
|
|
168
168
|
return {
|
|
169
169
|
unitId: h,
|
|
170
|
-
subUnitId:
|
|
171
|
-
drawingId:
|
|
172
|
-
transform:
|
|
170
|
+
subUnitId: m,
|
|
171
|
+
drawingId: f,
|
|
172
|
+
transform: p,
|
|
173
173
|
groupId: void 0
|
|
174
174
|
};
|
|
175
175
|
}), c = {
|
|
176
176
|
unitId: s,
|
|
177
177
|
subUnitId: o,
|
|
178
178
|
drawingId: a,
|
|
179
|
-
drawingType:
|
|
179
|
+
drawingType: x.DRAWING_GROUP,
|
|
180
180
|
transform: {
|
|
181
181
|
left: 0,
|
|
182
182
|
top: 0
|
|
@@ -188,64 +188,64 @@ function ts(i) {
|
|
|
188
188
|
});
|
|
189
189
|
}), t;
|
|
190
190
|
}
|
|
191
|
-
const
|
|
191
|
+
const kr = {
|
|
192
192
|
id: "sheet.command.group-sheet-image",
|
|
193
|
-
type:
|
|
193
|
+
type: q.COMMAND,
|
|
194
194
|
handler: (i, t) => {
|
|
195
|
-
const e = i.get(
|
|
195
|
+
const e = i.get(Y), n = i.get(Ze), r = i.get(se);
|
|
196
196
|
if (!t) return !1;
|
|
197
197
|
const s = [];
|
|
198
|
-
t.forEach(({ parent: h, children:
|
|
199
|
-
s.push(h.unitId),
|
|
200
|
-
s.push(
|
|
198
|
+
t.forEach(({ parent: h, children: m }) => {
|
|
199
|
+
s.push(h.unitId), m.forEach((f) => {
|
|
200
|
+
s.push(f.unitId);
|
|
201
201
|
});
|
|
202
202
|
});
|
|
203
203
|
const o = r.getGroupDrawingOp(t), { unitId: a, subUnitId: d, undo: u, redo: c, objects: l } = o;
|
|
204
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: d, objects:
|
|
208
|
-
{ id:
|
|
207
|
+
{ id: P.id, params: { op: u, unitId: a, subUnitId: d, objects: bs(l), type: U.UNGROUP } },
|
|
208
|
+
{ id: H.id, params: s }
|
|
209
209
|
],
|
|
210
210
|
redoMutations: [
|
|
211
211
|
{ id: P.id, params: { op: c, unitId: a, subUnitId: d, objects: l, type: U.GROUP } },
|
|
212
|
-
{ id:
|
|
212
|
+
{ id: H.id, params: s }
|
|
213
213
|
]
|
|
214
214
|
}), !0) : !1;
|
|
215
215
|
}
|
|
216
|
-
},
|
|
216
|
+
}, Xt = {
|
|
217
217
|
id: "sheet.command.insert-sheet-image",
|
|
218
|
-
type:
|
|
218
|
+
type: q.COMMAND,
|
|
219
219
|
handler: (i, t) => {
|
|
220
|
-
var
|
|
221
|
-
const e = i.get(
|
|
220
|
+
var S, I, D;
|
|
221
|
+
const e = i.get(Y), n = i.get(Ze), r = i.get(se), s = i.get(Ht);
|
|
222
222
|
if (!t) return !1;
|
|
223
|
-
const o = t.drawings, a = o.map((
|
|
224
|
-
return
|
|
223
|
+
const o = t.drawings, a = o.map((v) => v.unitId), d = r.getBatchAddOp(o), { unitId: u, subUnitId: c, undo: l, redo: g, objects: h } = d, m = s.onCommandExecute({ id: Xt.id, params: t }), f = { id: P.id, params: { op: g, unitId: u, subUnitId: c, objects: h, type: U.INSERT } }, p = { id: P.id, params: { op: l, unitId: u, subUnitId: c, objects: h, type: U.REMOVE } };
|
|
224
|
+
return lr([...(S = m.preRedos) != null ? S : [], f, ...m.redos], e) ? (n.pushUndoRedo({
|
|
225
225
|
unitID: u,
|
|
226
226
|
undoMutations: [
|
|
227
|
-
...(I =
|
|
228
|
-
|
|
229
|
-
...
|
|
230
|
-
{ id:
|
|
227
|
+
...(I = m.preUndos) != null ? I : [],
|
|
228
|
+
p,
|
|
229
|
+
...m.undos,
|
|
230
|
+
{ id: H.id, params: a }
|
|
231
231
|
],
|
|
232
232
|
redoMutations: [
|
|
233
|
-
...(
|
|
234
|
-
|
|
235
|
-
...
|
|
236
|
-
{ id:
|
|
233
|
+
...(D = m.preRedos) != null ? D : [],
|
|
234
|
+
f,
|
|
235
|
+
...m.redos,
|
|
236
|
+
{ id: H.id, params: a }
|
|
237
237
|
]
|
|
238
238
|
}), !0) : !1;
|
|
239
239
|
}
|
|
240
|
-
},
|
|
240
|
+
}, $r = {
|
|
241
241
|
id: "sheet.command.set-drawing-arrange",
|
|
242
|
-
type:
|
|
242
|
+
type: q.COMMAND,
|
|
243
243
|
handler: (i, t) => {
|
|
244
|
-
const e = i.get(
|
|
244
|
+
const e = i.get(Y), n = i.get(Ze);
|
|
245
245
|
if (!t) return !1;
|
|
246
|
-
const r = i.get(
|
|
246
|
+
const r = i.get(se), { unitId: s, subUnitId: o, drawingIds: a, arrangeType: d } = t, u = { unitId: s, subUnitId: o, drawingIds: a };
|
|
247
247
|
let c;
|
|
248
|
-
if (d ===
|
|
248
|
+
if (d === Mt.forward ? c = r.getForwardDrawingsOp(u) : d === Mt.backward ? c = r.getBackwardDrawingOp(u) : d === Mt.front ? c = r.getFrontDrawingsOp(u) : d === Mt.back && (c = r.getBackDrawingsOp(u)), c == null)
|
|
249
249
|
return !1;
|
|
250
250
|
const { objects: l, redo: g, undo: h } = c;
|
|
251
251
|
return e.syncExecuteCommand(P.id, { op: g, unitId: s, subUnitId: o, objects: l, type: U.ARRANGE }) ? (n.pushUndoRedo({
|
|
@@ -258,94 +258,94 @@ const gr = {
|
|
|
258
258
|
]
|
|
259
259
|
}), !0) : !1;
|
|
260
260
|
}
|
|
261
|
-
},
|
|
261
|
+
}, zt = {
|
|
262
262
|
id: "sheet.command.set-sheet-image",
|
|
263
|
-
type:
|
|
263
|
+
type: q.COMMAND,
|
|
264
264
|
handler: (i, t) => {
|
|
265
|
-
const e = i.get(
|
|
265
|
+
const e = i.get(Y), n = i.get(Ze), r = i.get(se);
|
|
266
266
|
if (!t) return !1;
|
|
267
267
|
const { drawings: s } = t, o = r.getBatchUpdateOp(s), { unitId: a, subUnitId: d, undo: u, redo: c, objects: l } = o;
|
|
268
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
271
|
{ id: P.id, params: { unitId: a, subUnitId: d, op: u, objects: l, type: U.UPDATE } },
|
|
272
|
-
{ id:
|
|
272
|
+
{ id: H.id, params: [a] }
|
|
273
273
|
],
|
|
274
274
|
redoMutations: [
|
|
275
275
|
{ id: P.id, params: { unitId: a, subUnitId: d, op: c, objects: l, type: U.UPDATE } },
|
|
276
|
-
{ id:
|
|
276
|
+
{ id: H.id, params: [a] }
|
|
277
277
|
]
|
|
278
278
|
}), !0) : !1;
|
|
279
279
|
}
|
|
280
|
-
},
|
|
280
|
+
}, xr = {
|
|
281
281
|
id: "sheet.command.ungroup-sheet-image",
|
|
282
|
-
type:
|
|
282
|
+
type: q.COMMAND,
|
|
283
283
|
handler: (i, t) => {
|
|
284
|
-
const e = i.get(
|
|
284
|
+
const e = i.get(Y), n = i.get(Ze), r = i.get(se);
|
|
285
285
|
if (!t) return !1;
|
|
286
286
|
const s = [];
|
|
287
|
-
t.forEach(({ parent: h, children:
|
|
288
|
-
s.push(h.unitId),
|
|
289
|
-
s.push(
|
|
287
|
+
t.forEach(({ parent: h, children: m }) => {
|
|
288
|
+
s.push(h.unitId), m.forEach((f) => {
|
|
289
|
+
s.push(f.unitId);
|
|
290
290
|
});
|
|
291
291
|
});
|
|
292
292
|
const o = r.getUngroupDrawingOp(t), { unitId: a, subUnitId: d, undo: u, redo: c, objects: l } = o;
|
|
293
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: d, objects:
|
|
297
|
-
{ id:
|
|
296
|
+
{ id: P.id, params: { op: u, unitId: a, subUnitId: d, objects: Ds(l), type: U.GROUP } },
|
|
297
|
+
{ id: H.id, params: s }
|
|
298
298
|
],
|
|
299
299
|
redoMutations: [
|
|
300
300
|
{ id: P.id, params: { op: c, unitId: a, subUnitId: d, objects: l, type: U.UNGROUP } },
|
|
301
|
-
{ id:
|
|
301
|
+
{ id: H.id, params: s }
|
|
302
302
|
]
|
|
303
303
|
}), !0) : !1;
|
|
304
304
|
}
|
|
305
305
|
};
|
|
306
|
-
var
|
|
307
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
306
|
+
var Ms = Object.getOwnPropertyDescriptor, ys = (i, t, e, n) => {
|
|
307
|
+
for (var r = n > 1 ? void 0 : n ? Ms(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
308
308
|
(o = i[s]) && (r = o(r) || r);
|
|
309
309
|
return r;
|
|
310
|
-
},
|
|
311
|
-
function
|
|
310
|
+
}, ie = (i, t) => (e, n) => t(e, n, i);
|
|
311
|
+
function Es(i, t, e) {
|
|
312
312
|
const n = e * Math.PI / 180, r = Math.abs(i * Math.cos(n)) + Math.abs(t * Math.sin(n)), s = Math.abs(i * Math.sin(n)) + Math.abs(t * Math.cos(n));
|
|
313
313
|
return { rotatedWidth: r, rotatedHeight: s };
|
|
314
314
|
}
|
|
315
|
-
function
|
|
316
|
-
var
|
|
317
|
-
const { rotatedHeight: s, rotatedWidth: o } =
|
|
315
|
+
function _n(i, t, e, n, r) {
|
|
316
|
+
var S;
|
|
317
|
+
const { rotatedHeight: s, rotatedWidth: o } = Es(e, n, r), d = i.get(Q).getRenderById(t.unitId);
|
|
318
318
|
if (!d)
|
|
319
319
|
return !1;
|
|
320
|
-
const c = (
|
|
320
|
+
const c = (S = d.with(X).getSkeletonParam(t.subUnitId)) == null ? void 0 : S.skeleton;
|
|
321
321
|
if (c == null)
|
|
322
322
|
return !1;
|
|
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,
|
|
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, m = o / s, p = Math.ceil(Math.min(g, h * m)) / o, w = !p || Number.isNaN(p) ? 1e-3 : p;
|
|
324
324
|
return {
|
|
325
|
-
width: e *
|
|
326
|
-
height: n *
|
|
325
|
+
width: e * w,
|
|
326
|
+
height: n * w
|
|
327
327
|
};
|
|
328
328
|
}
|
|
329
|
-
let
|
|
329
|
+
let dt = class extends ee {
|
|
330
330
|
constructor(t, e, n, r, s, o, a, d, u, c, l, g, h) {
|
|
331
331
|
super();
|
|
332
|
-
|
|
332
|
+
re(this, "_workbookSelections");
|
|
333
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: zn.map((n) => `.${n.replace("image/", "")}`).join(",")
|
|
339
339
|
}), e = t.length;
|
|
340
|
-
return e >
|
|
341
|
-
type:
|
|
342
|
-
content: this._localeService.t("update-status.exceedMaxCount", String(
|
|
340
|
+
return e > Kn ? (this._messageService.show({
|
|
341
|
+
type: Se.Error,
|
|
342
|
+
content: this._localeService.t("update-status.exceedMaxCount", String(Kn))
|
|
343
343
|
}), !1) : e === 0 ? !1 : (t.forEach(async (n) => await this.insertFloatImageByFile(n)), !0);
|
|
344
344
|
}
|
|
345
345
|
async insertCellImage() {
|
|
346
346
|
const e = (await this._fileOpenerService.openFile({
|
|
347
347
|
multiple: !1,
|
|
348
|
-
accept:
|
|
348
|
+
accept: zn.map((n) => `.${n.replace("image/", "")}`).join(",")
|
|
349
349
|
}))[0];
|
|
350
350
|
return e ? (await this._insertCellImage(e), !0) : !1;
|
|
351
351
|
}
|
|
@@ -356,75 +356,75 @@ let et = class extends ne {
|
|
|
356
356
|
let e;
|
|
357
357
|
try {
|
|
358
358
|
e = await this._imageIoService.saveImage(t);
|
|
359
|
-
} catch (
|
|
360
|
-
const I =
|
|
361
|
-
I ===
|
|
362
|
-
type:
|
|
363
|
-
content: this._localeService.t("update-status.exceedMaxSize", String(
|
|
364
|
-
}) : I ===
|
|
365
|
-
type:
|
|
359
|
+
} catch (S) {
|
|
360
|
+
const I = S.message;
|
|
361
|
+
I === xe.ERROR_EXCEED_SIZE ? this._messageService.show({
|
|
362
|
+
type: Se.Error,
|
|
363
|
+
content: this._localeService.t("update-status.exceedMaxSize", String(Jn / (1024 * 1024)))
|
|
364
|
+
}) : I === xe.ERROR_IMAGE_TYPE ? this._messageService.show({
|
|
365
|
+
type: Se.Error,
|
|
366
366
|
content: this._localeService.t("update-status.invalidImageType")
|
|
367
|
-
}) : I ===
|
|
368
|
-
type:
|
|
367
|
+
}) : I === xe.ERROR_IMAGE && this._messageService.show({
|
|
368
|
+
type: Se.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: d, base64Cache: u } = e, { width: c, height: l, image: g } = await
|
|
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 nn(u || ""), { width: h, height: m } = this._context.scene;
|
|
375
375
|
this._imageIoService.addImageSourceCache(d, a, g);
|
|
376
|
-
let
|
|
377
|
-
if (c >
|
|
378
|
-
const
|
|
379
|
-
|
|
376
|
+
let f = 1;
|
|
377
|
+
if (c > Zn || l > qn) {
|
|
378
|
+
const S = Zn / c, I = qn / l;
|
|
379
|
+
f = Math.max(S, I);
|
|
380
380
|
}
|
|
381
|
-
const
|
|
382
|
-
if (
|
|
381
|
+
const p = this._getImagePosition(c * f, l * f, h, m);
|
|
382
|
+
if (p == null)
|
|
383
383
|
return;
|
|
384
|
-
const
|
|
384
|
+
const w = {
|
|
385
385
|
unitId: r,
|
|
386
386
|
subUnitId: s,
|
|
387
387
|
drawingId: o,
|
|
388
|
-
drawingType:
|
|
388
|
+
drawingType: x.DRAWING_IMAGE,
|
|
389
389
|
imageSourceType: a,
|
|
390
390
|
source: d,
|
|
391
|
-
transform:
|
|
392
|
-
sheetTransform:
|
|
391
|
+
transform: J(p, this._selectionRenderService, this._skeletonManagerService),
|
|
392
|
+
sheetTransform: p
|
|
393
393
|
};
|
|
394
|
-
return this._commandService.executeCommand(
|
|
394
|
+
return this._commandService.executeCommand(Xt.id, {
|
|
395
395
|
unitId: r,
|
|
396
|
-
drawings: [
|
|
396
|
+
drawings: [w]
|
|
397
397
|
});
|
|
398
398
|
}
|
|
399
399
|
// eslint-disable-next-line max-lines-per-function
|
|
400
400
|
async _insertCellImage(t, e) {
|
|
401
|
-
var I,
|
|
401
|
+
var I, D;
|
|
402
402
|
let n;
|
|
403
403
|
try {
|
|
404
404
|
n = await this._imageIoService.saveImage(t);
|
|
405
|
-
} catch (
|
|
406
|
-
const C =
|
|
407
|
-
C ===
|
|
408
|
-
type:
|
|
409
|
-
content: this._localeService.t("update-status.exceedMaxSize", String(
|
|
410
|
-
}) : C ===
|
|
411
|
-
type:
|
|
405
|
+
} catch (v) {
|
|
406
|
+
const C = v.message;
|
|
407
|
+
C === xe.ERROR_EXCEED_SIZE ? this._messageService.show({
|
|
408
|
+
type: Se.Error,
|
|
409
|
+
content: this._localeService.t("update-status.exceedMaxSize", String(Jn / (1024 * 1024)))
|
|
410
|
+
}) : C === xe.ERROR_IMAGE_TYPE ? this._messageService.show({
|
|
411
|
+
type: Se.Error,
|
|
412
412
|
content: this._localeService.t("update-status.invalidImageType")
|
|
413
|
-
}) : C ===
|
|
414
|
-
type:
|
|
413
|
+
}) : C === xe.ERROR_IMAGE && this._messageService.show({
|
|
414
|
+
type: Se.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: d, height: u, image: c } = await
|
|
420
|
+
const { imageId: r, imageSourceType: s, source: o, base64Cache: a } = n, { width: d, height: u, image: c } = await nn(a || "");
|
|
421
421
|
this._imageIoService.addImageSourceCache(o, s, c);
|
|
422
422
|
const l = this._workbookSelections.getCurrentLastSelection();
|
|
423
423
|
if (!l)
|
|
424
424
|
return !1;
|
|
425
425
|
let g = l.primary.actualRow, h = l.primary.actualColumn;
|
|
426
426
|
l.primary.isMerged && (g = l.primary.startRow, h = l.primary.startColumn);
|
|
427
|
-
const
|
|
427
|
+
const m = un("", {}), f = _n(
|
|
428
428
|
this._injector,
|
|
429
429
|
{
|
|
430
430
|
unitId: this._context.unitId,
|
|
@@ -436,55 +436,55 @@ let et = class extends ne {
|
|
|
436
436
|
u,
|
|
437
437
|
0
|
|
438
438
|
);
|
|
439
|
-
if (!
|
|
439
|
+
if (!f)
|
|
440
440
|
return !1;
|
|
441
|
-
const
|
|
441
|
+
const p = {
|
|
442
442
|
size: {
|
|
443
|
-
width:
|
|
444
|
-
height:
|
|
443
|
+
width: f.width,
|
|
444
|
+
height: f.height
|
|
445
445
|
},
|
|
446
446
|
positionH: {
|
|
447
|
-
relativeFrom:
|
|
447
|
+
relativeFrom: Wn.PAGE,
|
|
448
448
|
posOffset: 0
|
|
449
449
|
},
|
|
450
450
|
positionV: {
|
|
451
|
-
relativeFrom:
|
|
451
|
+
relativeFrom: xn.PARAGRAPH,
|
|
452
452
|
posOffset: 0
|
|
453
453
|
},
|
|
454
454
|
angle: 0
|
|
455
|
-
},
|
|
456
|
-
unitId:
|
|
457
|
-
subUnitId:
|
|
455
|
+
}, w = {
|
|
456
|
+
unitId: m.getUnitId(),
|
|
457
|
+
subUnitId: m.getUnitId(),
|
|
458
458
|
drawingId: r,
|
|
459
|
-
drawingType:
|
|
459
|
+
drawingType: x.DRAWING_IMAGE,
|
|
460
460
|
imageSourceType: s,
|
|
461
461
|
source: o,
|
|
462
|
-
transform:
|
|
463
|
-
docTransform:
|
|
464
|
-
behindDoc:
|
|
462
|
+
transform: Xn(p),
|
|
463
|
+
docTransform: p,
|
|
464
|
+
behindDoc: Fn.FALSE,
|
|
465
465
|
title: "",
|
|
466
466
|
description: "",
|
|
467
|
-
layoutType:
|
|
467
|
+
layoutType: jn.INLINE,
|
|
468
468
|
// Insert inline drawing by default.
|
|
469
|
-
wrapText:
|
|
469
|
+
wrapText: Bn.BOTH_SIDES,
|
|
470
470
|
distB: 0,
|
|
471
471
|
distL: 0,
|
|
472
472
|
distR: 0,
|
|
473
473
|
distT: 0
|
|
474
|
-
},
|
|
475
|
-
documentDataModel:
|
|
476
|
-
drawings: [
|
|
474
|
+
}, S = hn.drawing.add({
|
|
475
|
+
documentDataModel: m,
|
|
476
|
+
drawings: [w],
|
|
477
477
|
selection: {
|
|
478
478
|
collapsed: !0,
|
|
479
479
|
startOffset: 0,
|
|
480
480
|
endOffset: 0
|
|
481
481
|
}
|
|
482
482
|
});
|
|
483
|
-
return
|
|
483
|
+
return S ? (m.apply(S), this._commandService.syncExecuteCommand(Ln.id, {
|
|
484
484
|
value: {
|
|
485
485
|
[(I = e == null ? void 0 : e.row) != null ? I : g]: {
|
|
486
|
-
[(
|
|
487
|
-
p:
|
|
486
|
+
[(D = e == null ? void 0 : e.col) != null ? D : h]: {
|
|
487
|
+
p: m.getSnapshot(),
|
|
488
488
|
t: 1
|
|
489
489
|
}
|
|
490
490
|
}
|
|
@@ -496,12 +496,12 @@ let et = class extends ne {
|
|
|
496
496
|
// eslint-disable-next-line max-lines-per-function
|
|
497
497
|
async insertCellImageByUrl(t, e) {
|
|
498
498
|
var g, h;
|
|
499
|
-
const { width: n, height: r, image: s } = await
|
|
500
|
-
this._imageIoService.addImageSourceCache(t,
|
|
499
|
+
const { width: n, height: r, image: s } = await nn(t || "");
|
|
500
|
+
this._imageIoService.addImageSourceCache(t, Ce.URL, s);
|
|
501
501
|
const o = this._workbookSelections.getCurrentLastSelection();
|
|
502
502
|
if (!o)
|
|
503
503
|
return !1;
|
|
504
|
-
const a =
|
|
504
|
+
const a = un("", {}), d = _n(
|
|
505
505
|
this._injector,
|
|
506
506
|
{
|
|
507
507
|
unitId: this._context.unitId,
|
|
@@ -521,34 +521,34 @@ let et = class extends ne {
|
|
|
521
521
|
height: d.height
|
|
522
522
|
},
|
|
523
523
|
positionH: {
|
|
524
|
-
relativeFrom:
|
|
524
|
+
relativeFrom: Wn.PAGE,
|
|
525
525
|
posOffset: 0
|
|
526
526
|
},
|
|
527
527
|
positionV: {
|
|
528
|
-
relativeFrom:
|
|
528
|
+
relativeFrom: xn.PARAGRAPH,
|
|
529
529
|
posOffset: 0
|
|
530
530
|
},
|
|
531
531
|
angle: 0
|
|
532
532
|
}, c = {
|
|
533
533
|
unitId: a.getUnitId(),
|
|
534
534
|
subUnitId: a.getUnitId(),
|
|
535
|
-
drawingId:
|
|
536
|
-
drawingType:
|
|
537
|
-
imageSourceType:
|
|
535
|
+
drawingId: He(),
|
|
536
|
+
drawingType: x.DRAWING_IMAGE,
|
|
537
|
+
imageSourceType: Ce.URL,
|
|
538
538
|
source: t,
|
|
539
|
-
transform:
|
|
539
|
+
transform: Xn(u),
|
|
540
540
|
docTransform: u,
|
|
541
|
-
behindDoc:
|
|
541
|
+
behindDoc: Fn.FALSE,
|
|
542
542
|
title: "",
|
|
543
543
|
description: "",
|
|
544
|
-
layoutType:
|
|
544
|
+
layoutType: jn.INLINE,
|
|
545
545
|
// Insert inline drawing by default.
|
|
546
|
-
wrapText:
|
|
546
|
+
wrapText: Bn.BOTH_SIDES,
|
|
547
547
|
distB: 0,
|
|
548
548
|
distL: 0,
|
|
549
549
|
distR: 0,
|
|
550
550
|
distT: 0
|
|
551
|
-
}, l =
|
|
551
|
+
}, l = hn.drawing.add({
|
|
552
552
|
documentDataModel: a,
|
|
553
553
|
drawings: [c],
|
|
554
554
|
selection: {
|
|
@@ -557,7 +557,7 @@ let et = class extends ne {
|
|
|
557
557
|
endOffset: 0
|
|
558
558
|
}
|
|
559
559
|
});
|
|
560
|
-
return l ? (a.apply(l), this._commandService.syncExecuteCommand(
|
|
560
|
+
return l ? (a.apply(l), this._commandService.syncExecuteCommand(Ln.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]: {
|
|
@@ -586,39 +586,39 @@ let et = class extends ne {
|
|
|
586
586
|
endColumn: 0
|
|
587
587
|
};
|
|
588
588
|
s && s.length > 0 && (o = s[s.length - 1].range);
|
|
589
|
-
const a =
|
|
589
|
+
const a = dr(this._skeletonManagerService.getCurrent().skeleton, o);
|
|
590
590
|
if (a == null)
|
|
591
591
|
return;
|
|
592
592
|
let { startColumn: d, startRow: u, startX: c, startY: l } = a, g = !1;
|
|
593
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
|
|
595
|
-
if (
|
|
594
|
+
const p = this._selectionRenderService.getCellWithCoordByOffset(c, l);
|
|
595
|
+
if (p == null)
|
|
596
596
|
return;
|
|
597
|
-
c =
|
|
597
|
+
c = p.startX, l = p.startY, d = p.actualColumn, u = p.actualRow;
|
|
598
598
|
}
|
|
599
599
|
const h = {
|
|
600
600
|
column: d,
|
|
601
601
|
columnOffset: 0,
|
|
602
602
|
row: u,
|
|
603
603
|
rowOffset: 0
|
|
604
|
-
},
|
|
605
|
-
if (
|
|
604
|
+
}, m = this._selectionRenderService.getCellWithCoordByOffset(c + t, l + e);
|
|
605
|
+
if (m == null)
|
|
606
606
|
return;
|
|
607
|
-
const
|
|
608
|
-
column:
|
|
609
|
-
columnOffset: c + t -
|
|
610
|
-
row:
|
|
611
|
-
rowOffset: l + e -
|
|
607
|
+
const f = {
|
|
608
|
+
column: m.actualColumn,
|
|
609
|
+
columnOffset: c + t - m.startX,
|
|
610
|
+
row: m.actualRow,
|
|
611
|
+
rowOffset: l + e - m.startY
|
|
612
612
|
};
|
|
613
613
|
return {
|
|
614
614
|
from: h,
|
|
615
|
-
to:
|
|
615
|
+
to: f
|
|
616
616
|
};
|
|
617
617
|
}
|
|
618
618
|
_updateOrderListener() {
|
|
619
619
|
this.disposeWithMe(this._drawingManagerService.featurePluginOrderUpdate$.subscribe((t) => {
|
|
620
620
|
const { unitId: e, subUnitId: n, drawingIds: r, arrangeType: s } = t;
|
|
621
|
-
this._commandService.executeCommand(
|
|
621
|
+
this._commandService.executeCommand($r.id, {
|
|
622
622
|
unitId: e,
|
|
623
623
|
subUnitId: n,
|
|
624
624
|
drawingIds: r,
|
|
@@ -636,16 +636,16 @@ let et = class extends ne {
|
|
|
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 =
|
|
639
|
+
const c = j({ ...u.transform, ...d }, this._selectionRenderService);
|
|
640
640
|
if (c == null)
|
|
641
641
|
return;
|
|
642
642
|
const l = {
|
|
643
643
|
...n,
|
|
644
|
-
transform: { ...u.transform, ...d, ...
|
|
644
|
+
transform: { ...u.transform, ...d, ...J(c, this._selectionRenderService, this._skeletonManagerService) },
|
|
645
645
|
sheetTransform: { ...c }
|
|
646
646
|
};
|
|
647
647
|
e.push(l);
|
|
648
|
-
}), e.length > 0 && this._commandService.executeCommand(
|
|
648
|
+
}), e.length > 0 && this._commandService.executeCommand(zt.id, {
|
|
649
649
|
unitId: t[0].unitId,
|
|
650
650
|
drawings: e
|
|
651
651
|
}));
|
|
@@ -653,45 +653,45 @@ let et = class extends ne {
|
|
|
653
653
|
}
|
|
654
654
|
_groupDrawingListener() {
|
|
655
655
|
this.disposeWithMe(this._drawingManagerService.featurePluginGroupUpdate$.subscribe((t) => {
|
|
656
|
-
this._commandService.executeCommand(
|
|
656
|
+
this._commandService.executeCommand(kr.id, t);
|
|
657
657
|
const { unitId: e, subUnitId: n, drawingId: r } = t[0].parent;
|
|
658
|
-
this._commandService.syncExecuteCommand(
|
|
658
|
+
this._commandService.syncExecuteCommand(Vt.id, [{ unitId: e, subUnitId: n, drawingId: r }]);
|
|
659
659
|
})), this.disposeWithMe(this._drawingManagerService.featurePluginUngroupUpdate$.subscribe((t) => {
|
|
660
|
-
this._commandService.executeCommand(
|
|
660
|
+
this._commandService.executeCommand(xr.id, t);
|
|
661
661
|
}));
|
|
662
662
|
}
|
|
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(Ge, !1), this._sheetDrawingService.focusDrawing([])) : (this._contextService.setContextValue(Ge, !0), this._sheetDrawingService.focusDrawing(t));
|
|
667
667
|
})
|
|
668
668
|
);
|
|
669
669
|
}
|
|
670
670
|
};
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
],
|
|
685
|
-
const
|
|
671
|
+
dt = ys([
|
|
672
|
+
ie(1, A(X)),
|
|
673
|
+
ie(2, Y),
|
|
674
|
+
ie(3, Je),
|
|
675
|
+
ie(4, ts),
|
|
676
|
+
ie(5, is),
|
|
677
|
+
ie(6, se),
|
|
678
|
+
ie(7, oe),
|
|
679
|
+
ie(8, ur),
|
|
680
|
+
ie(9, Or),
|
|
681
|
+
ie(10, A(Te)),
|
|
682
|
+
ie(11, A(ut)),
|
|
683
|
+
ie(12, A(qe))
|
|
684
|
+
], dt);
|
|
685
|
+
const Kt = {
|
|
686
686
|
id: "sheet.command.insert-float-image",
|
|
687
|
-
type:
|
|
687
|
+
type: q.COMMAND,
|
|
688
688
|
handler: async (i, t) => {
|
|
689
689
|
var o, a;
|
|
690
|
-
const e = i.get(
|
|
691
|
-
|
|
690
|
+
const e = i.get(de), n = i.get(Q), r = (o = Dn(
|
|
691
|
+
k.UNIVER_SHEET,
|
|
692
692
|
e,
|
|
693
693
|
n
|
|
694
|
-
)) == null ? void 0 : o.with(
|
|
694
|
+
)) == null ? void 0 : o.with(dt);
|
|
695
695
|
if (!r)
|
|
696
696
|
return !1;
|
|
697
697
|
const s = t == null ? void 0 : t.files;
|
|
@@ -701,54 +701,369 @@ const Bt = {
|
|
|
701
701
|
} else
|
|
702
702
|
return (a = r.insertFloatImage()) != null ? a : !1;
|
|
703
703
|
}
|
|
704
|
-
},
|
|
704
|
+
}, Mn = {
|
|
705
705
|
id: "sheet.command.insert-cell-image",
|
|
706
|
-
type:
|
|
706
|
+
type: q.COMMAND,
|
|
707
707
|
handler: (i) => {
|
|
708
708
|
var n, r;
|
|
709
|
-
const t = i.get(
|
|
710
|
-
return (r = (n =
|
|
711
|
-
|
|
709
|
+
const t = i.get(de), e = i.get(Q);
|
|
710
|
+
return (r = (n = Dn(
|
|
711
|
+
k.UNIVER_SHEET,
|
|
712
712
|
t,
|
|
713
713
|
e
|
|
714
|
-
)) == null ? void 0 : n.with(
|
|
714
|
+
)) == null ? void 0 : n.with(dt).insertCellImage()) != null ? r : !1;
|
|
715
715
|
}
|
|
716
|
-
},
|
|
716
|
+
}, gt = {
|
|
717
717
|
id: "sheet.command.move-drawing",
|
|
718
|
-
type:
|
|
718
|
+
type: q.COMMAND,
|
|
719
719
|
handler: (i, t) => {
|
|
720
|
-
const e = i.get(
|
|
720
|
+
const e = i.get(Y), n = i.get(se), r = i.get(Je), { direction: s } = t, o = n.getFocusDrawings();
|
|
721
721
|
if (o.length === 0)
|
|
722
722
|
return !1;
|
|
723
723
|
const a = o[0].unitId, d = o.map((c) => {
|
|
724
724
|
const { transform: l } = c;
|
|
725
725
|
if (l == null)
|
|
726
726
|
return null;
|
|
727
|
-
const g = { ...l }, { left: h = 0, top:
|
|
728
|
-
return s ===
|
|
727
|
+
const g = { ...l }, { left: h = 0, top: m = 0 } = l;
|
|
728
|
+
return s === ve.UP ? g.top = m - 1 : s === ve.DOWN ? g.top = m + 1 : s === ve.LEFT ? g.left = h - 1 : s === ve.RIGHT && (g.left = h + 1), {
|
|
729
729
|
...c,
|
|
730
730
|
transform: g,
|
|
731
|
-
sheetTransform:
|
|
731
|
+
sheetTransform: j(g, r)
|
|
732
732
|
};
|
|
733
733
|
}).filter((c) => c != null);
|
|
734
|
-
return e.syncExecuteCommand(
|
|
734
|
+
return e.syncExecuteCommand(zt.id, {
|
|
735
735
|
unitId: a,
|
|
736
736
|
drawings: d
|
|
737
|
-
}) ? (e.syncExecuteCommand(
|
|
737
|
+
}) ? (e.syncExecuteCommand(H.id, [a]), !0) : !1;
|
|
738
|
+
}
|
|
739
|
+
};
|
|
740
|
+
var Ts = Object.getOwnPropertyDescriptor, Os = (i, t, e, n) => {
|
|
741
|
+
for (var r = n > 1 ? void 0 : n ? Ts(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
742
|
+
(o = i[s]) && (r = o(r) || r);
|
|
743
|
+
return r;
|
|
744
|
+
}, an = (i, t) => (e, n) => t(e, n, i), ye = /* @__PURE__ */ ((i) => (i.CELL_ADDRESS = "cellAddress", i.COLUMN_VALUE = "columnValue", i))(ye || {});
|
|
745
|
+
const yn = hi("sheets-drawing-ui.batch-save-images.service");
|
|
746
|
+
function Sn(i) {
|
|
747
|
+
let t = "", e = i;
|
|
748
|
+
for (; e >= 0; )
|
|
749
|
+
t = String.fromCharCode(e % 26 + 65) + t, e = Math.floor(e / 26) - 1;
|
|
750
|
+
return t;
|
|
751
|
+
}
|
|
752
|
+
function At(i, t) {
|
|
753
|
+
return `${Sn(t)}${i + 1}`;
|
|
754
|
+
}
|
|
755
|
+
function Us(i) {
|
|
756
|
+
const t = At(i.startRow, i.startColumn), e = At(i.endRow, i.endColumn);
|
|
757
|
+
return t === e ? t : `${t}:${e}`;
|
|
758
|
+
}
|
|
759
|
+
function nr(i) {
|
|
760
|
+
var t, e, n, r;
|
|
761
|
+
return !!((e = (t = i == null ? void 0 : i.p) == null ? void 0 : t.drawingsOrder) != null && e.length && ((r = (n = i == null ? void 0 : i.p) == null ? void 0 : n.drawingsOrder) == null ? void 0 : r.length) > 0);
|
|
762
|
+
}
|
|
763
|
+
function rr(i) {
|
|
764
|
+
var n, r, s;
|
|
765
|
+
if (!((r = (n = i.p) == null ? void 0 : n.drawingsOrder) != null && r.length) || !((s = i.p) != null && s.drawings))
|
|
766
|
+
return null;
|
|
767
|
+
const t = i.p.drawingsOrder[0], e = i.p.drawings[t];
|
|
768
|
+
return !e || !("source" in e) || !("imageSourceType" in e) ? null : e;
|
|
769
|
+
}
|
|
770
|
+
function cn(i, t) {
|
|
771
|
+
if (t === Ce.BASE64) {
|
|
772
|
+
const e = i.match(/^data:image\/(\w+);/);
|
|
773
|
+
if (e)
|
|
774
|
+
return e[1] === "jpeg" ? "jpg" : e[1];
|
|
775
|
+
}
|
|
776
|
+
if (t === Ce.URL) {
|
|
777
|
+
const e = i.match(/\.(\w+)(?:\?|$)/);
|
|
778
|
+
if (e)
|
|
779
|
+
return e[1].toLowerCase();
|
|
780
|
+
}
|
|
781
|
+
return "png";
|
|
782
|
+
}
|
|
783
|
+
async function ir(i, t) {
|
|
784
|
+
if (t === Ce.BASE64)
|
|
785
|
+
return (await fetch(i)).blob();
|
|
786
|
+
if (t === Ce.URL)
|
|
787
|
+
return (await fetch(i)).blob();
|
|
788
|
+
throw new Error("UUID image type requires additional handling");
|
|
789
|
+
}
|
|
790
|
+
let vn = class extends ee {
|
|
791
|
+
constructor(i, t, e) {
|
|
792
|
+
super(), this._univerInstanceService = i, this._selectionService = t, this._imageIoService = e;
|
|
793
|
+
}
|
|
794
|
+
getCellImagesInSelection() {
|
|
795
|
+
const i = this._univerInstanceService.getCurrentUnitForType(k.UNIVER_SHEET);
|
|
796
|
+
if (!i) return [];
|
|
797
|
+
const t = i.getActiveSheet();
|
|
798
|
+
if (!t) return [];
|
|
799
|
+
const e = this._selectionService.getCurrentSelections();
|
|
800
|
+
if (!e || e.length === 0) return [];
|
|
801
|
+
const n = t.getCellMatrix(), r = [];
|
|
802
|
+
for (const s of e) {
|
|
803
|
+
const { startRow: o, endRow: a, startColumn: d, endColumn: u } = s.range;
|
|
804
|
+
for (let c = o; c <= a; c++)
|
|
805
|
+
for (let l = d; l <= u; l++) {
|
|
806
|
+
const g = n.getValue(c, l);
|
|
807
|
+
if (nr(g)) {
|
|
808
|
+
const h = rr(g);
|
|
809
|
+
h && r.push({
|
|
810
|
+
row: c,
|
|
811
|
+
col: l,
|
|
812
|
+
cellAddress: At(c, l),
|
|
813
|
+
source: h.source,
|
|
814
|
+
imageSourceType: h.imageSourceType,
|
|
815
|
+
imageId: h.drawingId
|
|
816
|
+
});
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
return r;
|
|
821
|
+
}
|
|
822
|
+
getCellImagesFromRanges(i, t, e) {
|
|
823
|
+
const n = this._univerInstanceService.getUnit(i, k.UNIVER_SHEET);
|
|
824
|
+
if (!n) return [];
|
|
825
|
+
const r = n.getSheetBySheetId(t);
|
|
826
|
+
if (!r) return [];
|
|
827
|
+
const s = r.getCellMatrix(), o = [];
|
|
828
|
+
for (const a of e) {
|
|
829
|
+
const { startRow: d, endRow: u, startColumn: c, endColumn: l } = a;
|
|
830
|
+
for (let g = d; g <= u; g++)
|
|
831
|
+
for (let h = c; h <= l; h++) {
|
|
832
|
+
const m = s.getValue(g, h);
|
|
833
|
+
if (nr(m)) {
|
|
834
|
+
const f = rr(m);
|
|
835
|
+
f && o.push({
|
|
836
|
+
row: g,
|
|
837
|
+
col: h,
|
|
838
|
+
cellAddress: At(g, h),
|
|
839
|
+
source: f.source,
|
|
840
|
+
imageSourceType: f.imageSourceType,
|
|
841
|
+
imageId: f.drawingId
|
|
842
|
+
});
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
return o;
|
|
847
|
+
}
|
|
848
|
+
getDataColumns() {
|
|
849
|
+
var l, g, h, m;
|
|
850
|
+
const i = this._univerInstanceService.getCurrentUnitForType(k.UNIVER_SHEET);
|
|
851
|
+
if (!i) return [];
|
|
852
|
+
const t = i.getActiveSheet();
|
|
853
|
+
if (!t) return [];
|
|
854
|
+
const e = this._selectionService.getCurrentSelections();
|
|
855
|
+
if (!e || e.length === 0) return [];
|
|
856
|
+
const n = t.getCellMatrix(), r = n.getDataRange();
|
|
857
|
+
let s = 1 / 0, o = -1 / 0;
|
|
858
|
+
const a = /* @__PURE__ */ new Set();
|
|
859
|
+
for (const f of e) {
|
|
860
|
+
s = Math.min(s, f.range.startRow), o = Math.max(o, f.range.endRow);
|
|
861
|
+
for (let p = f.range.startColumn; p <= f.range.endColumn; p++)
|
|
862
|
+
a.add(p);
|
|
863
|
+
}
|
|
864
|
+
const d = /* @__PURE__ */ new Set();
|
|
865
|
+
for (let f = r.startColumn; f <= r.endColumn; f++)
|
|
866
|
+
if (!a.has(f))
|
|
867
|
+
for (let p = s; p <= o; p++) {
|
|
868
|
+
const w = n.getValue(p, f);
|
|
869
|
+
if (w && (((l = w.v) == null ? void 0 : l.toString()) || ((m = (h = (g = w.p) == null ? void 0 : g.body) == null ? void 0 : h.dataStream) == null ? void 0 : m.trim()) || "")) {
|
|
870
|
+
d.add(f);
|
|
871
|
+
break;
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
const u = [], c = Array.from(d).sort((f, p) => f - p);
|
|
875
|
+
for (const f of c)
|
|
876
|
+
u.push({
|
|
877
|
+
index: f,
|
|
878
|
+
label: Sn(f)
|
|
879
|
+
});
|
|
880
|
+
return u;
|
|
881
|
+
}
|
|
882
|
+
getDataColumnsForRanges(i, t, e) {
|
|
883
|
+
var h, m, f, p;
|
|
884
|
+
const n = this._univerInstanceService.getUnit(i, k.UNIVER_SHEET);
|
|
885
|
+
if (!n) return [];
|
|
886
|
+
const r = n.getSheetBySheetId(t);
|
|
887
|
+
if (!r) return [];
|
|
888
|
+
const s = r.getCellMatrix(), o = s.getDataRange();
|
|
889
|
+
let a = 1 / 0, d = -1 / 0;
|
|
890
|
+
const u = /* @__PURE__ */ new Set();
|
|
891
|
+
for (const w of e) {
|
|
892
|
+
a = Math.min(a, w.startRow), d = Math.max(d, w.endRow);
|
|
893
|
+
for (let S = w.startColumn; S <= w.endColumn; S++)
|
|
894
|
+
u.add(S);
|
|
895
|
+
}
|
|
896
|
+
const c = /* @__PURE__ */ new Set();
|
|
897
|
+
for (let w = o.startColumn; w <= o.endColumn; w++)
|
|
898
|
+
if (!u.has(w))
|
|
899
|
+
for (let S = a; S <= d; S++) {
|
|
900
|
+
const I = s.getValue(S, w);
|
|
901
|
+
if (I && (((h = I.v) == null ? void 0 : h.toString()) || ((p = (f = (m = I.p) == null ? void 0 : m.body) == null ? void 0 : f.dataStream) == null ? void 0 : p.trim()) || "")) {
|
|
902
|
+
c.add(w);
|
|
903
|
+
break;
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
const l = [], g = Array.from(c).sort((w, S) => w - S);
|
|
907
|
+
for (const w of g)
|
|
908
|
+
l.push({
|
|
909
|
+
index: w,
|
|
910
|
+
label: Sn(w)
|
|
911
|
+
});
|
|
912
|
+
return l;
|
|
913
|
+
}
|
|
914
|
+
getSelectionRangeNotation() {
|
|
915
|
+
const i = this._selectionService.getCurrentSelections();
|
|
916
|
+
return !i || i.length === 0 ? "" : i.map((t) => Us(t.range)).join(", ");
|
|
917
|
+
}
|
|
918
|
+
getSelectionRowRange() {
|
|
919
|
+
const i = this._selectionService.getCurrentSelections();
|
|
920
|
+
if (!i || i.length === 0) return null;
|
|
921
|
+
let t = 1 / 0, e = -1 / 0;
|
|
922
|
+
for (const n of i)
|
|
923
|
+
t = Math.min(t, n.range.startRow), e = Math.max(e, n.range.endRow);
|
|
924
|
+
return { startRow: t, endRow: e };
|
|
925
|
+
}
|
|
926
|
+
getSelectionColumnIndices() {
|
|
927
|
+
const i = this._selectionService.getCurrentSelections();
|
|
928
|
+
if (!i || i.length === 0) return /* @__PURE__ */ new Set();
|
|
929
|
+
const t = /* @__PURE__ */ new Set();
|
|
930
|
+
for (const e of i)
|
|
931
|
+
for (let n = e.range.startColumn; n <= e.range.endColumn; n++)
|
|
932
|
+
t.add(n);
|
|
933
|
+
return t;
|
|
934
|
+
}
|
|
935
|
+
generateFileName(i, t) {
|
|
936
|
+
var s, o, a, d;
|
|
937
|
+
const e = this._univerInstanceService.getCurrentUnitForType(k.UNIVER_SHEET), n = cn(i.source, i.imageSourceType), r = [];
|
|
938
|
+
for (const u of t.fileNameParts)
|
|
939
|
+
if (u === "cellAddress")
|
|
940
|
+
r.push(i.cellAddress);
|
|
941
|
+
else if (u === "columnValue" && t.columnIndex !== void 0) {
|
|
942
|
+
const c = e == null ? void 0 : e.getActiveSheet();
|
|
943
|
+
if (c) {
|
|
944
|
+
const g = c.getCellMatrix().getValue(i.row, t.columnIndex);
|
|
945
|
+
if (g) {
|
|
946
|
+
const h = ((s = g.v) == null ? void 0 : s.toString()) || ((d = (a = (o = g.p) == null ? void 0 : o.body) == null ? void 0 : a.dataStream) == null ? void 0 : d.trim()) || "";
|
|
947
|
+
if (h) {
|
|
948
|
+
const m = h.replace(/[<>:"/\\|?*]/g, "_").trim();
|
|
949
|
+
m && r.push(m);
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
return r.length === 0 ? `${i.cellAddress}.${n}` : `${r.join("_")}.${n}`;
|
|
955
|
+
}
|
|
956
|
+
generateFileNameWithContext(i, t, e, n) {
|
|
957
|
+
var a, d, u, c;
|
|
958
|
+
const r = this._univerInstanceService.getUnit(e, k.UNIVER_SHEET), s = cn(i.source, i.imageSourceType), o = [];
|
|
959
|
+
for (const l of t.fileNameParts)
|
|
960
|
+
if (l === "cellAddress")
|
|
961
|
+
o.push(i.cellAddress);
|
|
962
|
+
else if (l === "columnValue" && t.columnIndex !== void 0) {
|
|
963
|
+
const g = r == null ? void 0 : r.getSheetBySheetId(n);
|
|
964
|
+
if (g) {
|
|
965
|
+
const m = g.getCellMatrix().getValue(i.row, t.columnIndex);
|
|
966
|
+
if (m) {
|
|
967
|
+
const f = ((a = m.v) == null ? void 0 : a.toString()) || ((c = (u = (d = m.p) == null ? void 0 : d.body) == null ? void 0 : u.dataStream) == null ? void 0 : c.trim()) || "";
|
|
968
|
+
if (f) {
|
|
969
|
+
const p = f.replace(/[<>:"/\\|?*]/g, "_").trim();
|
|
970
|
+
p && o.push(p);
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
return o.length === 0 ? `${i.cellAddress}.${s}` : `${o.join("_")}.${s}`;
|
|
976
|
+
}
|
|
977
|
+
async saveImages(i, t) {
|
|
978
|
+
var r;
|
|
979
|
+
const e = await window.showDirectoryPicker({ mode: "readwrite" }), n = /* @__PURE__ */ new Map();
|
|
980
|
+
for (const s of i) {
|
|
981
|
+
let o = this.generateFileName(s, t);
|
|
982
|
+
const a = o.replace(/\.\w+$/, ""), d = ((r = o.match(/\.\w+$/)) == null ? void 0 : r[0]) || ".png", u = n.get(a) || 0;
|
|
983
|
+
u > 0 && (o = `${a}_${u}${d}`), n.set(a, u + 1);
|
|
984
|
+
try {
|
|
985
|
+
const c = await this._getImageBlob(s), g = await (await e.getFileHandle(o, { create: !0 })).createWritable();
|
|
986
|
+
await g.write(c), await g.close();
|
|
987
|
+
} catch (c) {
|
|
988
|
+
throw console.error(`Failed to save image ${o}:`, c), c;
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
async saveImagesWithContext(i, t, e, n) {
|
|
993
|
+
var o;
|
|
994
|
+
const r = await window.showDirectoryPicker({ mode: "readwrite" }), s = /* @__PURE__ */ new Map();
|
|
995
|
+
for (const a of i) {
|
|
996
|
+
let d = this.generateFileNameWithContext(a, t, e, n);
|
|
997
|
+
const u = d.replace(/\.\w+$/, ""), c = ((o = d.match(/\.\w+$/)) == null ? void 0 : o[0]) || ".png", l = s.get(u) || 0;
|
|
998
|
+
l > 0 && (d = `${u}_${l}${c}`), s.set(u, l + 1);
|
|
999
|
+
try {
|
|
1000
|
+
const g = await this._getImageBlob(a), m = await (await r.getFileHandle(d, { create: !0 })).createWritable();
|
|
1001
|
+
await m.write(g), await m.close();
|
|
1002
|
+
} catch (g) {
|
|
1003
|
+
throw console.error(`Failed to save image ${d}:`, g), g;
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
738
1006
|
}
|
|
739
|
-
|
|
1007
|
+
async downloadSingleImage(i) {
|
|
1008
|
+
const t = cn(i.source, i.imageSourceType), e = `${i.cellAddress}.${t}`;
|
|
1009
|
+
try {
|
|
1010
|
+
const n = await this._getImageBlob(i), r = URL.createObjectURL(n), s = document.createElement("a");
|
|
1011
|
+
s.href = r, s.download = e, document.body.appendChild(s), s.click(), document.body.removeChild(s), URL.revokeObjectURL(r);
|
|
1012
|
+
} catch (n) {
|
|
1013
|
+
throw console.error(`Failed to download image ${e}:`, n), n;
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
async _getImageBlob(i) {
|
|
1017
|
+
if (i.imageSourceType === Ce.UUID) {
|
|
1018
|
+
const t = await this._imageIoService.getImage(i.source);
|
|
1019
|
+
return ir(t, Ce.URL);
|
|
1020
|
+
}
|
|
1021
|
+
return ir(i.source, i.imageSourceType);
|
|
1022
|
+
}
|
|
1023
|
+
};
|
|
1024
|
+
vn = Os([
|
|
1025
|
+
an(0, de),
|
|
1026
|
+
an(1, A(ut)),
|
|
1027
|
+
an(2, hr)
|
|
1028
|
+
], vn);
|
|
1029
|
+
const ze = "sheet.dialog.batch-save-images", ct = {
|
|
1030
|
+
id: "sheet.command.save-cell-images",
|
|
1031
|
+
type: q.COMMAND,
|
|
1032
|
+
handler: async (i) => {
|
|
1033
|
+
const t = i.get(bn), e = i.get(yn), n = e.getCellImagesInSelection();
|
|
1034
|
+
if (n.length === 1)
|
|
1035
|
+
try {
|
|
1036
|
+
return await e.downloadSingleImage(n[0]), !0;
|
|
1037
|
+
} catch (a) {
|
|
1038
|
+
return console.error("Failed to download image:", a), !1;
|
|
1039
|
+
}
|
|
1040
|
+
const r = i.get(Te), s = e.getSelectionRangeNotation(), o = `${r.t("sheetImage.save.title")} (${s})`;
|
|
1041
|
+
return t.open({
|
|
1042
|
+
id: ze,
|
|
1043
|
+
draggable: !0,
|
|
1044
|
+
width: 360,
|
|
1045
|
+
title: { title: o },
|
|
1046
|
+
children: {
|
|
1047
|
+
label: ze
|
|
1048
|
+
},
|
|
1049
|
+
destroyOnClose: !0,
|
|
1050
|
+
preservePositionOnDestroy: !0,
|
|
1051
|
+
onClose: () => t.close(ze)
|
|
1052
|
+
}), !0;
|
|
1053
|
+
}
|
|
1054
|
+
}, Wr = "COMPONENT_SHEET_DRAWING_PANEL", Br = {
|
|
740
1055
|
id: "sidebar.operation.sheet-image",
|
|
741
|
-
type:
|
|
1056
|
+
type: q.COMMAND,
|
|
742
1057
|
handler: async (i, t) => {
|
|
743
|
-
const e = i.get(
|
|
744
|
-
if (!
|
|
1058
|
+
const e = i.get(ss), n = i.get(Te), r = i.get(de), s = i.get(Y);
|
|
1059
|
+
if (!ae(r)) return !1;
|
|
745
1060
|
switch (t.value) {
|
|
746
1061
|
case "open":
|
|
747
1062
|
e.open({
|
|
748
1063
|
header: { title: n.t("sheetImage.panel.title") },
|
|
749
|
-
children: { label:
|
|
1064
|
+
children: { label: Wr },
|
|
750
1065
|
onClose: () => {
|
|
751
|
-
s.syncExecuteCommand(
|
|
1066
|
+
s.syncExecuteCommand(Vt.id, []);
|
|
752
1067
|
},
|
|
753
1068
|
width: 360
|
|
754
1069
|
});
|
|
@@ -760,27 +1075,27 @@ const Bt = {
|
|
|
760
1075
|
}
|
|
761
1076
|
return !0;
|
|
762
1077
|
}
|
|
763
|
-
},
|
|
1078
|
+
}, jr = {
|
|
764
1079
|
id: "sheet.operation.edit-sheet-image",
|
|
765
|
-
type:
|
|
1080
|
+
type: q.OPERATION,
|
|
766
1081
|
handler: (i, t) => {
|
|
767
|
-
const e = i.get(
|
|
768
|
-
return t == null ? !1 : (e.syncExecuteCommand(
|
|
1082
|
+
const e = i.get(Y);
|
|
1083
|
+
return t == null ? !1 : (e.syncExecuteCommand(Vt.id, [t]), e.executeCommand(Br.id, { value: "open" }), !0);
|
|
769
1084
|
}
|
|
770
|
-
},
|
|
771
|
-
var
|
|
772
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1085
|
+
}, Ps = "sheets-drawing-ui.config", sr = {};
|
|
1086
|
+
var As = Object.getOwnPropertyDescriptor, Ns = (i, t, e, n) => {
|
|
1087
|
+
for (var r = n > 1 ? void 0 : n ? As(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
773
1088
|
(o = i[s]) && (r = o(r) || r);
|
|
774
1089
|
return r;
|
|
775
1090
|
}, ce = (i, t) => (e, n) => t(e, n, i);
|
|
776
|
-
let
|
|
1091
|
+
let Nt = class extends gi {
|
|
777
1092
|
constructor(t, e, n, r, s, o, a, d, u, c) {
|
|
778
1093
|
super();
|
|
779
|
-
|
|
1094
|
+
re(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
|
|
780
1095
|
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
1096
|
}
|
|
782
1097
|
_init() {
|
|
783
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1098
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(k.UNIVER_SHEET).pipe(Qn(this.dispose$)).subscribe((t) => this._create(t)), this._univerInstanceService.getTypeOfUnitDisposed$(k.UNIVER_SHEET).pipe(Qn(this.dispose$)).subscribe((t) => this._dispose(t)), this._univerInstanceService.getAllUnitsForType(k.UNIVER_SHEET).forEach((t) => this._create(t)), this._setupLoadingStatus();
|
|
784
1099
|
}
|
|
785
1100
|
_setupLoadingStatus() {
|
|
786
1101
|
const t = "image-upload-loading";
|
|
@@ -788,7 +1103,7 @@ let Rt = class extends Xr {
|
|
|
788
1103
|
this.disposeWithMe(this._ioService.change$.subscribe((n) => {
|
|
789
1104
|
n > 0 && !e ? e = this._messageService.show({
|
|
790
1105
|
id: t,
|
|
791
|
-
type:
|
|
1106
|
+
type: Se.Loading,
|
|
792
1107
|
content: `${this._localeService.t("uploadLoading.loading")}: ${n}`,
|
|
793
1108
|
duration: 0
|
|
794
1109
|
}) : n === 0 && (e == null || e.dispose(), e = void 0);
|
|
@@ -808,7 +1123,7 @@ let Rt = class extends Xr {
|
|
|
808
1123
|
_hasCropObject(t) {
|
|
809
1124
|
const e = t.getAllObjectsByOrder();
|
|
810
1125
|
for (const n of e)
|
|
811
|
-
if (n instanceof
|
|
1126
|
+
if (n instanceof fs)
|
|
812
1127
|
return !0;
|
|
813
1128
|
return !1;
|
|
814
1129
|
}
|
|
@@ -823,7 +1138,7 @@ let Rt = class extends Xr {
|
|
|
823
1138
|
let r;
|
|
824
1139
|
this.disposeWithMe(
|
|
825
1140
|
n.createControl$.subscribe(() => {
|
|
826
|
-
if (this._contextService.setContextValue(
|
|
1141
|
+
if (this._contextService.setContextValue(Ge, !0), this._hasCropObject(e))
|
|
827
1142
|
return;
|
|
828
1143
|
const o = n.getSelectedObjectMap();
|
|
829
1144
|
if (o.size > 1) {
|
|
@@ -836,27 +1151,27 @@ let Rt = class extends Xr {
|
|
|
836
1151
|
const d = a.oKey, u = this._drawingManagerService.getDrawingOKey(d);
|
|
837
1152
|
if (!u)
|
|
838
1153
|
return;
|
|
839
|
-
const { unitId: c, subUnitId: l, drawingId: g, drawingType: h } = u,
|
|
840
|
-
if (
|
|
1154
|
+
const { unitId: c, subUnitId: l, drawingId: g, drawingType: h } = u, m = u.data;
|
|
1155
|
+
if (m && m.disablePopup)
|
|
841
1156
|
return;
|
|
842
1157
|
r == null || r.dispose();
|
|
843
|
-
const
|
|
1158
|
+
const f = this._canvasPopManagerService.getFeatureMenu(c, l, g, h);
|
|
844
1159
|
r = this.disposeWithMe(this._canvasPopManagerService.attachPopupToObject(a, {
|
|
845
|
-
componentKey:
|
|
1160
|
+
componentKey: ps,
|
|
846
1161
|
direction: "horizontal",
|
|
847
1162
|
offset: [2, 0],
|
|
848
1163
|
extraProps: {
|
|
849
|
-
menuItems:
|
|
1164
|
+
menuItems: f || this._getImageMenuItems(c, l, g, h)
|
|
850
1165
|
}
|
|
851
1166
|
}));
|
|
852
1167
|
})
|
|
853
1168
|
), this.disposeWithMe(
|
|
854
1169
|
n.clearControl$.subscribe(() => {
|
|
855
|
-
r == null || r.dispose(), this._contextService.setContextValue(
|
|
1170
|
+
r == null || r.dispose(), this._contextService.setContextValue(Ge, !1), this._commandService.syncExecuteCommand(Vt.id, []);
|
|
856
1171
|
})
|
|
857
1172
|
), this.disposeWithMe(
|
|
858
1173
|
this._contextService.contextChanged$.subscribe((o) => {
|
|
859
|
-
o[
|
|
1174
|
+
o[Ge] === !1 && (r == null || r.dispose());
|
|
860
1175
|
})
|
|
861
1176
|
), this.disposeWithMe(
|
|
862
1177
|
n.changing$.subscribe(() => {
|
|
@@ -869,62 +1184,62 @@ let Rt = class extends Xr {
|
|
|
869
1184
|
{
|
|
870
1185
|
label: "image-popup.edit",
|
|
871
1186
|
index: 0,
|
|
872
|
-
commandId:
|
|
1187
|
+
commandId: jr.id,
|
|
873
1188
|
commandParams: { unitId: t, subUnitId: e, drawingId: n },
|
|
874
|
-
disable: r ===
|
|
1189
|
+
disable: r === x.DRAWING_DOM
|
|
875
1190
|
},
|
|
876
1191
|
{
|
|
877
1192
|
label: "image-popup.delete",
|
|
878
1193
|
index: 1,
|
|
879
|
-
commandId:
|
|
1194
|
+
commandId: ht.id,
|
|
880
1195
|
commandParams: { unitId: t, drawings: [{ unitId: t, subUnitId: e, drawingId: n }] },
|
|
881
1196
|
disable: !1
|
|
882
1197
|
},
|
|
883
1198
|
{
|
|
884
1199
|
label: "image-popup.crop",
|
|
885
1200
|
index: 2,
|
|
886
|
-
commandId:
|
|
1201
|
+
commandId: ws.id,
|
|
887
1202
|
commandParams: { unitId: t, subUnitId: e, drawingId: n },
|
|
888
|
-
disable: r ===
|
|
1203
|
+
disable: r === x.DRAWING_DOM
|
|
889
1204
|
},
|
|
890
1205
|
{
|
|
891
1206
|
label: "image-popup.reset",
|
|
892
1207
|
index: 3,
|
|
893
|
-
commandId:
|
|
1208
|
+
commandId: _s.id,
|
|
894
1209
|
commandParams: [{ unitId: t, subUnitId: e, drawingId: n }],
|
|
895
|
-
disable: r ===
|
|
1210
|
+
disable: r === x.DRAWING_DOM
|
|
896
1211
|
}
|
|
897
1212
|
];
|
|
898
1213
|
}
|
|
899
1214
|
};
|
|
900
|
-
|
|
901
|
-
ce(0, A(
|
|
902
|
-
ce(1, A(
|
|
903
|
-
ce(2,
|
|
904
|
-
ce(3, A(
|
|
905
|
-
ce(4,
|
|
906
|
-
ce(5,
|
|
907
|
-
ce(6,
|
|
908
|
-
ce(7,
|
|
909
|
-
ce(8,
|
|
910
|
-
ce(9,
|
|
911
|
-
],
|
|
912
|
-
var
|
|
913
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1215
|
+
Nt = Ns([
|
|
1216
|
+
ce(0, A(qe)),
|
|
1217
|
+
ce(1, A(Te)),
|
|
1218
|
+
ce(2, oe),
|
|
1219
|
+
ce(3, A(ti)),
|
|
1220
|
+
ce(4, Q),
|
|
1221
|
+
ce(5, de),
|
|
1222
|
+
ce(6, Or),
|
|
1223
|
+
ce(7, ur),
|
|
1224
|
+
ce(8, hr),
|
|
1225
|
+
ce(9, Y)
|
|
1226
|
+
], Nt);
|
|
1227
|
+
var ks = Object.getOwnPropertyDescriptor, $s = (i, t, e, n) => {
|
|
1228
|
+
for (var r = n > 1 ? void 0 : n ? ks(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
914
1229
|
(o = i[s]) && (r = o(r) || r);
|
|
915
1230
|
return r;
|
|
916
|
-
},
|
|
917
|
-
let
|
|
1231
|
+
}, Tt = (i, t) => (e, n) => t(e, n, i);
|
|
1232
|
+
let In = class extends ee {
|
|
918
1233
|
constructor(t, e, n, r, s) {
|
|
919
1234
|
super();
|
|
920
|
-
|
|
1235
|
+
re(this, "_isSetCursor", !1);
|
|
921
1236
|
this._context = t, this._hoverManagerService = e, this._selectionsService = n, this._drawingRenderService = r, this._sheetSkeletonManagerService = s, this._initHover(), this._initImageClick();
|
|
922
1237
|
}
|
|
923
1238
|
_initHover() {
|
|
924
|
-
this.disposeWithMe(this._hoverManagerService.currentRichTextNoDistinct$.pipe(
|
|
1239
|
+
this.disposeWithMe(this._hoverManagerService.currentRichTextNoDistinct$.pipe(Is(33)).subscribe((t) => {
|
|
925
1240
|
var n, r;
|
|
926
1241
|
let e = [];
|
|
927
|
-
t !== null && (e = this._selectionsService.getWorkbookSelections(this._context.unitId).getCurrentSelections()), e.length > 0 && (t == null ? void 0 : t.unitId) === this._context.unitId && (t != null && t.drawing) && e.length === 1 && ((n = e[0].primary) == null ? void 0 : n.actualRow) === t.row && ((r = e[0].primary) == null ? void 0 : r.actualColumn) === t.col ? (this._isSetCursor = !0, this._context.scene.setCursor(
|
|
1242
|
+
t !== null && (e = this._selectionsService.getWorkbookSelections(this._context.unitId).getCurrentSelections()), e.length > 0 && (t == null ? void 0 : t.unitId) === this._context.unitId && (t != null && t.drawing) && e.length === 1 && ((n = e[0].primary) == null ? void 0 : n.actualRow) === t.row && ((r = e[0].primary) == null ? void 0 : r.actualColumn) === t.col ? (this._isSetCursor = !0, this._context.scene.setCursor(Qr.ZOOM_IN)) : this._isSetCursor && (this._isSetCursor = !1, this._context.scene.resetCursor());
|
|
928
1243
|
}));
|
|
929
1244
|
}
|
|
930
1245
|
_initImageClick() {
|
|
@@ -938,18 +1253,18 @@ let tn = class extends ne {
|
|
|
938
1253
|
}));
|
|
939
1254
|
}
|
|
940
1255
|
};
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
],
|
|
947
|
-
var
|
|
948
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1256
|
+
In = $s([
|
|
1257
|
+
Tt(1, A(ni)),
|
|
1258
|
+
Tt(2, A(ut)),
|
|
1259
|
+
Tt(3, A(Pr)),
|
|
1260
|
+
Tt(4, A(X))
|
|
1261
|
+
], In);
|
|
1262
|
+
var xs = Object.getOwnPropertyDescriptor, Ws = (i, t, e, n) => {
|
|
1263
|
+
for (var r = n > 1 ? void 0 : n ? xs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
949
1264
|
(o = i[s]) && (r = o(r) || r);
|
|
950
1265
|
return r;
|
|
951
|
-
},
|
|
952
|
-
let
|
|
1266
|
+
}, Ot = (i, t) => (e, n) => t(e, n, i);
|
|
1267
|
+
let Cn = class extends ee {
|
|
953
1268
|
constructor(i, t, e, n, r) {
|
|
954
1269
|
super(), this._context = i, this._sheetDrawingService = t, this._drawingManagerService = e, this._sheetSelectionRenderService = n, this._sheetSkeletonManagerService = r, this._init();
|
|
955
1270
|
}
|
|
@@ -963,27 +1278,27 @@ let nn = class extends ne {
|
|
|
963
1278
|
const e = i[t];
|
|
964
1279
|
for (const n in e.data) {
|
|
965
1280
|
const r = e.data[n];
|
|
966
|
-
r.sheetTransform && (r.transform =
|
|
1281
|
+
r.sheetTransform && (r.transform = J(r.sheetTransform, this._sheetSelectionRenderService, this._sheetSkeletonManagerService));
|
|
967
1282
|
}
|
|
968
1283
|
}
|
|
969
1284
|
this._drawingManagerService.registerDrawingData(this._context.unitId, this._sheetDrawingService.getDrawingDataForUnit(this._context.unitId)), this._drawingManagerService.initializeNotification(this._context.unitId);
|
|
970
1285
|
}
|
|
971
1286
|
};
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
],
|
|
978
|
-
var
|
|
979
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1287
|
+
Cn = Ws([
|
|
1288
|
+
Ot(1, se),
|
|
1289
|
+
Ot(2, oe),
|
|
1290
|
+
Ot(3, A(Je)),
|
|
1291
|
+
Ot(4, A(X))
|
|
1292
|
+
], Cn);
|
|
1293
|
+
var Bs = Object.getOwnPropertyDescriptor, js = (i, t, e, n) => {
|
|
1294
|
+
for (var r = n > 1 ? void 0 : n ? Bs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
980
1295
|
(o = i[s]) && (r = o(r) || r);
|
|
981
1296
|
return r;
|
|
982
|
-
},
|
|
983
|
-
function
|
|
1297
|
+
}, We = (i, t) => (e, n) => t(e, n, i);
|
|
1298
|
+
function Fr(i, t, e) {
|
|
984
1299
|
var n, r, s, o;
|
|
985
1300
|
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]], d =
|
|
1301
|
+
const a = e.p.drawings[e.p.drawingsOrder[0]], d = _n(
|
|
987
1302
|
i,
|
|
988
1303
|
{
|
|
989
1304
|
unitId: t.unitId,
|
|
@@ -1000,47 +1315,47 @@ function Sr(i, t, e) {
|
|
|
1000
1315
|
}
|
|
1001
1316
|
return !1;
|
|
1002
1317
|
}
|
|
1003
|
-
let
|
|
1318
|
+
let kt = class extends ee {
|
|
1004
1319
|
constructor(i, t, e, n, r, s) {
|
|
1005
1320
|
super(), this._commandService = i, this._sheetInterceptorService = t, this._injector = e, this._drawingManagerService = n, this._docDrawingController = r, this._editorBridgeService = s, this._handleInitEditor(), this._initCellContentInterceptor();
|
|
1006
1321
|
}
|
|
1007
1322
|
_handleInitEditor() {
|
|
1008
1323
|
this.disposeWithMe(this._editorBridgeService.visible$.subscribe((i) => {
|
|
1009
|
-
i.visible ? i.visible && (this._drawingManagerService.removeDrawingDataForUnit(
|
|
1324
|
+
i.visible ? i.visible && (this._drawingManagerService.removeDrawingDataForUnit(ot), this._docDrawingController.loadDrawingDataForUnit(ot), this._drawingManagerService.initializeNotification(ot)) : this._drawingManagerService.removeDrawingDataForUnit(ot);
|
|
1010
1325
|
})), this.disposeWithMe(this._commandService.onCommandExecuted((i) => {
|
|
1011
|
-
i.id ===
|
|
1326
|
+
i.id === Qi.id && i.params.unitId === Ve && (this._drawingManagerService.removeDrawingDataForUnit(Ve), this._docDrawingController.loadDrawingDataForUnit(Ve), this._drawingManagerService.initializeNotification(Ve));
|
|
1012
1327
|
}));
|
|
1013
1328
|
}
|
|
1014
1329
|
_initCellContentInterceptor() {
|
|
1015
1330
|
this.disposeWithMe(
|
|
1016
1331
|
this._sheetInterceptorService.intercept(
|
|
1017
|
-
|
|
1332
|
+
Ai.CELL_CONTENT,
|
|
1018
1333
|
{
|
|
1019
|
-
effect:
|
|
1020
|
-
priority:
|
|
1334
|
+
effect: mi.Style,
|
|
1335
|
+
priority: Ni.CELL_IMAGE,
|
|
1021
1336
|
handler: (i, t, e) => {
|
|
1022
1337
|
var n;
|
|
1023
|
-
return i != null && i.p && ((n = i.p.drawingsOrder) != null && n.length) && (i === t.rawData && (i = { ...t.rawData }), i.interceptorStyle || (i.interceptorStyle = {}), i.interceptorStyle.tr = { a: 0 },
|
|
1338
|
+
return i != null && i.p && ((n = i.p.drawingsOrder) != null && n.length) && (i === t.rawData && (i = { ...t.rawData }), i.interceptorStyle || (i.interceptorStyle = {}), i.interceptorStyle.tr = { a: 0 }, Fr(this._injector, { unitId: t.unitId, subUnitId: t.subUnitId, row: t.row, col: t.col }, i)), e(i);
|
|
1024
1339
|
}
|
|
1025
1340
|
}
|
|
1026
1341
|
)
|
|
1027
1342
|
);
|
|
1028
1343
|
}
|
|
1029
1344
|
};
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
],
|
|
1038
|
-
var
|
|
1039
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1345
|
+
kt = js([
|
|
1346
|
+
We(0, Y),
|
|
1347
|
+
We(1, A(Ht)),
|
|
1348
|
+
We(2, A(qe)),
|
|
1349
|
+
We(3, oe),
|
|
1350
|
+
We(4, A(gs)),
|
|
1351
|
+
We(5, A(ri))
|
|
1352
|
+
], kt);
|
|
1353
|
+
var Fs = Object.getOwnPropertyDescriptor, Ls = (i, t, e, n) => {
|
|
1354
|
+
for (var r = n > 1 ? void 0 : n ? Fs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
1040
1355
|
(o = i[s]) && (r = o(r) || r);
|
|
1041
1356
|
return r;
|
|
1042
|
-
},
|
|
1043
|
-
let
|
|
1357
|
+
}, or = (i, t) => (e, n) => t(e, n, i);
|
|
1358
|
+
let $t = class extends ee {
|
|
1044
1359
|
constructor(i, t) {
|
|
1045
1360
|
super(), this._autoFillService = i, this._injector = t, this._initAutoFillHooks();
|
|
1046
1361
|
}
|
|
@@ -1049,35 +1364,35 @@ let Mt = class extends ne {
|
|
|
1049
1364
|
this._autoFillService.addHook({
|
|
1050
1365
|
id: "sheet-cell-image-autofill",
|
|
1051
1366
|
onBeforeSubmit: (i, t, e, n) => {
|
|
1052
|
-
new
|
|
1053
|
-
|
|
1367
|
+
new fi(n).forValue((r, s, o) => {
|
|
1368
|
+
Fr(this._injector, { unitId: i.unitId, subUnitId: i.subUnitId, row: r, col: s }, o);
|
|
1054
1369
|
});
|
|
1055
1370
|
}
|
|
1056
1371
|
})
|
|
1057
1372
|
);
|
|
1058
1373
|
}
|
|
1059
1374
|
};
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
],
|
|
1064
|
-
var
|
|
1065
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1375
|
+
$t = Ls([
|
|
1376
|
+
or(0, A(ii)),
|
|
1377
|
+
or(1, A(qe))
|
|
1378
|
+
], $t);
|
|
1379
|
+
var Hs = Object.getOwnPropertyDescriptor, Vs = (i, t, e, n) => {
|
|
1380
|
+
for (var r = n > 1 ? void 0 : n ? Hs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
1066
1381
|
(o = i[s]) && (r = o(r) || r);
|
|
1067
1382
|
return r;
|
|
1068
|
-
},
|
|
1069
|
-
const
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1383
|
+
}, nt = (i, t) => (e, n) => t(e, n, i);
|
|
1384
|
+
const Ys = [
|
|
1385
|
+
ot,
|
|
1386
|
+
pi,
|
|
1387
|
+
Ve
|
|
1073
1388
|
];
|
|
1074
|
-
let
|
|
1389
|
+
let xt = class extends ee {
|
|
1075
1390
|
constructor(i, t, e, n, r) {
|
|
1076
1391
|
super(), this._commandService = i, this._univerInstanceService = t, this._dialogService = e, this._renderManagerService = n, this._localeService = r, this._initDocImageCopyPasteHooks();
|
|
1077
1392
|
}
|
|
1078
1393
|
_setCellImage(i) {
|
|
1079
1394
|
var r;
|
|
1080
|
-
const t =
|
|
1395
|
+
const t = un("", {}), e = (r = Dn(k.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : r.with(si), n = hn.drawing.add({
|
|
1081
1396
|
documentDataModel: t,
|
|
1082
1397
|
drawings: [i],
|
|
1083
1398
|
selection: {
|
|
@@ -1092,20 +1407,20 @@ let yt = class extends ne {
|
|
|
1092
1407
|
this.disposeWithMe(
|
|
1093
1408
|
this._commandService.beforeCommandExecuted((i) => {
|
|
1094
1409
|
var t, e;
|
|
1095
|
-
if (i.id ===
|
|
1096
|
-
const n = i.params, { doc: r } = n, s = this._univerInstanceService.getCurrentUnitOfType(
|
|
1410
|
+
if (i.id === es.id) {
|
|
1411
|
+
const n = i.params, { doc: r } = n, s = this._univerInstanceService.getCurrentUnitOfType(k.UNIVER_DOC);
|
|
1097
1412
|
if (s == null || !Object.keys((t = r.drawings) != null ? t : {}).length)
|
|
1098
1413
|
return;
|
|
1099
1414
|
const o = s.getUnitId();
|
|
1100
|
-
if (
|
|
1101
|
-
if (o !==
|
|
1415
|
+
if (Ys.includes(o)) {
|
|
1416
|
+
if (o !== Ve) {
|
|
1102
1417
|
const a = () => {
|
|
1103
|
-
this._dialogService.close("sheet-cell-image-copy-paste"), this._commandService.syncExecuteCommand(
|
|
1418
|
+
this._dialogService.close("sheet-cell-image-copy-paste"), this._commandService.syncExecuteCommand(Nn.id, {
|
|
1104
1419
|
visible: !1
|
|
1105
1420
|
});
|
|
1106
1421
|
};
|
|
1107
1422
|
((e = s.getBody()) == null ? void 0 : e.dataStream) === `\r
|
|
1108
|
-
` ? (this._commandService.syncExecuteCommand(
|
|
1423
|
+
` ? (this._commandService.syncExecuteCommand(Nn.id, {
|
|
1109
1424
|
visible: !1
|
|
1110
1425
|
}), this._setCellImage(Object.values(r.drawings)[0])) : this._dialogService.open({
|
|
1111
1426
|
id: "sheet-cell-image-copy-paste",
|
|
@@ -1133,32 +1448,32 @@ let yt = class extends ne {
|
|
|
1133
1448
|
);
|
|
1134
1449
|
}
|
|
1135
1450
|
};
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
],
|
|
1143
|
-
var
|
|
1144
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1451
|
+
xt = Vs([
|
|
1452
|
+
nt(0, Y),
|
|
1453
|
+
nt(1, de),
|
|
1454
|
+
nt(2, bn),
|
|
1455
|
+
nt(3, Q),
|
|
1456
|
+
nt(4, A(Te))
|
|
1457
|
+
], xt);
|
|
1458
|
+
var Gs = Object.getOwnPropertyDescriptor, Xs = (i, t, e, n) => {
|
|
1459
|
+
for (var r = n > 1 ? void 0 : n ? Gs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
1145
1460
|
(o = i[s]) && (r = o(r) || r);
|
|
1146
1461
|
return r;
|
|
1147
|
-
},
|
|
1148
|
-
const
|
|
1149
|
-
function
|
|
1462
|
+
}, rt = (i, t) => (e, n) => t(e, n, i);
|
|
1463
|
+
const Lr = "image/png";
|
|
1464
|
+
function zs(i) {
|
|
1150
1465
|
const t = i.split(","), e = atob(t[1]), n = e.length, r = new Uint8Array(n);
|
|
1151
1466
|
for (let s = 0; s < n; s++)
|
|
1152
1467
|
r[s] = e.charCodeAt(s);
|
|
1153
|
-
return new Blob([r], { type:
|
|
1468
|
+
return new Blob([r], { type: Lr });
|
|
1154
1469
|
}
|
|
1155
|
-
function
|
|
1156
|
-
const t = new ClipboardItem({ [
|
|
1470
|
+
function Ks(i) {
|
|
1471
|
+
const t = new ClipboardItem({ [Lr]: zs(i) });
|
|
1157
1472
|
navigator.clipboard.write([t]).catch((e) => {
|
|
1158
1473
|
console.error("Could not copy image using clipboard API: ", e);
|
|
1159
1474
|
});
|
|
1160
1475
|
}
|
|
1161
|
-
function
|
|
1476
|
+
function Js() {
|
|
1162
1477
|
function i() {
|
|
1163
1478
|
const n = document.createElement("input");
|
|
1164
1479
|
return n.style.position = "absolute", n.style.height = "1px", n.style.width = "1px", n.style.opacity = "0", n;
|
|
@@ -1168,16 +1483,16 @@ function Ds() {
|
|
|
1168
1483
|
e.blur(), document.body.removeChild(e), t instanceof HTMLElement && t.focus();
|
|
1169
1484
|
};
|
|
1170
1485
|
}
|
|
1171
|
-
const
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1486
|
+
const ar = [
|
|
1487
|
+
Le.SPECIAL_PASTE_COL_WIDTH,
|
|
1488
|
+
Le.SPECIAL_PASTE_VALUE,
|
|
1489
|
+
Le.SPECIAL_PASTE_FORMAT,
|
|
1490
|
+
Le.SPECIAL_PASTE_FORMULA
|
|
1176
1491
|
];
|
|
1177
|
-
let
|
|
1492
|
+
let Wt = class extends ee {
|
|
1178
1493
|
constructor(t, e, n, r, s) {
|
|
1179
1494
|
super();
|
|
1180
|
-
|
|
1495
|
+
re(this, "_copyInfo");
|
|
1181
1496
|
this._sheetClipboardService = t, this._renderManagerService = e, this._drawingService = n, this._clipboardInterfaceService = r, this._commandService = s, this._initCopyPaste();
|
|
1182
1497
|
}
|
|
1183
1498
|
get _focusedDrawings() {
|
|
@@ -1192,18 +1507,18 @@ let Tt = class extends ne {
|
|
|
1192
1507
|
const s = this._focusedDrawings;
|
|
1193
1508
|
if (s.length > 0) {
|
|
1194
1509
|
const [o] = s;
|
|
1195
|
-
if (o.drawingType !==
|
|
1510
|
+
if (o.drawingType !== x.DRAWING_IMAGE)
|
|
1196
1511
|
return;
|
|
1197
|
-
if (r ===
|
|
1512
|
+
if (r === Re.CUT) {
|
|
1198
1513
|
const d = {
|
|
1199
1514
|
unitId: t,
|
|
1200
1515
|
drawings: [o]
|
|
1201
1516
|
};
|
|
1202
|
-
this._commandService.executeCommand(
|
|
1517
|
+
this._commandService.executeCommand(ht.id, d);
|
|
1203
1518
|
}
|
|
1204
1519
|
setTimeout(() => {
|
|
1205
|
-
const d =
|
|
1206
|
-
o.drawingType ===
|
|
1520
|
+
const d = Js();
|
|
1521
|
+
o.drawingType === x.DRAWING_IMAGE && o.imageSourceType === ns.BASE64 ? Ks(o.source) : this._clipboardInterfaceService.writeText(""), d();
|
|
1207
1522
|
}, 200);
|
|
1208
1523
|
const a = {
|
|
1209
1524
|
unitId: o.unitId,
|
|
@@ -1219,14 +1534,14 @@ let Tt = class extends ne {
|
|
|
1219
1534
|
onPasteCells: (t, e, n, r) => {
|
|
1220
1535
|
if (!this._copyInfo)
|
|
1221
1536
|
return { redos: [], undos: [] };
|
|
1222
|
-
const { copyType: s =
|
|
1223
|
-
return this._copyInfo.copyRange ? this._generateRangeDrawingsPasteMutations({ pasteType: o, unitId: u, subUnitId: c, pasteRange: d }, { copyRange: a, copyType: s }) : this._generateSingleDrawingPasteMutations({ pasteTo: e, pasteType: o },
|
|
1537
|
+
const { copyType: s = Re.COPY, pasteType: o } = r, { range: a } = t || {}, { range: d, unitId: u, subUnitId: c } = e;
|
|
1538
|
+
return this._copyInfo.copyRange ? this._generateRangeDrawingsPasteMutations({ pasteType: o, unitId: u, subUnitId: c, pasteRange: d }, { copyRange: a, copyType: s }) : this._generateSingleDrawingPasteMutations({ pasteTo: e, pasteType: o }, Re.COPY);
|
|
1224
1539
|
},
|
|
1225
1540
|
onPastePlainText: (t, e) => ({ undos: [], redos: [] }),
|
|
1226
|
-
onPasteUnrecognized: (t) => this._copyInfo ? this._generateSingleDrawingPasteMutations({ pasteTo: t, pasteType:
|
|
1541
|
+
onPasteUnrecognized: (t) => this._copyInfo ? this._generateSingleDrawingPasteMutations({ pasteTo: t, pasteType: Le.DEFAULT_PASTE }, Re.COPY) : { undos: [], redos: [] },
|
|
1227
1542
|
onPasteFiles: (t, e) => {
|
|
1228
1543
|
if (this._copyInfo)
|
|
1229
|
-
return this._generateSingleDrawingPasteMutations({ pasteTo: t, pasteType:
|
|
1544
|
+
return this._generateSingleDrawingPasteMutations({ pasteTo: t, pasteType: Le.DEFAULT_PASTE }, Re.COPY);
|
|
1230
1545
|
{
|
|
1231
1546
|
const n = e.filter((r) => r.type.includes("image"));
|
|
1232
1547
|
if (n.length)
|
|
@@ -1234,7 +1549,7 @@ let Tt = class extends ne {
|
|
|
1234
1549
|
undos: [],
|
|
1235
1550
|
redos: [
|
|
1236
1551
|
{
|
|
1237
|
-
id:
|
|
1552
|
+
id: Kt.id,
|
|
1238
1553
|
params: { files: n }
|
|
1239
1554
|
}
|
|
1240
1555
|
]
|
|
@@ -1246,26 +1561,26 @@ let Tt = class extends ne {
|
|
|
1246
1561
|
}
|
|
1247
1562
|
_createDrawingsCopyInfoByRange(t, e, n) {
|
|
1248
1563
|
var g;
|
|
1249
|
-
const r = (g = this._renderManagerService.getRenderById(t)) == null ? void 0 : g.with(
|
|
1564
|
+
const r = (g = this._renderManagerService.getRenderById(t)) == null ? void 0 : g.with(X);
|
|
1250
1565
|
if (!r) return;
|
|
1251
1566
|
const s = r.attachRangeWithCoord(n);
|
|
1252
1567
|
if (!s)
|
|
1253
1568
|
return;
|
|
1254
1569
|
const { startX: o, endX: a, startY: d, endY: u } = s, c = this._drawingService.getDrawingData(t, e), l = this._focusedDrawings.slice();
|
|
1255
1570
|
if (Object.keys(c).forEach((h) => {
|
|
1256
|
-
const
|
|
1257
|
-
if (
|
|
1571
|
+
const m = c[h];
|
|
1572
|
+
if (m.drawingType !== x.DRAWING_IMAGE)
|
|
1258
1573
|
return;
|
|
1259
|
-
const { transform:
|
|
1260
|
-
if (
|
|
1574
|
+
const { transform: f } = m;
|
|
1575
|
+
if (m.anchorType !== O.Both || !f)
|
|
1261
1576
|
return;
|
|
1262
|
-
const { left:
|
|
1263
|
-
drawingStartX:
|
|
1264
|
-
drawingEndX:
|
|
1265
|
-
drawingStartY:
|
|
1266
|
-
drawingEndY:
|
|
1577
|
+
const { left: p = 0, top: w = 0, width: S = 0, height: I = 0 } = f, { drawingStartX: D, drawingEndX: v, drawingStartY: C, drawingEndY: _ } = {
|
|
1578
|
+
drawingStartX: p,
|
|
1579
|
+
drawingEndX: p + S,
|
|
1580
|
+
drawingStartY: w,
|
|
1581
|
+
drawingEndY: w + I
|
|
1267
1582
|
};
|
|
1268
|
-
o <=
|
|
1583
|
+
o <= D && v <= a && d <= C && _ <= u && l.push(m);
|
|
1269
1584
|
}), l.length)
|
|
1270
1585
|
return {
|
|
1271
1586
|
copyRange: n,
|
|
@@ -1276,31 +1591,31 @@ let Tt = class extends ne {
|
|
|
1276
1591
|
}
|
|
1277
1592
|
_generateSingleDrawingPasteMutations(t, e) {
|
|
1278
1593
|
const { pasteType: n, pasteTo: r } = t;
|
|
1279
|
-
if (
|
|
1594
|
+
if (ar.includes(n))
|
|
1280
1595
|
return { redos: [], undos: [] };
|
|
1281
|
-
const { unitId: s, subUnitId: o, range: a } = r, d = this._renderManagerService.getRenderById(s), u = d == null ? void 0 : d.with(
|
|
1596
|
+
const { unitId: s, subUnitId: o, range: a } = r, d = this._renderManagerService.getRenderById(s), u = d == null ? void 0 : d.with(X), c = d == null ? void 0 : d.with(Je), l = this._copyInfo;
|
|
1282
1597
|
if (!u || !c)
|
|
1283
1598
|
return { redos: [], undos: [] };
|
|
1284
|
-
const { drawings: g } = l, h =
|
|
1599
|
+
const { drawings: g } = l, h = kn(a);
|
|
1285
1600
|
return this._generateMutations(g, {
|
|
1286
1601
|
unitId: s,
|
|
1287
1602
|
subUnitId: o,
|
|
1288
|
-
isCut: e ===
|
|
1289
|
-
getTransform: (
|
|
1290
|
-
var
|
|
1291
|
-
const
|
|
1603
|
+
isCut: e === Re.CUT,
|
|
1604
|
+
getTransform: (m, f) => {
|
|
1605
|
+
var S;
|
|
1606
|
+
const p = u.attachRangeWithCoord({
|
|
1292
1607
|
startRow: h.startRow,
|
|
1293
1608
|
endRow: h.endRow,
|
|
1294
1609
|
startColumn: h.startColumn,
|
|
1295
1610
|
endColumn: h.endColumn
|
|
1296
|
-
}),
|
|
1297
|
-
...
|
|
1298
|
-
left:
|
|
1299
|
-
top:
|
|
1611
|
+
}), w = {
|
|
1612
|
+
...m,
|
|
1613
|
+
left: p == null ? void 0 : p.startX,
|
|
1614
|
+
top: p == null ? void 0 : p.startY
|
|
1300
1615
|
};
|
|
1301
1616
|
return {
|
|
1302
|
-
transform:
|
|
1303
|
-
sheetTransform: (
|
|
1617
|
+
transform: w,
|
|
1618
|
+
sheetTransform: (S = j(w, c)) != null ? S : f
|
|
1304
1619
|
};
|
|
1305
1620
|
}
|
|
1306
1621
|
});
|
|
@@ -1316,24 +1631,24 @@ let Tt = class extends ne {
|
|
|
1316
1631
|
const { transform: l, sheetTransform: g } = c;
|
|
1317
1632
|
if (!l)
|
|
1318
1633
|
return;
|
|
1319
|
-
const h = s(l, g),
|
|
1634
|
+
const h = s(l, g), m = {
|
|
1320
1635
|
...c,
|
|
1321
1636
|
unitId: n,
|
|
1322
1637
|
subUnitId: r,
|
|
1323
|
-
drawingId: o ? c.drawingId :
|
|
1638
|
+
drawingId: o ? c.drawingId : He(),
|
|
1324
1639
|
transform: h.transform,
|
|
1325
1640
|
sheetTransform: h.sheetTransform
|
|
1326
1641
|
};
|
|
1327
1642
|
if (o) {
|
|
1328
|
-
const { undo:
|
|
1643
|
+
const { undo: f, redo: p, objects: w } = u.getBatchUpdateOp([m]);
|
|
1329
1644
|
a.push({
|
|
1330
1645
|
id: P.id,
|
|
1331
1646
|
params: {
|
|
1332
1647
|
unitId: n,
|
|
1333
1648
|
subUnitId: r,
|
|
1334
1649
|
type: U.UPDATE,
|
|
1335
|
-
op:
|
|
1336
|
-
objects:
|
|
1650
|
+
op: p,
|
|
1651
|
+
objects: w
|
|
1337
1652
|
}
|
|
1338
1653
|
}), d.push({
|
|
1339
1654
|
id: P.id,
|
|
@@ -1341,13 +1656,13 @@ let Tt = class extends ne {
|
|
|
1341
1656
|
unitId: n,
|
|
1342
1657
|
subUnitId: r,
|
|
1343
1658
|
type: U.UPDATE,
|
|
1344
|
-
op:
|
|
1345
|
-
objects:
|
|
1659
|
+
op: f,
|
|
1660
|
+
objects: w
|
|
1346
1661
|
}
|
|
1347
1662
|
});
|
|
1348
1663
|
} else {
|
|
1349
|
-
const { undo:
|
|
1350
|
-
a.push({ id: P.id, params: { op:
|
|
1664
|
+
const { undo: f, redo: p, objects: w } = u.getBatchAddOp([m]);
|
|
1665
|
+
a.push({ id: P.id, params: { op: p, unitId: n, subUnitId: r, objects: w, type: U.INSERT } }), d.push({ id: P.id, params: { op: f, unitId: n, subUnitId: r, objects: w, type: U.REMOVE } });
|
|
1351
1666
|
}
|
|
1352
1667
|
}), { redos: a, undos: d };
|
|
1353
1668
|
}
|
|
@@ -1363,94 +1678,94 @@ let Tt = class extends ne {
|
|
|
1363
1678
|
copyRange: a,
|
|
1364
1679
|
copyType: d
|
|
1365
1680
|
} = e;
|
|
1366
|
-
if (
|
|
1681
|
+
if (ar.includes(s))
|
|
1367
1682
|
return { redos: [], undos: [] };
|
|
1368
|
-
const u = (y = this._renderManagerService.getRenderById(n)) == null ? void 0 : y.with(
|
|
1683
|
+
const u = (y = this._renderManagerService.getRenderById(n)) == null ? void 0 : y.with(X);
|
|
1369
1684
|
if (!u || !this._copyInfo)
|
|
1370
1685
|
return { redos: [], undos: [] };
|
|
1371
1686
|
const { drawings: c } = this._copyInfo;
|
|
1372
1687
|
if (!a)
|
|
1373
1688
|
return this._generateSingleDrawingPasteMutations({
|
|
1374
|
-
pasteTo: { unitId: n, subUnitId: r, range:
|
|
1689
|
+
pasteTo: { unitId: n, subUnitId: r, range: kn(o) },
|
|
1375
1690
|
pasteType: s
|
|
1376
1691
|
}, d);
|
|
1377
|
-
const { ranges: [l, g], mapFunc: h } =
|
|
1378
|
-
startRow: f,
|
|
1379
|
-
endRow: f,
|
|
1380
|
-
startColumn: p,
|
|
1381
|
-
endColumn: p
|
|
1382
|
-
}), I = u.attachRangeWithCoord({
|
|
1692
|
+
const { ranges: [l, g], mapFunc: h } = oi([a, o]), { row: m, col: f } = h(l.startRow, l.startColumn), { row: p, col: w } = h(g.startRow, g.startColumn), S = u.attachRangeWithCoord({
|
|
1383
1693
|
startRow: m,
|
|
1384
1694
|
endRow: m,
|
|
1385
|
-
startColumn:
|
|
1386
|
-
endColumn:
|
|
1695
|
+
startColumn: f,
|
|
1696
|
+
endColumn: f
|
|
1697
|
+
}), I = u.attachRangeWithCoord({
|
|
1698
|
+
startRow: p,
|
|
1699
|
+
endRow: p,
|
|
1700
|
+
startColumn: w,
|
|
1701
|
+
endColumn: w
|
|
1387
1702
|
});
|
|
1388
|
-
if (!
|
|
1703
|
+
if (!S || !I || !this._copyInfo)
|
|
1389
1704
|
return { redos: [], undos: [] };
|
|
1390
|
-
const
|
|
1705
|
+
const D = I.startX - S.startX, v = I.startY - S.startY, C = p - m, _ = w - f;
|
|
1391
1706
|
return this._generateMutations(c, {
|
|
1392
1707
|
unitId: n,
|
|
1393
1708
|
subUnitId: r,
|
|
1394
|
-
getTransform: (
|
|
1395
|
-
var
|
|
1709
|
+
getTransform: (R, E) => {
|
|
1710
|
+
var T, M;
|
|
1396
1711
|
return {
|
|
1397
1712
|
transform: {
|
|
1398
|
-
...
|
|
1399
|
-
left: ((
|
|
1400
|
-
top: ((M =
|
|
1713
|
+
...R,
|
|
1714
|
+
left: ((T = R == null ? void 0 : R.left) != null ? T : 0) + D,
|
|
1715
|
+
top: ((M = R == null ? void 0 : R.top) != null ? M : 0) + v
|
|
1401
1716
|
},
|
|
1402
1717
|
sheetTransform: {
|
|
1403
|
-
...
|
|
1718
|
+
...E,
|
|
1404
1719
|
to: {
|
|
1405
|
-
...
|
|
1406
|
-
row:
|
|
1407
|
-
column:
|
|
1720
|
+
...E.to,
|
|
1721
|
+
row: E.to.row + C,
|
|
1722
|
+
column: E.to.column + _
|
|
1408
1723
|
},
|
|
1409
1724
|
from: {
|
|
1410
|
-
...
|
|
1411
|
-
row:
|
|
1412
|
-
column:
|
|
1725
|
+
...E.from,
|
|
1726
|
+
row: E.from.row + C,
|
|
1727
|
+
column: E.from.column + _
|
|
1413
1728
|
}
|
|
1414
1729
|
}
|
|
1415
1730
|
};
|
|
1416
1731
|
},
|
|
1417
|
-
isCut: d ===
|
|
1732
|
+
isCut: d === Re.CUT
|
|
1418
1733
|
});
|
|
1419
1734
|
}
|
|
1420
1735
|
};
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
],
|
|
1428
|
-
var
|
|
1429
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1736
|
+
Wt = Xs([
|
|
1737
|
+
rt(0, ai),
|
|
1738
|
+
rt(1, Q),
|
|
1739
|
+
rt(2, oe),
|
|
1740
|
+
rt(3, os),
|
|
1741
|
+
rt(4, Y)
|
|
1742
|
+
], Wt);
|
|
1743
|
+
var Zs = Object.getOwnPropertyDescriptor, qs = (i, t, e, n) => {
|
|
1744
|
+
for (var r = n > 1 ? void 0 : n ? Zs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
1430
1745
|
(o = i[s]) && (r = o(r) || r);
|
|
1431
1746
|
return r;
|
|
1432
|
-
},
|
|
1433
|
-
let
|
|
1747
|
+
}, it = (i, t) => (e, n) => t(e, n, i);
|
|
1748
|
+
let Bt = class extends ee {
|
|
1434
1749
|
constructor(i, t, e, n, r) {
|
|
1435
1750
|
super(), this._drawingManagerService = i, this._renderManagerService = t, this._permissionService = e, this._univerInstanceService = n, this._userManagerService = r, this._initDrawingVisible(), this._initDrawingEditable(), this._initViewPermissionChange(), this._initEditPermissionChange();
|
|
1436
1751
|
}
|
|
1437
1752
|
_initDrawingVisible() {
|
|
1438
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1753
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(k.UNIVER_SHEET), t = this._userManagerService.currentUser$, e = at([i, t]);
|
|
1439
1754
|
this.disposeWithMe(
|
|
1440
1755
|
e.pipe(
|
|
1441
|
-
|
|
1442
|
-
|
|
1756
|
+
fe(([n, r]) => n ? n.activeSheet$.pipe(
|
|
1757
|
+
er((s) => {
|
|
1443
1758
|
if (!s) {
|
|
1444
1759
|
this._drawingManagerService.setDrawingVisible(!1);
|
|
1445
1760
|
return;
|
|
1446
1761
|
}
|
|
1447
1762
|
const o = n.getUnitId(), a = s.getSheetId();
|
|
1448
1763
|
this._permissionService.composePermission([
|
|
1449
|
-
new
|
|
1450
|
-
new
|
|
1764
|
+
new Hn(o).id,
|
|
1765
|
+
new Vn(o, a).id
|
|
1451
1766
|
]).every((u) => u.value) ? this._drawingManagerService.setDrawingVisible(!0) : this._handleDrawingVisibilityFalse(n, s);
|
|
1452
1767
|
})
|
|
1453
|
-
) : (this._drawingManagerService.setDrawingVisible(!1),
|
|
1768
|
+
) : (this._drawingManagerService.setDrawingVisible(!1), we))
|
|
1454
1769
|
).subscribe()
|
|
1455
1770
|
);
|
|
1456
1771
|
}
|
|
@@ -1460,26 +1775,26 @@ let Et = class extends ne {
|
|
|
1460
1775
|
if (!a)
|
|
1461
1776
|
return;
|
|
1462
1777
|
a.getAllObjectsByOrder().forEach((u) => {
|
|
1463
|
-
u.classType ===
|
|
1778
|
+
u.classType === ke.IMAGE && s.some((c) => u.oKey.includes(c.drawingId)) && a.removeObject(u);
|
|
1464
1779
|
});
|
|
1465
1780
|
}
|
|
1466
1781
|
_initDrawingEditable() {
|
|
1467
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1782
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(k.UNIVER_SHEET), t = this._userManagerService.currentUser$, e = at([i, t]);
|
|
1468
1783
|
this.disposeWithMe(
|
|
1469
1784
|
e.pipe(
|
|
1470
|
-
|
|
1471
|
-
|
|
1785
|
+
fe(([n, r]) => n ? n.activeSheet$.pipe(
|
|
1786
|
+
er((s) => {
|
|
1472
1787
|
if (!s) {
|
|
1473
1788
|
this._drawingManagerService.setDrawingEditable(!1);
|
|
1474
1789
|
return;
|
|
1475
1790
|
}
|
|
1476
1791
|
const o = n.getUnitId(), a = s.getSheetId();
|
|
1477
1792
|
this._permissionService.composePermission([
|
|
1478
|
-
new
|
|
1479
|
-
new
|
|
1793
|
+
new gn(o).id,
|
|
1794
|
+
new mn(o, a).id
|
|
1480
1795
|
]).every((u) => u.value) ? this._drawingManagerService.setDrawingEditable(!0) : this._handleDrawingEditableFalse(n, s);
|
|
1481
1796
|
})
|
|
1482
|
-
) : (this._drawingManagerService.setDrawingEditable(!1),
|
|
1797
|
+
) : (this._drawingManagerService.setDrawingEditable(!1), we))
|
|
1483
1798
|
).subscribe()
|
|
1484
1799
|
);
|
|
1485
1800
|
}
|
|
@@ -1489,29 +1804,29 @@ let Et = class extends ne {
|
|
|
1489
1804
|
if (!a)
|
|
1490
1805
|
return;
|
|
1491
1806
|
a.getAllObjectsByOrder().forEach((u) => {
|
|
1492
|
-
u.classType ===
|
|
1807
|
+
u.classType === ke.IMAGE && s.some((c) => u.oKey.includes(c.drawingId)) && a.detachTransformerFrom(u);
|
|
1493
1808
|
});
|
|
1494
1809
|
}
|
|
1495
1810
|
_initViewPermissionChange() {
|
|
1496
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1811
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(k.UNIVER_SHEET), t = this._userManagerService.currentUser$;
|
|
1497
1812
|
this.disposeWithMe(
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1813
|
+
at([i, t]).pipe(
|
|
1814
|
+
fe(([e, n]) => e ? e.activeSheet$.pipe(
|
|
1815
|
+
fe((r) => {
|
|
1501
1816
|
if (!r)
|
|
1502
|
-
return
|
|
1817
|
+
return we;
|
|
1503
1818
|
const s = e.getUnitId(), o = r.getSheetId(), a = this._renderManagerService.getRenderById(s), d = a == null ? void 0 : a.scene;
|
|
1504
1819
|
if (!d)
|
|
1505
|
-
return
|
|
1820
|
+
return we;
|
|
1506
1821
|
const u = d.getTransformerByCreate();
|
|
1507
1822
|
return this._permissionService.composePermission$([
|
|
1508
|
-
new
|
|
1509
|
-
new
|
|
1823
|
+
new Hn(s).id,
|
|
1824
|
+
new Vn(s, o).id
|
|
1510
1825
|
]).pipe(
|
|
1511
|
-
|
|
1512
|
-
|
|
1826
|
+
pe((l) => l.every((g) => g.value)),
|
|
1827
|
+
tr()
|
|
1513
1828
|
).pipe(
|
|
1514
|
-
|
|
1829
|
+
pe((l) => ({
|
|
1515
1830
|
permission: l,
|
|
1516
1831
|
scene: d,
|
|
1517
1832
|
transformer: u,
|
|
@@ -1520,18 +1835,18 @@ let Et = class extends ne {
|
|
|
1520
1835
|
}))
|
|
1521
1836
|
);
|
|
1522
1837
|
})
|
|
1523
|
-
) :
|
|
1838
|
+
) : we)
|
|
1524
1839
|
).subscribe({
|
|
1525
1840
|
next: ({ permission: e, scene: n, transformer: r, unitId: s, subUnitId: o }) => {
|
|
1526
1841
|
this._drawingManagerService.setDrawingVisible(e);
|
|
1527
1842
|
const a = n.getAllObjectsByOrder(), d = this._drawingManagerService.getDrawingData(s, o), u = Object.values(d);
|
|
1528
1843
|
e ? this._drawingManagerService.addNotification(u) : (a.forEach((c) => {
|
|
1529
|
-
c.classType ===
|
|
1844
|
+
c.classType === ke.IMAGE && u.some((l) => c.oKey.includes(l.drawingId)) && n.removeObject(c);
|
|
1530
1845
|
}), r.clearSelectedObjects());
|
|
1531
1846
|
},
|
|
1532
1847
|
complete: () => {
|
|
1533
1848
|
this._drawingManagerService.setDrawingVisible(!0);
|
|
1534
|
-
const e = this._univerInstanceService.getCurrentUnitForType(
|
|
1849
|
+
const e = this._univerInstanceService.getCurrentUnitForType(k.UNIVER_SHEET), n = e == null ? void 0 : e.getActiveSheet(), r = e == null ? void 0 : e.getUnitId(), s = n == null ? void 0 : n.getSheetId();
|
|
1535
1850
|
if (!r || !s)
|
|
1536
1851
|
return;
|
|
1537
1852
|
const o = this._drawingManagerService.getDrawingData(r, s), a = Object.values(o);
|
|
@@ -1541,25 +1856,25 @@ let Et = class extends ne {
|
|
|
1541
1856
|
);
|
|
1542
1857
|
}
|
|
1543
1858
|
_initEditPermissionChange() {
|
|
1544
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1859
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(k.UNIVER_SHEET), t = this._userManagerService.currentUser$;
|
|
1545
1860
|
this.disposeWithMe(
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1861
|
+
at([i, t]).pipe(
|
|
1862
|
+
fe(([e, n]) => e ? e.activeSheet$.pipe(
|
|
1863
|
+
fe((r) => {
|
|
1549
1864
|
if (!r)
|
|
1550
|
-
return
|
|
1865
|
+
return we;
|
|
1551
1866
|
const s = e.getUnitId(), o = r.getSheetId(), a = this._renderManagerService.getRenderById(s), d = a == null ? void 0 : a.scene;
|
|
1552
1867
|
if (!d)
|
|
1553
|
-
return
|
|
1868
|
+
return we;
|
|
1554
1869
|
const u = d.getTransformerByCreate();
|
|
1555
1870
|
return this._permissionService.composePermission$([
|
|
1556
|
-
new
|
|
1557
|
-
new
|
|
1871
|
+
new gn(s).id,
|
|
1872
|
+
new mn(s, o).id
|
|
1558
1873
|
]).pipe(
|
|
1559
|
-
|
|
1560
|
-
|
|
1874
|
+
pe((l) => l.every((g) => g.value)),
|
|
1875
|
+
tr()
|
|
1561
1876
|
).pipe(
|
|
1562
|
-
|
|
1877
|
+
pe((l) => ({
|
|
1563
1878
|
permission: l,
|
|
1564
1879
|
scene: d,
|
|
1565
1880
|
transformer: u,
|
|
@@ -1568,19 +1883,19 @@ let Et = class extends ne {
|
|
|
1568
1883
|
}))
|
|
1569
1884
|
);
|
|
1570
1885
|
})
|
|
1571
|
-
) :
|
|
1886
|
+
) : we)
|
|
1572
1887
|
).subscribe({
|
|
1573
1888
|
next: ({ permission: e, scene: n, transformer: r, unitId: s, subUnitId: o }) => {
|
|
1574
1889
|
this._drawingManagerService.setDrawingEditable(e);
|
|
1575
1890
|
const a = n.getAllObjectsByOrder(), d = this._drawingManagerService.getDrawingData(s, o), u = Object.values(d);
|
|
1576
1891
|
e ? (a.forEach((c) => {
|
|
1577
|
-
c.classType ===
|
|
1892
|
+
c.classType === ke.IMAGE && u.some((l) => c.oKey.includes(l.drawingId)) && n.attachTransformerTo(c);
|
|
1578
1893
|
}), this._drawingManagerService.addNotification(u)) : (a.forEach((c) => {
|
|
1579
|
-
c.classType ===
|
|
1894
|
+
c.classType === ke.IMAGE && u.some((l) => c.oKey.includes(l.drawingId)) && n.detachTransformerFrom(c);
|
|
1580
1895
|
}), r.clearSelectedObjects());
|
|
1581
1896
|
},
|
|
1582
1897
|
complete: () => {
|
|
1583
|
-
const e = this._univerInstanceService.getCurrentUnitForType(
|
|
1898
|
+
const e = this._univerInstanceService.getCurrentUnitForType(k.UNIVER_SHEET);
|
|
1584
1899
|
if (!e)
|
|
1585
1900
|
return;
|
|
1586
1901
|
const n = e.getUnitId(), r = e.getActiveSheet();
|
|
@@ -1591,27 +1906,28 @@ let Et = class extends ne {
|
|
|
1591
1906
|
return;
|
|
1592
1907
|
const d = this._drawingManagerService.getDrawingData(n, s), u = Object.values(d);
|
|
1593
1908
|
this._drawingManagerService.setDrawingEditable(!0), a.getAllObjectsByOrder().forEach((l) => {
|
|
1594
|
-
l.classType ===
|
|
1909
|
+
l.classType === ke.IMAGE && u.some((g) => l.oKey.includes(g.drawingId)) && a.detachTransformerFrom(l);
|
|
1595
1910
|
});
|
|
1596
1911
|
}
|
|
1597
1912
|
})
|
|
1598
1913
|
);
|
|
1599
1914
|
}
|
|
1600
1915
|
};
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
],
|
|
1608
|
-
var
|
|
1609
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1916
|
+
Bt = qs([
|
|
1917
|
+
it(0, oe),
|
|
1918
|
+
it(1, Q),
|
|
1919
|
+
it(2, wi),
|
|
1920
|
+
it(3, de),
|
|
1921
|
+
it(4, A(_i))
|
|
1922
|
+
], Bt);
|
|
1923
|
+
var Qs = Object.getOwnPropertyDescriptor, eo = (i, t, e, n) => {
|
|
1924
|
+
for (var r = n > 1 ? void 0 : n ? Qs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
1610
1925
|
(o = i[s]) && (r = o(r) || r);
|
|
1611
1926
|
return r;
|
|
1612
|
-
},
|
|
1613
|
-
|
|
1614
|
-
|
|
1927
|
+
}, be = (i, t) => (e, n) => t(e, n, i);
|
|
1928
|
+
const to = "univer-sheet-float-dom-";
|
|
1929
|
+
function Hr(i, t, e, n, r, s = !1) {
|
|
1930
|
+
const { scaleX: o, scaleY: a } = t.getAncestorScale(), d = t.getViewport(cr.VIEW_MAIN), u = n.getFreeze(), { startColumn: c, startRow: l, xSplit: g, ySplit: h } = u, m = {
|
|
1615
1931
|
left: !0,
|
|
1616
1932
|
// left means the left of pic is in a viewMainLeft
|
|
1617
1933
|
top: !0
|
|
@@ -1619,45 +1935,45 @@ function Ir(i, t, e, n, r, s = !1) {
|
|
|
1619
1935
|
if (!d)
|
|
1620
1936
|
return {
|
|
1621
1937
|
...i,
|
|
1622
|
-
absolute:
|
|
1938
|
+
absolute: m
|
|
1623
1939
|
};
|
|
1624
|
-
const { left:
|
|
1625
|
-
let { top: I, left:
|
|
1626
|
-
const { boundsOfViewArea:
|
|
1627
|
-
top: s ? 0 :
|
|
1628
|
-
left: s ? 0 :
|
|
1940
|
+
const { left: f, right: p, top: w, bottom: S } = i;
|
|
1941
|
+
let { top: I, left: D, viewportScrollX: v, viewportScrollY: C } = d;
|
|
1942
|
+
const { boundsOfViewArea: _, scrollDirectionResponse: y } = r || {}, { rowHeaderWidth: R, columnHeaderHeight: E } = e, T = {
|
|
1943
|
+
top: s ? 0 : E,
|
|
1944
|
+
left: s ? 0 : R
|
|
1629
1945
|
};
|
|
1630
|
-
|
|
1946
|
+
_ && (Ye.isDefine(T.top) && (T.top = _.top), Ye.isDefine(T.left) && (T.left = _.left)), y === "HORIZONTAL" && (C = 0), y === "VERTICAL" && (v = 0);
|
|
1631
1947
|
let M = 0, b = 0;
|
|
1632
|
-
const N = e.rowStartY(l - h) +
|
|
1948
|
+
const N = e.rowStartY(l - h) + E, F = e.colStartX(c - g) + R, te = e.rowStartY(l) + E, z = e.colStartX(c) + R;
|
|
1633
1949
|
if (g === 0)
|
|
1634
|
-
|
|
1950
|
+
m.left = !1, M = (f - v) * o, b = (p - v) * o;
|
|
1635
1951
|
else {
|
|
1636
|
-
const
|
|
1637
|
-
|
|
1952
|
+
const K = f - (F - R), W = p - (F - R);
|
|
1953
|
+
p < z ? (M = K * o, b = W * o) : f <= z && p >= z ? (M = K * o, b = Math.max(D, (p - v) * o)) : f > z && (m.left = !1, M = Math.max((f - v) * o, D), b = Math.max((p - v) * o, D));
|
|
1638
1954
|
}
|
|
1639
|
-
let
|
|
1955
|
+
let V = 0, G = 0;
|
|
1640
1956
|
if (h === 0)
|
|
1641
|
-
|
|
1957
|
+
m.top = !1, V = (w - C) * a, G = (S - C) * a;
|
|
1642
1958
|
else {
|
|
1643
|
-
const
|
|
1644
|
-
|
|
1959
|
+
const K = w - (N - E), W = S - (N - E);
|
|
1960
|
+
S < te ? (V = K * a, G = W * a) : w <= te && S >= te ? (V = K * a, G = Math.max(I, (S - C) * a)) : w > te && (m.top = !1, V = Math.max((w - C) * a, I), G = Math.max((S - C) * a, I));
|
|
1645
1961
|
}
|
|
1646
|
-
return M = Math.max(M,
|
|
1962
|
+
return M = Math.max(M, T.left), V = Math.max(V, T.top), b = Math.max(b, T.left), G = Math.max(G, T.top), {
|
|
1647
1963
|
left: M,
|
|
1648
1964
|
right: b,
|
|
1649
|
-
top:
|
|
1965
|
+
top: V,
|
|
1650
1966
|
bottom: G,
|
|
1651
|
-
absolute:
|
|
1967
|
+
absolute: m
|
|
1652
1968
|
};
|
|
1653
1969
|
}
|
|
1654
|
-
const
|
|
1970
|
+
const me = (i, t, e, n, r) => {
|
|
1655
1971
|
const { left: s, top: o, width: a, height: d, angle: u } = i, c = {
|
|
1656
1972
|
left: s,
|
|
1657
1973
|
right: s + a,
|
|
1658
1974
|
top: o,
|
|
1659
1975
|
bottom: o + d
|
|
1660
|
-
}, l =
|
|
1976
|
+
}, l = Hr(c, t, e, n, r), { scaleX: g, scaleY: h } = t.getAncestorScale();
|
|
1661
1977
|
return {
|
|
1662
1978
|
startX: l.left,
|
|
1663
1979
|
endX: l.right,
|
|
@@ -1669,23 +1985,23 @@ const ge = (i, t, e, n, r) => {
|
|
|
1669
1985
|
absolute: l.absolute
|
|
1670
1986
|
};
|
|
1671
1987
|
};
|
|
1672
|
-
let
|
|
1988
|
+
let lt = class extends ee {
|
|
1673
1989
|
constructor(t, e, n, r, s, o, a) {
|
|
1674
1990
|
super();
|
|
1675
1991
|
/**
|
|
1676
1992
|
* for update dom container position when scrolling and zoom
|
|
1677
1993
|
*/
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1994
|
+
re(this, "_domLayerInfoMap", /* @__PURE__ */ new Map());
|
|
1995
|
+
re(this, "_transformChange$", new on());
|
|
1996
|
+
re(this, "transformChange$", this._transformChange$.asObservable());
|
|
1997
|
+
re(this, "_add$", new on());
|
|
1998
|
+
re(this, "add$", this._add$.asObservable());
|
|
1999
|
+
re(this, "_remove$", new on());
|
|
2000
|
+
re(this, "remove$", this._remove$.asObservable());
|
|
1685
2001
|
this._renderManagerService = t, this._univerInstanceService = e, this._commandService = n, this._drawingManagerService = r, this._canvasFloatDomService = s, this._sheetDrawingService = o, this._lifecycleService = a, this._drawingAddListener(), this._featureUpdateListener(), this._deleteListener(), this._bindScrollEvent();
|
|
1686
2002
|
}
|
|
1687
2003
|
_bindScrollEvent() {
|
|
1688
|
-
this._lifecycleService.lifecycle$.pipe(
|
|
2004
|
+
this._lifecycleService.lifecycle$.pipe(Cs((t) => t === vi.Rendered), Rs(1)).subscribe(() => {
|
|
1689
2005
|
this._scrollUpdateListener();
|
|
1690
2006
|
});
|
|
1691
2007
|
}
|
|
@@ -1711,87 +2027,89 @@ let tt = class extends ne {
|
|
|
1711
2027
|
this._drawingManagerService.add$.subscribe((t) => {
|
|
1712
2028
|
t.forEach((e) => {
|
|
1713
2029
|
var K;
|
|
1714
|
-
const { unitId: n, subUnitId: r, drawingId: s } = e, o =
|
|
2030
|
+
const { unitId: n, subUnitId: r, drawingId: s } = e, o = ae(this._univerInstanceService, { unitId: n, subUnitId: r }), a = this._drawingManagerService.getDrawingByParam(e), d = this._univerInstanceService.getUnit(n, k.UNIVER_SHEET);
|
|
1715
2031
|
if (!d)
|
|
1716
2032
|
return;
|
|
1717
2033
|
const u = d.getActiveSheet().getSheetId();
|
|
1718
2034
|
if (!a || !o)
|
|
1719
2035
|
return;
|
|
1720
|
-
const c = (K = this._renderManagerService.getRenderById(n)) == null ? void 0 : K.with(
|
|
2036
|
+
const c = (K = this._renderManagerService.getRenderById(n)) == null ? void 0 : K.with(X).getSkeletonParam(r);
|
|
1721
2037
|
if (!c)
|
|
1722
2038
|
return;
|
|
1723
2039
|
const { transform: l, drawingType: g, data: h } = a;
|
|
1724
|
-
if (g !==
|
|
2040
|
+
if (g !== x.DRAWING_DOM && g !== x.DRAWING_CHART)
|
|
1725
2041
|
return;
|
|
1726
|
-
const
|
|
1727
|
-
if (
|
|
2042
|
+
const m = this._getSceneAndTransformerByDrawingSearch(n);
|
|
2043
|
+
if (m == null)
|
|
1728
2044
|
return;
|
|
1729
|
-
const { scene:
|
|
2045
|
+
const { scene: f, canvas: p } = m;
|
|
1730
2046
|
if (l == null)
|
|
1731
2047
|
return !0;
|
|
1732
2048
|
if (u !== r)
|
|
1733
2049
|
return;
|
|
1734
|
-
const { left:
|
|
1735
|
-
if (
|
|
1736
|
-
|
|
2050
|
+
const { left: w, top: S, width: I, height: D, angle: v, flipX: C, flipY: _, skewX: y, skewY: R } = l, E = De({ unitId: n, subUnitId: r, drawingId: s }), T = f.getObject(E);
|
|
2051
|
+
if (T != null) {
|
|
2052
|
+
T.transformByState({ left: w, top: S, width: I, height: D, angle: v, flipX: C, flipY: _, skewX: y, skewY: R });
|
|
1737
2053
|
return;
|
|
1738
2054
|
}
|
|
1739
2055
|
const M = {
|
|
1740
|
-
left:
|
|
1741
|
-
top:
|
|
2056
|
+
left: w,
|
|
2057
|
+
top: S,
|
|
1742
2058
|
width: I,
|
|
1743
|
-
height:
|
|
2059
|
+
height: D,
|
|
1744
2060
|
zIndex: this._drawingManagerService.getDrawingOrder(n, r).length - 1
|
|
1745
|
-
}, b = g ===
|
|
2061
|
+
}, b = g === x.DRAWING_CHART;
|
|
1746
2062
|
if (M.rotateEnabled = !1, b) {
|
|
1747
|
-
const
|
|
1748
|
-
M.fill =
|
|
2063
|
+
const W = h ? h.backgroundColor : "white";
|
|
2064
|
+
M.fill = W, h && h.border && (M.stroke = h.border), M.paintFirst = "stroke", M.strokeWidth = 1, M.borderEnabled = !1, M.radius = 8;
|
|
1749
2065
|
}
|
|
1750
|
-
const N = new
|
|
1751
|
-
b && N.setObjectType(
|
|
1752
|
-
const
|
|
1753
|
-
dispose:
|
|
2066
|
+
const N = new $e(E, M);
|
|
2067
|
+
b && N.setObjectType(An.CHART), f.addObject(N, qt), a.allowTransform !== !1 && f.attachTransformerTo(N);
|
|
2068
|
+
const F = new yt(), te = me(N, m.renderUnit.scene, c.skeleton, o.worksheet), z = new je(te), V = `${to}${He(6)}`, G = {
|
|
2069
|
+
dispose: F,
|
|
1754
2070
|
rect: N,
|
|
1755
|
-
position$:
|
|
2071
|
+
position$: z,
|
|
1756
2072
|
unitId: n,
|
|
1757
2073
|
subUnitId: r,
|
|
1758
|
-
id: s
|
|
2074
|
+
id: s,
|
|
2075
|
+
domId: V
|
|
1759
2076
|
};
|
|
1760
2077
|
this._canvasFloatDomService.addFloatDom({
|
|
1761
|
-
position$:
|
|
2078
|
+
position$: z,
|
|
1762
2079
|
id: s,
|
|
2080
|
+
domId: V,
|
|
1763
2081
|
componentKey: a.componentKey,
|
|
1764
|
-
onPointerDown: (
|
|
1765
|
-
|
|
2082
|
+
onPointerDown: (W) => {
|
|
2083
|
+
p.dispatchEvent(new PointerEvent(W.type, W));
|
|
1766
2084
|
},
|
|
1767
|
-
onPointerMove: (
|
|
1768
|
-
|
|
2085
|
+
onPointerMove: (W) => {
|
|
2086
|
+
p.dispatchEvent(new PointerEvent(W.type, W));
|
|
1769
2087
|
},
|
|
1770
|
-
onPointerUp: (
|
|
1771
|
-
|
|
2088
|
+
onPointerUp: (W) => {
|
|
2089
|
+
p.dispatchEvent(new PointerEvent(W.type, W));
|
|
1772
2090
|
},
|
|
1773
|
-
onWheel: (
|
|
1774
|
-
|
|
2091
|
+
onWheel: (W) => {
|
|
2092
|
+
p.dispatchEvent(new WheelEvent(W.type, W));
|
|
1775
2093
|
},
|
|
1776
2094
|
data: h,
|
|
1777
2095
|
unitId: n
|
|
1778
2096
|
});
|
|
1779
|
-
const
|
|
1780
|
-
const
|
|
1781
|
-
|
|
1782
|
-
|
|
2097
|
+
const Z = N.onTransformChange$.subscribeEvent(() => {
|
|
2098
|
+
const W = me(N, m.renderUnit.scene, c.skeleton, o.worksheet);
|
|
2099
|
+
z.next(
|
|
2100
|
+
W
|
|
1783
2101
|
);
|
|
1784
2102
|
});
|
|
1785
|
-
|
|
2103
|
+
F.add(() => {
|
|
1786
2104
|
this._canvasFloatDomService.removeFloatDom(s);
|
|
1787
|
-
}),
|
|
2105
|
+
}), Z && F.add(Z), this._domLayerInfoMap.set(s, G);
|
|
1788
2106
|
});
|
|
1789
2107
|
})
|
|
1790
2108
|
), this.disposeWithMe(
|
|
1791
2109
|
this._drawingManagerService.remove$.subscribe((t) => {
|
|
1792
2110
|
t.forEach((e) => {
|
|
1793
2111
|
var l;
|
|
1794
|
-
const { unitId: n, subUnitId: r, drawingId: s } = e, o =
|
|
2112
|
+
const { unitId: n, subUnitId: r, drawingId: s } = e, o = De({ unitId: n, subUnitId: r, drawingId: s }), a = this._getSceneAndTransformerByDrawingSearch(n);
|
|
1795
2113
|
if (a == null)
|
|
1796
2114
|
return;
|
|
1797
2115
|
const { transformer: d, scene: u } = a, c = u.getObject(o);
|
|
@@ -1803,25 +2121,25 @@ let tt = class extends ne {
|
|
|
1803
2121
|
_scrollUpdateListener() {
|
|
1804
2122
|
const t = (e, n) => {
|
|
1805
2123
|
var d;
|
|
1806
|
-
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 =
|
|
2124
|
+
const r = this._getSceneAndTransformerByDrawingSearch(e), s = Array.from(this._domLayerInfoMap.keys()).map((u) => ({ id: u, ...this._domLayerInfoMap.get(u) })).filter((u) => u.subUnitId === n && u.unitId === e).map((u) => u.id), o = ae(this._univerInstanceService, { unitId: e, subUnitId: n }), a = (d = this._renderManagerService.getRenderById(e)) == null ? void 0 : d.with(X).getSkeletonParam(n);
|
|
1807
2125
|
!r || !o || !a || s.forEach((u) => {
|
|
1808
2126
|
const c = this._domLayerInfoMap.get(u);
|
|
1809
2127
|
if (c) {
|
|
1810
|
-
const l =
|
|
2128
|
+
const l = me(c.rect, r.renderUnit.scene, a.skeleton, o.worksheet, c);
|
|
1811
2129
|
c.position$.next(l);
|
|
1812
2130
|
}
|
|
1813
2131
|
});
|
|
1814
2132
|
};
|
|
1815
2133
|
this.disposeWithMe(
|
|
1816
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1817
|
-
|
|
1818
|
-
|
|
2134
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(k.UNIVER_SHEET).pipe(
|
|
2135
|
+
fe((e) => e ? e.activeSheet$ : wn(null)),
|
|
2136
|
+
pe((e) => {
|
|
1819
2137
|
if (!e) return null;
|
|
1820
2138
|
const n = e.getUnitId(), r = this._renderManagerService.getRenderById(n);
|
|
1821
2139
|
return r ? { render: r, unitId: n, subUnitId: e.getSheetId() } : null;
|
|
1822
2140
|
}),
|
|
1823
|
-
|
|
1824
|
-
(e) => e ?
|
|
2141
|
+
fe(
|
|
2142
|
+
(e) => e ? Ii(e.render.scene.getViewport(cr.VIEW_MAIN).onScrollAfter$).pipe(pe(() => ({ unitId: e.unitId, subUnitId: e.subUnitId }))) : wn(null)
|
|
1825
2143
|
)
|
|
1826
2144
|
).subscribe((e) => {
|
|
1827
2145
|
if (!e) return;
|
|
@@ -1829,12 +2147,15 @@ let tt = class extends ne {
|
|
|
1829
2147
|
t(n, r);
|
|
1830
2148
|
})
|
|
1831
2149
|
), this.disposeWithMe(this._commandService.onCommandExecuted((e) => {
|
|
1832
|
-
if (e.id ===
|
|
2150
|
+
if (e.id === $n.id) {
|
|
1833
2151
|
const n = e.params, { unitId: r } = n;
|
|
1834
2152
|
Array.from(this._domLayerInfoMap.values()).filter((o) => o.unitId === r).map((o) => o.subUnitId).forEach((o) => {
|
|
1835
2153
|
t(r, o);
|
|
1836
2154
|
});
|
|
1837
|
-
} else if (e.id ===
|
|
2155
|
+
} else if (e.id === ki.id) {
|
|
2156
|
+
const { unitId: n, subUnitId: r } = e.params;
|
|
2157
|
+
t(n, r);
|
|
2158
|
+
} else if (e.id === $i.id) {
|
|
1838
2159
|
const { unitId: n, subUnitId: r } = e.params;
|
|
1839
2160
|
t(n, r);
|
|
1840
2161
|
}
|
|
@@ -1843,13 +2164,13 @@ let tt = class extends ne {
|
|
|
1843
2164
|
updateFloatDomProps(t, e, n, r) {
|
|
1844
2165
|
const s = this._domLayerInfoMap.get(n), o = this._getSceneAndTransformerByDrawingSearch(t);
|
|
1845
2166
|
if (s && o) {
|
|
1846
|
-
const { scene: a } = o, d =
|
|
1847
|
-
u && u instanceof
|
|
2167
|
+
const { scene: a } = o, d = De({ unitId: t, subUnitId: e, drawingId: n }), u = a.getObject(d);
|
|
2168
|
+
u && u instanceof $e && u.setProps(r);
|
|
1848
2169
|
}
|
|
1849
2170
|
}
|
|
1850
2171
|
_getPosition(t, e) {
|
|
1851
2172
|
var g;
|
|
1852
|
-
const { startX: n, endX: r, startY: s, endY: o } = t, a = (g = this._renderManagerService.getRenderById(e)) == null ? void 0 : g.with(
|
|
2173
|
+
const { startX: n, endX: r, startY: s, endY: o } = t, a = (g = this._renderManagerService.getRenderById(e)) == null ? void 0 : g.with(Je);
|
|
1853
2174
|
if (a == null)
|
|
1854
2175
|
return;
|
|
1855
2176
|
const d = a.getCellWithCoordByOffset(n, s);
|
|
@@ -1879,7 +2200,7 @@ let tt = class extends ne {
|
|
|
1879
2200
|
this._drawingManagerService.update$.subscribe((t) => {
|
|
1880
2201
|
t.forEach((e) => {
|
|
1881
2202
|
const n = this._drawingManagerService.getDrawingByParam(e);
|
|
1882
|
-
if (!n || n.drawingType !==
|
|
2203
|
+
if (!n || n.drawingType !== x.DRAWING_DOM && n.drawingType !== x.DRAWING_CHART)
|
|
1883
2204
|
return;
|
|
1884
2205
|
const r = {
|
|
1885
2206
|
...n.transform
|
|
@@ -1888,7 +2209,7 @@ let tt = class extends ne {
|
|
|
1888
2209
|
...n
|
|
1889
2210
|
});
|
|
1890
2211
|
const s = this._getSceneAndTransformerByDrawingSearch(e.unitId);
|
|
1891
|
-
if (s && n.drawingType !==
|
|
2212
|
+
if (s && n.drawingType !== x.DRAWING_CHART) {
|
|
1892
2213
|
const { scene: o } = s, a = this._domLayerInfoMap.get(e.drawingId);
|
|
1893
2214
|
a != null && a.rect && (n.allowTransform === !1 ? o.detachTransformerFrom(a.rect) : o.attachTransformerTo(a.rect));
|
|
1894
2215
|
}
|
|
@@ -1907,20 +2228,20 @@ let tt = class extends ne {
|
|
|
1907
2228
|
}
|
|
1908
2229
|
// CreateFloatDomCommand --> floatDomService.addFloatDomToPosition
|
|
1909
2230
|
addFloatDomToPosition(t, e) {
|
|
1910
|
-
const n =
|
|
2231
|
+
const n = ae(this._univerInstanceService, {
|
|
1911
2232
|
unitId: t.unitId,
|
|
1912
2233
|
subUnitId: t.subUnitId
|
|
1913
2234
|
});
|
|
1914
2235
|
if (!n)
|
|
1915
2236
|
throw new Error("cannot find current target!");
|
|
1916
|
-
const { unitId: r, subUnitId: s } = n, { initPosition: o, componentKey: a, data: d, allowTransform: u = !0 } = t, c = e != null ? e :
|
|
2237
|
+
const { unitId: r, subUnitId: s } = n, { initPosition: o, componentKey: a, data: d, allowTransform: u = !0 } = t, c = e != null ? e : He(), l = this._getPosition(o, r);
|
|
1917
2238
|
if (l == null)
|
|
1918
2239
|
return;
|
|
1919
2240
|
const g = {
|
|
1920
2241
|
unitId: r,
|
|
1921
2242
|
subUnitId: s,
|
|
1922
2243
|
drawingId: c,
|
|
1923
|
-
drawingType: t.type ||
|
|
2244
|
+
drawingType: t.type || x.DRAWING_DOM,
|
|
1924
2245
|
componentKey: a,
|
|
1925
2246
|
sheetTransform: l,
|
|
1926
2247
|
transform: {
|
|
@@ -1932,7 +2253,7 @@ let tt = class extends ne {
|
|
|
1932
2253
|
data: d,
|
|
1933
2254
|
allowTransform: u
|
|
1934
2255
|
};
|
|
1935
|
-
return this._commandService.executeCommand(
|
|
2256
|
+
return this._commandService.executeCommand(Xt.id, {
|
|
1936
2257
|
unitId: r,
|
|
1937
2258
|
drawings: [g]
|
|
1938
2259
|
}), this._add$.next({ unitId: r, subUnitId: s, id: c }), {
|
|
@@ -1959,8 +2280,8 @@ let tt = class extends ne {
|
|
|
1959
2280
|
}
|
|
1960
2281
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
1961
2282
|
addFloatDomToRange(t, e, n, r) {
|
|
1962
|
-
var C,
|
|
1963
|
-
const s =
|
|
2283
|
+
var C, _, y;
|
|
2284
|
+
const s = ae(this._univerInstanceService, {
|
|
1964
2285
|
unitId: e.unitId,
|
|
1965
2286
|
subUnitId: e.subUnitId
|
|
1966
2287
|
});
|
|
@@ -1970,84 +2291,84 @@ let tt = class extends ne {
|
|
|
1970
2291
|
if (!d) return;
|
|
1971
2292
|
const u = this._renderManagerService.getRenderById(o);
|
|
1972
2293
|
if (!u) return;
|
|
1973
|
-
const c = (C = this._renderManagerService.getRenderById(o)) == null ? void 0 : C.with(
|
|
2294
|
+
const c = (C = this._renderManagerService.getRenderById(o)) == null ? void 0 : C.with(X).getWorksheetSkeleton(a);
|
|
1974
2295
|
if (!c) return;
|
|
1975
|
-
const { componentKey: l, data: g, allowTransform: h = !0 } = e,
|
|
1976
|
-
if (this._getPosition(
|
|
2296
|
+
const { componentKey: l, data: g, allowTransform: h = !0 } = e, m = r != null ? r : He(), { position: f, position$: p } = this._createRangePositionObserver(t, u, c.skeleton);
|
|
2297
|
+
if (this._getPosition(f, o) == null)
|
|
1977
2298
|
return;
|
|
1978
|
-
const
|
|
2299
|
+
const S = d.scene, { scaleX: I } = S.getAncestorScale(), D = Ut(f, n, I), v = {
|
|
1979
2300
|
unitId: o,
|
|
1980
2301
|
subUnitId: a,
|
|
1981
|
-
drawingId:
|
|
1982
|
-
drawingType: e.type ||
|
|
2302
|
+
drawingId: m,
|
|
2303
|
+
drawingType: e.type || x.DRAWING_DOM,
|
|
1983
2304
|
componentKey: l,
|
|
1984
2305
|
transform: {
|
|
1985
|
-
left:
|
|
1986
|
-
top:
|
|
1987
|
-
width:
|
|
1988
|
-
height:
|
|
2306
|
+
left: D.startX,
|
|
2307
|
+
top: D.startY,
|
|
2308
|
+
width: D.width,
|
|
2309
|
+
height: D.height
|
|
1989
2310
|
},
|
|
1990
2311
|
data: g,
|
|
1991
2312
|
allowTransform: h
|
|
1992
2313
|
};
|
|
1993
2314
|
{
|
|
1994
|
-
const { unitId:
|
|
2315
|
+
const { unitId: R, subUnitId: E, drawingId: T } = v, M = ae(this._univerInstanceService, { unitId: R, subUnitId: E }), b = v, N = this._univerInstanceService.getUnit(R, k.UNIVER_SHEET);
|
|
1995
2316
|
if (!N)
|
|
1996
2317
|
return;
|
|
1997
|
-
const
|
|
2318
|
+
const F = N.getActiveSheet().getSheetId();
|
|
1998
2319
|
if (!b || !M)
|
|
1999
2320
|
return;
|
|
2000
|
-
const
|
|
2001
|
-
if (!
|
|
2321
|
+
const te = (_ = this._renderManagerService.getRenderById(R)) == null ? void 0 : _.with(X);
|
|
2322
|
+
if (!te)
|
|
2002
2323
|
return;
|
|
2003
|
-
const
|
|
2004
|
-
if (!
|
|
2324
|
+
const z = te.getWorksheetSkeleton(E);
|
|
2325
|
+
if (!z)
|
|
2005
2326
|
return;
|
|
2006
|
-
const { transform:
|
|
2007
|
-
if (G !==
|
|
2327
|
+
const { transform: V, drawingType: G, data: Z } = b;
|
|
2328
|
+
if (G !== x.DRAWING_DOM && G !== x.DRAWING_CHART)
|
|
2008
2329
|
return;
|
|
2009
|
-
const
|
|
2010
|
-
if (
|
|
2330
|
+
const K = this._getSceneAndTransformerByDrawingSearch(R);
|
|
2331
|
+
if (K == null)
|
|
2011
2332
|
return;
|
|
2012
|
-
const { scene:
|
|
2013
|
-
if (
|
|
2333
|
+
const { scene: W, canvas: Oe } = K;
|
|
2334
|
+
if (V == null || F !== E)
|
|
2014
2335
|
return;
|
|
2015
|
-
const { left:
|
|
2016
|
-
if (
|
|
2017
|
-
|
|
2336
|
+
const { left: ft, top: pt, width: wt, height: _t, angle: Jt, flipX: Zt, flipY: St, skewX: vt, skewY: Ue } = V, It = De({ unitId: R, subUnitId: E, drawingId: T }), le = W.getObject(It);
|
|
2337
|
+
if (le != null) {
|
|
2338
|
+
le.transformByState({ left: ft, top: pt, width: wt, height: _t, angle: Jt, flipX: Zt, flipY: St, skewX: vt, skewY: Ue });
|
|
2018
2339
|
return;
|
|
2019
2340
|
}
|
|
2020
|
-
const
|
|
2021
|
-
left:
|
|
2341
|
+
const ne = {
|
|
2342
|
+
left: ft,
|
|
2022
2343
|
// from floatDomParam.transform
|
|
2023
|
-
top:
|
|
2024
|
-
width:
|
|
2025
|
-
height:
|
|
2026
|
-
zIndex: this._drawingManagerService.getDrawingOrder(
|
|
2027
|
-
},
|
|
2028
|
-
if (
|
|
2029
|
-
const
|
|
2030
|
-
|
|
2344
|
+
top: pt,
|
|
2345
|
+
width: wt,
|
|
2346
|
+
height: _t,
|
|
2347
|
+
zIndex: this._drawingManagerService.getDrawingOrder(R, E).length - 1
|
|
2348
|
+
}, Pe = G === x.DRAWING_CHART;
|
|
2349
|
+
if (Pe) {
|
|
2350
|
+
const $ = Z ? Z.backgroundColor : "white";
|
|
2351
|
+
ne.fill = $, ne.rotateEnabled = !1, Z && Z.border && (ne.stroke = Z.border), ne.paintFirst = "stroke", ne.strokeWidth = 1, ne.borderEnabled = !1, ne.radius = 8;
|
|
2031
2352
|
}
|
|
2032
|
-
const
|
|
2033
|
-
|
|
2034
|
-
const
|
|
2035
|
-
top:
|
|
2036
|
-
left:
|
|
2037
|
-
bottom:
|
|
2038
|
-
right:
|
|
2039
|
-
},
|
|
2040
|
-
dispose:
|
|
2041
|
-
rect:
|
|
2042
|
-
boundsOfViewArea:
|
|
2353
|
+
const ue = new $e(It, ne);
|
|
2354
|
+
Pe && ue.setObjectType(An.CHART), W.addObject(ue, qt), b.allowTransform !== !1 && W.attachTransformerTo(ue);
|
|
2355
|
+
const he = new yt(), Ct = W.getMainViewport(), { rowHeaderWidth: Ae, columnHeaderHeight: Qe } = z.skeleton, Rt = {
|
|
2356
|
+
top: Qe,
|
|
2357
|
+
left: Ae,
|
|
2358
|
+
bottom: Ct.bottom,
|
|
2359
|
+
right: Ct.right
|
|
2360
|
+
}, ge = {
|
|
2361
|
+
dispose: he,
|
|
2362
|
+
rect: ue,
|
|
2363
|
+
boundsOfViewArea: Rt,
|
|
2043
2364
|
domAnchor: n,
|
|
2044
|
-
unitId:
|
|
2045
|
-
subUnitId:
|
|
2046
|
-
},
|
|
2047
|
-
|
|
2048
|
-
let
|
|
2049
|
-
position$:
|
|
2050
|
-
id:
|
|
2365
|
+
unitId: R,
|
|
2366
|
+
subUnitId: E
|
|
2367
|
+
}, B = me(ue, K.renderUnit.scene, z.skeleton, M.worksheet, ge), Ne = new je(B);
|
|
2368
|
+
ge.position$ = Ne;
|
|
2369
|
+
let et = {
|
|
2370
|
+
position$: Ne,
|
|
2371
|
+
id: T,
|
|
2051
2372
|
componentKey: b.componentKey,
|
|
2052
2373
|
onPointerDown: () => {
|
|
2053
2374
|
},
|
|
@@ -2055,70 +2376,70 @@ let tt = class extends ne {
|
|
|
2055
2376
|
},
|
|
2056
2377
|
onPointerUp: () => {
|
|
2057
2378
|
},
|
|
2058
|
-
onWheel: (
|
|
2059
|
-
|
|
2379
|
+
onWheel: ($) => {
|
|
2380
|
+
Oe.dispatchEvent(new WheelEvent($.type, $));
|
|
2060
2381
|
},
|
|
2061
|
-
data:
|
|
2062
|
-
unitId:
|
|
2382
|
+
data: Z,
|
|
2383
|
+
unitId: R
|
|
2063
2384
|
};
|
|
2064
|
-
e.eventPassThrough && (
|
|
2065
|
-
...
|
|
2066
|
-
onPointerDown: (
|
|
2067
|
-
|
|
2385
|
+
e.eventPassThrough && (et = {
|
|
2386
|
+
...et,
|
|
2387
|
+
onPointerDown: ($) => {
|
|
2388
|
+
Oe.dispatchEvent(new PointerEvent($.type, $));
|
|
2068
2389
|
},
|
|
2069
|
-
onPointerMove: (
|
|
2070
|
-
|
|
2390
|
+
onPointerMove: ($) => {
|
|
2391
|
+
Oe.dispatchEvent(new PointerEvent($.type, $));
|
|
2071
2392
|
},
|
|
2072
|
-
onPointerUp: (
|
|
2073
|
-
|
|
2393
|
+
onPointerUp: ($) => {
|
|
2394
|
+
Oe.dispatchEvent(new PointerEvent($.type, $));
|
|
2074
2395
|
}
|
|
2075
|
-
}), this._canvasFloatDomService.addFloatDom(
|
|
2076
|
-
var
|
|
2077
|
-
const
|
|
2078
|
-
startX:
|
|
2079
|
-
startY:
|
|
2080
|
-
endX:
|
|
2081
|
-
endY:
|
|
2082
|
-
width: (
|
|
2083
|
-
height: (
|
|
2396
|
+
}), this._canvasFloatDomService.addFloatDom(et), this.disposeWithMe(p.subscribe(($) => {
|
|
2397
|
+
var Tn, On, Un, Pn;
|
|
2398
|
+
const En = Ut({
|
|
2399
|
+
startX: $.startX,
|
|
2400
|
+
startY: $.startY,
|
|
2401
|
+
endX: $.endX,
|
|
2402
|
+
endY: $.endY,
|
|
2403
|
+
width: (Tn = n.width) != null ? Tn : $.width,
|
|
2404
|
+
height: (On = n.height) != null ? On : $.height,
|
|
2084
2405
|
absolute: {
|
|
2085
|
-
left:
|
|
2086
|
-
top:
|
|
2406
|
+
left: f.absolute.left,
|
|
2407
|
+
top: f.absolute.top
|
|
2087
2408
|
}
|
|
2088
|
-
}, n),
|
|
2089
|
-
left:
|
|
2090
|
-
top:
|
|
2091
|
-
width: (
|
|
2092
|
-
height: (
|
|
2093
|
-
zIndex: this._drawingManagerService.getDrawingOrder(
|
|
2094
|
-
}),
|
|
2095
|
-
|
|
2409
|
+
}, n), Gr = De({ unitId: R, subUnitId: E, drawingId: T }), Xr = new $e(Gr, {
|
|
2410
|
+
left: En.startX,
|
|
2411
|
+
top: En.startY,
|
|
2412
|
+
width: (Un = n.width) != null ? Un : $.width,
|
|
2413
|
+
height: (Pn = n.height) != null ? Pn : $.height,
|
|
2414
|
+
zIndex: this._drawingManagerService.getDrawingOrder(R, E).length - 1
|
|
2415
|
+
}), zr = me(Xr, K.renderUnit.scene, z.skeleton, M.worksheet, ge);
|
|
2416
|
+
Ne.next(zr);
|
|
2096
2417
|
}));
|
|
2097
|
-
const
|
|
2098
|
-
|
|
2099
|
-
|
|
2418
|
+
const tt = (y = this._renderManagerService.getRenderById(R)) == null ? void 0 : y.with(X);
|
|
2419
|
+
tt == null || tt.currentSkeleton$.subscribe(($) => {
|
|
2420
|
+
$ && z.sheetId !== $.sheetId && this._removeDom(m, !0);
|
|
2100
2421
|
});
|
|
2101
|
-
const
|
|
2102
|
-
const
|
|
2103
|
-
|
|
2104
|
-
|
|
2422
|
+
const Dt = ue.onTransformChange$.subscribeEvent(() => {
|
|
2423
|
+
const $ = me(ue, K.renderUnit.scene, z.skeleton, M.worksheet, ge);
|
|
2424
|
+
Ne.next(
|
|
2425
|
+
$
|
|
2105
2426
|
);
|
|
2106
2427
|
});
|
|
2107
|
-
|
|
2108
|
-
this._canvasFloatDomService.removeFloatDom(
|
|
2109
|
-
}),
|
|
2428
|
+
he.add(() => {
|
|
2429
|
+
this._canvasFloatDomService.removeFloatDom(T);
|
|
2430
|
+
}), Dt && he.add(Dt), this._domLayerInfoMap.set(T, ge);
|
|
2110
2431
|
}
|
|
2111
2432
|
return {
|
|
2112
|
-
id:
|
|
2433
|
+
id: m,
|
|
2113
2434
|
dispose: () => {
|
|
2114
|
-
this._removeDom(
|
|
2435
|
+
this._removeDom(m, !0);
|
|
2115
2436
|
}
|
|
2116
2437
|
};
|
|
2117
2438
|
}
|
|
2118
2439
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
2119
2440
|
addFloatDomToColumnHeader(t, e, n, r) {
|
|
2120
|
-
var
|
|
2121
|
-
const s =
|
|
2441
|
+
var D, v, C;
|
|
2442
|
+
const s = ae(this._univerInstanceService, {
|
|
2122
2443
|
unitId: e.unitId,
|
|
2123
2444
|
subUnitId: e.subUnitId
|
|
2124
2445
|
});
|
|
@@ -2128,158 +2449,158 @@ let tt = class extends ne {
|
|
|
2128
2449
|
if (!this._getSceneAndTransformerByDrawingSearch(o)) return;
|
|
2129
2450
|
const u = this._renderManagerService.getRenderById(o);
|
|
2130
2451
|
if (!u) return;
|
|
2131
|
-
const c = (
|
|
2452
|
+
const c = (D = this._renderManagerService.getRenderById(o)) == null ? void 0 : D.with(X).getWorksheetSkeleton(a);
|
|
2132
2453
|
if (!c) return;
|
|
2133
|
-
const { componentKey: l, data: g, allowTransform: h = !0 } = e,
|
|
2454
|
+
const { componentKey: l, data: g, allowTransform: h = !0 } = e, m = r != null ? r : He(), { position: f, position$: p } = this._createRangePositionObserver({
|
|
2134
2455
|
startRow: 0,
|
|
2135
2456
|
endRow: 0,
|
|
2136
2457
|
startColumn: t,
|
|
2137
2458
|
endColumn: t
|
|
2138
|
-
}, u, c.skeleton),
|
|
2139
|
-
if (
|
|
2459
|
+
}, u, c.skeleton), w = f;
|
|
2460
|
+
if (w.startY = 0, this._getPosition(f, o) == null)
|
|
2140
2461
|
return;
|
|
2141
2462
|
const I = {
|
|
2142
2463
|
unitId: o,
|
|
2143
2464
|
subUnitId: a,
|
|
2144
|
-
drawingId:
|
|
2145
|
-
drawingType: e.type ||
|
|
2465
|
+
drawingId: m,
|
|
2466
|
+
drawingType: e.type || x.DRAWING_DOM,
|
|
2146
2467
|
componentKey: l,
|
|
2147
2468
|
transform: {
|
|
2148
|
-
left:
|
|
2149
|
-
top:
|
|
2150
|
-
width:
|
|
2151
|
-
height:
|
|
2469
|
+
left: w.startX,
|
|
2470
|
+
top: w.startY,
|
|
2471
|
+
width: w.width,
|
|
2472
|
+
height: w.height
|
|
2152
2473
|
},
|
|
2153
2474
|
data: g,
|
|
2154
2475
|
allowTransform: h
|
|
2155
2476
|
};
|
|
2156
2477
|
{
|
|
2157
|
-
const { unitId:
|
|
2478
|
+
const { unitId: _, subUnitId: y, drawingId: R } = I, E = ae(this._univerInstanceService, { unitId: _, subUnitId: y }), T = I, M = this._univerInstanceService.getUnit(_, k.UNIVER_SHEET);
|
|
2158
2479
|
if (!M)
|
|
2159
2480
|
return;
|
|
2160
2481
|
const b = M.getActiveSheet().getSheetId();
|
|
2161
|
-
if (!
|
|
2482
|
+
if (!T || !E)
|
|
2162
2483
|
return;
|
|
2163
|
-
const N = (
|
|
2484
|
+
const N = (v = this._renderManagerService.getRenderById(_)) == null ? void 0 : v.with(X);
|
|
2164
2485
|
if (!N)
|
|
2165
2486
|
return;
|
|
2166
|
-
const
|
|
2167
|
-
if (!
|
|
2487
|
+
const F = N.getWorksheetSkeleton(y);
|
|
2488
|
+
if (!F)
|
|
2168
2489
|
return;
|
|
2169
|
-
const { transform:
|
|
2170
|
-
if (
|
|
2490
|
+
const { transform: te, data: z } = T, V = this._getSceneAndTransformerByDrawingSearch(_);
|
|
2491
|
+
if (V == null)
|
|
2171
2492
|
return;
|
|
2172
|
-
const { scene: G, canvas:
|
|
2173
|
-
if (
|
|
2493
|
+
const { scene: G, canvas: Z } = V;
|
|
2494
|
+
if (te == null || b !== y)
|
|
2174
2495
|
return;
|
|
2175
|
-
const { left:
|
|
2176
|
-
if (
|
|
2177
|
-
|
|
2496
|
+
const { left: K, top: W, width: Oe, height: ft, angle: pt, flipX: wt, flipY: _t, skewX: Jt, skewY: Zt } = te, St = De({ unitId: _, subUnitId: y, drawingId: R }), vt = G.getObject(St);
|
|
2497
|
+
if (vt != null) {
|
|
2498
|
+
vt.transformByState({ left: K, top: W, width: Oe, height: ft, angle: pt, flipX: wt, flipY: _t, skewX: Jt, skewY: Zt });
|
|
2178
2499
|
return;
|
|
2179
2500
|
}
|
|
2180
|
-
const
|
|
2181
|
-
startX:
|
|
2501
|
+
const Ue = Ut({
|
|
2502
|
+
startX: w.startX,
|
|
2182
2503
|
startY: 0,
|
|
2183
|
-
endX:
|
|
2184
|
-
endY:
|
|
2504
|
+
endX: f.endX,
|
|
2505
|
+
endY: f.endY,
|
|
2185
2506
|
width: n.width,
|
|
2186
2507
|
height: n.height,
|
|
2187
2508
|
absolute: {
|
|
2188
|
-
left:
|
|
2189
|
-
top:
|
|
2509
|
+
left: f.absolute.left,
|
|
2510
|
+
top: f.absolute.top
|
|
2190
2511
|
}
|
|
2191
|
-
}, n),
|
|
2192
|
-
left:
|
|
2193
|
-
top:
|
|
2194
|
-
width:
|
|
2195
|
-
height:
|
|
2196
|
-
zIndex: this._drawingManagerService.getDrawingOrder(
|
|
2197
|
-
},
|
|
2198
|
-
G.addObject(
|
|
2199
|
-
const
|
|
2512
|
+
}, n), It = {
|
|
2513
|
+
left: Ue.startX,
|
|
2514
|
+
top: Ue.startY,
|
|
2515
|
+
width: Ue.width,
|
|
2516
|
+
height: Ue.height,
|
|
2517
|
+
zIndex: this._drawingManagerService.getDrawingOrder(_, y).length - 1
|
|
2518
|
+
}, le = new $e(St, It);
|
|
2519
|
+
G.addObject(le, qt), T.allowTransform !== !1 && G.attachTransformerTo(le);
|
|
2520
|
+
const ne = new yt(), Pe = G.getMainViewport(), ue = {
|
|
2200
2521
|
top: 0,
|
|
2201
2522
|
//viewMain.top,
|
|
2202
|
-
left:
|
|
2203
|
-
bottom:
|
|
2204
|
-
right:
|
|
2205
|
-
},
|
|
2206
|
-
dispose:
|
|
2207
|
-
rect:
|
|
2523
|
+
left: Pe.left,
|
|
2524
|
+
bottom: Pe.bottom,
|
|
2525
|
+
right: Pe.right
|
|
2526
|
+
}, he = {
|
|
2527
|
+
dispose: ne,
|
|
2528
|
+
rect: le,
|
|
2208
2529
|
// position$,
|
|
2209
|
-
unitId:
|
|
2530
|
+
unitId: _,
|
|
2210
2531
|
subUnitId: y,
|
|
2211
|
-
boundsOfViewArea:
|
|
2532
|
+
boundsOfViewArea: ue,
|
|
2212
2533
|
domAnchor: n,
|
|
2213
2534
|
scrollDirectionResponse: "HORIZONTAL"
|
|
2214
2535
|
/* HORIZONTAL */
|
|
2215
|
-
},
|
|
2216
|
-
|
|
2217
|
-
let
|
|
2218
|
-
position$:
|
|
2219
|
-
id:
|
|
2220
|
-
componentKey:
|
|
2536
|
+
}, Ct = me(le, V.renderUnit.scene, F.skeleton, E.worksheet, he), Ae = new je(Ct);
|
|
2537
|
+
he.position$ = Ae;
|
|
2538
|
+
let Qe = {
|
|
2539
|
+
position$: Ae,
|
|
2540
|
+
id: R,
|
|
2541
|
+
componentKey: T.componentKey,
|
|
2221
2542
|
onPointerDown: () => {
|
|
2222
2543
|
},
|
|
2223
2544
|
onPointerMove: () => {
|
|
2224
2545
|
},
|
|
2225
2546
|
onPointerUp: () => {
|
|
2226
2547
|
},
|
|
2227
|
-
onWheel: (
|
|
2228
|
-
|
|
2548
|
+
onWheel: (B) => {
|
|
2549
|
+
Z.dispatchEvent(new WheelEvent(B.type, B));
|
|
2229
2550
|
},
|
|
2230
|
-
data:
|
|
2231
|
-
unitId:
|
|
2551
|
+
data: z,
|
|
2552
|
+
unitId: _
|
|
2232
2553
|
};
|
|
2233
|
-
e.eventPassThrough && (
|
|
2234
|
-
...
|
|
2235
|
-
onPointerDown: (
|
|
2236
|
-
|
|
2554
|
+
e.eventPassThrough && (Qe = {
|
|
2555
|
+
...Qe,
|
|
2556
|
+
onPointerDown: (B) => {
|
|
2557
|
+
Z.dispatchEvent(new PointerEvent(B.type, B));
|
|
2237
2558
|
},
|
|
2238
|
-
onPointerMove: (
|
|
2239
|
-
|
|
2559
|
+
onPointerMove: (B) => {
|
|
2560
|
+
Z.dispatchEvent(new PointerEvent(B.type, B));
|
|
2240
2561
|
},
|
|
2241
|
-
onPointerUp: (
|
|
2242
|
-
|
|
2562
|
+
onPointerUp: (B) => {
|
|
2563
|
+
Z.dispatchEvent(new PointerEvent(B.type, B));
|
|
2243
2564
|
}
|
|
2244
|
-
}), this._canvasFloatDomService.addFloatDom(
|
|
2245
|
-
const
|
|
2246
|
-
const
|
|
2247
|
-
|
|
2248
|
-
|
|
2565
|
+
}), this._canvasFloatDomService.addFloatDom(Qe);
|
|
2566
|
+
const Rt = le.onTransformChange$.subscribeEvent(() => {
|
|
2567
|
+
const B = me(le, V.renderUnit.scene, F.skeleton, E.worksheet, he);
|
|
2568
|
+
Ae.next(
|
|
2569
|
+
B
|
|
2249
2570
|
);
|
|
2250
2571
|
});
|
|
2251
|
-
this.disposeWithMe(
|
|
2252
|
-
const
|
|
2253
|
-
startX:
|
|
2572
|
+
this.disposeWithMe(p.subscribe((B) => {
|
|
2573
|
+
const Ne = Ut({
|
|
2574
|
+
startX: B.startX,
|
|
2254
2575
|
startY: 0,
|
|
2255
|
-
endX:
|
|
2256
|
-
endY:
|
|
2576
|
+
endX: B.endX,
|
|
2577
|
+
endY: B.endY,
|
|
2257
2578
|
width: n.width,
|
|
2258
2579
|
height: n.height,
|
|
2259
2580
|
absolute: {
|
|
2260
|
-
left:
|
|
2261
|
-
top:
|
|
2581
|
+
left: f.absolute.left,
|
|
2582
|
+
top: f.absolute.top
|
|
2262
2583
|
}
|
|
2263
|
-
}, n),
|
|
2264
|
-
left:
|
|
2584
|
+
}, n), et = De({ unitId: _, subUnitId: y, drawingId: R }), tt = new $e(et, {
|
|
2585
|
+
left: Ne.startX,
|
|
2265
2586
|
top: 0,
|
|
2266
2587
|
width: n.width,
|
|
2267
2588
|
height: n.height,
|
|
2268
|
-
zIndex: this._drawingManagerService.getDrawingOrder(
|
|
2269
|
-
}),
|
|
2270
|
-
|
|
2589
|
+
zIndex: this._drawingManagerService.getDrawingOrder(_, y).length - 1
|
|
2590
|
+
}), Dt = me(tt, V.renderUnit.scene, F.skeleton, E.worksheet, he);
|
|
2591
|
+
Ae.next(Dt);
|
|
2271
2592
|
}));
|
|
2272
|
-
const
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
}),
|
|
2276
|
-
this._canvasFloatDomService.removeFloatDom(
|
|
2277
|
-
}),
|
|
2593
|
+
const ge = (C = this._renderManagerService.getRenderById(_)) == null ? void 0 : C.with(X);
|
|
2594
|
+
ge == null || ge.currentSkeleton$.subscribe((B) => {
|
|
2595
|
+
B && c.sheetId !== B.sheetId && this._removeDom(m, !0);
|
|
2596
|
+
}), ne.add(() => {
|
|
2597
|
+
this._canvasFloatDomService.removeFloatDom(R);
|
|
2598
|
+
}), Rt && ne.add(Rt), this._domLayerInfoMap.set(R, he);
|
|
2278
2599
|
}
|
|
2279
2600
|
return {
|
|
2280
|
-
id:
|
|
2601
|
+
id: m,
|
|
2281
2602
|
dispose: () => {
|
|
2282
|
-
this._removeDom(
|
|
2603
|
+
this._removeDom(m, !0);
|
|
2283
2604
|
}
|
|
2284
2605
|
};
|
|
2285
2606
|
}
|
|
@@ -2296,19 +2617,19 @@ let tt = class extends ne {
|
|
|
2296
2617
|
// eslint-disable-next-line max-lines-per-function
|
|
2297
2618
|
_createRangePositionObserver(t, e, n) {
|
|
2298
2619
|
let { startRow: r, startColumn: s } = t;
|
|
2299
|
-
const o =
|
|
2300
|
-
const
|
|
2301
|
-
a.next(
|
|
2302
|
-
}, l = new
|
|
2303
|
-
l.add(e.engine.clientRect$.subscribe(() => c())), l.add(this._commandService.onCommandExecuted((
|
|
2304
|
-
if (
|
|
2620
|
+
const o = st(r, s, n), a = new je(o), d = st(t.endRow, t.endColumn, n), u = new je(d), c = () => {
|
|
2621
|
+
const p = st(r, s, n), w = st(t.endRow, t.endColumn, n);
|
|
2622
|
+
a.next(p), u.next(w);
|
|
2623
|
+
}, l = new yt();
|
|
2624
|
+
l.add(e.engine.clientRect$.subscribe(() => c())), l.add(this._commandService.onCommandExecuted((p) => {
|
|
2625
|
+
if (p.id === xi.id && p.params.rowsAutoHeightInfo.findIndex((S) => S.row === r) > -1) {
|
|
2305
2626
|
c();
|
|
2306
2627
|
return;
|
|
2307
2628
|
}
|
|
2308
|
-
(
|
|
2629
|
+
(Wi.indexOf(p.id) > -1 || p.id === ci.id || p.id === $n.id) && c();
|
|
2309
2630
|
}));
|
|
2310
|
-
const g = (
|
|
2311
|
-
r =
|
|
2631
|
+
const g = (p, w) => {
|
|
2632
|
+
r = p, s = w, c();
|
|
2312
2633
|
}, h = () => ({
|
|
2313
2634
|
rotate: 0,
|
|
2314
2635
|
width: d.right - o.left,
|
|
@@ -2321,27 +2642,27 @@ let tt = class extends ne {
|
|
|
2321
2642
|
startY: o.top,
|
|
2322
2643
|
endX: d.right,
|
|
2323
2644
|
endY: d.bottom
|
|
2324
|
-
}),
|
|
2325
|
-
|
|
2326
|
-
const
|
|
2645
|
+
}), m = a.pipe(
|
|
2646
|
+
pe((p) => {
|
|
2647
|
+
const w = st(t.endRow, t.endColumn, n);
|
|
2327
2648
|
return {
|
|
2328
2649
|
rotate: 0,
|
|
2329
|
-
width:
|
|
2330
|
-
height:
|
|
2650
|
+
width: w.right - p.left,
|
|
2651
|
+
height: w.bottom - p.top,
|
|
2331
2652
|
absolute: {
|
|
2332
2653
|
left: !0,
|
|
2333
2654
|
top: !0
|
|
2334
2655
|
},
|
|
2335
|
-
startX:
|
|
2336
|
-
startY:
|
|
2337
|
-
endX:
|
|
2338
|
-
endY:
|
|
2656
|
+
startX: p.left,
|
|
2657
|
+
startY: p.top,
|
|
2658
|
+
endX: w.right,
|
|
2659
|
+
endY: w.bottom
|
|
2339
2660
|
};
|
|
2340
2661
|
})
|
|
2341
|
-
),
|
|
2662
|
+
), f = h();
|
|
2342
2663
|
return {
|
|
2343
|
-
position$:
|
|
2344
|
-
position:
|
|
2664
|
+
position$: m,
|
|
2665
|
+
position: f,
|
|
2345
2666
|
updateRowCol: g,
|
|
2346
2667
|
topLeftPos$: a,
|
|
2347
2668
|
rightBottomPos$: u,
|
|
@@ -2349,16 +2670,16 @@ let tt = class extends ne {
|
|
|
2349
2670
|
};
|
|
2350
2671
|
}
|
|
2351
2672
|
};
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
],
|
|
2361
|
-
function
|
|
2673
|
+
lt = eo([
|
|
2674
|
+
be(0, A(Q)),
|
|
2675
|
+
be(1, de),
|
|
2676
|
+
be(2, A(Y)),
|
|
2677
|
+
be(3, oe),
|
|
2678
|
+
be(4, A(as)),
|
|
2679
|
+
be(5, se),
|
|
2680
|
+
be(6, A(Si))
|
|
2681
|
+
], lt);
|
|
2682
|
+
function st(i, t, e) {
|
|
2362
2683
|
const n = e.getCellWithCoordByIndex(i, t), r = n.isMergedMainCell ? n.mergeInfo : n;
|
|
2363
2684
|
return {
|
|
2364
2685
|
left: r.startX,
|
|
@@ -2367,22 +2688,22 @@ function Je(i, t, e) {
|
|
|
2367
2688
|
bottom: r.endY
|
|
2368
2689
|
};
|
|
2369
2690
|
}
|
|
2370
|
-
function
|
|
2691
|
+
function Ut(i, t, e) {
|
|
2371
2692
|
var u, c;
|
|
2372
2693
|
e = e != null ? e : 1;
|
|
2373
2694
|
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;
|
|
2374
2695
|
let a = 0, d = 0;
|
|
2375
2696
|
if (t) {
|
|
2376
2697
|
if (t.horizonOffsetAlign === "right") {
|
|
2377
|
-
const l =
|
|
2698
|
+
const l = Pt(t.marginX, n * e);
|
|
2378
2699
|
a = i.endX - l - s;
|
|
2379
2700
|
} else
|
|
2380
|
-
a = i.startX +
|
|
2701
|
+
a = i.startX + Pt(t.marginX, n);
|
|
2381
2702
|
if (t.verticalOffsetAlign === "bottom") {
|
|
2382
|
-
const l =
|
|
2703
|
+
const l = Pt(t.marginY, r * e);
|
|
2383
2704
|
d = i.endY - l - o;
|
|
2384
2705
|
} else
|
|
2385
|
-
d = i.startY +
|
|
2706
|
+
d = i.startY + Pt(t.marginY, r);
|
|
2386
2707
|
}
|
|
2387
2708
|
return {
|
|
2388
2709
|
rotate: 0,
|
|
@@ -2398,15 +2719,15 @@ function Ct(i, t, e) {
|
|
|
2398
2719
|
}
|
|
2399
2720
|
};
|
|
2400
2721
|
}
|
|
2401
|
-
function
|
|
2722
|
+
function Pt(i, t) {
|
|
2402
2723
|
if (i === void 0) return 0;
|
|
2403
2724
|
if (typeof i == "number") return i;
|
|
2404
2725
|
const e = Number.parseFloat(i);
|
|
2405
2726
|
return t * e / 100;
|
|
2406
2727
|
}
|
|
2407
|
-
const
|
|
2408
|
-
const { floatDomInfos: t, scene: e, skeleton: n, worksheet: r } = i, s =
|
|
2409
|
-
const { width: a, height: d, angle: u, left: c, top: l } = o.transform, g =
|
|
2728
|
+
const no = (i) => {
|
|
2729
|
+
const { floatDomInfos: t, scene: e, skeleton: n, worksheet: r } = i, s = Fe(() => t.map((o) => {
|
|
2730
|
+
const { width: a, height: d, angle: u, left: c, top: l } = o.transform, g = Hr(
|
|
2410
2731
|
{
|
|
2411
2732
|
left: c != null ? c : 0,
|
|
2412
2733
|
right: (c != null ? c : 0) + (a != null ? a : 0),
|
|
@@ -2418,18 +2739,18 @@ const Ts = (i) => {
|
|
|
2418
2739
|
r,
|
|
2419
2740
|
void 0,
|
|
2420
2741
|
!0
|
|
2421
|
-
), { scaleX: h, scaleY:
|
|
2742
|
+
), { scaleX: h, scaleY: m } = e.getAncestorScale(), f = {
|
|
2422
2743
|
startX: g.left,
|
|
2423
2744
|
endX: g.right,
|
|
2424
2745
|
startY: g.top,
|
|
2425
2746
|
endY: g.bottom,
|
|
2426
2747
|
rotate: u,
|
|
2427
2748
|
width: a * h,
|
|
2428
|
-
height: d *
|
|
2749
|
+
height: d * m,
|
|
2429
2750
|
absolute: g.absolute
|
|
2430
|
-
},
|
|
2431
|
-
position$: new
|
|
2432
|
-
position:
|
|
2751
|
+
}, p = {
|
|
2752
|
+
position$: new je(f),
|
|
2753
|
+
position: f,
|
|
2433
2754
|
id: o.drawingId,
|
|
2434
2755
|
componentKey: o.componentKey,
|
|
2435
2756
|
onPointerMove: () => {
|
|
@@ -2443,16 +2764,16 @@ const Ts = (i) => {
|
|
|
2443
2764
|
unitId: o.unitId,
|
|
2444
2765
|
data: o.data
|
|
2445
2766
|
};
|
|
2446
|
-
return [o.drawingId,
|
|
2767
|
+
return [o.drawingId, p];
|
|
2447
2768
|
}), [t, e, n, r]);
|
|
2448
|
-
return /* @__PURE__ */
|
|
2769
|
+
return /* @__PURE__ */ L("div", { style: { position: "absolute", top: 0, left: 0 }, children: s.map(([o, a]) => /* @__PURE__ */ L(cs, { layer: a, id: o, position: a.position }, o)) });
|
|
2449
2770
|
};
|
|
2450
|
-
var
|
|
2451
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
2771
|
+
var ro = Object.getOwnPropertyDescriptor, io = (i, t, e, n) => {
|
|
2772
|
+
for (var r = n > 1 ? void 0 : n ? ro(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
2452
2773
|
(o = i[s]) && (r = o(r) || r);
|
|
2453
2774
|
return r;
|
|
2454
|
-
},
|
|
2455
|
-
let
|
|
2775
|
+
}, Me = (i, t) => (e, n) => t(e, n, i);
|
|
2776
|
+
let jt = class extends ee {
|
|
2456
2777
|
constructor(i, t, e, n, r, s, o) {
|
|
2457
2778
|
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();
|
|
2458
2779
|
}
|
|
@@ -2465,7 +2786,7 @@ let Ot = class extends ne {
|
|
|
2465
2786
|
const { unitId: n, scene: r, subUnitId: s } = t, o = this._drawingManagerService.getDrawingDataForUnit(n), a = o == null ? void 0 : o[s];
|
|
2466
2787
|
return a && a.order.forEach((d) => {
|
|
2467
2788
|
const u = a.data[d];
|
|
2468
|
-
u.drawingType !==
|
|
2789
|
+
u.drawingType !== x.DRAWING_CHART && u.drawingType !== x.DRAWING_DOM && this._drawingRenderService.renderDrawing(u, r);
|
|
2469
2790
|
}), e();
|
|
2470
2791
|
}
|
|
2471
2792
|
}
|
|
@@ -2478,7 +2799,7 @@ let Ot = class extends ne {
|
|
|
2478
2799
|
const { unitId: n, subUnitId: r } = t, s = this._renderManagerService.getRenderById(n);
|
|
2479
2800
|
if (!s)
|
|
2480
2801
|
return e(i);
|
|
2481
|
-
const o = s.with(
|
|
2802
|
+
const o = s.with(X).getSkeletonParam(r);
|
|
2482
2803
|
if (!o)
|
|
2483
2804
|
return e(i);
|
|
2484
2805
|
const a = this._drawingManagerService.getDrawingDataForUnit(n), d = a == null ? void 0 : a[t.subUnitId];
|
|
@@ -2486,9 +2807,9 @@ let Ot = class extends ne {
|
|
|
2486
2807
|
return e(i);
|
|
2487
2808
|
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]);
|
|
2488
2809
|
return g.length ? (g.forEach((h) => {
|
|
2489
|
-
if (!h.groupId && h.transform &&
|
|
2490
|
-
const
|
|
2491
|
-
|
|
2810
|
+
if (!h.groupId && h.transform && Ye.isDefine(h.transform.left) && Ye.isDefine(h.transform.top) && Ye.isDefine(h.transform.width) && Ye.isDefine(h.transform.height)) {
|
|
2811
|
+
const m = o.skeleton.getCellIndexByOffset(h.transform.left, h.transform.top, u, c, { x: 0, y: 0 }), f = o.skeleton.getCellIndexByOffset(h.transform.left + h.transform.width, h.transform.top + h.transform.height, u, c, { x: 0, y: 0 });
|
|
2812
|
+
m.column < l.startColumn && (l.startColumn = m.column), m.row < l.startRow && (l.startRow = m.row), l.endRow < f.row && (l.endRow = f.row), l.endColumn < f.column && (l.endColumn = f.column);
|
|
2492
2813
|
}
|
|
2493
2814
|
}), e(l)) : e(i);
|
|
2494
2815
|
}
|
|
@@ -2506,12 +2827,12 @@ let Ot = class extends ne {
|
|
|
2506
2827
|
if (o) {
|
|
2507
2828
|
const a = o.order.map((u) => {
|
|
2508
2829
|
const c = o.data[u];
|
|
2509
|
-
if (c.drawingType ===
|
|
2830
|
+
if (c.drawingType === x.DRAWING_CHART)
|
|
2510
2831
|
return {
|
|
2511
2832
|
...c,
|
|
2512
|
-
componentKey: this._componetManager.get(
|
|
2833
|
+
componentKey: this._componetManager.get(Ci)
|
|
2513
2834
|
};
|
|
2514
|
-
if (c.drawingType ===
|
|
2835
|
+
if (c.drawingType === x.DRAWING_DOM) {
|
|
2515
2836
|
const l = this._sheetPrintInterceptorService.getPrintComponent(c.componentKey);
|
|
2516
2837
|
return {
|
|
2517
2838
|
...c,
|
|
@@ -2519,12 +2840,12 @@ let Ot = class extends ne {
|
|
|
2519
2840
|
};
|
|
2520
2841
|
}
|
|
2521
2842
|
return null;
|
|
2522
|
-
}).filter(Boolean), d =
|
|
2523
|
-
return
|
|
2524
|
-
/* @__PURE__ */
|
|
2843
|
+
}).filter(Boolean), d = ds(no, this._injector);
|
|
2844
|
+
return Xi(
|
|
2845
|
+
/* @__PURE__ */ L(d, { floatDomInfos: a, scene: t.scene, skeleton: t.skeleton, worksheet: t.worksheet }),
|
|
2525
2846
|
t.root
|
|
2526
2847
|
), i == null || i.add(() => {
|
|
2527
|
-
|
|
2848
|
+
zi(t.root);
|
|
2528
2849
|
}), e(i);
|
|
2529
2850
|
}
|
|
2530
2851
|
}
|
|
@@ -2533,49 +2854,49 @@ let Ot = class extends ne {
|
|
|
2533
2854
|
);
|
|
2534
2855
|
}
|
|
2535
2856
|
};
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
],
|
|
2545
|
-
var
|
|
2546
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
2857
|
+
jt = io([
|
|
2858
|
+
Me(0, A(di)),
|
|
2859
|
+
Me(1, A(Pr)),
|
|
2860
|
+
Me(2, oe),
|
|
2861
|
+
Me(3, Q),
|
|
2862
|
+
Me(4, A(lt)),
|
|
2863
|
+
Me(5, A(Ur)),
|
|
2864
|
+
Me(6, A(qe))
|
|
2865
|
+
], jt);
|
|
2866
|
+
var so = Object.getOwnPropertyDescriptor, oo = (i, t, e, n) => {
|
|
2867
|
+
for (var r = n > 1 ? void 0 : n ? so(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
2547
2868
|
(o = i[s]) && (r = o(r) || r);
|
|
2548
2869
|
return r;
|
|
2549
|
-
},
|
|
2550
|
-
const
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
],
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2870
|
+
}, _e = (i, t) => (e, n) => t(e, n, i);
|
|
2871
|
+
const ao = [
|
|
2872
|
+
gr.id,
|
|
2873
|
+
mr.id,
|
|
2874
|
+
fr.id,
|
|
2875
|
+
pr.id,
|
|
2876
|
+
wr.id,
|
|
2877
|
+
_r.id,
|
|
2878
|
+
Sr.id,
|
|
2879
|
+
vr.id,
|
|
2880
|
+
fn.id,
|
|
2881
|
+
pn.id,
|
|
2882
|
+
Ir.id,
|
|
2883
|
+
Cr.id,
|
|
2884
|
+
Rr.id,
|
|
2885
|
+
Dr.id,
|
|
2886
|
+
br.id,
|
|
2887
|
+
Mr.id,
|
|
2888
|
+
yr.id,
|
|
2889
|
+
Er.id,
|
|
2890
|
+
Tr.id
|
|
2891
|
+
], co = [
|
|
2892
|
+
Bi.id,
|
|
2893
|
+
ji.id,
|
|
2894
|
+
Fi.id,
|
|
2895
|
+
Li.id,
|
|
2896
|
+
Hi.id,
|
|
2897
|
+
Vi.id
|
|
2577
2898
|
];
|
|
2578
|
-
let
|
|
2899
|
+
let Rn = class extends ee {
|
|
2579
2900
|
constructor(i, t, e, n, r, s, o, a, d) {
|
|
2580
2901
|
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();
|
|
2581
2902
|
}
|
|
@@ -2584,57 +2905,57 @@ let rn = class extends ne {
|
|
|
2584
2905
|
this._sheetInterceptorService.interceptAfterCommand({
|
|
2585
2906
|
/* eslint-disable-next-line complexity */
|
|
2586
2907
|
getMutations: (i) => {
|
|
2587
|
-
if (!
|
|
2908
|
+
if (!ao.includes(i.id))
|
|
2588
2909
|
return { redos: [], undos: [] };
|
|
2589
2910
|
if (i.params == null)
|
|
2590
2911
|
return { redos: [], undos: [] };
|
|
2591
2912
|
const t = i.id;
|
|
2592
|
-
if (t ===
|
|
2913
|
+
if (t === gr.id)
|
|
2593
2914
|
return this._moveRowInterceptor(i.params, "insert");
|
|
2594
|
-
if ([
|
|
2915
|
+
if ([yr.id, Er.id, Tr.id].includes(t))
|
|
2595
2916
|
return this._moveRangeInterceptor(i.params);
|
|
2596
|
-
if (t ===
|
|
2917
|
+
if (t === mr.id)
|
|
2597
2918
|
return this._moveColInterceptor(i.params, "insert");
|
|
2598
|
-
if (t ===
|
|
2919
|
+
if (t === fr.id)
|
|
2599
2920
|
return this._moveRowInterceptor(i.params, "remove");
|
|
2600
|
-
if (t ===
|
|
2921
|
+
if (t === pr.id)
|
|
2601
2922
|
return this._moveColInterceptor(i.params, "remove");
|
|
2602
|
-
if (t ===
|
|
2923
|
+
if (t === wr.id) {
|
|
2603
2924
|
const { range: e } = i.params;
|
|
2604
2925
|
return this._getRangeMoveUndo(
|
|
2605
2926
|
e,
|
|
2606
2927
|
0
|
|
2607
2928
|
/* deleteLeft */
|
|
2608
2929
|
);
|
|
2609
|
-
} else if (t ===
|
|
2930
|
+
} else if (t === _r.id) {
|
|
2610
2931
|
const { range: e } = i.params;
|
|
2611
2932
|
return this._getRangeMoveUndo(
|
|
2612
2933
|
e,
|
|
2613
2934
|
1
|
|
2614
2935
|
/* deleteUp */
|
|
2615
2936
|
);
|
|
2616
|
-
} else if (t ===
|
|
2937
|
+
} else if (t === Sr.id) {
|
|
2617
2938
|
const { range: e } = i.params;
|
|
2618
2939
|
return this._getRangeMoveUndo(
|
|
2619
2940
|
e,
|
|
2620
2941
|
2
|
|
2621
2942
|
/* insertDown */
|
|
2622
2943
|
);
|
|
2623
|
-
} else if (t ===
|
|
2944
|
+
} else if (t === vr.id) {
|
|
2624
2945
|
const { range: e } = i.params;
|
|
2625
2946
|
return this._getRangeMoveUndo(
|
|
2626
2947
|
e,
|
|
2627
2948
|
3
|
|
2628
2949
|
/* insertRight */
|
|
2629
2950
|
);
|
|
2630
|
-
} else if (t ===
|
|
2951
|
+
} else if (t === Rr.id || t === Dr.id) {
|
|
2631
2952
|
const e = i.params, { unitId: n, subUnitId: r, ranges: s } = e;
|
|
2632
2953
|
return this._getDrawingUndoForRowVisible(n, r, s);
|
|
2633
|
-
} else if (t ===
|
|
2954
|
+
} else if (t === br.id || t === Mr.id) {
|
|
2634
2955
|
const e = i.params, { unitId: n, subUnitId: r, ranges: s } = e;
|
|
2635
2956
|
return this._getDrawingUndoForColVisible(n, r, s);
|
|
2636
|
-
} else if (t ===
|
|
2637
|
-
const e = i.params, { unitId: n, subUnitId: r, ranges: s } = e, o = t ===
|
|
2957
|
+
} else if (t === fn.id || t === pn.id || t === Ir.id || t === Cr.id) {
|
|
2958
|
+
const e = i.params, { unitId: n, subUnitId: r, ranges: s } = e, o = t === fn.id || t === pn.id;
|
|
2638
2959
|
return this._getDrawingUndoForRowAndColSize(n, r, s, o);
|
|
2639
2960
|
}
|
|
2640
2961
|
return { redos: [], undos: [] };
|
|
@@ -2643,7 +2964,7 @@ let rn = class extends ne {
|
|
|
2643
2964
|
);
|
|
2644
2965
|
}
|
|
2645
2966
|
_getRangeMoveUndo(i, t) {
|
|
2646
|
-
const e =
|
|
2967
|
+
const e = ae(this._univerInstanceService);
|
|
2647
2968
|
if (e == null)
|
|
2648
2969
|
return { redos: [], undos: [] };
|
|
2649
2970
|
const n = e.unitId, r = e.subUnitId, s = [], o = [], a = this._sheetDrawingService.getDrawingData(n, r), d = [], u = [];
|
|
@@ -2660,49 +2981,49 @@ let rn = class extends ne {
|
|
|
2660
2981
|
const c = this._sheetDrawingService.getBatchRemoveOp(u), l = c.undo, g = c.redo, h = c.objects;
|
|
2661
2982
|
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 } });
|
|
2662
2983
|
}
|
|
2663
|
-
return s.push({ id:
|
|
2984
|
+
return s.push({ id: H.id, params: [n] }), o.push({ id: H.id, params: [n] }), {
|
|
2664
2985
|
redos: s,
|
|
2665
2986
|
undos: o
|
|
2666
2987
|
};
|
|
2667
2988
|
}
|
|
2668
2989
|
_getUpdateOrDeleteDrawings(i, t, e) {
|
|
2669
|
-
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:
|
|
2990
|
+
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: m } = l, { row: f, column: p } = g;
|
|
2670
2991
|
if (s == null || a == null)
|
|
2671
2992
|
return {
|
|
2672
2993
|
updateDrawings: n,
|
|
2673
2994
|
deleteDrawings: r
|
|
2674
2995
|
};
|
|
2675
|
-
const { startRow:
|
|
2676
|
-
let
|
|
2677
|
-
if (t === 0 && h >=
|
|
2678
|
-
if (
|
|
2996
|
+
const { startRow: w, endRow: S, startColumn: I, endColumn: D } = i;
|
|
2997
|
+
let v = null, C = null;
|
|
2998
|
+
if (t === 0 && h >= w && f <= S)
|
|
2999
|
+
if (m >= I && p <= D)
|
|
2679
3000
|
r.push({ unitId: d, subUnitId: u, drawingId: c });
|
|
2680
3001
|
else {
|
|
2681
|
-
const
|
|
2682
|
-
|
|
3002
|
+
const _ = this._shrinkCol(s, a, I, D, o);
|
|
3003
|
+
v = _ == null ? void 0 : _.newSheetTransform, C = _ == null ? void 0 : _.newTransform;
|
|
2683
3004
|
}
|
|
2684
|
-
else if (t === 1 &&
|
|
2685
|
-
if (h >=
|
|
3005
|
+
else if (t === 1 && m >= I && p <= D)
|
|
3006
|
+
if (h >= w && f <= S)
|
|
2686
3007
|
r.push({ unitId: d, subUnitId: u, drawingId: c });
|
|
2687
3008
|
else {
|
|
2688
|
-
const
|
|
2689
|
-
|
|
3009
|
+
const _ = this._shrinkRow(s, a, w, S, o);
|
|
3010
|
+
v = _ == null ? void 0 : _.newSheetTransform, C = _ == null ? void 0 : _.newTransform;
|
|
2690
3011
|
}
|
|
2691
3012
|
else if (t === 2) {
|
|
2692
|
-
const
|
|
2693
|
-
|
|
3013
|
+
const _ = this._expandRow(s, a, w, S, o);
|
|
3014
|
+
v = _ == null ? void 0 : _.newSheetTransform, C = _ == null ? void 0 : _.newTransform;
|
|
2694
3015
|
} else if (t === 3) {
|
|
2695
|
-
const
|
|
2696
|
-
|
|
3016
|
+
const _ = this._expandCol(s, a, I, D, o);
|
|
3017
|
+
v = _ == null ? void 0 : _.newSheetTransform, C = _ == null ? void 0 : _.newTransform;
|
|
2697
3018
|
}
|
|
2698
|
-
if (
|
|
2699
|
-
const
|
|
2700
|
-
n.push({ ...e, sheetTransform:
|
|
3019
|
+
if (v != null && C != null) {
|
|
3020
|
+
const _ = J(v, this._selectionRenderService, this._skeletonManagerService);
|
|
3021
|
+
n.push({ ...e, sheetTransform: v, transform: _ });
|
|
2701
3022
|
}
|
|
2702
3023
|
return { updateDrawings: n, deleteDrawings: r };
|
|
2703
3024
|
}
|
|
2704
3025
|
_remainDrawingSize(i, t, e) {
|
|
2705
|
-
const n =
|
|
3026
|
+
const n = j({ ...i }, this._selectionRenderService);
|
|
2706
3027
|
n != null && t.push({
|
|
2707
3028
|
...e,
|
|
2708
3029
|
sheetTransform: n
|
|
@@ -2712,35 +3033,35 @@ let rn = class extends ne {
|
|
|
2712
3033
|
_getDrawingUndoForColVisible(i, t, e) {
|
|
2713
3034
|
const n = this._drawingManagerService.getDrawingData(i, t), r = [], s = [];
|
|
2714
3035
|
if (Object.keys(n).forEach((c) => {
|
|
2715
|
-
const l = n[c], { sheetTransform: g, transform: h, anchorType:
|
|
2716
|
-
if (
|
|
3036
|
+
const l = n[c], { sheetTransform: g, transform: h, anchorType: m = O.Position } = l;
|
|
3037
|
+
if (m === O.None)
|
|
2717
3038
|
this._remainDrawingSize(h, r, l);
|
|
2718
3039
|
else {
|
|
2719
|
-
const { from:
|
|
2720
|
-
for (let
|
|
2721
|
-
const C = e[
|
|
2722
|
-
if (
|
|
3040
|
+
const { from: f, to: p } = g, { row: w, column: S } = f, { row: I, column: D } = p;
|
|
3041
|
+
for (let v = 0; v < e.length; v++) {
|
|
3042
|
+
const C = e[v], { startRow: _, endRow: y, startColumn: R, endColumn: E } = C;
|
|
3043
|
+
if (D < R)
|
|
2723
3044
|
continue;
|
|
2724
|
-
if (
|
|
3045
|
+
if (m === O.Position) {
|
|
2725
3046
|
let b = null, N = null;
|
|
2726
|
-
if (
|
|
2727
|
-
const
|
|
2728
|
-
if (
|
|
3047
|
+
if (S >= R && S <= E) {
|
|
3048
|
+
const F = this._skeletonManagerService.attachRangeWithCoord({ startColumn: S, endColumn: E, startRow: f.row, endRow: p.row });
|
|
3049
|
+
if (F == null)
|
|
2729
3050
|
return;
|
|
2730
|
-
N = { ...h, left:
|
|
3051
|
+
N = { ...h, left: F.startX };
|
|
2731
3052
|
}
|
|
2732
|
-
if (N != null && (b =
|
|
3053
|
+
if (N != null && (b = j(N, this._selectionRenderService), b != null && N != null)) {
|
|
2733
3054
|
r.push({ ...l, sheetTransform: b, transform: N });
|
|
2734
3055
|
break;
|
|
2735
3056
|
}
|
|
2736
3057
|
this._remainDrawingSize(h, r, l);
|
|
2737
3058
|
continue;
|
|
2738
3059
|
}
|
|
2739
|
-
if (
|
|
3060
|
+
if (S >= R && D <= E)
|
|
2740
3061
|
continue;
|
|
2741
|
-
let
|
|
2742
|
-
if (
|
|
2743
|
-
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn:
|
|
3062
|
+
let T = null, M = null;
|
|
3063
|
+
if (S >= R && S <= E) {
|
|
3064
|
+
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: S, endColumn: E, startRow: f.row, endRow: p.row });
|
|
2744
3065
|
if (b == null)
|
|
2745
3066
|
return;
|
|
2746
3067
|
M = {
|
|
@@ -2748,8 +3069,8 @@ let rn = class extends ne {
|
|
|
2748
3069
|
left: (b == null ? void 0 : b.startX) || 0,
|
|
2749
3070
|
width: ((h == null ? void 0 : h.width) || 0) - b.endX + b.startX
|
|
2750
3071
|
};
|
|
2751
|
-
} else if (
|
|
2752
|
-
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn:
|
|
3072
|
+
} else if (D >= R && D <= E) {
|
|
3073
|
+
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: R, endColumn: D, startRow: f.row, endRow: p.row });
|
|
2753
3074
|
if (b == null)
|
|
2754
3075
|
return;
|
|
2755
3076
|
M = {
|
|
@@ -2757,19 +3078,19 @@ let rn = class extends ne {
|
|
|
2757
3078
|
left: b.startX - ((h == null ? void 0 : h.width) || 0)
|
|
2758
3079
|
};
|
|
2759
3080
|
} else {
|
|
2760
|
-
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn:
|
|
3081
|
+
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: R, endColumn: E, startRow: f.row, endRow: p.row });
|
|
2761
3082
|
if (b == null)
|
|
2762
3083
|
return;
|
|
2763
3084
|
if (M = {
|
|
2764
3085
|
...h,
|
|
2765
3086
|
width: ((h == null ? void 0 : h.width) || 0) - b.endX + b.startX
|
|
2766
|
-
},
|
|
2767
|
-
s.push({ ...l, sheetTransform:
|
|
3087
|
+
}, T = j(M, this._selectionRenderService), T != null && M != null) {
|
|
3088
|
+
s.push({ ...l, sheetTransform: T, transform: M });
|
|
2768
3089
|
break;
|
|
2769
3090
|
}
|
|
2770
3091
|
}
|
|
2771
|
-
if (M != null && (
|
|
2772
|
-
r.push({ ...l, sheetTransform:
|
|
3092
|
+
if (M != null && (T = j(M, this._selectionRenderService)), M != null && T != null) {
|
|
3093
|
+
r.push({ ...l, sheetTransform: T, transform: M });
|
|
2773
3094
|
break;
|
|
2774
3095
|
} else
|
|
2775
3096
|
this._remainDrawingSize(h, r, l);
|
|
@@ -2792,10 +3113,10 @@ let rn = class extends ne {
|
|
|
2792
3113
|
_createUndoAndRedoMutation(i, t, e) {
|
|
2793
3114
|
const n = this._sheetDrawingService.getBatchUpdateOp(e), { undo: r, redo: s, objects: o } = n, a = [
|
|
2794
3115
|
{ id: P.id, params: { unitId: i, subUnitId: t, op: s, objects: o, type: U.UPDATE } },
|
|
2795
|
-
{ id:
|
|
3116
|
+
{ id: H.id, params: [i] }
|
|
2796
3117
|
], d = [
|
|
2797
3118
|
{ id: P.id, params: { unitId: i, subUnitId: t, op: r, objects: o, type: U.UPDATE } },
|
|
2798
|
-
{ id:
|
|
3119
|
+
{ id: H.id, params: [i] }
|
|
2799
3120
|
];
|
|
2800
3121
|
return {
|
|
2801
3122
|
redos: a,
|
|
@@ -2806,35 +3127,35 @@ let rn = class extends ne {
|
|
|
2806
3127
|
_getDrawingUndoForRowVisible(i, t, e) {
|
|
2807
3128
|
const n = this._drawingManagerService.getDrawingData(i, t), r = [], s = [];
|
|
2808
3129
|
if (Object.keys(n).forEach((c) => {
|
|
2809
|
-
const l = n[c], { sheetTransform: g, transform: h, anchorType:
|
|
2810
|
-
if (
|
|
3130
|
+
const l = n[c], { sheetTransform: g, transform: h, anchorType: m = O.Position } = l;
|
|
3131
|
+
if (m === O.None)
|
|
2811
3132
|
this._remainDrawingSize(h, r, l);
|
|
2812
3133
|
else {
|
|
2813
|
-
const { from:
|
|
2814
|
-
for (let
|
|
2815
|
-
const C = e[
|
|
2816
|
-
if (I <
|
|
3134
|
+
const { from: f, to: p } = g, { row: w, column: S } = f, { row: I, column: D } = p;
|
|
3135
|
+
for (let v = 0; v < e.length; v++) {
|
|
3136
|
+
const C = e[v], { startRow: _, endRow: y, startColumn: R, endColumn: E } = C;
|
|
3137
|
+
if (I < _)
|
|
2817
3138
|
continue;
|
|
2818
|
-
if (
|
|
3139
|
+
if (m === O.Position) {
|
|
2819
3140
|
let b = null, N = null;
|
|
2820
|
-
if (
|
|
2821
|
-
const
|
|
2822
|
-
if (
|
|
3141
|
+
if (w >= _ && w <= y) {
|
|
3142
|
+
const F = this._skeletonManagerService.attachRangeWithCoord({ startColumn: f.column, endColumn: p.column, startRow: w, endRow: y });
|
|
3143
|
+
if (F == null)
|
|
2823
3144
|
return;
|
|
2824
|
-
N = { ...h, top:
|
|
3145
|
+
N = { ...h, top: F.startY };
|
|
2825
3146
|
}
|
|
2826
|
-
if (N != null && (b =
|
|
3147
|
+
if (N != null && (b = j(N, this._selectionRenderService), b != null && N != null)) {
|
|
2827
3148
|
r.push({ ...l, sheetTransform: b, transform: N });
|
|
2828
3149
|
break;
|
|
2829
3150
|
}
|
|
2830
3151
|
this._remainDrawingSize(h, r, l);
|
|
2831
3152
|
continue;
|
|
2832
3153
|
}
|
|
2833
|
-
if (
|
|
3154
|
+
if (w >= _ && I <= y)
|
|
2834
3155
|
continue;
|
|
2835
|
-
let
|
|
2836
|
-
if (
|
|
2837
|
-
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn:
|
|
3156
|
+
let T = null, M = null;
|
|
3157
|
+
if (w >= _ && w <= y) {
|
|
3158
|
+
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: f.column, endColumn: p.column, startRow: w, endRow: y });
|
|
2838
3159
|
if (b == null)
|
|
2839
3160
|
return;
|
|
2840
3161
|
M = {
|
|
@@ -2842,8 +3163,8 @@ let rn = class extends ne {
|
|
|
2842
3163
|
top: (b == null ? void 0 : b.startY) || 0,
|
|
2843
3164
|
height: ((h == null ? void 0 : h.height) || 0) - b.endY + b.startY
|
|
2844
3165
|
};
|
|
2845
|
-
} else if (I >=
|
|
2846
|
-
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn:
|
|
3166
|
+
} else if (I >= _ && I <= y) {
|
|
3167
|
+
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: f.column, endColumn: p.column, startRow: _, endRow: I });
|
|
2847
3168
|
if (b == null)
|
|
2848
3169
|
return;
|
|
2849
3170
|
M = {
|
|
@@ -2851,19 +3172,19 @@ let rn = class extends ne {
|
|
|
2851
3172
|
top: b.startY - ((h == null ? void 0 : h.height) || 0)
|
|
2852
3173
|
};
|
|
2853
3174
|
} else {
|
|
2854
|
-
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn:
|
|
3175
|
+
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: f.column, endColumn: p.column, startRow: _, endRow: y });
|
|
2855
3176
|
if (b == null)
|
|
2856
3177
|
return;
|
|
2857
3178
|
if (M = {
|
|
2858
3179
|
...h,
|
|
2859
3180
|
height: ((h == null ? void 0 : h.height) || 0) - b.endY + b.startY
|
|
2860
|
-
},
|
|
2861
|
-
s.push({ ...l, sheetTransform:
|
|
3181
|
+
}, T = j(M, this._selectionRenderService), T != null && M != null) {
|
|
3182
|
+
s.push({ ...l, sheetTransform: T, transform: M });
|
|
2862
3183
|
break;
|
|
2863
3184
|
}
|
|
2864
3185
|
}
|
|
2865
|
-
if (M != null && (
|
|
2866
|
-
r.push({ ...l, sheetTransform:
|
|
3186
|
+
if (M != null && (T = j(M, this._selectionRenderService)), M != null && T != null) {
|
|
3187
|
+
r.push({ ...l, sheetTransform: T, transform: M });
|
|
2867
3188
|
break;
|
|
2868
3189
|
} else
|
|
2869
3190
|
this._remainDrawingSize(h, r, l);
|
|
@@ -2890,20 +3211,20 @@ let rn = class extends ne {
|
|
|
2890
3211
|
if (c === O.None)
|
|
2891
3212
|
this._remainDrawingSize(u, s, a);
|
|
2892
3213
|
else {
|
|
2893
|
-
const { from: l, to: g } = d, { row: h, column:
|
|
2894
|
-
for (let
|
|
2895
|
-
const
|
|
2896
|
-
if (
|
|
3214
|
+
const { from: l, to: g } = d, { row: h, column: m } = l, { row: f, column: p } = g;
|
|
3215
|
+
for (let w = 0; w < e.length; w++) {
|
|
3216
|
+
const S = e[w], { startRow: I, endRow: D, startColumn: v, endColumn: C } = S;
|
|
3217
|
+
if (f < I || p < v)
|
|
2897
3218
|
continue;
|
|
2898
|
-
if (c === O.Position && (h <= I &&
|
|
3219
|
+
if (c === O.Position && (h <= I && f >= D || m <= v && p >= C)) {
|
|
2899
3220
|
this._remainDrawingSize(u, s, a);
|
|
2900
3221
|
continue;
|
|
2901
3222
|
}
|
|
2902
|
-
const
|
|
2903
|
-
if (
|
|
3223
|
+
const _ = J({ ...d }, this._selectionRenderService, this._skeletonManagerService);
|
|
3224
|
+
if (_ != null) {
|
|
2904
3225
|
s.push({
|
|
2905
3226
|
...a,
|
|
2906
|
-
transform:
|
|
3227
|
+
transform: _
|
|
2907
3228
|
});
|
|
2908
3229
|
break;
|
|
2909
3230
|
}
|
|
@@ -2916,7 +3237,7 @@ let rn = class extends ne {
|
|
|
2916
3237
|
if (t === "insert")
|
|
2917
3238
|
e = i.unitId, n = i.subUnitId;
|
|
2918
3239
|
else {
|
|
2919
|
-
const r =
|
|
3240
|
+
const r = ae(this._univerInstanceService);
|
|
2920
3241
|
if (r == null)
|
|
2921
3242
|
return;
|
|
2922
3243
|
e = r.unitId, n = r.subUnitId;
|
|
@@ -2924,50 +3245,50 @@ let rn = class extends ne {
|
|
|
2924
3245
|
return { unitId: e, subUnitId: n };
|
|
2925
3246
|
}
|
|
2926
3247
|
_moveRangeInterceptor(i) {
|
|
2927
|
-
var I,
|
|
2928
|
-
const { toRange: t, fromRange: e } = i, n =
|
|
3248
|
+
var I, D;
|
|
3249
|
+
const { toRange: t, fromRange: e } = i, n = ae(this._univerInstanceService);
|
|
2929
3250
|
if (!n)
|
|
2930
3251
|
return { redos: [], undos: [] };
|
|
2931
|
-
const { unitId: r, subUnitId: s } = n, o = (
|
|
3252
|
+
const { unitId: r, subUnitId: s } = n, o = (D = (I = this._renderManagerService.getRenderById(r)) == null ? void 0 : I.with(X)) == null ? void 0 : D.getCurrentSkeleton();
|
|
2932
3253
|
if (!o)
|
|
2933
3254
|
return { redos: [], undos: [] };
|
|
2934
|
-
const a =
|
|
3255
|
+
const a = dr(o, e);
|
|
2935
3256
|
if (!a)
|
|
2936
3257
|
return { redos: [], undos: [] };
|
|
2937
3258
|
const { startX: d, endX: u, startY: c, endY: l } = a, g = this._sheetDrawingService.getDrawingData(r, s), h = [];
|
|
2938
|
-
Object.keys(g).forEach((
|
|
2939
|
-
const C = g[
|
|
3259
|
+
Object.keys(g).forEach((v) => {
|
|
3260
|
+
const C = g[v];
|
|
2940
3261
|
if (C.anchorType !== O.Both)
|
|
2941
3262
|
return;
|
|
2942
|
-
const { transform:
|
|
2943
|
-
if (!
|
|
3263
|
+
const { transform: _ } = C;
|
|
3264
|
+
if (!_)
|
|
2944
3265
|
return;
|
|
2945
|
-
const { left: y = 0, top:
|
|
3266
|
+
const { left: y = 0, top: R = 0, width: E = 0, height: T = 0 } = _, { drawingStartX: M, drawingEndX: b, drawingStartY: N, drawingEndY: F } = {
|
|
2946
3267
|
drawingStartX: y,
|
|
2947
|
-
drawingEndX: y +
|
|
2948
|
-
drawingStartY:
|
|
2949
|
-
drawingEndY:
|
|
3268
|
+
drawingEndX: y + E,
|
|
3269
|
+
drawingStartY: R,
|
|
3270
|
+
drawingEndY: R + T
|
|
2950
3271
|
};
|
|
2951
|
-
d <= M && b <= u && c <= N &&
|
|
3272
|
+
d <= M && b <= u && c <= N && F <= l && h.push(C);
|
|
2952
3273
|
});
|
|
2953
|
-
const
|
|
2954
|
-
const C =
|
|
2955
|
-
to: { ...C.to, row: C.to.row +
|
|
2956
|
-
from: { ...C.from, row: C.from.row +
|
|
2957
|
-
}, y =
|
|
3274
|
+
const m = [], f = [], p = t.startRow - e.startRow, w = t.startColumn - e.startColumn, S = h.map((v) => {
|
|
3275
|
+
const C = v.sheetTransform, _ = {
|
|
3276
|
+
to: { ...C.to, row: C.to.row + p, column: C.to.column + w },
|
|
3277
|
+
from: { ...C.from, row: C.from.row + p, column: C.from.column + w }
|
|
3278
|
+
}, y = J(_, this._selectionRenderService, this._skeletonManagerService);
|
|
2958
3279
|
return {
|
|
2959
3280
|
unitId: r,
|
|
2960
3281
|
subUnitId: s,
|
|
2961
|
-
drawingId:
|
|
3282
|
+
drawingId: v.drawingId,
|
|
2962
3283
|
transform: y,
|
|
2963
|
-
sheetTransform:
|
|
3284
|
+
sheetTransform: _
|
|
2964
3285
|
};
|
|
2965
3286
|
});
|
|
2966
|
-
if (
|
|
2967
|
-
const
|
|
2968
|
-
|
|
3287
|
+
if (S.length) {
|
|
3288
|
+
const v = this._sheetDrawingService.getBatchUpdateOp(S), { undo: C, redo: _, objects: y } = v;
|
|
3289
|
+
m.push({ id: P.id, params: { unitId: r, subUnitId: s, op: _, objects: y, type: U.UPDATE } }), f.push({ id: P.id, params: { unitId: r, subUnitId: s, op: C, objects: y, type: U.UPDATE } });
|
|
2969
3290
|
}
|
|
2970
|
-
return { redos:
|
|
3291
|
+
return { redos: m, undos: f };
|
|
2971
3292
|
}
|
|
2972
3293
|
_moveRowInterceptor(i, t) {
|
|
2973
3294
|
const e = this._getUnitIdAndSubUnitId(i, t);
|
|
@@ -2975,37 +3296,37 @@ let rn = class extends ne {
|
|
|
2975
3296
|
return { redos: [], undos: [] };
|
|
2976
3297
|
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 = [];
|
|
2977
3298
|
if (Object.keys(c).forEach((h) => {
|
|
2978
|
-
const
|
|
2979
|
-
if (
|
|
3299
|
+
const m = c[h], { sheetTransform: f, transform: p, anchorType: w = O.Position } = m;
|
|
3300
|
+
if (f == null || p == null)
|
|
2980
3301
|
return;
|
|
2981
|
-
let
|
|
3302
|
+
let S, I;
|
|
2982
3303
|
if (t === "insert") {
|
|
2983
|
-
const
|
|
2984
|
-
|
|
3304
|
+
const v = this._expandRow(f, p, o, a, w);
|
|
3305
|
+
S = v == null ? void 0 : v.newSheetTransform, I = v == null ? void 0 : v.newTransform;
|
|
2985
3306
|
} else {
|
|
2986
|
-
const { from:
|
|
2987
|
-
if (
|
|
3307
|
+
const { from: v, to: C } = f, { row: _ } = v, { row: y } = C;
|
|
3308
|
+
if (w === O.Both && _ >= o && y <= a)
|
|
2988
3309
|
g.push({ unitId: n, subUnitId: r, drawingId: h });
|
|
2989
3310
|
else {
|
|
2990
|
-
const
|
|
2991
|
-
|
|
3311
|
+
const R = this._shrinkRow(f, p, o, a, w);
|
|
3312
|
+
S = R == null ? void 0 : R.newSheetTransform, I = R == null ? void 0 : R.newTransform;
|
|
2992
3313
|
}
|
|
2993
3314
|
}
|
|
2994
|
-
if (!
|
|
3315
|
+
if (!S || !I)
|
|
2995
3316
|
return;
|
|
2996
|
-
const
|
|
2997
|
-
l.push(
|
|
3317
|
+
const D = { unitId: n, subUnitId: r, drawingId: h, transform: I, sheetTransform: S };
|
|
3318
|
+
l.push(D);
|
|
2998
3319
|
}), l.length === 0 && g.length === 0)
|
|
2999
3320
|
return { redos: [], undos: [] };
|
|
3000
3321
|
if (l.length > 0) {
|
|
3001
|
-
const h = this._sheetDrawingService.getBatchUpdateOp(l), { undo:
|
|
3002
|
-
d.push({ id: P.id, params: { unitId: n, subUnitId: r, op:
|
|
3322
|
+
const h = this._sheetDrawingService.getBatchUpdateOp(l), { undo: m, redo: f, objects: p } = h;
|
|
3323
|
+
d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: p, type: U.UPDATE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: m, objects: p, type: U.UPDATE } });
|
|
3003
3324
|
}
|
|
3004
3325
|
if (g.length > 0) {
|
|
3005
|
-
const h = this._sheetDrawingService.getBatchRemoveOp(g),
|
|
3006
|
-
d.push({ id: P.id, params: { unitId: n, subUnitId: r, op:
|
|
3326
|
+
const h = this._sheetDrawingService.getBatchRemoveOp(g), m = h.undo, f = h.redo, p = h.objects;
|
|
3327
|
+
d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: p, type: U.REMOVE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: m, objects: p, type: U.INSERT } });
|
|
3007
3328
|
}
|
|
3008
|
-
return d.push({ id:
|
|
3329
|
+
return d.push({ id: H.id, params: [n] }), u.push({ id: H.id, params: [n] }), {
|
|
3009
3330
|
redos: d,
|
|
3010
3331
|
undos: u
|
|
3011
3332
|
};
|
|
@@ -3016,43 +3337,43 @@ let rn = class extends ne {
|
|
|
3016
3337
|
return { redos: [], undos: [] };
|
|
3017
3338
|
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 = [];
|
|
3018
3339
|
if (Object.keys(c).forEach((h) => {
|
|
3019
|
-
const
|
|
3020
|
-
if (
|
|
3340
|
+
const m = c[h], { sheetTransform: f, transform: p, anchorType: w = O.Position } = m;
|
|
3341
|
+
if (f == null || p == null)
|
|
3021
3342
|
return;
|
|
3022
|
-
let
|
|
3343
|
+
let S, I;
|
|
3023
3344
|
if (t === "insert") {
|
|
3024
|
-
const
|
|
3025
|
-
|
|
3345
|
+
const v = this._expandCol(f, p, o, a, w);
|
|
3346
|
+
S = v == null ? void 0 : v.newSheetTransform, I = v == null ? void 0 : v.newTransform;
|
|
3026
3347
|
} else {
|
|
3027
|
-
const { from:
|
|
3028
|
-
if (
|
|
3348
|
+
const { from: v, to: C } = f, { column: _ } = v, { column: y } = C;
|
|
3349
|
+
if (w === O.Both && _ >= o && y <= a)
|
|
3029
3350
|
g.push({ unitId: n, subUnitId: r, drawingId: h });
|
|
3030
3351
|
else {
|
|
3031
|
-
const
|
|
3032
|
-
|
|
3352
|
+
const R = this._shrinkCol(f, p, o, a, w);
|
|
3353
|
+
S = R == null ? void 0 : R.newSheetTransform, I = R == null ? void 0 : R.newTransform;
|
|
3033
3354
|
}
|
|
3034
3355
|
}
|
|
3035
|
-
if (!
|
|
3356
|
+
if (!S || !I)
|
|
3036
3357
|
return;
|
|
3037
|
-
const
|
|
3038
|
-
l.push(
|
|
3358
|
+
const D = { unitId: n, subUnitId: r, drawingId: h, transform: I, sheetTransform: S };
|
|
3359
|
+
l.push(D);
|
|
3039
3360
|
}), l.length === 0 && g.length === 0)
|
|
3040
3361
|
return { redos: [], undos: [] };
|
|
3041
3362
|
if (l.length > 0) {
|
|
3042
|
-
const h = this._sheetDrawingService.getBatchUpdateOp(l), { undo:
|
|
3043
|
-
d.push({ id: P.id, params: { unitId: n, subUnitId: r, op:
|
|
3363
|
+
const h = this._sheetDrawingService.getBatchUpdateOp(l), { undo: m, redo: f, objects: p } = h;
|
|
3364
|
+
d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: p, type: U.UPDATE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: m, objects: p, type: U.UPDATE } });
|
|
3044
3365
|
}
|
|
3045
3366
|
if (g.length > 0) {
|
|
3046
|
-
const h = this._sheetDrawingService.getBatchRemoveOp(g),
|
|
3047
|
-
d.push({ id: P.id, params: { unitId: n, subUnitId: r, op:
|
|
3367
|
+
const h = this._sheetDrawingService.getBatchRemoveOp(g), m = h.undo, f = h.redo, p = h.objects;
|
|
3368
|
+
d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: p, type: U.REMOVE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: m, objects: p, type: U.INSERT } });
|
|
3048
3369
|
}
|
|
3049
|
-
return d.push({ id:
|
|
3370
|
+
return d.push({ id: H.id, params: [n] }), u.push({ id: H.id, params: [n] }), { redos: d, undos: u };
|
|
3050
3371
|
}
|
|
3051
3372
|
_expandCol(i, t, e, n, r = O.Position) {
|
|
3052
3373
|
const s = n - e + 1, { from: o, to: a } = i, { column: d } = o, { column: u } = a;
|
|
3053
3374
|
if (r === O.None)
|
|
3054
3375
|
return {
|
|
3055
|
-
newSheetTransform:
|
|
3376
|
+
newSheetTransform: j({ ...t }, this._selectionRenderService),
|
|
3056
3377
|
newTransform: t
|
|
3057
3378
|
};
|
|
3058
3379
|
let c = null, l = null;
|
|
@@ -3060,16 +3381,16 @@ let rn = class extends ne {
|
|
|
3060
3381
|
const g = this._skeletonManagerService.attachRangeWithCoord({ startColumn: e, endColumn: n, startRow: o.row, endRow: a.row });
|
|
3061
3382
|
if (g == null)
|
|
3062
3383
|
return;
|
|
3063
|
-
l = { ...t, left: (t.left || 0) + g.endX - g.startX }, c =
|
|
3384
|
+
l = { ...t, left: (t.left || 0) + g.endX - g.startX }, c = j(l, this._selectionRenderService);
|
|
3064
3385
|
} else if (u >= n)
|
|
3065
3386
|
if (r === O.Both)
|
|
3066
3387
|
c = {
|
|
3067
3388
|
from: { ...o },
|
|
3068
3389
|
to: { ...a, column: u + s }
|
|
3069
|
-
}, l =
|
|
3390
|
+
}, l = J(c, this._selectionRenderService, this._skeletonManagerService);
|
|
3070
3391
|
else
|
|
3071
3392
|
return {
|
|
3072
|
-
newSheetTransform:
|
|
3393
|
+
newSheetTransform: j({ ...t }, this._selectionRenderService),
|
|
3073
3394
|
newTransform: t
|
|
3074
3395
|
};
|
|
3075
3396
|
return c != null && l != null ? {
|
|
@@ -3081,7 +3402,7 @@ let rn = class extends ne {
|
|
|
3081
3402
|
const s = n - e + 1, { from: o, to: a } = i, { column: d } = o, { column: u } = a;
|
|
3082
3403
|
if (r === O.None)
|
|
3083
3404
|
return {
|
|
3084
|
-
newSheetTransform:
|
|
3405
|
+
newSheetTransform: j({ ...t }, this._selectionRenderService),
|
|
3085
3406
|
newTransform: t
|
|
3086
3407
|
};
|
|
3087
3408
|
let c = null, l = null;
|
|
@@ -3089,7 +3410,7 @@ let rn = class extends ne {
|
|
|
3089
3410
|
c = {
|
|
3090
3411
|
from: { ...o, column: d - s },
|
|
3091
3412
|
to: { ...a, column: u - s }
|
|
3092
|
-
}, l =
|
|
3413
|
+
}, l = J(c, this._selectionRenderService, this._skeletonManagerService);
|
|
3093
3414
|
else {
|
|
3094
3415
|
if (d >= e && u <= n)
|
|
3095
3416
|
return null;
|
|
@@ -3098,10 +3419,10 @@ let rn = class extends ne {
|
|
|
3098
3419
|
c = {
|
|
3099
3420
|
from: { ...o },
|
|
3100
3421
|
to: { ...a, column: u - s }
|
|
3101
|
-
}, l =
|
|
3422
|
+
}, l = J(c, this._selectionRenderService, this._skeletonManagerService);
|
|
3102
3423
|
else
|
|
3103
3424
|
return {
|
|
3104
|
-
newSheetTransform:
|
|
3425
|
+
newSheetTransform: j({ ...t }, this._selectionRenderService),
|
|
3105
3426
|
newTransform: t
|
|
3106
3427
|
};
|
|
3107
3428
|
else if (d >= e && d <= n) {
|
|
@@ -3113,7 +3434,7 @@ let rn = class extends ne {
|
|
|
3113
3434
|
return;
|
|
3114
3435
|
l = { ...t, left: (t.left || 0) - g.endX + g.startX - i.from.columnOffset };
|
|
3115
3436
|
}
|
|
3116
|
-
c =
|
|
3437
|
+
c = j(l, this._selectionRenderService);
|
|
3117
3438
|
} else if (u >= e && u <= n && r === O.Both) {
|
|
3118
3439
|
const g = this._skeletonManagerService.attachRangeWithCoord({
|
|
3119
3440
|
startColumn: e - 1,
|
|
@@ -3126,7 +3447,7 @@ let rn = class extends ne {
|
|
|
3126
3447
|
c = {
|
|
3127
3448
|
from: { ...o },
|
|
3128
3449
|
to: { ...a, column: e - 1, columnOffset: g.endX - g.startX }
|
|
3129
|
-
}, l =
|
|
3450
|
+
}, l = J(c, this._selectionRenderService, this._skeletonManagerService);
|
|
3130
3451
|
}
|
|
3131
3452
|
}
|
|
3132
3453
|
return c != null && l != null ? {
|
|
@@ -3138,7 +3459,7 @@ let rn = class extends ne {
|
|
|
3138
3459
|
const s = n - e + 1, { from: o, to: a } = i, { row: d } = o, { row: u } = a;
|
|
3139
3460
|
if (r === O.None)
|
|
3140
3461
|
return {
|
|
3141
|
-
newSheetTransform:
|
|
3462
|
+
newSheetTransform: j({ ...t }, this._selectionRenderService),
|
|
3142
3463
|
newTransform: t
|
|
3143
3464
|
};
|
|
3144
3465
|
let c = null, l = null;
|
|
@@ -3146,7 +3467,7 @@ let rn = class extends ne {
|
|
|
3146
3467
|
const g = this._skeletonManagerService.attachRangeWithCoord({ startRow: e, endRow: n, startColumn: o.column, endColumn: a.column });
|
|
3147
3468
|
if (g == null)
|
|
3148
3469
|
return;
|
|
3149
|
-
l = { ...t, top: (t.top || 0) + g.endY - g.startY }, c =
|
|
3470
|
+
l = { ...t, top: (t.top || 0) + g.endY - g.startY }, c = j(l, this._selectionRenderService);
|
|
3150
3471
|
} else if (u >= n)
|
|
3151
3472
|
if (r === O.Both)
|
|
3152
3473
|
c = {
|
|
@@ -3155,10 +3476,10 @@ let rn = class extends ne {
|
|
|
3155
3476
|
...a,
|
|
3156
3477
|
row: u + s
|
|
3157
3478
|
}
|
|
3158
|
-
}, l =
|
|
3479
|
+
}, l = J(c, this._selectionRenderService, this._skeletonManagerService);
|
|
3159
3480
|
else
|
|
3160
3481
|
return {
|
|
3161
|
-
newSheetTransform:
|
|
3482
|
+
newSheetTransform: j({ ...t }, this._selectionRenderService),
|
|
3162
3483
|
newTransform: t
|
|
3163
3484
|
};
|
|
3164
3485
|
return c != null && l != null ? {
|
|
@@ -3170,7 +3491,7 @@ let rn = class extends ne {
|
|
|
3170
3491
|
const s = n - e + 1, { from: o, to: a } = i, { row: d } = o, { row: u } = a;
|
|
3171
3492
|
if (r === O.None)
|
|
3172
3493
|
return {
|
|
3173
|
-
newSheetTransform:
|
|
3494
|
+
newSheetTransform: j({ ...t }, this._selectionRenderService),
|
|
3174
3495
|
newTransform: t
|
|
3175
3496
|
};
|
|
3176
3497
|
let c = null, l = null;
|
|
@@ -3178,7 +3499,7 @@ let rn = class extends ne {
|
|
|
3178
3499
|
c = {
|
|
3179
3500
|
from: { ...o, row: d - s },
|
|
3180
3501
|
to: { ...a, row: u - s }
|
|
3181
|
-
}, l =
|
|
3502
|
+
}, l = J(c, this._selectionRenderService, this._skeletonManagerService);
|
|
3182
3503
|
else {
|
|
3183
3504
|
if (d >= e && u <= n)
|
|
3184
3505
|
return null;
|
|
@@ -3187,10 +3508,10 @@ let rn = class extends ne {
|
|
|
3187
3508
|
c = {
|
|
3188
3509
|
from: { ...o },
|
|
3189
3510
|
to: { ...a, row: u - s }
|
|
3190
|
-
}, l =
|
|
3511
|
+
}, l = J(c, this._selectionRenderService, this._skeletonManagerService);
|
|
3191
3512
|
else
|
|
3192
3513
|
return {
|
|
3193
|
-
newSheetTransform:
|
|
3514
|
+
newSheetTransform: j({ ...t }, this._selectionRenderService),
|
|
3194
3515
|
newTransform: t
|
|
3195
3516
|
};
|
|
3196
3517
|
else if (d >= e && d <= n) {
|
|
@@ -3202,7 +3523,7 @@ let rn = class extends ne {
|
|
|
3202
3523
|
return;
|
|
3203
3524
|
l = { ...t, top: (t.top || 0) - g.endY + g.startY - i.from.rowOffset };
|
|
3204
3525
|
}
|
|
3205
|
-
c =
|
|
3526
|
+
c = j(l, this._selectionRenderService);
|
|
3206
3527
|
} else if (u >= e && u <= n && r === O.Both) {
|
|
3207
3528
|
const g = this._skeletonManagerService.attachRangeWithCoord({ startColumn: o.column, endColumn: o.column, startRow: e - 1, endRow: e - 1 });
|
|
3208
3529
|
if (g == null)
|
|
@@ -3210,7 +3531,7 @@ let rn = class extends ne {
|
|
|
3210
3531
|
c = {
|
|
3211
3532
|
from: { ...o },
|
|
3212
3533
|
to: { ...a, row: e - 1, rowOffset: g.endY - g.startY }
|
|
3213
|
-
}, l =
|
|
3534
|
+
}, l = J(c, this._selectionRenderService, this._skeletonManagerService);
|
|
3214
3535
|
}
|
|
3215
3536
|
}
|
|
3216
3537
|
return c != null && l != null ? {
|
|
@@ -3224,7 +3545,7 @@ let rn = class extends ne {
|
|
|
3224
3545
|
// but the skeleton changes like other render modules. These two signals are not equivalent.
|
|
3225
3546
|
// As a temp solution, I subscribed to activate$ here.
|
|
3226
3547
|
this._commandService.onCommandExecuted((i) => {
|
|
3227
|
-
if (i.id ===
|
|
3548
|
+
if (i.id === Yi.id) {
|
|
3228
3549
|
const { unitId: t, subUnitId: e } = i.params;
|
|
3229
3550
|
this._updateDrawings(t, e);
|
|
3230
3551
|
}
|
|
@@ -3264,7 +3585,7 @@ let rn = class extends ne {
|
|
|
3264
3585
|
d != null && Object.keys(d).forEach((u) => {
|
|
3265
3586
|
if (s === i && a === t) {
|
|
3266
3587
|
const c = d[u];
|
|
3267
|
-
c.transform =
|
|
3588
|
+
c.transform = J(c.sheetTransform, this._selectionRenderService, this._skeletonManagerService), n.push(d[u]);
|
|
3268
3589
|
} else
|
|
3269
3590
|
r.push(d[u]);
|
|
3270
3591
|
});
|
|
@@ -3275,7 +3596,7 @@ let rn = class extends ne {
|
|
|
3275
3596
|
_sheetRefreshListener() {
|
|
3276
3597
|
this.disposeWithMe(
|
|
3277
3598
|
this._commandService.onCommandExecuted((i) => {
|
|
3278
|
-
|
|
3599
|
+
co.includes(i.id) && requestIdleCallback(() => {
|
|
3279
3600
|
const t = i.params, { unitId: e, subUnitId: n, ranges: r } = t;
|
|
3280
3601
|
this._refreshDrawingTransform(e, n, r);
|
|
3281
3602
|
});
|
|
@@ -3288,279 +3609,426 @@ let rn = class extends ne {
|
|
|
3288
3609
|
const o = n[s], { sheetTransform: a, transform: d, anchorType: u = O.Position } = o;
|
|
3289
3610
|
if (u === O.None)
|
|
3290
3611
|
return !0;
|
|
3291
|
-
const { from: c, to: l } = a, { row: g, column: h } = c, { row:
|
|
3292
|
-
for (let
|
|
3293
|
-
const
|
|
3294
|
-
if (
|
|
3612
|
+
const { from: c, to: l } = a, { row: g, column: h } = c, { row: m, column: f } = l;
|
|
3613
|
+
for (let p = 0; p < e.length; p++) {
|
|
3614
|
+
const w = e[p], { startRow: S, endRow: I, startColumn: D, endColumn: v } = w;
|
|
3615
|
+
if (Ri.intersects(
|
|
3295
3616
|
{
|
|
3296
|
-
startRow:
|
|
3617
|
+
startRow: S,
|
|
3297
3618
|
endRow: I,
|
|
3298
|
-
startColumn:
|
|
3299
|
-
endColumn:
|
|
3619
|
+
startColumn: D,
|
|
3620
|
+
endColumn: v
|
|
3300
3621
|
},
|
|
3301
3622
|
{
|
|
3302
3623
|
startRow: g,
|
|
3303
|
-
endRow:
|
|
3624
|
+
endRow: m,
|
|
3304
3625
|
startColumn: h,
|
|
3305
|
-
endColumn:
|
|
3626
|
+
endColumn: f
|
|
3306
3627
|
}
|
|
3307
|
-
) || g > I || h >
|
|
3308
|
-
const C = u === O.Position,
|
|
3628
|
+
) || g > I || h > v) {
|
|
3629
|
+
const C = u === O.Position, _ = J(a, this._selectionRenderService, this._skeletonManagerService);
|
|
3309
3630
|
r.push({
|
|
3310
3631
|
...o,
|
|
3311
3632
|
transform: {
|
|
3312
|
-
...
|
|
3313
|
-
width: C ? d == null ? void 0 : d.width :
|
|
3314
|
-
height: C ? d == null ? void 0 : d.height :
|
|
3633
|
+
..._,
|
|
3634
|
+
width: C ? d == null ? void 0 : d.width : _ == null ? void 0 : _.width,
|
|
3635
|
+
height: C ? d == null ? void 0 : d.height : _ == null ? void 0 : _.height
|
|
3315
3636
|
}
|
|
3316
3637
|
});
|
|
3317
3638
|
break;
|
|
3318
3639
|
}
|
|
3319
3640
|
}
|
|
3320
|
-
}), r.length !== 0 && (this._drawingManagerService.refreshTransform(r), this._commandService.syncExecuteCommand(
|
|
3641
|
+
}), r.length !== 0 && (this._drawingManagerService.refreshTransform(r), this._commandService.syncExecuteCommand(H.id, [i]));
|
|
3321
3642
|
}
|
|
3322
3643
|
};
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
],
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3644
|
+
Rn = oo([
|
|
3645
|
+
_e(1, Q),
|
|
3646
|
+
_e(2, Y),
|
|
3647
|
+
_e(3, Je),
|
|
3648
|
+
_e(4, A(X)),
|
|
3649
|
+
_e(5, A(Ht)),
|
|
3650
|
+
_e(6, se),
|
|
3651
|
+
_e(7, oe),
|
|
3652
|
+
_e(8, de)
|
|
3653
|
+
], Rn);
|
|
3654
|
+
function lo() {
|
|
3655
|
+
const i = Ie(Te), t = Ie(bn), e = Ie(yn), [n, r] = Ee([ye.CELL_ADDRESS]), [s, o] = Ee(!1), [a, d] = Ee(null), u = Fe(() => e.getCellImagesInSelection(), [e]), c = Fe(() => e.getDataColumns(), [e]), l = Fe(() => e.getSelectionRowRange(), [e]), g = c.length > 0, h = Fe(() => c.map((C) => ({
|
|
3656
|
+
label: C.label,
|
|
3657
|
+
value: String(C.index)
|
|
3658
|
+
})), [c]), [m, f] = Ee(
|
|
3659
|
+
() => h.length > 0 ? h[0].value : "0"
|
|
3660
|
+
), p = Fe(() => {
|
|
3661
|
+
if (!n.includes(ye.COLUMN_VALUE) || !l)
|
|
3662
|
+
return [];
|
|
3663
|
+
const _ = Number(m);
|
|
3664
|
+
return [{
|
|
3665
|
+
startRow: l.startRow,
|
|
3666
|
+
endRow: l.endRow,
|
|
3667
|
+
startColumn: _,
|
|
3668
|
+
endColumn: _
|
|
3669
|
+
}];
|
|
3670
|
+
}, [n, m, l]);
|
|
3671
|
+
li(p);
|
|
3672
|
+
const w = Et((C) => {
|
|
3673
|
+
C.length !== 0 && r(C);
|
|
3674
|
+
}, []), S = Et((C) => {
|
|
3675
|
+
f(String(C));
|
|
3676
|
+
}, []), I = Et(() => {
|
|
3677
|
+
t.close(ze);
|
|
3678
|
+
}, [t]), D = Et(async () => {
|
|
3679
|
+
if (u.length !== 0) {
|
|
3680
|
+
o(!0), d(null);
|
|
3681
|
+
try {
|
|
3682
|
+
await e.saveImages(u, {
|
|
3683
|
+
fileNameParts: n,
|
|
3684
|
+
columnIndex: n.includes(ye.COLUMN_VALUE) ? Number(m) : void 0
|
|
3685
|
+
}), t.close(ze);
|
|
3686
|
+
} catch (C) {
|
|
3687
|
+
console.error("Failed to save images:", C), d(i.t("sheetImage.save.error"));
|
|
3688
|
+
} finally {
|
|
3689
|
+
o(!1);
|
|
3690
|
+
}
|
|
3691
|
+
}
|
|
3692
|
+
}, [e, u, n, m, t, i]), v = n.includes(ye.COLUMN_VALUE);
|
|
3693
|
+
return /* @__PURE__ */ Xe("div", { className: "univer-flex univer-flex-col", children: [
|
|
3694
|
+
/* @__PURE__ */ L(en, { label: i.t("sheetImage.save.imageCount"), children: /* @__PURE__ */ L("div", { className: "univer-text-sm univer-text-gray-600", children: u.length }) }),
|
|
3695
|
+
/* @__PURE__ */ L(en, { label: i.t("sheetImage.save.fileNameConfig"), children: /* @__PURE__ */ Xe(Ki, { value: n, onChange: w, direction: "vertical", children: [
|
|
3696
|
+
/* @__PURE__ */ L(Yn, { value: ye.CELL_ADDRESS, disabled: !g, children: i.t("sheetImage.save.useRowCol") }),
|
|
3697
|
+
g && /* @__PURE__ */ L(Yn, { value: ye.COLUMN_VALUE, children: i.t("sheetImage.save.useColumnValue") })
|
|
3698
|
+
] }) }),
|
|
3699
|
+
v && /* @__PURE__ */ L(en, { label: i.t("sheetImage.save.selectColumn"), children: /* @__PURE__ */ L(
|
|
3700
|
+
Ji,
|
|
3701
|
+
{
|
|
3702
|
+
value: m,
|
|
3703
|
+
options: h,
|
|
3704
|
+
onChange: S
|
|
3705
|
+
}
|
|
3706
|
+
) }),
|
|
3707
|
+
a && /* @__PURE__ */ L("div", { className: "univer-text-xs univer-text-red-500", children: a }),
|
|
3708
|
+
/* @__PURE__ */ Xe(
|
|
3709
|
+
"div",
|
|
3710
|
+
{
|
|
3711
|
+
className: "univer-flex univer-justify-end univer-gap-2 univer-border-t univer-border-gray-200 univer-pt-3",
|
|
3712
|
+
children: [
|
|
3713
|
+
/* @__PURE__ */ L(Gn, { onClick: I, disabled: s, children: i.t("sheetImage.save.cancel") }),
|
|
3714
|
+
/* @__PURE__ */ L(
|
|
3715
|
+
Gn,
|
|
3716
|
+
{
|
|
3717
|
+
variant: "primary",
|
|
3718
|
+
onClick: D,
|
|
3719
|
+
disabled: s || u.length === 0,
|
|
3720
|
+
children: s ? i.t("sheetImage.save.saving") : i.t("sheetImage.save.confirm")
|
|
3721
|
+
}
|
|
3722
|
+
)
|
|
3723
|
+
]
|
|
3724
|
+
}
|
|
3725
|
+
)
|
|
3726
|
+
] });
|
|
3727
|
+
}
|
|
3728
|
+
const uo = (i) => {
|
|
3729
|
+
var S;
|
|
3730
|
+
const t = Ie(Y), e = Ie(Te), n = Ie(oe), r = Ie(Q), { drawings: s } = i, o = s[0];
|
|
3336
3731
|
if (o == null)
|
|
3337
3732
|
return;
|
|
3338
3733
|
const { unitId: a } = o, d = r.getRenderById(a), u = d == null ? void 0 : d.scene;
|
|
3339
3734
|
if (u == null)
|
|
3340
3735
|
return;
|
|
3341
|
-
const c = u.getTransformerByCreate(), [l, g] =
|
|
3342
|
-
function
|
|
3343
|
-
const
|
|
3736
|
+
const c = u.getTransformerByCreate(), [l, g] = Ee(!0), h = (S = o.anchorType) != null ? S : O.Position, [m, f] = Ee(h);
|
|
3737
|
+
function p(I, D) {
|
|
3738
|
+
const v = [];
|
|
3344
3739
|
return I.forEach((C) => {
|
|
3345
|
-
const { oKey:
|
|
3740
|
+
const { oKey: _ } = C, y = D.getDrawingOKey(_);
|
|
3346
3741
|
if (y == null)
|
|
3347
|
-
return
|
|
3348
|
-
const { unitId:
|
|
3349
|
-
|
|
3350
|
-
unitId:
|
|
3351
|
-
subUnitId:
|
|
3352
|
-
drawingId:
|
|
3742
|
+
return v.push(null), !0;
|
|
3743
|
+
const { unitId: R, subUnitId: E, drawingId: T, drawingType: M, anchorType: b, sheetTransform: N } = y;
|
|
3744
|
+
v.push({
|
|
3745
|
+
unitId: R,
|
|
3746
|
+
subUnitId: E,
|
|
3747
|
+
drawingId: T,
|
|
3353
3748
|
anchorType: b,
|
|
3354
3749
|
sheetTransform: N,
|
|
3355
3750
|
drawingType: M
|
|
3356
3751
|
});
|
|
3357
|
-
}),
|
|
3752
|
+
}), v;
|
|
3358
3753
|
}
|
|
3359
|
-
|
|
3360
|
-
const I = c.clearControl$.subscribe((
|
|
3361
|
-
|
|
3362
|
-
}),
|
|
3754
|
+
Ar(() => {
|
|
3755
|
+
const I = c.clearControl$.subscribe((v) => {
|
|
3756
|
+
v === !0 && g(!1);
|
|
3757
|
+
}), D = c.changeStart$.subscribe((v) => {
|
|
3363
3758
|
var y;
|
|
3364
|
-
const { objects: C } =
|
|
3365
|
-
if (
|
|
3759
|
+
const { objects: C } = v, _ = p(C, n);
|
|
3760
|
+
if (_.length === 0)
|
|
3366
3761
|
g(!1);
|
|
3367
|
-
else if (
|
|
3762
|
+
else if (_.length >= 1) {
|
|
3368
3763
|
g(!0);
|
|
3369
|
-
const
|
|
3370
|
-
|
|
3764
|
+
const R = ((y = _[0]) == null ? void 0 : y.anchorType) || O.Position;
|
|
3765
|
+
f(R);
|
|
3371
3766
|
}
|
|
3372
3767
|
});
|
|
3373
3768
|
return () => {
|
|
3374
|
-
|
|
3769
|
+
D.unsubscribe(), I.unsubscribe();
|
|
3375
3770
|
};
|
|
3376
3771
|
}, []);
|
|
3377
|
-
function
|
|
3378
|
-
|
|
3379
|
-
const
|
|
3380
|
-
if (
|
|
3772
|
+
function w(I) {
|
|
3773
|
+
f(I);
|
|
3774
|
+
const D = n.getFocusDrawings();
|
|
3775
|
+
if (D.length === 0)
|
|
3381
3776
|
return;
|
|
3382
|
-
const
|
|
3777
|
+
const v = D.map((C) => ({
|
|
3383
3778
|
unitId: C.unitId,
|
|
3384
3779
|
subUnitId: C.subUnitId,
|
|
3385
3780
|
drawingId: C.drawingId,
|
|
3386
3781
|
anchorType: I
|
|
3387
3782
|
}));
|
|
3388
|
-
t.executeCommand(
|
|
3389
|
-
unitId:
|
|
3390
|
-
drawings:
|
|
3783
|
+
t.executeCommand(zt.id, {
|
|
3784
|
+
unitId: D[0].unitId,
|
|
3785
|
+
drawings: v
|
|
3391
3786
|
});
|
|
3392
3787
|
}
|
|
3393
|
-
return /* @__PURE__ */
|
|
3788
|
+
return /* @__PURE__ */ Xe(
|
|
3394
3789
|
"div",
|
|
3395
3790
|
{
|
|
3396
|
-
className:
|
|
3791
|
+
className: Zi("univer-grid univer-gap-2 univer-py-2 univer-text-gray-400", {
|
|
3397
3792
|
"univer-hidden": !l
|
|
3398
3793
|
}),
|
|
3399
3794
|
children: [
|
|
3400
|
-
/* @__PURE__ */
|
|
3795
|
+
/* @__PURE__ */ L(
|
|
3401
3796
|
"header",
|
|
3402
3797
|
{
|
|
3403
3798
|
className: "univer-text-gray-600 dark:!univer-text-gray-200",
|
|
3404
|
-
children: /* @__PURE__ */
|
|
3799
|
+
children: /* @__PURE__ */ L("div", { children: e.t("drawing-anchor.title") })
|
|
3405
3800
|
}
|
|
3406
3801
|
),
|
|
3407
|
-
/* @__PURE__ */
|
|
3408
|
-
/* @__PURE__ */
|
|
3409
|
-
/* @__PURE__ */
|
|
3410
|
-
/* @__PURE__ */
|
|
3802
|
+
/* @__PURE__ */ L("div", { children: /* @__PURE__ */ Xe(qi, { value: m, onChange: w, direction: "vertical", children: [
|
|
3803
|
+
/* @__PURE__ */ L(tn, { value: O.Both, children: e.t("drawing-anchor.both") }),
|
|
3804
|
+
/* @__PURE__ */ L(tn, { value: O.Position, children: e.t("drawing-anchor.position") }),
|
|
3805
|
+
/* @__PURE__ */ L(tn, { value: O.None, children: e.t("drawing-anchor.none") })
|
|
3411
3806
|
] }) })
|
|
3412
3807
|
]
|
|
3413
3808
|
}
|
|
3414
3809
|
);
|
|
3415
|
-
},
|
|
3416
|
-
const i =
|
|
3417
|
-
return
|
|
3810
|
+
}, ho = () => {
|
|
3811
|
+
const i = Ie(oe), t = i.getFocusDrawings(), [e, n] = Ee(t);
|
|
3812
|
+
return Ar(() => {
|
|
3418
3813
|
const r = i.focus$.subscribe((s) => {
|
|
3419
3814
|
n(s);
|
|
3420
3815
|
});
|
|
3421
3816
|
return () => {
|
|
3422
3817
|
r.unsubscribe();
|
|
3423
3818
|
};
|
|
3424
|
-
}, []), !!(e != null && e.length) && /* @__PURE__ */
|
|
3425
|
-
/* @__PURE__ */
|
|
3426
|
-
/* @__PURE__ */
|
|
3819
|
+
}, []), !!(e != null && e.length) && /* @__PURE__ */ Xe("div", { className: "univer-text-sm", children: [
|
|
3820
|
+
/* @__PURE__ */ L(Ss, { drawings: e }),
|
|
3821
|
+
/* @__PURE__ */ L(uo, { drawings: e })
|
|
3427
3822
|
] });
|
|
3428
|
-
},
|
|
3429
|
-
function
|
|
3823
|
+
}, Vr = "sheet.menu.image";
|
|
3824
|
+
function go(i) {
|
|
3430
3825
|
return {
|
|
3431
|
-
id:
|
|
3432
|
-
type:
|
|
3826
|
+
id: Vr,
|
|
3827
|
+
type: Gt.SUBITEMS,
|
|
3433
3828
|
icon: "AddImageIcon",
|
|
3434
3829
|
tooltip: "sheetImage.title",
|
|
3435
|
-
hidden$:
|
|
3436
|
-
disabled$:
|
|
3830
|
+
hidden$: Yt(i, k.UNIVER_SHEET),
|
|
3831
|
+
disabled$: ui(i, { workbookTypes: [gn], worksheetTypes: [mn], rangeTypes: [Gi] })
|
|
3437
3832
|
};
|
|
3438
3833
|
}
|
|
3439
|
-
function
|
|
3834
|
+
function mo(i) {
|
|
3440
3835
|
return {
|
|
3441
|
-
id:
|
|
3836
|
+
id: Kt.id,
|
|
3442
3837
|
title: "sheetImage.upload.float",
|
|
3443
|
-
type:
|
|
3444
|
-
hidden$:
|
|
3838
|
+
type: Gt.BUTTON,
|
|
3839
|
+
hidden$: Yt(i, k.UNIVER_SHEET)
|
|
3445
3840
|
};
|
|
3446
3841
|
}
|
|
3447
|
-
function
|
|
3842
|
+
function fo(i) {
|
|
3448
3843
|
return {
|
|
3449
|
-
id:
|
|
3844
|
+
id: Mn.id,
|
|
3450
3845
|
title: "sheetImage.upload.cell",
|
|
3451
|
-
type:
|
|
3452
|
-
hidden$:
|
|
3846
|
+
type: Gt.BUTTON,
|
|
3847
|
+
hidden$: Yt(i, k.UNIVER_SHEET)
|
|
3453
3848
|
};
|
|
3454
3849
|
}
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3850
|
+
function po(i) {
|
|
3851
|
+
var t, e, n, r;
|
|
3852
|
+
return !!((e = (t = i == null ? void 0 : i.p) == null ? void 0 : t.drawingsOrder) != null && e.length && ((r = (n = i == null ? void 0 : i.p) == null ? void 0 : n.drawingsOrder) == null ? void 0 : r.length) > 0);
|
|
3853
|
+
}
|
|
3854
|
+
function wo(i, t) {
|
|
3855
|
+
const e = i.getActiveSheet();
|
|
3856
|
+
if (!e) return !1;
|
|
3857
|
+
const n = e.getCellMatrix(), { startRow: r, endRow: s, startColumn: o, endColumn: a } = t;
|
|
3858
|
+
for (let d = r; d <= s; d++)
|
|
3859
|
+
for (let u = o; u <= a; u++) {
|
|
3860
|
+
const c = n.getValue(d, u);
|
|
3861
|
+
if (po(c))
|
|
3862
|
+
return !0;
|
|
3863
|
+
}
|
|
3864
|
+
return !1;
|
|
3865
|
+
}
|
|
3866
|
+
function _o() {
|
|
3867
|
+
return "showDirectoryPicker" in window;
|
|
3868
|
+
}
|
|
3869
|
+
function dn(i) {
|
|
3870
|
+
const t = i.get(de), e = i.get(ut), n = at([
|
|
3871
|
+
Yt(i, k.UNIVER_SHEET),
|
|
3872
|
+
t.getCurrentTypeOfUnit$(k.UNIVER_SHEET).pipe(
|
|
3873
|
+
fe((r) => r ? e.selectionMoveEnd$.pipe(
|
|
3874
|
+
pe(() => {
|
|
3875
|
+
if (!_o())
|
|
3876
|
+
return !0;
|
|
3877
|
+
const s = e.getCurrentSelections();
|
|
3878
|
+
if (!s || s.length === 0)
|
|
3879
|
+
return !0;
|
|
3880
|
+
for (const o of s)
|
|
3881
|
+
if (wo(r, o.range))
|
|
3882
|
+
return !1;
|
|
3883
|
+
return !0;
|
|
3884
|
+
})
|
|
3885
|
+
) : wn(!0))
|
|
3886
|
+
)
|
|
3887
|
+
]).pipe(
|
|
3888
|
+
pe(([r, s]) => r || s)
|
|
3889
|
+
);
|
|
3890
|
+
return {
|
|
3891
|
+
id: ct.id,
|
|
3892
|
+
type: Gt.BUTTON,
|
|
3893
|
+
icon: "DownloadImageIcon",
|
|
3894
|
+
title: "sheetImage.save.menuLabel",
|
|
3895
|
+
hidden$: n
|
|
3896
|
+
};
|
|
3897
|
+
}
|
|
3898
|
+
const So = {
|
|
3899
|
+
[ls.MEDIA]: {
|
|
3900
|
+
[Vr]: {
|
|
3458
3901
|
order: 0,
|
|
3459
|
-
menuItemFactory:
|
|
3460
|
-
[
|
|
3902
|
+
menuItemFactory: go,
|
|
3903
|
+
[Kt.id]: {
|
|
3461
3904
|
order: 0,
|
|
3462
|
-
menuItemFactory:
|
|
3905
|
+
menuItemFactory: mo
|
|
3463
3906
|
},
|
|
3464
|
-
[
|
|
3907
|
+
[Mn.id]: {
|
|
3465
3908
|
order: 1,
|
|
3466
|
-
menuItemFactory:
|
|
3909
|
+
menuItemFactory: fo
|
|
3910
|
+
}
|
|
3911
|
+
}
|
|
3912
|
+
},
|
|
3913
|
+
[rn.MAIN_AREA]: {
|
|
3914
|
+
[sn.OTHERS]: {
|
|
3915
|
+
[ct.id]: {
|
|
3916
|
+
order: 10,
|
|
3917
|
+
menuItemFactory: dn
|
|
3918
|
+
}
|
|
3919
|
+
}
|
|
3920
|
+
},
|
|
3921
|
+
[rn.COL_HEADER]: {
|
|
3922
|
+
[sn.OTHERS]: {
|
|
3923
|
+
[ct.id]: {
|
|
3924
|
+
order: 10,
|
|
3925
|
+
menuItemFactory: dn
|
|
3926
|
+
}
|
|
3927
|
+
}
|
|
3928
|
+
},
|
|
3929
|
+
[rn.ROW_HEADER]: {
|
|
3930
|
+
[sn.OTHERS]: {
|
|
3931
|
+
[ct.id]: {
|
|
3932
|
+
order: 10,
|
|
3933
|
+
menuItemFactory: dn
|
|
3467
3934
|
}
|
|
3468
3935
|
}
|
|
3469
3936
|
}
|
|
3470
3937
|
};
|
|
3471
|
-
function
|
|
3472
|
-
return !i.getContextValue(
|
|
3938
|
+
function mt(i) {
|
|
3939
|
+
return !i.getContextValue(Di) && !i.getContextValue(bi) && !i.getContextValue(Mi) && i.getContextValue(Ge);
|
|
3473
3940
|
}
|
|
3474
|
-
const
|
|
3475
|
-
id:
|
|
3941
|
+
const vo = {
|
|
3942
|
+
id: gt.id,
|
|
3476
3943
|
description: "shortcut.drawing-move-down",
|
|
3477
3944
|
group: "4_drawing-view",
|
|
3478
|
-
binding:
|
|
3945
|
+
binding: Ke.ARROW_DOWN,
|
|
3479
3946
|
priority: 100,
|
|
3480
|
-
preconditions:
|
|
3947
|
+
preconditions: mt,
|
|
3481
3948
|
staticParameters: {
|
|
3482
|
-
direction:
|
|
3949
|
+
direction: ve.DOWN
|
|
3483
3950
|
}
|
|
3484
|
-
},
|
|
3485
|
-
id:
|
|
3951
|
+
}, Io = {
|
|
3952
|
+
id: gt.id,
|
|
3486
3953
|
description: "shortcut.drawing-move-up",
|
|
3487
3954
|
group: "4_drawing-view",
|
|
3488
|
-
binding:
|
|
3955
|
+
binding: Ke.ARROW_UP,
|
|
3489
3956
|
priority: 100,
|
|
3490
|
-
preconditions:
|
|
3957
|
+
preconditions: mt,
|
|
3491
3958
|
staticParameters: {
|
|
3492
|
-
direction:
|
|
3959
|
+
direction: ve.UP
|
|
3493
3960
|
}
|
|
3494
|
-
},
|
|
3495
|
-
id:
|
|
3961
|
+
}, Co = {
|
|
3962
|
+
id: gt.id,
|
|
3496
3963
|
description: "shortcut.drawing-move-left",
|
|
3497
3964
|
group: "4_drawing-view",
|
|
3498
|
-
binding:
|
|
3965
|
+
binding: Ke.ARROW_LEFT,
|
|
3499
3966
|
priority: 100,
|
|
3500
|
-
preconditions:
|
|
3967
|
+
preconditions: mt,
|
|
3501
3968
|
staticParameters: {
|
|
3502
|
-
direction:
|
|
3969
|
+
direction: ve.LEFT
|
|
3503
3970
|
}
|
|
3504
|
-
},
|
|
3505
|
-
id:
|
|
3971
|
+
}, Ro = {
|
|
3972
|
+
id: gt.id,
|
|
3506
3973
|
description: "shortcut.drawing-move-right",
|
|
3507
3974
|
group: "4_drawing-view",
|
|
3508
|
-
binding:
|
|
3975
|
+
binding: Ke.ARROW_RIGHT,
|
|
3509
3976
|
priority: 100,
|
|
3510
|
-
preconditions:
|
|
3977
|
+
preconditions: mt,
|
|
3511
3978
|
staticParameters: {
|
|
3512
|
-
direction:
|
|
3979
|
+
direction: ve.RIGHT
|
|
3513
3980
|
}
|
|
3514
|
-
},
|
|
3515
|
-
id:
|
|
3981
|
+
}, Do = {
|
|
3982
|
+
id: Nr.id,
|
|
3516
3983
|
description: "shortcut.drawing-delete",
|
|
3517
3984
|
group: "4_drawing-view",
|
|
3518
3985
|
// when focusing on any other input tag do not trigger this shortcut
|
|
3519
|
-
preconditions:
|
|
3520
|
-
binding:
|
|
3521
|
-
mac:
|
|
3986
|
+
preconditions: mt,
|
|
3987
|
+
binding: Ke.DELETE,
|
|
3988
|
+
mac: Ke.BACKSPACE
|
|
3522
3989
|
};
|
|
3523
|
-
var
|
|
3524
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
3990
|
+
var bo = Object.getOwnPropertyDescriptor, Mo = (i, t, e, n) => {
|
|
3991
|
+
for (var r = n > 1 ? void 0 : n ? bo(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
3525
3992
|
(o = i[s]) && (r = o(r) || r);
|
|
3526
3993
|
return r;
|
|
3527
|
-
},
|
|
3528
|
-
let
|
|
3994
|
+
}, Be = (i, t) => (e, n) => t(e, n, i);
|
|
3995
|
+
let Ft = class extends ee {
|
|
3529
3996
|
constructor(i, t, e, n, r, s) {
|
|
3530
3997
|
super(), this._componentManager = i, this._menuManagerService = t, this._commandService = e, this._shortcutService = n, this._drawingManagerService = r, this._sheetsSelectionsService = s, this._init();
|
|
3531
3998
|
}
|
|
3532
3999
|
_initCustomComponents() {
|
|
3533
4000
|
const i = this._componentManager;
|
|
3534
|
-
this.disposeWithMe(i.register(
|
|
4001
|
+
this.disposeWithMe(i.register(Wr, ho)), this.disposeWithMe(i.register(ze, lo));
|
|
3535
4002
|
}
|
|
3536
4003
|
_initMenus() {
|
|
3537
|
-
this._menuManagerService.mergeMenu(
|
|
4004
|
+
this._menuManagerService.mergeMenu(So);
|
|
3538
4005
|
}
|
|
3539
4006
|
_initCommands() {
|
|
3540
4007
|
[
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
4008
|
+
Kt,
|
|
4009
|
+
Mn,
|
|
4010
|
+
Xt,
|
|
4011
|
+
ht,
|
|
4012
|
+
zt,
|
|
4013
|
+
Br,
|
|
4014
|
+
H,
|
|
4015
|
+
jr,
|
|
4016
|
+
kr,
|
|
4017
|
+
xr,
|
|
4018
|
+
gt,
|
|
4019
|
+
Nr,
|
|
4020
|
+
$r,
|
|
4021
|
+
ct
|
|
3554
4022
|
].forEach((i) => this.disposeWithMe(this._commandService.registerCommand(i)));
|
|
3555
4023
|
}
|
|
3556
4024
|
_initShortcuts() {
|
|
3557
4025
|
[
|
|
3558
4026
|
// sheet drawing shortcuts
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
4027
|
+
vo,
|
|
4028
|
+
Io,
|
|
4029
|
+
Co,
|
|
4030
|
+
Ro,
|
|
4031
|
+
Do
|
|
3564
4032
|
].forEach((i) => {
|
|
3565
4033
|
this.disposeWithMe(this._shortcutService.registerShortcut(i));
|
|
3566
4034
|
});
|
|
@@ -3569,100 +4037,106 @@ let Ut = class extends ne {
|
|
|
3569
4037
|
this._initCommands(), this._initCustomComponents(), this._initMenus(), this._initShortcuts();
|
|
3570
4038
|
}
|
|
3571
4039
|
};
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
],
|
|
3580
|
-
var
|
|
3581
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
4040
|
+
Ft = Mo([
|
|
4041
|
+
Be(0, A(Ur)),
|
|
4042
|
+
Be(1, us),
|
|
4043
|
+
Be(2, Y),
|
|
4044
|
+
Be(3, hs),
|
|
4045
|
+
Be(4, oe),
|
|
4046
|
+
Be(5, A(ut))
|
|
4047
|
+
], Ft);
|
|
4048
|
+
var yo = Object.defineProperty, Eo = Object.getOwnPropertyDescriptor, To = (i, t, e) => t in i ? yo(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, Oo = (i, t, e, n) => {
|
|
4049
|
+
for (var r = n > 1 ? void 0 : n ? Eo(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
3582
4050
|
(o = i[s]) && (r = o(r) || r);
|
|
3583
4051
|
return r;
|
|
3584
|
-
},
|
|
3585
|
-
const
|
|
3586
|
-
let
|
|
3587
|
-
constructor(i =
|
|
4052
|
+
}, ln = (i, t) => (e, n) => t(e, n, i), Yr = (i, t, e) => To(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4053
|
+
const Uo = "SHEET_IMAGE_UI_PLUGIN";
|
|
4054
|
+
let Lt = class extends Ti {
|
|
4055
|
+
constructor(i = sr, t, e, n) {
|
|
3588
4056
|
super(), this._config = i, this._injector = t, this._renderManagerService = e, this._configService = n;
|
|
3589
|
-
const { menu: r, ...s } =
|
|
4057
|
+
const { menu: r, ...s } = Oi(
|
|
3590
4058
|
{},
|
|
3591
|
-
|
|
4059
|
+
sr,
|
|
3592
4060
|
this._config
|
|
3593
4061
|
);
|
|
3594
|
-
r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(
|
|
4062
|
+
r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(Ps, s);
|
|
3595
4063
|
}
|
|
3596
4064
|
onStarting() {
|
|
3597
|
-
|
|
3598
|
-
[
|
|
3599
|
-
[
|
|
3600
|
-
[
|
|
3601
|
-
[
|
|
3602
|
-
[
|
|
3603
|
-
[
|
|
3604
|
-
[
|
|
3605
|
-
[
|
|
3606
|
-
[
|
|
3607
|
-
|
|
3608
|
-
|
|
4065
|
+
Ui(this._injector, [
|
|
4066
|
+
[lt],
|
|
4067
|
+
[Ft],
|
|
4068
|
+
[Nt],
|
|
4069
|
+
[jt],
|
|
4070
|
+
[Bt],
|
|
4071
|
+
[Wt],
|
|
4072
|
+
[kt],
|
|
4073
|
+
[$t],
|
|
4074
|
+
[xt],
|
|
4075
|
+
[yn, { useClass: vn }]
|
|
4076
|
+
]), Qt(this._injector, [
|
|
4077
|
+
[lt]
|
|
3609
4078
|
]);
|
|
3610
4079
|
}
|
|
3611
4080
|
onReady() {
|
|
3612
|
-
|
|
3613
|
-
[
|
|
3614
|
-
[
|
|
4081
|
+
Qt(this._injector, [
|
|
4082
|
+
[Wt],
|
|
4083
|
+
[xt]
|
|
3615
4084
|
]);
|
|
3616
4085
|
}
|
|
3617
4086
|
onRendered() {
|
|
3618
|
-
this._registerRenderModules(),
|
|
3619
|
-
[
|
|
3620
|
-
[
|
|
3621
|
-
[
|
|
3622
|
-
[
|
|
3623
|
-
[
|
|
4087
|
+
this._registerRenderModules(), Qt(this._injector, [
|
|
4088
|
+
[Bt],
|
|
4089
|
+
[jt],
|
|
4090
|
+
[Ft],
|
|
4091
|
+
[kt],
|
|
4092
|
+
[$t]
|
|
3624
4093
|
]);
|
|
3625
4094
|
}
|
|
3626
4095
|
onSteady() {
|
|
3627
|
-
this._injector.get(
|
|
4096
|
+
this._injector.get(Nt);
|
|
3628
4097
|
}
|
|
3629
4098
|
_registerRenderModules() {
|
|
3630
4099
|
[
|
|
3631
|
-
[
|
|
3632
|
-
[
|
|
3633
|
-
[
|
|
3634
|
-
[
|
|
4100
|
+
[dt],
|
|
4101
|
+
[Rn],
|
|
4102
|
+
[Cn],
|
|
4103
|
+
[In]
|
|
3635
4104
|
].forEach((i) => {
|
|
3636
|
-
this.disposeWithMe(this._renderManagerService.registerRenderModule(
|
|
4105
|
+
this.disposeWithMe(this._renderManagerService.registerRenderModule(k.UNIVER_SHEET, i));
|
|
3637
4106
|
});
|
|
3638
4107
|
}
|
|
3639
4108
|
};
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
],
|
|
4109
|
+
Yr(Lt, "type", k.UNIVER_SHEET);
|
|
4110
|
+
Yr(Lt, "pluginName", Uo);
|
|
4111
|
+
Lt = Oo([
|
|
4112
|
+
yi(rs, ms, vs, Pi),
|
|
4113
|
+
ln(1, A(qe)),
|
|
4114
|
+
ln(2, Q),
|
|
4115
|
+
ln(3, Ei)
|
|
4116
|
+
], Lt);
|
|
3648
4117
|
export {
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
4118
|
+
vn as BatchSaveImagesService,
|
|
4119
|
+
H as ClearSheetDrawingTransformerOperation,
|
|
4120
|
+
Nr as DeleteDrawingsCommand,
|
|
4121
|
+
jr as EditSheetDrawingOperation,
|
|
4122
|
+
ye as FileNamePart,
|
|
4123
|
+
kr as GroupSheetDrawingCommand,
|
|
4124
|
+
yn as IBatchSaveImagesService,
|
|
4125
|
+
Kt as InsertFloatImageCommand,
|
|
4126
|
+
Xt as InsertSheetDrawingCommand,
|
|
4127
|
+
gt as MoveDrawingsCommand,
|
|
4128
|
+
ht as RemoveSheetDrawingCommand,
|
|
4129
|
+
Vr as SHEETS_IMAGE_MENU_ID,
|
|
4130
|
+
to as SHEET_FLOAT_DOM_PREFIX,
|
|
4131
|
+
ct as SaveCellImagesCommand,
|
|
4132
|
+
$r as SetDrawingArrangeCommand,
|
|
4133
|
+
zt as SetSheetDrawingCommand,
|
|
4134
|
+
lt as SheetCanvasFloatDomManagerService,
|
|
4135
|
+
dt as SheetDrawingUpdateController,
|
|
4136
|
+
Br as SidebarSheetDrawingOperation,
|
|
4137
|
+
xr as UngroupSheetDrawingCommand,
|
|
4138
|
+
Lt as UniverSheetsDrawingUIPlugin,
|
|
4139
|
+
me as calcSheetFloatDomPosition,
|
|
4140
|
+
J as drawingPositionToTransform,
|
|
4141
|
+
j as transformToDrawingPosition
|
|
3668
4142
|
};
|