@univerjs/sheets-drawing-ui 0.15.0-insiders.20260106-79b11f9 → 0.15.0-insiders.20260107-3d1cfdf
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/es/facade.js +65 -44
- package/lib/es/index.js +874 -860
- package/lib/facade.js +65 -44
- package/lib/index.js +874 -860
- package/lib/types/facade/f-univer.d.ts +20 -1
- package/lib/types/services/batch-save-images.service.d.ts +12 -1
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +2 -2
- package/package.json +12 -12
package/lib/es/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
var Jr = Object.defineProperty;
|
|
2
2
|
var Zr = (i, t, e) => t in i ? Jr(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
-
var
|
|
4
|
-
import { precisionTo as bt, IRenderManagerService as
|
|
5
|
-
import { convertPositionSheetOverGridToAbsolute as ti, SheetSkeletonManagerService as X, ISheetSelectionRenderService as Je, attachRangeWithCoord as dr, SheetCanvasPopManagerService as ni, HoverManagerService as ri, IEditorBridgeService as ii, IAutoFillService as si, EditingRenderController as oi, SetCellEditVisibleOperation as
|
|
6
|
-
import { CommandType as q, ICommandService as G, IUndoRedoService as Ze, sequenceExecute as lr, DrawingTypeEnum as x, ArrangeTypeEnum as Mt, Inject as A, IContextService as ur, LocaleService as Te, Injector as qe, Disposable as
|
|
7
|
-
import { ISheetDrawingService as oe, DrawingApplyType as U, SetDrawingApplyMutation as P, SheetDrawingAnchorType as O, UniverSheetsDrawingPlugin as
|
|
8
|
-
import { SheetInterceptorService as Ht, SheetsSelectionsService as ut, SetRangeValuesCommand 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
|
|
3
|
+
var Q = (i, t, e) => Zr(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { precisionTo as bt, IRenderManagerService as ee, transformObjectOutOfGroup as qr, getGroupState as Qr, getCurrentTypeOfRenderer as bn, CURSOR_TYPE as ei, RENDER_CLASS_TYPE as ke, Rect as $e, ObjectType as Nn, DRAWING_OBJECT_LAYER_INDEX as qt, SHEET_VIEWPORT_KEY as cr } from "@univerjs/engine-render";
|
|
5
|
+
import { convertPositionSheetOverGridToAbsolute as ti, SheetSkeletonManagerService as X, ISheetSelectionRenderService as Je, attachRangeWithCoord as dr, SheetCanvasPopManagerService as ni, HoverManagerService as ri, IEditorBridgeService as ii, IAutoFillService as si, EditingRenderController as oi, SetCellEditVisibleOperation as kn, PREDEFINED_HOOK_NAME_PASTE as Le, COPY_TYPE as Re, discreteRangeToRange as $n, virtualizeDiscreteRanges as ai, ISheetClipboardService as ci, SetZoomRatioOperation as xn, SetScrollOperation as di, SheetPrintInterceptorService as li, useHighlightRange as ui, getCurrentRangeDisable$ as hi } from "@univerjs/sheets-ui";
|
|
6
|
+
import { CommandType as q, ICommandService as G, IUndoRedoService as Ze, sequenceExecute as lr, DrawingTypeEnum as x, ArrangeTypeEnum as Mt, Inject as A, IContextService as ur, LocaleService as Te, Injector as qe, Disposable as te, createDocumentModelWithStyle as hn, ObjectRelativeFromV as Wn, ObjectRelativeFromH as Bn, WrapTextType as jn, PositionedObjectLayoutType as Fn, BooleanNumber as Ln, BuildTextUtils as gn, ImageSourceType as de, generateRandomId as He, FOCUSING_COMMON_DRAWINGS as Ye, IUniverInstanceService as le, UniverInstanceType as k, Direction as Ie, createIdentifier as gi, IImageIoService as hr, toDisposable as mi, RxDisposable as fi, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as ot, DOCS_ZEN_EDITOR_UNIT_ID_KEY as Ve, InterceptorEffectEnum as pi, ObjectMatrix as wi, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as _i, IPermissionService as Si, UserManagerService as vi, LifecycleService as Ii, LifecycleStages as Ci, DisposableCollection as yt, fromEventSubject as Ri, Tools as Ge, PRINT_CHART_COMPONENT_KEY as Di, Rectangle as bi, FOCUSING_SHEET as Mi, FOCUSING_FX_BAR_EDITOR as yi, EDITOR_ACTIVATED as Ei, FOCUSING_PANEL_EDITOR as Ti, DependentOn as Oi, IConfigService as Ui, Plugin as Pi, merge as Ai, registerDependencies as Ni, touchDependencies as Qt } from "@univerjs/core";
|
|
7
|
+
import { ISheetDrawingService as oe, DrawingApplyType as U, SetDrawingApplyMutation as P, SheetDrawingAnchorType as O, UniverSheetsDrawingPlugin as ki } from "@univerjs/sheets-drawing";
|
|
8
|
+
import { SheetInterceptorService as Ht, SheetsSelectionsService as ut, SetRangeValuesCommand as Hn, getSheetCommandTarget as se, INTERCEPTOR_POINT as $i, InterceptCellContentPriority as xi, WorkbookViewPermission as Vn, WorksheetViewPermission as Gn, WorkbookEditablePermission as mn, WorksheetEditPermission as fn, SetFrozenMutation as Wi, SetSelectionsOperation as Bi, SetWorksheetRowAutoHeightMutation as gr, COMMAND_LISTENER_SKELETON_CHANGE as ji, InsertRowCommand as mr, InsertColCommand as fr, RemoveRowCommand as pr, RemoveColCommand as wr, DeleteRangeMoveLeftCommand as _r, DeleteRangeMoveUpCommand as Sr, InsertRangeMoveDownCommand as vr, InsertRangeMoveRightCommand as Ir, DeltaRowHeightCommand as pn, SetRowHeightCommand as wn, DeltaColumnWidthCommand as Cr, SetColWidthCommand as Rr, SetRowHiddenCommand as Dr, SetSpecificRowsVisibleCommand as br, SetSpecificColsVisibleCommand as Mr, SetColHiddenCommand as yr, MoveColsCommand as Er, MoveRowsCommand as Tr, MoveRangeCommand as Or, SetRowVisibleMutation as Fi, SetRowHiddenMutation as Li, SetColVisibleMutation as Hi, SetColHiddenMutation as Vi, SetWorksheetRowHeightMutation as Gi, SetWorksheetRowIsAutoHeightMutation as Yi, SetWorksheetColWidthMutation as Xi, SetWorksheetActiveOperation as zi, RangeProtectionPermissionEditPoint as Ki } from "@univerjs/sheets";
|
|
9
|
+
import { MessageType as ve, render as Ji, unmount as Zi, FormLayout as en, CheckboxGroup as qi, Checkbox as Yn, Select as Qi, Button as Xn, clsx as es, RadioGroup as ts, Radio as tn } from "@univerjs/design";
|
|
10
|
+
import { docDrawingPositionToTransform as zn, ReplaceSnapshotCommand as ns, InnerPasteCommand as rs } from "@univerjs/docs-ui";
|
|
11
|
+
import { IImageIoService as is, IDrawingManagerService as ae, DRAWING_IMAGE_ALLOW_IMAGE_LIST as Kn, DRAWING_IMAGE_COUNT_LIMIT as Jn, ImageUploadStatusType as xe, DRAWING_IMAGE_ALLOW_SIZE as Zn, getImageSize as nn, SetDrawingSelectedOperation as Vt, DRAWING_IMAGE_WIDTH_LIMIT as qn, DRAWING_IMAGE_HEIGHT_LIMIT as Qn, ImageSourceType as ss, getDrawingShapeKeyByDrawingSearch as De, UniverDrawingPlugin as os } from "@univerjs/drawing";
|
|
12
|
+
import { ILocalFileService as as, IMessageService as Ur, IDialogService as Mn, ISidebarService as cs, IClipboardInterfaceService as ds, CanvasFloatDomService as ls, PrintFloatDomSingle as us, ComponentManager as Pr, connectInjector as hs, useDependency as Ce, getMenuHiddenObservable as Gt, MenuItemType as Yt, ContextMenuPosition as rn, ContextMenuGroup as sn, RibbonInsertGroup as gs, KeyCode as Ke, IMenuManagerService as ms, IShortcutService as fs } from "@univerjs/ui";
|
|
13
|
+
import { DocDrawingController as ps, UniverDocsDrawingPlugin as ws } from "@univerjs/docs-drawing";
|
|
14
|
+
import { ImageCropperObject as _s, COMPONENT_IMAGE_POPUP_MENU as Ss, OpenImageCropOperation as vs, ImageResetSizeOperation as Is, DrawingRenderService as Ar, DrawingCommonPanel as Cs, UniverDrawingUIPlugin as Rs } from "@univerjs/drawing-ui";
|
|
15
|
+
import { takeUntil as er, throttleTime as Ds, combineLatest as at, switchMap as pe, EMPTY as _e, tap as tr, map as we, distinctUntilChanged as nr, Subject as on, filter as bs, take as Ms, BehaviorSubject as je, of as _n } from "rxjs";
|
|
16
16
|
import { jsx as L, jsxs as Xe } from "react/jsx-runtime";
|
|
17
17
|
import { useMemo as Fe, useState as Ee, useCallback as Et, useEffect as Nr } from "react";
|
|
18
18
|
function J(i, t, e) {
|
|
@@ -25,9 +25,9 @@ function J(i, t, e) {
|
|
|
25
25
|
{ from: n, to: r },
|
|
26
26
|
e
|
|
27
27
|
);
|
|
28
|
-
let { left: g, top: h, width: m, height:
|
|
29
|
-
const
|
|
30
|
-
return g + m > w && (g = w - m), h +
|
|
28
|
+
let { left: g, top: h, width: m, height: p } = l;
|
|
29
|
+
const f = e.getCurrentSkeleton(), w = f.rowHeaderWidth + f.columnTotalWidth, _ = f.columnHeaderHeight + f.rowTotalHeight;
|
|
30
|
+
return g + m > w && (g = w - m), h + p > _ && (h = _ - p), {
|
|
31
31
|
flipY: s,
|
|
32
32
|
flipX: o,
|
|
33
33
|
angle: a,
|
|
@@ -36,7 +36,7 @@ function J(i, t, e) {
|
|
|
36
36
|
left: g,
|
|
37
37
|
top: h,
|
|
38
38
|
width: m,
|
|
39
|
-
height:
|
|
39
|
+
height: p
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
42
|
function j(i, t) {
|
|
@@ -71,7 +71,7 @@ const H = {
|
|
|
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(ee);
|
|
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();
|
|
@@ -81,7 +81,7 @@ const H = {
|
|
|
81
81
|
id: "sheet.command.remove-sheet-image",
|
|
82
82
|
type: q.COMMAND,
|
|
83
83
|
handler: (i, t) => {
|
|
84
|
-
var
|
|
84
|
+
var _, I, R;
|
|
85
85
|
const e = i.get(G), n = i.get(Ze), r = i.get(Ht), s = i.get(oe);
|
|
86
86
|
if (!t) return !1;
|
|
87
87
|
const { drawings: o } = t, a = [];
|
|
@@ -89,18 +89,18 @@ const H = {
|
|
|
89
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, m = r.onCommandExecute({ id: ht.id, params: t }),
|
|
93
|
-
return lr([...(
|
|
92
|
+
const d = s.getBatchRemoveOp(o), { unitId: u, subUnitId: c, undo: l, redo: g, objects: h } = d, m = r.onCommandExecute({ id: ht.id, params: t }), p = { id: P.id, params: { unitId: u, subUnitId: c, op: g, objects: h, type: U.REMOVE } }, f = { id: P.id, params: { unitId: u, subUnitId: c, op: l, objects: h, type: U.INSERT } };
|
|
93
|
+
return lr([...(_ = m.preRedos) != null ? _ : [], p, ...m.redos], e) ? (n.pushUndoRedo({
|
|
94
94
|
unitID: u,
|
|
95
95
|
undoMutations: [
|
|
96
96
|
...(I = m.preUndos) != null ? I : [],
|
|
97
|
-
|
|
97
|
+
f,
|
|
98
98
|
...m.undos,
|
|
99
99
|
{ id: H.id, params: a }
|
|
100
100
|
],
|
|
101
101
|
redoMutations: [
|
|
102
|
-
...(
|
|
103
|
-
|
|
102
|
+
...(R = m.preRedos) != null ? R : [],
|
|
103
|
+
p,
|
|
104
104
|
...m.redos,
|
|
105
105
|
{ id: H.id, params: a }
|
|
106
106
|
]
|
|
@@ -128,15 +128,15 @@ const H = {
|
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
130
|
};
|
|
131
|
-
function
|
|
131
|
+
function ys(i) {
|
|
132
132
|
const t = [];
|
|
133
133
|
return i.forEach((e) => {
|
|
134
134
|
const { parent: n, children: r } = e, { unitId: s, subUnitId: o, drawingId: a } = n, d = Qr(0, 0, r.map((l) => l.transform || {})), u = r.map((l) => {
|
|
135
|
-
const g = l.transform || { left: 0, top: 0 }, { unitId: h, subUnitId: m, drawingId:
|
|
135
|
+
const g = l.transform || { left: 0, top: 0 }, { unitId: h, subUnitId: m, drawingId: p } = l;
|
|
136
136
|
return {
|
|
137
137
|
unitId: h,
|
|
138
138
|
subUnitId: m,
|
|
139
|
-
drawingId:
|
|
139
|
+
drawingId: p,
|
|
140
140
|
transform: {
|
|
141
141
|
...g,
|
|
142
142
|
left: g.left - d.left,
|
|
@@ -157,19 +157,19 @@ function Ms(i) {
|
|
|
157
157
|
});
|
|
158
158
|
}), t;
|
|
159
159
|
}
|
|
160
|
-
function
|
|
160
|
+
function Es(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: m, drawingId:
|
|
167
|
+
const { transform: g } = l, { unitId: h, subUnitId: m, drawingId: p } = l, f = qr(g || {}, d, d.width || 0, d.height || 0);
|
|
168
168
|
return {
|
|
169
169
|
unitId: h,
|
|
170
170
|
subUnitId: m,
|
|
171
|
-
drawingId:
|
|
172
|
-
transform:
|
|
171
|
+
drawingId: p,
|
|
172
|
+
transform: f,
|
|
173
173
|
groupId: void 0
|
|
174
174
|
};
|
|
175
175
|
}), c = {
|
|
@@ -196,15 +196,15 @@ const $r = {
|
|
|
196
196
|
if (!t) return !1;
|
|
197
197
|
const s = [];
|
|
198
198
|
t.forEach(({ parent: h, children: m }) => {
|
|
199
|
-
s.push(h.unitId), m.forEach((
|
|
200
|
-
s.push(
|
|
199
|
+
s.push(h.unitId), m.forEach((p) => {
|
|
200
|
+
s.push(p.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:
|
|
207
|
+
{ id: P.id, params: { op: u, unitId: a, subUnitId: d, objects: Es(l), type: U.UNGROUP } },
|
|
208
208
|
{ id: H.id, params: s }
|
|
209
209
|
],
|
|
210
210
|
redoMutations: [
|
|
@@ -217,21 +217,21 @@ const $r = {
|
|
|
217
217
|
id: "sheet.command.insert-sheet-image",
|
|
218
218
|
type: q.COMMAND,
|
|
219
219
|
handler: (i, t) => {
|
|
220
|
-
var
|
|
220
|
+
var _, I, R;
|
|
221
221
|
const e = i.get(G), n = i.get(Ze), r = i.get(oe), s = i.get(Ht);
|
|
222
222
|
if (!t) return !1;
|
|
223
|
-
const o = t.drawings, a = o.map((v) => v.unitId), d = r.getBatchAddOp(o), { unitId: u, subUnitId: c, undo: l, redo: g, objects: h } = d, m = s.onCommandExecute({ id: Xt.id, params: t }),
|
|
224
|
-
return lr([...(
|
|
223
|
+
const o = t.drawings, a = o.map((v) => v.unitId), d = r.getBatchAddOp(o), { unitId: u, subUnitId: c, undo: l, redo: g, objects: h } = d, m = s.onCommandExecute({ id: Xt.id, params: t }), p = { id: P.id, params: { op: g, unitId: u, subUnitId: c, objects: h, type: U.INSERT } }, f = { id: P.id, params: { op: l, unitId: u, subUnitId: c, objects: h, type: U.REMOVE } };
|
|
224
|
+
return lr([...(_ = m.preRedos) != null ? _ : [], p, ...m.redos], e) ? (n.pushUndoRedo({
|
|
225
225
|
unitID: u,
|
|
226
226
|
undoMutations: [
|
|
227
227
|
...(I = m.preUndos) != null ? I : [],
|
|
228
|
-
|
|
228
|
+
f,
|
|
229
229
|
...m.undos,
|
|
230
230
|
{ id: H.id, params: a }
|
|
231
231
|
],
|
|
232
232
|
redoMutations: [
|
|
233
|
-
...(
|
|
234
|
-
|
|
233
|
+
...(R = m.preRedos) != null ? R : [],
|
|
234
|
+
p,
|
|
235
235
|
...m.redos,
|
|
236
236
|
{ id: H.id, params: a }
|
|
237
237
|
]
|
|
@@ -285,15 +285,15 @@ const $r = {
|
|
|
285
285
|
if (!t) return !1;
|
|
286
286
|
const s = [];
|
|
287
287
|
t.forEach(({ parent: h, children: m }) => {
|
|
288
|
-
s.push(h.unitId), m.forEach((
|
|
289
|
-
s.push(
|
|
288
|
+
s.push(h.unitId), m.forEach((p) => {
|
|
289
|
+
s.push(p.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:
|
|
296
|
+
{ id: P.id, params: { op: u, unitId: a, subUnitId: d, objects: ys(l), type: U.GROUP } },
|
|
297
297
|
{ id: H.id, params: s }
|
|
298
298
|
],
|
|
299
299
|
redoMutations: [
|
|
@@ -303,49 +303,49 @@ const $r = {
|
|
|
303
303
|
}), !0) : !1;
|
|
304
304
|
}
|
|
305
305
|
};
|
|
306
|
-
var
|
|
307
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
306
|
+
var Ts = Object.getOwnPropertyDescriptor, Os = (i, t, e, n) => {
|
|
307
|
+
for (var r = n > 1 ? void 0 : n ? Ts(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
310
|
}, ie = (i, t) => (e, n) => t(e, n, i);
|
|
311
|
-
function
|
|
311
|
+
function Us(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 Sn(i, t, e, n, r) {
|
|
316
|
+
var _;
|
|
317
|
+
const { rotatedHeight: s, rotatedWidth: o } = Us(e, n, r), d = i.get(ee).getRenderById(t.unitId);
|
|
318
318
|
if (!d)
|
|
319
319
|
return !1;
|
|
320
|
-
const c = (
|
|
320
|
+
const c = (_ = d.with(X).getSkeletonParam(t.subUnitId)) == null ? void 0 : _.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, m = 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, m = o / s, f = Math.ceil(Math.min(g, h * m)) / o, w = !f || Number.isNaN(f) ? 1e-3 : f;
|
|
324
324
|
return {
|
|
325
325
|
width: e * w,
|
|
326
326
|
height: n * w
|
|
327
327
|
};
|
|
328
328
|
}
|
|
329
|
-
let dt = class extends
|
|
329
|
+
let dt = class extends te {
|
|
330
330
|
constructor(t, e, n, r, s, o, a, d, u, c, l, g, h) {
|
|
331
331
|
super();
|
|
332
|
-
|
|
332
|
+
Q(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: Kn.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 > Jn ? (this._messageService.show({
|
|
341
|
+
type: ve.Error,
|
|
342
|
+
content: this._localeService.t("update-status.exceedMaxCount", String(Jn))
|
|
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: Kn.map((n) => `.${n.replace("image/", "")}`).join(",")
|
|
349
349
|
}))[0];
|
|
350
350
|
return e ? (await this._insertCellImage(e), !0) : !1;
|
|
351
351
|
}
|
|
@@ -356,16 +356,16 @@ let dt = class extends ee {
|
|
|
356
356
|
let e;
|
|
357
357
|
try {
|
|
358
358
|
e = await this._imageIoService.saveImage(t);
|
|
359
|
-
} catch (
|
|
360
|
-
const I =
|
|
359
|
+
} catch (_) {
|
|
360
|
+
const I = _.message;
|
|
361
361
|
I === xe.ERROR_EXCEED_SIZE ? this._messageService.show({
|
|
362
|
-
type:
|
|
363
|
-
content: this._localeService.t("update-status.exceedMaxSize", String(
|
|
362
|
+
type: ve.Error,
|
|
363
|
+
content: this._localeService.t("update-status.exceedMaxSize", String(Zn / (1024 * 1024)))
|
|
364
364
|
}) : I === xe.ERROR_IMAGE_TYPE ? this._messageService.show({
|
|
365
|
-
type:
|
|
365
|
+
type: ve.Error,
|
|
366
366
|
content: this._localeService.t("update-status.invalidImageType")
|
|
367
367
|
}) : I === xe.ERROR_IMAGE && this._messageService.show({
|
|
368
|
-
type:
|
|
368
|
+
type: ve.Error,
|
|
369
369
|
content: this._localeService.t("update-status.invalidImage")
|
|
370
370
|
});
|
|
371
371
|
}
|
|
@@ -373,13 +373,13 @@ let dt = class extends ee {
|
|
|
373
373
|
return;
|
|
374
374
|
const n = this._getUnitInfo(), { unitId: r, subUnitId: s } = n, { imageId: o, imageSourceType: a, source: d, base64Cache: u } = e, { width: c, height: l, image: g } = await nn(u || ""), { width: h, height: m } = this._context.scene;
|
|
375
375
|
this._imageIoService.addImageSourceCache(d, a, g);
|
|
376
|
-
let
|
|
377
|
-
if (c >
|
|
378
|
-
const
|
|
379
|
-
|
|
376
|
+
let p = 1;
|
|
377
|
+
if (c > qn || l > Qn) {
|
|
378
|
+
const _ = qn / c, I = Qn / l;
|
|
379
|
+
p = Math.max(_, I);
|
|
380
380
|
}
|
|
381
|
-
const
|
|
382
|
-
if (
|
|
381
|
+
const f = this._getImagePosition(c * p, l * p, h, m);
|
|
382
|
+
if (f == null)
|
|
383
383
|
return;
|
|
384
384
|
const w = {
|
|
385
385
|
unitId: r,
|
|
@@ -388,8 +388,8 @@ let dt = class extends ee {
|
|
|
388
388
|
drawingType: x.DRAWING_IMAGE,
|
|
389
389
|
imageSourceType: a,
|
|
390
390
|
source: d,
|
|
391
|
-
transform: J(
|
|
392
|
-
sheetTransform:
|
|
391
|
+
transform: J(f, this._selectionRenderService, this._skeletonManagerService),
|
|
392
|
+
sheetTransform: f
|
|
393
393
|
};
|
|
394
394
|
return this._commandService.executeCommand(Xt.id, {
|
|
395
395
|
unitId: r,
|
|
@@ -398,20 +398,20 @@ let dt = class extends ee {
|
|
|
398
398
|
}
|
|
399
399
|
// eslint-disable-next-line max-lines-per-function
|
|
400
400
|
async _insertCellImage(t, e) {
|
|
401
|
-
var I,
|
|
401
|
+
var I, R;
|
|
402
402
|
let n;
|
|
403
403
|
try {
|
|
404
404
|
n = await this._imageIoService.saveImage(t);
|
|
405
405
|
} catch (v) {
|
|
406
406
|
const C = v.message;
|
|
407
407
|
C === xe.ERROR_EXCEED_SIZE ? this._messageService.show({
|
|
408
|
-
type:
|
|
409
|
-
content: this._localeService.t("update-status.exceedMaxSize", String(
|
|
408
|
+
type: ve.Error,
|
|
409
|
+
content: this._localeService.t("update-status.exceedMaxSize", String(Zn / (1024 * 1024)))
|
|
410
410
|
}) : C === xe.ERROR_IMAGE_TYPE ? this._messageService.show({
|
|
411
|
-
type:
|
|
411
|
+
type: ve.Error,
|
|
412
412
|
content: this._localeService.t("update-status.invalidImageType")
|
|
413
413
|
}) : C === xe.ERROR_IMAGE && this._messageService.show({
|
|
414
|
-
type:
|
|
414
|
+
type: ve.Error,
|
|
415
415
|
content: this._localeService.t("update-status.invalidImage")
|
|
416
416
|
});
|
|
417
417
|
}
|
|
@@ -424,7 +424,7 @@ let dt = class extends ee {
|
|
|
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 m =
|
|
427
|
+
const m = hn("", {}), p = Sn(
|
|
428
428
|
this._injector,
|
|
429
429
|
{
|
|
430
430
|
unitId: this._context.unitId,
|
|
@@ -436,19 +436,19 @@ let dt = class extends ee {
|
|
|
436
436
|
u,
|
|
437
437
|
0
|
|
438
438
|
);
|
|
439
|
-
if (!
|
|
439
|
+
if (!p)
|
|
440
440
|
return !1;
|
|
441
|
-
const
|
|
441
|
+
const f = {
|
|
442
442
|
size: {
|
|
443
|
-
width:
|
|
444
|
-
height:
|
|
443
|
+
width: p.width,
|
|
444
|
+
height: p.height
|
|
445
445
|
},
|
|
446
446
|
positionH: {
|
|
447
|
-
relativeFrom:
|
|
447
|
+
relativeFrom: Bn.PAGE,
|
|
448
448
|
posOffset: 0
|
|
449
449
|
},
|
|
450
450
|
positionV: {
|
|
451
|
-
relativeFrom:
|
|
451
|
+
relativeFrom: Wn.PARAGRAPH,
|
|
452
452
|
posOffset: 0
|
|
453
453
|
},
|
|
454
454
|
angle: 0
|
|
@@ -459,19 +459,19 @@ let dt = class extends ee {
|
|
|
459
459
|
drawingType: x.DRAWING_IMAGE,
|
|
460
460
|
imageSourceType: s,
|
|
461
461
|
source: o,
|
|
462
|
-
transform:
|
|
463
|
-
docTransform:
|
|
464
|
-
behindDoc:
|
|
462
|
+
transform: zn(f),
|
|
463
|
+
docTransform: f,
|
|
464
|
+
behindDoc: Ln.FALSE,
|
|
465
465
|
title: "",
|
|
466
466
|
description: "",
|
|
467
|
-
layoutType:
|
|
467
|
+
layoutType: Fn.INLINE,
|
|
468
468
|
// Insert inline drawing by default.
|
|
469
|
-
wrapText:
|
|
469
|
+
wrapText: jn.BOTH_SIDES,
|
|
470
470
|
distB: 0,
|
|
471
471
|
distL: 0,
|
|
472
472
|
distR: 0,
|
|
473
473
|
distT: 0
|
|
474
|
-
},
|
|
474
|
+
}, _ = gn.drawing.add({
|
|
475
475
|
documentDataModel: m,
|
|
476
476
|
drawings: [w],
|
|
477
477
|
selection: {
|
|
@@ -480,10 +480,10 @@ let dt = class extends ee {
|
|
|
480
480
|
endOffset: 0
|
|
481
481
|
}
|
|
482
482
|
});
|
|
483
|
-
return
|
|
483
|
+
return _ ? (m.apply(_), this._commandService.syncExecuteCommand(Hn.id, {
|
|
484
484
|
value: {
|
|
485
485
|
[(I = e == null ? void 0 : e.row) != null ? I : g]: {
|
|
486
|
-
[(
|
|
486
|
+
[(R = e == null ? void 0 : e.col) != null ? R : h]: {
|
|
487
487
|
p: m.getSnapshot(),
|
|
488
488
|
t: 1
|
|
489
489
|
}
|
|
@@ -497,11 +497,11 @@ let dt = class extends ee {
|
|
|
497
497
|
async insertCellImageByUrl(t, e) {
|
|
498
498
|
var g, h;
|
|
499
499
|
const { width: n, height: r, image: s } = await nn(t || "");
|
|
500
|
-
this._imageIoService.addImageSourceCache(t,
|
|
500
|
+
this._imageIoService.addImageSourceCache(t, de.URL, s);
|
|
501
501
|
const o = this._workbookSelections.getCurrentLastSelection();
|
|
502
502
|
if (!o)
|
|
503
503
|
return !1;
|
|
504
|
-
const a =
|
|
504
|
+
const a = hn("", {}), d = Sn(
|
|
505
505
|
this._injector,
|
|
506
506
|
{
|
|
507
507
|
unitId: this._context.unitId,
|
|
@@ -521,11 +521,11 @@ let dt = class extends ee {
|
|
|
521
521
|
height: d.height
|
|
522
522
|
},
|
|
523
523
|
positionH: {
|
|
524
|
-
relativeFrom:
|
|
524
|
+
relativeFrom: Bn.PAGE,
|
|
525
525
|
posOffset: 0
|
|
526
526
|
},
|
|
527
527
|
positionV: {
|
|
528
|
-
relativeFrom:
|
|
528
|
+
relativeFrom: Wn.PARAGRAPH,
|
|
529
529
|
posOffset: 0
|
|
530
530
|
},
|
|
531
531
|
angle: 0
|
|
@@ -534,21 +534,21 @@ let dt = class extends ee {
|
|
|
534
534
|
subUnitId: a.getUnitId(),
|
|
535
535
|
drawingId: He(),
|
|
536
536
|
drawingType: x.DRAWING_IMAGE,
|
|
537
|
-
imageSourceType:
|
|
537
|
+
imageSourceType: de.URL,
|
|
538
538
|
source: t,
|
|
539
|
-
transform:
|
|
539
|
+
transform: zn(u),
|
|
540
540
|
docTransform: u,
|
|
541
|
-
behindDoc:
|
|
541
|
+
behindDoc: Ln.FALSE,
|
|
542
542
|
title: "",
|
|
543
543
|
description: "",
|
|
544
|
-
layoutType:
|
|
544
|
+
layoutType: Fn.INLINE,
|
|
545
545
|
// Insert inline drawing by default.
|
|
546
|
-
wrapText:
|
|
546
|
+
wrapText: jn.BOTH_SIDES,
|
|
547
547
|
distB: 0,
|
|
548
548
|
distL: 0,
|
|
549
549
|
distR: 0,
|
|
550
550
|
distT: 0
|
|
551
|
-
}, l =
|
|
551
|
+
}, l = gn.drawing.add({
|
|
552
552
|
documentDataModel: a,
|
|
553
553
|
drawings: [c],
|
|
554
554
|
selection: {
|
|
@@ -557,7 +557,7 @@ let dt = class extends ee {
|
|
|
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(Hn.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]: {
|
|
@@ -591,10 +591,10 @@ let dt = class extends ee {
|
|
|
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 f = this._selectionRenderService.getCellWithCoordByOffset(c, l);
|
|
595
|
+
if (f == null)
|
|
596
596
|
return;
|
|
597
|
-
c =
|
|
597
|
+
c = f.startX, l = f.startY, d = f.actualColumn, u = f.actualRow;
|
|
598
598
|
}
|
|
599
599
|
const h = {
|
|
600
600
|
column: d,
|
|
@@ -604,7 +604,7 @@ let dt = class extends ee {
|
|
|
604
604
|
}, m = this._selectionRenderService.getCellWithCoordByOffset(c + t, l + e);
|
|
605
605
|
if (m == null)
|
|
606
606
|
return;
|
|
607
|
-
const
|
|
607
|
+
const p = {
|
|
608
608
|
column: m.actualColumn,
|
|
609
609
|
columnOffset: c + t - m.startX,
|
|
610
610
|
row: m.actualRow,
|
|
@@ -612,7 +612,7 @@ let dt = class extends ee {
|
|
|
612
612
|
};
|
|
613
613
|
return {
|
|
614
614
|
from: h,
|
|
615
|
-
to:
|
|
615
|
+
to: p
|
|
616
616
|
};
|
|
617
617
|
}
|
|
618
618
|
_updateOrderListener() {
|
|
@@ -668,12 +668,12 @@ let dt = class extends ee {
|
|
|
668
668
|
);
|
|
669
669
|
}
|
|
670
670
|
};
|
|
671
|
-
dt =
|
|
671
|
+
dt = Os([
|
|
672
672
|
ie(1, A(X)),
|
|
673
673
|
ie(2, G),
|
|
674
674
|
ie(3, Je),
|
|
675
|
-
ie(4,
|
|
676
|
-
ie(5,
|
|
675
|
+
ie(4, is),
|
|
676
|
+
ie(5, as),
|
|
677
677
|
ie(6, oe),
|
|
678
678
|
ie(7, ae),
|
|
679
679
|
ie(8, ur),
|
|
@@ -687,7 +687,7 @@ const Kt = {
|
|
|
687
687
|
type: q.COMMAND,
|
|
688
688
|
handler: async (i, t) => {
|
|
689
689
|
var o, a;
|
|
690
|
-
const e = i.get(
|
|
690
|
+
const e = i.get(le), n = i.get(ee), r = (o = bn(
|
|
691
691
|
k.UNIVER_SHEET,
|
|
692
692
|
e,
|
|
693
693
|
n
|
|
@@ -701,13 +701,13 @@ const Kt = {
|
|
|
701
701
|
} else
|
|
702
702
|
return (a = r.insertFloatImage()) != null ? a : !1;
|
|
703
703
|
}
|
|
704
|
-
},
|
|
704
|
+
}, yn = {
|
|
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 =
|
|
709
|
+
const t = i.get(le), e = i.get(ee);
|
|
710
|
+
return (r = (n = bn(
|
|
711
711
|
k.UNIVER_SHEET,
|
|
712
712
|
t,
|
|
713
713
|
e
|
|
@@ -725,7 +725,7 @@ const Kt = {
|
|
|
725
725
|
if (l == null)
|
|
726
726
|
return null;
|
|
727
727
|
const g = { ...l }, { left: h = 0, top: m = 0 } = l;
|
|
728
|
-
return s ===
|
|
728
|
+
return s === Ie.UP ? g.top = m - 1 : s === Ie.DOWN ? g.top = m + 1 : s === Ie.LEFT ? g.left = h - 1 : s === Ie.RIGHT && (g.left = h + 1), {
|
|
729
729
|
...c,
|
|
730
730
|
transform: g,
|
|
731
731
|
sheetTransform: j(g, r)
|
|
@@ -737,30 +737,30 @@ const Kt = {
|
|
|
737
737
|
}) ? (e.syncExecuteCommand(H.id, [a]), !0) : !1;
|
|
738
738
|
}
|
|
739
739
|
};
|
|
740
|
-
var
|
|
741
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
740
|
+
var Ps = Object.getOwnPropertyDescriptor, As = (i, t, e, n) => {
|
|
741
|
+
for (var r = n > 1 ? void 0 : n ? Ps(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
742
742
|
(o = i[s]) && (r = o(r) || r);
|
|
743
743
|
return r;
|
|
744
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
|
|
746
|
-
function
|
|
745
|
+
const En = gi("sheets-drawing-ui.batch-save-images.service");
|
|
746
|
+
function vn(i) {
|
|
747
747
|
let t = "", e = i;
|
|
748
748
|
for (; e >= 0; )
|
|
749
749
|
t = String.fromCharCode(e % 26 + 65) + t, e = Math.floor(e / 26) - 1;
|
|
750
750
|
return t;
|
|
751
751
|
}
|
|
752
752
|
function At(i, t) {
|
|
753
|
-
return `${
|
|
753
|
+
return `${vn(t)}${i + 1}`;
|
|
754
754
|
}
|
|
755
|
-
function
|
|
755
|
+
function Ns(i) {
|
|
756
756
|
const t = At(i.startRow, i.startColumn), e = At(i.endRow, i.endColumn);
|
|
757
757
|
return t === e ? t : `${t}:${e}`;
|
|
758
758
|
}
|
|
759
|
-
function
|
|
759
|
+
function rr(i) {
|
|
760
760
|
var t, e, n, r;
|
|
761
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
762
|
}
|
|
763
|
-
function
|
|
763
|
+
function ir(i) {
|
|
764
764
|
var n, r, s;
|
|
765
765
|
if (!((r = (n = i.p) == null ? void 0 : n.drawingsOrder) != null && r.length) || !((s = i.p) != null && s.drawings))
|
|
766
766
|
return null;
|
|
@@ -768,74 +768,81 @@ function rr(i) {
|
|
|
768
768
|
return !e || !("source" in e) || !("imageSourceType" in e) ? null : e;
|
|
769
769
|
}
|
|
770
770
|
function cn(i, t) {
|
|
771
|
-
if (t ===
|
|
771
|
+
if (t === de.BASE64) {
|
|
772
772
|
const e = i.match(/^data:image\/(\w+);/);
|
|
773
773
|
if (e)
|
|
774
774
|
return e[1] === "jpeg" ? "jpg" : e[1];
|
|
775
775
|
}
|
|
776
|
-
if (t ===
|
|
776
|
+
if (t === de.URL) {
|
|
777
777
|
const e = i.match(/\.(\w+)(?:\?|$)/);
|
|
778
778
|
if (e)
|
|
779
779
|
return e[1].toLowerCase();
|
|
780
780
|
}
|
|
781
781
|
return "png";
|
|
782
782
|
}
|
|
783
|
-
async function
|
|
784
|
-
if (t ===
|
|
783
|
+
async function dn(i, t) {
|
|
784
|
+
if (t === de.BASE64)
|
|
785
785
|
return (await fetch(i)).blob();
|
|
786
|
-
if (t ===
|
|
786
|
+
if (t === de.URL)
|
|
787
787
|
return (await fetch(i)).blob();
|
|
788
788
|
throw new Error("UUID image type requires additional handling");
|
|
789
789
|
}
|
|
790
|
-
let
|
|
791
|
-
constructor(
|
|
792
|
-
super()
|
|
790
|
+
let In = class extends te {
|
|
791
|
+
constructor(t, e, n) {
|
|
792
|
+
super();
|
|
793
|
+
Q(this, "_urlImageDownloader", null);
|
|
794
|
+
this._univerInstanceService = t, this._selectionService = e, this._imageIoService = n;
|
|
795
|
+
}
|
|
796
|
+
registerURLImageDownloader(t) {
|
|
797
|
+
return this._urlImageDownloader = t, mi(() => {
|
|
798
|
+
this._urlImageDownloader === t && (this._urlImageDownloader = null);
|
|
799
|
+
});
|
|
793
800
|
}
|
|
794
801
|
getCellImagesInSelection() {
|
|
795
|
-
const
|
|
796
|
-
if (!i) return [];
|
|
797
|
-
const t = i.getActiveSheet();
|
|
802
|
+
const t = this._univerInstanceService.getCurrentUnitForType(k.UNIVER_SHEET);
|
|
798
803
|
if (!t) return [];
|
|
799
|
-
const e =
|
|
800
|
-
if (!e
|
|
801
|
-
const n =
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
804
|
+
const e = t.getActiveSheet();
|
|
805
|
+
if (!e) return [];
|
|
806
|
+
const n = this._selectionService.getCurrentSelections();
|
|
807
|
+
if (!n || n.length === 0) return [];
|
|
808
|
+
const r = e.getCellMatrix(), s = [];
|
|
809
|
+
for (const o of n) {
|
|
810
|
+
const { startRow: a, endRow: d, startColumn: u, endColumn: c } = o.range;
|
|
811
|
+
for (let l = a; l <= d; l++)
|
|
812
|
+
for (let g = u; g <= c; g++) {
|
|
813
|
+
const h = r.getValue(l, g);
|
|
814
|
+
if (rr(h)) {
|
|
815
|
+
const m = ir(h);
|
|
816
|
+
m && s.push({
|
|
817
|
+
row: l,
|
|
818
|
+
col: g,
|
|
819
|
+
cellAddress: At(l, g),
|
|
820
|
+
source: m.source,
|
|
821
|
+
imageSourceType: m.imageSourceType,
|
|
822
|
+
imageId: m.drawingId
|
|
816
823
|
});
|
|
817
824
|
}
|
|
818
825
|
}
|
|
819
826
|
}
|
|
820
|
-
return
|
|
827
|
+
return s;
|
|
821
828
|
}
|
|
822
|
-
getCellImagesFromRanges(
|
|
823
|
-
const
|
|
824
|
-
if (!n) return [];
|
|
825
|
-
const r = n.getSheetBySheetId(t);
|
|
829
|
+
getCellImagesFromRanges(t, e, n) {
|
|
830
|
+
const r = this._univerInstanceService.getUnit(t, k.UNIVER_SHEET);
|
|
826
831
|
if (!r) return [];
|
|
827
|
-
const s = r.
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
832
|
+
const s = r.getSheetBySheetId(e);
|
|
833
|
+
if (!s) return [];
|
|
834
|
+
const o = s.getCellMatrix(), a = [];
|
|
835
|
+
for (const d of n) {
|
|
836
|
+
const { startRow: u, endRow: c, startColumn: l, endColumn: g } = d;
|
|
837
|
+
for (let h = u; h <= c; h++)
|
|
838
|
+
for (let m = l; m <= g; m++) {
|
|
839
|
+
const p = o.getValue(h, m);
|
|
840
|
+
if (rr(p)) {
|
|
841
|
+
const f = ir(p);
|
|
842
|
+
f && a.push({
|
|
843
|
+
row: h,
|
|
844
|
+
col: m,
|
|
845
|
+
cellAddress: At(h, m),
|
|
839
846
|
source: f.source,
|
|
840
847
|
imageSourceType: f.imageSourceType,
|
|
841
848
|
imageId: f.drawingId
|
|
@@ -843,194 +850,201 @@ let vn = class extends ee {
|
|
|
843
850
|
}
|
|
844
851
|
}
|
|
845
852
|
}
|
|
846
|
-
return
|
|
853
|
+
return a;
|
|
847
854
|
}
|
|
848
855
|
getDataColumns() {
|
|
849
|
-
var
|
|
850
|
-
const
|
|
851
|
-
if (!i) return [];
|
|
852
|
-
const t = i.getActiveSheet();
|
|
856
|
+
var g, h, m, p;
|
|
857
|
+
const t = this._univerInstanceService.getCurrentUnitForType(k.UNIVER_SHEET);
|
|
853
858
|
if (!t) return [];
|
|
854
|
-
const e =
|
|
855
|
-
if (!e
|
|
856
|
-
const n =
|
|
857
|
-
|
|
858
|
-
const
|
|
859
|
-
|
|
860
|
-
s = Math.min(s, f.range.startRow), o = Math.max(o, f.range.endRow);
|
|
861
|
-
for (let p = f.range.startColumn; p <= f.range.endColumn; p++)
|
|
862
|
-
a.add(p);
|
|
863
|
-
}
|
|
859
|
+
const e = t.getActiveSheet();
|
|
860
|
+
if (!e) return [];
|
|
861
|
+
const n = this._selectionService.getCurrentSelections();
|
|
862
|
+
if (!n || n.length === 0) return [];
|
|
863
|
+
const r = e.getCellMatrix(), s = r.getDataRange();
|
|
864
|
+
let o = 1 / 0, a = -1 / 0;
|
|
864
865
|
const d = /* @__PURE__ */ new Set();
|
|
865
|
-
for (
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
866
|
+
for (const f of n) {
|
|
867
|
+
o = Math.min(o, f.range.startRow), a = Math.max(a, f.range.endRow);
|
|
868
|
+
for (let w = f.range.startColumn; w <= f.range.endColumn; w++)
|
|
869
|
+
d.add(w);
|
|
870
|
+
}
|
|
871
|
+
const u = /* @__PURE__ */ new Set();
|
|
872
|
+
for (let f = s.startColumn; f <= s.endColumn; f++)
|
|
873
|
+
if (!d.has(f))
|
|
874
|
+
for (let w = o; w <= a; w++) {
|
|
875
|
+
const _ = r.getValue(w, f);
|
|
876
|
+
if (_ && (((g = _.v) == null ? void 0 : g.toString()) || ((p = (m = (h = _.p) == null ? void 0 : h.body) == null ? void 0 : m.dataStream) == null ? void 0 : p.trim()) || "")) {
|
|
877
|
+
u.add(f);
|
|
871
878
|
break;
|
|
872
879
|
}
|
|
873
880
|
}
|
|
874
|
-
const
|
|
875
|
-
for (const f of
|
|
876
|
-
|
|
881
|
+
const c = [], l = Array.from(u).sort((f, w) => f - w);
|
|
882
|
+
for (const f of l)
|
|
883
|
+
c.push({
|
|
877
884
|
index: f,
|
|
878
|
-
label:
|
|
885
|
+
label: vn(f)
|
|
879
886
|
});
|
|
880
|
-
return
|
|
887
|
+
return c;
|
|
881
888
|
}
|
|
882
|
-
getDataColumnsForRanges(
|
|
883
|
-
var
|
|
884
|
-
const
|
|
885
|
-
if (!n) return [];
|
|
886
|
-
const r = n.getSheetBySheetId(t);
|
|
889
|
+
getDataColumnsForRanges(t, e, n) {
|
|
890
|
+
var m, p, f, w;
|
|
891
|
+
const r = this._univerInstanceService.getUnit(t, k.UNIVER_SHEET);
|
|
887
892
|
if (!r) return [];
|
|
888
|
-
const s = r.
|
|
889
|
-
|
|
890
|
-
const
|
|
891
|
-
|
|
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
|
-
}
|
|
893
|
+
const s = r.getSheetBySheetId(e);
|
|
894
|
+
if (!s) return [];
|
|
895
|
+
const o = s.getCellMatrix(), a = o.getDataRange();
|
|
896
|
+
let d = 1 / 0, u = -1 / 0;
|
|
896
897
|
const c = /* @__PURE__ */ new Set();
|
|
897
|
-
for (
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
898
|
+
for (const _ of n) {
|
|
899
|
+
d = Math.min(d, _.startRow), u = Math.max(u, _.endRow);
|
|
900
|
+
for (let I = _.startColumn; I <= _.endColumn; I++)
|
|
901
|
+
c.add(I);
|
|
902
|
+
}
|
|
903
|
+
const l = /* @__PURE__ */ new Set();
|
|
904
|
+
for (let _ = a.startColumn; _ <= a.endColumn; _++)
|
|
905
|
+
if (!c.has(_))
|
|
906
|
+
for (let I = d; I <= u; I++) {
|
|
907
|
+
const R = o.getValue(I, _);
|
|
908
|
+
if (R && (((m = R.v) == null ? void 0 : m.toString()) || ((w = (f = (p = R.p) == null ? void 0 : p.body) == null ? void 0 : f.dataStream) == null ? void 0 : w.trim()) || "")) {
|
|
909
|
+
l.add(_);
|
|
903
910
|
break;
|
|
904
911
|
}
|
|
905
912
|
}
|
|
906
|
-
const
|
|
907
|
-
for (const
|
|
908
|
-
|
|
909
|
-
index:
|
|
910
|
-
label:
|
|
913
|
+
const g = [], h = Array.from(l).sort((_, I) => _ - I);
|
|
914
|
+
for (const _ of h)
|
|
915
|
+
g.push({
|
|
916
|
+
index: _,
|
|
917
|
+
label: vn(_)
|
|
911
918
|
});
|
|
912
|
-
return
|
|
919
|
+
return g;
|
|
913
920
|
}
|
|
914
921
|
getSelectionRangeNotation() {
|
|
915
|
-
const
|
|
916
|
-
return !
|
|
922
|
+
const t = this._selectionService.getCurrentSelections();
|
|
923
|
+
return !t || t.length === 0 ? "" : t.map((e) => Ns(e.range)).join(", ");
|
|
917
924
|
}
|
|
918
925
|
getSelectionRowRange() {
|
|
919
|
-
const
|
|
920
|
-
if (!
|
|
921
|
-
let
|
|
922
|
-
for (const
|
|
923
|
-
|
|
924
|
-
return { startRow:
|
|
926
|
+
const t = this._selectionService.getCurrentSelections();
|
|
927
|
+
if (!t || t.length === 0) return null;
|
|
928
|
+
let e = 1 / 0, n = -1 / 0;
|
|
929
|
+
for (const r of t)
|
|
930
|
+
e = Math.min(e, r.range.startRow), n = Math.max(n, r.range.endRow);
|
|
931
|
+
return { startRow: e, endRow: n };
|
|
925
932
|
}
|
|
926
933
|
getSelectionColumnIndices() {
|
|
927
|
-
const
|
|
928
|
-
if (!
|
|
929
|
-
const
|
|
930
|
-
for (const
|
|
931
|
-
for (let
|
|
932
|
-
|
|
933
|
-
return
|
|
934
|
-
}
|
|
935
|
-
generateFileName(
|
|
936
|
-
var
|
|
937
|
-
const
|
|
938
|
-
for (const
|
|
939
|
-
if (
|
|
940
|
-
|
|
941
|
-
else if (
|
|
942
|
-
const
|
|
943
|
-
if (
|
|
944
|
-
const
|
|
945
|
-
if (
|
|
946
|
-
const
|
|
947
|
-
if (
|
|
948
|
-
const
|
|
949
|
-
|
|
934
|
+
const t = this._selectionService.getCurrentSelections();
|
|
935
|
+
if (!t || t.length === 0) return /* @__PURE__ */ new Set();
|
|
936
|
+
const e = /* @__PURE__ */ new Set();
|
|
937
|
+
for (const n of t)
|
|
938
|
+
for (let r = n.range.startColumn; r <= n.range.endColumn; r++)
|
|
939
|
+
e.add(r);
|
|
940
|
+
return e;
|
|
941
|
+
}
|
|
942
|
+
generateFileName(t, e) {
|
|
943
|
+
var o, a, d, u;
|
|
944
|
+
const n = this._univerInstanceService.getCurrentUnitForType(k.UNIVER_SHEET), r = cn(t.source, t.imageSourceType), s = [];
|
|
945
|
+
for (const c of e.fileNameParts)
|
|
946
|
+
if (c === "cellAddress")
|
|
947
|
+
s.push(t.cellAddress);
|
|
948
|
+
else if (c === "columnValue" && e.columnIndex !== void 0) {
|
|
949
|
+
const l = n == null ? void 0 : n.getActiveSheet();
|
|
950
|
+
if (l) {
|
|
951
|
+
const h = l.getCellMatrix().getValue(t.row, e.columnIndex);
|
|
952
|
+
if (h) {
|
|
953
|
+
const m = ((o = h.v) == null ? void 0 : o.toString()) || ((u = (d = (a = h.p) == null ? void 0 : a.body) == null ? void 0 : d.dataStream) == null ? void 0 : u.trim()) || "";
|
|
954
|
+
if (m) {
|
|
955
|
+
const p = m.replace(/[<>:"/\\|?*]/g, "_").trim();
|
|
956
|
+
p && s.push(p);
|
|
950
957
|
}
|
|
951
958
|
}
|
|
952
959
|
}
|
|
953
960
|
}
|
|
954
|
-
return
|
|
955
|
-
}
|
|
956
|
-
generateFileNameWithContext(
|
|
957
|
-
var
|
|
958
|
-
const
|
|
959
|
-
for (const
|
|
960
|
-
if (
|
|
961
|
-
|
|
962
|
-
else if (
|
|
963
|
-
const
|
|
964
|
-
if (
|
|
965
|
-
const
|
|
966
|
-
if (
|
|
967
|
-
const f = ((
|
|
961
|
+
return s.length === 0 ? `${t.cellAddress}.${r}` : `${s.join("_")}.${r}`;
|
|
962
|
+
}
|
|
963
|
+
generateFileNameWithContext(t, e, n, r) {
|
|
964
|
+
var d, u, c, l;
|
|
965
|
+
const s = this._univerInstanceService.getUnit(n, k.UNIVER_SHEET), o = cn(t.source, t.imageSourceType), a = [];
|
|
966
|
+
for (const g of e.fileNameParts)
|
|
967
|
+
if (g === "cellAddress")
|
|
968
|
+
a.push(t.cellAddress);
|
|
969
|
+
else if (g === "columnValue" && e.columnIndex !== void 0) {
|
|
970
|
+
const h = s == null ? void 0 : s.getSheetBySheetId(r);
|
|
971
|
+
if (h) {
|
|
972
|
+
const p = h.getCellMatrix().getValue(t.row, e.columnIndex);
|
|
973
|
+
if (p) {
|
|
974
|
+
const f = ((d = p.v) == null ? void 0 : d.toString()) || ((l = (c = (u = p.p) == null ? void 0 : u.body) == null ? void 0 : c.dataStream) == null ? void 0 : l.trim()) || "";
|
|
968
975
|
if (f) {
|
|
969
|
-
const
|
|
970
|
-
|
|
976
|
+
const w = f.replace(/[<>:"/\\|?*]/g, "_").trim();
|
|
977
|
+
w && a.push(w);
|
|
971
978
|
}
|
|
972
979
|
}
|
|
973
980
|
}
|
|
974
981
|
}
|
|
975
|
-
return
|
|
982
|
+
return a.length === 0 ? `${t.cellAddress}.${o}` : `${a.join("_")}.${o}`;
|
|
976
983
|
}
|
|
977
|
-
async saveImages(
|
|
978
|
-
var
|
|
979
|
-
const
|
|
980
|
-
for (const
|
|
981
|
-
let
|
|
982
|
-
const
|
|
983
|
-
|
|
984
|
+
async saveImages(t, e) {
|
|
985
|
+
var s;
|
|
986
|
+
const n = await window.showDirectoryPicker({ mode: "readwrite" }), r = /* @__PURE__ */ new Map();
|
|
987
|
+
for (const o of t) {
|
|
988
|
+
let a = this.generateFileName(o, e);
|
|
989
|
+
const d = a.replace(/\.\w+$/, ""), u = ((s = a.match(/\.\w+$/)) == null ? void 0 : s[0]) || ".png", c = r.get(d) || 0;
|
|
990
|
+
c > 0 && (a = `${d}_${c}${u}`), r.set(d, c + 1);
|
|
984
991
|
try {
|
|
985
|
-
const
|
|
986
|
-
await
|
|
987
|
-
} catch (
|
|
988
|
-
throw console.error(`Failed to save image ${
|
|
992
|
+
const l = await this._getImageBlob(o), h = await (await n.getFileHandle(a, { create: !0 })).createWritable();
|
|
993
|
+
await h.write(l), await h.close();
|
|
994
|
+
} catch (l) {
|
|
995
|
+
throw console.error(`Failed to save image ${a}:`, l), l;
|
|
989
996
|
}
|
|
990
997
|
}
|
|
991
998
|
}
|
|
992
|
-
async saveImagesWithContext(
|
|
993
|
-
var
|
|
994
|
-
const
|
|
995
|
-
for (const
|
|
996
|
-
let
|
|
997
|
-
const
|
|
998
|
-
|
|
999
|
+
async saveImagesWithContext(t, e, n, r) {
|
|
1000
|
+
var a;
|
|
1001
|
+
const s = await window.showDirectoryPicker({ mode: "readwrite" }), o = /* @__PURE__ */ new Map();
|
|
1002
|
+
for (const d of t) {
|
|
1003
|
+
let u = this.generateFileNameWithContext(d, e, n, r);
|
|
1004
|
+
const c = u.replace(/\.\w+$/, ""), l = ((a = u.match(/\.\w+$/)) == null ? void 0 : a[0]) || ".png", g = o.get(c) || 0;
|
|
1005
|
+
g > 0 && (u = `${c}_${g}${l}`), o.set(c, g + 1);
|
|
999
1006
|
try {
|
|
1000
|
-
const
|
|
1001
|
-
await
|
|
1002
|
-
} catch (
|
|
1003
|
-
throw console.error(`Failed to save image ${
|
|
1007
|
+
const h = await this._getImageBlob(d), p = await (await s.getFileHandle(u, { create: !0 })).createWritable();
|
|
1008
|
+
await p.write(h), await p.close();
|
|
1009
|
+
} catch (h) {
|
|
1010
|
+
throw console.error(`Failed to save image ${u}:`, h), h;
|
|
1004
1011
|
}
|
|
1005
1012
|
}
|
|
1006
1013
|
}
|
|
1007
|
-
async downloadSingleImage(
|
|
1008
|
-
const
|
|
1014
|
+
async downloadSingleImage(t) {
|
|
1015
|
+
const e = cn(t.source, t.imageSourceType), n = `${t.cellAddress}.${e}`;
|
|
1009
1016
|
try {
|
|
1010
|
-
const
|
|
1011
|
-
|
|
1012
|
-
} catch (
|
|
1013
|
-
throw console.error(`Failed to download image ${
|
|
1017
|
+
const r = await this._getImageBlob(t), s = URL.createObjectURL(r), o = document.createElement("a");
|
|
1018
|
+
o.href = s, o.download = n, document.body.appendChild(o), o.click(), document.body.removeChild(o), URL.revokeObjectURL(s);
|
|
1019
|
+
} catch (r) {
|
|
1020
|
+
throw console.error(`Failed to download image ${n}:`, r), r;
|
|
1014
1021
|
}
|
|
1015
1022
|
}
|
|
1016
|
-
async _getImageBlob(
|
|
1017
|
-
if (
|
|
1018
|
-
const
|
|
1019
|
-
return
|
|
1023
|
+
async _getImageBlob(t) {
|
|
1024
|
+
if (t.imageSourceType === de.UUID) {
|
|
1025
|
+
const e = await this._imageIoService.getImage(t.source);
|
|
1026
|
+
return dn(e, de.URL);
|
|
1020
1027
|
}
|
|
1021
|
-
|
|
1028
|
+
if (t.imageSourceType === de.URL && this._urlImageDownloader)
|
|
1029
|
+
try {
|
|
1030
|
+
const e = await this._urlImageDownloader(t.source);
|
|
1031
|
+
return dn(e, de.BASE64);
|
|
1032
|
+
} catch (e) {
|
|
1033
|
+
console.error(`Custom downloader failed for ${t.source}, falling back to default fetch:`, e);
|
|
1034
|
+
}
|
|
1035
|
+
return dn(t.source, t.imageSourceType);
|
|
1022
1036
|
}
|
|
1023
1037
|
};
|
|
1024
|
-
|
|
1025
|
-
an(0,
|
|
1038
|
+
In = As([
|
|
1039
|
+
an(0, le),
|
|
1026
1040
|
an(1, A(ut)),
|
|
1027
1041
|
an(2, hr)
|
|
1028
|
-
],
|
|
1042
|
+
], In);
|
|
1029
1043
|
const ze = "sheet.dialog.batch-save-images", ct = {
|
|
1030
1044
|
id: "sheet.command.save-cell-images",
|
|
1031
1045
|
type: q.COMMAND,
|
|
1032
1046
|
handler: async (i) => {
|
|
1033
|
-
const t = i.get(
|
|
1047
|
+
const t = i.get(Mn), e = i.get(En), n = e.getCellImagesInSelection();
|
|
1034
1048
|
if (n.length === 1)
|
|
1035
1049
|
try {
|
|
1036
1050
|
return await e.downloadSingleImage(n[0]), !0;
|
|
@@ -1055,7 +1069,7 @@ const ze = "sheet.dialog.batch-save-images", ct = {
|
|
|
1055
1069
|
id: "sidebar.operation.sheet-image",
|
|
1056
1070
|
type: q.COMMAND,
|
|
1057
1071
|
handler: async (i, t) => {
|
|
1058
|
-
const e = i.get(
|
|
1072
|
+
const e = i.get(cs), n = i.get(Te), r = i.get(le), s = i.get(G);
|
|
1059
1073
|
return se(r) ? (t.value === "open" ? e.open({
|
|
1060
1074
|
header: { title: n.t("sheetImage.panel.title") },
|
|
1061
1075
|
children: { label: Br },
|
|
@@ -1072,20 +1086,20 @@ const ze = "sheet.dialog.batch-save-images", ct = {
|
|
|
1072
1086
|
const e = i.get(G);
|
|
1073
1087
|
return t == null ? !1 : (e.syncExecuteCommand(Vt.id, [t]), e.executeCommand(jr.id, { value: "open" }), !0);
|
|
1074
1088
|
}
|
|
1075
|
-
},
|
|
1076
|
-
var
|
|
1077
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1089
|
+
}, ks = "sheets-drawing-ui.config", sr = {};
|
|
1090
|
+
var $s = Object.getOwnPropertyDescriptor, xs = (i, t, e, n) => {
|
|
1091
|
+
for (var r = n > 1 ? void 0 : n ? $s(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
1078
1092
|
(o = i[s]) && (r = o(r) || r);
|
|
1079
1093
|
return r;
|
|
1080
1094
|
}, ce = (i, t) => (e, n) => t(e, n, i);
|
|
1081
|
-
let Nt = class extends
|
|
1095
|
+
let Nt = class extends fi {
|
|
1082
1096
|
constructor(t, e, n, r, s, o, a, d, u, c) {
|
|
1083
1097
|
super();
|
|
1084
|
-
|
|
1098
|
+
Q(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
|
|
1085
1099
|
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();
|
|
1086
1100
|
}
|
|
1087
1101
|
_init() {
|
|
1088
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(k.UNIVER_SHEET).pipe(
|
|
1102
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(k.UNIVER_SHEET).pipe(er(this.dispose$)).subscribe((t) => this._create(t)), this._univerInstanceService.getTypeOfUnitDisposed$(k.UNIVER_SHEET).pipe(er(this.dispose$)).subscribe((t) => this._dispose(t)), this._univerInstanceService.getAllUnitsForType(k.UNIVER_SHEET).forEach((t) => this._create(t)), this._setupLoadingStatus();
|
|
1089
1103
|
}
|
|
1090
1104
|
_setupLoadingStatus() {
|
|
1091
1105
|
const t = "image-upload-loading";
|
|
@@ -1093,7 +1107,7 @@ let Nt = class extends mi {
|
|
|
1093
1107
|
this.disposeWithMe(this._ioService.change$.subscribe((n) => {
|
|
1094
1108
|
n > 0 && !e ? e = this._messageService.show({
|
|
1095
1109
|
id: t,
|
|
1096
|
-
type:
|
|
1110
|
+
type: ve.Loading,
|
|
1097
1111
|
content: `${this._localeService.t("uploadLoading.loading")}: ${n}`,
|
|
1098
1112
|
duration: 0
|
|
1099
1113
|
}) : n === 0 && (e == null || e.dispose(), e = void 0);
|
|
@@ -1113,7 +1127,7 @@ let Nt = class extends mi {
|
|
|
1113
1127
|
_hasCropObject(t) {
|
|
1114
1128
|
const e = t.getAllObjectsByOrder();
|
|
1115
1129
|
for (const n of e)
|
|
1116
|
-
if (n instanceof
|
|
1130
|
+
if (n instanceof _s)
|
|
1117
1131
|
return !0;
|
|
1118
1132
|
return !1;
|
|
1119
1133
|
}
|
|
@@ -1145,13 +1159,13 @@ let Nt = class extends mi {
|
|
|
1145
1159
|
if (m && m.disablePopup)
|
|
1146
1160
|
return;
|
|
1147
1161
|
r == null || r.dispose();
|
|
1148
|
-
const
|
|
1162
|
+
const p = this._canvasPopManagerService.getFeatureMenu(c, l, g, h);
|
|
1149
1163
|
r = this.disposeWithMe(this._canvasPopManagerService.attachPopupToObject(a, {
|
|
1150
|
-
componentKey:
|
|
1164
|
+
componentKey: Ss,
|
|
1151
1165
|
direction: "horizontal",
|
|
1152
1166
|
offset: [2, 0],
|
|
1153
1167
|
extraProps: {
|
|
1154
|
-
menuItems:
|
|
1168
|
+
menuItems: p || this._getImageMenuItems(c, l, g, h)
|
|
1155
1169
|
}
|
|
1156
1170
|
}));
|
|
1157
1171
|
})
|
|
@@ -1188,45 +1202,45 @@ let Nt = class extends mi {
|
|
|
1188
1202
|
{
|
|
1189
1203
|
label: "image-popup.crop",
|
|
1190
1204
|
index: 2,
|
|
1191
|
-
commandId:
|
|
1205
|
+
commandId: vs.id,
|
|
1192
1206
|
commandParams: { unitId: t, subUnitId: e, drawingId: n },
|
|
1193
1207
|
disable: r === x.DRAWING_DOM
|
|
1194
1208
|
},
|
|
1195
1209
|
{
|
|
1196
1210
|
label: "image-popup.reset",
|
|
1197
1211
|
index: 3,
|
|
1198
|
-
commandId:
|
|
1212
|
+
commandId: Is.id,
|
|
1199
1213
|
commandParams: [{ unitId: t, subUnitId: e, drawingId: n }],
|
|
1200
1214
|
disable: r === x.DRAWING_DOM
|
|
1201
1215
|
}
|
|
1202
1216
|
];
|
|
1203
1217
|
}
|
|
1204
1218
|
};
|
|
1205
|
-
Nt =
|
|
1219
|
+
Nt = xs([
|
|
1206
1220
|
ce(0, A(qe)),
|
|
1207
1221
|
ce(1, A(Te)),
|
|
1208
1222
|
ce(2, ae),
|
|
1209
1223
|
ce(3, A(ni)),
|
|
1210
|
-
ce(4,
|
|
1211
|
-
ce(5,
|
|
1224
|
+
ce(4, ee),
|
|
1225
|
+
ce(5, le),
|
|
1212
1226
|
ce(6, Ur),
|
|
1213
1227
|
ce(7, ur),
|
|
1214
1228
|
ce(8, hr),
|
|
1215
1229
|
ce(9, G)
|
|
1216
1230
|
], Nt);
|
|
1217
|
-
var
|
|
1218
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1231
|
+
var Ws = Object.getOwnPropertyDescriptor, Bs = (i, t, e, n) => {
|
|
1232
|
+
for (var r = n > 1 ? void 0 : n ? Ws(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
1219
1233
|
(o = i[s]) && (r = o(r) || r);
|
|
1220
1234
|
return r;
|
|
1221
1235
|
}, Tt = (i, t) => (e, n) => t(e, n, i);
|
|
1222
|
-
let
|
|
1236
|
+
let Cn = class extends te {
|
|
1223
1237
|
constructor(t, e, n, r, s) {
|
|
1224
1238
|
super();
|
|
1225
|
-
|
|
1239
|
+
Q(this, "_isSetCursor", !1);
|
|
1226
1240
|
this._context = t, this._hoverManagerService = e, this._selectionsService = n, this._drawingRenderService = r, this._sheetSkeletonManagerService = s, this._initHover(), this._initImageClick();
|
|
1227
1241
|
}
|
|
1228
1242
|
_initHover() {
|
|
1229
|
-
this.disposeWithMe(this._hoverManagerService.currentRichTextNoDistinct$.pipe(
|
|
1243
|
+
this.disposeWithMe(this._hoverManagerService.currentRichTextNoDistinct$.pipe(Ds(33)).subscribe((t) => {
|
|
1230
1244
|
var n, r;
|
|
1231
1245
|
let e = [];
|
|
1232
1246
|
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(ei.ZOOM_IN)) : this._isSetCursor && (this._isSetCursor = !1, this._context.scene.resetCursor());
|
|
@@ -1243,18 +1257,18 @@ let In = class extends ee {
|
|
|
1243
1257
|
}));
|
|
1244
1258
|
}
|
|
1245
1259
|
};
|
|
1246
|
-
|
|
1260
|
+
Cn = Bs([
|
|
1247
1261
|
Tt(1, A(ri)),
|
|
1248
1262
|
Tt(2, A(ut)),
|
|
1249
1263
|
Tt(3, A(Ar)),
|
|
1250
1264
|
Tt(4, A(X))
|
|
1251
|
-
],
|
|
1252
|
-
var
|
|
1253
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1265
|
+
], Cn);
|
|
1266
|
+
var js = Object.getOwnPropertyDescriptor, Fs = (i, t, e, n) => {
|
|
1267
|
+
for (var r = n > 1 ? void 0 : n ? js(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
1254
1268
|
(o = i[s]) && (r = o(r) || r);
|
|
1255
1269
|
return r;
|
|
1256
1270
|
}, Ot = (i, t) => (e, n) => t(e, n, i);
|
|
1257
|
-
let
|
|
1271
|
+
let Rn = class extends te {
|
|
1258
1272
|
constructor(i, t, e, n, r) {
|
|
1259
1273
|
super(), this._context = i, this._sheetDrawingService = t, this._drawingManagerService = e, this._sheetSelectionRenderService = n, this._sheetSkeletonManagerService = r, this._init();
|
|
1260
1274
|
}
|
|
@@ -1274,21 +1288,21 @@ let Cn = class extends ee {
|
|
|
1274
1288
|
this._drawingManagerService.registerDrawingData(this._context.unitId, this._sheetDrawingService.getDrawingDataForUnit(this._context.unitId)), this._drawingManagerService.initializeNotification(this._context.unitId);
|
|
1275
1289
|
}
|
|
1276
1290
|
};
|
|
1277
|
-
|
|
1291
|
+
Rn = Fs([
|
|
1278
1292
|
Ot(1, oe),
|
|
1279
1293
|
Ot(2, ae),
|
|
1280
1294
|
Ot(3, A(Je)),
|
|
1281
1295
|
Ot(4, A(X))
|
|
1282
|
-
],
|
|
1283
|
-
var
|
|
1284
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1296
|
+
], Rn);
|
|
1297
|
+
var Ls = Object.getOwnPropertyDescriptor, Hs = (i, t, e, n) => {
|
|
1298
|
+
for (var r = n > 1 ? void 0 : n ? Ls(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
1285
1299
|
(o = i[s]) && (r = o(r) || r);
|
|
1286
1300
|
return r;
|
|
1287
1301
|
}, We = (i, t) => (e, n) => t(e, n, i);
|
|
1288
1302
|
function Lr(i, t, e) {
|
|
1289
1303
|
var n, r, s, o;
|
|
1290
1304
|
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) {
|
|
1291
|
-
const a = e.p.drawings[e.p.drawingsOrder[0]], d =
|
|
1305
|
+
const a = e.p.drawings[e.p.drawingsOrder[0]], d = Sn(
|
|
1292
1306
|
i,
|
|
1293
1307
|
{
|
|
1294
1308
|
unitId: t.unitId,
|
|
@@ -1305,7 +1319,7 @@ function Lr(i, t, e) {
|
|
|
1305
1319
|
}
|
|
1306
1320
|
return !1;
|
|
1307
1321
|
}
|
|
1308
|
-
let kt = class extends
|
|
1322
|
+
let kt = class extends te {
|
|
1309
1323
|
constructor(i, t, e, n, r, s) {
|
|
1310
1324
|
super(), this._commandService = i, this._sheetInterceptorService = t, this._injector = e, this._drawingManagerService = n, this._docDrawingController = r, this._editorBridgeService = s, this._handleInitEditor(), this._initCellContentInterceptor();
|
|
1311
1325
|
}
|
|
@@ -1313,16 +1327,16 @@ let kt = class extends ee {
|
|
|
1313
1327
|
this.disposeWithMe(this._editorBridgeService.visible$.subscribe((i) => {
|
|
1314
1328
|
i.visible ? i.visible && (this._drawingManagerService.removeDrawingDataForUnit(ot), this._docDrawingController.loadDrawingDataForUnit(ot), this._drawingManagerService.initializeNotification(ot)) : this._drawingManagerService.removeDrawingDataForUnit(ot);
|
|
1315
1329
|
})), this.disposeWithMe(this._commandService.onCommandExecuted((i) => {
|
|
1316
|
-
i.id ===
|
|
1330
|
+
i.id === ns.id && i.params.unitId === Ve && (this._drawingManagerService.removeDrawingDataForUnit(Ve), this._docDrawingController.loadDrawingDataForUnit(Ve), this._drawingManagerService.initializeNotification(Ve));
|
|
1317
1331
|
}));
|
|
1318
1332
|
}
|
|
1319
1333
|
_initCellContentInterceptor() {
|
|
1320
1334
|
this.disposeWithMe(
|
|
1321
1335
|
this._sheetInterceptorService.intercept(
|
|
1322
|
-
|
|
1336
|
+
$i.CELL_CONTENT,
|
|
1323
1337
|
{
|
|
1324
|
-
effect:
|
|
1325
|
-
priority:
|
|
1338
|
+
effect: pi.Style,
|
|
1339
|
+
priority: xi.CELL_IMAGE,
|
|
1326
1340
|
handler: (i, t, e) => {
|
|
1327
1341
|
var n;
|
|
1328
1342
|
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);
|
|
@@ -1332,20 +1346,20 @@ let kt = class extends ee {
|
|
|
1332
1346
|
);
|
|
1333
1347
|
}
|
|
1334
1348
|
};
|
|
1335
|
-
kt =
|
|
1349
|
+
kt = Hs([
|
|
1336
1350
|
We(0, G),
|
|
1337
1351
|
We(1, A(Ht)),
|
|
1338
1352
|
We(2, A(qe)),
|
|
1339
1353
|
We(3, ae),
|
|
1340
|
-
We(4, A(
|
|
1354
|
+
We(4, A(ps)),
|
|
1341
1355
|
We(5, A(ii))
|
|
1342
1356
|
], kt);
|
|
1343
|
-
var
|
|
1344
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1357
|
+
var Vs = Object.getOwnPropertyDescriptor, Gs = (i, t, e, n) => {
|
|
1358
|
+
for (var r = n > 1 ? void 0 : n ? Vs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
1345
1359
|
(o = i[s]) && (r = o(r) || r);
|
|
1346
1360
|
return r;
|
|
1347
1361
|
}, or = (i, t) => (e, n) => t(e, n, i);
|
|
1348
|
-
let $t = class extends
|
|
1362
|
+
let $t = class extends te {
|
|
1349
1363
|
constructor(i, t) {
|
|
1350
1364
|
super(), this._autoFillService = i, this._injector = t, this._initAutoFillHooks();
|
|
1351
1365
|
}
|
|
@@ -1354,7 +1368,7 @@ let $t = class extends ee {
|
|
|
1354
1368
|
this._autoFillService.addHook({
|
|
1355
1369
|
id: "sheet-cell-image-autofill",
|
|
1356
1370
|
onBeforeSubmit: (i, t, e, n) => {
|
|
1357
|
-
new
|
|
1371
|
+
new wi(n).forValue((r, s, o) => {
|
|
1358
1372
|
Lr(this._injector, { unitId: i.unitId, subUnitId: i.subUnitId, row: r, col: s }, o);
|
|
1359
1373
|
});
|
|
1360
1374
|
}
|
|
@@ -1362,27 +1376,27 @@ let $t = class extends ee {
|
|
|
1362
1376
|
);
|
|
1363
1377
|
}
|
|
1364
1378
|
};
|
|
1365
|
-
$t =
|
|
1379
|
+
$t = Gs([
|
|
1366
1380
|
or(0, A(si)),
|
|
1367
1381
|
or(1, A(qe))
|
|
1368
1382
|
], $t);
|
|
1369
|
-
var
|
|
1370
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1383
|
+
var Ys = Object.getOwnPropertyDescriptor, Xs = (i, t, e, n) => {
|
|
1384
|
+
for (var r = n > 1 ? void 0 : n ? Ys(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
1371
1385
|
(o = i[s]) && (r = o(r) || r);
|
|
1372
1386
|
return r;
|
|
1373
1387
|
}, nt = (i, t) => (e, n) => t(e, n, i);
|
|
1374
|
-
const
|
|
1388
|
+
const zs = [
|
|
1375
1389
|
ot,
|
|
1376
|
-
|
|
1390
|
+
_i,
|
|
1377
1391
|
Ve
|
|
1378
1392
|
];
|
|
1379
|
-
let xt = class extends
|
|
1393
|
+
let xt = class extends te {
|
|
1380
1394
|
constructor(i, t, e, n, r) {
|
|
1381
1395
|
super(), this._commandService = i, this._univerInstanceService = t, this._dialogService = e, this._renderManagerService = n, this._localeService = r, this._initDocImageCopyPasteHooks();
|
|
1382
1396
|
}
|
|
1383
1397
|
_setCellImage(i) {
|
|
1384
1398
|
var r;
|
|
1385
|
-
const t =
|
|
1399
|
+
const t = hn("", {}), e = (r = bn(k.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : r.with(oi), n = gn.drawing.add({
|
|
1386
1400
|
documentDataModel: t,
|
|
1387
1401
|
drawings: [i],
|
|
1388
1402
|
selection: {
|
|
@@ -1397,20 +1411,20 @@ let xt = class extends ee {
|
|
|
1397
1411
|
this.disposeWithMe(
|
|
1398
1412
|
this._commandService.beforeCommandExecuted((i) => {
|
|
1399
1413
|
var t, e;
|
|
1400
|
-
if (i.id ===
|
|
1414
|
+
if (i.id === rs.id) {
|
|
1401
1415
|
const n = i.params, { doc: r } = n, s = this._univerInstanceService.getCurrentUnitOfType(k.UNIVER_DOC);
|
|
1402
1416
|
if (s == null || !Object.keys((t = r.drawings) != null ? t : {}).length)
|
|
1403
1417
|
return;
|
|
1404
1418
|
const o = s.getUnitId();
|
|
1405
|
-
if (
|
|
1419
|
+
if (zs.includes(o)) {
|
|
1406
1420
|
if (o !== Ve) {
|
|
1407
1421
|
const a = () => {
|
|
1408
|
-
this._dialogService.close("sheet-cell-image-copy-paste"), this._commandService.syncExecuteCommand(
|
|
1422
|
+
this._dialogService.close("sheet-cell-image-copy-paste"), this._commandService.syncExecuteCommand(kn.id, {
|
|
1409
1423
|
visible: !1
|
|
1410
1424
|
});
|
|
1411
1425
|
};
|
|
1412
1426
|
((e = s.getBody()) == null ? void 0 : e.dataStream) === `\r
|
|
1413
|
-
` ? (this._commandService.syncExecuteCommand(
|
|
1427
|
+
` ? (this._commandService.syncExecuteCommand(kn.id, {
|
|
1414
1428
|
visible: !1
|
|
1415
1429
|
}), this._setCellImage(Object.values(r.drawings)[0])) : this._dialogService.open({
|
|
1416
1430
|
id: "sheet-cell-image-copy-paste",
|
|
@@ -1438,32 +1452,32 @@ let xt = class extends ee {
|
|
|
1438
1452
|
);
|
|
1439
1453
|
}
|
|
1440
1454
|
};
|
|
1441
|
-
xt =
|
|
1455
|
+
xt = Xs([
|
|
1442
1456
|
nt(0, G),
|
|
1443
|
-
nt(1,
|
|
1444
|
-
nt(2,
|
|
1445
|
-
nt(3,
|
|
1457
|
+
nt(1, le),
|
|
1458
|
+
nt(2, Mn),
|
|
1459
|
+
nt(3, ee),
|
|
1446
1460
|
nt(4, A(Te))
|
|
1447
1461
|
], xt);
|
|
1448
|
-
var
|
|
1449
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1462
|
+
var Ks = Object.getOwnPropertyDescriptor, Js = (i, t, e, n) => {
|
|
1463
|
+
for (var r = n > 1 ? void 0 : n ? Ks(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
1450
1464
|
(o = i[s]) && (r = o(r) || r);
|
|
1451
1465
|
return r;
|
|
1452
1466
|
}, rt = (i, t) => (e, n) => t(e, n, i);
|
|
1453
1467
|
const Hr = "image/png";
|
|
1454
|
-
function
|
|
1468
|
+
function Zs(i) {
|
|
1455
1469
|
const t = i.split(","), e = atob(t[1]), n = e.length, r = new Uint8Array(n);
|
|
1456
1470
|
for (let s = 0; s < n; s++)
|
|
1457
1471
|
r[s] = e.charCodeAt(s);
|
|
1458
1472
|
return new Blob([r], { type: Hr });
|
|
1459
1473
|
}
|
|
1460
|
-
function
|
|
1461
|
-
const t = new ClipboardItem({ [Hr]:
|
|
1474
|
+
function qs(i) {
|
|
1475
|
+
const t = new ClipboardItem({ [Hr]: Zs(i) });
|
|
1462
1476
|
navigator.clipboard.write([t]).catch((e) => {
|
|
1463
1477
|
console.error("Could not copy image using clipboard API: ", e);
|
|
1464
1478
|
});
|
|
1465
1479
|
}
|
|
1466
|
-
function
|
|
1480
|
+
function Qs() {
|
|
1467
1481
|
function i() {
|
|
1468
1482
|
const n = document.createElement("input");
|
|
1469
1483
|
return n.style.position = "absolute", n.style.height = "1px", n.style.width = "1px", n.style.opacity = "0", n;
|
|
@@ -1479,10 +1493,10 @@ const ar = [
|
|
|
1479
1493
|
Le.SPECIAL_PASTE_FORMAT,
|
|
1480
1494
|
Le.SPECIAL_PASTE_FORMULA
|
|
1481
1495
|
];
|
|
1482
|
-
let Wt = class extends
|
|
1496
|
+
let Wt = class extends te {
|
|
1483
1497
|
constructor(t, e, n, r, s) {
|
|
1484
1498
|
super();
|
|
1485
|
-
|
|
1499
|
+
Q(this, "_copyInfo");
|
|
1486
1500
|
this._sheetClipboardService = t, this._renderManagerService = e, this._drawingService = n, this._clipboardInterfaceService = r, this._commandService = s, this._initCopyPaste();
|
|
1487
1501
|
}
|
|
1488
1502
|
get _focusedDrawings() {
|
|
@@ -1507,8 +1521,8 @@ let Wt = class extends ee {
|
|
|
1507
1521
|
this._commandService.executeCommand(ht.id, d);
|
|
1508
1522
|
}
|
|
1509
1523
|
setTimeout(() => {
|
|
1510
|
-
const d =
|
|
1511
|
-
o.drawingType === x.DRAWING_IMAGE && o.imageSourceType ===
|
|
1524
|
+
const d = Qs();
|
|
1525
|
+
o.drawingType === x.DRAWING_IMAGE && o.imageSourceType === ss.BASE64 ? qs(o.source) : this._clipboardInterfaceService.writeText(""), d();
|
|
1512
1526
|
}, 200);
|
|
1513
1527
|
const a = {
|
|
1514
1528
|
unitId: o.unitId,
|
|
@@ -1561,16 +1575,16 @@ let Wt = class extends ee {
|
|
|
1561
1575
|
const m = c[h];
|
|
1562
1576
|
if (m.drawingType !== x.DRAWING_IMAGE)
|
|
1563
1577
|
return;
|
|
1564
|
-
const { transform:
|
|
1565
|
-
if (m.anchorType !== O.Both || !
|
|
1578
|
+
const { transform: p } = m;
|
|
1579
|
+
if (m.anchorType !== O.Both || !p)
|
|
1566
1580
|
return;
|
|
1567
|
-
const { left:
|
|
1568
|
-
drawingStartX:
|
|
1569
|
-
drawingEndX:
|
|
1581
|
+
const { left: f = 0, top: w = 0, width: _ = 0, height: I = 0 } = p, { drawingStartX: R, drawingEndX: v, drawingStartY: C, drawingEndY: S } = {
|
|
1582
|
+
drawingStartX: f,
|
|
1583
|
+
drawingEndX: f + _,
|
|
1570
1584
|
drawingStartY: w,
|
|
1571
1585
|
drawingEndY: w + I
|
|
1572
1586
|
};
|
|
1573
|
-
o <=
|
|
1587
|
+
o <= R && v <= a && d <= C && S <= u && l.push(m);
|
|
1574
1588
|
}), l.length)
|
|
1575
1589
|
return {
|
|
1576
1590
|
copyRange: n,
|
|
@@ -1586,26 +1600,26 @@ let Wt = class extends ee {
|
|
|
1586
1600
|
const { unitId: s, subUnitId: o, range: a } = r, d = this._renderManagerService.getRenderById(s), u = d == null ? void 0 : d.with(X), c = d == null ? void 0 : d.with(Je), l = this._copyInfo;
|
|
1587
1601
|
if (!u || !c)
|
|
1588
1602
|
return { redos: [], undos: [] };
|
|
1589
|
-
const { drawings: g } = l, h =
|
|
1603
|
+
const { drawings: g } = l, h = $n(a);
|
|
1590
1604
|
return this._generateMutations(g, {
|
|
1591
1605
|
unitId: s,
|
|
1592
1606
|
subUnitId: o,
|
|
1593
1607
|
isCut: e === Re.CUT,
|
|
1594
|
-
getTransform: (m,
|
|
1595
|
-
var
|
|
1596
|
-
const
|
|
1608
|
+
getTransform: (m, p) => {
|
|
1609
|
+
var _;
|
|
1610
|
+
const f = u.attachRangeWithCoord({
|
|
1597
1611
|
startRow: h.startRow,
|
|
1598
1612
|
endRow: h.endRow,
|
|
1599
1613
|
startColumn: h.startColumn,
|
|
1600
1614
|
endColumn: h.endColumn
|
|
1601
1615
|
}), w = {
|
|
1602
1616
|
...m,
|
|
1603
|
-
left:
|
|
1604
|
-
top:
|
|
1617
|
+
left: f == null ? void 0 : f.startX,
|
|
1618
|
+
top: f == null ? void 0 : f.startY
|
|
1605
1619
|
};
|
|
1606
1620
|
return {
|
|
1607
1621
|
transform: w,
|
|
1608
|
-
sheetTransform: (
|
|
1622
|
+
sheetTransform: (_ = j(w, c)) != null ? _ : p
|
|
1609
1623
|
};
|
|
1610
1624
|
}
|
|
1611
1625
|
});
|
|
@@ -1630,14 +1644,14 @@ let Wt = class extends ee {
|
|
|
1630
1644
|
sheetTransform: h.sheetTransform
|
|
1631
1645
|
};
|
|
1632
1646
|
if (o) {
|
|
1633
|
-
const { undo:
|
|
1647
|
+
const { undo: p, redo: f, objects: w } = u.getBatchUpdateOp([m]);
|
|
1634
1648
|
a.push({
|
|
1635
1649
|
id: P.id,
|
|
1636
1650
|
params: {
|
|
1637
1651
|
unitId: n,
|
|
1638
1652
|
subUnitId: r,
|
|
1639
1653
|
type: U.UPDATE,
|
|
1640
|
-
op:
|
|
1654
|
+
op: f,
|
|
1641
1655
|
objects: w
|
|
1642
1656
|
}
|
|
1643
1657
|
}), d.push({
|
|
@@ -1646,13 +1660,13 @@ let Wt = class extends ee {
|
|
|
1646
1660
|
unitId: n,
|
|
1647
1661
|
subUnitId: r,
|
|
1648
1662
|
type: U.UPDATE,
|
|
1649
|
-
op:
|
|
1663
|
+
op: p,
|
|
1650
1664
|
objects: w
|
|
1651
1665
|
}
|
|
1652
1666
|
});
|
|
1653
1667
|
} else {
|
|
1654
|
-
const { undo:
|
|
1655
|
-
a.push({ id: P.id, params: { op:
|
|
1668
|
+
const { undo: p, redo: f, objects: w } = u.getBatchAddOp([m]);
|
|
1669
|
+
a.push({ id: P.id, params: { op: f, unitId: n, subUnitId: r, objects: w, type: U.INSERT } }), d.push({ id: P.id, params: { op: p, unitId: n, subUnitId: r, objects: w, type: U.REMOVE } });
|
|
1656
1670
|
}
|
|
1657
1671
|
}), { redos: a, undos: d };
|
|
1658
1672
|
}
|
|
@@ -1676,45 +1690,45 @@ let Wt = class extends ee {
|
|
|
1676
1690
|
const { drawings: c } = this._copyInfo;
|
|
1677
1691
|
if (!a)
|
|
1678
1692
|
return this._generateSingleDrawingPasteMutations({
|
|
1679
|
-
pasteTo: { unitId: n, subUnitId: r, range:
|
|
1693
|
+
pasteTo: { unitId: n, subUnitId: r, range: $n(o) },
|
|
1680
1694
|
pasteType: s
|
|
1681
1695
|
}, d);
|
|
1682
|
-
const { ranges: [l, g], mapFunc: h } = ai([a, o]), { row: m, col:
|
|
1696
|
+
const { ranges: [l, g], mapFunc: h } = ai([a, o]), { row: m, col: p } = h(l.startRow, l.startColumn), { row: f, col: w } = h(g.startRow, g.startColumn), _ = u.attachRangeWithCoord({
|
|
1683
1697
|
startRow: m,
|
|
1684
1698
|
endRow: m,
|
|
1685
|
-
startColumn:
|
|
1686
|
-
endColumn:
|
|
1699
|
+
startColumn: p,
|
|
1700
|
+
endColumn: p
|
|
1687
1701
|
}), I = u.attachRangeWithCoord({
|
|
1688
|
-
startRow:
|
|
1689
|
-
endRow:
|
|
1702
|
+
startRow: f,
|
|
1703
|
+
endRow: f,
|
|
1690
1704
|
startColumn: w,
|
|
1691
1705
|
endColumn: w
|
|
1692
1706
|
});
|
|
1693
|
-
if (!
|
|
1707
|
+
if (!_ || !I || !this._copyInfo)
|
|
1694
1708
|
return { redos: [], undos: [] };
|
|
1695
|
-
const
|
|
1709
|
+
const R = I.startX - _.startX, v = I.startY - _.startY, C = f - m, S = w - p;
|
|
1696
1710
|
return this._generateMutations(c, {
|
|
1697
1711
|
unitId: n,
|
|
1698
1712
|
subUnitId: r,
|
|
1699
|
-
getTransform: (
|
|
1713
|
+
getTransform: (D, E) => {
|
|
1700
1714
|
var T, M;
|
|
1701
1715
|
return {
|
|
1702
1716
|
transform: {
|
|
1703
|
-
...
|
|
1704
|
-
left: ((T =
|
|
1705
|
-
top: ((M =
|
|
1717
|
+
...D,
|
|
1718
|
+
left: ((T = D == null ? void 0 : D.left) != null ? T : 0) + R,
|
|
1719
|
+
top: ((M = D == null ? void 0 : D.top) != null ? M : 0) + v
|
|
1706
1720
|
},
|
|
1707
1721
|
sheetTransform: {
|
|
1708
1722
|
...E,
|
|
1709
1723
|
to: {
|
|
1710
1724
|
...E.to,
|
|
1711
1725
|
row: E.to.row + C,
|
|
1712
|
-
column: E.to.column +
|
|
1726
|
+
column: E.to.column + S
|
|
1713
1727
|
},
|
|
1714
1728
|
from: {
|
|
1715
1729
|
...E.from,
|
|
1716
1730
|
row: E.from.row + C,
|
|
1717
|
-
column: E.from.column +
|
|
1731
|
+
column: E.from.column + S
|
|
1718
1732
|
}
|
|
1719
1733
|
}
|
|
1720
1734
|
};
|
|
@@ -1723,19 +1737,19 @@ let Wt = class extends ee {
|
|
|
1723
1737
|
});
|
|
1724
1738
|
}
|
|
1725
1739
|
};
|
|
1726
|
-
Wt =
|
|
1740
|
+
Wt = Js([
|
|
1727
1741
|
rt(0, ci),
|
|
1728
|
-
rt(1,
|
|
1742
|
+
rt(1, ee),
|
|
1729
1743
|
rt(2, ae),
|
|
1730
|
-
rt(3,
|
|
1744
|
+
rt(3, ds),
|
|
1731
1745
|
rt(4, G)
|
|
1732
1746
|
], Wt);
|
|
1733
|
-
var
|
|
1734
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1747
|
+
var eo = Object.getOwnPropertyDescriptor, to = (i, t, e, n) => {
|
|
1748
|
+
for (var r = n > 1 ? void 0 : n ? eo(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
1735
1749
|
(o = i[s]) && (r = o(r) || r);
|
|
1736
1750
|
return r;
|
|
1737
1751
|
}, it = (i, t) => (e, n) => t(e, n, i);
|
|
1738
|
-
let Bt = class extends
|
|
1752
|
+
let Bt = class extends te {
|
|
1739
1753
|
constructor(i, t, e, n, r) {
|
|
1740
1754
|
super(), this._drawingManagerService = i, this._renderManagerService = t, this._permissionService = e, this._univerInstanceService = n, this._userManagerService = r, this._initDrawingVisible(), this._initDrawingEditable(), this._initViewPermissionChange(), this._initEditPermissionChange();
|
|
1741
1755
|
}
|
|
@@ -1743,19 +1757,19 @@ let Bt = class extends ee {
|
|
|
1743
1757
|
const i = this._univerInstanceService.getCurrentTypeOfUnit$(k.UNIVER_SHEET), t = this._userManagerService.currentUser$, e = at([i, t]);
|
|
1744
1758
|
this.disposeWithMe(
|
|
1745
1759
|
e.pipe(
|
|
1746
|
-
|
|
1747
|
-
|
|
1760
|
+
pe(([n, r]) => n ? n.activeSheet$.pipe(
|
|
1761
|
+
tr((s) => {
|
|
1748
1762
|
if (!s) {
|
|
1749
1763
|
this._drawingManagerService.setDrawingVisible(!1);
|
|
1750
1764
|
return;
|
|
1751
1765
|
}
|
|
1752
1766
|
const o = n.getUnitId(), a = s.getSheetId();
|
|
1753
1767
|
this._permissionService.composePermission([
|
|
1754
|
-
new
|
|
1755
|
-
new
|
|
1768
|
+
new Vn(o).id,
|
|
1769
|
+
new Gn(o, a).id
|
|
1756
1770
|
]).every((u) => u.value) ? this._drawingManagerService.setDrawingVisible(!0) : this._handleDrawingVisibilityFalse(n, s);
|
|
1757
1771
|
})
|
|
1758
|
-
) : (this._drawingManagerService.setDrawingVisible(!1),
|
|
1772
|
+
) : (this._drawingManagerService.setDrawingVisible(!1), _e))
|
|
1759
1773
|
).subscribe()
|
|
1760
1774
|
);
|
|
1761
1775
|
}
|
|
@@ -1772,19 +1786,19 @@ let Bt = class extends ee {
|
|
|
1772
1786
|
const i = this._univerInstanceService.getCurrentTypeOfUnit$(k.UNIVER_SHEET), t = this._userManagerService.currentUser$, e = at([i, t]);
|
|
1773
1787
|
this.disposeWithMe(
|
|
1774
1788
|
e.pipe(
|
|
1775
|
-
|
|
1776
|
-
|
|
1789
|
+
pe(([n, r]) => n ? n.activeSheet$.pipe(
|
|
1790
|
+
tr((s) => {
|
|
1777
1791
|
if (!s) {
|
|
1778
1792
|
this._drawingManagerService.setDrawingEditable(!1);
|
|
1779
1793
|
return;
|
|
1780
1794
|
}
|
|
1781
1795
|
const o = n.getUnitId(), a = s.getSheetId();
|
|
1782
1796
|
this._permissionService.composePermission([
|
|
1783
|
-
new
|
|
1784
|
-
new
|
|
1797
|
+
new mn(o).id,
|
|
1798
|
+
new fn(o, a).id
|
|
1785
1799
|
]).every((u) => u.value) ? this._drawingManagerService.setDrawingEditable(!0) : this._handleDrawingEditableFalse(n, s);
|
|
1786
1800
|
})
|
|
1787
|
-
) : (this._drawingManagerService.setDrawingEditable(!1),
|
|
1801
|
+
) : (this._drawingManagerService.setDrawingEditable(!1), _e))
|
|
1788
1802
|
).subscribe()
|
|
1789
1803
|
);
|
|
1790
1804
|
}
|
|
@@ -1801,22 +1815,22 @@ let Bt = class extends ee {
|
|
|
1801
1815
|
const i = this._univerInstanceService.getCurrentTypeOfUnit$(k.UNIVER_SHEET), t = this._userManagerService.currentUser$;
|
|
1802
1816
|
this.disposeWithMe(
|
|
1803
1817
|
at([i, t]).pipe(
|
|
1804
|
-
|
|
1805
|
-
|
|
1818
|
+
pe(([e, n]) => e ? e.activeSheet$.pipe(
|
|
1819
|
+
pe((r) => {
|
|
1806
1820
|
if (!r)
|
|
1807
|
-
return
|
|
1821
|
+
return _e;
|
|
1808
1822
|
const s = e.getUnitId(), o = r.getSheetId(), a = this._renderManagerService.getRenderById(s), d = a == null ? void 0 : a.scene;
|
|
1809
1823
|
if (!d)
|
|
1810
|
-
return
|
|
1824
|
+
return _e;
|
|
1811
1825
|
const u = d.getTransformerByCreate();
|
|
1812
1826
|
return this._permissionService.composePermission$([
|
|
1813
|
-
new
|
|
1814
|
-
new
|
|
1827
|
+
new Vn(s).id,
|
|
1828
|
+
new Gn(s, o).id
|
|
1815
1829
|
]).pipe(
|
|
1816
|
-
|
|
1817
|
-
|
|
1830
|
+
we((l) => l.every((g) => g.value)),
|
|
1831
|
+
nr()
|
|
1818
1832
|
).pipe(
|
|
1819
|
-
|
|
1833
|
+
we((l) => ({
|
|
1820
1834
|
permission: l,
|
|
1821
1835
|
scene: d,
|
|
1822
1836
|
transformer: u,
|
|
@@ -1825,7 +1839,7 @@ let Bt = class extends ee {
|
|
|
1825
1839
|
}))
|
|
1826
1840
|
);
|
|
1827
1841
|
})
|
|
1828
|
-
) :
|
|
1842
|
+
) : _e)
|
|
1829
1843
|
).subscribe({
|
|
1830
1844
|
next: ({ permission: e, scene: n, transformer: r, unitId: s, subUnitId: o }) => {
|
|
1831
1845
|
this._drawingManagerService.setDrawingVisible(e);
|
|
@@ -1849,22 +1863,22 @@ let Bt = class extends ee {
|
|
|
1849
1863
|
const i = this._univerInstanceService.getCurrentTypeOfUnit$(k.UNIVER_SHEET), t = this._userManagerService.currentUser$;
|
|
1850
1864
|
this.disposeWithMe(
|
|
1851
1865
|
at([i, t]).pipe(
|
|
1852
|
-
|
|
1853
|
-
|
|
1866
|
+
pe(([e, n]) => e ? e.activeSheet$.pipe(
|
|
1867
|
+
pe((r) => {
|
|
1854
1868
|
if (!r)
|
|
1855
|
-
return
|
|
1869
|
+
return _e;
|
|
1856
1870
|
const s = e.getUnitId(), o = r.getSheetId(), a = this._renderManagerService.getRenderById(s), d = a == null ? void 0 : a.scene;
|
|
1857
1871
|
if (!d)
|
|
1858
|
-
return
|
|
1872
|
+
return _e;
|
|
1859
1873
|
const u = d.getTransformerByCreate();
|
|
1860
1874
|
return this._permissionService.composePermission$([
|
|
1861
|
-
new
|
|
1862
|
-
new
|
|
1875
|
+
new mn(s).id,
|
|
1876
|
+
new fn(s, o).id
|
|
1863
1877
|
]).pipe(
|
|
1864
|
-
|
|
1865
|
-
|
|
1878
|
+
we((l) => l.every((g) => g.value)),
|
|
1879
|
+
nr()
|
|
1866
1880
|
).pipe(
|
|
1867
|
-
|
|
1881
|
+
we((l) => ({
|
|
1868
1882
|
permission: l,
|
|
1869
1883
|
scene: d,
|
|
1870
1884
|
transformer: u,
|
|
@@ -1873,7 +1887,7 @@ let Bt = class extends ee {
|
|
|
1873
1887
|
}))
|
|
1874
1888
|
);
|
|
1875
1889
|
})
|
|
1876
|
-
) :
|
|
1890
|
+
) : _e)
|
|
1877
1891
|
).subscribe({
|
|
1878
1892
|
next: ({ permission: e, scene: n, transformer: r, unitId: s, subUnitId: o }) => {
|
|
1879
1893
|
this._drawingManagerService.setDrawingEditable(e);
|
|
@@ -1903,19 +1917,19 @@ let Bt = class extends ee {
|
|
|
1903
1917
|
);
|
|
1904
1918
|
}
|
|
1905
1919
|
};
|
|
1906
|
-
Bt =
|
|
1920
|
+
Bt = to([
|
|
1907
1921
|
it(0, ae),
|
|
1908
|
-
it(1,
|
|
1909
|
-
it(2,
|
|
1910
|
-
it(3,
|
|
1911
|
-
it(4, A(
|
|
1922
|
+
it(1, ee),
|
|
1923
|
+
it(2, Si),
|
|
1924
|
+
it(3, le),
|
|
1925
|
+
it(4, A(vi))
|
|
1912
1926
|
], Bt);
|
|
1913
|
-
var
|
|
1914
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1927
|
+
var no = Object.getOwnPropertyDescriptor, ro = (i, t, e, n) => {
|
|
1928
|
+
for (var r = n > 1 ? void 0 : n ? no(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
1915
1929
|
(o = i[s]) && (r = o(r) || r);
|
|
1916
1930
|
return r;
|
|
1917
1931
|
}, be = (i, t) => (e, n) => t(e, n, i);
|
|
1918
|
-
const
|
|
1932
|
+
const io = "univer-sheet-float-dom-";
|
|
1919
1933
|
function Vr(i, t, e, n, r, s = !1) {
|
|
1920
1934
|
const { scaleX: o, scaleY: a } = t.getAncestorScale(), d = t.getViewport(cr.VIEW_MAIN), u = n.getFreeze(), { startColumn: c, startRow: l, xSplit: g, ySplit: h } = u, m = {
|
|
1921
1935
|
left: !0,
|
|
@@ -1927,27 +1941,27 @@ function Vr(i, t, e, n, r, s = !1) {
|
|
|
1927
1941
|
...i,
|
|
1928
1942
|
absolute: m
|
|
1929
1943
|
};
|
|
1930
|
-
const { left:
|
|
1931
|
-
let { top: I, left:
|
|
1932
|
-
const { boundsOfViewArea:
|
|
1944
|
+
const { left: p, right: f, top: w, bottom: _ } = i;
|
|
1945
|
+
let { top: I, left: R, viewportScrollX: v, viewportScrollY: C } = d;
|
|
1946
|
+
const { boundsOfViewArea: S, scrollDirectionResponse: y } = r || {}, { rowHeaderWidth: D, columnHeaderHeight: E } = e, T = {
|
|
1933
1947
|
top: s ? 0 : E,
|
|
1934
|
-
left: s ? 0 :
|
|
1948
|
+
left: s ? 0 : D
|
|
1935
1949
|
};
|
|
1936
|
-
|
|
1950
|
+
S && (Ge.isDefine(T.top) && (T.top = S.top), Ge.isDefine(T.left) && (T.left = S.left)), y === "HORIZONTAL" && (C = 0), y === "VERTICAL" && (v = 0);
|
|
1937
1951
|
let M = 0, b = 0;
|
|
1938
|
-
const N = e.rowStartY(l - h) + E, F = e.colStartX(c - g) +
|
|
1952
|
+
const N = e.rowStartY(l - h) + E, F = e.colStartX(c - g) + D, ne = e.rowStartY(l) + E, z = e.colStartX(c) + D;
|
|
1939
1953
|
if (g === 0)
|
|
1940
|
-
m.left = !1, M = (
|
|
1954
|
+
m.left = !1, M = (p - v) * o, b = (f - v) * o;
|
|
1941
1955
|
else {
|
|
1942
|
-
const K =
|
|
1943
|
-
|
|
1956
|
+
const K = p - (F - D), W = f - (F - D);
|
|
1957
|
+
f < z ? (M = K * o, b = W * o) : p <= z && f >= z ? (M = K * o, b = Math.max(R, (f - v) * o)) : p > z && (m.left = !1, M = Math.max((p - v) * o, R), b = Math.max((f - v) * o, R));
|
|
1944
1958
|
}
|
|
1945
1959
|
let V = 0, Y = 0;
|
|
1946
1960
|
if (h === 0)
|
|
1947
|
-
m.top = !1, V = (w - C) * a, Y = (
|
|
1961
|
+
m.top = !1, V = (w - C) * a, Y = (_ - C) * a;
|
|
1948
1962
|
else {
|
|
1949
|
-
const K = w - (N - E), W =
|
|
1950
|
-
|
|
1963
|
+
const K = w - (N - E), W = _ - (N - E);
|
|
1964
|
+
_ < ne ? (V = K * a, Y = W * a) : w <= ne && _ >= ne ? (V = K * a, Y = Math.max(I, (_ - C) * a)) : w > ne && (m.top = !1, V = Math.max((w - C) * a, I), Y = Math.max((_ - C) * a, I));
|
|
1951
1965
|
}
|
|
1952
1966
|
return M = Math.max(M, T.left), V = Math.max(V, T.top), b = Math.max(b, T.left), Y = Math.max(Y, T.top), {
|
|
1953
1967
|
left: M,
|
|
@@ -1957,7 +1971,7 @@ function Vr(i, t, e, n, r, s = !1) {
|
|
|
1957
1971
|
absolute: m
|
|
1958
1972
|
};
|
|
1959
1973
|
}
|
|
1960
|
-
const
|
|
1974
|
+
const fe = (i, t, e, n, r) => {
|
|
1961
1975
|
const { left: s, top: o, width: a, height: d, angle: u } = i, c = {
|
|
1962
1976
|
left: s,
|
|
1963
1977
|
right: s + a,
|
|
@@ -1975,23 +1989,23 @@ const me = (i, t, e, n, r) => {
|
|
|
1975
1989
|
absolute: l.absolute
|
|
1976
1990
|
};
|
|
1977
1991
|
};
|
|
1978
|
-
let lt = class extends
|
|
1992
|
+
let lt = class extends te {
|
|
1979
1993
|
constructor(t, e, n, r, s, o, a) {
|
|
1980
1994
|
super();
|
|
1981
1995
|
/**
|
|
1982
1996
|
* for update dom container position when scrolling and zoom
|
|
1983
1997
|
*/
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1998
|
+
Q(this, "_domLayerInfoMap", /* @__PURE__ */ new Map());
|
|
1999
|
+
Q(this, "_transformChange$", new on());
|
|
2000
|
+
Q(this, "transformChange$", this._transformChange$.asObservable());
|
|
2001
|
+
Q(this, "_add$", new on());
|
|
2002
|
+
Q(this, "add$", this._add$.asObservable());
|
|
2003
|
+
Q(this, "_remove$", new on());
|
|
2004
|
+
Q(this, "remove$", this._remove$.asObservable());
|
|
1991
2005
|
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();
|
|
1992
2006
|
}
|
|
1993
2007
|
_bindScrollEvent() {
|
|
1994
|
-
this._lifecycleService.lifecycle$.pipe(
|
|
2008
|
+
this._lifecycleService.lifecycle$.pipe(bs((t) => t === Ci.Rendered), Ms(1)).subscribe(() => {
|
|
1995
2009
|
this._scrollUpdateListener();
|
|
1996
2010
|
});
|
|
1997
2011
|
}
|
|
@@ -2032,21 +2046,21 @@ let lt = class extends ee {
|
|
|
2032
2046
|
const m = this._getSceneAndTransformerByDrawingSearch(n);
|
|
2033
2047
|
if (m == null)
|
|
2034
2048
|
return;
|
|
2035
|
-
const { scene:
|
|
2049
|
+
const { scene: p, canvas: f } = m;
|
|
2036
2050
|
if (l == null)
|
|
2037
2051
|
return !0;
|
|
2038
2052
|
if (u !== r)
|
|
2039
2053
|
return;
|
|
2040
|
-
const { left: w, top:
|
|
2054
|
+
const { left: w, top: _, width: I, height: R, angle: v, flipX: C, flipY: S, skewX: y, skewY: D } = l, E = De({ unitId: n, subUnitId: r, drawingId: s }), T = p.getObject(E);
|
|
2041
2055
|
if (T != null) {
|
|
2042
|
-
T.transformByState({ left: w, top:
|
|
2056
|
+
T.transformByState({ left: w, top: _, width: I, height: R, angle: v, flipX: C, flipY: S, skewX: y, skewY: D });
|
|
2043
2057
|
return;
|
|
2044
2058
|
}
|
|
2045
2059
|
const M = {
|
|
2046
2060
|
left: w,
|
|
2047
|
-
top:
|
|
2061
|
+
top: _,
|
|
2048
2062
|
width: I,
|
|
2049
|
-
height:
|
|
2063
|
+
height: R,
|
|
2050
2064
|
zIndex: this._drawingManagerService.getDrawingOrder(n, r).length - 1
|
|
2051
2065
|
}, b = g === x.DRAWING_CHART;
|
|
2052
2066
|
if (M.rotateEnabled = !1, b) {
|
|
@@ -2054,8 +2068,8 @@ let lt = class extends ee {
|
|
|
2054
2068
|
M.fill = W, h && h.border && (M.stroke = h.border), M.paintFirst = "stroke", M.strokeWidth = 1, M.borderEnabled = !1, M.radius = 8;
|
|
2055
2069
|
}
|
|
2056
2070
|
const N = new $e(E, M);
|
|
2057
|
-
b && N.setObjectType(
|
|
2058
|
-
const F = new yt(),
|
|
2071
|
+
b && N.setObjectType(Nn.CHART), p.addObject(N, qt), a.allowTransform !== !1 && p.attachTransformerTo(N);
|
|
2072
|
+
const F = new yt(), ne = fe(N, m.renderUnit.scene, c.skeleton, o.worksheet), z = new je(ne), V = `${io}${He(6)}`, Y = {
|
|
2059
2073
|
dispose: F,
|
|
2060
2074
|
rect: N,
|
|
2061
2075
|
position$: z,
|
|
@@ -2070,22 +2084,22 @@ let lt = class extends ee {
|
|
|
2070
2084
|
domId: V,
|
|
2071
2085
|
componentKey: a.componentKey,
|
|
2072
2086
|
onPointerDown: (W) => {
|
|
2073
|
-
|
|
2087
|
+
f.dispatchEvent(new PointerEvent(W.type, W));
|
|
2074
2088
|
},
|
|
2075
2089
|
onPointerMove: (W) => {
|
|
2076
|
-
|
|
2090
|
+
f.dispatchEvent(new PointerEvent(W.type, W));
|
|
2077
2091
|
},
|
|
2078
2092
|
onPointerUp: (W) => {
|
|
2079
|
-
|
|
2093
|
+
f.dispatchEvent(new PointerEvent(W.type, W));
|
|
2080
2094
|
},
|
|
2081
2095
|
onWheel: (W) => {
|
|
2082
|
-
|
|
2096
|
+
f.dispatchEvent(new WheelEvent(W.type, W));
|
|
2083
2097
|
},
|
|
2084
2098
|
data: h,
|
|
2085
2099
|
unitId: n
|
|
2086
2100
|
});
|
|
2087
2101
|
const Z = N.onTransformChange$.subscribeEvent(() => {
|
|
2088
|
-
const W =
|
|
2102
|
+
const W = fe(N, m.renderUnit.scene, c.skeleton, o.worksheet);
|
|
2089
2103
|
z.next(
|
|
2090
2104
|
W
|
|
2091
2105
|
);
|
|
@@ -2115,21 +2129,21 @@ let lt = class extends ee {
|
|
|
2115
2129
|
!r || !o || !a || s.forEach((u) => {
|
|
2116
2130
|
const c = this._domLayerInfoMap.get(u);
|
|
2117
2131
|
if (c) {
|
|
2118
|
-
const l =
|
|
2132
|
+
const l = fe(c.rect, r.renderUnit.scene, a.skeleton, o.worksheet, c);
|
|
2119
2133
|
c.position$.next(l);
|
|
2120
2134
|
}
|
|
2121
2135
|
});
|
|
2122
2136
|
};
|
|
2123
2137
|
this.disposeWithMe(
|
|
2124
2138
|
this._univerInstanceService.getCurrentTypeOfUnit$(k.UNIVER_SHEET).pipe(
|
|
2125
|
-
|
|
2126
|
-
|
|
2139
|
+
pe((e) => e ? e.activeSheet$ : _n(null)),
|
|
2140
|
+
we((e) => {
|
|
2127
2141
|
if (!e) return null;
|
|
2128
2142
|
const n = e.getUnitId(), r = this._renderManagerService.getRenderById(n);
|
|
2129
2143
|
return r ? { render: r, unitId: n, subUnitId: e.getSheetId() } : null;
|
|
2130
2144
|
}),
|
|
2131
|
-
|
|
2132
|
-
(e) => e ?
|
|
2145
|
+
pe(
|
|
2146
|
+
(e) => e ? Ri(e.render.scene.getViewport(cr.VIEW_MAIN).onScrollAfter$).pipe(we(() => ({ unitId: e.unitId, subUnitId: e.subUnitId }))) : _n(null)
|
|
2133
2147
|
)
|
|
2134
2148
|
).subscribe((e) => {
|
|
2135
2149
|
if (!e) return;
|
|
@@ -2137,15 +2151,15 @@ let lt = class extends ee {
|
|
|
2137
2151
|
t(n, r);
|
|
2138
2152
|
})
|
|
2139
2153
|
), this.disposeWithMe(this._commandService.onCommandExecuted((e) => {
|
|
2140
|
-
if (e.id ===
|
|
2154
|
+
if (e.id === xn.id) {
|
|
2141
2155
|
const n = e.params, { unitId: r } = n;
|
|
2142
2156
|
Array.from(this._domLayerInfoMap.values()).filter((o) => o.unitId === r).map((o) => o.subUnitId).forEach((o) => {
|
|
2143
2157
|
t(r, o);
|
|
2144
2158
|
});
|
|
2145
|
-
} else if (e.id ===
|
|
2159
|
+
} else if (e.id === Wi.id) {
|
|
2146
2160
|
const { unitId: n, subUnitId: r } = e.params;
|
|
2147
2161
|
t(n, r);
|
|
2148
|
-
} else if (e.id ===
|
|
2162
|
+
} else if (e.id === Bi.id) {
|
|
2149
2163
|
const { unitId: n, subUnitId: r } = e.params;
|
|
2150
2164
|
t(n, r);
|
|
2151
2165
|
}
|
|
@@ -2270,7 +2284,7 @@ let lt = class extends ee {
|
|
|
2270
2284
|
}
|
|
2271
2285
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
2272
2286
|
addFloatDomToRange(t, e, n, r) {
|
|
2273
|
-
var C,
|
|
2287
|
+
var C, S, y;
|
|
2274
2288
|
const s = se(this._univerInstanceService, {
|
|
2275
2289
|
unitId: e.unitId,
|
|
2276
2290
|
subUnitId: e.subUnitId
|
|
@@ -2283,79 +2297,79 @@ let lt = class extends ee {
|
|
|
2283
2297
|
if (!u) return;
|
|
2284
2298
|
const c = (C = this._renderManagerService.getRenderById(o)) == null ? void 0 : C.with(X).getWorksheetSkeleton(a);
|
|
2285
2299
|
if (!c) return;
|
|
2286
|
-
const { componentKey: l, data: g, allowTransform: h = !0 } = e, m = r != null ? r : He(), { position:
|
|
2287
|
-
if (this._getPosition(
|
|
2300
|
+
const { componentKey: l, data: g, allowTransform: h = !0 } = e, m = r != null ? r : He(), { position: p, position$: f } = this._createRangePositionObserver(t, u, c.skeleton);
|
|
2301
|
+
if (this._getPosition(p, o) == null)
|
|
2288
2302
|
return;
|
|
2289
|
-
const
|
|
2303
|
+
const _ = d.scene, { scaleX: I } = _.getAncestorScale(), R = Ut(p, n, I), v = {
|
|
2290
2304
|
unitId: o,
|
|
2291
2305
|
subUnitId: a,
|
|
2292
2306
|
drawingId: m,
|
|
2293
2307
|
drawingType: e.type || x.DRAWING_DOM,
|
|
2294
2308
|
componentKey: l,
|
|
2295
2309
|
transform: {
|
|
2296
|
-
left:
|
|
2297
|
-
top:
|
|
2298
|
-
width:
|
|
2299
|
-
height:
|
|
2310
|
+
left: R.startX,
|
|
2311
|
+
top: R.startY,
|
|
2312
|
+
width: R.width,
|
|
2313
|
+
height: R.height
|
|
2300
2314
|
},
|
|
2301
2315
|
data: g,
|
|
2302
2316
|
allowTransform: h
|
|
2303
2317
|
};
|
|
2304
2318
|
{
|
|
2305
|
-
const { unitId:
|
|
2319
|
+
const { unitId: D, subUnitId: E, drawingId: T } = v, M = se(this._univerInstanceService, { unitId: D, subUnitId: E }), b = v, N = this._univerInstanceService.getUnit(D, k.UNIVER_SHEET);
|
|
2306
2320
|
if (!N)
|
|
2307
2321
|
return;
|
|
2308
2322
|
const F = N.getActiveSheet().getSheetId();
|
|
2309
2323
|
if (!b || !M)
|
|
2310
2324
|
return;
|
|
2311
|
-
const
|
|
2312
|
-
if (!
|
|
2325
|
+
const ne = (S = this._renderManagerService.getRenderById(D)) == null ? void 0 : S.with(X);
|
|
2326
|
+
if (!ne)
|
|
2313
2327
|
return;
|
|
2314
|
-
const z =
|
|
2328
|
+
const z = ne.getWorksheetSkeleton(E);
|
|
2315
2329
|
if (!z)
|
|
2316
2330
|
return;
|
|
2317
2331
|
const { transform: V, drawingType: Y, data: Z } = b;
|
|
2318
2332
|
if (Y !== x.DRAWING_DOM && Y !== x.DRAWING_CHART)
|
|
2319
2333
|
return;
|
|
2320
|
-
const K = this._getSceneAndTransformerByDrawingSearch(
|
|
2334
|
+
const K = this._getSceneAndTransformerByDrawingSearch(D);
|
|
2321
2335
|
if (K == null)
|
|
2322
2336
|
return;
|
|
2323
2337
|
const { scene: W, canvas: Oe } = K;
|
|
2324
2338
|
if (V == null || F !== E)
|
|
2325
2339
|
return;
|
|
2326
|
-
const { left: ft, top: pt, width: wt, height: _t, angle: Jt, flipX: Zt, flipY: St, skewX: vt, skewY: Ue } = V, It = De({ unitId:
|
|
2327
|
-
if (
|
|
2328
|
-
|
|
2340
|
+
const { left: ft, top: pt, width: wt, height: _t, angle: Jt, flipX: Zt, flipY: St, skewX: vt, skewY: Ue } = V, It = De({ unitId: D, subUnitId: E, drawingId: T }), ue = W.getObject(It);
|
|
2341
|
+
if (ue != null) {
|
|
2342
|
+
ue.transformByState({ left: ft, top: pt, width: wt, height: _t, angle: Jt, flipX: Zt, flipY: St, skewX: vt, skewY: Ue });
|
|
2329
2343
|
return;
|
|
2330
2344
|
}
|
|
2331
|
-
const
|
|
2345
|
+
const re = {
|
|
2332
2346
|
left: ft,
|
|
2333
2347
|
// from floatDomParam.transform
|
|
2334
2348
|
top: pt,
|
|
2335
2349
|
width: wt,
|
|
2336
2350
|
height: _t,
|
|
2337
|
-
zIndex: this._drawingManagerService.getDrawingOrder(
|
|
2351
|
+
zIndex: this._drawingManagerService.getDrawingOrder(D, E).length - 1
|
|
2338
2352
|
}, Pe = Y === x.DRAWING_CHART;
|
|
2339
2353
|
if (Pe) {
|
|
2340
2354
|
const $ = Z ? Z.backgroundColor : "white";
|
|
2341
|
-
|
|
2355
|
+
re.fill = $, re.rotateEnabled = !1, Z && Z.border && (re.stroke = Z.border), re.paintFirst = "stroke", re.strokeWidth = 1, re.borderEnabled = !1, re.radius = 8;
|
|
2342
2356
|
}
|
|
2343
|
-
const
|
|
2344
|
-
Pe &&
|
|
2345
|
-
const
|
|
2357
|
+
const he = new $e(It, re);
|
|
2358
|
+
Pe && he.setObjectType(Nn.CHART), W.addObject(he, qt), b.allowTransform !== !1 && W.attachTransformerTo(he);
|
|
2359
|
+
const ge = new yt(), Ct = W.getMainViewport(), { rowHeaderWidth: Ae, columnHeaderHeight: Qe } = z.skeleton, Rt = {
|
|
2346
2360
|
top: Qe,
|
|
2347
2361
|
left: Ae,
|
|
2348
2362
|
bottom: Ct.bottom,
|
|
2349
2363
|
right: Ct.right
|
|
2350
|
-
},
|
|
2351
|
-
dispose:
|
|
2352
|
-
rect:
|
|
2364
|
+
}, me = {
|
|
2365
|
+
dispose: ge,
|
|
2366
|
+
rect: he,
|
|
2353
2367
|
boundsOfViewArea: Rt,
|
|
2354
2368
|
domAnchor: n,
|
|
2355
|
-
unitId:
|
|
2369
|
+
unitId: D,
|
|
2356
2370
|
subUnitId: E
|
|
2357
|
-
}, B =
|
|
2358
|
-
|
|
2371
|
+
}, B = fe(he, K.renderUnit.scene, z.skeleton, M.worksheet, me), Ne = new je(B);
|
|
2372
|
+
me.position$ = Ne;
|
|
2359
2373
|
let et = {
|
|
2360
2374
|
position$: Ne,
|
|
2361
2375
|
id: T,
|
|
@@ -2370,7 +2384,7 @@ let lt = class extends ee {
|
|
|
2370
2384
|
Oe.dispatchEvent(new WheelEvent($.type, $));
|
|
2371
2385
|
},
|
|
2372
2386
|
data: Z,
|
|
2373
|
-
unitId:
|
|
2387
|
+
unitId: D
|
|
2374
2388
|
};
|
|
2375
2389
|
e.eventPassThrough && (et = {
|
|
2376
2390
|
...et,
|
|
@@ -2383,41 +2397,41 @@ let lt = class extends ee {
|
|
|
2383
2397
|
onPointerUp: ($) => {
|
|
2384
2398
|
Oe.dispatchEvent(new PointerEvent($.type, $));
|
|
2385
2399
|
}
|
|
2386
|
-
}), this._canvasFloatDomService.addFloatDom(et), this.disposeWithMe(
|
|
2387
|
-
var
|
|
2388
|
-
const
|
|
2400
|
+
}), this._canvasFloatDomService.addFloatDom(et), this.disposeWithMe(f.subscribe(($) => {
|
|
2401
|
+
var On, Un, Pn, An;
|
|
2402
|
+
const Tn = Ut({
|
|
2389
2403
|
startX: $.startX,
|
|
2390
2404
|
startY: $.startY,
|
|
2391
2405
|
endX: $.endX,
|
|
2392
2406
|
endY: $.endY,
|
|
2393
|
-
width: (
|
|
2394
|
-
height: (
|
|
2407
|
+
width: (On = n.width) != null ? On : $.width,
|
|
2408
|
+
height: (Un = n.height) != null ? Un : $.height,
|
|
2395
2409
|
absolute: {
|
|
2396
|
-
left:
|
|
2397
|
-
top:
|
|
2410
|
+
left: p.absolute.left,
|
|
2411
|
+
top: p.absolute.top
|
|
2398
2412
|
}
|
|
2399
|
-
}, n), Xr = De({ unitId:
|
|
2400
|
-
left:
|
|
2401
|
-
top:
|
|
2402
|
-
width: (
|
|
2403
|
-
height: (
|
|
2404
|
-
zIndex: this._drawingManagerService.getDrawingOrder(
|
|
2405
|
-
}), Kr =
|
|
2413
|
+
}, n), Xr = De({ unitId: D, subUnitId: E, drawingId: T }), zr = new $e(Xr, {
|
|
2414
|
+
left: Tn.startX,
|
|
2415
|
+
top: Tn.startY,
|
|
2416
|
+
width: (Pn = n.width) != null ? Pn : $.width,
|
|
2417
|
+
height: (An = n.height) != null ? An : $.height,
|
|
2418
|
+
zIndex: this._drawingManagerService.getDrawingOrder(D, E).length - 1
|
|
2419
|
+
}), Kr = fe(zr, K.renderUnit.scene, z.skeleton, M.worksheet, me);
|
|
2406
2420
|
Ne.next(Kr);
|
|
2407
2421
|
}));
|
|
2408
|
-
const tt = (y = this._renderManagerService.getRenderById(
|
|
2422
|
+
const tt = (y = this._renderManagerService.getRenderById(D)) == null ? void 0 : y.with(X);
|
|
2409
2423
|
tt == null || tt.currentSkeleton$.subscribe(($) => {
|
|
2410
2424
|
$ && z.sheetId !== $.sheetId && this._removeDom(m, !0);
|
|
2411
2425
|
});
|
|
2412
|
-
const Dt =
|
|
2413
|
-
const $ =
|
|
2426
|
+
const Dt = he.onTransformChange$.subscribeEvent(() => {
|
|
2427
|
+
const $ = fe(he, K.renderUnit.scene, z.skeleton, M.worksheet, me);
|
|
2414
2428
|
Ne.next(
|
|
2415
2429
|
$
|
|
2416
2430
|
);
|
|
2417
2431
|
});
|
|
2418
|
-
|
|
2432
|
+
ge.add(() => {
|
|
2419
2433
|
this._canvasFloatDomService.removeFloatDom(T);
|
|
2420
|
-
}), Dt &&
|
|
2434
|
+
}), Dt && ge.add(Dt), this._domLayerInfoMap.set(T, me);
|
|
2421
2435
|
}
|
|
2422
2436
|
return {
|
|
2423
2437
|
id: m,
|
|
@@ -2428,7 +2442,7 @@ let lt = class extends ee {
|
|
|
2428
2442
|
}
|
|
2429
2443
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
2430
2444
|
addFloatDomToColumnHeader(t, e, n, r) {
|
|
2431
|
-
var
|
|
2445
|
+
var R, v, C;
|
|
2432
2446
|
const s = se(this._univerInstanceService, {
|
|
2433
2447
|
unitId: e.unitId,
|
|
2434
2448
|
subUnitId: e.subUnitId
|
|
@@ -2439,15 +2453,15 @@ let lt = class extends ee {
|
|
|
2439
2453
|
if (!this._getSceneAndTransformerByDrawingSearch(o)) return;
|
|
2440
2454
|
const u = this._renderManagerService.getRenderById(o);
|
|
2441
2455
|
if (!u) return;
|
|
2442
|
-
const c = (
|
|
2456
|
+
const c = (R = this._renderManagerService.getRenderById(o)) == null ? void 0 : R.with(X).getWorksheetSkeleton(a);
|
|
2443
2457
|
if (!c) return;
|
|
2444
|
-
const { componentKey: l, data: g, allowTransform: h = !0 } = e, m = r != null ? r : He(), { position:
|
|
2458
|
+
const { componentKey: l, data: g, allowTransform: h = !0 } = e, m = r != null ? r : He(), { position: p, position$: f } = this._createRangePositionObserver({
|
|
2445
2459
|
startRow: 0,
|
|
2446
2460
|
endRow: 0,
|
|
2447
2461
|
startColumn: t,
|
|
2448
2462
|
endColumn: t
|
|
2449
|
-
}, u, c.skeleton), w =
|
|
2450
|
-
if (w.startY = 0, this._getPosition(
|
|
2463
|
+
}, u, c.skeleton), w = p;
|
|
2464
|
+
if (w.startY = 0, this._getPosition(p, o) == null)
|
|
2451
2465
|
return;
|
|
2452
2466
|
const I = {
|
|
2453
2467
|
unitId: o,
|
|
@@ -2465,25 +2479,25 @@ let lt = class extends ee {
|
|
|
2465
2479
|
allowTransform: h
|
|
2466
2480
|
};
|
|
2467
2481
|
{
|
|
2468
|
-
const { unitId:
|
|
2482
|
+
const { unitId: S, subUnitId: y, drawingId: D } = I, E = se(this._univerInstanceService, { unitId: S, subUnitId: y }), T = I, M = this._univerInstanceService.getUnit(S, k.UNIVER_SHEET);
|
|
2469
2483
|
if (!M)
|
|
2470
2484
|
return;
|
|
2471
2485
|
const b = M.getActiveSheet().getSheetId();
|
|
2472
2486
|
if (!T || !E)
|
|
2473
2487
|
return;
|
|
2474
|
-
const N = (v = this._renderManagerService.getRenderById(
|
|
2488
|
+
const N = (v = this._renderManagerService.getRenderById(S)) == null ? void 0 : v.with(X);
|
|
2475
2489
|
if (!N)
|
|
2476
2490
|
return;
|
|
2477
2491
|
const F = N.getWorksheetSkeleton(y);
|
|
2478
2492
|
if (!F)
|
|
2479
2493
|
return;
|
|
2480
|
-
const { transform:
|
|
2494
|
+
const { transform: ne, data: z } = T, V = this._getSceneAndTransformerByDrawingSearch(S);
|
|
2481
2495
|
if (V == null)
|
|
2482
2496
|
return;
|
|
2483
2497
|
const { scene: Y, canvas: Z } = V;
|
|
2484
|
-
if (
|
|
2498
|
+
if (ne == null || b !== y)
|
|
2485
2499
|
return;
|
|
2486
|
-
const { left: K, top: W, width: Oe, height: ft, angle: pt, flipX: wt, flipY: _t, skewX: Jt, skewY: Zt } =
|
|
2500
|
+
const { left: K, top: W, width: Oe, height: ft, angle: pt, flipX: wt, flipY: _t, skewX: Jt, skewY: Zt } = ne, St = De({ unitId: S, subUnitId: y, drawingId: D }), vt = Y.getObject(St);
|
|
2487
2501
|
if (vt != null) {
|
|
2488
2502
|
vt.transformByState({ left: K, top: W, width: Oe, height: ft, angle: pt, flipX: wt, flipY: _t, skewX: Jt, skewY: Zt });
|
|
2489
2503
|
return;
|
|
@@ -2491,43 +2505,43 @@ let lt = class extends ee {
|
|
|
2491
2505
|
const Ue = Ut({
|
|
2492
2506
|
startX: w.startX,
|
|
2493
2507
|
startY: 0,
|
|
2494
|
-
endX:
|
|
2495
|
-
endY:
|
|
2508
|
+
endX: p.endX,
|
|
2509
|
+
endY: p.endY,
|
|
2496
2510
|
width: n.width,
|
|
2497
2511
|
height: n.height,
|
|
2498
2512
|
absolute: {
|
|
2499
|
-
left:
|
|
2500
|
-
top:
|
|
2513
|
+
left: p.absolute.left,
|
|
2514
|
+
top: p.absolute.top
|
|
2501
2515
|
}
|
|
2502
2516
|
}, n), It = {
|
|
2503
2517
|
left: Ue.startX,
|
|
2504
2518
|
top: Ue.startY,
|
|
2505
2519
|
width: Ue.width,
|
|
2506
2520
|
height: Ue.height,
|
|
2507
|
-
zIndex: this._drawingManagerService.getDrawingOrder(
|
|
2508
|
-
},
|
|
2509
|
-
Y.addObject(
|
|
2510
|
-
const
|
|
2521
|
+
zIndex: this._drawingManagerService.getDrawingOrder(S, y).length - 1
|
|
2522
|
+
}, ue = new $e(St, It);
|
|
2523
|
+
Y.addObject(ue, qt), T.allowTransform !== !1 && Y.attachTransformerTo(ue);
|
|
2524
|
+
const re = new yt(), Pe = Y.getMainViewport(), he = {
|
|
2511
2525
|
top: 0,
|
|
2512
2526
|
//viewMain.top,
|
|
2513
2527
|
left: Pe.left,
|
|
2514
2528
|
bottom: Pe.bottom,
|
|
2515
2529
|
right: Pe.right
|
|
2516
|
-
},
|
|
2517
|
-
dispose:
|
|
2518
|
-
rect:
|
|
2530
|
+
}, ge = {
|
|
2531
|
+
dispose: re,
|
|
2532
|
+
rect: ue,
|
|
2519
2533
|
// position$,
|
|
2520
|
-
unitId:
|
|
2534
|
+
unitId: S,
|
|
2521
2535
|
subUnitId: y,
|
|
2522
|
-
boundsOfViewArea:
|
|
2536
|
+
boundsOfViewArea: he,
|
|
2523
2537
|
domAnchor: n,
|
|
2524
2538
|
scrollDirectionResponse: "HORIZONTAL"
|
|
2525
2539
|
/* HORIZONTAL */
|
|
2526
|
-
}, Ct =
|
|
2527
|
-
|
|
2540
|
+
}, Ct = fe(ue, V.renderUnit.scene, F.skeleton, E.worksheet, ge), Ae = new je(Ct);
|
|
2541
|
+
ge.position$ = Ae;
|
|
2528
2542
|
let Qe = {
|
|
2529
2543
|
position$: Ae,
|
|
2530
|
-
id:
|
|
2544
|
+
id: D,
|
|
2531
2545
|
componentKey: T.componentKey,
|
|
2532
2546
|
onPointerDown: () => {
|
|
2533
2547
|
},
|
|
@@ -2539,7 +2553,7 @@ let lt = class extends ee {
|
|
|
2539
2553
|
Z.dispatchEvent(new WheelEvent(B.type, B));
|
|
2540
2554
|
},
|
|
2541
2555
|
data: z,
|
|
2542
|
-
unitId:
|
|
2556
|
+
unitId: S
|
|
2543
2557
|
};
|
|
2544
2558
|
e.eventPassThrough && (Qe = {
|
|
2545
2559
|
...Qe,
|
|
@@ -2553,13 +2567,13 @@ let lt = class extends ee {
|
|
|
2553
2567
|
Z.dispatchEvent(new PointerEvent(B.type, B));
|
|
2554
2568
|
}
|
|
2555
2569
|
}), this._canvasFloatDomService.addFloatDom(Qe);
|
|
2556
|
-
const Rt =
|
|
2557
|
-
const B =
|
|
2570
|
+
const Rt = ue.onTransformChange$.subscribeEvent(() => {
|
|
2571
|
+
const B = fe(ue, V.renderUnit.scene, F.skeleton, E.worksheet, ge);
|
|
2558
2572
|
Ae.next(
|
|
2559
2573
|
B
|
|
2560
2574
|
);
|
|
2561
2575
|
});
|
|
2562
|
-
this.disposeWithMe(
|
|
2576
|
+
this.disposeWithMe(f.subscribe((B) => {
|
|
2563
2577
|
const Ne = Ut({
|
|
2564
2578
|
startX: B.startX,
|
|
2565
2579
|
startY: 0,
|
|
@@ -2568,24 +2582,24 @@ let lt = class extends ee {
|
|
|
2568
2582
|
width: n.width,
|
|
2569
2583
|
height: n.height,
|
|
2570
2584
|
absolute: {
|
|
2571
|
-
left:
|
|
2572
|
-
top:
|
|
2585
|
+
left: p.absolute.left,
|
|
2586
|
+
top: p.absolute.top
|
|
2573
2587
|
}
|
|
2574
|
-
}, n), et = De({ unitId:
|
|
2588
|
+
}, n), et = De({ unitId: S, subUnitId: y, drawingId: D }), tt = new $e(et, {
|
|
2575
2589
|
left: Ne.startX,
|
|
2576
2590
|
top: 0,
|
|
2577
2591
|
width: n.width,
|
|
2578
2592
|
height: n.height,
|
|
2579
|
-
zIndex: this._drawingManagerService.getDrawingOrder(
|
|
2580
|
-
}), Dt =
|
|
2593
|
+
zIndex: this._drawingManagerService.getDrawingOrder(S, y).length - 1
|
|
2594
|
+
}), Dt = fe(tt, V.renderUnit.scene, F.skeleton, E.worksheet, ge);
|
|
2581
2595
|
Ae.next(Dt);
|
|
2582
2596
|
}));
|
|
2583
|
-
const
|
|
2584
|
-
|
|
2597
|
+
const me = (C = this._renderManagerService.getRenderById(S)) == null ? void 0 : C.with(X);
|
|
2598
|
+
me == null || me.currentSkeleton$.subscribe((B) => {
|
|
2585
2599
|
B && c.sheetId !== B.sheetId && this._removeDom(m, !0);
|
|
2586
|
-
}),
|
|
2587
|
-
this._canvasFloatDomService.removeFloatDom(
|
|
2588
|
-
}), Rt &&
|
|
2600
|
+
}), re.add(() => {
|
|
2601
|
+
this._canvasFloatDomService.removeFloatDom(D);
|
|
2602
|
+
}), Rt && re.add(Rt), this._domLayerInfoMap.set(D, ge);
|
|
2589
2603
|
}
|
|
2590
2604
|
return {
|
|
2591
2605
|
id: m,
|
|
@@ -2608,18 +2622,18 @@ let lt = class extends ee {
|
|
|
2608
2622
|
_createRangePositionObserver(t, e, n) {
|
|
2609
2623
|
let { startRow: r, startColumn: s } = t;
|
|
2610
2624
|
const o = st(r, s, n), a = new je(o), d = st(t.endRow, t.endColumn, n), u = new je(d), c = () => {
|
|
2611
|
-
const
|
|
2612
|
-
a.next(
|
|
2625
|
+
const f = st(r, s, n), w = st(t.endRow, t.endColumn, n);
|
|
2626
|
+
a.next(f), u.next(w);
|
|
2613
2627
|
}, l = new yt();
|
|
2614
|
-
l.add(e.engine.clientRect$.subscribe(() => c())), l.add(this._commandService.onCommandExecuted((
|
|
2615
|
-
if (
|
|
2628
|
+
l.add(e.engine.clientRect$.subscribe(() => c())), l.add(this._commandService.onCommandExecuted((f) => {
|
|
2629
|
+
if (f.id === gr.id && f.params.rowsAutoHeightInfo.findIndex((_) => _.row === r) > -1) {
|
|
2616
2630
|
c();
|
|
2617
2631
|
return;
|
|
2618
2632
|
}
|
|
2619
|
-
(
|
|
2633
|
+
(ji.indexOf(f.id) > -1 || f.id === di.id || f.id === xn.id) && c();
|
|
2620
2634
|
}));
|
|
2621
|
-
const g = (
|
|
2622
|
-
r =
|
|
2635
|
+
const g = (f, w) => {
|
|
2636
|
+
r = f, s = w, c();
|
|
2623
2637
|
}, h = () => ({
|
|
2624
2638
|
rotate: 0,
|
|
2625
2639
|
width: d.right - o.left,
|
|
@@ -2633,26 +2647,26 @@ let lt = class extends ee {
|
|
|
2633
2647
|
endX: d.right,
|
|
2634
2648
|
endY: d.bottom
|
|
2635
2649
|
}), m = a.pipe(
|
|
2636
|
-
|
|
2650
|
+
we((f) => {
|
|
2637
2651
|
const w = st(t.endRow, t.endColumn, n);
|
|
2638
2652
|
return {
|
|
2639
2653
|
rotate: 0,
|
|
2640
|
-
width: w.right -
|
|
2641
|
-
height: w.bottom -
|
|
2654
|
+
width: w.right - f.left,
|
|
2655
|
+
height: w.bottom - f.top,
|
|
2642
2656
|
absolute: {
|
|
2643
2657
|
left: !0,
|
|
2644
2658
|
top: !0
|
|
2645
2659
|
},
|
|
2646
|
-
startX:
|
|
2647
|
-
startY:
|
|
2660
|
+
startX: f.left,
|
|
2661
|
+
startY: f.top,
|
|
2648
2662
|
endX: w.right,
|
|
2649
2663
|
endY: w.bottom
|
|
2650
2664
|
};
|
|
2651
2665
|
})
|
|
2652
|
-
),
|
|
2666
|
+
), p = h();
|
|
2653
2667
|
return {
|
|
2654
2668
|
position$: m,
|
|
2655
|
-
position:
|
|
2669
|
+
position: p,
|
|
2656
2670
|
updateRowCol: g,
|
|
2657
2671
|
topLeftPos$: a,
|
|
2658
2672
|
rightBottomPos$: u,
|
|
@@ -2660,14 +2674,14 @@ let lt = class extends ee {
|
|
|
2660
2674
|
};
|
|
2661
2675
|
}
|
|
2662
2676
|
};
|
|
2663
|
-
lt =
|
|
2664
|
-
be(0, A(
|
|
2665
|
-
be(1,
|
|
2677
|
+
lt = ro([
|
|
2678
|
+
be(0, A(ee)),
|
|
2679
|
+
be(1, le),
|
|
2666
2680
|
be(2, A(G)),
|
|
2667
2681
|
be(3, ae),
|
|
2668
|
-
be(4, A(
|
|
2682
|
+
be(4, A(ls)),
|
|
2669
2683
|
be(5, oe),
|
|
2670
|
-
be(6, A(
|
|
2684
|
+
be(6, A(Ii))
|
|
2671
2685
|
], lt);
|
|
2672
2686
|
function st(i, t, e) {
|
|
2673
2687
|
const n = e.getCellWithCoordByIndex(i, t), r = n.isMergedMainCell ? n.mergeInfo : n;
|
|
@@ -2715,7 +2729,7 @@ function Pt(i, t) {
|
|
|
2715
2729
|
const e = Number.parseFloat(i);
|
|
2716
2730
|
return t * e / 100;
|
|
2717
2731
|
}
|
|
2718
|
-
const
|
|
2732
|
+
const so = (i) => {
|
|
2719
2733
|
const { floatDomInfos: t, scene: e, skeleton: n, worksheet: r } = i, s = Fe(() => t.map((o) => {
|
|
2720
2734
|
const { width: a, height: d, angle: u, left: c, top: l } = o.transform, g = Vr(
|
|
2721
2735
|
{
|
|
@@ -2729,7 +2743,7 @@ const io = (i) => {
|
|
|
2729
2743
|
r,
|
|
2730
2744
|
void 0,
|
|
2731
2745
|
!0
|
|
2732
|
-
), { scaleX: h, scaleY: m } = e.getAncestorScale(),
|
|
2746
|
+
), { scaleX: h, scaleY: m } = e.getAncestorScale(), p = {
|
|
2733
2747
|
startX: g.left,
|
|
2734
2748
|
endX: g.right,
|
|
2735
2749
|
startY: g.top,
|
|
@@ -2738,9 +2752,9 @@ const io = (i) => {
|
|
|
2738
2752
|
width: a * h,
|
|
2739
2753
|
height: d * m,
|
|
2740
2754
|
absolute: g.absolute
|
|
2741
|
-
},
|
|
2742
|
-
position$: new je(
|
|
2743
|
-
position:
|
|
2755
|
+
}, f = {
|
|
2756
|
+
position$: new je(p),
|
|
2757
|
+
position: p,
|
|
2744
2758
|
id: o.drawingId,
|
|
2745
2759
|
componentKey: o.componentKey,
|
|
2746
2760
|
onPointerMove: () => {
|
|
@@ -2754,16 +2768,16 @@ const io = (i) => {
|
|
|
2754
2768
|
unitId: o.unitId,
|
|
2755
2769
|
data: o.data
|
|
2756
2770
|
};
|
|
2757
|
-
return [o.drawingId,
|
|
2771
|
+
return [o.drawingId, f];
|
|
2758
2772
|
}), [t, e, n, r]);
|
|
2759
|
-
return /* @__PURE__ */ L("div", { style: { position: "absolute", top: 0, left: 0 }, children: s.map(([o, a]) => /* @__PURE__ */ L(
|
|
2773
|
+
return /* @__PURE__ */ L("div", { style: { position: "absolute", top: 0, left: 0 }, children: s.map(([o, a]) => /* @__PURE__ */ L(us, { layer: a, id: o, position: a.position }, o)) });
|
|
2760
2774
|
};
|
|
2761
|
-
var
|
|
2762
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
2775
|
+
var oo = Object.getOwnPropertyDescriptor, ao = (i, t, e, n) => {
|
|
2776
|
+
for (var r = n > 1 ? void 0 : n ? oo(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
2763
2777
|
(o = i[s]) && (r = o(r) || r);
|
|
2764
2778
|
return r;
|
|
2765
2779
|
}, Me = (i, t) => (e, n) => t(e, n, i);
|
|
2766
|
-
let jt = class extends
|
|
2780
|
+
let jt = class extends te {
|
|
2767
2781
|
constructor(i, t, e, n, r, s, o) {
|
|
2768
2782
|
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();
|
|
2769
2783
|
}
|
|
@@ -2798,8 +2812,8 @@ let jt = class extends ee {
|
|
|
2798
2812
|
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]);
|
|
2799
2813
|
return g.length ? (g.forEach((h) => {
|
|
2800
2814
|
if (!h.groupId && h.transform && Ge.isDefine(h.transform.left) && Ge.isDefine(h.transform.top) && Ge.isDefine(h.transform.width) && Ge.isDefine(h.transform.height)) {
|
|
2801
|
-
const m = o.skeleton.getCellIndexByOffset(h.transform.left, h.transform.top, u, c, { x: 0, y: 0 }),
|
|
2802
|
-
m.column < l.startColumn && (l.startColumn = m.column), m.row < l.startRow && (l.startRow = m.row), l.endRow <
|
|
2815
|
+
const m = o.skeleton.getCellIndexByOffset(h.transform.left, h.transform.top, u, c, { x: 0, y: 0 }), p = o.skeleton.getCellIndexByOffset(h.transform.left + h.transform.width, h.transform.top + h.transform.height, u, c, { x: 0, y: 0 });
|
|
2816
|
+
m.column < l.startColumn && (l.startColumn = m.column), m.row < l.startRow && (l.startRow = m.row), l.endRow < p.row && (l.endRow = p.row), l.endColumn < p.column && (l.endColumn = p.column);
|
|
2803
2817
|
}
|
|
2804
2818
|
}), e(l)) : e(i);
|
|
2805
2819
|
}
|
|
@@ -2820,7 +2834,7 @@ let jt = class extends ee {
|
|
|
2820
2834
|
if (c.drawingType === x.DRAWING_CHART)
|
|
2821
2835
|
return {
|
|
2822
2836
|
...c,
|
|
2823
|
-
componentKey: this._componetManager.get(
|
|
2837
|
+
componentKey: this._componetManager.get(Di)
|
|
2824
2838
|
};
|
|
2825
2839
|
if (c.drawingType === x.DRAWING_DOM) {
|
|
2826
2840
|
const l = this._sheetPrintInterceptorService.getPrintComponent(c.componentKey);
|
|
@@ -2830,12 +2844,12 @@ let jt = class extends ee {
|
|
|
2830
2844
|
};
|
|
2831
2845
|
}
|
|
2832
2846
|
return null;
|
|
2833
|
-
}).filter(Boolean), d =
|
|
2834
|
-
return
|
|
2847
|
+
}).filter(Boolean), d = hs(so, this._injector);
|
|
2848
|
+
return Ji(
|
|
2835
2849
|
/* @__PURE__ */ L(d, { floatDomInfos: a, scene: t.scene, skeleton: t.skeleton, worksheet: t.worksheet }),
|
|
2836
2850
|
t.root
|
|
2837
2851
|
), i == null || i.add(() => {
|
|
2838
|
-
|
|
2852
|
+
Zi(t.root);
|
|
2839
2853
|
}), e(i);
|
|
2840
2854
|
}
|
|
2841
2855
|
}
|
|
@@ -2844,21 +2858,21 @@ let jt = class extends ee {
|
|
|
2844
2858
|
);
|
|
2845
2859
|
}
|
|
2846
2860
|
};
|
|
2847
|
-
jt =
|
|
2861
|
+
jt = ao([
|
|
2848
2862
|
Me(0, A(li)),
|
|
2849
2863
|
Me(1, A(Ar)),
|
|
2850
2864
|
Me(2, ae),
|
|
2851
|
-
Me(3,
|
|
2865
|
+
Me(3, ee),
|
|
2852
2866
|
Me(4, A(lt)),
|
|
2853
2867
|
Me(5, A(Pr)),
|
|
2854
2868
|
Me(6, A(qe))
|
|
2855
2869
|
], jt);
|
|
2856
|
-
var
|
|
2857
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
2870
|
+
var co = Object.getOwnPropertyDescriptor, lo = (i, t, e, n) => {
|
|
2871
|
+
for (var r = n > 1 ? void 0 : n ? co(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
2858
2872
|
(o = i[s]) && (r = o(r) || r);
|
|
2859
2873
|
return r;
|
|
2860
|
-
},
|
|
2861
|
-
const
|
|
2874
|
+
}, Se = (i, t) => (e, n) => t(e, n, i);
|
|
2875
|
+
const uo = [
|
|
2862
2876
|
mr.id,
|
|
2863
2877
|
fr.id,
|
|
2864
2878
|
pr.id,
|
|
@@ -2867,8 +2881,8 @@ const lo = [
|
|
|
2867
2881
|
Sr.id,
|
|
2868
2882
|
vr.id,
|
|
2869
2883
|
Ir.id,
|
|
2870
|
-
fn.id,
|
|
2871
2884
|
pn.id,
|
|
2885
|
+
wn.id,
|
|
2872
2886
|
Cr.id,
|
|
2873
2887
|
Rr.id,
|
|
2874
2888
|
Dr.id,
|
|
@@ -2878,17 +2892,17 @@ const lo = [
|
|
|
2878
2892
|
Er.id,
|
|
2879
2893
|
Tr.id,
|
|
2880
2894
|
Or.id
|
|
2881
|
-
],
|
|
2882
|
-
ji.id,
|
|
2895
|
+
], ho = [
|
|
2883
2896
|
Fi.id,
|
|
2884
2897
|
Li.id,
|
|
2885
2898
|
Hi.id,
|
|
2886
2899
|
Vi.id,
|
|
2887
|
-
gr.id,
|
|
2888
2900
|
Gi.id,
|
|
2889
|
-
|
|
2901
|
+
gr.id,
|
|
2902
|
+
Yi.id,
|
|
2903
|
+
Xi.id
|
|
2890
2904
|
];
|
|
2891
|
-
let
|
|
2905
|
+
let Dn = class extends te {
|
|
2892
2906
|
constructor(i, t, e, n, r, s, o, a, d) {
|
|
2893
2907
|
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();
|
|
2894
2908
|
}
|
|
@@ -2897,7 +2911,7 @@ let Rn = class extends ee {
|
|
|
2897
2911
|
this._sheetInterceptorService.interceptAfterCommand({
|
|
2898
2912
|
/* eslint-disable-next-line complexity */
|
|
2899
2913
|
getMutations: (i) => {
|
|
2900
|
-
if (!
|
|
2914
|
+
if (!uo.includes(i.id))
|
|
2901
2915
|
return { redos: [], undos: [] };
|
|
2902
2916
|
if (i.params == null)
|
|
2903
2917
|
return { redos: [], undos: [] };
|
|
@@ -2946,8 +2960,8 @@ let Rn = class extends ee {
|
|
|
2946
2960
|
} else if (t === Mr.id || t === yr.id) {
|
|
2947
2961
|
const e = i.params, { unitId: n, subUnitId: r, ranges: s } = e;
|
|
2948
2962
|
return this._getDrawingUndoForColVisible(n, r, s);
|
|
2949
|
-
} else if (t ===
|
|
2950
|
-
const e = i.params, { unitId: n, subUnitId: r, ranges: s } = e, o = t ===
|
|
2963
|
+
} else if (t === pn.id || t === wn.id || t === Cr.id || t === Rr.id) {
|
|
2964
|
+
const e = i.params, { unitId: n, subUnitId: r, ranges: s } = e, o = t === pn.id || t === wn.id;
|
|
2951
2965
|
return this._getDrawingUndoForRowAndColSize(n, r, s, o);
|
|
2952
2966
|
}
|
|
2953
2967
|
return { redos: [], undos: [] };
|
|
@@ -2979,38 +2993,38 @@ let Rn = class extends ee {
|
|
|
2979
2993
|
};
|
|
2980
2994
|
}
|
|
2981
2995
|
_getUpdateOrDeleteDrawings(i, t, e) {
|
|
2982
|
-
const n = [], r = [], { sheetTransform: s, anchorType: o = O.Position, transform: a, unitId: d, subUnitId: u, drawingId: c } = e, { from: l, to: g } = s, { row: h, column: m } = l, { row:
|
|
2996
|
+
const n = [], r = [], { sheetTransform: s, anchorType: o = O.Position, transform: a, unitId: d, subUnitId: u, drawingId: c } = e, { from: l, to: g } = s, { row: h, column: m } = l, { row: p, column: f } = g;
|
|
2983
2997
|
if (s == null || a == null)
|
|
2984
2998
|
return {
|
|
2985
2999
|
updateDrawings: n,
|
|
2986
3000
|
deleteDrawings: r
|
|
2987
3001
|
};
|
|
2988
|
-
const { startRow: w, endRow:
|
|
3002
|
+
const { startRow: w, endRow: _, startColumn: I, endColumn: R } = i;
|
|
2989
3003
|
let v = null, C = null;
|
|
2990
|
-
if (t === 0 && h >= w &&
|
|
2991
|
-
if (m >= I &&
|
|
3004
|
+
if (t === 0 && h >= w && p <= _)
|
|
3005
|
+
if (m >= I && f <= R)
|
|
2992
3006
|
r.push({ unitId: d, subUnitId: u, drawingId: c });
|
|
2993
3007
|
else {
|
|
2994
|
-
const
|
|
2995
|
-
v =
|
|
3008
|
+
const S = this._shrinkCol(s, a, I, R, o);
|
|
3009
|
+
v = S == null ? void 0 : S.newSheetTransform, C = S == null ? void 0 : S.newTransform;
|
|
2996
3010
|
}
|
|
2997
|
-
else if (t === 1 && m >= I &&
|
|
2998
|
-
if (h >= w &&
|
|
3011
|
+
else if (t === 1 && m >= I && f <= R)
|
|
3012
|
+
if (h >= w && p <= _)
|
|
2999
3013
|
r.push({ unitId: d, subUnitId: u, drawingId: c });
|
|
3000
3014
|
else {
|
|
3001
|
-
const
|
|
3002
|
-
v =
|
|
3015
|
+
const S = this._shrinkRow(s, a, w, _, o);
|
|
3016
|
+
v = S == null ? void 0 : S.newSheetTransform, C = S == null ? void 0 : S.newTransform;
|
|
3003
3017
|
}
|
|
3004
3018
|
else if (t === 2) {
|
|
3005
|
-
const
|
|
3006
|
-
v =
|
|
3019
|
+
const S = this._expandRow(s, a, w, _, o);
|
|
3020
|
+
v = S == null ? void 0 : S.newSheetTransform, C = S == null ? void 0 : S.newTransform;
|
|
3007
3021
|
} else if (t === 3) {
|
|
3008
|
-
const
|
|
3009
|
-
v =
|
|
3022
|
+
const S = this._expandCol(s, a, I, R, o);
|
|
3023
|
+
v = S == null ? void 0 : S.newSheetTransform, C = S == null ? void 0 : S.newTransform;
|
|
3010
3024
|
}
|
|
3011
3025
|
if (v != null && C != null) {
|
|
3012
|
-
const
|
|
3013
|
-
n.push({ ...e, sheetTransform: v, transform:
|
|
3026
|
+
const S = J(v, this._selectionRenderService, this._skeletonManagerService);
|
|
3027
|
+
n.push({ ...e, sheetTransform: v, transform: S });
|
|
3014
3028
|
}
|
|
3015
3029
|
return { updateDrawings: n, deleteDrawings: r };
|
|
3016
3030
|
}
|
|
@@ -3029,15 +3043,15 @@ let Rn = class extends ee {
|
|
|
3029
3043
|
if (m === O.None)
|
|
3030
3044
|
this._remainDrawingSize(h, r, l);
|
|
3031
3045
|
else {
|
|
3032
|
-
const { from:
|
|
3046
|
+
const { from: p, to: f } = g, { row: w, column: _ } = p, { row: I, column: R } = f;
|
|
3033
3047
|
for (let v = 0; v < e.length; v++) {
|
|
3034
|
-
const C = e[v], { startRow:
|
|
3035
|
-
if (
|
|
3048
|
+
const C = e[v], { startRow: S, endRow: y, startColumn: D, endColumn: E } = C;
|
|
3049
|
+
if (R < D)
|
|
3036
3050
|
continue;
|
|
3037
3051
|
if (m === O.Position) {
|
|
3038
3052
|
let b = null, N = null;
|
|
3039
|
-
if (
|
|
3040
|
-
const F = this._skeletonManagerService.attachRangeWithCoord({ startColumn:
|
|
3053
|
+
if (_ >= D && _ <= E) {
|
|
3054
|
+
const F = this._skeletonManagerService.attachRangeWithCoord({ startColumn: _, endColumn: E, startRow: p.row, endRow: f.row });
|
|
3041
3055
|
if (F == null)
|
|
3042
3056
|
return;
|
|
3043
3057
|
N = { ...h, left: F.startX };
|
|
@@ -3049,11 +3063,11 @@ let Rn = class extends ee {
|
|
|
3049
3063
|
this._remainDrawingSize(h, r, l);
|
|
3050
3064
|
continue;
|
|
3051
3065
|
}
|
|
3052
|
-
if (
|
|
3066
|
+
if (_ >= D && R <= E)
|
|
3053
3067
|
continue;
|
|
3054
3068
|
let T = null, M = null;
|
|
3055
|
-
if (
|
|
3056
|
-
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn:
|
|
3069
|
+
if (_ >= D && _ <= E) {
|
|
3070
|
+
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: _, endColumn: E, startRow: p.row, endRow: f.row });
|
|
3057
3071
|
if (b == null)
|
|
3058
3072
|
return;
|
|
3059
3073
|
M = {
|
|
@@ -3061,8 +3075,8 @@ let Rn = class extends ee {
|
|
|
3061
3075
|
left: (b == null ? void 0 : b.startX) || 0,
|
|
3062
3076
|
width: ((h == null ? void 0 : h.width) || 0) - b.endX + b.startX
|
|
3063
3077
|
};
|
|
3064
|
-
} else if (
|
|
3065
|
-
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn:
|
|
3078
|
+
} else if (R >= D && R <= E) {
|
|
3079
|
+
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: D, endColumn: R, startRow: p.row, endRow: f.row });
|
|
3066
3080
|
if (b == null)
|
|
3067
3081
|
return;
|
|
3068
3082
|
M = {
|
|
@@ -3070,7 +3084,7 @@ let Rn = class extends ee {
|
|
|
3070
3084
|
left: b.startX - ((h == null ? void 0 : h.width) || 0)
|
|
3071
3085
|
};
|
|
3072
3086
|
} else {
|
|
3073
|
-
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn:
|
|
3087
|
+
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: D, endColumn: E, startRow: p.row, endRow: f.row });
|
|
3074
3088
|
if (b == null)
|
|
3075
3089
|
return;
|
|
3076
3090
|
if (M = {
|
|
@@ -3123,15 +3137,15 @@ let Rn = class extends ee {
|
|
|
3123
3137
|
if (m === O.None)
|
|
3124
3138
|
this._remainDrawingSize(h, r, l);
|
|
3125
3139
|
else {
|
|
3126
|
-
const { from:
|
|
3140
|
+
const { from: p, to: f } = g, { row: w, column: _ } = p, { row: I, column: R } = f;
|
|
3127
3141
|
for (let v = 0; v < e.length; v++) {
|
|
3128
|
-
const C = e[v], { startRow:
|
|
3129
|
-
if (I <
|
|
3142
|
+
const C = e[v], { startRow: S, endRow: y, startColumn: D, endColumn: E } = C;
|
|
3143
|
+
if (I < S)
|
|
3130
3144
|
continue;
|
|
3131
3145
|
if (m === O.Position) {
|
|
3132
3146
|
let b = null, N = null;
|
|
3133
|
-
if (w >=
|
|
3134
|
-
const F = this._skeletonManagerService.attachRangeWithCoord({ startColumn:
|
|
3147
|
+
if (w >= S && w <= y) {
|
|
3148
|
+
const F = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: f.column, startRow: w, endRow: y });
|
|
3135
3149
|
if (F == null)
|
|
3136
3150
|
return;
|
|
3137
3151
|
N = { ...h, top: F.startY };
|
|
@@ -3143,11 +3157,11 @@ let Rn = class extends ee {
|
|
|
3143
3157
|
this._remainDrawingSize(h, r, l);
|
|
3144
3158
|
continue;
|
|
3145
3159
|
}
|
|
3146
|
-
if (w >=
|
|
3160
|
+
if (w >= S && I <= y)
|
|
3147
3161
|
continue;
|
|
3148
3162
|
let T = null, M = null;
|
|
3149
|
-
if (w >=
|
|
3150
|
-
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn:
|
|
3163
|
+
if (w >= S && w <= y) {
|
|
3164
|
+
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: f.column, startRow: w, endRow: y });
|
|
3151
3165
|
if (b == null)
|
|
3152
3166
|
return;
|
|
3153
3167
|
M = {
|
|
@@ -3155,8 +3169,8 @@ let Rn = class extends ee {
|
|
|
3155
3169
|
top: (b == null ? void 0 : b.startY) || 0,
|
|
3156
3170
|
height: ((h == null ? void 0 : h.height) || 0) - b.endY + b.startY
|
|
3157
3171
|
};
|
|
3158
|
-
} else if (I >=
|
|
3159
|
-
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn:
|
|
3172
|
+
} else if (I >= S && I <= y) {
|
|
3173
|
+
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: f.column, startRow: S, endRow: I });
|
|
3160
3174
|
if (b == null)
|
|
3161
3175
|
return;
|
|
3162
3176
|
M = {
|
|
@@ -3164,7 +3178,7 @@ let Rn = class extends ee {
|
|
|
3164
3178
|
top: b.startY - ((h == null ? void 0 : h.height) || 0)
|
|
3165
3179
|
};
|
|
3166
3180
|
} else {
|
|
3167
|
-
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn:
|
|
3181
|
+
const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: f.column, startRow: S, endRow: y });
|
|
3168
3182
|
if (b == null)
|
|
3169
3183
|
return;
|
|
3170
3184
|
if (M = {
|
|
@@ -3203,20 +3217,20 @@ let Rn = class extends ee {
|
|
|
3203
3217
|
if (c === O.None)
|
|
3204
3218
|
this._remainDrawingSize(u, s, a);
|
|
3205
3219
|
else {
|
|
3206
|
-
const { from: l, to: g } = d, { row: h, column: m } = l, { row:
|
|
3220
|
+
const { from: l, to: g } = d, { row: h, column: m } = l, { row: p, column: f } = g;
|
|
3207
3221
|
for (let w = 0; w < e.length; w++) {
|
|
3208
|
-
const
|
|
3209
|
-
if (
|
|
3222
|
+
const _ = e[w], { startRow: I, endRow: R, startColumn: v, endColumn: C } = _;
|
|
3223
|
+
if (p < I || f < v)
|
|
3210
3224
|
continue;
|
|
3211
|
-
if (c === O.Position && (h <= I &&
|
|
3225
|
+
if (c === O.Position && (h <= I && p >= R || m <= v && f >= C)) {
|
|
3212
3226
|
this._remainDrawingSize(u, s, a);
|
|
3213
3227
|
continue;
|
|
3214
3228
|
}
|
|
3215
|
-
const
|
|
3216
|
-
if (
|
|
3229
|
+
const S = J({ ...d }, this._selectionRenderService, this._skeletonManagerService);
|
|
3230
|
+
if (S != null) {
|
|
3217
3231
|
s.push({
|
|
3218
3232
|
...a,
|
|
3219
|
-
transform:
|
|
3233
|
+
transform: S
|
|
3220
3234
|
});
|
|
3221
3235
|
break;
|
|
3222
3236
|
}
|
|
@@ -3237,11 +3251,11 @@ let Rn = class extends ee {
|
|
|
3237
3251
|
return { unitId: e, subUnitId: n };
|
|
3238
3252
|
}
|
|
3239
3253
|
_moveRangeInterceptor(i) {
|
|
3240
|
-
var I,
|
|
3254
|
+
var I, R;
|
|
3241
3255
|
const { toRange: t, fromRange: e } = i, n = se(this._univerInstanceService);
|
|
3242
3256
|
if (!n)
|
|
3243
3257
|
return { redos: [], undos: [] };
|
|
3244
|
-
const { unitId: r, subUnitId: s } = n, o = (
|
|
3258
|
+
const { unitId: r, subUnitId: s } = n, o = (R = (I = this._renderManagerService.getRenderById(r)) == null ? void 0 : I.with(X)) == null ? void 0 : R.getCurrentSkeleton();
|
|
3245
3259
|
if (!o)
|
|
3246
3260
|
return { redos: [], undos: [] };
|
|
3247
3261
|
const a = dr(o, e);
|
|
@@ -3252,35 +3266,35 @@ let Rn = class extends ee {
|
|
|
3252
3266
|
const C = g[v];
|
|
3253
3267
|
if (C.anchorType !== O.Both)
|
|
3254
3268
|
return;
|
|
3255
|
-
const { transform:
|
|
3256
|
-
if (!
|
|
3269
|
+
const { transform: S } = C;
|
|
3270
|
+
if (!S)
|
|
3257
3271
|
return;
|
|
3258
|
-
const { left: y = 0, top:
|
|
3272
|
+
const { left: y = 0, top: D = 0, width: E = 0, height: T = 0 } = S, { drawingStartX: M, drawingEndX: b, drawingStartY: N, drawingEndY: F } = {
|
|
3259
3273
|
drawingStartX: y,
|
|
3260
3274
|
drawingEndX: y + E,
|
|
3261
|
-
drawingStartY:
|
|
3262
|
-
drawingEndY:
|
|
3275
|
+
drawingStartY: D,
|
|
3276
|
+
drawingEndY: D + T
|
|
3263
3277
|
};
|
|
3264
3278
|
d <= M && b <= u && c <= N && F <= l && h.push(C);
|
|
3265
3279
|
});
|
|
3266
|
-
const m = [],
|
|
3267
|
-
const C = v.sheetTransform,
|
|
3268
|
-
to: { ...C.to, row: C.to.row +
|
|
3269
|
-
from: { ...C.from, row: C.from.row +
|
|
3270
|
-
}, y = J(
|
|
3280
|
+
const m = [], p = [], f = t.startRow - e.startRow, w = t.startColumn - e.startColumn, _ = h.map((v) => {
|
|
3281
|
+
const C = v.sheetTransform, S = {
|
|
3282
|
+
to: { ...C.to, row: C.to.row + f, column: C.to.column + w },
|
|
3283
|
+
from: { ...C.from, row: C.from.row + f, column: C.from.column + w }
|
|
3284
|
+
}, y = J(S, this._selectionRenderService, this._skeletonManagerService);
|
|
3271
3285
|
return {
|
|
3272
3286
|
unitId: r,
|
|
3273
3287
|
subUnitId: s,
|
|
3274
3288
|
drawingId: v.drawingId,
|
|
3275
3289
|
transform: y,
|
|
3276
|
-
sheetTransform:
|
|
3290
|
+
sheetTransform: S
|
|
3277
3291
|
};
|
|
3278
3292
|
});
|
|
3279
|
-
if (
|
|
3280
|
-
const v = this._sheetDrawingService.getBatchUpdateOp(
|
|
3281
|
-
m.push({ id: P.id, params: { unitId: r, subUnitId: s, op:
|
|
3293
|
+
if (_.length) {
|
|
3294
|
+
const v = this._sheetDrawingService.getBatchUpdateOp(_), { undo: C, redo: S, objects: y } = v;
|
|
3295
|
+
m.push({ id: P.id, params: { unitId: r, subUnitId: s, op: S, objects: y, type: U.UPDATE } }), p.push({ id: P.id, params: { unitId: r, subUnitId: s, op: C, objects: y, type: U.UPDATE } });
|
|
3282
3296
|
}
|
|
3283
|
-
return { redos: m, undos:
|
|
3297
|
+
return { redos: m, undos: p };
|
|
3284
3298
|
}
|
|
3285
3299
|
_moveRowInterceptor(i, t) {
|
|
3286
3300
|
const e = this._getUnitIdAndSubUnitId(i, t);
|
|
@@ -3288,35 +3302,35 @@ let Rn = class extends ee {
|
|
|
3288
3302
|
return { redos: [], undos: [] };
|
|
3289
3303
|
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 = [];
|
|
3290
3304
|
if (Object.keys(c).forEach((h) => {
|
|
3291
|
-
const m = c[h], { sheetTransform:
|
|
3292
|
-
if (
|
|
3305
|
+
const m = c[h], { sheetTransform: p, transform: f, anchorType: w = O.Position } = m;
|
|
3306
|
+
if (p == null || f == null)
|
|
3293
3307
|
return;
|
|
3294
|
-
let
|
|
3308
|
+
let _, I;
|
|
3295
3309
|
if (t === "insert") {
|
|
3296
|
-
const v = this._expandRow(
|
|
3297
|
-
|
|
3310
|
+
const v = this._expandRow(p, f, o, a, w);
|
|
3311
|
+
_ = v == null ? void 0 : v.newSheetTransform, I = v == null ? void 0 : v.newTransform;
|
|
3298
3312
|
} else {
|
|
3299
|
-
const { from: v, to: C } =
|
|
3300
|
-
if (w === O.Both &&
|
|
3313
|
+
const { from: v, to: C } = p, { row: S } = v, { row: y } = C;
|
|
3314
|
+
if (w === O.Both && S >= o && y <= a)
|
|
3301
3315
|
g.push({ unitId: n, subUnitId: r, drawingId: h });
|
|
3302
3316
|
else {
|
|
3303
|
-
const
|
|
3304
|
-
|
|
3317
|
+
const D = this._shrinkRow(p, f, o, a, w);
|
|
3318
|
+
_ = D == null ? void 0 : D.newSheetTransform, I = D == null ? void 0 : D.newTransform;
|
|
3305
3319
|
}
|
|
3306
3320
|
}
|
|
3307
|
-
if (!
|
|
3321
|
+
if (!_ || !I)
|
|
3308
3322
|
return;
|
|
3309
|
-
const
|
|
3310
|
-
l.push(
|
|
3323
|
+
const R = { unitId: n, subUnitId: r, drawingId: h, transform: I, sheetTransform: _ };
|
|
3324
|
+
l.push(R);
|
|
3311
3325
|
}), l.length === 0 && g.length === 0)
|
|
3312
3326
|
return { redos: [], undos: [] };
|
|
3313
3327
|
if (l.length > 0) {
|
|
3314
|
-
const h = this._sheetDrawingService.getBatchUpdateOp(l), { undo: m, redo:
|
|
3315
|
-
d.push({ id: P.id, params: { unitId: n, subUnitId: r, op:
|
|
3328
|
+
const h = this._sheetDrawingService.getBatchUpdateOp(l), { undo: m, redo: p, objects: f } = h;
|
|
3329
|
+
d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: p, objects: f, type: U.UPDATE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: m, objects: f, type: U.UPDATE } });
|
|
3316
3330
|
}
|
|
3317
3331
|
if (g.length > 0) {
|
|
3318
|
-
const h = this._sheetDrawingService.getBatchRemoveOp(g), m = h.undo,
|
|
3319
|
-
d.push({ id: P.id, params: { unitId: n, subUnitId: r, op:
|
|
3332
|
+
const h = this._sheetDrawingService.getBatchRemoveOp(g), m = h.undo, p = h.redo, f = h.objects;
|
|
3333
|
+
d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: p, objects: f, type: U.REMOVE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: m, objects: f, type: U.INSERT } });
|
|
3320
3334
|
}
|
|
3321
3335
|
return d.push({ id: H.id, params: [n] }), u.push({ id: H.id, params: [n] }), {
|
|
3322
3336
|
redos: d,
|
|
@@ -3329,35 +3343,35 @@ let Rn = class extends ee {
|
|
|
3329
3343
|
return { redos: [], undos: [] };
|
|
3330
3344
|
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 = [];
|
|
3331
3345
|
if (Object.keys(c).forEach((h) => {
|
|
3332
|
-
const m = c[h], { sheetTransform:
|
|
3333
|
-
if (
|
|
3346
|
+
const m = c[h], { sheetTransform: p, transform: f, anchorType: w = O.Position } = m;
|
|
3347
|
+
if (p == null || f == null)
|
|
3334
3348
|
return;
|
|
3335
|
-
let
|
|
3349
|
+
let _, I;
|
|
3336
3350
|
if (t === "insert") {
|
|
3337
|
-
const v = this._expandCol(
|
|
3338
|
-
|
|
3351
|
+
const v = this._expandCol(p, f, o, a, w);
|
|
3352
|
+
_ = v == null ? void 0 : v.newSheetTransform, I = v == null ? void 0 : v.newTransform;
|
|
3339
3353
|
} else {
|
|
3340
|
-
const { from: v, to: C } =
|
|
3341
|
-
if (w === O.Both &&
|
|
3354
|
+
const { from: v, to: C } = p, { column: S } = v, { column: y } = C;
|
|
3355
|
+
if (w === O.Both && S >= o && y <= a)
|
|
3342
3356
|
g.push({ unitId: n, subUnitId: r, drawingId: h });
|
|
3343
3357
|
else {
|
|
3344
|
-
const
|
|
3345
|
-
|
|
3358
|
+
const D = this._shrinkCol(p, f, o, a, w);
|
|
3359
|
+
_ = D == null ? void 0 : D.newSheetTransform, I = D == null ? void 0 : D.newTransform;
|
|
3346
3360
|
}
|
|
3347
3361
|
}
|
|
3348
|
-
if (!
|
|
3362
|
+
if (!_ || !I)
|
|
3349
3363
|
return;
|
|
3350
|
-
const
|
|
3351
|
-
l.push(
|
|
3364
|
+
const R = { unitId: n, subUnitId: r, drawingId: h, transform: I, sheetTransform: _ };
|
|
3365
|
+
l.push(R);
|
|
3352
3366
|
}), l.length === 0 && g.length === 0)
|
|
3353
3367
|
return { redos: [], undos: [] };
|
|
3354
3368
|
if (l.length > 0) {
|
|
3355
|
-
const h = this._sheetDrawingService.getBatchUpdateOp(l), { undo: m, redo:
|
|
3356
|
-
d.push({ id: P.id, params: { unitId: n, subUnitId: r, op:
|
|
3369
|
+
const h = this._sheetDrawingService.getBatchUpdateOp(l), { undo: m, redo: p, objects: f } = h;
|
|
3370
|
+
d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: p, objects: f, type: U.UPDATE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: m, objects: f, type: U.UPDATE } });
|
|
3357
3371
|
}
|
|
3358
3372
|
if (g.length > 0) {
|
|
3359
|
-
const h = this._sheetDrawingService.getBatchRemoveOp(g), m = h.undo,
|
|
3360
|
-
d.push({ id: P.id, params: { unitId: n, subUnitId: r, op:
|
|
3373
|
+
const h = this._sheetDrawingService.getBatchRemoveOp(g), m = h.undo, p = h.redo, f = h.objects;
|
|
3374
|
+
d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: p, objects: f, type: U.REMOVE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: m, objects: f, type: U.INSERT } });
|
|
3361
3375
|
}
|
|
3362
3376
|
return d.push({ id: H.id, params: [n] }), u.push({ id: H.id, params: [n] }), { redos: d, undos: u };
|
|
3363
3377
|
}
|
|
@@ -3537,7 +3551,7 @@ let Rn = class extends ee {
|
|
|
3537
3551
|
// but the skeleton changes like other render modules. These two signals are not equivalent.
|
|
3538
3552
|
// As a temp solution, I subscribed to activate$ here.
|
|
3539
3553
|
this._commandService.onCommandExecuted((i) => {
|
|
3540
|
-
if (i.id ===
|
|
3554
|
+
if (i.id === zi.id) {
|
|
3541
3555
|
const { unitId: t, subUnitId: e } = i.params;
|
|
3542
3556
|
this._updateDrawings(t, e);
|
|
3543
3557
|
}
|
|
@@ -3588,7 +3602,7 @@ let Rn = class extends ee {
|
|
|
3588
3602
|
_sheetRefreshListener() {
|
|
3589
3603
|
this.disposeWithMe(
|
|
3590
3604
|
this._commandService.onCommandExecuted((i) => {
|
|
3591
|
-
|
|
3605
|
+
ho.includes(i.id) && requestIdleCallback(() => {
|
|
3592
3606
|
const t = i.params, e = se(this._univerInstanceService, t);
|
|
3593
3607
|
if (!e) return;
|
|
3594
3608
|
const { unitId: n, subUnitId: r, worksheet: s } = e;
|
|
@@ -3609,30 +3623,30 @@ let Rn = class extends ee {
|
|
|
3609
3623
|
const o = n[s], { sheetTransform: a, transform: d, anchorType: u = O.Position } = o;
|
|
3610
3624
|
if (u === O.None)
|
|
3611
3625
|
return !0;
|
|
3612
|
-
const { from: c, to: l } = a, { row: g, column: h } = c, { row: m, column:
|
|
3613
|
-
for (let
|
|
3614
|
-
const w = e[
|
|
3615
|
-
if (
|
|
3626
|
+
const { from: c, to: l } = a, { row: g, column: h } = c, { row: m, column: p } = l;
|
|
3627
|
+
for (let f = 0; f < e.length; f++) {
|
|
3628
|
+
const w = e[f], { startRow: _, endRow: I, startColumn: R, endColumn: v } = w;
|
|
3629
|
+
if (bi.intersects(
|
|
3616
3630
|
{
|
|
3617
|
-
startRow:
|
|
3631
|
+
startRow: _,
|
|
3618
3632
|
endRow: I,
|
|
3619
|
-
startColumn:
|
|
3633
|
+
startColumn: R,
|
|
3620
3634
|
endColumn: v
|
|
3621
3635
|
},
|
|
3622
3636
|
{
|
|
3623
3637
|
startRow: g,
|
|
3624
3638
|
endRow: m,
|
|
3625
3639
|
startColumn: h,
|
|
3626
|
-
endColumn:
|
|
3640
|
+
endColumn: p
|
|
3627
3641
|
}
|
|
3628
3642
|
) || g > I || h > v) {
|
|
3629
|
-
const C = u === O.Position,
|
|
3643
|
+
const C = u === O.Position, S = J(a, this._selectionRenderService, this._skeletonManagerService);
|
|
3630
3644
|
r.push({
|
|
3631
3645
|
...o,
|
|
3632
3646
|
transform: {
|
|
3633
|
-
...
|
|
3634
|
-
width: C ? d == null ? void 0 : d.width :
|
|
3635
|
-
height: C ? d == null ? void 0 : d.height :
|
|
3647
|
+
...S,
|
|
3648
|
+
width: C ? d == null ? void 0 : d.width : S == null ? void 0 : S.width,
|
|
3649
|
+
height: C ? d == null ? void 0 : d.height : S == null ? void 0 : S.height
|
|
3636
3650
|
}
|
|
3637
3651
|
});
|
|
3638
3652
|
break;
|
|
@@ -3641,41 +3655,41 @@ let Rn = class extends ee {
|
|
|
3641
3655
|
}), r.length !== 0 && (this._drawingManagerService.refreshTransform(r), this._commandService.syncExecuteCommand(H.id, [i]));
|
|
3642
3656
|
}
|
|
3643
3657
|
};
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
],
|
|
3654
|
-
function
|
|
3655
|
-
const i =
|
|
3658
|
+
Dn = lo([
|
|
3659
|
+
Se(1, ee),
|
|
3660
|
+
Se(2, G),
|
|
3661
|
+
Se(3, Je),
|
|
3662
|
+
Se(4, A(X)),
|
|
3663
|
+
Se(5, A(Ht)),
|
|
3664
|
+
Se(6, oe),
|
|
3665
|
+
Se(7, ae),
|
|
3666
|
+
Se(8, le)
|
|
3667
|
+
], Dn);
|
|
3668
|
+
function go() {
|
|
3669
|
+
const i = Ce(Te), t = Ce(Mn), e = Ce(En), [n, r] = Ee([ye.CELL_ADDRESS]), [s, o] = Ee(!1), [a, d] = Ee(null), u = Fe(() => e.getCellImagesInSelection(), [e]), c = Fe(() => e.getDataColumns(), [e]), l = Fe(() => e.getSelectionRowRange(), [e]), g = c.length > 0, h = Fe(() => c.map((C) => ({
|
|
3656
3670
|
label: C.label,
|
|
3657
3671
|
value: String(C.index)
|
|
3658
|
-
})), [c]), [m,
|
|
3672
|
+
})), [c]), [m, p] = Ee(
|
|
3659
3673
|
() => h.length > 0 ? h[0].value : "0"
|
|
3660
|
-
),
|
|
3674
|
+
), f = Fe(() => {
|
|
3661
3675
|
if (!n.includes(ye.COLUMN_VALUE) || !l)
|
|
3662
3676
|
return [];
|
|
3663
|
-
const
|
|
3677
|
+
const S = Number(m);
|
|
3664
3678
|
return [{
|
|
3665
3679
|
startRow: l.startRow,
|
|
3666
3680
|
endRow: l.endRow,
|
|
3667
|
-
startColumn:
|
|
3668
|
-
endColumn:
|
|
3681
|
+
startColumn: S,
|
|
3682
|
+
endColumn: S
|
|
3669
3683
|
}];
|
|
3670
3684
|
}, [n, m, l]);
|
|
3671
|
-
ui(
|
|
3685
|
+
ui(f);
|
|
3672
3686
|
const w = Et((C) => {
|
|
3673
3687
|
C.length !== 0 && r(C);
|
|
3674
|
-
}, []),
|
|
3675
|
-
|
|
3688
|
+
}, []), _ = Et((C) => {
|
|
3689
|
+
p(String(C));
|
|
3676
3690
|
}, []), I = Et(() => {
|
|
3677
3691
|
t.close(ze);
|
|
3678
|
-
}, [t]),
|
|
3692
|
+
}, [t]), R = Et(async () => {
|
|
3679
3693
|
if (u.length !== 0) {
|
|
3680
3694
|
o(!0), d(null);
|
|
3681
3695
|
try {
|
|
@@ -3692,16 +3706,16 @@ function ho() {
|
|
|
3692
3706
|
}, [e, u, n, m, t, i]), v = n.includes(ye.COLUMN_VALUE);
|
|
3693
3707
|
return /* @__PURE__ */ Xe("div", { className: "univer-flex univer-flex-col", children: [
|
|
3694
3708
|
/* @__PURE__ */ L(en, { label: i.t("sheetImage.save.imageCount"), children: /* @__PURE__ */ L("div", { className: "univer-text-sm univer-text-gray-600", children: u.length }) }),
|
|
3695
|
-
/* @__PURE__ */ L(en, { label: i.t("sheetImage.save.fileNameConfig"), children: /* @__PURE__ */ Xe(
|
|
3696
|
-
/* @__PURE__ */ L(
|
|
3697
|
-
g && /* @__PURE__ */ L(
|
|
3709
|
+
/* @__PURE__ */ L(en, { label: i.t("sheetImage.save.fileNameConfig"), children: /* @__PURE__ */ Xe(qi, { value: n, onChange: w, direction: "vertical", children: [
|
|
3710
|
+
/* @__PURE__ */ L(Yn, { value: ye.CELL_ADDRESS, disabled: !g, children: i.t("sheetImage.save.useRowCol") }),
|
|
3711
|
+
g && /* @__PURE__ */ L(Yn, { value: ye.COLUMN_VALUE, children: i.t("sheetImage.save.useColumnValue") })
|
|
3698
3712
|
] }) }),
|
|
3699
3713
|
v && /* @__PURE__ */ L(en, { label: i.t("sheetImage.save.selectColumn"), children: /* @__PURE__ */ L(
|
|
3700
|
-
|
|
3714
|
+
Qi,
|
|
3701
3715
|
{
|
|
3702
3716
|
value: m,
|
|
3703
3717
|
options: h,
|
|
3704
|
-
onChange:
|
|
3718
|
+
onChange: _
|
|
3705
3719
|
}
|
|
3706
3720
|
) }),
|
|
3707
3721
|
a && /* @__PURE__ */ L("div", { className: "univer-text-xs univer-text-red-500", children: a }),
|
|
@@ -3710,12 +3724,12 @@ function ho() {
|
|
|
3710
3724
|
{
|
|
3711
3725
|
className: "univer-flex univer-justify-end univer-gap-2 univer-border-t univer-border-gray-200 univer-pt-3",
|
|
3712
3726
|
children: [
|
|
3713
|
-
/* @__PURE__ */ L(
|
|
3727
|
+
/* @__PURE__ */ L(Xn, { onClick: I, disabled: s, children: i.t("sheetImage.save.cancel") }),
|
|
3714
3728
|
/* @__PURE__ */ L(
|
|
3715
|
-
|
|
3729
|
+
Xn,
|
|
3716
3730
|
{
|
|
3717
3731
|
variant: "primary",
|
|
3718
|
-
onClick:
|
|
3732
|
+
onClick: R,
|
|
3719
3733
|
disabled: s || u.length === 0,
|
|
3720
3734
|
children: s ? i.t("sheetImage.save.saving") : i.t("sheetImage.save.confirm")
|
|
3721
3735
|
}
|
|
@@ -3725,24 +3739,24 @@ function ho() {
|
|
|
3725
3739
|
)
|
|
3726
3740
|
] });
|
|
3727
3741
|
}
|
|
3728
|
-
const
|
|
3729
|
-
var
|
|
3730
|
-
const t =
|
|
3742
|
+
const mo = (i) => {
|
|
3743
|
+
var _;
|
|
3744
|
+
const t = Ce(G), e = Ce(Te), n = Ce(ae), r = Ce(ee), { drawings: s } = i, o = s[0];
|
|
3731
3745
|
if (o == null)
|
|
3732
3746
|
return;
|
|
3733
3747
|
const { unitId: a } = o, d = r.getRenderById(a), u = d == null ? void 0 : d.scene;
|
|
3734
3748
|
if (u == null)
|
|
3735
3749
|
return;
|
|
3736
|
-
const c = u.getTransformerByCreate(), [l, g] = Ee(!0), h = (
|
|
3737
|
-
function
|
|
3750
|
+
const c = u.getTransformerByCreate(), [l, g] = Ee(!0), h = (_ = o.anchorType) != null ? _ : O.Position, [m, p] = Ee(h);
|
|
3751
|
+
function f(I, R) {
|
|
3738
3752
|
const v = [];
|
|
3739
3753
|
return I.forEach((C) => {
|
|
3740
|
-
const { oKey:
|
|
3754
|
+
const { oKey: S } = C, y = R.getDrawingOKey(S);
|
|
3741
3755
|
if (y == null)
|
|
3742
3756
|
return v.push(null), !0;
|
|
3743
|
-
const { unitId:
|
|
3757
|
+
const { unitId: D, subUnitId: E, drawingId: T, drawingType: M, anchorType: b, sheetTransform: N } = y;
|
|
3744
3758
|
v.push({
|
|
3745
|
-
unitId:
|
|
3759
|
+
unitId: D,
|
|
3746
3760
|
subUnitId: E,
|
|
3747
3761
|
drawingId: T,
|
|
3748
3762
|
anchorType: b,
|
|
@@ -3754,41 +3768,41 @@ const go = (i) => {
|
|
|
3754
3768
|
Nr(() => {
|
|
3755
3769
|
const I = c.clearControl$.subscribe((v) => {
|
|
3756
3770
|
v === !0 && g(!1);
|
|
3757
|
-
}),
|
|
3771
|
+
}), R = c.changeStart$.subscribe((v) => {
|
|
3758
3772
|
var y;
|
|
3759
|
-
const { objects: C } = v,
|
|
3760
|
-
if (
|
|
3773
|
+
const { objects: C } = v, S = f(C, n);
|
|
3774
|
+
if (S.length === 0)
|
|
3761
3775
|
g(!1);
|
|
3762
|
-
else if (
|
|
3776
|
+
else if (S.length >= 1) {
|
|
3763
3777
|
g(!0);
|
|
3764
|
-
const
|
|
3765
|
-
|
|
3778
|
+
const D = ((y = S[0]) == null ? void 0 : y.anchorType) || O.Position;
|
|
3779
|
+
p(D);
|
|
3766
3780
|
}
|
|
3767
3781
|
});
|
|
3768
3782
|
return () => {
|
|
3769
|
-
|
|
3783
|
+
R.unsubscribe(), I.unsubscribe();
|
|
3770
3784
|
};
|
|
3771
3785
|
}, []);
|
|
3772
3786
|
function w(I) {
|
|
3773
|
-
|
|
3774
|
-
const
|
|
3775
|
-
if (
|
|
3787
|
+
p(I);
|
|
3788
|
+
const R = n.getFocusDrawings();
|
|
3789
|
+
if (R.length === 0)
|
|
3776
3790
|
return;
|
|
3777
|
-
const v =
|
|
3791
|
+
const v = R.map((C) => ({
|
|
3778
3792
|
unitId: C.unitId,
|
|
3779
3793
|
subUnitId: C.subUnitId,
|
|
3780
3794
|
drawingId: C.drawingId,
|
|
3781
3795
|
anchorType: I
|
|
3782
3796
|
}));
|
|
3783
3797
|
t.executeCommand(zt.id, {
|
|
3784
|
-
unitId:
|
|
3798
|
+
unitId: R[0].unitId,
|
|
3785
3799
|
drawings: v
|
|
3786
3800
|
});
|
|
3787
3801
|
}
|
|
3788
3802
|
return /* @__PURE__ */ Xe(
|
|
3789
3803
|
"div",
|
|
3790
3804
|
{
|
|
3791
|
-
className:
|
|
3805
|
+
className: es("univer-grid univer-gap-2 univer-py-2 univer-text-gray-400", {
|
|
3792
3806
|
"univer-hidden": !l
|
|
3793
3807
|
}),
|
|
3794
3808
|
children: [
|
|
@@ -3799,7 +3813,7 @@ const go = (i) => {
|
|
|
3799
3813
|
children: /* @__PURE__ */ L("div", { children: e.t("drawing-anchor.title") })
|
|
3800
3814
|
}
|
|
3801
3815
|
),
|
|
3802
|
-
/* @__PURE__ */ L("div", { children: /* @__PURE__ */ Xe(
|
|
3816
|
+
/* @__PURE__ */ L("div", { children: /* @__PURE__ */ Xe(ts, { value: m, onChange: w, direction: "vertical", children: [
|
|
3803
3817
|
/* @__PURE__ */ L(tn, { value: O.Both, children: e.t("drawing-anchor.both") }),
|
|
3804
3818
|
/* @__PURE__ */ L(tn, { value: O.Position, children: e.t("drawing-anchor.position") }),
|
|
3805
3819
|
/* @__PURE__ */ L(tn, { value: O.None, children: e.t("drawing-anchor.none") })
|
|
@@ -3807,8 +3821,8 @@ const go = (i) => {
|
|
|
3807
3821
|
]
|
|
3808
3822
|
}
|
|
3809
3823
|
);
|
|
3810
|
-
},
|
|
3811
|
-
const i =
|
|
3824
|
+
}, fo = () => {
|
|
3825
|
+
const i = Ce(ae), t = i.getFocusDrawings(), [e, n] = Ee(t);
|
|
3812
3826
|
return Nr(() => {
|
|
3813
3827
|
const r = i.focus$.subscribe((s) => {
|
|
3814
3828
|
n(s);
|
|
@@ -3817,21 +3831,21 @@ const go = (i) => {
|
|
|
3817
3831
|
r.unsubscribe();
|
|
3818
3832
|
};
|
|
3819
3833
|
}, []), !!(e != null && e.length) && /* @__PURE__ */ Xe("div", { className: "univer-text-sm", children: [
|
|
3820
|
-
/* @__PURE__ */ L(
|
|
3821
|
-
/* @__PURE__ */ L(
|
|
3834
|
+
/* @__PURE__ */ L(Cs, { drawings: e }),
|
|
3835
|
+
/* @__PURE__ */ L(mo, { drawings: e })
|
|
3822
3836
|
] });
|
|
3823
3837
|
}, Gr = "sheet.menu.image";
|
|
3824
|
-
function
|
|
3838
|
+
function po(i) {
|
|
3825
3839
|
return {
|
|
3826
3840
|
id: Gr,
|
|
3827
3841
|
type: Yt.SUBITEMS,
|
|
3828
3842
|
icon: "AddImageIcon",
|
|
3829
3843
|
tooltip: "sheetImage.title",
|
|
3830
3844
|
hidden$: Gt(i, k.UNIVER_SHEET),
|
|
3831
|
-
disabled$: hi(i, { workbookTypes: [
|
|
3845
|
+
disabled$: hi(i, { workbookTypes: [mn], worksheetTypes: [fn], rangeTypes: [Ki] })
|
|
3832
3846
|
};
|
|
3833
3847
|
}
|
|
3834
|
-
function
|
|
3848
|
+
function wo(i) {
|
|
3835
3849
|
return {
|
|
3836
3850
|
id: Kt.id,
|
|
3837
3851
|
title: "sheetImage.upload.float",
|
|
@@ -3839,53 +3853,53 @@ function po(i) {
|
|
|
3839
3853
|
hidden$: Gt(i, k.UNIVER_SHEET)
|
|
3840
3854
|
};
|
|
3841
3855
|
}
|
|
3842
|
-
function
|
|
3856
|
+
function _o(i) {
|
|
3843
3857
|
return {
|
|
3844
|
-
id:
|
|
3858
|
+
id: yn.id,
|
|
3845
3859
|
title: "sheetImage.upload.cell",
|
|
3846
3860
|
type: Yt.BUTTON,
|
|
3847
3861
|
hidden$: Gt(i, k.UNIVER_SHEET)
|
|
3848
3862
|
};
|
|
3849
3863
|
}
|
|
3850
|
-
function
|
|
3864
|
+
function So(i) {
|
|
3851
3865
|
var t, e, n, r;
|
|
3852
3866
|
return !!((e = (t = i == null ? void 0 : i.p) == null ? void 0 : t.drawingsOrder) != null && e.length && ((r = (n = i == null ? void 0 : i.p) == null ? void 0 : n.drawingsOrder) == null ? void 0 : r.length) > 0);
|
|
3853
3867
|
}
|
|
3854
|
-
function
|
|
3868
|
+
function vo(i, t) {
|
|
3855
3869
|
const e = i.getActiveSheet();
|
|
3856
3870
|
if (!e) return !1;
|
|
3857
3871
|
const n = e.getCellMatrix(), { startRow: r, endRow: s, startColumn: o, endColumn: a } = t;
|
|
3858
3872
|
for (let d = r; d <= s; d++)
|
|
3859
3873
|
for (let u = o; u <= a; u++) {
|
|
3860
3874
|
const c = n.getValue(d, u);
|
|
3861
|
-
if (
|
|
3875
|
+
if (So(c))
|
|
3862
3876
|
return !0;
|
|
3863
3877
|
}
|
|
3864
3878
|
return !1;
|
|
3865
3879
|
}
|
|
3866
|
-
function
|
|
3880
|
+
function Io() {
|
|
3867
3881
|
return "showDirectoryPicker" in window;
|
|
3868
3882
|
}
|
|
3869
|
-
function
|
|
3870
|
-
const t = i.get(
|
|
3883
|
+
function ln(i) {
|
|
3884
|
+
const t = i.get(le), e = i.get(ut), n = at([
|
|
3871
3885
|
Gt(i, k.UNIVER_SHEET),
|
|
3872
3886
|
t.getCurrentTypeOfUnit$(k.UNIVER_SHEET).pipe(
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
if (!
|
|
3887
|
+
pe((r) => r ? e.selectionMoveEnd$.pipe(
|
|
3888
|
+
we(() => {
|
|
3889
|
+
if (!Io())
|
|
3876
3890
|
return !0;
|
|
3877
3891
|
const s = e.getCurrentSelections();
|
|
3878
3892
|
if (!s || s.length === 0)
|
|
3879
3893
|
return !0;
|
|
3880
3894
|
for (const o of s)
|
|
3881
|
-
if (
|
|
3895
|
+
if (vo(r, o.range))
|
|
3882
3896
|
return !1;
|
|
3883
3897
|
return !0;
|
|
3884
3898
|
})
|
|
3885
|
-
) :
|
|
3899
|
+
) : _n(!0))
|
|
3886
3900
|
)
|
|
3887
3901
|
]).pipe(
|
|
3888
|
-
|
|
3902
|
+
we(([r, s]) => r || s)
|
|
3889
3903
|
);
|
|
3890
3904
|
return {
|
|
3891
3905
|
id: ct.id,
|
|
@@ -3895,18 +3909,18 @@ function dn(i) {
|
|
|
3895
3909
|
hidden$: n
|
|
3896
3910
|
};
|
|
3897
3911
|
}
|
|
3898
|
-
const
|
|
3899
|
-
[
|
|
3912
|
+
const Co = {
|
|
3913
|
+
[gs.MEDIA]: {
|
|
3900
3914
|
[Gr]: {
|
|
3901
3915
|
order: 0,
|
|
3902
|
-
menuItemFactory:
|
|
3916
|
+
menuItemFactory: po,
|
|
3903
3917
|
[Kt.id]: {
|
|
3904
3918
|
order: 0,
|
|
3905
|
-
menuItemFactory:
|
|
3919
|
+
menuItemFactory: wo
|
|
3906
3920
|
},
|
|
3907
|
-
[
|
|
3921
|
+
[yn.id]: {
|
|
3908
3922
|
order: 1,
|
|
3909
|
-
menuItemFactory:
|
|
3923
|
+
menuItemFactory: _o
|
|
3910
3924
|
}
|
|
3911
3925
|
}
|
|
3912
3926
|
},
|
|
@@ -3914,7 +3928,7 @@ const Io = {
|
|
|
3914
3928
|
[sn.OTHERS]: {
|
|
3915
3929
|
[ct.id]: {
|
|
3916
3930
|
order: 10,
|
|
3917
|
-
menuItemFactory:
|
|
3931
|
+
menuItemFactory: ln
|
|
3918
3932
|
}
|
|
3919
3933
|
}
|
|
3920
3934
|
},
|
|
@@ -3922,7 +3936,7 @@ const Io = {
|
|
|
3922
3936
|
[sn.OTHERS]: {
|
|
3923
3937
|
[ct.id]: {
|
|
3924
3938
|
order: 10,
|
|
3925
|
-
menuItemFactory:
|
|
3939
|
+
menuItemFactory: ln
|
|
3926
3940
|
}
|
|
3927
3941
|
}
|
|
3928
3942
|
},
|
|
@@ -3930,15 +3944,15 @@ const Io = {
|
|
|
3930
3944
|
[sn.OTHERS]: {
|
|
3931
3945
|
[ct.id]: {
|
|
3932
3946
|
order: 10,
|
|
3933
|
-
menuItemFactory:
|
|
3947
|
+
menuItemFactory: ln
|
|
3934
3948
|
}
|
|
3935
3949
|
}
|
|
3936
3950
|
}
|
|
3937
3951
|
};
|
|
3938
3952
|
function mt(i) {
|
|
3939
|
-
return i.getContextValue(
|
|
3953
|
+
return i.getContextValue(Mi) && !i.getContextValue(yi) && !i.getContextValue(Ei) && !i.getContextValue(Ti) && i.getContextValue(Ye);
|
|
3940
3954
|
}
|
|
3941
|
-
const
|
|
3955
|
+
const Ro = {
|
|
3942
3956
|
id: gt.id,
|
|
3943
3957
|
description: "shortcut.drawing-move-down",
|
|
3944
3958
|
group: "4_drawing-view",
|
|
@@ -3946,9 +3960,9 @@ const Co = {
|
|
|
3946
3960
|
priority: 100,
|
|
3947
3961
|
preconditions: mt,
|
|
3948
3962
|
staticParameters: {
|
|
3949
|
-
direction:
|
|
3963
|
+
direction: Ie.DOWN
|
|
3950
3964
|
}
|
|
3951
|
-
},
|
|
3965
|
+
}, Do = {
|
|
3952
3966
|
id: gt.id,
|
|
3953
3967
|
description: "shortcut.drawing-move-up",
|
|
3954
3968
|
group: "4_drawing-view",
|
|
@@ -3956,9 +3970,9 @@ const Co = {
|
|
|
3956
3970
|
priority: 100,
|
|
3957
3971
|
preconditions: mt,
|
|
3958
3972
|
staticParameters: {
|
|
3959
|
-
direction:
|
|
3973
|
+
direction: Ie.UP
|
|
3960
3974
|
}
|
|
3961
|
-
},
|
|
3975
|
+
}, bo = {
|
|
3962
3976
|
id: gt.id,
|
|
3963
3977
|
description: "shortcut.drawing-move-left",
|
|
3964
3978
|
group: "4_drawing-view",
|
|
@@ -3966,9 +3980,9 @@ const Co = {
|
|
|
3966
3980
|
priority: 100,
|
|
3967
3981
|
preconditions: mt,
|
|
3968
3982
|
staticParameters: {
|
|
3969
|
-
direction:
|
|
3983
|
+
direction: Ie.LEFT
|
|
3970
3984
|
}
|
|
3971
|
-
},
|
|
3985
|
+
}, Mo = {
|
|
3972
3986
|
id: gt.id,
|
|
3973
3987
|
description: "shortcut.drawing-move-right",
|
|
3974
3988
|
group: "4_drawing-view",
|
|
@@ -3976,9 +3990,9 @@ const Co = {
|
|
|
3976
3990
|
priority: 100,
|
|
3977
3991
|
preconditions: mt,
|
|
3978
3992
|
staticParameters: {
|
|
3979
|
-
direction:
|
|
3993
|
+
direction: Ie.RIGHT
|
|
3980
3994
|
}
|
|
3981
|
-
},
|
|
3995
|
+
}, yo = {
|
|
3982
3996
|
id: kr.id,
|
|
3983
3997
|
description: "shortcut.drawing-delete",
|
|
3984
3998
|
group: "4_drawing-view",
|
|
@@ -3987,26 +4001,26 @@ const Co = {
|
|
|
3987
4001
|
binding: Ke.DELETE,
|
|
3988
4002
|
mac: Ke.BACKSPACE
|
|
3989
4003
|
};
|
|
3990
|
-
var
|
|
3991
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
4004
|
+
var Eo = Object.getOwnPropertyDescriptor, To = (i, t, e, n) => {
|
|
4005
|
+
for (var r = n > 1 ? void 0 : n ? Eo(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
3992
4006
|
(o = i[s]) && (r = o(r) || r);
|
|
3993
4007
|
return r;
|
|
3994
4008
|
}, Be = (i, t) => (e, n) => t(e, n, i);
|
|
3995
|
-
let Ft = class extends
|
|
4009
|
+
let Ft = class extends te {
|
|
3996
4010
|
constructor(i, t, e, n, r, s) {
|
|
3997
4011
|
super(), this._componentManager = i, this._menuManagerService = t, this._commandService = e, this._shortcutService = n, this._drawingManagerService = r, this._sheetsSelectionsService = s, this._init();
|
|
3998
4012
|
}
|
|
3999
4013
|
_initCustomComponents() {
|
|
4000
4014
|
const i = this._componentManager;
|
|
4001
|
-
this.disposeWithMe(i.register(Br,
|
|
4015
|
+
this.disposeWithMe(i.register(Br, fo)), this.disposeWithMe(i.register(ze, go));
|
|
4002
4016
|
}
|
|
4003
4017
|
_initMenus() {
|
|
4004
|
-
this._menuManagerService.mergeMenu(
|
|
4018
|
+
this._menuManagerService.mergeMenu(Co);
|
|
4005
4019
|
}
|
|
4006
4020
|
_initCommands() {
|
|
4007
4021
|
[
|
|
4008
4022
|
Kt,
|
|
4009
|
-
|
|
4023
|
+
yn,
|
|
4010
4024
|
Xt,
|
|
4011
4025
|
ht,
|
|
4012
4026
|
zt,
|
|
@@ -4024,11 +4038,11 @@ let Ft = class extends ee {
|
|
|
4024
4038
|
_initShortcuts() {
|
|
4025
4039
|
[
|
|
4026
4040
|
// sheet drawing shortcuts
|
|
4027
|
-
Co,
|
|
4028
4041
|
Ro,
|
|
4029
4042
|
Do,
|
|
4030
4043
|
bo,
|
|
4031
|
-
Mo
|
|
4044
|
+
Mo,
|
|
4045
|
+
yo
|
|
4032
4046
|
].forEach((i) => {
|
|
4033
4047
|
this.disposeWithMe(this._shortcutService.registerShortcut(i));
|
|
4034
4048
|
});
|
|
@@ -4037,32 +4051,32 @@ let Ft = class extends ee {
|
|
|
4037
4051
|
this._initCommands(), this._initCustomComponents(), this._initMenus(), this._initShortcuts();
|
|
4038
4052
|
}
|
|
4039
4053
|
};
|
|
4040
|
-
Ft =
|
|
4054
|
+
Ft = To([
|
|
4041
4055
|
Be(0, A(Pr)),
|
|
4042
|
-
Be(1,
|
|
4056
|
+
Be(1, ms),
|
|
4043
4057
|
Be(2, G),
|
|
4044
|
-
Be(3,
|
|
4058
|
+
Be(3, fs),
|
|
4045
4059
|
Be(4, ae),
|
|
4046
4060
|
Be(5, A(ut))
|
|
4047
4061
|
], Ft);
|
|
4048
|
-
var
|
|
4049
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
4062
|
+
var Oo = Object.defineProperty, Uo = Object.getOwnPropertyDescriptor, Po = (i, t, e) => t in i ? Oo(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, Ao = (i, t, e, n) => {
|
|
4063
|
+
for (var r = n > 1 ? void 0 : n ? Uo(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
4050
4064
|
(o = i[s]) && (r = o(r) || r);
|
|
4051
4065
|
return r;
|
|
4052
|
-
},
|
|
4053
|
-
const
|
|
4054
|
-
let Lt = class extends
|
|
4066
|
+
}, un = (i, t) => (e, n) => t(e, n, i), Yr = (i, t, e) => Po(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4067
|
+
const No = "SHEET_IMAGE_UI_PLUGIN";
|
|
4068
|
+
let Lt = class extends Pi {
|
|
4055
4069
|
constructor(i = sr, t, e, n) {
|
|
4056
4070
|
super(), this._config = i, this._injector = t, this._renderManagerService = e, this._configService = n;
|
|
4057
|
-
const { menu: r, ...s } =
|
|
4071
|
+
const { menu: r, ...s } = Ai(
|
|
4058
4072
|
{},
|
|
4059
4073
|
sr,
|
|
4060
4074
|
this._config
|
|
4061
4075
|
);
|
|
4062
|
-
r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(
|
|
4076
|
+
r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(ks, s);
|
|
4063
4077
|
}
|
|
4064
4078
|
onStarting() {
|
|
4065
|
-
|
|
4079
|
+
Ni(this._injector, [
|
|
4066
4080
|
[lt],
|
|
4067
4081
|
[Ft],
|
|
4068
4082
|
[Nt],
|
|
@@ -4072,7 +4086,7 @@ let Lt = class extends Ui {
|
|
|
4072
4086
|
[kt],
|
|
4073
4087
|
[$t],
|
|
4074
4088
|
[xt],
|
|
4075
|
-
[
|
|
4089
|
+
[En, { useClass: In }]
|
|
4076
4090
|
]), Qt(this._injector, [
|
|
4077
4091
|
[lt]
|
|
4078
4092
|
]);
|
|
@@ -4098,46 +4112,46 @@ let Lt = class extends Ui {
|
|
|
4098
4112
|
_registerRenderModules() {
|
|
4099
4113
|
[
|
|
4100
4114
|
[dt],
|
|
4115
|
+
[Dn],
|
|
4101
4116
|
[Rn],
|
|
4102
|
-
[Cn]
|
|
4103
|
-
[In]
|
|
4117
|
+
[Cn]
|
|
4104
4118
|
].forEach((i) => {
|
|
4105
4119
|
this.disposeWithMe(this._renderManagerService.registerRenderModule(k.UNIVER_SHEET, i));
|
|
4106
4120
|
});
|
|
4107
4121
|
}
|
|
4108
4122
|
};
|
|
4109
4123
|
Yr(Lt, "type", k.UNIVER_SHEET);
|
|
4110
|
-
Yr(Lt, "pluginName",
|
|
4111
|
-
Lt =
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4124
|
+
Yr(Lt, "pluginName", No);
|
|
4125
|
+
Lt = Ao([
|
|
4126
|
+
Oi(os, ws, Rs, ki),
|
|
4127
|
+
un(1, A(qe)),
|
|
4128
|
+
un(2, ee),
|
|
4129
|
+
un(3, Ui)
|
|
4116
4130
|
], Lt);
|
|
4117
4131
|
export {
|
|
4118
|
-
|
|
4132
|
+
In as BatchSaveImagesService,
|
|
4119
4133
|
H as ClearSheetDrawingTransformerOperation,
|
|
4120
4134
|
kr as DeleteDrawingsCommand,
|
|
4121
4135
|
Fr as EditSheetDrawingOperation,
|
|
4122
4136
|
ye as FileNamePart,
|
|
4123
4137
|
$r as GroupSheetDrawingCommand,
|
|
4124
|
-
|
|
4138
|
+
En as IBatchSaveImagesService,
|
|
4125
4139
|
Kt as InsertFloatImageCommand,
|
|
4126
4140
|
Xt as InsertSheetDrawingCommand,
|
|
4127
4141
|
gt as MoveDrawingsCommand,
|
|
4128
4142
|
ht as RemoveSheetDrawingCommand,
|
|
4129
4143
|
Gr as SHEETS_IMAGE_MENU_ID,
|
|
4130
|
-
|
|
4144
|
+
io as SHEET_FLOAT_DOM_PREFIX,
|
|
4131
4145
|
ct as SaveCellImagesCommand,
|
|
4132
4146
|
xr as SetDrawingArrangeCommand,
|
|
4133
4147
|
zt as SetSheetDrawingCommand,
|
|
4134
4148
|
lt as SheetCanvasFloatDomManagerService,
|
|
4135
|
-
|
|
4149
|
+
mo as SheetDrawingAnchor,
|
|
4136
4150
|
dt as SheetDrawingUpdateController,
|
|
4137
4151
|
jr as SidebarSheetDrawingOperation,
|
|
4138
4152
|
Wr as UngroupSheetDrawingCommand,
|
|
4139
4153
|
Lt as UniverSheetsDrawingUIPlugin,
|
|
4140
|
-
|
|
4154
|
+
fe as calcSheetFloatDomPosition,
|
|
4141
4155
|
J as drawingPositionToTransform,
|
|
4142
4156
|
j as transformToDrawingPosition
|
|
4143
4157
|
};
|