@univerjs/sheets-drawing-ui 0.12.3-experimental.20251205-8c9a6bf → 0.12.3-nightly.202512060617
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 +1760 -1215
- 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 +13 -0
- package/lib/facade.js +439 -395
- package/lib/index.css +1 -1
- package/lib/index.js +1760 -1215
- 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 +13 -0
- 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 +2 -0
- 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/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 +13 -12
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 q, ICommandService 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 Qr = Object.defineProperty;
|
|
2
|
+
var ei = (i, t, e) => t in i ? Qr(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
+
var re = (i, t, e) => ei(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { precisionTo as bt, IRenderManagerService as Q, transformObjectOutOfGroup as ti, getGroupState as ni, getCurrentTypeOfRenderer as Dn, CURSOR_TYPE as ri, RENDER_CLASS_TYPE as $e, Rect as ke, ObjectType as An, DRAWING_OBJECT_LAYER_INDEX as qt, SHEET_VIEWPORT_KEY as cr } from "@univerjs/engine-render";
|
|
5
|
+
import { convertPositionSheetOverGridToAbsolute as ii, SheetSkeletonManagerService as X, ISheetSelectionRenderService as Ze, attachRangeWithCoord as dr, SheetCanvasPopManagerService as si, HoverManagerService as oi, IEditorBridgeService as ai, IAutoFillService as ci, EditingRenderController as di, SetCellEditVisibleOperation as Nn, PREDEFINED_HOOK_NAME as Le, COPY_TYPE as Re, discreteRangeToRange as $n, virtualizeDiscreteRanges as li, ISheetClipboardService as ui, SetZoomRatioOperation as kn, SetScrollOperation as hi, SheetPrintInterceptorService as gi, useHighlightRange as fi, getCurrentRangeDisable$ as mi } from "@univerjs/sheets-ui";
|
|
6
|
+
import { CommandType as q, ICommandService as Y, IUndoRedoService as Je, 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 Ve, FOCUSING_COMMON_DRAWINGS as Ge, IUniverInstanceService as de, UniverInstanceType as $, Direction as ve, createIdentifier as pi, IImageIoService as hr, RxDisposable as wi, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as ot, DOCS_ZEN_EDITOR_UNIT_ID_KEY as He, InterceptorEffectEnum as _i, ObjectMatrix as Si, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as vi, IPermissionService as Ii, UserManagerService as Ci, LifecycleService as Ri, LifecycleStages as Di, DisposableCollection as yt, fromEventSubject as bi, Tools as Ye, PRINT_CHART_COMPONENT_KEY as Mi, Rectangle as yi, FOCUSING_FX_BAR_EDITOR as Ei, EDITOR_ACTIVATED as Ti, FOCUSING_PANEL_EDITOR as Oi, DependentOn as Ui, IConfigService as Pi, Plugin as Ai, merge as Ni, registerDependencies as $i, touchDependencies as Qt } from "@univerjs/core";
|
|
7
|
+
import { ISheetDrawingService as se, DrawingApplyType as U, SetDrawingApplyMutation as P, SheetDrawingAnchorType as O, UniverSheetsDrawingPlugin as ki } from "@univerjs/sheets-drawing";
|
|
8
|
+
import { SheetInterceptorService as Vt, SheetsSelectionsService as ut, SetRangeValuesCommand as Ln, getSheetCommandTarget as ae, INTERCEPTOR_POINT as xi, InterceptCellContentPriority as Wi, WorkbookViewPermission as Vn, WorksheetViewPermission as Hn, WorkbookEditablePermission as gn, WorksheetEditPermission as fn, SetFrozenMutation as Bi, SetSelectionsOperation as ji, SetWorksheetRowAutoHeightMutation as Fi, COMMAND_LISTENER_SKELETON_CHANGE as Li, InsertRowCommand as gr, InsertColCommand as fr, RemoveRowCommand as mr, RemoveColCommand as pr, DeleteRangeMoveLeftCommand as wr, DeleteRangeMoveUpCommand as _r, InsertRangeMoveDownCommand as Sr, InsertRangeMoveRightCommand as vr, DeltaRowHeightCommand as mn, 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 Vi, SetRowHiddenMutation as Hi, SetColVisibleMutation as Yi, SetColHiddenMutation as Gi, SetWorksheetRowHeightMutation as Xi, SetWorksheetColWidthMutation as zi, SetWorksheetActiveOperation as Ki, RangeProtectionPermissionEditPoint as Zi } from "@univerjs/sheets";
|
|
9
|
+
import { MessageType as Se, render as Ji, unmount as qi, FormLayout as en, CheckboxGroup as Qi, Checkbox as Yn, Select as es, Button as Gn, clsx as ts, RadioGroup as ns, Radio as tn } from "@univerjs/design";
|
|
10
|
+
import { docDrawingPositionToTransform as Xn, ReplaceSnapshotCommand as rs, InnerPasteCommand as is } from "@univerjs/docs-ui";
|
|
11
|
+
import { IImageIoService as ss, IDrawingManagerService as oe, DRAWING_IMAGE_ALLOW_IMAGE_LIST as zn, DRAWING_IMAGE_COUNT_LIMIT as Kn, ImageUploadStatusType as xe, DRAWING_IMAGE_ALLOW_SIZE as Zn, getImageSize as nn, SetDrawingSelectedOperation as Ht, DRAWING_IMAGE_WIDTH_LIMIT as Jn, DRAWING_IMAGE_HEIGHT_LIMIT as qn, ImageSourceType as os, getDrawingShapeKeyByDrawingSearch as De, UniverDrawingPlugin as as } from "@univerjs/drawing";
|
|
12
|
+
import { ILocalFileService as cs, IMessageService as Or, IDialogService as bn, ISidebarService as ds, IClipboardInterfaceService as ls, CanvasFloatDomService as us, PrintFloatDomSingle as hs, ComponentManager as Ur, connectInjector as gs, useDependency as Ie, getMenuHiddenObservable as Yt, MenuItemType as Gt, ContextMenuPosition as rn, ContextMenuGroup as sn, RibbonInsertGroup as fs, KeyCode as Ke, IMenuManagerService as ms, IShortcutService as ps } from "@univerjs/ui";
|
|
13
|
+
import { DocDrawingController as ws, UniverDocsDrawingPlugin as _s } from "@univerjs/docs-drawing";
|
|
14
|
+
import { ImageCropperObject as Ss, COMPONENT_IMAGE_POPUP_MENU as vs, OpenImageCropOperation as Is, ImageResetSizeOperation as Cs, DrawingRenderService as Pr, DrawingCommonPanel as Rs, UniverDrawingUIPlugin as Ds } from "@univerjs/drawing-ui";
|
|
15
|
+
import { takeUntil as Qn, throttleTime as bs, combineLatest as at, switchMap as me, EMPTY as we, tap as er, map as pe, distinctUntilChanged as tr, Subject as on, filter as Ms, take as ys, 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, useRef as Es, createElement as Ar, forwardRef as Ts, useState as Ee, useCallback as Et, useEffect as Nr } from "react";
|
|
18
|
+
function Z(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 = ii(
|
|
23
23
|
c.unitId,
|
|
24
24
|
c.sheetId,
|
|
25
25
|
{ from: n, to: r },
|
|
26
26
|
e
|
|
27
27
|
);
|
|
28
|
-
let { left: g, top: h, width: f, height:
|
|
29
|
-
const
|
|
30
|
-
return g + f >
|
|
28
|
+
let { left: g, top: h, width: f, height: m } = l;
|
|
29
|
+
const p = e.getCurrentSkeleton(), w = p.rowHeaderWidth + p.columnTotalWidth, S = p.columnHeaderHeight + p.rowTotalHeight;
|
|
30
|
+
return g + f > w && (g = w - f), h + m > S && (h = S - m), {
|
|
31
31
|
flipY: s,
|
|
32
32
|
flipX: o,
|
|
33
33
|
angle: a,
|
|
@@ -36,26 +36,26 @@ function K(i, t, e) {
|
|
|
36
36
|
left: g,
|
|
37
37
|
top: h,
|
|
38
38
|
width: f,
|
|
39
|
-
height:
|
|
39
|
+
height: m
|
|
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
54
|
const f = {
|
|
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,
|
|
@@ -67,50 +67,50 @@ function $(i, t) {
|
|
|
67
67
|
to: f
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
|
-
const
|
|
70
|
+
const V = {
|
|
71
71
|
id: "sheet.operation.clear-drawing-transformer",
|
|
72
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
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(Je), r = i.get(Vt), 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, f = r.onCommandExecute({ id:
|
|
93
|
-
return
|
|
92
|
+
const d = s.getBatchRemoveOp(o), { unitId: u, subUnitId: c, undo: l, redo: g, objects: h } = d, f = r.onCommandExecute({ id: ht.id, params: t }), m = { 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 = f.preRedos) != null ? S : [], m, ...f.redos], e) ? (n.pushUndoRedo({
|
|
94
94
|
unitID: u,
|
|
95
95
|
undoMutations: [
|
|
96
96
|
...(I = f.preUndos) != null ? I : [],
|
|
97
|
-
|
|
97
|
+
p,
|
|
98
98
|
...f.undos,
|
|
99
|
-
{ id:
|
|
99
|
+
{ id: V.id, params: a }
|
|
100
100
|
],
|
|
101
101
|
redoMutations: [
|
|
102
|
-
...(
|
|
103
|
-
|
|
102
|
+
...(D = f.preRedos) != null ? D : [],
|
|
103
|
+
m,
|
|
104
104
|
...f.redos,
|
|
105
|
-
{ id:
|
|
105
|
+
{ id: V.id, params: a }
|
|
106
106
|
]
|
|
107
107
|
}), !0) : !1;
|
|
108
108
|
}
|
|
109
|
-
},
|
|
109
|
+
}, $r = {
|
|
110
110
|
id: "sheet.command.delete-drawing",
|
|
111
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 Os(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: f, drawingId:
|
|
134
|
+
const { parent: n, children: r } = e, { unitId: s, subUnitId: o, drawingId: a } = n, d = ni(0, 0, r.map((l) => l.transform || {})), u = r.map((l) => {
|
|
135
|
+
const g = l.transform || { left: 0, top: 0 }, { unitId: h, subUnitId: f, drawingId: m } = l;
|
|
136
136
|
return {
|
|
137
137
|
unitId: h,
|
|
138
138
|
subUnitId: f,
|
|
139
|
-
drawingId:
|
|
139
|
+
drawingId: m,
|
|
140
140
|
transform: {
|
|
141
141
|
...g,
|
|
142
142
|
left: g.left - d.left,
|
|
@@ -148,7 +148,7 @@ function ts(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 ts(i) {
|
|
|
157
157
|
});
|
|
158
158
|
}), t;
|
|
159
159
|
}
|
|
160
|
-
function
|
|
160
|
+
function Us(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: f, drawingId:
|
|
167
|
+
const { transform: g } = l, { unitId: h, subUnitId: f, drawingId: m } = l, p = ti(g || {}, d, d.width || 0, d.height || 0);
|
|
168
168
|
return {
|
|
169
169
|
unitId: h,
|
|
170
170
|
subUnitId: f,
|
|
171
|
-
drawingId:
|
|
172
|
-
transform:
|
|
171
|
+
drawingId: m,
|
|
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 ns(i) {
|
|
|
188
188
|
});
|
|
189
189
|
}), t;
|
|
190
190
|
}
|
|
191
|
-
const
|
|
191
|
+
const kr = {
|
|
192
192
|
id: "sheet.command.group-sheet-image",
|
|
193
193
|
type: q.COMMAND,
|
|
194
194
|
handler: (i, t) => {
|
|
195
|
-
const e = i.get(
|
|
195
|
+
const e = i.get(Y), n = i.get(Je), r = i.get(se);
|
|
196
196
|
if (!t) return !1;
|
|
197
197
|
const s = [];
|
|
198
198
|
t.forEach(({ parent: h, children: f }) => {
|
|
199
|
-
s.push(h.unitId), f.forEach((
|
|
200
|
-
s.push(
|
|
199
|
+
s.push(h.unitId), f.forEach((m) => {
|
|
200
|
+
s.push(m.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: Us(l), type: U.UNGROUP } },
|
|
208
|
+
{ id: V.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: V.id, params: s }
|
|
213
213
|
]
|
|
214
214
|
}), !0) : !1;
|
|
215
215
|
}
|
|
216
|
-
},
|
|
216
|
+
}, Xt = {
|
|
217
217
|
id: "sheet.command.insert-sheet-image",
|
|
218
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(Je), r = i.get(se), s = i.get(Vt);
|
|
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, f = s.onCommandExecute({ id: Xt.id, params: t }), m = { 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 = f.preRedos) != null ? S : [], m, ...f.redos], e) ? (n.pushUndoRedo({
|
|
225
225
|
unitID: u,
|
|
226
226
|
undoMutations: [
|
|
227
227
|
...(I = f.preUndos) != null ? I : [],
|
|
228
|
-
|
|
228
|
+
p,
|
|
229
229
|
...f.undos,
|
|
230
|
-
{ id:
|
|
230
|
+
{ id: V.id, params: a }
|
|
231
231
|
],
|
|
232
232
|
redoMutations: [
|
|
233
|
-
...(
|
|
234
|
-
|
|
233
|
+
...(D = f.preRedos) != null ? D : [],
|
|
234
|
+
m,
|
|
235
235
|
...f.redos,
|
|
236
|
-
{ id:
|
|
236
|
+
{ id: V.id, params: a }
|
|
237
237
|
]
|
|
238
238
|
}), !0) : !1;
|
|
239
239
|
}
|
|
240
|
-
},
|
|
240
|
+
}, xr = {
|
|
241
241
|
id: "sheet.command.set-drawing-arrange",
|
|
242
242
|
type: q.COMMAND,
|
|
243
243
|
handler: (i, t) => {
|
|
244
|
-
const e = i.get(
|
|
244
|
+
const e = i.get(Y), n = i.get(Je);
|
|
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
263
|
type: q.COMMAND,
|
|
264
264
|
handler: (i, t) => {
|
|
265
|
-
const e = i.get(
|
|
265
|
+
const e = i.get(Y), n = i.get(Je), 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: V.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: V.id, params: [a] }
|
|
277
277
|
]
|
|
278
278
|
}), !0) : !1;
|
|
279
279
|
}
|
|
280
|
-
},
|
|
280
|
+
}, Wr = {
|
|
281
281
|
id: "sheet.command.ungroup-sheet-image",
|
|
282
282
|
type: q.COMMAND,
|
|
283
283
|
handler: (i, t) => {
|
|
284
|
-
const e = i.get(
|
|
284
|
+
const e = i.get(Y), n = i.get(Je), r = i.get(se);
|
|
285
285
|
if (!t) return !1;
|
|
286
286
|
const s = [];
|
|
287
287
|
t.forEach(({ parent: h, children: f }) => {
|
|
288
|
-
s.push(h.unitId), f.forEach((
|
|
289
|
-
s.push(
|
|
288
|
+
s.push(h.unitId), f.forEach((m) => {
|
|
289
|
+
s.push(m.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: Os(l), type: U.GROUP } },
|
|
297
|
+
{ id: V.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: V.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 Ps = Object.getOwnPropertyDescriptor, As = (i, t, e, n) => {
|
|
307
|
+
for (var r = n > 1 ? void 0 : n ? Ps(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 Ns(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 } = Ns(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, f = o / s,
|
|
323
|
+
const l = c.getCellByIndex(t.row, t.col), g = l.mergeInfo.endX - l.mergeInfo.startX - 2, h = l.mergeInfo.endY - l.mergeInfo.startY - 2, f = o / s, p = Math.ceil(Math.min(g, h * f)) / 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 re {
|
|
|
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(Zn / (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: f } = this._context.scene;
|
|
375
375
|
this._imageIoService.addImageSourceCache(d, a, g);
|
|
376
|
-
let
|
|
377
|
-
if (c >
|
|
378
|
-
const
|
|
379
|
-
|
|
376
|
+
let m = 1;
|
|
377
|
+
if (c > Jn || l > qn) {
|
|
378
|
+
const S = Jn / c, I = qn / l;
|
|
379
|
+
m = Math.max(S, I);
|
|
380
380
|
}
|
|
381
|
-
const
|
|
382
|
-
if (
|
|
381
|
+
const p = this._getImagePosition(c * m, l * m, h, f);
|
|
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: Z(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(Zn / (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 f =
|
|
427
|
+
const f = un("", {}), m = _n(
|
|
428
428
|
this._injector,
|
|
429
429
|
{
|
|
430
430
|
unitId: this._context.unitId,
|
|
@@ -436,54 +436,54 @@ let et = class extends re {
|
|
|
436
436
|
u,
|
|
437
437
|
0
|
|
438
438
|
);
|
|
439
|
-
if (!
|
|
439
|
+
if (!m)
|
|
440
440
|
return !1;
|
|
441
|
-
const
|
|
441
|
+
const p = {
|
|
442
442
|
size: {
|
|
443
|
-
width:
|
|
444
|
-
height:
|
|
443
|
+
width: m.width,
|
|
444
|
+
height: m.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
|
-
},
|
|
455
|
+
}, w = {
|
|
456
456
|
unitId: f.getUnitId(),
|
|
457
457
|
subUnitId: f.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
|
-
},
|
|
474
|
+
}, S = hn.drawing.add({
|
|
475
475
|
documentDataModel: f,
|
|
476
|
-
drawings: [
|
|
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 ? (f.apply(S), this._commandService.syncExecuteCommand(Ln.id, {
|
|
484
484
|
value: {
|
|
485
485
|
[(I = e == null ? void 0 : e.row) != null ? I : g]: {
|
|
486
|
-
[(
|
|
486
|
+
[(D = e == null ? void 0 : e.col) != null ? D : h]: {
|
|
487
487
|
p: f.getSnapshot(),
|
|
488
488
|
t: 1
|
|
489
489
|
}
|
|
@@ -496,12 +496,12 @@ let et = class extends re {
|
|
|
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 re {
|
|
|
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: Ve(),
|
|
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 re {
|
|
|
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,15 +586,15 @@ let et = class extends re {
|
|
|
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,
|
|
@@ -604,7 +604,7 @@ let et = class extends re {
|
|
|
604
604
|
}, f = this._selectionRenderService.getCellWithCoordByOffset(c + t, l + e);
|
|
605
605
|
if (f == null)
|
|
606
606
|
return;
|
|
607
|
-
const
|
|
607
|
+
const m = {
|
|
608
608
|
column: f.actualColumn,
|
|
609
609
|
columnOffset: c + t - f.startX,
|
|
610
610
|
row: f.actualRow,
|
|
@@ -612,13 +612,13 @@ let et = class extends re {
|
|
|
612
612
|
};
|
|
613
613
|
return {
|
|
614
614
|
from: h,
|
|
615
|
-
to:
|
|
615
|
+
to: m
|
|
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(xr.id, {
|
|
622
622
|
unitId: e,
|
|
623
623
|
subUnitId: n,
|
|
624
624
|
drawingIds: r,
|
|
@@ -636,16 +636,16 @@ let et = class extends re {
|
|
|
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, ...Z(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 re {
|
|
|
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(Ht.id, [{ unitId: e, subUnitId: n, drawingId: r }]);
|
|
659
659
|
})), this.disposeWithMe(this._drawingManagerService.featurePluginUngroupUpdate$.subscribe((t) => {
|
|
660
|
-
this._commandService.executeCommand(
|
|
660
|
+
this._commandService.executeCommand(Wr.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 = As([
|
|
672
|
+
ie(1, A(X)),
|
|
673
|
+
ie(2, Y),
|
|
674
|
+
ie(3, Ze),
|
|
675
|
+
ie(4, ss),
|
|
676
|
+
ie(5, cs),
|
|
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
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
|
+
$.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,23 +701,23 @@ 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
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
|
+
$.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
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(Ze), { 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) => {
|
|
@@ -725,30 +725,345 @@ const Bt = {
|
|
|
725
725
|
if (l == null)
|
|
726
726
|
return null;
|
|
727
727
|
const g = { ...l }, { left: h = 0, top: f = 0 } = l;
|
|
728
|
-
return s ===
|
|
728
|
+
return s === ve.UP ? g.top = f - 1 : s === ve.DOWN ? g.top = f + 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(V.id, [a]), !0) : !1;
|
|
738
|
+
}
|
|
739
|
+
};
|
|
740
|
+
var $s = Object.getOwnPropertyDescriptor, ks = (i, t, e, n) => {
|
|
741
|
+
for (var r = n > 1 ? void 0 : n ? $s(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 = pi("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 xs(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];
|
|
738
775
|
}
|
|
739
|
-
|
|
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($.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, $.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 f = s.getValue(g, h);
|
|
833
|
+
if (nr(f)) {
|
|
834
|
+
const m = rr(f);
|
|
835
|
+
m && o.push({
|
|
836
|
+
row: g,
|
|
837
|
+
col: h,
|
|
838
|
+
cellAddress: At(g, h),
|
|
839
|
+
source: m.source,
|
|
840
|
+
imageSourceType: m.imageSourceType,
|
|
841
|
+
imageId: m.drawingId
|
|
842
|
+
});
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
return o;
|
|
847
|
+
}
|
|
848
|
+
getDataColumns() {
|
|
849
|
+
var l, g, h, f;
|
|
850
|
+
const i = this._univerInstanceService.getCurrentUnitForType($.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 m of e) {
|
|
860
|
+
s = Math.min(s, m.range.startRow), o = Math.max(o, m.range.endRow);
|
|
861
|
+
for (let p = m.range.startColumn; p <= m.range.endColumn; p++)
|
|
862
|
+
a.add(p);
|
|
863
|
+
}
|
|
864
|
+
const d = /* @__PURE__ */ new Set();
|
|
865
|
+
for (let m = r.startColumn; m <= r.endColumn; m++)
|
|
866
|
+
if (!a.has(m))
|
|
867
|
+
for (let p = s; p <= o; p++) {
|
|
868
|
+
const w = n.getValue(p, m);
|
|
869
|
+
if (w && (((l = w.v) == null ? void 0 : l.toString()) || ((f = (h = (g = w.p) == null ? void 0 : g.body) == null ? void 0 : h.dataStream) == null ? void 0 : f.trim()) || "")) {
|
|
870
|
+
d.add(m);
|
|
871
|
+
break;
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
const u = [], c = Array.from(d).sort((m, p) => m - p);
|
|
875
|
+
for (const m of c)
|
|
876
|
+
u.push({
|
|
877
|
+
index: m,
|
|
878
|
+
label: Sn(m)
|
|
879
|
+
});
|
|
880
|
+
return u;
|
|
881
|
+
}
|
|
882
|
+
getDataColumnsForRanges(i, t, e) {
|
|
883
|
+
var h, f, m, p;
|
|
884
|
+
const n = this._univerInstanceService.getUnit(i, $.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 = (m = (f = I.p) == null ? void 0 : f.body) == null ? void 0 : m.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) => xs(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($.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 f = h.replace(/[<>:"/\\|?*]/g, "_").trim();
|
|
949
|
+
f && r.push(f);
|
|
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, $.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 f = g.getCellMatrix().getValue(i.row, t.columnIndex);
|
|
966
|
+
if (f) {
|
|
967
|
+
const m = ((a = f.v) == null ? void 0 : a.toString()) || ((c = (u = (d = f.p) == null ? void 0 : d.body) == null ? void 0 : u.dataStream) == null ? void 0 : c.trim()) || "";
|
|
968
|
+
if (m) {
|
|
969
|
+
const p = m.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), f = await (await r.getFileHandle(d, { create: !0 })).createWritable();
|
|
1001
|
+
await f.write(g), await f.close();
|
|
1002
|
+
} catch (g) {
|
|
1003
|
+
throw console.error(`Failed to save image ${d}:`, g), g;
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
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 = ks([
|
|
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
|
+
}, Br = "COMPONENT_SHEET_DRAWING_PANEL", jr = {
|
|
740
1055
|
id: "sidebar.operation.sheet-image",
|
|
741
1056
|
type: q.COMMAND,
|
|
742
1057
|
handler: async (i, t) => {
|
|
743
|
-
const e = i.get(
|
|
744
|
-
if (!
|
|
1058
|
+
const e = i.get(ds), 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: Br },
|
|
750
1065
|
onClose: () => {
|
|
751
|
-
s.syncExecuteCommand(
|
|
1066
|
+
s.syncExecuteCommand(Ht.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
|
+
}, Fr = {
|
|
764
1079
|
id: "sheet.operation.edit-sheet-image",
|
|
765
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(Ht.id, [t]), e.executeCommand(jr.id, { value: "open" }), !0);
|
|
769
1084
|
}
|
|
770
|
-
},
|
|
771
|
-
var
|
|
772
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1085
|
+
}, Ws = "sheets-drawing-ui.config", sr = {};
|
|
1086
|
+
var Bs = Object.getOwnPropertyDescriptor, js = (i, t, e, n) => {
|
|
1087
|
+
for (var r = n > 1 ? void 0 : n ? Bs(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 wi {
|
|
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$($.UNIVER_SHEET).pipe(Qn(this.dispose$)).subscribe((t) => this._create(t)), this._univerInstanceService.getTypeOfUnitDisposed$($.UNIVER_SHEET).pipe(Qn(this.dispose$)).subscribe((t) => this._dispose(t)), this._univerInstanceService.getAllUnitsForType($.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 Ss)
|
|
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) {
|
|
@@ -840,23 +1155,23 @@ let Rt = class extends Xr {
|
|
|
840
1155
|
if (f && f.disablePopup)
|
|
841
1156
|
return;
|
|
842
1157
|
r == null || r.dispose();
|
|
843
|
-
const
|
|
1158
|
+
const m = this._canvasPopManagerService.getFeatureMenu(c, l, g, h);
|
|
844
1159
|
r = this.disposeWithMe(this._canvasPopManagerService.attachPopupToObject(a, {
|
|
845
|
-
componentKey:
|
|
1160
|
+
componentKey: vs,
|
|
846
1161
|
direction: "horizontal",
|
|
847
1162
|
offset: [2, 0],
|
|
848
1163
|
extraProps: {
|
|
849
|
-
menuItems:
|
|
1164
|
+
menuItems: m || 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(Ht.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: Fr.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: Is.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: Cs.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 = js([
|
|
1216
|
+
ce(0, A(qe)),
|
|
1217
|
+
ce(1, A(Te)),
|
|
1218
|
+
ce(2, oe),
|
|
1219
|
+
ce(3, A(si)),
|
|
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 Fs = Object.getOwnPropertyDescriptor, Ls = (i, t, e, n) => {
|
|
1228
|
+
for (var r = n > 1 ? void 0 : n ? Fs(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(bs(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(ri.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 re {
|
|
|
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 = Ls([
|
|
1257
|
+
Tt(1, A(oi)),
|
|
1258
|
+
Tt(2, A(ut)),
|
|
1259
|
+
Tt(3, A(Pr)),
|
|
1260
|
+
Tt(4, A(X))
|
|
1261
|
+
], In);
|
|
1262
|
+
var Vs = Object.getOwnPropertyDescriptor, Hs = (i, t, e, n) => {
|
|
1263
|
+
for (var r = n > 1 ? void 0 : n ? Vs(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 re {
|
|
|
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 = Z(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 = Hs([
|
|
1288
|
+
Ot(1, se),
|
|
1289
|
+
Ot(2, oe),
|
|
1290
|
+
Ot(3, A(Ze)),
|
|
1291
|
+
Ot(4, A(X))
|
|
1292
|
+
], Cn);
|
|
1293
|
+
var Ys = Object.getOwnPropertyDescriptor, Gs = (i, t, e, n) => {
|
|
1294
|
+
for (var r = n > 1 ? void 0 : n ? Ys(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 Lr(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 $t = 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 === rs.id && i.params.unitId === He && (this._drawingManagerService.removeDrawingDataForUnit(He), this._docDrawingController.loadDrawingDataForUnit(He), this._drawingManagerService.initializeNotification(He));
|
|
1012
1327
|
}));
|
|
1013
1328
|
}
|
|
1014
1329
|
_initCellContentInterceptor() {
|
|
1015
1330
|
this.disposeWithMe(
|
|
1016
1331
|
this._sheetInterceptorService.intercept(
|
|
1017
|
-
|
|
1332
|
+
xi.CELL_CONTENT,
|
|
1018
1333
|
{
|
|
1019
|
-
effect:
|
|
1020
|
-
priority:
|
|
1334
|
+
effect: _i.Style,
|
|
1335
|
+
priority: Wi.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 }, Lr(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
|
+
$t = Gs([
|
|
1346
|
+
We(0, Y),
|
|
1347
|
+
We(1, A(Vt)),
|
|
1348
|
+
We(2, A(qe)),
|
|
1349
|
+
We(3, oe),
|
|
1350
|
+
We(4, A(ws)),
|
|
1351
|
+
We(5, A(ai))
|
|
1352
|
+
], $t);
|
|
1353
|
+
var Xs = Object.getOwnPropertyDescriptor, zs = (i, t, e, n) => {
|
|
1354
|
+
for (var r = n > 1 ? void 0 : n ? Xs(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 kt = 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 re {
|
|
|
1049
1364
|
this._autoFillService.addHook({
|
|
1050
1365
|
id: "sheet-cell-image-autofill",
|
|
1051
1366
|
onBeforeSubmit: (i, t, e, n) => {
|
|
1052
|
-
new
|
|
1053
|
-
|
|
1367
|
+
new Si(n).forValue((r, s, o) => {
|
|
1368
|
+
Lr(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
|
+
kt = zs([
|
|
1376
|
+
or(0, A(ci)),
|
|
1377
|
+
or(1, A(qe))
|
|
1378
|
+
], kt);
|
|
1379
|
+
var Ks = Object.getOwnPropertyDescriptor, Zs = (i, t, e, n) => {
|
|
1380
|
+
for (var r = n > 1 ? void 0 : n ? Ks(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 Js = [
|
|
1385
|
+
ot,
|
|
1386
|
+
vi,
|
|
1387
|
+
He
|
|
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($.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : r.with(di), n = hn.drawing.add({
|
|
1081
1396
|
documentDataModel: t,
|
|
1082
1397
|
drawings: [i],
|
|
1083
1398
|
selection: {
|
|
@@ -1092,20 +1407,20 @@ let yt = class extends re {
|
|
|
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 === is.id) {
|
|
1411
|
+
const n = i.params, { doc: r } = n, s = this._univerInstanceService.getCurrentUnitOfType($.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 (Js.includes(o)) {
|
|
1416
|
+
if (o !== He) {
|
|
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 re {
|
|
|
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 = Zs([
|
|
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 qs = Object.getOwnPropertyDescriptor, Qs = (i, t, e, n) => {
|
|
1459
|
+
for (var r = n > 1 ? void 0 : n ? qs(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 Vr = "image/png";
|
|
1464
|
+
function eo(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: Vr });
|
|
1154
1469
|
}
|
|
1155
|
-
function
|
|
1156
|
-
const t = new ClipboardItem({ [
|
|
1470
|
+
function to(i) {
|
|
1471
|
+
const t = new ClipboardItem({ [Vr]: eo(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 no() {
|
|
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 Rs() {
|
|
|
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 re {
|
|
|
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 = no();
|
|
1521
|
+
o.drawingType === x.DRAWING_IMAGE && o.imageSourceType === os.BASE64 ? to(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 re {
|
|
|
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 re {
|
|
|
1234
1549
|
undos: [],
|
|
1235
1550
|
redos: [
|
|
1236
1551
|
{
|
|
1237
|
-
id:
|
|
1552
|
+
id: Kt.id,
|
|
1238
1553
|
params: { files: n }
|
|
1239
1554
|
}
|
|
1240
1555
|
]
|
|
@@ -1246,7 +1561,7 @@ let Tt = class extends re {
|
|
|
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)
|
|
@@ -1254,18 +1569,18 @@ let Tt = class extends re {
|
|
|
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
1571
|
const f = c[h];
|
|
1257
|
-
if (f.drawingType !==
|
|
1572
|
+
if (f.drawingType !== x.DRAWING_IMAGE)
|
|
1258
1573
|
return;
|
|
1259
|
-
const { transform:
|
|
1260
|
-
if (f.anchorType !== O.Both || !
|
|
1574
|
+
const { transform: m } = f;
|
|
1575
|
+
if (f.anchorType !== O.Both || !m)
|
|
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 } = m, { 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(f);
|
|
1269
1584
|
}), l.length)
|
|
1270
1585
|
return {
|
|
1271
1586
|
copyRange: n,
|
|
@@ -1276,31 +1591,31 @@ let Tt = class extends re {
|
|
|
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(Ze), 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 = $n(a);
|
|
1285
1600
|
return this._generateMutations(g, {
|
|
1286
1601
|
unitId: s,
|
|
1287
1602
|
subUnitId: o,
|
|
1288
|
-
isCut: e ===
|
|
1289
|
-
getTransform: (f,
|
|
1290
|
-
var
|
|
1291
|
-
const
|
|
1603
|
+
isCut: e === Re.CUT,
|
|
1604
|
+
getTransform: (f, m) => {
|
|
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
|
-
}),
|
|
1611
|
+
}), w = {
|
|
1297
1612
|
...f,
|
|
1298
|
-
left:
|
|
1299
|
-
top:
|
|
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 : m
|
|
1304
1619
|
};
|
|
1305
1620
|
}
|
|
1306
1621
|
});
|
|
@@ -1320,20 +1635,20 @@ let Tt = class extends re {
|
|
|
1320
1635
|
...c,
|
|
1321
1636
|
unitId: n,
|
|
1322
1637
|
subUnitId: r,
|
|
1323
|
-
drawingId: o ? c.drawingId :
|
|
1638
|
+
drawingId: o ? c.drawingId : Ve(),
|
|
1324
1639
|
transform: h.transform,
|
|
1325
1640
|
sheetTransform: h.sheetTransform
|
|
1326
1641
|
};
|
|
1327
1642
|
if (o) {
|
|
1328
|
-
const { undo:
|
|
1643
|
+
const { undo: m, redo: p, objects: w } = u.getBatchUpdateOp([f]);
|
|
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 re {
|
|
|
1341
1656
|
unitId: n,
|
|
1342
1657
|
subUnitId: r,
|
|
1343
1658
|
type: U.UPDATE,
|
|
1344
|
-
op:
|
|
1345
|
-
objects:
|
|
1659
|
+
op: m,
|
|
1660
|
+
objects: w
|
|
1346
1661
|
}
|
|
1347
1662
|
});
|
|
1348
1663
|
} else {
|
|
1349
|
-
const { undo:
|
|
1350
|
-
a.push({ id: P.id, params: { op:
|
|
1664
|
+
const { undo: m, redo: p, objects: w } = u.getBatchAddOp([f]);
|
|
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: m, 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 re {
|
|
|
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: $n(o) },
|
|
1375
1690
|
pasteType: s
|
|
1376
1691
|
}, d);
|
|
1377
|
-
const { ranges: [l, g], mapFunc: h } =
|
|
1692
|
+
const { ranges: [l, g], mapFunc: h } = li([a, o]), { row: f, col: m } = h(l.startRow, l.startColumn), { row: p, col: w } = h(g.startRow, g.startColumn), S = u.attachRangeWithCoord({
|
|
1378
1693
|
startRow: f,
|
|
1379
1694
|
endRow: f,
|
|
1380
|
-
startColumn:
|
|
1381
|
-
endColumn:
|
|
1695
|
+
startColumn: m,
|
|
1696
|
+
endColumn: m
|
|
1382
1697
|
}), I = u.attachRangeWithCoord({
|
|
1383
|
-
startRow:
|
|
1384
|
-
endRow:
|
|
1385
|
-
startColumn:
|
|
1386
|
-
endColumn:
|
|
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 - f, _ = w - m;
|
|
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 = Qs([
|
|
1737
|
+
rt(0, ui),
|
|
1738
|
+
rt(1, Q),
|
|
1739
|
+
rt(2, oe),
|
|
1740
|
+
rt(3, ls),
|
|
1741
|
+
rt(4, Y)
|
|
1742
|
+
], Wt);
|
|
1743
|
+
var ro = Object.getOwnPropertyDescriptor, io = (i, t, e, n) => {
|
|
1744
|
+
for (var r = n > 1 ? void 0 : n ? ro(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$($.UNIVER_SHEET), t = this._userManagerService.currentUser$, e = at([i, t]);
|
|
1439
1754
|
this.disposeWithMe(
|
|
1440
1755
|
e.pipe(
|
|
1441
|
-
|
|
1442
|
-
|
|
1756
|
+
me(([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 Vn(o).id,
|
|
1765
|
+
new Hn(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 re {
|
|
|
1460
1775
|
if (!a)
|
|
1461
1776
|
return;
|
|
1462
1777
|
a.getAllObjectsByOrder().forEach((u) => {
|
|
1463
|
-
u.classType ===
|
|
1778
|
+
u.classType === $e.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$($.UNIVER_SHEET), t = this._userManagerService.currentUser$, e = at([i, t]);
|
|
1468
1783
|
this.disposeWithMe(
|
|
1469
1784
|
e.pipe(
|
|
1470
|
-
|
|
1471
|
-
|
|
1785
|
+
me(([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 fn(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 re {
|
|
|
1489
1804
|
if (!a)
|
|
1490
1805
|
return;
|
|
1491
1806
|
a.getAllObjectsByOrder().forEach((u) => {
|
|
1492
|
-
u.classType ===
|
|
1807
|
+
u.classType === $e.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$($.UNIVER_SHEET), t = this._userManagerService.currentUser$;
|
|
1497
1812
|
this.disposeWithMe(
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1813
|
+
at([i, t]).pipe(
|
|
1814
|
+
me(([e, n]) => e ? e.activeSheet$.pipe(
|
|
1815
|
+
me((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 Vn(s).id,
|
|
1824
|
+
new Hn(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 re {
|
|
|
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 === $e.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($.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 re {
|
|
|
1541
1856
|
);
|
|
1542
1857
|
}
|
|
1543
1858
|
_initEditPermissionChange() {
|
|
1544
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1859
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$($.UNIVER_SHEET), t = this._userManagerService.currentUser$;
|
|
1545
1860
|
this.disposeWithMe(
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1861
|
+
at([i, t]).pipe(
|
|
1862
|
+
me(([e, n]) => e ? e.activeSheet$.pipe(
|
|
1863
|
+
me((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 fn(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 re {
|
|
|
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 === $e.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 === $e.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($.UNIVER_SHEET);
|
|
1584
1899
|
if (!e)
|
|
1585
1900
|
return;
|
|
1586
1901
|
const n = e.getUnitId(), r = e.getActiveSheet();
|
|
@@ -1591,28 +1906,28 @@ let Et = class extends re {
|
|
|
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 === $e.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 = io([
|
|
1917
|
+
it(0, oe),
|
|
1918
|
+
it(1, Q),
|
|
1919
|
+
it(2, Ii),
|
|
1920
|
+
it(3, de),
|
|
1921
|
+
it(4, A(Ci))
|
|
1922
|
+
], Bt);
|
|
1923
|
+
var so = Object.getOwnPropertyDescriptor, oo = (i, t, e, n) => {
|
|
1924
|
+
for (var r = n > 1 ? void 0 : n ? so(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
|
-
const
|
|
1614
|
-
function
|
|
1615
|
-
const { scaleX: o, scaleY: a } = t.getAncestorScale(), d = t.getViewport(
|
|
1927
|
+
}, be = (i, t) => (e, n) => t(e, n, i);
|
|
1928
|
+
const ao = "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, f = {
|
|
1616
1931
|
left: !0,
|
|
1617
1932
|
// left means the left of pic is in a viewMainLeft
|
|
1618
1933
|
top: !0
|
|
@@ -1622,43 +1937,43 @@ function Ir(i, t, e, n, r, s = !1) {
|
|
|
1622
1937
|
...i,
|
|
1623
1938
|
absolute: f
|
|
1624
1939
|
};
|
|
1625
|
-
const { left:
|
|
1626
|
-
let { top: I, left:
|
|
1627
|
-
const { boundsOfViewArea:
|
|
1628
|
-
top: s ? 0 :
|
|
1629
|
-
left: s ? 0 :
|
|
1940
|
+
const { left: m, 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
|
|
1630
1945
|
};
|
|
1631
|
-
|
|
1946
|
+
_ && (Ye.isDefine(T.top) && (T.top = _.top), Ye.isDefine(T.left) && (T.left = _.left)), y === "HORIZONTAL" && (C = 0), y === "VERTICAL" && (v = 0);
|
|
1632
1947
|
let M = 0, b = 0;
|
|
1633
|
-
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;
|
|
1634
1949
|
if (g === 0)
|
|
1635
|
-
f.left = !1, M = (
|
|
1950
|
+
f.left = !1, M = (m - v) * o, b = (p - v) * o;
|
|
1636
1951
|
else {
|
|
1637
|
-
const
|
|
1638
|
-
|
|
1952
|
+
const K = m - (F - R), W = p - (F - R);
|
|
1953
|
+
p < z ? (M = K * o, b = W * o) : m <= z && p >= z ? (M = K * o, b = Math.max(D, (p - v) * o)) : m > z && (f.left = !1, M = Math.max((m - v) * o, D), b = Math.max((p - v) * o, D));
|
|
1639
1954
|
}
|
|
1640
|
-
let
|
|
1955
|
+
let H = 0, G = 0;
|
|
1641
1956
|
if (h === 0)
|
|
1642
|
-
f.top = !1,
|
|
1957
|
+
f.top = !1, H = (w - C) * a, G = (S - C) * a;
|
|
1643
1958
|
else {
|
|
1644
|
-
const
|
|
1645
|
-
|
|
1959
|
+
const K = w - (N - E), W = S - (N - E);
|
|
1960
|
+
S < te ? (H = K * a, G = W * a) : w <= te && S >= te ? (H = K * a, G = Math.max(I, (S - C) * a)) : w > te && (f.top = !1, H = Math.max((w - C) * a, I), G = Math.max((S - C) * a, I));
|
|
1646
1961
|
}
|
|
1647
|
-
return M = Math.max(M,
|
|
1962
|
+
return M = Math.max(M, T.left), H = Math.max(H, T.top), b = Math.max(b, T.left), G = Math.max(G, T.top), {
|
|
1648
1963
|
left: M,
|
|
1649
1964
|
right: b,
|
|
1650
|
-
top:
|
|
1651
|
-
bottom:
|
|
1965
|
+
top: H,
|
|
1966
|
+
bottom: G,
|
|
1652
1967
|
absolute: f
|
|
1653
1968
|
};
|
|
1654
1969
|
}
|
|
1655
|
-
const
|
|
1970
|
+
const fe = (i, t, e, n, r) => {
|
|
1656
1971
|
const { left: s, top: o, width: a, height: d, angle: u } = i, c = {
|
|
1657
1972
|
left: s,
|
|
1658
1973
|
right: s + a,
|
|
1659
1974
|
top: o,
|
|
1660
1975
|
bottom: o + d
|
|
1661
|
-
}, l =
|
|
1976
|
+
}, l = Hr(c, t, e, n, r), { scaleX: g, scaleY: h } = t.getAncestorScale();
|
|
1662
1977
|
return {
|
|
1663
1978
|
startX: l.left,
|
|
1664
1979
|
endX: l.right,
|
|
@@ -1670,23 +1985,23 @@ const ge = (i, t, e, n, r) => {
|
|
|
1670
1985
|
absolute: l.absolute
|
|
1671
1986
|
};
|
|
1672
1987
|
};
|
|
1673
|
-
let
|
|
1988
|
+
let lt = class extends ee {
|
|
1674
1989
|
constructor(t, e, n, r, s, o, a) {
|
|
1675
1990
|
super();
|
|
1676
1991
|
/**
|
|
1677
1992
|
* for update dom container position when scrolling and zoom
|
|
1678
1993
|
*/
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
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());
|
|
1686
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();
|
|
1687
2002
|
}
|
|
1688
2003
|
_bindScrollEvent() {
|
|
1689
|
-
this._lifecycleService.lifecycle$.pipe(
|
|
2004
|
+
this._lifecycleService.lifecycle$.pipe(Ms((t) => t === Di.Rendered), ys(1)).subscribe(() => {
|
|
1690
2005
|
this._scrollUpdateListener();
|
|
1691
2006
|
});
|
|
1692
2007
|
}
|
|
@@ -1711,90 +2026,90 @@ let tt = class extends re {
|
|
|
1711
2026
|
// eslint-disable-next-line max-lines-per-function
|
|
1712
2027
|
this._drawingManagerService.add$.subscribe((t) => {
|
|
1713
2028
|
t.forEach((e) => {
|
|
1714
|
-
var
|
|
1715
|
-
const { unitId: n, subUnitId: r, drawingId: s } = e, o =
|
|
2029
|
+
var K;
|
|
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, $.UNIVER_SHEET);
|
|
1716
2031
|
if (!d)
|
|
1717
2032
|
return;
|
|
1718
2033
|
const u = d.getActiveSheet().getSheetId();
|
|
1719
2034
|
if (!a || !o)
|
|
1720
2035
|
return;
|
|
1721
|
-
const c = (
|
|
2036
|
+
const c = (K = this._renderManagerService.getRenderById(n)) == null ? void 0 : K.with(X).getSkeletonParam(r);
|
|
1722
2037
|
if (!c)
|
|
1723
2038
|
return;
|
|
1724
2039
|
const { transform: l, drawingType: g, data: h } = a;
|
|
1725
|
-
if (g !==
|
|
2040
|
+
if (g !== x.DRAWING_DOM && g !== x.DRAWING_CHART)
|
|
1726
2041
|
return;
|
|
1727
2042
|
const f = this._getSceneAndTransformerByDrawingSearch(n);
|
|
1728
2043
|
if (f == null)
|
|
1729
2044
|
return;
|
|
1730
|
-
const { scene:
|
|
2045
|
+
const { scene: m, canvas: p } = f;
|
|
1731
2046
|
if (l == null)
|
|
1732
2047
|
return !0;
|
|
1733
2048
|
if (u !== r)
|
|
1734
2049
|
return;
|
|
1735
|
-
const { left:
|
|
1736
|
-
if (
|
|
1737
|
-
|
|
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 = m.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 });
|
|
1738
2053
|
return;
|
|
1739
2054
|
}
|
|
1740
2055
|
const M = {
|
|
1741
|
-
left:
|
|
1742
|
-
top:
|
|
2056
|
+
left: w,
|
|
2057
|
+
top: S,
|
|
1743
2058
|
width: I,
|
|
1744
|
-
height:
|
|
2059
|
+
height: D,
|
|
1745
2060
|
zIndex: this._drawingManagerService.getDrawingOrder(n, r).length - 1
|
|
1746
|
-
}, b = g ===
|
|
2061
|
+
}, b = g === x.DRAWING_CHART;
|
|
1747
2062
|
if (M.rotateEnabled = !1, b) {
|
|
1748
|
-
const
|
|
1749
|
-
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;
|
|
1750
2065
|
}
|
|
1751
|
-
const N = new
|
|
1752
|
-
b && N.setObjectType(
|
|
1753
|
-
const
|
|
1754
|
-
dispose:
|
|
2066
|
+
const N = new ke(E, M);
|
|
2067
|
+
b && N.setObjectType(An.CHART), m.addObject(N, qt), a.allowTransform !== !1 && m.attachTransformerTo(N);
|
|
2068
|
+
const F = new yt(), te = fe(N, f.renderUnit.scene, c.skeleton, o.worksheet), z = new je(te), H = `${ao}${Ve(6)}`, G = {
|
|
2069
|
+
dispose: F,
|
|
1755
2070
|
rect: N,
|
|
1756
|
-
position$:
|
|
2071
|
+
position$: z,
|
|
1757
2072
|
unitId: n,
|
|
1758
2073
|
subUnitId: r,
|
|
1759
2074
|
id: s,
|
|
1760
|
-
domId:
|
|
2075
|
+
domId: H
|
|
1761
2076
|
};
|
|
1762
2077
|
this._canvasFloatDomService.addFloatDom({
|
|
1763
|
-
position$:
|
|
2078
|
+
position$: z,
|
|
1764
2079
|
id: s,
|
|
1765
|
-
domId:
|
|
2080
|
+
domId: H,
|
|
1766
2081
|
componentKey: a.componentKey,
|
|
1767
|
-
onPointerDown: (
|
|
1768
|
-
|
|
2082
|
+
onPointerDown: (W) => {
|
|
2083
|
+
p.dispatchEvent(new PointerEvent(W.type, W));
|
|
1769
2084
|
},
|
|
1770
|
-
onPointerMove: (
|
|
1771
|
-
|
|
2085
|
+
onPointerMove: (W) => {
|
|
2086
|
+
p.dispatchEvent(new PointerEvent(W.type, W));
|
|
1772
2087
|
},
|
|
1773
|
-
onPointerUp: (
|
|
1774
|
-
|
|
2088
|
+
onPointerUp: (W) => {
|
|
2089
|
+
p.dispatchEvent(new PointerEvent(W.type, W));
|
|
1775
2090
|
},
|
|
1776
|
-
onWheel: (
|
|
1777
|
-
|
|
2091
|
+
onWheel: (W) => {
|
|
2092
|
+
p.dispatchEvent(new WheelEvent(W.type, W));
|
|
1778
2093
|
},
|
|
1779
2094
|
data: h,
|
|
1780
2095
|
unitId: n
|
|
1781
2096
|
});
|
|
1782
2097
|
const J = N.onTransformChange$.subscribeEvent(() => {
|
|
1783
|
-
const
|
|
1784
|
-
|
|
1785
|
-
|
|
2098
|
+
const W = fe(N, f.renderUnit.scene, c.skeleton, o.worksheet);
|
|
2099
|
+
z.next(
|
|
2100
|
+
W
|
|
1786
2101
|
);
|
|
1787
2102
|
});
|
|
1788
|
-
|
|
2103
|
+
F.add(() => {
|
|
1789
2104
|
this._canvasFloatDomService.removeFloatDom(s);
|
|
1790
|
-
}), J &&
|
|
2105
|
+
}), J && F.add(J), this._domLayerInfoMap.set(s, G);
|
|
1791
2106
|
});
|
|
1792
2107
|
})
|
|
1793
2108
|
), this.disposeWithMe(
|
|
1794
2109
|
this._drawingManagerService.remove$.subscribe((t) => {
|
|
1795
2110
|
t.forEach((e) => {
|
|
1796
2111
|
var l;
|
|
1797
|
-
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);
|
|
1798
2113
|
if (a == null)
|
|
1799
2114
|
return;
|
|
1800
2115
|
const { transformer: d, scene: u } = a, c = u.getObject(o);
|
|
@@ -1806,25 +2121,25 @@ let tt = class extends re {
|
|
|
1806
2121
|
_scrollUpdateListener() {
|
|
1807
2122
|
const t = (e, n) => {
|
|
1808
2123
|
var d;
|
|
1809
|
-
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);
|
|
1810
2125
|
!r || !o || !a || s.forEach((u) => {
|
|
1811
2126
|
const c = this._domLayerInfoMap.get(u);
|
|
1812
2127
|
if (c) {
|
|
1813
|
-
const l =
|
|
2128
|
+
const l = fe(c.rect, r.renderUnit.scene, a.skeleton, o.worksheet, c);
|
|
1814
2129
|
c.position$.next(l);
|
|
1815
2130
|
}
|
|
1816
2131
|
});
|
|
1817
2132
|
};
|
|
1818
2133
|
this.disposeWithMe(
|
|
1819
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1820
|
-
|
|
1821
|
-
|
|
2134
|
+
this._univerInstanceService.getCurrentTypeOfUnit$($.UNIVER_SHEET).pipe(
|
|
2135
|
+
me((e) => e ? e.activeSheet$ : wn(null)),
|
|
2136
|
+
pe((e) => {
|
|
1822
2137
|
if (!e) return null;
|
|
1823
2138
|
const n = e.getUnitId(), r = this._renderManagerService.getRenderById(n);
|
|
1824
2139
|
return r ? { render: r, unitId: n, subUnitId: e.getSheetId() } : null;
|
|
1825
2140
|
}),
|
|
1826
|
-
|
|
1827
|
-
(e) => e ?
|
|
2141
|
+
me(
|
|
2142
|
+
(e) => e ? bi(e.render.scene.getViewport(cr.VIEW_MAIN).onScrollAfter$).pipe(pe(() => ({ unitId: e.unitId, subUnitId: e.subUnitId }))) : wn(null)
|
|
1828
2143
|
)
|
|
1829
2144
|
).subscribe((e) => {
|
|
1830
2145
|
if (!e) return;
|
|
@@ -1832,15 +2147,15 @@ let tt = class extends re {
|
|
|
1832
2147
|
t(n, r);
|
|
1833
2148
|
})
|
|
1834
2149
|
), this.disposeWithMe(this._commandService.onCommandExecuted((e) => {
|
|
1835
|
-
if (e.id ===
|
|
2150
|
+
if (e.id === kn.id) {
|
|
1836
2151
|
const n = e.params, { unitId: r } = n;
|
|
1837
2152
|
Array.from(this._domLayerInfoMap.values()).filter((o) => o.unitId === r).map((o) => o.subUnitId).forEach((o) => {
|
|
1838
2153
|
t(r, o);
|
|
1839
2154
|
});
|
|
1840
|
-
} else if (e.id ===
|
|
2155
|
+
} else if (e.id === Bi.id) {
|
|
1841
2156
|
const { unitId: n, subUnitId: r } = e.params;
|
|
1842
2157
|
t(n, r);
|
|
1843
|
-
} else if (e.id ===
|
|
2158
|
+
} else if (e.id === ji.id) {
|
|
1844
2159
|
const { unitId: n, subUnitId: r } = e.params;
|
|
1845
2160
|
t(n, r);
|
|
1846
2161
|
}
|
|
@@ -1849,13 +2164,13 @@ let tt = class extends re {
|
|
|
1849
2164
|
updateFloatDomProps(t, e, n, r) {
|
|
1850
2165
|
const s = this._domLayerInfoMap.get(n), o = this._getSceneAndTransformerByDrawingSearch(t);
|
|
1851
2166
|
if (s && o) {
|
|
1852
|
-
const { scene: a } = o, d =
|
|
1853
|
-
u && u instanceof
|
|
2167
|
+
const { scene: a } = o, d = De({ unitId: t, subUnitId: e, drawingId: n }), u = a.getObject(d);
|
|
2168
|
+
u && u instanceof ke && u.setProps(r);
|
|
1854
2169
|
}
|
|
1855
2170
|
}
|
|
1856
2171
|
_getPosition(t, e) {
|
|
1857
2172
|
var g;
|
|
1858
|
-
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(Ze);
|
|
1859
2174
|
if (a == null)
|
|
1860
2175
|
return;
|
|
1861
2176
|
const d = a.getCellWithCoordByOffset(n, s);
|
|
@@ -1885,7 +2200,7 @@ let tt = class extends re {
|
|
|
1885
2200
|
this._drawingManagerService.update$.subscribe((t) => {
|
|
1886
2201
|
t.forEach((e) => {
|
|
1887
2202
|
const n = this._drawingManagerService.getDrawingByParam(e);
|
|
1888
|
-
if (!n || n.drawingType !==
|
|
2203
|
+
if (!n || n.drawingType !== x.DRAWING_DOM && n.drawingType !== x.DRAWING_CHART)
|
|
1889
2204
|
return;
|
|
1890
2205
|
const r = {
|
|
1891
2206
|
...n.transform
|
|
@@ -1894,7 +2209,7 @@ let tt = class extends re {
|
|
|
1894
2209
|
...n
|
|
1895
2210
|
});
|
|
1896
2211
|
const s = this._getSceneAndTransformerByDrawingSearch(e.unitId);
|
|
1897
|
-
if (s && n.drawingType !==
|
|
2212
|
+
if (s && n.drawingType !== x.DRAWING_CHART) {
|
|
1898
2213
|
const { scene: o } = s, a = this._domLayerInfoMap.get(e.drawingId);
|
|
1899
2214
|
a != null && a.rect && (n.allowTransform === !1 ? o.detachTransformerFrom(a.rect) : o.attachTransformerTo(a.rect));
|
|
1900
2215
|
}
|
|
@@ -1913,20 +2228,20 @@ let tt = class extends re {
|
|
|
1913
2228
|
}
|
|
1914
2229
|
// CreateFloatDomCommand --> floatDomService.addFloatDomToPosition
|
|
1915
2230
|
addFloatDomToPosition(t, e) {
|
|
1916
|
-
const n =
|
|
2231
|
+
const n = ae(this._univerInstanceService, {
|
|
1917
2232
|
unitId: t.unitId,
|
|
1918
2233
|
subUnitId: t.subUnitId
|
|
1919
2234
|
});
|
|
1920
2235
|
if (!n)
|
|
1921
2236
|
throw new Error("cannot find current target!");
|
|
1922
|
-
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 : Ve(), l = this._getPosition(o, r);
|
|
1923
2238
|
if (l == null)
|
|
1924
2239
|
return;
|
|
1925
2240
|
const g = {
|
|
1926
2241
|
unitId: r,
|
|
1927
2242
|
subUnitId: s,
|
|
1928
2243
|
drawingId: c,
|
|
1929
|
-
drawingType: t.type ||
|
|
2244
|
+
drawingType: t.type || x.DRAWING_DOM,
|
|
1930
2245
|
componentKey: a,
|
|
1931
2246
|
sheetTransform: l,
|
|
1932
2247
|
transform: {
|
|
@@ -1938,7 +2253,7 @@ let tt = class extends re {
|
|
|
1938
2253
|
data: d,
|
|
1939
2254
|
allowTransform: u
|
|
1940
2255
|
};
|
|
1941
|
-
return this._commandService.executeCommand(
|
|
2256
|
+
return this._commandService.executeCommand(Xt.id, {
|
|
1942
2257
|
unitId: r,
|
|
1943
2258
|
drawings: [g]
|
|
1944
2259
|
}), this._add$.next({ unitId: r, subUnitId: s, id: c }), {
|
|
@@ -1965,8 +2280,8 @@ let tt = class extends re {
|
|
|
1965
2280
|
}
|
|
1966
2281
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
1967
2282
|
addFloatDomToRange(t, e, n, r) {
|
|
1968
|
-
var C,
|
|
1969
|
-
const s =
|
|
2283
|
+
var C, _, y;
|
|
2284
|
+
const s = ae(this._univerInstanceService, {
|
|
1970
2285
|
unitId: e.unitId,
|
|
1971
2286
|
subUnitId: e.subUnitId
|
|
1972
2287
|
});
|
|
@@ -1976,84 +2291,84 @@ let tt = class extends re {
|
|
|
1976
2291
|
if (!d) return;
|
|
1977
2292
|
const u = this._renderManagerService.getRenderById(o);
|
|
1978
2293
|
if (!u) return;
|
|
1979
|
-
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);
|
|
1980
2295
|
if (!c) return;
|
|
1981
|
-
const { componentKey: l, data: g, allowTransform: h = !0 } = e, f = r != null ? r :
|
|
1982
|
-
if (this._getPosition(
|
|
2296
|
+
const { componentKey: l, data: g, allowTransform: h = !0 } = e, f = r != null ? r : Ve(), { position: m, position$: p } = this._createRangePositionObserver(t, u, c.skeleton);
|
|
2297
|
+
if (this._getPosition(m, o) == null)
|
|
1983
2298
|
return;
|
|
1984
|
-
const
|
|
2299
|
+
const S = d.scene, { scaleX: I } = S.getAncestorScale(), D = Ut(m, n, I), v = {
|
|
1985
2300
|
unitId: o,
|
|
1986
2301
|
subUnitId: a,
|
|
1987
2302
|
drawingId: f,
|
|
1988
|
-
drawingType: e.type ||
|
|
2303
|
+
drawingType: e.type || x.DRAWING_DOM,
|
|
1989
2304
|
componentKey: l,
|
|
1990
2305
|
transform: {
|
|
1991
|
-
left:
|
|
1992
|
-
top:
|
|
1993
|
-
width:
|
|
1994
|
-
height:
|
|
2306
|
+
left: D.startX,
|
|
2307
|
+
top: D.startY,
|
|
2308
|
+
width: D.width,
|
|
2309
|
+
height: D.height
|
|
1995
2310
|
},
|
|
1996
2311
|
data: g,
|
|
1997
2312
|
allowTransform: h
|
|
1998
2313
|
};
|
|
1999
2314
|
{
|
|
2000
|
-
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, $.UNIVER_SHEET);
|
|
2001
2316
|
if (!N)
|
|
2002
2317
|
return;
|
|
2003
|
-
const
|
|
2318
|
+
const F = N.getActiveSheet().getSheetId();
|
|
2004
2319
|
if (!b || !M)
|
|
2005
2320
|
return;
|
|
2006
|
-
const
|
|
2007
|
-
if (!
|
|
2321
|
+
const te = (_ = this._renderManagerService.getRenderById(R)) == null ? void 0 : _.with(X);
|
|
2322
|
+
if (!te)
|
|
2008
2323
|
return;
|
|
2009
|
-
const
|
|
2010
|
-
if (!
|
|
2324
|
+
const z = te.getWorksheetSkeleton(E);
|
|
2325
|
+
if (!z)
|
|
2011
2326
|
return;
|
|
2012
|
-
const { transform:
|
|
2013
|
-
if (
|
|
2327
|
+
const { transform: H, drawingType: G, data: J } = b;
|
|
2328
|
+
if (G !== x.DRAWING_DOM && G !== x.DRAWING_CHART)
|
|
2014
2329
|
return;
|
|
2015
|
-
const
|
|
2016
|
-
if (
|
|
2330
|
+
const K = this._getSceneAndTransformerByDrawingSearch(R);
|
|
2331
|
+
if (K == null)
|
|
2017
2332
|
return;
|
|
2018
|
-
const { scene:
|
|
2019
|
-
if (
|
|
2333
|
+
const { scene: W, canvas: Oe } = K;
|
|
2334
|
+
if (H == null || F !== E)
|
|
2020
2335
|
return;
|
|
2021
|
-
const { left:
|
|
2022
|
-
if (
|
|
2023
|
-
|
|
2336
|
+
const { left: mt, top: pt, width: wt, height: _t, angle: Zt, flipX: Jt, flipY: St, skewX: vt, skewY: Ue } = H, It = De({ unitId: R, subUnitId: E, drawingId: T }), le = W.getObject(It);
|
|
2337
|
+
if (le != null) {
|
|
2338
|
+
le.transformByState({ left: mt, top: pt, width: wt, height: _t, angle: Zt, flipX: Jt, flipY: St, skewX: vt, skewY: Ue });
|
|
2024
2339
|
return;
|
|
2025
2340
|
}
|
|
2026
|
-
const
|
|
2027
|
-
left:
|
|
2341
|
+
const ne = {
|
|
2342
|
+
left: mt,
|
|
2028
2343
|
// from floatDomParam.transform
|
|
2029
|
-
top:
|
|
2030
|
-
width:
|
|
2031
|
-
height:
|
|
2032
|
-
zIndex: this._drawingManagerService.getDrawingOrder(
|
|
2033
|
-
},
|
|
2034
|
-
if (
|
|
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) {
|
|
2035
2350
|
const k = J ? J.backgroundColor : "white";
|
|
2036
|
-
|
|
2351
|
+
ne.fill = k, ne.rotateEnabled = !1, J && J.border && (ne.stroke = J.border), ne.paintFirst = "stroke", ne.strokeWidth = 1, ne.borderEnabled = !1, ne.radius = 8;
|
|
2037
2352
|
}
|
|
2038
|
-
const
|
|
2039
|
-
|
|
2040
|
-
const
|
|
2041
|
-
top:
|
|
2042
|
-
left:
|
|
2043
|
-
bottom:
|
|
2044
|
-
right:
|
|
2045
|
-
},
|
|
2046
|
-
dispose:
|
|
2047
|
-
rect:
|
|
2048
|
-
boundsOfViewArea:
|
|
2353
|
+
const ue = new ke(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,
|
|
2049
2364
|
domAnchor: n,
|
|
2050
|
-
unitId:
|
|
2051
|
-
subUnitId:
|
|
2052
|
-
},
|
|
2053
|
-
|
|
2054
|
-
let
|
|
2055
|
-
position$:
|
|
2056
|
-
id:
|
|
2365
|
+
unitId: R,
|
|
2366
|
+
subUnitId: E
|
|
2367
|
+
}, B = fe(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,
|
|
2057
2372
|
componentKey: b.componentKey,
|
|
2058
2373
|
onPointerDown: () => {
|
|
2059
2374
|
},
|
|
@@ -2062,57 +2377,57 @@ let tt = class extends re {
|
|
|
2062
2377
|
onPointerUp: () => {
|
|
2063
2378
|
},
|
|
2064
2379
|
onWheel: (k) => {
|
|
2065
|
-
|
|
2380
|
+
Oe.dispatchEvent(new WheelEvent(k.type, k));
|
|
2066
2381
|
},
|
|
2067
2382
|
data: J,
|
|
2068
|
-
unitId:
|
|
2383
|
+
unitId: R
|
|
2069
2384
|
};
|
|
2070
|
-
e.eventPassThrough && (
|
|
2071
|
-
...
|
|
2385
|
+
e.eventPassThrough && (et = {
|
|
2386
|
+
...et,
|
|
2072
2387
|
onPointerDown: (k) => {
|
|
2073
|
-
|
|
2388
|
+
Oe.dispatchEvent(new PointerEvent(k.type, k));
|
|
2074
2389
|
},
|
|
2075
2390
|
onPointerMove: (k) => {
|
|
2076
|
-
|
|
2391
|
+
Oe.dispatchEvent(new PointerEvent(k.type, k));
|
|
2077
2392
|
},
|
|
2078
2393
|
onPointerUp: (k) => {
|
|
2079
|
-
|
|
2394
|
+
Oe.dispatchEvent(new PointerEvent(k.type, k));
|
|
2080
2395
|
}
|
|
2081
|
-
}), this._canvasFloatDomService.addFloatDom(
|
|
2082
|
-
var
|
|
2083
|
-
const
|
|
2396
|
+
}), this._canvasFloatDomService.addFloatDom(et), this.disposeWithMe(p.subscribe((k) => {
|
|
2397
|
+
var Tn, On, Un, Pn;
|
|
2398
|
+
const En = Ut({
|
|
2084
2399
|
startX: k.startX,
|
|
2085
2400
|
startY: k.startY,
|
|
2086
2401
|
endX: k.endX,
|
|
2087
2402
|
endY: k.endY,
|
|
2088
|
-
width: (
|
|
2089
|
-
height: (
|
|
2403
|
+
width: (Tn = n.width) != null ? Tn : k.width,
|
|
2404
|
+
height: (On = n.height) != null ? On : k.height,
|
|
2090
2405
|
absolute: {
|
|
2091
|
-
left:
|
|
2092
|
-
top:
|
|
2406
|
+
left: m.absolute.left,
|
|
2407
|
+
top: m.absolute.top
|
|
2093
2408
|
}
|
|
2094
|
-
}, n),
|
|
2095
|
-
left:
|
|
2096
|
-
top:
|
|
2097
|
-
width: (
|
|
2098
|
-
height: (
|
|
2099
|
-
zIndex: this._drawingManagerService.getDrawingOrder(
|
|
2100
|
-
}),
|
|
2101
|
-
|
|
2409
|
+
}, n), Zr = De({ unitId: R, subUnitId: E, drawingId: T }), Jr = new ke(Zr, {
|
|
2410
|
+
left: En.startX,
|
|
2411
|
+
top: En.startY,
|
|
2412
|
+
width: (Un = n.width) != null ? Un : k.width,
|
|
2413
|
+
height: (Pn = n.height) != null ? Pn : k.height,
|
|
2414
|
+
zIndex: this._drawingManagerService.getDrawingOrder(R, E).length - 1
|
|
2415
|
+
}), qr = fe(Jr, K.renderUnit.scene, z.skeleton, M.worksheet, ge);
|
|
2416
|
+
Ne.next(qr);
|
|
2102
2417
|
}));
|
|
2103
|
-
const
|
|
2104
|
-
|
|
2105
|
-
k &&
|
|
2418
|
+
const tt = (y = this._renderManagerService.getRenderById(R)) == null ? void 0 : y.with(X);
|
|
2419
|
+
tt == null || tt.currentSkeleton$.subscribe((k) => {
|
|
2420
|
+
k && z.sheetId !== k.sheetId && this._removeDom(f, !0);
|
|
2106
2421
|
});
|
|
2107
|
-
const
|
|
2108
|
-
const k =
|
|
2109
|
-
|
|
2422
|
+
const Dt = ue.onTransformChange$.subscribeEvent(() => {
|
|
2423
|
+
const k = fe(ue, K.renderUnit.scene, z.skeleton, M.worksheet, ge);
|
|
2424
|
+
Ne.next(
|
|
2110
2425
|
k
|
|
2111
2426
|
);
|
|
2112
2427
|
});
|
|
2113
|
-
|
|
2114
|
-
this._canvasFloatDomService.removeFloatDom(
|
|
2115
|
-
}),
|
|
2428
|
+
he.add(() => {
|
|
2429
|
+
this._canvasFloatDomService.removeFloatDom(T);
|
|
2430
|
+
}), Dt && he.add(Dt), this._domLayerInfoMap.set(T, ge);
|
|
2116
2431
|
}
|
|
2117
2432
|
return {
|
|
2118
2433
|
id: f,
|
|
@@ -2123,8 +2438,8 @@ let tt = class extends re {
|
|
|
2123
2438
|
}
|
|
2124
2439
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
2125
2440
|
addFloatDomToColumnHeader(t, e, n, r) {
|
|
2126
|
-
var
|
|
2127
|
-
const s =
|
|
2441
|
+
var D, v, C;
|
|
2442
|
+
const s = ae(this._univerInstanceService, {
|
|
2128
2443
|
unitId: e.unitId,
|
|
2129
2444
|
subUnitId: e.subUnitId
|
|
2130
2445
|
});
|
|
@@ -2134,153 +2449,153 @@ let tt = class extends re {
|
|
|
2134
2449
|
if (!this._getSceneAndTransformerByDrawingSearch(o)) return;
|
|
2135
2450
|
const u = this._renderManagerService.getRenderById(o);
|
|
2136
2451
|
if (!u) return;
|
|
2137
|
-
const c = (
|
|
2452
|
+
const c = (D = this._renderManagerService.getRenderById(o)) == null ? void 0 : D.with(X).getWorksheetSkeleton(a);
|
|
2138
2453
|
if (!c) return;
|
|
2139
|
-
const { componentKey: l, data: g, allowTransform: h = !0 } = e, f = r != null ? r :
|
|
2454
|
+
const { componentKey: l, data: g, allowTransform: h = !0 } = e, f = r != null ? r : Ve(), { position: m, position$: p } = this._createRangePositionObserver({
|
|
2140
2455
|
startRow: 0,
|
|
2141
2456
|
endRow: 0,
|
|
2142
2457
|
startColumn: t,
|
|
2143
2458
|
endColumn: t
|
|
2144
|
-
}, u, c.skeleton),
|
|
2145
|
-
if (
|
|
2459
|
+
}, u, c.skeleton), w = m;
|
|
2460
|
+
if (w.startY = 0, this._getPosition(m, o) == null)
|
|
2146
2461
|
return;
|
|
2147
2462
|
const I = {
|
|
2148
2463
|
unitId: o,
|
|
2149
2464
|
subUnitId: a,
|
|
2150
2465
|
drawingId: f,
|
|
2151
|
-
drawingType: e.type ||
|
|
2466
|
+
drawingType: e.type || x.DRAWING_DOM,
|
|
2152
2467
|
componentKey: l,
|
|
2153
2468
|
transform: {
|
|
2154
|
-
left:
|
|
2155
|
-
top:
|
|
2156
|
-
width:
|
|
2157
|
-
height:
|
|
2469
|
+
left: w.startX,
|
|
2470
|
+
top: w.startY,
|
|
2471
|
+
width: w.width,
|
|
2472
|
+
height: w.height
|
|
2158
2473
|
},
|
|
2159
2474
|
data: g,
|
|
2160
2475
|
allowTransform: h
|
|
2161
2476
|
};
|
|
2162
2477
|
{
|
|
2163
|
-
const { unitId:
|
|
2478
|
+
const { unitId: _, subUnitId: y, drawingId: R } = I, E = ae(this._univerInstanceService, { unitId: _, subUnitId: y }), T = I, M = this._univerInstanceService.getUnit(_, $.UNIVER_SHEET);
|
|
2164
2479
|
if (!M)
|
|
2165
2480
|
return;
|
|
2166
2481
|
const b = M.getActiveSheet().getSheetId();
|
|
2167
|
-
if (!
|
|
2482
|
+
if (!T || !E)
|
|
2168
2483
|
return;
|
|
2169
|
-
const N = (
|
|
2484
|
+
const N = (v = this._renderManagerService.getRenderById(_)) == null ? void 0 : v.with(X);
|
|
2170
2485
|
if (!N)
|
|
2171
2486
|
return;
|
|
2172
|
-
const
|
|
2173
|
-
if (!
|
|
2487
|
+
const F = N.getWorksheetSkeleton(y);
|
|
2488
|
+
if (!F)
|
|
2174
2489
|
return;
|
|
2175
|
-
const { transform:
|
|
2176
|
-
if (
|
|
2490
|
+
const { transform: te, data: z } = T, H = this._getSceneAndTransformerByDrawingSearch(_);
|
|
2491
|
+
if (H == null)
|
|
2177
2492
|
return;
|
|
2178
|
-
const { scene:
|
|
2179
|
-
if (
|
|
2493
|
+
const { scene: G, canvas: J } = H;
|
|
2494
|
+
if (te == null || b !== y)
|
|
2180
2495
|
return;
|
|
2181
|
-
const { left:
|
|
2182
|
-
if (
|
|
2183
|
-
|
|
2496
|
+
const { left: K, top: W, width: Oe, height: mt, angle: pt, flipX: wt, flipY: _t, skewX: Zt, skewY: Jt } = 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: mt, angle: pt, flipX: wt, flipY: _t, skewX: Zt, skewY: Jt });
|
|
2184
2499
|
return;
|
|
2185
2500
|
}
|
|
2186
|
-
const
|
|
2187
|
-
startX:
|
|
2501
|
+
const Ue = Ut({
|
|
2502
|
+
startX: w.startX,
|
|
2188
2503
|
startY: 0,
|
|
2189
|
-
endX:
|
|
2190
|
-
endY:
|
|
2504
|
+
endX: m.endX,
|
|
2505
|
+
endY: m.endY,
|
|
2191
2506
|
width: n.width,
|
|
2192
2507
|
height: n.height,
|
|
2193
2508
|
absolute: {
|
|
2194
|
-
left:
|
|
2195
|
-
top:
|
|
2509
|
+
left: m.absolute.left,
|
|
2510
|
+
top: m.absolute.top
|
|
2196
2511
|
}
|
|
2197
|
-
}, n),
|
|
2198
|
-
left:
|
|
2199
|
-
top:
|
|
2200
|
-
width:
|
|
2201
|
-
height:
|
|
2202
|
-
zIndex: this._drawingManagerService.getDrawingOrder(
|
|
2203
|
-
},
|
|
2204
|
-
|
|
2205
|
-
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 ke(St, It);
|
|
2519
|
+
G.addObject(le, qt), T.allowTransform !== !1 && G.attachTransformerTo(le);
|
|
2520
|
+
const ne = new yt(), Pe = G.getMainViewport(), ue = {
|
|
2206
2521
|
top: 0,
|
|
2207
2522
|
//viewMain.top,
|
|
2208
|
-
left:
|
|
2209
|
-
bottom:
|
|
2210
|
-
right:
|
|
2211
|
-
},
|
|
2212
|
-
dispose:
|
|
2213
|
-
rect:
|
|
2523
|
+
left: Pe.left,
|
|
2524
|
+
bottom: Pe.bottom,
|
|
2525
|
+
right: Pe.right
|
|
2526
|
+
}, he = {
|
|
2527
|
+
dispose: ne,
|
|
2528
|
+
rect: le,
|
|
2214
2529
|
// position$,
|
|
2215
|
-
unitId:
|
|
2530
|
+
unitId: _,
|
|
2216
2531
|
subUnitId: y,
|
|
2217
|
-
boundsOfViewArea:
|
|
2532
|
+
boundsOfViewArea: ue,
|
|
2218
2533
|
domAnchor: n,
|
|
2219
2534
|
scrollDirectionResponse: "HORIZONTAL"
|
|
2220
2535
|
/* HORIZONTAL */
|
|
2221
|
-
},
|
|
2222
|
-
|
|
2223
|
-
let
|
|
2224
|
-
position$:
|
|
2225
|
-
id:
|
|
2226
|
-
componentKey:
|
|
2536
|
+
}, Ct = fe(le, H.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,
|
|
2227
2542
|
onPointerDown: () => {
|
|
2228
2543
|
},
|
|
2229
2544
|
onPointerMove: () => {
|
|
2230
2545
|
},
|
|
2231
2546
|
onPointerUp: () => {
|
|
2232
2547
|
},
|
|
2233
|
-
onWheel: (
|
|
2234
|
-
J.dispatchEvent(new WheelEvent(
|
|
2548
|
+
onWheel: (B) => {
|
|
2549
|
+
J.dispatchEvent(new WheelEvent(B.type, B));
|
|
2235
2550
|
},
|
|
2236
|
-
data:
|
|
2237
|
-
unitId:
|
|
2551
|
+
data: z,
|
|
2552
|
+
unitId: _
|
|
2238
2553
|
};
|
|
2239
|
-
e.eventPassThrough && (
|
|
2240
|
-
...
|
|
2241
|
-
onPointerDown: (
|
|
2242
|
-
J.dispatchEvent(new PointerEvent(
|
|
2554
|
+
e.eventPassThrough && (Qe = {
|
|
2555
|
+
...Qe,
|
|
2556
|
+
onPointerDown: (B) => {
|
|
2557
|
+
J.dispatchEvent(new PointerEvent(B.type, B));
|
|
2243
2558
|
},
|
|
2244
|
-
onPointerMove: (
|
|
2245
|
-
J.dispatchEvent(new PointerEvent(
|
|
2559
|
+
onPointerMove: (B) => {
|
|
2560
|
+
J.dispatchEvent(new PointerEvent(B.type, B));
|
|
2246
2561
|
},
|
|
2247
|
-
onPointerUp: (
|
|
2248
|
-
J.dispatchEvent(new PointerEvent(
|
|
2562
|
+
onPointerUp: (B) => {
|
|
2563
|
+
J.dispatchEvent(new PointerEvent(B.type, B));
|
|
2249
2564
|
}
|
|
2250
|
-
}), this._canvasFloatDomService.addFloatDom(
|
|
2251
|
-
const
|
|
2252
|
-
const
|
|
2253
|
-
|
|
2254
|
-
|
|
2565
|
+
}), this._canvasFloatDomService.addFloatDom(Qe);
|
|
2566
|
+
const Rt = le.onTransformChange$.subscribeEvent(() => {
|
|
2567
|
+
const B = fe(le, H.renderUnit.scene, F.skeleton, E.worksheet, he);
|
|
2568
|
+
Ae.next(
|
|
2569
|
+
B
|
|
2255
2570
|
);
|
|
2256
2571
|
});
|
|
2257
|
-
this.disposeWithMe(
|
|
2258
|
-
const
|
|
2259
|
-
startX:
|
|
2572
|
+
this.disposeWithMe(p.subscribe((B) => {
|
|
2573
|
+
const Ne = Ut({
|
|
2574
|
+
startX: B.startX,
|
|
2260
2575
|
startY: 0,
|
|
2261
|
-
endX:
|
|
2262
|
-
endY:
|
|
2576
|
+
endX: B.endX,
|
|
2577
|
+
endY: B.endY,
|
|
2263
2578
|
width: n.width,
|
|
2264
2579
|
height: n.height,
|
|
2265
2580
|
absolute: {
|
|
2266
|
-
left:
|
|
2267
|
-
top:
|
|
2581
|
+
left: m.absolute.left,
|
|
2582
|
+
top: m.absolute.top
|
|
2268
2583
|
}
|
|
2269
|
-
}, n),
|
|
2270
|
-
left:
|
|
2584
|
+
}, n), et = De({ unitId: _, subUnitId: y, drawingId: R }), tt = new ke(et, {
|
|
2585
|
+
left: Ne.startX,
|
|
2271
2586
|
top: 0,
|
|
2272
2587
|
width: n.width,
|
|
2273
2588
|
height: n.height,
|
|
2274
|
-
zIndex: this._drawingManagerService.getDrawingOrder(
|
|
2275
|
-
}),
|
|
2276
|
-
|
|
2589
|
+
zIndex: this._drawingManagerService.getDrawingOrder(_, y).length - 1
|
|
2590
|
+
}), Dt = fe(tt, H.renderUnit.scene, F.skeleton, E.worksheet, he);
|
|
2591
|
+
Ae.next(Dt);
|
|
2277
2592
|
}));
|
|
2278
|
-
const
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
}),
|
|
2282
|
-
this._canvasFloatDomService.removeFloatDom(
|
|
2283
|
-
}),
|
|
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(f, !0);
|
|
2596
|
+
}), ne.add(() => {
|
|
2597
|
+
this._canvasFloatDomService.removeFloatDom(R);
|
|
2598
|
+
}), Rt && ne.add(Rt), this._domLayerInfoMap.set(R, he);
|
|
2284
2599
|
}
|
|
2285
2600
|
return {
|
|
2286
2601
|
id: f,
|
|
@@ -2302,19 +2617,19 @@ let tt = class extends re {
|
|
|
2302
2617
|
// eslint-disable-next-line max-lines-per-function
|
|
2303
2618
|
_createRangePositionObserver(t, e, n) {
|
|
2304
2619
|
let { startRow: r, startColumn: s } = t;
|
|
2305
|
-
const o =
|
|
2306
|
-
const
|
|
2307
|
-
a.next(
|
|
2308
|
-
}, l = new
|
|
2309
|
-
l.add(e.engine.clientRect$.subscribe(() => c())), l.add(this._commandService.onCommandExecuted((
|
|
2310
|
-
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 === Fi.id && p.params.rowsAutoHeightInfo.findIndex((S) => S.row === r) > -1) {
|
|
2311
2626
|
c();
|
|
2312
2627
|
return;
|
|
2313
2628
|
}
|
|
2314
|
-
(
|
|
2629
|
+
(Li.indexOf(p.id) > -1 || p.id === hi.id || p.id === kn.id) && c();
|
|
2315
2630
|
}));
|
|
2316
|
-
const g = (
|
|
2317
|
-
r =
|
|
2631
|
+
const g = (p, w) => {
|
|
2632
|
+
r = p, s = w, c();
|
|
2318
2633
|
}, h = () => ({
|
|
2319
2634
|
rotate: 0,
|
|
2320
2635
|
width: d.right - o.left,
|
|
@@ -2328,26 +2643,26 @@ let tt = class extends re {
|
|
|
2328
2643
|
endX: d.right,
|
|
2329
2644
|
endY: d.bottom
|
|
2330
2645
|
}), f = a.pipe(
|
|
2331
|
-
|
|
2332
|
-
const
|
|
2646
|
+
pe((p) => {
|
|
2647
|
+
const w = st(t.endRow, t.endColumn, n);
|
|
2333
2648
|
return {
|
|
2334
2649
|
rotate: 0,
|
|
2335
|
-
width:
|
|
2336
|
-
height:
|
|
2650
|
+
width: w.right - p.left,
|
|
2651
|
+
height: w.bottom - p.top,
|
|
2337
2652
|
absolute: {
|
|
2338
2653
|
left: !0,
|
|
2339
2654
|
top: !0
|
|
2340
2655
|
},
|
|
2341
|
-
startX:
|
|
2342
|
-
startY:
|
|
2343
|
-
endX:
|
|
2344
|
-
endY:
|
|
2656
|
+
startX: p.left,
|
|
2657
|
+
startY: p.top,
|
|
2658
|
+
endX: w.right,
|
|
2659
|
+
endY: w.bottom
|
|
2345
2660
|
};
|
|
2346
2661
|
})
|
|
2347
|
-
),
|
|
2662
|
+
), m = h();
|
|
2348
2663
|
return {
|
|
2349
2664
|
position$: f,
|
|
2350
|
-
position:
|
|
2665
|
+
position: m,
|
|
2351
2666
|
updateRowCol: g,
|
|
2352
2667
|
topLeftPos$: a,
|
|
2353
2668
|
rightBottomPos$: u,
|
|
@@ -2355,16 +2670,16 @@ let tt = class extends re {
|
|
|
2355
2670
|
};
|
|
2356
2671
|
}
|
|
2357
2672
|
};
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
],
|
|
2367
|
-
function
|
|
2673
|
+
lt = oo([
|
|
2674
|
+
be(0, A(Q)),
|
|
2675
|
+
be(1, de),
|
|
2676
|
+
be(2, A(Y)),
|
|
2677
|
+
be(3, oe),
|
|
2678
|
+
be(4, A(us)),
|
|
2679
|
+
be(5, se),
|
|
2680
|
+
be(6, A(Ri))
|
|
2681
|
+
], lt);
|
|
2682
|
+
function st(i, t, e) {
|
|
2368
2683
|
const n = e.getCellWithCoordByIndex(i, t), r = n.isMergedMainCell ? n.mergeInfo : n;
|
|
2369
2684
|
return {
|
|
2370
2685
|
left: r.startX,
|
|
@@ -2373,22 +2688,22 @@ function Ze(i, t, e) {
|
|
|
2373
2688
|
bottom: r.endY
|
|
2374
2689
|
};
|
|
2375
2690
|
}
|
|
2376
|
-
function
|
|
2691
|
+
function Ut(i, t, e) {
|
|
2377
2692
|
var u, c;
|
|
2378
2693
|
e = e != null ? e : 1;
|
|
2379
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;
|
|
2380
2695
|
let a = 0, d = 0;
|
|
2381
2696
|
if (t) {
|
|
2382
2697
|
if (t.horizonOffsetAlign === "right") {
|
|
2383
|
-
const l =
|
|
2698
|
+
const l = Pt(t.marginX, n * e);
|
|
2384
2699
|
a = i.endX - l - s;
|
|
2385
2700
|
} else
|
|
2386
|
-
a = i.startX +
|
|
2701
|
+
a = i.startX + Pt(t.marginX, n);
|
|
2387
2702
|
if (t.verticalOffsetAlign === "bottom") {
|
|
2388
|
-
const l =
|
|
2703
|
+
const l = Pt(t.marginY, r * e);
|
|
2389
2704
|
d = i.endY - l - o;
|
|
2390
2705
|
} else
|
|
2391
|
-
d = i.startY +
|
|
2706
|
+
d = i.startY + Pt(t.marginY, r);
|
|
2392
2707
|
}
|
|
2393
2708
|
return {
|
|
2394
2709
|
rotate: 0,
|
|
@@ -2404,15 +2719,15 @@ function Ct(i, t, e) {
|
|
|
2404
2719
|
}
|
|
2405
2720
|
};
|
|
2406
2721
|
}
|
|
2407
|
-
function
|
|
2722
|
+
function Pt(i, t) {
|
|
2408
2723
|
if (i === void 0) return 0;
|
|
2409
2724
|
if (typeof i == "number") return i;
|
|
2410
2725
|
const e = Number.parseFloat(i);
|
|
2411
2726
|
return t * e / 100;
|
|
2412
2727
|
}
|
|
2413
|
-
const
|
|
2414
|
-
const { floatDomInfos: t, scene: e, skeleton: n, worksheet: r } = i, s =
|
|
2415
|
-
const { width: a, height: d, angle: u, left: c, top: l } = o.transform, g =
|
|
2728
|
+
const co = (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(
|
|
2416
2731
|
{
|
|
2417
2732
|
left: c != null ? c : 0,
|
|
2418
2733
|
right: (c != null ? c : 0) + (a != null ? a : 0),
|
|
@@ -2424,7 +2739,7 @@ const Os = (i) => {
|
|
|
2424
2739
|
r,
|
|
2425
2740
|
void 0,
|
|
2426
2741
|
!0
|
|
2427
|
-
), { scaleX: h, scaleY: f } = e.getAncestorScale(),
|
|
2742
|
+
), { scaleX: h, scaleY: f } = e.getAncestorScale(), m = {
|
|
2428
2743
|
startX: g.left,
|
|
2429
2744
|
endX: g.right,
|
|
2430
2745
|
startY: g.top,
|
|
@@ -2433,9 +2748,9 @@ const Os = (i) => {
|
|
|
2433
2748
|
width: a * h,
|
|
2434
2749
|
height: d * f,
|
|
2435
2750
|
absolute: g.absolute
|
|
2436
|
-
},
|
|
2437
|
-
position$: new
|
|
2438
|
-
position:
|
|
2751
|
+
}, p = {
|
|
2752
|
+
position$: new je(m),
|
|
2753
|
+
position: m,
|
|
2439
2754
|
id: o.drawingId,
|
|
2440
2755
|
componentKey: o.componentKey,
|
|
2441
2756
|
onPointerMove: () => {
|
|
@@ -2449,16 +2764,16 @@ const Os = (i) => {
|
|
|
2449
2764
|
unitId: o.unitId,
|
|
2450
2765
|
data: o.data
|
|
2451
2766
|
};
|
|
2452
|
-
return [o.drawingId,
|
|
2767
|
+
return [o.drawingId, p];
|
|
2453
2768
|
}), [t, e, n, r]);
|
|
2454
|
-
return /* @__PURE__ */
|
|
2769
|
+
return /* @__PURE__ */ L("div", { style: { position: "absolute", top: 0, left: 0 }, children: s.map(([o, a]) => /* @__PURE__ */ L(hs, { layer: a, id: o, position: a.position }, o)) });
|
|
2455
2770
|
};
|
|
2456
|
-
var
|
|
2457
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
2771
|
+
var lo = Object.getOwnPropertyDescriptor, uo = (i, t, e, n) => {
|
|
2772
|
+
for (var r = n > 1 ? void 0 : n ? lo(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
2458
2773
|
(o = i[s]) && (r = o(r) || r);
|
|
2459
2774
|
return r;
|
|
2460
|
-
},
|
|
2461
|
-
let
|
|
2775
|
+
}, Me = (i, t) => (e, n) => t(e, n, i);
|
|
2776
|
+
let jt = class extends ee {
|
|
2462
2777
|
constructor(i, t, e, n, r, s, o) {
|
|
2463
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();
|
|
2464
2779
|
}
|
|
@@ -2471,7 +2786,7 @@ let Ot = class extends re {
|
|
|
2471
2786
|
const { unitId: n, scene: r, subUnitId: s } = t, o = this._drawingManagerService.getDrawingDataForUnit(n), a = o == null ? void 0 : o[s];
|
|
2472
2787
|
return a && a.order.forEach((d) => {
|
|
2473
2788
|
const u = a.data[d];
|
|
2474
|
-
u.drawingType !==
|
|
2789
|
+
u.drawingType !== x.DRAWING_CHART && u.drawingType !== x.DRAWING_DOM && this._drawingRenderService.renderDrawing(u, r);
|
|
2475
2790
|
}), e();
|
|
2476
2791
|
}
|
|
2477
2792
|
}
|
|
@@ -2484,7 +2799,7 @@ let Ot = class extends re {
|
|
|
2484
2799
|
const { unitId: n, subUnitId: r } = t, s = this._renderManagerService.getRenderById(n);
|
|
2485
2800
|
if (!s)
|
|
2486
2801
|
return e(i);
|
|
2487
|
-
const o = s.with(
|
|
2802
|
+
const o = s.with(X).getSkeletonParam(r);
|
|
2488
2803
|
if (!o)
|
|
2489
2804
|
return e(i);
|
|
2490
2805
|
const a = this._drawingManagerService.getDrawingDataForUnit(n), d = a == null ? void 0 : a[t.subUnitId];
|
|
@@ -2492,9 +2807,9 @@ let Ot = class extends re {
|
|
|
2492
2807
|
return e(i);
|
|
2493
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]);
|
|
2494
2809
|
return g.length ? (g.forEach((h) => {
|
|
2495
|
-
if (!h.groupId && h.transform &&
|
|
2496
|
-
const f = o.skeleton.getCellIndexByOffset(h.transform.left, h.transform.top, u, c, { x: 0, y: 0 }),
|
|
2497
|
-
f.column < l.startColumn && (l.startColumn = f.column), f.row < l.startRow && (l.startRow = f.row), l.endRow <
|
|
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 f = o.skeleton.getCellIndexByOffset(h.transform.left, h.transform.top, u, c, { x: 0, y: 0 }), m = o.skeleton.getCellIndexByOffset(h.transform.left + h.transform.width, h.transform.top + h.transform.height, u, c, { x: 0, y: 0 });
|
|
2812
|
+
f.column < l.startColumn && (l.startColumn = f.column), f.row < l.startRow && (l.startRow = f.row), l.endRow < m.row && (l.endRow = m.row), l.endColumn < m.column && (l.endColumn = m.column);
|
|
2498
2813
|
}
|
|
2499
2814
|
}), e(l)) : e(i);
|
|
2500
2815
|
}
|
|
@@ -2512,12 +2827,12 @@ let Ot = class extends re {
|
|
|
2512
2827
|
if (o) {
|
|
2513
2828
|
const a = o.order.map((u) => {
|
|
2514
2829
|
const c = o.data[u];
|
|
2515
|
-
if (c.drawingType ===
|
|
2830
|
+
if (c.drawingType === x.DRAWING_CHART)
|
|
2516
2831
|
return {
|
|
2517
2832
|
...c,
|
|
2518
|
-
componentKey: this._componetManager.get(
|
|
2833
|
+
componentKey: this._componetManager.get(Mi)
|
|
2519
2834
|
};
|
|
2520
|
-
if (c.drawingType ===
|
|
2835
|
+
if (c.drawingType === x.DRAWING_DOM) {
|
|
2521
2836
|
const l = this._sheetPrintInterceptorService.getPrintComponent(c.componentKey);
|
|
2522
2837
|
return {
|
|
2523
2838
|
...c,
|
|
@@ -2525,12 +2840,12 @@ let Ot = class extends re {
|
|
|
2525
2840
|
};
|
|
2526
2841
|
}
|
|
2527
2842
|
return null;
|
|
2528
|
-
}).filter(Boolean), d =
|
|
2529
|
-
return
|
|
2530
|
-
/* @__PURE__ */
|
|
2843
|
+
}).filter(Boolean), d = gs(co, this._injector);
|
|
2844
|
+
return Ji(
|
|
2845
|
+
/* @__PURE__ */ L(d, { floatDomInfos: a, scene: t.scene, skeleton: t.skeleton, worksheet: t.worksheet }),
|
|
2531
2846
|
t.root
|
|
2532
2847
|
), i == null || i.add(() => {
|
|
2533
|
-
|
|
2848
|
+
qi(t.root);
|
|
2534
2849
|
}), e(i);
|
|
2535
2850
|
}
|
|
2536
2851
|
}
|
|
@@ -2539,49 +2854,49 @@ let Ot = class extends re {
|
|
|
2539
2854
|
);
|
|
2540
2855
|
}
|
|
2541
2856
|
};
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
],
|
|
2551
|
-
var
|
|
2552
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
2857
|
+
jt = uo([
|
|
2858
|
+
Me(0, A(gi)),
|
|
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 ho = Object.getOwnPropertyDescriptor, go = (i, t, e, n) => {
|
|
2867
|
+
for (var r = n > 1 ? void 0 : n ? ho(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
2553
2868
|
(o = i[s]) && (r = o(r) || r);
|
|
2554
2869
|
return r;
|
|
2555
|
-
},
|
|
2556
|
-
const
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
],
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2870
|
+
}, _e = (i, t) => (e, n) => t(e, n, i);
|
|
2871
|
+
const fo = [
|
|
2872
|
+
gr.id,
|
|
2873
|
+
fr.id,
|
|
2874
|
+
mr.id,
|
|
2875
|
+
pr.id,
|
|
2876
|
+
wr.id,
|
|
2877
|
+
_r.id,
|
|
2878
|
+
Sr.id,
|
|
2879
|
+
vr.id,
|
|
2880
|
+
mn.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
|
+
], mo = [
|
|
2892
|
+
Vi.id,
|
|
2893
|
+
Hi.id,
|
|
2894
|
+
Yi.id,
|
|
2895
|
+
Gi.id,
|
|
2896
|
+
Xi.id,
|
|
2897
|
+
zi.id
|
|
2583
2898
|
];
|
|
2584
|
-
let
|
|
2899
|
+
let Rn = class extends ee {
|
|
2585
2900
|
constructor(i, t, e, n, r, s, o, a, d) {
|
|
2586
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();
|
|
2587
2902
|
}
|
|
@@ -2590,57 +2905,57 @@ let rn = class extends re {
|
|
|
2590
2905
|
this._sheetInterceptorService.interceptAfterCommand({
|
|
2591
2906
|
/* eslint-disable-next-line complexity */
|
|
2592
2907
|
getMutations: (i) => {
|
|
2593
|
-
if (!
|
|
2908
|
+
if (!fo.includes(i.id))
|
|
2594
2909
|
return { redos: [], undos: [] };
|
|
2595
2910
|
if (i.params == null)
|
|
2596
2911
|
return { redos: [], undos: [] };
|
|
2597
2912
|
const t = i.id;
|
|
2598
|
-
if (t ===
|
|
2913
|
+
if (t === gr.id)
|
|
2599
2914
|
return this._moveRowInterceptor(i.params, "insert");
|
|
2600
|
-
if ([
|
|
2915
|
+
if ([yr.id, Er.id, Tr.id].includes(t))
|
|
2601
2916
|
return this._moveRangeInterceptor(i.params);
|
|
2602
|
-
if (t ===
|
|
2917
|
+
if (t === fr.id)
|
|
2603
2918
|
return this._moveColInterceptor(i.params, "insert");
|
|
2604
|
-
if (t ===
|
|
2919
|
+
if (t === mr.id)
|
|
2605
2920
|
return this._moveRowInterceptor(i.params, "remove");
|
|
2606
|
-
if (t ===
|
|
2921
|
+
if (t === pr.id)
|
|
2607
2922
|
return this._moveColInterceptor(i.params, "remove");
|
|
2608
|
-
if (t ===
|
|
2923
|
+
if (t === wr.id) {
|
|
2609
2924
|
const { range: e } = i.params;
|
|
2610
2925
|
return this._getRangeMoveUndo(
|
|
2611
2926
|
e,
|
|
2612
2927
|
0
|
|
2613
2928
|
/* deleteLeft */
|
|
2614
2929
|
);
|
|
2615
|
-
} else if (t ===
|
|
2930
|
+
} else if (t === _r.id) {
|
|
2616
2931
|
const { range: e } = i.params;
|
|
2617
2932
|
return this._getRangeMoveUndo(
|
|
2618
2933
|
e,
|
|
2619
2934
|
1
|
|
2620
2935
|
/* deleteUp */
|
|
2621
2936
|
);
|
|
2622
|
-
} else if (t ===
|
|
2937
|
+
} else if (t === Sr.id) {
|
|
2623
2938
|
const { range: e } = i.params;
|
|
2624
2939
|
return this._getRangeMoveUndo(
|
|
2625
2940
|
e,
|
|
2626
2941
|
2
|
|
2627
2942
|
/* insertDown */
|
|
2628
2943
|
);
|
|
2629
|
-
} else if (t ===
|
|
2944
|
+
} else if (t === vr.id) {
|
|
2630
2945
|
const { range: e } = i.params;
|
|
2631
2946
|
return this._getRangeMoveUndo(
|
|
2632
2947
|
e,
|
|
2633
2948
|
3
|
|
2634
2949
|
/* insertRight */
|
|
2635
2950
|
);
|
|
2636
|
-
} else if (t ===
|
|
2951
|
+
} else if (t === Rr.id || t === Dr.id) {
|
|
2637
2952
|
const e = i.params, { unitId: n, subUnitId: r, ranges: s } = e;
|
|
2638
2953
|
return this._getDrawingUndoForRowVisible(n, r, s);
|
|
2639
|
-
} else if (t ===
|
|
2954
|
+
} else if (t === br.id || t === Mr.id) {
|
|
2640
2955
|
const e = i.params, { unitId: n, subUnitId: r, ranges: s } = e;
|
|
2641
2956
|
return this._getDrawingUndoForColVisible(n, r, s);
|
|
2642
|
-
} else if (t ===
|
|
2643
|
-
const e = i.params, { unitId: n, subUnitId: r, ranges: s } = e, o = t ===
|
|
2957
|
+
} else if (t === mn.id || t === pn.id || t === Ir.id || t === Cr.id) {
|
|
2958
|
+
const e = i.params, { unitId: n, subUnitId: r, ranges: s } = e, o = t === mn.id || t === pn.id;
|
|
2644
2959
|
return this._getDrawingUndoForRowAndColSize(n, r, s, o);
|
|
2645
2960
|
}
|
|
2646
2961
|
return { redos: [], undos: [] };
|
|
@@ -2649,7 +2964,7 @@ let rn = class extends re {
|
|
|
2649
2964
|
);
|
|
2650
2965
|
}
|
|
2651
2966
|
_getRangeMoveUndo(i, t) {
|
|
2652
|
-
const e =
|
|
2967
|
+
const e = ae(this._univerInstanceService);
|
|
2653
2968
|
if (e == null)
|
|
2654
2969
|
return { redos: [], undos: [] };
|
|
2655
2970
|
const n = e.unitId, r = e.subUnitId, s = [], o = [], a = this._sheetDrawingService.getDrawingData(n, r), d = [], u = [];
|
|
@@ -2666,49 +2981,49 @@ let rn = class extends re {
|
|
|
2666
2981
|
const c = this._sheetDrawingService.getBatchRemoveOp(u), l = c.undo, g = c.redo, h = c.objects;
|
|
2667
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 } });
|
|
2668
2983
|
}
|
|
2669
|
-
return s.push({ id:
|
|
2984
|
+
return s.push({ id: V.id, params: [n] }), o.push({ id: V.id, params: [n] }), {
|
|
2670
2985
|
redos: s,
|
|
2671
2986
|
undos: o
|
|
2672
2987
|
};
|
|
2673
2988
|
}
|
|
2674
2989
|
_getUpdateOrDeleteDrawings(i, t, e) {
|
|
2675
|
-
const n = [], r = [], { sheetTransform: s, anchorType: o = O.Position, transform: a, unitId: d, subUnitId: u, drawingId: c } = e, { from: l, to: g } = s, { row: h, column: f } = l, { row:
|
|
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: f } = l, { row: m, column: p } = g;
|
|
2676
2991
|
if (s == null || a == null)
|
|
2677
2992
|
return {
|
|
2678
2993
|
updateDrawings: n,
|
|
2679
2994
|
deleteDrawings: r
|
|
2680
2995
|
};
|
|
2681
|
-
const { startRow:
|
|
2682
|
-
let
|
|
2683
|
-
if (t === 0 && h >=
|
|
2684
|
-
if (f >= I &&
|
|
2996
|
+
const { startRow: w, endRow: S, startColumn: I, endColumn: D } = i;
|
|
2997
|
+
let v = null, C = null;
|
|
2998
|
+
if (t === 0 && h >= w && m <= S)
|
|
2999
|
+
if (f >= I && p <= D)
|
|
2685
3000
|
r.push({ unitId: d, subUnitId: u, drawingId: c });
|
|
2686
3001
|
else {
|
|
2687
|
-
const
|
|
2688
|
-
|
|
3002
|
+
const _ = this._shrinkCol(s, a, I, D, o);
|
|
3003
|
+
v = _ == null ? void 0 : _.newSheetTransform, C = _ == null ? void 0 : _.newTransform;
|
|
2689
3004
|
}
|
|
2690
|
-
else if (t === 1 && f >= I &&
|
|
2691
|
-
if (h >=
|
|
3005
|
+
else if (t === 1 && f >= I && p <= D)
|
|
3006
|
+
if (h >= w && m <= S)
|
|
2692
3007
|
r.push({ unitId: d, subUnitId: u, drawingId: c });
|
|
2693
3008
|
else {
|
|
2694
|
-
const
|
|
2695
|
-
|
|
3009
|
+
const _ = this._shrinkRow(s, a, w, S, o);
|
|
3010
|
+
v = _ == null ? void 0 : _.newSheetTransform, C = _ == null ? void 0 : _.newTransform;
|
|
2696
3011
|
}
|
|
2697
3012
|
else if (t === 2) {
|
|
2698
|
-
const
|
|
2699
|
-
|
|
3013
|
+
const _ = this._expandRow(s, a, w, S, o);
|
|
3014
|
+
v = _ == null ? void 0 : _.newSheetTransform, C = _ == null ? void 0 : _.newTransform;
|
|
2700
3015
|
} else if (t === 3) {
|
|
2701
|
-
const
|
|
2702
|
-
|
|
3016
|
+
const _ = this._expandCol(s, a, I, D, o);
|
|
3017
|
+
v = _ == null ? void 0 : _.newSheetTransform, C = _ == null ? void 0 : _.newTransform;
|
|
2703
3018
|
}
|
|
2704
|
-
if (
|
|
2705
|
-
const
|
|
2706
|
-
n.push({ ...e, sheetTransform:
|
|
3019
|
+
if (v != null && C != null) {
|
|
3020
|
+
const _ = Z(v, this._selectionRenderService, this._skeletonManagerService);
|
|
3021
|
+
n.push({ ...e, sheetTransform: v, transform: _ });
|
|
2707
3022
|
}
|
|
2708
3023
|
return { updateDrawings: n, deleteDrawings: r };
|
|
2709
3024
|
}
|
|
2710
3025
|
_remainDrawingSize(i, t, e) {
|
|
2711
|
-
const n =
|
|
3026
|
+
const n = j({ ...i }, this._selectionRenderService);
|
|
2712
3027
|
n != null && t.push({
|
|
2713
3028
|
...e,
|
|
2714
3029
|
sheetTransform: n
|
|
@@ -2722,31 +3037,31 @@ let rn = class extends re {
|
|
|
2722
3037
|
if (f === O.None)
|
|
2723
3038
|
this._remainDrawingSize(h, r, l);
|
|
2724
3039
|
else {
|
|
2725
|
-
const { from:
|
|
2726
|
-
for (let
|
|
2727
|
-
const C = e[
|
|
2728
|
-
if (
|
|
3040
|
+
const { from: m, to: p } = g, { row: w, column: S } = m, { 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)
|
|
2729
3044
|
continue;
|
|
2730
3045
|
if (f === O.Position) {
|
|
2731
3046
|
let b = null, N = null;
|
|
2732
|
-
if (
|
|
2733
|
-
const
|
|
2734
|
-
if (
|
|
3047
|
+
if (S >= R && S <= E) {
|
|
3048
|
+
const F = this._skeletonManagerService.attachRangeWithCoord({ startColumn: S, endColumn: E, startRow: m.row, endRow: p.row });
|
|
3049
|
+
if (F == null)
|
|
2735
3050
|
return;
|
|
2736
|
-
N = { ...h, left:
|
|
3051
|
+
N = { ...h, left: F.startX };
|
|
2737
3052
|
}
|
|
2738
|
-
if (N != null && (b =
|
|
3053
|
+
if (N != null && (b = j(N, this._selectionRenderService), b != null && N != null)) {
|
|
2739
3054
|
r.push({ ...l, sheetTransform: b, transform: N });
|
|
2740
3055
|
break;
|
|
2741
3056
|
}
|
|
2742
3057
|
this._remainDrawingSize(h, r, l);
|
|
2743
3058
|
continue;
|
|
2744
3059
|
}
|
|
2745
|
-
if (
|
|
3060
|
+
if (S >= R && D <= E)
|
|
2746
3061
|
continue;
|
|
2747
|
-
let
|
|
2748
|
-
if (
|
|
2749
|
-
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: m.row, endRow: p.row });
|
|
2750
3065
|
if (b == null)
|
|
2751
3066
|
return;
|
|
2752
3067
|
M = {
|
|
@@ -2754,8 +3069,8 @@ let rn = class extends re {
|
|
|
2754
3069
|
left: (b == null ? void 0 : b.startX) || 0,
|
|
2755
3070
|
width: ((h == null ? void 0 : h.width) || 0) - b.endX + b.startX
|
|
2756
3071
|
};
|
|
2757
|
-
} else if (
|
|
2758
|
-
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn:
|
|
3072
|
+
} else if (D >= R && D <= E) {
|
|
3073
|
+
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: R, endColumn: D, startRow: m.row, endRow: p.row });
|
|
2759
3074
|
if (b == null)
|
|
2760
3075
|
return;
|
|
2761
3076
|
M = {
|
|
@@ -2763,19 +3078,19 @@ let rn = class extends re {
|
|
|
2763
3078
|
left: b.startX - ((h == null ? void 0 : h.width) || 0)
|
|
2764
3079
|
};
|
|
2765
3080
|
} else {
|
|
2766
|
-
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn:
|
|
3081
|
+
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: R, endColumn: E, startRow: m.row, endRow: p.row });
|
|
2767
3082
|
if (b == null)
|
|
2768
3083
|
return;
|
|
2769
3084
|
if (M = {
|
|
2770
3085
|
...h,
|
|
2771
3086
|
width: ((h == null ? void 0 : h.width) || 0) - b.endX + b.startX
|
|
2772
|
-
},
|
|
2773
|
-
s.push({ ...l, sheetTransform:
|
|
3087
|
+
}, T = j(M, this._selectionRenderService), T != null && M != null) {
|
|
3088
|
+
s.push({ ...l, sheetTransform: T, transform: M });
|
|
2774
3089
|
break;
|
|
2775
3090
|
}
|
|
2776
3091
|
}
|
|
2777
|
-
if (M != null && (
|
|
2778
|
-
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 });
|
|
2779
3094
|
break;
|
|
2780
3095
|
} else
|
|
2781
3096
|
this._remainDrawingSize(h, r, l);
|
|
@@ -2798,10 +3113,10 @@ let rn = class extends re {
|
|
|
2798
3113
|
_createUndoAndRedoMutation(i, t, e) {
|
|
2799
3114
|
const n = this._sheetDrawingService.getBatchUpdateOp(e), { undo: r, redo: s, objects: o } = n, a = [
|
|
2800
3115
|
{ id: P.id, params: { unitId: i, subUnitId: t, op: s, objects: o, type: U.UPDATE } },
|
|
2801
|
-
{ id:
|
|
3116
|
+
{ id: V.id, params: [i] }
|
|
2802
3117
|
], d = [
|
|
2803
3118
|
{ id: P.id, params: { unitId: i, subUnitId: t, op: r, objects: o, type: U.UPDATE } },
|
|
2804
|
-
{ id:
|
|
3119
|
+
{ id: V.id, params: [i] }
|
|
2805
3120
|
];
|
|
2806
3121
|
return {
|
|
2807
3122
|
redos: a,
|
|
@@ -2816,31 +3131,31 @@ let rn = class extends re {
|
|
|
2816
3131
|
if (f === O.None)
|
|
2817
3132
|
this._remainDrawingSize(h, r, l);
|
|
2818
3133
|
else {
|
|
2819
|
-
const { from:
|
|
2820
|
-
for (let
|
|
2821
|
-
const C = e[
|
|
2822
|
-
if (I <
|
|
3134
|
+
const { from: m, to: p } = g, { row: w, column: S } = m, { 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 < _)
|
|
2823
3138
|
continue;
|
|
2824
3139
|
if (f === O.Position) {
|
|
2825
3140
|
let b = null, N = null;
|
|
2826
|
-
if (
|
|
2827
|
-
const
|
|
2828
|
-
if (
|
|
3141
|
+
if (w >= _ && w <= y) {
|
|
3142
|
+
const F = this._skeletonManagerService.attachRangeWithCoord({ startColumn: m.column, endColumn: p.column, startRow: w, endRow: y });
|
|
3143
|
+
if (F == null)
|
|
2829
3144
|
return;
|
|
2830
|
-
N = { ...h, top:
|
|
3145
|
+
N = { ...h, top: F.startY };
|
|
2831
3146
|
}
|
|
2832
|
-
if (N != null && (b =
|
|
3147
|
+
if (N != null && (b = j(N, this._selectionRenderService), b != null && N != null)) {
|
|
2833
3148
|
r.push({ ...l, sheetTransform: b, transform: N });
|
|
2834
3149
|
break;
|
|
2835
3150
|
}
|
|
2836
3151
|
this._remainDrawingSize(h, r, l);
|
|
2837
3152
|
continue;
|
|
2838
3153
|
}
|
|
2839
|
-
if (
|
|
3154
|
+
if (w >= _ && I <= y)
|
|
2840
3155
|
continue;
|
|
2841
|
-
let
|
|
2842
|
-
if (
|
|
2843
|
-
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn:
|
|
3156
|
+
let T = null, M = null;
|
|
3157
|
+
if (w >= _ && w <= y) {
|
|
3158
|
+
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: m.column, endColumn: p.column, startRow: w, endRow: y });
|
|
2844
3159
|
if (b == null)
|
|
2845
3160
|
return;
|
|
2846
3161
|
M = {
|
|
@@ -2848,8 +3163,8 @@ let rn = class extends re {
|
|
|
2848
3163
|
top: (b == null ? void 0 : b.startY) || 0,
|
|
2849
3164
|
height: ((h == null ? void 0 : h.height) || 0) - b.endY + b.startY
|
|
2850
3165
|
};
|
|
2851
|
-
} else if (I >=
|
|
2852
|
-
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn:
|
|
3166
|
+
} else if (I >= _ && I <= y) {
|
|
3167
|
+
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: m.column, endColumn: p.column, startRow: _, endRow: I });
|
|
2853
3168
|
if (b == null)
|
|
2854
3169
|
return;
|
|
2855
3170
|
M = {
|
|
@@ -2857,19 +3172,19 @@ let rn = class extends re {
|
|
|
2857
3172
|
top: b.startY - ((h == null ? void 0 : h.height) || 0)
|
|
2858
3173
|
};
|
|
2859
3174
|
} else {
|
|
2860
|
-
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn:
|
|
3175
|
+
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: m.column, endColumn: p.column, startRow: _, endRow: y });
|
|
2861
3176
|
if (b == null)
|
|
2862
3177
|
return;
|
|
2863
3178
|
if (M = {
|
|
2864
3179
|
...h,
|
|
2865
3180
|
height: ((h == null ? void 0 : h.height) || 0) - b.endY + b.startY
|
|
2866
|
-
},
|
|
2867
|
-
s.push({ ...l, sheetTransform:
|
|
3181
|
+
}, T = j(M, this._selectionRenderService), T != null && M != null) {
|
|
3182
|
+
s.push({ ...l, sheetTransform: T, transform: M });
|
|
2868
3183
|
break;
|
|
2869
3184
|
}
|
|
2870
3185
|
}
|
|
2871
|
-
if (M != null && (
|
|
2872
|
-
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 });
|
|
2873
3188
|
break;
|
|
2874
3189
|
} else
|
|
2875
3190
|
this._remainDrawingSize(h, r, l);
|
|
@@ -2896,20 +3211,20 @@ let rn = class extends re {
|
|
|
2896
3211
|
if (c === O.None)
|
|
2897
3212
|
this._remainDrawingSize(u, s, a);
|
|
2898
3213
|
else {
|
|
2899
|
-
const { from: l, to: g } = d, { row: h, column: f } = l, { row:
|
|
2900
|
-
for (let
|
|
2901
|
-
const
|
|
2902
|
-
if (
|
|
3214
|
+
const { from: l, to: g } = d, { row: h, column: f } = l, { row: m, 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 (m < I || p < v)
|
|
2903
3218
|
continue;
|
|
2904
|
-
if (c === O.Position && (h <= I &&
|
|
3219
|
+
if (c === O.Position && (h <= I && m >= D || f <= v && p >= C)) {
|
|
2905
3220
|
this._remainDrawingSize(u, s, a);
|
|
2906
3221
|
continue;
|
|
2907
3222
|
}
|
|
2908
|
-
const
|
|
2909
|
-
if (
|
|
3223
|
+
const _ = Z({ ...d }, this._selectionRenderService, this._skeletonManagerService);
|
|
3224
|
+
if (_ != null) {
|
|
2910
3225
|
s.push({
|
|
2911
3226
|
...a,
|
|
2912
|
-
transform:
|
|
3227
|
+
transform: _
|
|
2913
3228
|
});
|
|
2914
3229
|
break;
|
|
2915
3230
|
}
|
|
@@ -2922,7 +3237,7 @@ let rn = class extends re {
|
|
|
2922
3237
|
if (t === "insert")
|
|
2923
3238
|
e = i.unitId, n = i.subUnitId;
|
|
2924
3239
|
else {
|
|
2925
|
-
const r =
|
|
3240
|
+
const r = ae(this._univerInstanceService);
|
|
2926
3241
|
if (r == null)
|
|
2927
3242
|
return;
|
|
2928
3243
|
e = r.unitId, n = r.subUnitId;
|
|
@@ -2930,50 +3245,50 @@ let rn = class extends re {
|
|
|
2930
3245
|
return { unitId: e, subUnitId: n };
|
|
2931
3246
|
}
|
|
2932
3247
|
_moveRangeInterceptor(i) {
|
|
2933
|
-
var I,
|
|
2934
|
-
const { toRange: t, fromRange: e } = i, n =
|
|
3248
|
+
var I, D;
|
|
3249
|
+
const { toRange: t, fromRange: e } = i, n = ae(this._univerInstanceService);
|
|
2935
3250
|
if (!n)
|
|
2936
3251
|
return { redos: [], undos: [] };
|
|
2937
|
-
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();
|
|
2938
3253
|
if (!o)
|
|
2939
3254
|
return { redos: [], undos: [] };
|
|
2940
|
-
const a =
|
|
3255
|
+
const a = dr(o, e);
|
|
2941
3256
|
if (!a)
|
|
2942
3257
|
return { redos: [], undos: [] };
|
|
2943
3258
|
const { startX: d, endX: u, startY: c, endY: l } = a, g = this._sheetDrawingService.getDrawingData(r, s), h = [];
|
|
2944
|
-
Object.keys(g).forEach((
|
|
2945
|
-
const C = g[
|
|
3259
|
+
Object.keys(g).forEach((v) => {
|
|
3260
|
+
const C = g[v];
|
|
2946
3261
|
if (C.anchorType !== O.Both)
|
|
2947
3262
|
return;
|
|
2948
|
-
const { transform:
|
|
2949
|
-
if (!
|
|
3263
|
+
const { transform: _ } = C;
|
|
3264
|
+
if (!_)
|
|
2950
3265
|
return;
|
|
2951
|
-
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 } = {
|
|
2952
3267
|
drawingStartX: y,
|
|
2953
|
-
drawingEndX: y +
|
|
2954
|
-
drawingStartY:
|
|
2955
|
-
drawingEndY:
|
|
3268
|
+
drawingEndX: y + E,
|
|
3269
|
+
drawingStartY: R,
|
|
3270
|
+
drawingEndY: R + T
|
|
2956
3271
|
};
|
|
2957
|
-
d <= M && b <= u && c <= N &&
|
|
3272
|
+
d <= M && b <= u && c <= N && F <= l && h.push(C);
|
|
2958
3273
|
});
|
|
2959
|
-
const f = [],
|
|
2960
|
-
const C =
|
|
2961
|
-
to: { ...C.to, row: C.to.row +
|
|
2962
|
-
from: { ...C.from, row: C.from.row +
|
|
2963
|
-
}, y =
|
|
3274
|
+
const f = [], m = [], 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 = Z(_, this._selectionRenderService, this._skeletonManagerService);
|
|
2964
3279
|
return {
|
|
2965
3280
|
unitId: r,
|
|
2966
3281
|
subUnitId: s,
|
|
2967
|
-
drawingId:
|
|
3282
|
+
drawingId: v.drawingId,
|
|
2968
3283
|
transform: y,
|
|
2969
|
-
sheetTransform:
|
|
3284
|
+
sheetTransform: _
|
|
2970
3285
|
};
|
|
2971
3286
|
});
|
|
2972
|
-
if (
|
|
2973
|
-
const
|
|
2974
|
-
f.push({ id: P.id, params: { unitId: r, subUnitId: s, op:
|
|
3287
|
+
if (S.length) {
|
|
3288
|
+
const v = this._sheetDrawingService.getBatchUpdateOp(S), { undo: C, redo: _, objects: y } = v;
|
|
3289
|
+
f.push({ id: P.id, params: { unitId: r, subUnitId: s, op: _, objects: y, type: U.UPDATE } }), m.push({ id: P.id, params: { unitId: r, subUnitId: s, op: C, objects: y, type: U.UPDATE } });
|
|
2975
3290
|
}
|
|
2976
|
-
return { redos: f, undos:
|
|
3291
|
+
return { redos: f, undos: m };
|
|
2977
3292
|
}
|
|
2978
3293
|
_moveRowInterceptor(i, t) {
|
|
2979
3294
|
const e = this._getUnitIdAndSubUnitId(i, t);
|
|
@@ -2981,37 +3296,37 @@ let rn = class extends re {
|
|
|
2981
3296
|
return { redos: [], undos: [] };
|
|
2982
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 = [];
|
|
2983
3298
|
if (Object.keys(c).forEach((h) => {
|
|
2984
|
-
const f = c[h], { sheetTransform:
|
|
2985
|
-
if (
|
|
3299
|
+
const f = c[h], { sheetTransform: m, transform: p, anchorType: w = O.Position } = f;
|
|
3300
|
+
if (m == null || p == null)
|
|
2986
3301
|
return;
|
|
2987
|
-
let
|
|
3302
|
+
let S, I;
|
|
2988
3303
|
if (t === "insert") {
|
|
2989
|
-
const
|
|
2990
|
-
|
|
3304
|
+
const v = this._expandRow(m, p, o, a, w);
|
|
3305
|
+
S = v == null ? void 0 : v.newSheetTransform, I = v == null ? void 0 : v.newTransform;
|
|
2991
3306
|
} else {
|
|
2992
|
-
const { from:
|
|
2993
|
-
if (
|
|
3307
|
+
const { from: v, to: C } = m, { row: _ } = v, { row: y } = C;
|
|
3308
|
+
if (w === O.Both && _ >= o && y <= a)
|
|
2994
3309
|
g.push({ unitId: n, subUnitId: r, drawingId: h });
|
|
2995
3310
|
else {
|
|
2996
|
-
const
|
|
2997
|
-
|
|
3311
|
+
const R = this._shrinkRow(m, p, o, a, w);
|
|
3312
|
+
S = R == null ? void 0 : R.newSheetTransform, I = R == null ? void 0 : R.newTransform;
|
|
2998
3313
|
}
|
|
2999
3314
|
}
|
|
3000
|
-
if (!
|
|
3315
|
+
if (!S || !I)
|
|
3001
3316
|
return;
|
|
3002
|
-
const
|
|
3003
|
-
l.push(
|
|
3317
|
+
const D = { unitId: n, subUnitId: r, drawingId: h, transform: I, sheetTransform: S };
|
|
3318
|
+
l.push(D);
|
|
3004
3319
|
}), l.length === 0 && g.length === 0)
|
|
3005
3320
|
return { redos: [], undos: [] };
|
|
3006
3321
|
if (l.length > 0) {
|
|
3007
|
-
const h = this._sheetDrawingService.getBatchUpdateOp(l), { undo: f, redo:
|
|
3008
|
-
d.push({ id: P.id, params: { unitId: n, subUnitId: r, op:
|
|
3322
|
+
const h = this._sheetDrawingService.getBatchUpdateOp(l), { undo: f, redo: m, objects: p } = h;
|
|
3323
|
+
d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: m, objects: p, type: U.UPDATE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: p, type: U.UPDATE } });
|
|
3009
3324
|
}
|
|
3010
3325
|
if (g.length > 0) {
|
|
3011
|
-
const h = this._sheetDrawingService.getBatchRemoveOp(g), f = h.undo,
|
|
3012
|
-
d.push({ id: P.id, params: { unitId: n, subUnitId: r, op:
|
|
3326
|
+
const h = this._sheetDrawingService.getBatchRemoveOp(g), f = h.undo, m = h.redo, p = h.objects;
|
|
3327
|
+
d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: m, objects: p, type: U.REMOVE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: p, type: U.INSERT } });
|
|
3013
3328
|
}
|
|
3014
|
-
return d.push({ id:
|
|
3329
|
+
return d.push({ id: V.id, params: [n] }), u.push({ id: V.id, params: [n] }), {
|
|
3015
3330
|
redos: d,
|
|
3016
3331
|
undos: u
|
|
3017
3332
|
};
|
|
@@ -3022,43 +3337,43 @@ let rn = class extends re {
|
|
|
3022
3337
|
return { redos: [], undos: [] };
|
|
3023
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 = [];
|
|
3024
3339
|
if (Object.keys(c).forEach((h) => {
|
|
3025
|
-
const f = c[h], { sheetTransform:
|
|
3026
|
-
if (
|
|
3340
|
+
const f = c[h], { sheetTransform: m, transform: p, anchorType: w = O.Position } = f;
|
|
3341
|
+
if (m == null || p == null)
|
|
3027
3342
|
return;
|
|
3028
|
-
let
|
|
3343
|
+
let S, I;
|
|
3029
3344
|
if (t === "insert") {
|
|
3030
|
-
const
|
|
3031
|
-
|
|
3345
|
+
const v = this._expandCol(m, p, o, a, w);
|
|
3346
|
+
S = v == null ? void 0 : v.newSheetTransform, I = v == null ? void 0 : v.newTransform;
|
|
3032
3347
|
} else {
|
|
3033
|
-
const { from:
|
|
3034
|
-
if (
|
|
3348
|
+
const { from: v, to: C } = m, { column: _ } = v, { column: y } = C;
|
|
3349
|
+
if (w === O.Both && _ >= o && y <= a)
|
|
3035
3350
|
g.push({ unitId: n, subUnitId: r, drawingId: h });
|
|
3036
3351
|
else {
|
|
3037
|
-
const
|
|
3038
|
-
|
|
3352
|
+
const R = this._shrinkCol(m, p, o, a, w);
|
|
3353
|
+
S = R == null ? void 0 : R.newSheetTransform, I = R == null ? void 0 : R.newTransform;
|
|
3039
3354
|
}
|
|
3040
3355
|
}
|
|
3041
|
-
if (!
|
|
3356
|
+
if (!S || !I)
|
|
3042
3357
|
return;
|
|
3043
|
-
const
|
|
3044
|
-
l.push(
|
|
3358
|
+
const D = { unitId: n, subUnitId: r, drawingId: h, transform: I, sheetTransform: S };
|
|
3359
|
+
l.push(D);
|
|
3045
3360
|
}), l.length === 0 && g.length === 0)
|
|
3046
3361
|
return { redos: [], undos: [] };
|
|
3047
3362
|
if (l.length > 0) {
|
|
3048
|
-
const h = this._sheetDrawingService.getBatchUpdateOp(l), { undo: f, redo:
|
|
3049
|
-
d.push({ id: P.id, params: { unitId: n, subUnitId: r, op:
|
|
3363
|
+
const h = this._sheetDrawingService.getBatchUpdateOp(l), { undo: f, redo: m, objects: p } = h;
|
|
3364
|
+
d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: m, objects: p, type: U.UPDATE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: p, type: U.UPDATE } });
|
|
3050
3365
|
}
|
|
3051
3366
|
if (g.length > 0) {
|
|
3052
|
-
const h = this._sheetDrawingService.getBatchRemoveOp(g), f = h.undo,
|
|
3053
|
-
d.push({ id: P.id, params: { unitId: n, subUnitId: r, op:
|
|
3367
|
+
const h = this._sheetDrawingService.getBatchRemoveOp(g), f = h.undo, m = h.redo, p = h.objects;
|
|
3368
|
+
d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: m, objects: p, type: U.REMOVE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: p, type: U.INSERT } });
|
|
3054
3369
|
}
|
|
3055
|
-
return d.push({ id:
|
|
3370
|
+
return d.push({ id: V.id, params: [n] }), u.push({ id: V.id, params: [n] }), { redos: d, undos: u };
|
|
3056
3371
|
}
|
|
3057
3372
|
_expandCol(i, t, e, n, r = O.Position) {
|
|
3058
3373
|
const s = n - e + 1, { from: o, to: a } = i, { column: d } = o, { column: u } = a;
|
|
3059
3374
|
if (r === O.None)
|
|
3060
3375
|
return {
|
|
3061
|
-
newSheetTransform:
|
|
3376
|
+
newSheetTransform: j({ ...t }, this._selectionRenderService),
|
|
3062
3377
|
newTransform: t
|
|
3063
3378
|
};
|
|
3064
3379
|
let c = null, l = null;
|
|
@@ -3066,16 +3381,16 @@ let rn = class extends re {
|
|
|
3066
3381
|
const g = this._skeletonManagerService.attachRangeWithCoord({ startColumn: e, endColumn: n, startRow: o.row, endRow: a.row });
|
|
3067
3382
|
if (g == null)
|
|
3068
3383
|
return;
|
|
3069
|
-
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);
|
|
3070
3385
|
} else if (u >= n)
|
|
3071
3386
|
if (r === O.Both)
|
|
3072
3387
|
c = {
|
|
3073
3388
|
from: { ...o },
|
|
3074
3389
|
to: { ...a, column: u + s }
|
|
3075
|
-
}, l =
|
|
3390
|
+
}, l = Z(c, this._selectionRenderService, this._skeletonManagerService);
|
|
3076
3391
|
else
|
|
3077
3392
|
return {
|
|
3078
|
-
newSheetTransform:
|
|
3393
|
+
newSheetTransform: j({ ...t }, this._selectionRenderService),
|
|
3079
3394
|
newTransform: t
|
|
3080
3395
|
};
|
|
3081
3396
|
return c != null && l != null ? {
|
|
@@ -3087,7 +3402,7 @@ let rn = class extends re {
|
|
|
3087
3402
|
const s = n - e + 1, { from: o, to: a } = i, { column: d } = o, { column: u } = a;
|
|
3088
3403
|
if (r === O.None)
|
|
3089
3404
|
return {
|
|
3090
|
-
newSheetTransform:
|
|
3405
|
+
newSheetTransform: j({ ...t }, this._selectionRenderService),
|
|
3091
3406
|
newTransform: t
|
|
3092
3407
|
};
|
|
3093
3408
|
let c = null, l = null;
|
|
@@ -3095,7 +3410,7 @@ let rn = class extends re {
|
|
|
3095
3410
|
c = {
|
|
3096
3411
|
from: { ...o, column: d - s },
|
|
3097
3412
|
to: { ...a, column: u - s }
|
|
3098
|
-
}, l =
|
|
3413
|
+
}, l = Z(c, this._selectionRenderService, this._skeletonManagerService);
|
|
3099
3414
|
else {
|
|
3100
3415
|
if (d >= e && u <= n)
|
|
3101
3416
|
return null;
|
|
@@ -3104,10 +3419,10 @@ let rn = class extends re {
|
|
|
3104
3419
|
c = {
|
|
3105
3420
|
from: { ...o },
|
|
3106
3421
|
to: { ...a, column: u - s }
|
|
3107
|
-
}, l =
|
|
3422
|
+
}, l = Z(c, this._selectionRenderService, this._skeletonManagerService);
|
|
3108
3423
|
else
|
|
3109
3424
|
return {
|
|
3110
|
-
newSheetTransform:
|
|
3425
|
+
newSheetTransform: j({ ...t }, this._selectionRenderService),
|
|
3111
3426
|
newTransform: t
|
|
3112
3427
|
};
|
|
3113
3428
|
else if (d >= e && d <= n) {
|
|
@@ -3119,7 +3434,7 @@ let rn = class extends re {
|
|
|
3119
3434
|
return;
|
|
3120
3435
|
l = { ...t, left: (t.left || 0) - g.endX + g.startX - i.from.columnOffset };
|
|
3121
3436
|
}
|
|
3122
|
-
c =
|
|
3437
|
+
c = j(l, this._selectionRenderService);
|
|
3123
3438
|
} else if (u >= e && u <= n && r === O.Both) {
|
|
3124
3439
|
const g = this._skeletonManagerService.attachRangeWithCoord({
|
|
3125
3440
|
startColumn: e - 1,
|
|
@@ -3132,7 +3447,7 @@ let rn = class extends re {
|
|
|
3132
3447
|
c = {
|
|
3133
3448
|
from: { ...o },
|
|
3134
3449
|
to: { ...a, column: e - 1, columnOffset: g.endX - g.startX }
|
|
3135
|
-
}, l =
|
|
3450
|
+
}, l = Z(c, this._selectionRenderService, this._skeletonManagerService);
|
|
3136
3451
|
}
|
|
3137
3452
|
}
|
|
3138
3453
|
return c != null && l != null ? {
|
|
@@ -3144,7 +3459,7 @@ let rn = class extends re {
|
|
|
3144
3459
|
const s = n - e + 1, { from: o, to: a } = i, { row: d } = o, { row: u } = a;
|
|
3145
3460
|
if (r === O.None)
|
|
3146
3461
|
return {
|
|
3147
|
-
newSheetTransform:
|
|
3462
|
+
newSheetTransform: j({ ...t }, this._selectionRenderService),
|
|
3148
3463
|
newTransform: t
|
|
3149
3464
|
};
|
|
3150
3465
|
let c = null, l = null;
|
|
@@ -3152,7 +3467,7 @@ let rn = class extends re {
|
|
|
3152
3467
|
const g = this._skeletonManagerService.attachRangeWithCoord({ startRow: e, endRow: n, startColumn: o.column, endColumn: a.column });
|
|
3153
3468
|
if (g == null)
|
|
3154
3469
|
return;
|
|
3155
|
-
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);
|
|
3156
3471
|
} else if (u >= n)
|
|
3157
3472
|
if (r === O.Both)
|
|
3158
3473
|
c = {
|
|
@@ -3161,10 +3476,10 @@ let rn = class extends re {
|
|
|
3161
3476
|
...a,
|
|
3162
3477
|
row: u + s
|
|
3163
3478
|
}
|
|
3164
|
-
}, l =
|
|
3479
|
+
}, l = Z(c, this._selectionRenderService, this._skeletonManagerService);
|
|
3165
3480
|
else
|
|
3166
3481
|
return {
|
|
3167
|
-
newSheetTransform:
|
|
3482
|
+
newSheetTransform: j({ ...t }, this._selectionRenderService),
|
|
3168
3483
|
newTransform: t
|
|
3169
3484
|
};
|
|
3170
3485
|
return c != null && l != null ? {
|
|
@@ -3176,7 +3491,7 @@ let rn = class extends re {
|
|
|
3176
3491
|
const s = n - e + 1, { from: o, to: a } = i, { row: d } = o, { row: u } = a;
|
|
3177
3492
|
if (r === O.None)
|
|
3178
3493
|
return {
|
|
3179
|
-
newSheetTransform:
|
|
3494
|
+
newSheetTransform: j({ ...t }, this._selectionRenderService),
|
|
3180
3495
|
newTransform: t
|
|
3181
3496
|
};
|
|
3182
3497
|
let c = null, l = null;
|
|
@@ -3184,7 +3499,7 @@ let rn = class extends re {
|
|
|
3184
3499
|
c = {
|
|
3185
3500
|
from: { ...o, row: d - s },
|
|
3186
3501
|
to: { ...a, row: u - s }
|
|
3187
|
-
}, l =
|
|
3502
|
+
}, l = Z(c, this._selectionRenderService, this._skeletonManagerService);
|
|
3188
3503
|
else {
|
|
3189
3504
|
if (d >= e && u <= n)
|
|
3190
3505
|
return null;
|
|
@@ -3193,10 +3508,10 @@ let rn = class extends re {
|
|
|
3193
3508
|
c = {
|
|
3194
3509
|
from: { ...o },
|
|
3195
3510
|
to: { ...a, row: u - s }
|
|
3196
|
-
}, l =
|
|
3511
|
+
}, l = Z(c, this._selectionRenderService, this._skeletonManagerService);
|
|
3197
3512
|
else
|
|
3198
3513
|
return {
|
|
3199
|
-
newSheetTransform:
|
|
3514
|
+
newSheetTransform: j({ ...t }, this._selectionRenderService),
|
|
3200
3515
|
newTransform: t
|
|
3201
3516
|
};
|
|
3202
3517
|
else if (d >= e && d <= n) {
|
|
@@ -3208,7 +3523,7 @@ let rn = class extends re {
|
|
|
3208
3523
|
return;
|
|
3209
3524
|
l = { ...t, top: (t.top || 0) - g.endY + g.startY - i.from.rowOffset };
|
|
3210
3525
|
}
|
|
3211
|
-
c =
|
|
3526
|
+
c = j(l, this._selectionRenderService);
|
|
3212
3527
|
} else if (u >= e && u <= n && r === O.Both) {
|
|
3213
3528
|
const g = this._skeletonManagerService.attachRangeWithCoord({ startColumn: o.column, endColumn: o.column, startRow: e - 1, endRow: e - 1 });
|
|
3214
3529
|
if (g == null)
|
|
@@ -3216,7 +3531,7 @@ let rn = class extends re {
|
|
|
3216
3531
|
c = {
|
|
3217
3532
|
from: { ...o },
|
|
3218
3533
|
to: { ...a, row: e - 1, rowOffset: g.endY - g.startY }
|
|
3219
|
-
}, l =
|
|
3534
|
+
}, l = Z(c, this._selectionRenderService, this._skeletonManagerService);
|
|
3220
3535
|
}
|
|
3221
3536
|
}
|
|
3222
3537
|
return c != null && l != null ? {
|
|
@@ -3230,7 +3545,7 @@ let rn = class extends re {
|
|
|
3230
3545
|
// but the skeleton changes like other render modules. These two signals are not equivalent.
|
|
3231
3546
|
// As a temp solution, I subscribed to activate$ here.
|
|
3232
3547
|
this._commandService.onCommandExecuted((i) => {
|
|
3233
|
-
if (i.id ===
|
|
3548
|
+
if (i.id === Ki.id) {
|
|
3234
3549
|
const { unitId: t, subUnitId: e } = i.params;
|
|
3235
3550
|
this._updateDrawings(t, e);
|
|
3236
3551
|
}
|
|
@@ -3270,7 +3585,7 @@ let rn = class extends re {
|
|
|
3270
3585
|
d != null && Object.keys(d).forEach((u) => {
|
|
3271
3586
|
if (s === i && a === t) {
|
|
3272
3587
|
const c = d[u];
|
|
3273
|
-
c.transform =
|
|
3588
|
+
c.transform = Z(c.sheetTransform, this._selectionRenderService, this._skeletonManagerService), n.push(d[u]);
|
|
3274
3589
|
} else
|
|
3275
3590
|
r.push(d[u]);
|
|
3276
3591
|
});
|
|
@@ -3281,7 +3596,7 @@ let rn = class extends re {
|
|
|
3281
3596
|
_sheetRefreshListener() {
|
|
3282
3597
|
this.disposeWithMe(
|
|
3283
3598
|
this._commandService.onCommandExecuted((i) => {
|
|
3284
|
-
|
|
3599
|
+
mo.includes(i.id) && requestIdleCallback(() => {
|
|
3285
3600
|
const t = i.params, { unitId: e, subUnitId: n, ranges: r } = t;
|
|
3286
3601
|
this._refreshDrawingTransform(e, n, r);
|
|
3287
3602
|
});
|
|
@@ -3294,279 +3609,504 @@ let rn = class extends re {
|
|
|
3294
3609
|
const o = n[s], { sheetTransform: a, transform: d, anchorType: u = O.Position } = o;
|
|
3295
3610
|
if (u === O.None)
|
|
3296
3611
|
return !0;
|
|
3297
|
-
const { from: c, to: l } = a, { row: g, column: h } = c, { row: f, column:
|
|
3298
|
-
for (let
|
|
3299
|
-
const
|
|
3300
|
-
if (
|
|
3612
|
+
const { from: c, to: l } = a, { row: g, column: h } = c, { row: f, column: m } = 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 (yi.intersects(
|
|
3301
3616
|
{
|
|
3302
|
-
startRow:
|
|
3617
|
+
startRow: S,
|
|
3303
3618
|
endRow: I,
|
|
3304
|
-
startColumn:
|
|
3305
|
-
endColumn:
|
|
3619
|
+
startColumn: D,
|
|
3620
|
+
endColumn: v
|
|
3306
3621
|
},
|
|
3307
3622
|
{
|
|
3308
3623
|
startRow: g,
|
|
3309
3624
|
endRow: f,
|
|
3310
3625
|
startColumn: h,
|
|
3311
|
-
endColumn:
|
|
3626
|
+
endColumn: m
|
|
3312
3627
|
}
|
|
3313
|
-
) || g > I || h >
|
|
3314
|
-
const C = u === O.Position,
|
|
3628
|
+
) || g > I || h > v) {
|
|
3629
|
+
const C = u === O.Position, _ = Z(a, this._selectionRenderService, this._skeletonManagerService);
|
|
3315
3630
|
r.push({
|
|
3316
3631
|
...o,
|
|
3317
3632
|
transform: {
|
|
3318
|
-
...
|
|
3319
|
-
width: C ? d == null ? void 0 : d.width :
|
|
3320
|
-
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
|
|
3321
3636
|
}
|
|
3322
3637
|
});
|
|
3323
3638
|
break;
|
|
3324
3639
|
}
|
|
3325
3640
|
}
|
|
3326
|
-
}), r.length !== 0 && (this._drawingManagerService.refreshTransform(r), this._commandService.syncExecuteCommand(
|
|
3641
|
+
}), r.length !== 0 && (this._drawingManagerService.refreshTransform(r), this._commandService.syncExecuteCommand(V.id, [i]));
|
|
3327
3642
|
}
|
|
3328
3643
|
};
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
],
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3644
|
+
Rn = go([
|
|
3645
|
+
_e(1, Q),
|
|
3646
|
+
_e(2, Y),
|
|
3647
|
+
_e(3, Ze),
|
|
3648
|
+
_e(4, A(X)),
|
|
3649
|
+
_e(5, A(Vt)),
|
|
3650
|
+
_e(6, se),
|
|
3651
|
+
_e(7, oe),
|
|
3652
|
+
_e(8, de)
|
|
3653
|
+
], Rn);
|
|
3654
|
+
function Yr({ ref: i, ...t }) {
|
|
3655
|
+
const { icon: e, id: n, className: r, extend: s, ...o } = t, a = `univerjs-icon univerjs-icon-${n} ${r || ""}`.trim(), d = Es(`_${_o()}`);
|
|
3656
|
+
return Gr(e, `${n}`, {
|
|
3657
|
+
defIds: e.defIds,
|
|
3658
|
+
idSuffix: d.current
|
|
3659
|
+
}, {
|
|
3660
|
+
ref: i,
|
|
3661
|
+
className: a,
|
|
3662
|
+
...o
|
|
3663
|
+
}, s);
|
|
3664
|
+
}
|
|
3665
|
+
function Gr(i, t, e, n, r) {
|
|
3666
|
+
return Ar(i.tag, {
|
|
3667
|
+
key: t,
|
|
3668
|
+
...po(i, e, r),
|
|
3669
|
+
...n
|
|
3670
|
+
}, (wo(i, e).children || []).map((s, o) => Gr(s, `${t}-${i.tag}-${o}`, e, void 0, r)));
|
|
3671
|
+
}
|
|
3672
|
+
function po(i, t, e) {
|
|
3673
|
+
const n = { ...i.attrs };
|
|
3674
|
+
e != null && e.colorChannel1 && n.fill === "colorChannel1" && (n.fill = e.colorChannel1), i.tag === "mask" && n.id && (n.id = n.id + t.idSuffix), Object.entries(n).forEach(([s, o]) => {
|
|
3675
|
+
s === "mask" && typeof o == "string" && (n[s] = o.replace(/url\(#(.*)\)/, `url(#$1${t.idSuffix})`));
|
|
3676
|
+
});
|
|
3677
|
+
const { defIds: r } = t;
|
|
3678
|
+
return !r || r.length === 0 || (i.tag === "use" && n["xlink:href"] && (n["xlink:href"] = n["xlink:href"] + t.idSuffix), Object.entries(n).forEach(([s, o]) => {
|
|
3679
|
+
typeof o == "string" && (n[s] = o.replace(/url\(#(.*)\)/, `url(#$1${t.idSuffix})`));
|
|
3680
|
+
})), n;
|
|
3681
|
+
}
|
|
3682
|
+
function wo(i, t) {
|
|
3683
|
+
var n;
|
|
3684
|
+
const { defIds: e } = t;
|
|
3685
|
+
return !e || e.length === 0 ? i : i.tag === "defs" && ((n = i.children) != null && n.length) ? {
|
|
3686
|
+
...i,
|
|
3687
|
+
children: i.children.map((r) => typeof r.attrs.id == "string" && e && e.includes(r.attrs.id) ? {
|
|
3688
|
+
...r,
|
|
3689
|
+
attrs: {
|
|
3690
|
+
...r.attrs,
|
|
3691
|
+
id: r.attrs.id + t.idSuffix
|
|
3692
|
+
}
|
|
3693
|
+
} : r)
|
|
3694
|
+
} : i;
|
|
3695
|
+
}
|
|
3696
|
+
function _o() {
|
|
3697
|
+
return Math.random().toString(36).substring(2, 8);
|
|
3698
|
+
}
|
|
3699
|
+
Yr.displayName = "UniverIcon";
|
|
3700
|
+
const So = {
|
|
3701
|
+
tag: "svg",
|
|
3702
|
+
attrs: {
|
|
3703
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3704
|
+
fill: "none",
|
|
3705
|
+
viewBox: "0 0 17 16",
|
|
3706
|
+
width: "1em",
|
|
3707
|
+
height: "1em"
|
|
3708
|
+
},
|
|
3709
|
+
children: [{
|
|
3710
|
+
tag: "path",
|
|
3711
|
+
attrs: {
|
|
3712
|
+
fill: "currentColor",
|
|
3713
|
+
d: "M2.35381 3.65517C2.35381 2.88198 2.98061 2.25518 3.75381 2.25518H8.10381C8.43518 2.25518 8.70381 1.98655 8.70381 1.65518C8.70381 1.3238 8.43518 1.05518 8.10381 1.05518H3.75381C2.31787 1.05518 1.15381 2.21923 1.15381 3.65517V12.3552C1.15381 13.7911 2.31787 14.9552 3.75381 14.9552H12.4538C13.8897 14.9552 15.0538 13.7911 15.0538 12.3552V8.00518C15.0538 7.6738 14.7852 7.40518 14.4538 7.40518C14.1224 7.40518 13.8538 7.6738 13.8538 8.00518V9.24469L12.3428 8.11143C11.8294 7.72642 11.1111 7.77744 10.6573 8.23119L9.11281 9.77567L6.84342 7.83047C6.34812 7.40592 5.61375 7.41815 5.13289 7.85896L2.35381 10.4064V3.65517ZM2.35381 12.0343V12.3552C2.35381 13.1284 2.98061 13.7552 3.75381 13.7552H12.4538C13.227 13.7552 13.8538 13.1284 13.8538 12.3552V10.7447L11.6228 9.07144C11.5871 9.04469 11.5373 9.04827 11.5058 9.07971L10.0266 10.5589L11.2057 11.5696C11.4573 11.7853 11.4865 12.164 11.2708 12.4156C11.0552 12.6672 10.6764 12.6964 10.4248 12.4807L6.06245 8.74157C6.02809 8.71212 5.97713 8.71296 5.94377 8.74353L2.35381 12.0343Z",
|
|
3714
|
+
fillRule: "evenodd",
|
|
3715
|
+
clipRule: "evenodd"
|
|
3716
|
+
}
|
|
3717
|
+
}, {
|
|
3718
|
+
tag: "path",
|
|
3719
|
+
attrs: {
|
|
3720
|
+
fill: "currentColor",
|
|
3721
|
+
d: "M10.3911 3.84419C10.6254 3.60988 11.0053 3.60988 11.2396 3.84419L11.8818 4.48643V1.93496C11.8818 1.60359 12.1505 1.33496 12.4818 1.33496C12.8132 1.33496 13.0818 1.60359 13.0818 1.93496V4.48676L13.7244 3.84419C13.9587 3.60988 14.3386 3.60988 14.5729 3.84419C14.8072 4.07851 14.8072 4.45841 14.5729 4.69272L12.9063 6.35939C12.6719 6.5937 12.292 6.5937 12.0577 6.35939L10.3911 4.69272C10.1568 4.45841 10.1568 4.07851 10.3911 3.84419Z"
|
|
3722
|
+
}
|
|
3723
|
+
}]
|
|
3724
|
+
}, Xr = Ts(function(t, e) {
|
|
3725
|
+
return Ar(Yr, Object.assign({}, t, {
|
|
3726
|
+
id: "download-image-icon",
|
|
3727
|
+
ref: e,
|
|
3728
|
+
icon: So
|
|
3729
|
+
}));
|
|
3730
|
+
});
|
|
3731
|
+
Xr.displayName = "DownloadImageIcon";
|
|
3732
|
+
function vo() {
|
|
3733
|
+
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) => ({
|
|
3734
|
+
label: C.label,
|
|
3735
|
+
value: String(C.index)
|
|
3736
|
+
})), [c]), [f, m] = Ee(
|
|
3737
|
+
() => h.length > 0 ? h[0].value : "0"
|
|
3738
|
+
), p = Fe(() => {
|
|
3739
|
+
if (!n.includes(ye.COLUMN_VALUE) || !l)
|
|
3740
|
+
return [];
|
|
3741
|
+
const _ = Number(f);
|
|
3742
|
+
return [{
|
|
3743
|
+
startRow: l.startRow,
|
|
3744
|
+
endRow: l.endRow,
|
|
3745
|
+
startColumn: _,
|
|
3746
|
+
endColumn: _
|
|
3747
|
+
}];
|
|
3748
|
+
}, [n, f, l]);
|
|
3749
|
+
fi(p);
|
|
3750
|
+
const w = Et((C) => {
|
|
3751
|
+
C.length !== 0 && r(C);
|
|
3752
|
+
}, []), S = Et((C) => {
|
|
3753
|
+
m(String(C));
|
|
3754
|
+
}, []), I = Et(() => {
|
|
3755
|
+
t.close(ze);
|
|
3756
|
+
}, [t]), D = Et(async () => {
|
|
3757
|
+
if (u.length !== 0) {
|
|
3758
|
+
o(!0), d(null);
|
|
3759
|
+
try {
|
|
3760
|
+
await e.saveImages(u, {
|
|
3761
|
+
fileNameParts: n,
|
|
3762
|
+
columnIndex: n.includes(ye.COLUMN_VALUE) ? Number(f) : void 0
|
|
3763
|
+
}), t.close(ze);
|
|
3764
|
+
} catch (C) {
|
|
3765
|
+
console.error("Failed to save images:", C), d(i.t("sheetImage.save.error"));
|
|
3766
|
+
} finally {
|
|
3767
|
+
o(!1);
|
|
3768
|
+
}
|
|
3769
|
+
}
|
|
3770
|
+
}, [e, u, n, f, t, i]), v = n.includes(ye.COLUMN_VALUE);
|
|
3771
|
+
return /* @__PURE__ */ Xe("div", { className: "univer-flex univer-flex-col", children: [
|
|
3772
|
+
/* @__PURE__ */ L(en, { label: i.t("sheetImage.save.imageCount"), children: /* @__PURE__ */ L("div", { className: "univer-text-sm univer-text-gray-600", children: u.length }) }),
|
|
3773
|
+
/* @__PURE__ */ L(en, { label: i.t("sheetImage.save.fileNameConfig"), children: /* @__PURE__ */ Xe(Qi, { value: n, onChange: w, direction: "vertical", children: [
|
|
3774
|
+
/* @__PURE__ */ L(Yn, { value: ye.CELL_ADDRESS, disabled: !g, children: i.t("sheetImage.save.useRowCol") }),
|
|
3775
|
+
g && /* @__PURE__ */ L(Yn, { value: ye.COLUMN_VALUE, children: i.t("sheetImage.save.useColumnValue") })
|
|
3776
|
+
] }) }),
|
|
3777
|
+
v && /* @__PURE__ */ L(en, { label: i.t("sheetImage.save.selectColumn"), children: /* @__PURE__ */ L(
|
|
3778
|
+
es,
|
|
3779
|
+
{
|
|
3780
|
+
value: f,
|
|
3781
|
+
options: h,
|
|
3782
|
+
onChange: S
|
|
3783
|
+
}
|
|
3784
|
+
) }),
|
|
3785
|
+
a && /* @__PURE__ */ L("div", { className: "univer-text-xs univer-text-red-500", children: a }),
|
|
3786
|
+
/* @__PURE__ */ Xe(
|
|
3787
|
+
"div",
|
|
3788
|
+
{
|
|
3789
|
+
className: "univer-flex univer-justify-end univer-gap-2 univer-border-t univer-border-gray-200 univer-pt-3",
|
|
3790
|
+
children: [
|
|
3791
|
+
/* @__PURE__ */ L(Gn, { onClick: I, disabled: s, children: i.t("sheetImage.save.cancel") }),
|
|
3792
|
+
/* @__PURE__ */ L(
|
|
3793
|
+
Gn,
|
|
3794
|
+
{
|
|
3795
|
+
variant: "primary",
|
|
3796
|
+
onClick: D,
|
|
3797
|
+
disabled: s || u.length === 0,
|
|
3798
|
+
children: s ? i.t("sheetImage.save.saving") : i.t("sheetImage.save.confirm")
|
|
3799
|
+
}
|
|
3800
|
+
)
|
|
3801
|
+
]
|
|
3802
|
+
}
|
|
3803
|
+
)
|
|
3804
|
+
] });
|
|
3805
|
+
}
|
|
3806
|
+
const Io = (i) => {
|
|
3807
|
+
var S;
|
|
3808
|
+
const t = Ie(Y), e = Ie(Te), n = Ie(oe), r = Ie(Q), { drawings: s } = i, o = s[0];
|
|
3342
3809
|
if (o == null)
|
|
3343
3810
|
return;
|
|
3344
3811
|
const { unitId: a } = o, d = r.getRenderById(a), u = d == null ? void 0 : d.scene;
|
|
3345
3812
|
if (u == null)
|
|
3346
3813
|
return;
|
|
3347
|
-
const c = u.getTransformerByCreate(), [l, g] =
|
|
3348
|
-
function
|
|
3349
|
-
const
|
|
3814
|
+
const c = u.getTransformerByCreate(), [l, g] = Ee(!0), h = (S = o.anchorType) != null ? S : O.Position, [f, m] = Ee(h);
|
|
3815
|
+
function p(I, D) {
|
|
3816
|
+
const v = [];
|
|
3350
3817
|
return I.forEach((C) => {
|
|
3351
|
-
const { oKey:
|
|
3818
|
+
const { oKey: _ } = C, y = D.getDrawingOKey(_);
|
|
3352
3819
|
if (y == null)
|
|
3353
|
-
return
|
|
3354
|
-
const { unitId:
|
|
3355
|
-
|
|
3356
|
-
unitId:
|
|
3357
|
-
subUnitId:
|
|
3358
|
-
drawingId:
|
|
3820
|
+
return v.push(null), !0;
|
|
3821
|
+
const { unitId: R, subUnitId: E, drawingId: T, drawingType: M, anchorType: b, sheetTransform: N } = y;
|
|
3822
|
+
v.push({
|
|
3823
|
+
unitId: R,
|
|
3824
|
+
subUnitId: E,
|
|
3825
|
+
drawingId: T,
|
|
3359
3826
|
anchorType: b,
|
|
3360
3827
|
sheetTransform: N,
|
|
3361
3828
|
drawingType: M
|
|
3362
3829
|
});
|
|
3363
|
-
}),
|
|
3830
|
+
}), v;
|
|
3364
3831
|
}
|
|
3365
|
-
|
|
3366
|
-
const I = c.clearControl$.subscribe((
|
|
3367
|
-
|
|
3368
|
-
}),
|
|
3832
|
+
Nr(() => {
|
|
3833
|
+
const I = c.clearControl$.subscribe((v) => {
|
|
3834
|
+
v === !0 && g(!1);
|
|
3835
|
+
}), D = c.changeStart$.subscribe((v) => {
|
|
3369
3836
|
var y;
|
|
3370
|
-
const { objects: C } =
|
|
3371
|
-
if (
|
|
3837
|
+
const { objects: C } = v, _ = p(C, n);
|
|
3838
|
+
if (_.length === 0)
|
|
3372
3839
|
g(!1);
|
|
3373
|
-
else if (
|
|
3840
|
+
else if (_.length >= 1) {
|
|
3374
3841
|
g(!0);
|
|
3375
|
-
const
|
|
3376
|
-
|
|
3842
|
+
const R = ((y = _[0]) == null ? void 0 : y.anchorType) || O.Position;
|
|
3843
|
+
m(R);
|
|
3377
3844
|
}
|
|
3378
3845
|
});
|
|
3379
3846
|
return () => {
|
|
3380
|
-
|
|
3847
|
+
D.unsubscribe(), I.unsubscribe();
|
|
3381
3848
|
};
|
|
3382
3849
|
}, []);
|
|
3383
|
-
function
|
|
3384
|
-
|
|
3385
|
-
const
|
|
3386
|
-
if (
|
|
3850
|
+
function w(I) {
|
|
3851
|
+
m(I);
|
|
3852
|
+
const D = n.getFocusDrawings();
|
|
3853
|
+
if (D.length === 0)
|
|
3387
3854
|
return;
|
|
3388
|
-
const
|
|
3855
|
+
const v = D.map((C) => ({
|
|
3389
3856
|
unitId: C.unitId,
|
|
3390
3857
|
subUnitId: C.subUnitId,
|
|
3391
3858
|
drawingId: C.drawingId,
|
|
3392
3859
|
anchorType: I
|
|
3393
3860
|
}));
|
|
3394
|
-
t.executeCommand(
|
|
3395
|
-
unitId:
|
|
3396
|
-
drawings:
|
|
3861
|
+
t.executeCommand(zt.id, {
|
|
3862
|
+
unitId: D[0].unitId,
|
|
3863
|
+
drawings: v
|
|
3397
3864
|
});
|
|
3398
3865
|
}
|
|
3399
|
-
return /* @__PURE__ */
|
|
3866
|
+
return /* @__PURE__ */ Xe(
|
|
3400
3867
|
"div",
|
|
3401
3868
|
{
|
|
3402
|
-
className:
|
|
3869
|
+
className: ts("univer-grid univer-gap-2 univer-py-2 univer-text-gray-400", {
|
|
3403
3870
|
"univer-hidden": !l
|
|
3404
3871
|
}),
|
|
3405
3872
|
children: [
|
|
3406
|
-
/* @__PURE__ */
|
|
3873
|
+
/* @__PURE__ */ L(
|
|
3407
3874
|
"header",
|
|
3408
3875
|
{
|
|
3409
3876
|
className: "univer-text-gray-600 dark:!univer-text-gray-200",
|
|
3410
|
-
children: /* @__PURE__ */
|
|
3877
|
+
children: /* @__PURE__ */ L("div", { children: e.t("drawing-anchor.title") })
|
|
3411
3878
|
}
|
|
3412
3879
|
),
|
|
3413
|
-
/* @__PURE__ */
|
|
3414
|
-
/* @__PURE__ */
|
|
3415
|
-
/* @__PURE__ */
|
|
3416
|
-
/* @__PURE__ */
|
|
3880
|
+
/* @__PURE__ */ L("div", { children: /* @__PURE__ */ Xe(ns, { value: f, onChange: w, direction: "vertical", children: [
|
|
3881
|
+
/* @__PURE__ */ L(tn, { value: O.Both, children: e.t("drawing-anchor.both") }),
|
|
3882
|
+
/* @__PURE__ */ L(tn, { value: O.Position, children: e.t("drawing-anchor.position") }),
|
|
3883
|
+
/* @__PURE__ */ L(tn, { value: O.None, children: e.t("drawing-anchor.none") })
|
|
3417
3884
|
] }) })
|
|
3418
3885
|
]
|
|
3419
3886
|
}
|
|
3420
3887
|
);
|
|
3421
|
-
},
|
|
3422
|
-
const i =
|
|
3423
|
-
return
|
|
3888
|
+
}, Co = () => {
|
|
3889
|
+
const i = Ie(oe), t = i.getFocusDrawings(), [e, n] = Ee(t);
|
|
3890
|
+
return Nr(() => {
|
|
3424
3891
|
const r = i.focus$.subscribe((s) => {
|
|
3425
3892
|
n(s);
|
|
3426
3893
|
});
|
|
3427
3894
|
return () => {
|
|
3428
3895
|
r.unsubscribe();
|
|
3429
3896
|
};
|
|
3430
|
-
}, []), !!(e != null && e.length) && /* @__PURE__ */
|
|
3431
|
-
/* @__PURE__ */
|
|
3432
|
-
/* @__PURE__ */
|
|
3897
|
+
}, []), !!(e != null && e.length) && /* @__PURE__ */ Xe("div", { className: "univer-text-sm", children: [
|
|
3898
|
+
/* @__PURE__ */ L(Rs, { drawings: e }),
|
|
3899
|
+
/* @__PURE__ */ L(Io, { drawings: e })
|
|
3433
3900
|
] });
|
|
3434
|
-
},
|
|
3435
|
-
function
|
|
3901
|
+
}, zr = "sheet.menu.image";
|
|
3902
|
+
function Ro(i) {
|
|
3436
3903
|
return {
|
|
3437
|
-
id:
|
|
3438
|
-
type:
|
|
3904
|
+
id: zr,
|
|
3905
|
+
type: Gt.SUBITEMS,
|
|
3439
3906
|
icon: "AddImageIcon",
|
|
3440
3907
|
tooltip: "sheetImage.title",
|
|
3441
|
-
hidden$:
|
|
3442
|
-
disabled$:
|
|
3908
|
+
hidden$: Yt(i, $.UNIVER_SHEET),
|
|
3909
|
+
disabled$: mi(i, { workbookTypes: [gn], worksheetTypes: [fn], rangeTypes: [Zi] })
|
|
3443
3910
|
};
|
|
3444
3911
|
}
|
|
3445
|
-
function
|
|
3912
|
+
function Do(i) {
|
|
3446
3913
|
return {
|
|
3447
|
-
id:
|
|
3914
|
+
id: Kt.id,
|
|
3448
3915
|
title: "sheetImage.upload.float",
|
|
3449
|
-
type:
|
|
3450
|
-
hidden$:
|
|
3916
|
+
type: Gt.BUTTON,
|
|
3917
|
+
hidden$: Yt(i, $.UNIVER_SHEET)
|
|
3451
3918
|
};
|
|
3452
3919
|
}
|
|
3453
|
-
function
|
|
3920
|
+
function bo(i) {
|
|
3454
3921
|
return {
|
|
3455
|
-
id:
|
|
3922
|
+
id: Mn.id,
|
|
3456
3923
|
title: "sheetImage.upload.cell",
|
|
3457
|
-
type:
|
|
3458
|
-
hidden$:
|
|
3924
|
+
type: Gt.BUTTON,
|
|
3925
|
+
hidden$: Yt(i, $.UNIVER_SHEET)
|
|
3459
3926
|
};
|
|
3460
3927
|
}
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3928
|
+
function Mo(i) {
|
|
3929
|
+
var t, e, n, r;
|
|
3930
|
+
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);
|
|
3931
|
+
}
|
|
3932
|
+
function yo(i, t) {
|
|
3933
|
+
const e = i.getActiveSheet();
|
|
3934
|
+
if (!e) return !1;
|
|
3935
|
+
const n = e.getCellMatrix(), { startRow: r, endRow: s, startColumn: o, endColumn: a } = t;
|
|
3936
|
+
for (let d = r; d <= s; d++)
|
|
3937
|
+
for (let u = o; u <= a; u++) {
|
|
3938
|
+
const c = n.getValue(d, u);
|
|
3939
|
+
if (Mo(c))
|
|
3940
|
+
return !0;
|
|
3941
|
+
}
|
|
3942
|
+
return !1;
|
|
3943
|
+
}
|
|
3944
|
+
function Eo() {
|
|
3945
|
+
return "showDirectoryPicker" in window;
|
|
3946
|
+
}
|
|
3947
|
+
function dn(i) {
|
|
3948
|
+
const t = i.get(de), e = i.get(ut), n = at([
|
|
3949
|
+
Yt(i, $.UNIVER_SHEET),
|
|
3950
|
+
t.getCurrentTypeOfUnit$($.UNIVER_SHEET).pipe(
|
|
3951
|
+
me((r) => r ? e.selectionMoveEnd$.pipe(
|
|
3952
|
+
pe(() => {
|
|
3953
|
+
if (!Eo())
|
|
3954
|
+
return !0;
|
|
3955
|
+
const s = e.getCurrentSelections();
|
|
3956
|
+
if (!s || s.length === 0)
|
|
3957
|
+
return !0;
|
|
3958
|
+
for (const o of s)
|
|
3959
|
+
if (yo(r, o.range))
|
|
3960
|
+
return !1;
|
|
3961
|
+
return !0;
|
|
3962
|
+
})
|
|
3963
|
+
) : wn(!0))
|
|
3964
|
+
)
|
|
3965
|
+
]).pipe(
|
|
3966
|
+
pe(([r, s]) => r || s)
|
|
3967
|
+
);
|
|
3968
|
+
return {
|
|
3969
|
+
id: ct.id,
|
|
3970
|
+
type: Gt.BUTTON,
|
|
3971
|
+
icon: "DownloadImageIcon",
|
|
3972
|
+
title: "sheetImage.save.menuLabel",
|
|
3973
|
+
hidden$: n
|
|
3974
|
+
};
|
|
3975
|
+
}
|
|
3976
|
+
const To = {
|
|
3977
|
+
[fs.MEDIA]: {
|
|
3978
|
+
[zr]: {
|
|
3464
3979
|
order: 0,
|
|
3465
|
-
menuItemFactory:
|
|
3466
|
-
[
|
|
3980
|
+
menuItemFactory: Ro,
|
|
3981
|
+
[Kt.id]: {
|
|
3467
3982
|
order: 0,
|
|
3468
|
-
menuItemFactory:
|
|
3983
|
+
menuItemFactory: Do
|
|
3469
3984
|
},
|
|
3470
|
-
[
|
|
3985
|
+
[Mn.id]: {
|
|
3471
3986
|
order: 1,
|
|
3472
|
-
menuItemFactory:
|
|
3987
|
+
menuItemFactory: bo
|
|
3988
|
+
}
|
|
3989
|
+
}
|
|
3990
|
+
},
|
|
3991
|
+
[rn.MAIN_AREA]: {
|
|
3992
|
+
[sn.OTHERS]: {
|
|
3993
|
+
[ct.id]: {
|
|
3994
|
+
order: 10,
|
|
3995
|
+
menuItemFactory: dn
|
|
3996
|
+
}
|
|
3997
|
+
}
|
|
3998
|
+
},
|
|
3999
|
+
[rn.COL_HEADER]: {
|
|
4000
|
+
[sn.OTHERS]: {
|
|
4001
|
+
[ct.id]: {
|
|
4002
|
+
order: 10,
|
|
4003
|
+
menuItemFactory: dn
|
|
4004
|
+
}
|
|
4005
|
+
}
|
|
4006
|
+
},
|
|
4007
|
+
[rn.ROW_HEADER]: {
|
|
4008
|
+
[sn.OTHERS]: {
|
|
4009
|
+
[ct.id]: {
|
|
4010
|
+
order: 10,
|
|
4011
|
+
menuItemFactory: dn
|
|
3473
4012
|
}
|
|
3474
4013
|
}
|
|
3475
4014
|
}
|
|
3476
4015
|
};
|
|
3477
|
-
function
|
|
3478
|
-
return !i.getContextValue(
|
|
4016
|
+
function ft(i) {
|
|
4017
|
+
return !i.getContextValue(Ei) && !i.getContextValue(Ti) && !i.getContextValue(Oi) && i.getContextValue(Ge);
|
|
3479
4018
|
}
|
|
3480
|
-
const
|
|
3481
|
-
id:
|
|
4019
|
+
const Oo = {
|
|
4020
|
+
id: gt.id,
|
|
3482
4021
|
description: "shortcut.drawing-move-down",
|
|
3483
4022
|
group: "4_drawing-view",
|
|
3484
|
-
binding:
|
|
4023
|
+
binding: Ke.ARROW_DOWN,
|
|
3485
4024
|
priority: 100,
|
|
3486
|
-
preconditions:
|
|
4025
|
+
preconditions: ft,
|
|
3487
4026
|
staticParameters: {
|
|
3488
|
-
direction:
|
|
4027
|
+
direction: ve.DOWN
|
|
3489
4028
|
}
|
|
3490
|
-
},
|
|
3491
|
-
id:
|
|
4029
|
+
}, Uo = {
|
|
4030
|
+
id: gt.id,
|
|
3492
4031
|
description: "shortcut.drawing-move-up",
|
|
3493
4032
|
group: "4_drawing-view",
|
|
3494
|
-
binding:
|
|
4033
|
+
binding: Ke.ARROW_UP,
|
|
3495
4034
|
priority: 100,
|
|
3496
|
-
preconditions:
|
|
4035
|
+
preconditions: ft,
|
|
3497
4036
|
staticParameters: {
|
|
3498
|
-
direction:
|
|
4037
|
+
direction: ve.UP
|
|
3499
4038
|
}
|
|
3500
|
-
},
|
|
3501
|
-
id:
|
|
4039
|
+
}, Po = {
|
|
4040
|
+
id: gt.id,
|
|
3502
4041
|
description: "shortcut.drawing-move-left",
|
|
3503
4042
|
group: "4_drawing-view",
|
|
3504
|
-
binding:
|
|
4043
|
+
binding: Ke.ARROW_LEFT,
|
|
3505
4044
|
priority: 100,
|
|
3506
|
-
preconditions:
|
|
4045
|
+
preconditions: ft,
|
|
3507
4046
|
staticParameters: {
|
|
3508
|
-
direction:
|
|
4047
|
+
direction: ve.LEFT
|
|
3509
4048
|
}
|
|
3510
|
-
},
|
|
3511
|
-
id:
|
|
4049
|
+
}, Ao = {
|
|
4050
|
+
id: gt.id,
|
|
3512
4051
|
description: "shortcut.drawing-move-right",
|
|
3513
4052
|
group: "4_drawing-view",
|
|
3514
|
-
binding:
|
|
4053
|
+
binding: Ke.ARROW_RIGHT,
|
|
3515
4054
|
priority: 100,
|
|
3516
|
-
preconditions:
|
|
4055
|
+
preconditions: ft,
|
|
3517
4056
|
staticParameters: {
|
|
3518
|
-
direction:
|
|
4057
|
+
direction: ve.RIGHT
|
|
3519
4058
|
}
|
|
3520
|
-
},
|
|
3521
|
-
id:
|
|
4059
|
+
}, No = {
|
|
4060
|
+
id: $r.id,
|
|
3522
4061
|
description: "shortcut.drawing-delete",
|
|
3523
4062
|
group: "4_drawing-view",
|
|
3524
4063
|
// when focusing on any other input tag do not trigger this shortcut
|
|
3525
|
-
preconditions:
|
|
3526
|
-
binding:
|
|
3527
|
-
mac:
|
|
4064
|
+
preconditions: ft,
|
|
4065
|
+
binding: Ke.DELETE,
|
|
4066
|
+
mac: Ke.BACKSPACE
|
|
3528
4067
|
};
|
|
3529
|
-
var
|
|
3530
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
4068
|
+
var $o = Object.getOwnPropertyDescriptor, ko = (i, t, e, n) => {
|
|
4069
|
+
for (var r = n > 1 ? void 0 : n ? $o(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
3531
4070
|
(o = i[s]) && (r = o(r) || r);
|
|
3532
4071
|
return r;
|
|
3533
|
-
},
|
|
3534
|
-
let
|
|
4072
|
+
}, Be = (i, t) => (e, n) => t(e, n, i);
|
|
4073
|
+
let Ft = class extends ee {
|
|
3535
4074
|
constructor(i, t, e, n, r, s) {
|
|
3536
4075
|
super(), this._componentManager = i, this._menuManagerService = t, this._commandService = e, this._shortcutService = n, this._drawingManagerService = r, this._sheetsSelectionsService = s, this._init();
|
|
3537
4076
|
}
|
|
3538
4077
|
_initCustomComponents() {
|
|
3539
4078
|
const i = this._componentManager;
|
|
3540
|
-
this.disposeWithMe(i.register(
|
|
4079
|
+
this.disposeWithMe(i.register(Br, Co)), this.disposeWithMe(i.register(ze, vo)), this.disposeWithMe(i.register("DownloadImageIcon", Xr));
|
|
3541
4080
|
}
|
|
3542
4081
|
_initMenus() {
|
|
3543
|
-
this._menuManagerService.mergeMenu(
|
|
4082
|
+
this._menuManagerService.mergeMenu(To);
|
|
3544
4083
|
}
|
|
3545
4084
|
_initCommands() {
|
|
3546
4085
|
[
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
4086
|
+
Kt,
|
|
4087
|
+
Mn,
|
|
4088
|
+
Xt,
|
|
4089
|
+
ht,
|
|
4090
|
+
zt,
|
|
4091
|
+
jr,
|
|
4092
|
+
V,
|
|
4093
|
+
Fr,
|
|
4094
|
+
kr,
|
|
4095
|
+
Wr,
|
|
4096
|
+
gt,
|
|
4097
|
+
$r,
|
|
4098
|
+
xr,
|
|
4099
|
+
ct
|
|
3560
4100
|
].forEach((i) => this.disposeWithMe(this._commandService.registerCommand(i)));
|
|
3561
4101
|
}
|
|
3562
4102
|
_initShortcuts() {
|
|
3563
4103
|
[
|
|
3564
4104
|
// sheet drawing shortcuts
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
4105
|
+
Oo,
|
|
4106
|
+
Uo,
|
|
4107
|
+
Po,
|
|
4108
|
+
Ao,
|
|
4109
|
+
No
|
|
3570
4110
|
].forEach((i) => {
|
|
3571
4111
|
this.disposeWithMe(this._shortcutService.registerShortcut(i));
|
|
3572
4112
|
});
|
|
@@ -3575,101 +4115,106 @@ let Ut = class extends re {
|
|
|
3575
4115
|
this._initCommands(), this._initCustomComponents(), this._initMenus(), this._initShortcuts();
|
|
3576
4116
|
}
|
|
3577
4117
|
};
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
],
|
|
3586
|
-
var
|
|
3587
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
4118
|
+
Ft = ko([
|
|
4119
|
+
Be(0, A(Ur)),
|
|
4120
|
+
Be(1, ms),
|
|
4121
|
+
Be(2, Y),
|
|
4122
|
+
Be(3, ps),
|
|
4123
|
+
Be(4, oe),
|
|
4124
|
+
Be(5, A(ut))
|
|
4125
|
+
], Ft);
|
|
4126
|
+
var xo = Object.defineProperty, Wo = Object.getOwnPropertyDescriptor, Bo = (i, t, e) => t in i ? xo(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, jo = (i, t, e, n) => {
|
|
4127
|
+
for (var r = n > 1 ? void 0 : n ? Wo(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
3588
4128
|
(o = i[s]) && (r = o(r) || r);
|
|
3589
4129
|
return r;
|
|
3590
|
-
},
|
|
3591
|
-
const
|
|
3592
|
-
let
|
|
3593
|
-
constructor(i =
|
|
4130
|
+
}, ln = (i, t) => (e, n) => t(e, n, i), Kr = (i, t, e) => Bo(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4131
|
+
const Fo = "SHEET_IMAGE_UI_PLUGIN";
|
|
4132
|
+
let Lt = class extends Ai {
|
|
4133
|
+
constructor(i = sr, t, e, n) {
|
|
3594
4134
|
super(), this._config = i, this._injector = t, this._renderManagerService = e, this._configService = n;
|
|
3595
|
-
const { menu: r, ...s } =
|
|
4135
|
+
const { menu: r, ...s } = Ni(
|
|
3596
4136
|
{},
|
|
3597
|
-
|
|
4137
|
+
sr,
|
|
3598
4138
|
this._config
|
|
3599
4139
|
);
|
|
3600
|
-
r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(
|
|
4140
|
+
r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(Ws, s);
|
|
3601
4141
|
}
|
|
3602
4142
|
onStarting() {
|
|
3603
|
-
|
|
3604
|
-
[
|
|
3605
|
-
[
|
|
3606
|
-
[
|
|
3607
|
-
[
|
|
3608
|
-
[
|
|
3609
|
-
[
|
|
3610
|
-
[
|
|
3611
|
-
[
|
|
3612
|
-
[
|
|
3613
|
-
|
|
3614
|
-
|
|
4143
|
+
$i(this._injector, [
|
|
4144
|
+
[lt],
|
|
4145
|
+
[Ft],
|
|
4146
|
+
[Nt],
|
|
4147
|
+
[jt],
|
|
4148
|
+
[Bt],
|
|
4149
|
+
[Wt],
|
|
4150
|
+
[$t],
|
|
4151
|
+
[kt],
|
|
4152
|
+
[xt],
|
|
4153
|
+
[yn, { useClass: vn }]
|
|
4154
|
+
]), Qt(this._injector, [
|
|
4155
|
+
[lt]
|
|
3615
4156
|
]);
|
|
3616
4157
|
}
|
|
3617
4158
|
onReady() {
|
|
3618
|
-
|
|
3619
|
-
[
|
|
3620
|
-
[
|
|
4159
|
+
Qt(this._injector, [
|
|
4160
|
+
[Wt],
|
|
4161
|
+
[xt]
|
|
3621
4162
|
]);
|
|
3622
4163
|
}
|
|
3623
4164
|
onRendered() {
|
|
3624
|
-
this._registerRenderModules(),
|
|
3625
|
-
[
|
|
3626
|
-
[
|
|
3627
|
-
[
|
|
3628
|
-
[
|
|
3629
|
-
[
|
|
4165
|
+
this._registerRenderModules(), Qt(this._injector, [
|
|
4166
|
+
[Bt],
|
|
4167
|
+
[jt],
|
|
4168
|
+
[Ft],
|
|
4169
|
+
[$t],
|
|
4170
|
+
[kt]
|
|
3630
4171
|
]);
|
|
3631
4172
|
}
|
|
3632
4173
|
onSteady() {
|
|
3633
|
-
this._injector.get(
|
|
4174
|
+
this._injector.get(Nt);
|
|
3634
4175
|
}
|
|
3635
4176
|
_registerRenderModules() {
|
|
3636
4177
|
[
|
|
3637
|
-
[
|
|
3638
|
-
[
|
|
3639
|
-
[
|
|
3640
|
-
[
|
|
4178
|
+
[dt],
|
|
4179
|
+
[Rn],
|
|
4180
|
+
[Cn],
|
|
4181
|
+
[In]
|
|
3641
4182
|
].forEach((i) => {
|
|
3642
|
-
this.disposeWithMe(this._renderManagerService.registerRenderModule(
|
|
4183
|
+
this.disposeWithMe(this._renderManagerService.registerRenderModule($.UNIVER_SHEET, i));
|
|
3643
4184
|
});
|
|
3644
4185
|
}
|
|
3645
4186
|
};
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
],
|
|
4187
|
+
Kr(Lt, "type", $.UNIVER_SHEET);
|
|
4188
|
+
Kr(Lt, "pluginName", Fo);
|
|
4189
|
+
Lt = jo([
|
|
4190
|
+
Ui(as, _s, Ds, ki),
|
|
4191
|
+
ln(1, A(qe)),
|
|
4192
|
+
ln(2, Q),
|
|
4193
|
+
ln(3, Pi)
|
|
4194
|
+
], Lt);
|
|
3654
4195
|
export {
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
4196
|
+
vn as BatchSaveImagesService,
|
|
4197
|
+
V as ClearSheetDrawingTransformerOperation,
|
|
4198
|
+
$r as DeleteDrawingsCommand,
|
|
4199
|
+
Fr as EditSheetDrawingOperation,
|
|
4200
|
+
ye as FileNamePart,
|
|
4201
|
+
kr as GroupSheetDrawingCommand,
|
|
4202
|
+
yn as IBatchSaveImagesService,
|
|
4203
|
+
Kt as InsertFloatImageCommand,
|
|
4204
|
+
Xt as InsertSheetDrawingCommand,
|
|
4205
|
+
gt as MoveDrawingsCommand,
|
|
4206
|
+
ht as RemoveSheetDrawingCommand,
|
|
4207
|
+
zr as SHEETS_IMAGE_MENU_ID,
|
|
4208
|
+
ao as SHEET_FLOAT_DOM_PREFIX,
|
|
4209
|
+
ct as SaveCellImagesCommand,
|
|
4210
|
+
xr as SetDrawingArrangeCommand,
|
|
4211
|
+
zt as SetSheetDrawingCommand,
|
|
4212
|
+
lt as SheetCanvasFloatDomManagerService,
|
|
4213
|
+
dt as SheetDrawingUpdateController,
|
|
4214
|
+
jr as SidebarSheetDrawingOperation,
|
|
4215
|
+
Wr as UngroupSheetDrawingCommand,
|
|
4216
|
+
Lt as UniverSheetsDrawingUIPlugin,
|
|
4217
|
+
fe as calcSheetFloatDomPosition,
|
|
4218
|
+
Z as drawingPositionToTransform,
|
|
4219
|
+
j as transformToDrawingPosition
|
|
3675
4220
|
};
|