@univerjs/sheets-drawing-ui 0.15.0-insiders.20260107-3441c7a → 0.15.0-insiders.20260108-47c73e3
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 +63 -42
- package/lib/es/index.js +490 -476
- package/lib/facade.js +63 -42
- package/lib/index.js +490 -476
- package/lib/types/controllers/sheet-drawing-update.controller.d.ts +3 -2
- package/lib/types/facade/f-univer.d.ts +20 -1
- package/lib/types/services/batch-save-images.service.d.ts +16 -2
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +2 -2
- package/package.json +13 -13
package/lib/index.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { precisionTo as bt, IRenderManagerService as
|
|
5
|
-
import { convertPositionSheetOverGridToAbsolute 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
|
|
9
|
-
import { MessageType as
|
|
10
|
-
import { docDrawingPositionToTransform as Xn, ReplaceSnapshotCommand as
|
|
11
|
-
import { IImageIoService as
|
|
12
|
-
import { ILocalFileService as
|
|
13
|
-
import { DocDrawingController as
|
|
14
|
-
import { ImageCropperObject as
|
|
15
|
-
import { takeUntil as Qn, throttleTime as
|
|
1
|
+
var Zr = Object.defineProperty;
|
|
2
|
+
var qr = (i, t, e) => t in i ? Zr(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
+
var ie = (i, t, e) => qr(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { precisionTo as bt, IRenderManagerService as ee, transformObjectOutOfGroup as Qr, getGroupState as ei, getCurrentTypeOfRenderer as Dn, CURSOR_TYPE as ti, RENDER_CLASS_TYPE as ke, Rect as $e, ObjectType as An, DRAWING_OBJECT_LAYER_INDEX as Qt, SHEET_VIEWPORT_KEY as cr } from "@univerjs/engine-render";
|
|
5
|
+
import { convertPositionSheetOverGridToAbsolute as ni, SheetSkeletonManagerService as X, ISheetSelectionRenderService as Je, attachRangeWithCoord as dr, SheetCanvasPopManagerService as ri, HoverManagerService as ii, IEditorBridgeService as si, IAutoFillService as oi, EditingRenderController as ai, SetCellEditVisibleOperation as Nn, PREDEFINED_HOOK_NAME_PASTE as Le, COPY_TYPE as Re, discreteRangeToRange as kn, virtualizeDiscreteRanges as ci, ISheetClipboardService as di, SetZoomRatioOperation as $n, SetScrollOperation as li, SheetPrintInterceptorService as ui, useHighlightRange as hi, getCurrentRangeDisable$ as gi } 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, IURLImageService as hr, Disposable as te, createDocumentModelWithStyle as un, ObjectRelativeFromV as xn, ObjectRelativeFromH as Wn, WrapTextType as Bn, PositionedObjectLayoutType as jn, BooleanNumber as Fn, BuildTextUtils as hn, ImageSourceType as we, generateRandomId as He, FOCUSING_COMMON_DRAWINGS as Ye, IUniverInstanceService as de, UniverInstanceType as k, Direction as Ie, createIdentifier as mi, IImageIoService as gr, 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 en } 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 Vt, SheetsSelectionsService as ut, SetRangeValuesCommand as Ln, getSheetCommandTarget as se, INTERCEPTOR_POINT as $i, InterceptCellContentPriority as xi, WorkbookViewPermission as Hn, WorksheetViewPermission as Vn, WorkbookEditablePermission as gn, WorksheetEditPermission as mn, SetFrozenMutation as Wi, SetSelectionsOperation as Bi, SetWorksheetRowAutoHeightMutation as mr, COMMAND_LISTENER_SKELETON_CHANGE as ji, InsertRowCommand as fr, InsertColCommand as pr, RemoveRowCommand as wr, RemoveColCommand as _r, DeleteRangeMoveLeftCommand as Sr, DeleteRangeMoveUpCommand as vr, InsertRangeMoveDownCommand as Ir, InsertRangeMoveRightCommand as Cr, DeltaRowHeightCommand as fn, SetRowHeightCommand as pn, DeltaColumnWidthCommand as Rr, SetColWidthCommand as Dr, SetRowHiddenCommand as br, SetSpecificRowsVisibleCommand as Mr, SetSpecificColsVisibleCommand as yr, SetColHiddenCommand as Er, MoveColsCommand as Tr, MoveRowsCommand as Or, MoveRangeCommand as Ur, 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 tn, CheckboxGroup as qi, Checkbox as Gn, Select as Qi, Button as Yn, clsx as es, RadioGroup as ts, Radio as nn } from "@univerjs/design";
|
|
10
|
+
import { docDrawingPositionToTransform as Xn, ReplaceSnapshotCommand as ns, InnerPasteCommand as rs } from "@univerjs/docs-ui";
|
|
11
|
+
import { IImageIoService as is, IDrawingManagerService as ae, DRAWING_IMAGE_ALLOW_IMAGE_LIST as zn, DRAWING_IMAGE_COUNT_LIMIT as Kn, ImageUploadStatusType as xe, DRAWING_IMAGE_ALLOW_SIZE as Jn, getImageSize as rn, SetDrawingSelectedOperation as Gt, DRAWING_IMAGE_WIDTH_LIMIT as Zn, 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 Pr, IDialogService as bn, ISidebarService as cs, IClipboardInterfaceService as ds, CanvasFloatDomService as ls, PrintFloatDomSingle as us, ComponentManager as Ar, connectInjector as hs, useDependency as Ce, getMenuHiddenObservable as Yt, MenuItemType as Xt, ContextMenuPosition as sn, ContextMenuGroup as on, 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 Nr, DrawingCommonPanel as Cs, UniverDrawingUIPlugin as Rs } from "@univerjs/drawing-ui";
|
|
15
|
+
import { takeUntil as Qn, throttleTime as Ds, combineLatest as at, switchMap as fe, EMPTY as _e, tap as er, map as pe, distinctUntilChanged as tr, Subject as an, filter as bs, take as Ms, BehaviorSubject as je, of as wn } from "rxjs";
|
|
16
16
|
import { jsx as L, jsxs as Xe } from "react/jsx-runtime";
|
|
17
|
-
import { useMemo as Fe, useState as Ee, useCallback as Et, useEffect as
|
|
17
|
+
import { useMemo as Fe, useState as Ee, useCallback as Et, useEffect as kr } from "react";
|
|
18
18
|
function J(i, t, e) {
|
|
19
19
|
const { from: n, to: r, flipY: s = !1, flipX: o = !1, angle: a = 0, skewX: d = 0, skewY: u = 0 } = i, c = e.getCurrent();
|
|
20
20
|
if (c == null)
|
|
21
21
|
return;
|
|
22
|
-
const l =
|
|
22
|
+
const l = ni(
|
|
23
23
|
c.unitId,
|
|
24
24
|
c.sheetId,
|
|
25
25
|
{ from: n, to: r },
|
|
@@ -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();
|
|
@@ -82,7 +82,7 @@ const H = {
|
|
|
82
82
|
type: q.COMMAND,
|
|
83
83
|
handler: (i, t) => {
|
|
84
84
|
var S, I, D;
|
|
85
|
-
const e = i.get(G), n = i.get(Ze), r = i.get(
|
|
85
|
+
const e = i.get(G), n = i.get(Ze), r = i.get(Vt), s = i.get(oe);
|
|
86
86
|
if (!t) return !1;
|
|
87
87
|
const { drawings: o } = t, a = [];
|
|
88
88
|
o.forEach((v) => {
|
|
@@ -106,7 +106,7 @@ const H = {
|
|
|
106
106
|
]
|
|
107
107
|
}), !0) : !1;
|
|
108
108
|
}
|
|
109
|
-
},
|
|
109
|
+
}, $r = {
|
|
110
110
|
id: "sheet.command.delete-drawing",
|
|
111
111
|
type: q.COMMAND,
|
|
112
112
|
handler: (i) => {
|
|
@@ -128,10 +128,10 @@ 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
|
-
const { parent: n, children: r } = e, { unitId: s, subUnitId: o, drawingId: a } = n, d =
|
|
134
|
+
const { parent: n, children: r } = e, { unitId: s, subUnitId: o, drawingId: a } = n, d = ei(0, 0, r.map((l) => l.transform || {})), u = r.map((l) => {
|
|
135
135
|
const g = l.transform || { left: 0, top: 0 }, { unitId: h, subUnitId: m, drawingId: f } = l;
|
|
136
136
|
return {
|
|
137
137
|
unitId: h,
|
|
@@ -157,14 +157,14 @@ 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: f } = l, p =
|
|
167
|
+
const { transform: g } = l, { unitId: h, subUnitId: m, drawingId: f } = l, p = Qr(g || {}, d, d.width || 0, d.height || 0);
|
|
168
168
|
return {
|
|
169
169
|
unitId: h,
|
|
170
170
|
subUnitId: m,
|
|
@@ -188,7 +188,7 @@ function ys(i) {
|
|
|
188
188
|
});
|
|
189
189
|
}), t;
|
|
190
190
|
}
|
|
191
|
-
const
|
|
191
|
+
const xr = {
|
|
192
192
|
id: "sheet.command.group-sheet-image",
|
|
193
193
|
type: q.COMMAND,
|
|
194
194
|
handler: (i, t) => {
|
|
@@ -204,7 +204,7 @@ const $r = {
|
|
|
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: [
|
|
@@ -213,14 +213,14 @@ const $r = {
|
|
|
213
213
|
]
|
|
214
214
|
}), !0) : !1;
|
|
215
215
|
}
|
|
216
|
-
},
|
|
216
|
+
}, zt = {
|
|
217
217
|
id: "sheet.command.insert-sheet-image",
|
|
218
218
|
type: q.COMMAND,
|
|
219
219
|
handler: (i, t) => {
|
|
220
220
|
var S, I, D;
|
|
221
|
-
const e = i.get(G), n = i.get(Ze), r = i.get(oe), s = i.get(
|
|
221
|
+
const e = i.get(G), n = i.get(Ze), r = i.get(oe), s = i.get(Vt);
|
|
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:
|
|
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: zt.id, params: t }), f = { id: P.id, params: { op: g, unitId: u, subUnitId: c, objects: h, type: U.INSERT } }, p = { id: P.id, params: { op: l, unitId: u, subUnitId: c, objects: h, type: U.REMOVE } };
|
|
224
224
|
return lr([...(S = m.preRedos) != null ? S : [], f, ...m.redos], e) ? (n.pushUndoRedo({
|
|
225
225
|
unitID: u,
|
|
226
226
|
undoMutations: [
|
|
@@ -237,7 +237,7 @@ const $r = {
|
|
|
237
237
|
]
|
|
238
238
|
}), !0) : !1;
|
|
239
239
|
}
|
|
240
|
-
},
|
|
240
|
+
}, Wr = {
|
|
241
241
|
id: "sheet.command.set-drawing-arrange",
|
|
242
242
|
type: q.COMMAND,
|
|
243
243
|
handler: (i, t) => {
|
|
@@ -258,7 +258,7 @@ const $r = {
|
|
|
258
258
|
]
|
|
259
259
|
}), !0) : !1;
|
|
260
260
|
}
|
|
261
|
-
},
|
|
261
|
+
}, Kt = {
|
|
262
262
|
id: "sheet.command.set-sheet-image",
|
|
263
263
|
type: q.COMMAND,
|
|
264
264
|
handler: (i, t) => {
|
|
@@ -277,7 +277,7 @@ const $r = {
|
|
|
277
277
|
]
|
|
278
278
|
}), !0) : !1;
|
|
279
279
|
}
|
|
280
|
-
},
|
|
280
|
+
}, Br = {
|
|
281
281
|
id: "sheet.command.ungroup-sheet-image",
|
|
282
282
|
type: q.COMMAND,
|
|
283
283
|
handler: (i, t) => {
|
|
@@ -293,7 +293,7 @@ const $r = {
|
|
|
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,18 +303,18 @@ 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
|
-
},
|
|
311
|
-
function
|
|
310
|
+
}, Q = (i, t) => (e, n) => t(e, n, i);
|
|
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
315
|
function _n(i, t, e, n, r) {
|
|
316
316
|
var S;
|
|
317
|
-
const { rotatedHeight: s, rotatedWidth: o } =
|
|
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
320
|
const c = (S = d.with(X).getSkeletonParam(t.subUnitId)) == null ? void 0 : S.skeleton;
|
|
@@ -326,11 +326,11 @@ function _n(i, t, e, n, r) {
|
|
|
326
326
|
height: n * w
|
|
327
327
|
};
|
|
328
328
|
}
|
|
329
|
-
let dt = class extends
|
|
330
|
-
constructor(t, e, n, r, s, o, a, d, u, c, l, g, h) {
|
|
329
|
+
let dt = class extends te {
|
|
330
|
+
constructor(t, e, n, r, s, o, a, d, u, c, l, g, h, m) {
|
|
331
331
|
super();
|
|
332
|
-
|
|
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();
|
|
332
|
+
ie(this, "_workbookSelections");
|
|
333
|
+
this._context = t, this._skeletonManagerService = e, this._commandService = n, this._selectionRenderService = r, this._imageIoService = s, this._fileOpenerService = o, this._sheetDrawingService = a, this._drawingManagerService = d, this._contextService = u, this._messageService = c, this._localeService = l, this._injector = h, this._urlImageService = m, 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({
|
|
@@ -338,7 +338,7 @@ let dt = class extends ee {
|
|
|
338
338
|
accept: zn.map((n) => `.${n.replace("image/", "")}`).join(",")
|
|
339
339
|
}), e = t.length;
|
|
340
340
|
return e > Kn ? (this._messageService.show({
|
|
341
|
-
type:
|
|
341
|
+
type: ve.Error,
|
|
342
342
|
content: this._localeService.t("update-status.exceedMaxCount", String(Kn))
|
|
343
343
|
}), !1) : e === 0 ? !1 : (t.forEach(async (n) => await this.insertFloatImageByFile(n)), !0);
|
|
344
344
|
}
|
|
@@ -359,19 +359,19 @@ let dt = class extends ee {
|
|
|
359
359
|
} catch (S) {
|
|
360
360
|
const I = S.message;
|
|
361
361
|
I === xe.ERROR_EXCEED_SIZE ? this._messageService.show({
|
|
362
|
-
type:
|
|
362
|
+
type: ve.Error,
|
|
363
363
|
content: this._localeService.t("update-status.exceedMaxSize", String(Jn / (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
|
}
|
|
372
372
|
if (e == null)
|
|
373
373
|
return;
|
|
374
|
-
const n = this._getUnitInfo(), { unitId: r, subUnitId: s } = n, { imageId: o, imageSourceType: a, source: d, base64Cache: u } = e, { width: c, height: l, image: g } = await
|
|
374
|
+
const n = this._getUnitInfo(), { unitId: r, subUnitId: s } = n, { imageId: o, imageSourceType: a, source: d, base64Cache: u } = e, { width: c, height: l, image: g } = await rn(u || ""), { width: h, height: m } = this._context.scene;
|
|
375
375
|
this._imageIoService.addImageSourceCache(d, a, g);
|
|
376
376
|
let f = 1;
|
|
377
377
|
if (c > Zn || l > qn) {
|
|
@@ -391,7 +391,7 @@ let dt = class extends ee {
|
|
|
391
391
|
transform: J(p, this._selectionRenderService, this._skeletonManagerService),
|
|
392
392
|
sheetTransform: p
|
|
393
393
|
};
|
|
394
|
-
return this._commandService.executeCommand(
|
|
394
|
+
return this._commandService.executeCommand(zt.id, {
|
|
395
395
|
unitId: r,
|
|
396
396
|
drawings: [w]
|
|
397
397
|
});
|
|
@@ -405,19 +405,19 @@ let dt = class extends ee {
|
|
|
405
405
|
} catch (v) {
|
|
406
406
|
const C = v.message;
|
|
407
407
|
C === xe.ERROR_EXCEED_SIZE ? this._messageService.show({
|
|
408
|
-
type:
|
|
408
|
+
type: ve.Error,
|
|
409
409
|
content: this._localeService.t("update-status.exceedMaxSize", String(Jn / (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
|
}
|
|
418
418
|
if (n == null)
|
|
419
419
|
return !1;
|
|
420
|
-
const { imageId: r, imageSourceType: s, source: o, base64Cache: a } = n, { width: d, height: u, image: c } = await
|
|
420
|
+
const { imageId: r, imageSourceType: s, source: o, base64Cache: a } = n, { width: d, height: u, image: c } = await rn(a || "");
|
|
421
421
|
this._imageIoService.addImageSourceCache(o, s, c);
|
|
422
422
|
const l = this._workbookSelections.getCurrentLastSelection();
|
|
423
423
|
if (!l)
|
|
@@ -495,30 +495,36 @@ let dt = class extends ee {
|
|
|
495
495
|
}
|
|
496
496
|
// eslint-disable-next-line max-lines-per-function
|
|
497
497
|
async insertCellImageByUrl(t, e) {
|
|
498
|
-
var
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
498
|
+
var h, m;
|
|
499
|
+
let n = t;
|
|
500
|
+
try {
|
|
501
|
+
n = await this._urlImageService.getImage(t);
|
|
502
|
+
} catch (f) {
|
|
503
|
+
console.error(`Failed to get image from URLImageService: ${t}`, f);
|
|
504
|
+
}
|
|
505
|
+
const { width: r, height: s, image: o } = await rn(n || "");
|
|
506
|
+
this._imageIoService.addImageSourceCache(t, we.URL, o);
|
|
507
|
+
const a = this._workbookSelections.getCurrentLastSelection();
|
|
508
|
+
if (!a)
|
|
503
509
|
return !1;
|
|
504
|
-
const
|
|
510
|
+
const d = un("", {}), u = _n(
|
|
505
511
|
this._injector,
|
|
506
512
|
{
|
|
507
513
|
unitId: this._context.unitId,
|
|
508
514
|
subUnitId: this._context.unit.getActiveSheet().getSheetId(),
|
|
509
|
-
row:
|
|
510
|
-
col:
|
|
515
|
+
row: a.primary.actualRow,
|
|
516
|
+
col: a.primary.actualColumn
|
|
511
517
|
},
|
|
512
|
-
n,
|
|
513
518
|
r,
|
|
519
|
+
s,
|
|
514
520
|
0
|
|
515
521
|
);
|
|
516
|
-
if (!
|
|
522
|
+
if (!u)
|
|
517
523
|
return !1;
|
|
518
|
-
const
|
|
524
|
+
const c = {
|
|
519
525
|
size: {
|
|
520
|
-
width:
|
|
521
|
-
height:
|
|
526
|
+
width: u.width,
|
|
527
|
+
height: u.height
|
|
522
528
|
},
|
|
523
529
|
positionH: {
|
|
524
530
|
relativeFrom: Wn.PAGE,
|
|
@@ -529,15 +535,15 @@ let dt = class extends ee {
|
|
|
529
535
|
posOffset: 0
|
|
530
536
|
},
|
|
531
537
|
angle: 0
|
|
532
|
-
},
|
|
533
|
-
unitId:
|
|
534
|
-
subUnitId:
|
|
538
|
+
}, l = {
|
|
539
|
+
unitId: d.getUnitId(),
|
|
540
|
+
subUnitId: d.getUnitId(),
|
|
535
541
|
drawingId: He(),
|
|
536
542
|
drawingType: x.DRAWING_IMAGE,
|
|
537
|
-
imageSourceType:
|
|
543
|
+
imageSourceType: we.URL,
|
|
538
544
|
source: t,
|
|
539
|
-
transform: Xn(
|
|
540
|
-
docTransform:
|
|
545
|
+
transform: Xn(c),
|
|
546
|
+
docTransform: c,
|
|
541
547
|
behindDoc: Fn.FALSE,
|
|
542
548
|
title: "",
|
|
543
549
|
description: "",
|
|
@@ -548,20 +554,20 @@ let dt = class extends ee {
|
|
|
548
554
|
distL: 0,
|
|
549
555
|
distR: 0,
|
|
550
556
|
distT: 0
|
|
551
|
-
},
|
|
552
|
-
documentDataModel:
|
|
553
|
-
drawings: [
|
|
557
|
+
}, g = hn.drawing.add({
|
|
558
|
+
documentDataModel: d,
|
|
559
|
+
drawings: [l],
|
|
554
560
|
selection: {
|
|
555
561
|
collapsed: !0,
|
|
556
562
|
startOffset: 0,
|
|
557
563
|
endOffset: 0
|
|
558
564
|
}
|
|
559
565
|
});
|
|
560
|
-
return
|
|
566
|
+
return g ? (d.apply(g), this._commandService.syncExecuteCommand(Ln.id, {
|
|
561
567
|
value: {
|
|
562
|
-
[(
|
|
563
|
-
[(
|
|
564
|
-
p:
|
|
568
|
+
[(h = e == null ? void 0 : e.row) != null ? h : a.primary.actualRow]: {
|
|
569
|
+
[(m = e == null ? void 0 : e.col) != null ? m : a.primary.actualColumn]: {
|
|
570
|
+
p: d.getSnapshot(),
|
|
565
571
|
t: 1
|
|
566
572
|
}
|
|
567
573
|
}
|
|
@@ -618,7 +624,7 @@ let dt = class extends ee {
|
|
|
618
624
|
_updateOrderListener() {
|
|
619
625
|
this.disposeWithMe(this._drawingManagerService.featurePluginOrderUpdate$.subscribe((t) => {
|
|
620
626
|
const { unitId: e, subUnitId: n, drawingIds: r, arrangeType: s } = t;
|
|
621
|
-
this._commandService.executeCommand(
|
|
627
|
+
this._commandService.executeCommand(Wr.id, {
|
|
622
628
|
unitId: e,
|
|
623
629
|
subUnitId: n,
|
|
624
630
|
drawingIds: r,
|
|
@@ -645,7 +651,7 @@ let dt = class extends ee {
|
|
|
645
651
|
sheetTransform: { ...c }
|
|
646
652
|
};
|
|
647
653
|
e.push(l);
|
|
648
|
-
}), e.length > 0 && this._commandService.executeCommand(
|
|
654
|
+
}), e.length > 0 && this._commandService.executeCommand(Kt.id, {
|
|
649
655
|
unitId: t[0].unitId,
|
|
650
656
|
drawings: e
|
|
651
657
|
}));
|
|
@@ -653,11 +659,11 @@ let dt = class extends ee {
|
|
|
653
659
|
}
|
|
654
660
|
_groupDrawingListener() {
|
|
655
661
|
this.disposeWithMe(this._drawingManagerService.featurePluginGroupUpdate$.subscribe((t) => {
|
|
656
|
-
this._commandService.executeCommand(
|
|
662
|
+
this._commandService.executeCommand(xr.id, t);
|
|
657
663
|
const { unitId: e, subUnitId: n, drawingId: r } = t[0].parent;
|
|
658
|
-
this._commandService.syncExecuteCommand(
|
|
664
|
+
this._commandService.syncExecuteCommand(Gt.id, [{ unitId: e, subUnitId: n, drawingId: r }]);
|
|
659
665
|
})), this.disposeWithMe(this._drawingManagerService.featurePluginUngroupUpdate$.subscribe((t) => {
|
|
660
|
-
this._commandService.executeCommand(
|
|
666
|
+
this._commandService.executeCommand(Br.id, t);
|
|
661
667
|
}));
|
|
662
668
|
}
|
|
663
669
|
_focusDrawingListener() {
|
|
@@ -668,26 +674,27 @@ let dt = class extends ee {
|
|
|
668
674
|
);
|
|
669
675
|
}
|
|
670
676
|
};
|
|
671
|
-
dt =
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
677
|
+
dt = Os([
|
|
678
|
+
Q(1, A(X)),
|
|
679
|
+
Q(2, G),
|
|
680
|
+
Q(3, Je),
|
|
681
|
+
Q(4, is),
|
|
682
|
+
Q(5, as),
|
|
683
|
+
Q(6, oe),
|
|
684
|
+
Q(7, ae),
|
|
685
|
+
Q(8, ur),
|
|
686
|
+
Q(9, Pr),
|
|
687
|
+
Q(10, A(Te)),
|
|
688
|
+
Q(11, A(ut)),
|
|
689
|
+
Q(12, A(qe)),
|
|
690
|
+
Q(13, hr)
|
|
684
691
|
], dt);
|
|
685
|
-
const
|
|
692
|
+
const Jt = {
|
|
686
693
|
id: "sheet.command.insert-float-image",
|
|
687
694
|
type: q.COMMAND,
|
|
688
695
|
handler: async (i, t) => {
|
|
689
696
|
var o, a;
|
|
690
|
-
const e = i.get(de), n = i.get(
|
|
697
|
+
const e = i.get(de), n = i.get(ee), r = (o = Dn(
|
|
691
698
|
k.UNIVER_SHEET,
|
|
692
699
|
e,
|
|
693
700
|
n
|
|
@@ -706,7 +713,7 @@ const Kt = {
|
|
|
706
713
|
type: q.COMMAND,
|
|
707
714
|
handler: (i) => {
|
|
708
715
|
var n, r;
|
|
709
|
-
const t = i.get(de), e = i.get(
|
|
716
|
+
const t = i.get(de), e = i.get(ee);
|
|
710
717
|
return (r = (n = Dn(
|
|
711
718
|
k.UNIVER_SHEET,
|
|
712
719
|
t,
|
|
@@ -725,35 +732,35 @@ const Kt = {
|
|
|
725
732
|
if (l == null)
|
|
726
733
|
return null;
|
|
727
734
|
const g = { ...l }, { left: h = 0, top: m = 0 } = l;
|
|
728
|
-
return s ===
|
|
735
|
+
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
736
|
...c,
|
|
730
737
|
transform: g,
|
|
731
738
|
sheetTransform: j(g, r)
|
|
732
739
|
};
|
|
733
740
|
}).filter((c) => c != null);
|
|
734
|
-
return e.syncExecuteCommand(
|
|
741
|
+
return e.syncExecuteCommand(Kt.id, {
|
|
735
742
|
unitId: a,
|
|
736
743
|
drawings: d
|
|
737
744
|
}) ? (e.syncExecuteCommand(H.id, [a]), !0) : !1;
|
|
738
745
|
}
|
|
739
746
|
};
|
|
740
|
-
var
|
|
741
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
747
|
+
var Ps = Object.getOwnPropertyDescriptor, As = (i, t, e, n) => {
|
|
748
|
+
for (var r = n > 1 ? void 0 : n ? Ps(t, e) : t, s = i.length - 1, o; s >= 0; s--)
|
|
742
749
|
(o = i[s]) && (r = o(r) || r);
|
|
743
750
|
return r;
|
|
744
|
-
},
|
|
745
|
-
const yn =
|
|
751
|
+
}, Tt = (i, t) => (e, n) => t(e, n, i), ye = /* @__PURE__ */ ((i) => (i.CELL_ADDRESS = "cellAddress", i.COLUMN_VALUE = "columnValue", i))(ye || {});
|
|
752
|
+
const yn = mi("sheets-drawing-ui.batch-save-images.service");
|
|
746
753
|
function Sn(i) {
|
|
747
754
|
let t = "", e = i;
|
|
748
755
|
for (; e >= 0; )
|
|
749
756
|
t = String.fromCharCode(e % 26 + 65) + t, e = Math.floor(e / 26) - 1;
|
|
750
757
|
return t;
|
|
751
758
|
}
|
|
752
|
-
function
|
|
759
|
+
function Nt(i, t) {
|
|
753
760
|
return `${Sn(t)}${i + 1}`;
|
|
754
761
|
}
|
|
755
|
-
function
|
|
756
|
-
const t =
|
|
762
|
+
function Ns(i) {
|
|
763
|
+
const t = Nt(i.startRow, i.startColumn), e = Nt(i.endRow, i.endColumn);
|
|
757
764
|
return t === e ? t : `${t}:${e}`;
|
|
758
765
|
}
|
|
759
766
|
function nr(i) {
|
|
@@ -768,12 +775,12 @@ function rr(i) {
|
|
|
768
775
|
return !e || !("source" in e) || !("imageSourceType" in e) ? null : e;
|
|
769
776
|
}
|
|
770
777
|
function cn(i, t) {
|
|
771
|
-
if (t ===
|
|
778
|
+
if (t === we.BASE64) {
|
|
772
779
|
const e = i.match(/^data:image\/(\w+);/);
|
|
773
780
|
if (e)
|
|
774
781
|
return e[1] === "jpeg" ? "jpg" : e[1];
|
|
775
782
|
}
|
|
776
|
-
if (t ===
|
|
783
|
+
if (t === we.URL) {
|
|
777
784
|
const e = i.match(/\.(\w+)(?:\?|$)/);
|
|
778
785
|
if (e)
|
|
779
786
|
return e[1].toLowerCase();
|
|
@@ -781,15 +788,21 @@ function cn(i, t) {
|
|
|
781
788
|
return "png";
|
|
782
789
|
}
|
|
783
790
|
async function ir(i, t) {
|
|
784
|
-
if (t ===
|
|
791
|
+
if (t === we.BASE64)
|
|
785
792
|
return (await fetch(i)).blob();
|
|
786
|
-
if (t ===
|
|
793
|
+
if (t === we.URL)
|
|
787
794
|
return (await fetch(i)).blob();
|
|
788
795
|
throw new Error("UUID image type requires additional handling");
|
|
789
796
|
}
|
|
790
|
-
let vn = class extends
|
|
791
|
-
constructor(i, t, e) {
|
|
792
|
-
super(), this._univerInstanceService = i, this._selectionService = t, this._imageIoService = e;
|
|
797
|
+
let vn = class extends te {
|
|
798
|
+
constructor(i, t, e, n) {
|
|
799
|
+
super(), this._univerInstanceService = i, this._selectionService = t, this._imageIoService = e, this._urlImageService = n;
|
|
800
|
+
}
|
|
801
|
+
/**
|
|
802
|
+
* @deprecated Use IURLImageService directly
|
|
803
|
+
*/
|
|
804
|
+
registerURLImageDownloader(i) {
|
|
805
|
+
return this._urlImageService.registerURLImageDownloader(i);
|
|
793
806
|
}
|
|
794
807
|
getCellImagesInSelection() {
|
|
795
808
|
const i = this._univerInstanceService.getCurrentUnitForType(k.UNIVER_SHEET);
|
|
@@ -809,7 +822,7 @@ let vn = class extends ee {
|
|
|
809
822
|
h && r.push({
|
|
810
823
|
row: c,
|
|
811
824
|
col: l,
|
|
812
|
-
cellAddress:
|
|
825
|
+
cellAddress: Nt(c, l),
|
|
813
826
|
source: h.source,
|
|
814
827
|
imageSourceType: h.imageSourceType,
|
|
815
828
|
imageId: h.drawingId
|
|
@@ -835,7 +848,7 @@ let vn = class extends ee {
|
|
|
835
848
|
f && o.push({
|
|
836
849
|
row: g,
|
|
837
850
|
col: h,
|
|
838
|
-
cellAddress:
|
|
851
|
+
cellAddress: Nt(g, h),
|
|
839
852
|
source: f.source,
|
|
840
853
|
imageSourceType: f.imageSourceType,
|
|
841
854
|
imageId: f.drawingId
|
|
@@ -913,7 +926,7 @@ let vn = class extends ee {
|
|
|
913
926
|
}
|
|
914
927
|
getSelectionRangeNotation() {
|
|
915
928
|
const i = this._selectionService.getCurrentSelections();
|
|
916
|
-
return !i || i.length === 0 ? "" : i.map((t) =>
|
|
929
|
+
return !i || i.length === 0 ? "" : i.map((t) => Ns(t.range)).join(", ");
|
|
917
930
|
}
|
|
918
931
|
getSelectionRowRange() {
|
|
919
932
|
const i = this._selectionService.getCurrentSelections();
|
|
@@ -1014,17 +1027,18 @@ let vn = class extends ee {
|
|
|
1014
1027
|
}
|
|
1015
1028
|
}
|
|
1016
1029
|
async _getImageBlob(i) {
|
|
1017
|
-
if (i.imageSourceType ===
|
|
1030
|
+
if (i.imageSourceType === we.UUID) {
|
|
1018
1031
|
const t = await this._imageIoService.getImage(i.source);
|
|
1019
|
-
return ir(t,
|
|
1032
|
+
return ir(t, we.URL);
|
|
1020
1033
|
}
|
|
1021
|
-
return ir(i.source, i.imageSourceType);
|
|
1034
|
+
return i.imageSourceType === we.URL ? this._urlImageService.downloadImage(i.source) : ir(i.source, i.imageSourceType);
|
|
1022
1035
|
}
|
|
1023
1036
|
};
|
|
1024
|
-
vn =
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1037
|
+
vn = As([
|
|
1038
|
+
Tt(0, de),
|
|
1039
|
+
Tt(1, A(ut)),
|
|
1040
|
+
Tt(2, gr),
|
|
1041
|
+
Tt(3, hr)
|
|
1028
1042
|
], vn);
|
|
1029
1043
|
const ze = "sheet.dialog.batch-save-images", ct = {
|
|
1030
1044
|
id: "sheet.command.save-cell-images",
|
|
@@ -1051,37 +1065,37 @@ const ze = "sheet.dialog.batch-save-images", ct = {
|
|
|
1051
1065
|
onClose: () => t.close(ze)
|
|
1052
1066
|
}), !0;
|
|
1053
1067
|
}
|
|
1054
|
-
},
|
|
1068
|
+
}, jr = "COMPONENT_SHEET_DRAWING_PANEL", Fr = {
|
|
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(de), s = i.get(G);
|
|
1059
1073
|
return se(r) ? (t.value === "open" ? e.open({
|
|
1060
1074
|
header: { title: n.t("sheetImage.panel.title") },
|
|
1061
|
-
children: { label:
|
|
1075
|
+
children: { label: jr },
|
|
1062
1076
|
onClose: () => {
|
|
1063
|
-
s.syncExecuteCommand(
|
|
1077
|
+
s.syncExecuteCommand(Gt.id, []);
|
|
1064
1078
|
},
|
|
1065
1079
|
width: 360
|
|
1066
1080
|
}) : e.close(), !0) : !1;
|
|
1067
1081
|
}
|
|
1068
|
-
},
|
|
1082
|
+
}, Lr = {
|
|
1069
1083
|
id: "sheet.operation.edit-sheet-image",
|
|
1070
1084
|
type: q.OPERATION,
|
|
1071
1085
|
handler: (i, t) => {
|
|
1072
1086
|
const e = i.get(G);
|
|
1073
|
-
return t == null ? !1 : (e.syncExecuteCommand(
|
|
1087
|
+
return t == null ? !1 : (e.syncExecuteCommand(Gt.id, [t]), e.executeCommand(Fr.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
|
|
1095
|
+
let kt = class extends fi {
|
|
1082
1096
|
constructor(t, e, n, r, s, o, a, d, u, c) {
|
|
1083
1097
|
super();
|
|
1084
|
-
|
|
1098
|
+
ie(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() {
|
|
@@ -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
|
}
|
|
@@ -1147,7 +1161,7 @@ let Nt = class extends mi {
|
|
|
1147
1161
|
r == null || r.dispose();
|
|
1148
1162
|
const f = 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: {
|
|
@@ -1157,7 +1171,7 @@ let Nt = class extends mi {
|
|
|
1157
1171
|
})
|
|
1158
1172
|
), this.disposeWithMe(
|
|
1159
1173
|
n.clearControl$.subscribe(() => {
|
|
1160
|
-
r == null || r.dispose(), this._contextService.setContextValue(Ye, !1), this._commandService.syncExecuteCommand(
|
|
1174
|
+
r == null || r.dispose(), this._contextService.setContextValue(Ye, !1), this._commandService.syncExecuteCommand(Gt.id, []);
|
|
1161
1175
|
})
|
|
1162
1176
|
), this.disposeWithMe(
|
|
1163
1177
|
this._contextService.contextChanged$.subscribe((o) => {
|
|
@@ -1174,7 +1188,7 @@ let Nt = class extends mi {
|
|
|
1174
1188
|
{
|
|
1175
1189
|
label: "image-popup.edit",
|
|
1176
1190
|
index: 0,
|
|
1177
|
-
commandId:
|
|
1191
|
+
commandId: Lr.id,
|
|
1178
1192
|
commandParams: { unitId: t, subUnitId: e, drawingId: n },
|
|
1179
1193
|
disable: r === x.DRAWING_DOM
|
|
1180
1194
|
},
|
|
@@ -1188,48 +1202,48 @@ 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
|
-
|
|
1219
|
+
kt = xs([
|
|
1206
1220
|
ce(0, A(qe)),
|
|
1207
1221
|
ce(1, A(Te)),
|
|
1208
1222
|
ce(2, ae),
|
|
1209
|
-
ce(3, A(
|
|
1210
|
-
ce(4,
|
|
1223
|
+
ce(3, A(ri)),
|
|
1224
|
+
ce(4, ee),
|
|
1211
1225
|
ce(5, de),
|
|
1212
|
-
ce(6,
|
|
1226
|
+
ce(6, Pr),
|
|
1213
1227
|
ce(7, ur),
|
|
1214
|
-
ce(8,
|
|
1228
|
+
ce(8, gr),
|
|
1215
1229
|
ce(9, G)
|
|
1216
|
-
],
|
|
1217
|
-
var
|
|
1218
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1230
|
+
], kt);
|
|
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
|
-
},
|
|
1222
|
-
let In = class extends
|
|
1235
|
+
}, Ot = (i, t) => (e, n) => t(e, n, i);
|
|
1236
|
+
let In = class extends te {
|
|
1223
1237
|
constructor(t, e, n, r, s) {
|
|
1224
1238
|
super();
|
|
1225
|
-
|
|
1239
|
+
ie(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
|
-
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(
|
|
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(ti.ZOOM_IN)) : this._isSetCursor && (this._isSetCursor = !1, this._context.scene.resetCursor());
|
|
1233
1247
|
}));
|
|
1234
1248
|
}
|
|
1235
1249
|
_initImageClick() {
|
|
@@ -1243,18 +1257,18 @@ let In = class extends ee {
|
|
|
1243
1257
|
}));
|
|
1244
1258
|
}
|
|
1245
1259
|
};
|
|
1246
|
-
In =
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1260
|
+
In = Bs([
|
|
1261
|
+
Ot(1, A(ii)),
|
|
1262
|
+
Ot(2, A(ut)),
|
|
1263
|
+
Ot(3, A(Nr)),
|
|
1264
|
+
Ot(4, A(X))
|
|
1251
1265
|
], In);
|
|
1252
|
-
var
|
|
1253
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
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
|
-
},
|
|
1257
|
-
let Cn = class extends
|
|
1270
|
+
}, Ut = (i, t) => (e, n) => t(e, n, i);
|
|
1271
|
+
let Cn = 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,18 +1288,18 @@ 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
|
-
Cn =
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1291
|
+
Cn = Fs([
|
|
1292
|
+
Ut(1, oe),
|
|
1293
|
+
Ut(2, ae),
|
|
1294
|
+
Ut(3, A(Je)),
|
|
1295
|
+
Ut(4, A(X))
|
|
1282
1296
|
], Cn);
|
|
1283
|
-
var
|
|
1284
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
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
|
-
function
|
|
1302
|
+
function Hr(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
1305
|
const a = e.p.drawings[e.p.drawingsOrder[0]], d = _n(
|
|
@@ -1305,7 +1319,7 @@ function Lr(i, t, e) {
|
|
|
1305
1319
|
}
|
|
1306
1320
|
return !1;
|
|
1307
1321
|
}
|
|
1308
|
-
let
|
|
1322
|
+
let $t = 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,39 +1327,39 @@ 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
|
-
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 },
|
|
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 }, Hr(this._injector, { unitId: t.unitId, subUnitId: t.subUnitId, row: t.row, col: t.col }, i)), e(i);
|
|
1329
1343
|
}
|
|
1330
1344
|
}
|
|
1331
1345
|
)
|
|
1332
1346
|
);
|
|
1333
1347
|
}
|
|
1334
1348
|
};
|
|
1335
|
-
|
|
1349
|
+
$t = Hs([
|
|
1336
1350
|
We(0, G),
|
|
1337
|
-
We(1, A(
|
|
1351
|
+
We(1, A(Vt)),
|
|
1338
1352
|
We(2, A(qe)),
|
|
1339
1353
|
We(3, ae),
|
|
1340
|
-
We(4, A(
|
|
1341
|
-
We(5, A(
|
|
1342
|
-
],
|
|
1343
|
-
var
|
|
1344
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1354
|
+
We(4, A(ps)),
|
|
1355
|
+
We(5, A(si))
|
|
1356
|
+
], $t);
|
|
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
|
|
1362
|
+
let xt = class extends te {
|
|
1349
1363
|
constructor(i, t) {
|
|
1350
1364
|
super(), this._autoFillService = i, this._injector = t, this._initAutoFillHooks();
|
|
1351
1365
|
}
|
|
@@ -1354,35 +1368,35 @@ 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
|
|
1358
|
-
|
|
1371
|
+
new wi(n).forValue((r, s, o) => {
|
|
1372
|
+
Hr(this._injector, { unitId: i.unitId, subUnitId: i.subUnitId, row: r, col: s }, o);
|
|
1359
1373
|
});
|
|
1360
1374
|
}
|
|
1361
1375
|
})
|
|
1362
1376
|
);
|
|
1363
1377
|
}
|
|
1364
1378
|
};
|
|
1365
|
-
|
|
1366
|
-
or(0, A(
|
|
1379
|
+
xt = Gs([
|
|
1380
|
+
or(0, A(oi)),
|
|
1367
1381
|
or(1, A(qe))
|
|
1368
|
-
],
|
|
1369
|
-
var
|
|
1370
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1382
|
+
], xt);
|
|
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
|
|
1393
|
+
let Wt = 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 = un("", {}), e = (r = Dn(k.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : r.with(
|
|
1399
|
+
const t = un("", {}), e = (r = Dn(k.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : r.with(ai), n = hn.drawing.add({
|
|
1386
1400
|
documentDataModel: t,
|
|
1387
1401
|
drawings: [i],
|
|
1388
1402
|
selection: {
|
|
@@ -1397,12 +1411,12 @@ 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
1422
|
this._dialogService.close("sheet-cell-image-copy-paste"), this._commandService.syncExecuteCommand(Nn.id, {
|
|
@@ -1438,32 +1452,32 @@ let xt = class extends ee {
|
|
|
1438
1452
|
);
|
|
1439
1453
|
}
|
|
1440
1454
|
};
|
|
1441
|
-
|
|
1455
|
+
Wt = Xs([
|
|
1442
1456
|
nt(0, G),
|
|
1443
1457
|
nt(1, de),
|
|
1444
1458
|
nt(2, bn),
|
|
1445
|
-
nt(3,
|
|
1459
|
+
nt(3, ee),
|
|
1446
1460
|
nt(4, A(Te))
|
|
1447
|
-
],
|
|
1448
|
-
var
|
|
1449
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1461
|
+
], Wt);
|
|
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
|
-
const
|
|
1454
|
-
function
|
|
1467
|
+
const Vr = "image/png";
|
|
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
|
-
return new Blob([r], { type:
|
|
1472
|
+
return new Blob([r], { type: Vr });
|
|
1459
1473
|
}
|
|
1460
|
-
function
|
|
1461
|
-
const t = new ClipboardItem({ [
|
|
1474
|
+
function qs(i) {
|
|
1475
|
+
const t = new ClipboardItem({ [Vr]: 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
|
|
1496
|
+
let Bt = class extends te {
|
|
1483
1497
|
constructor(t, e, n, r, s) {
|
|
1484
1498
|
super();
|
|
1485
|
-
|
|
1499
|
+
ie(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,
|
|
@@ -1539,7 +1553,7 @@ let Wt = class extends ee {
|
|
|
1539
1553
|
undos: [],
|
|
1540
1554
|
redos: [
|
|
1541
1555
|
{
|
|
1542
|
-
id:
|
|
1556
|
+
id: Jt.id,
|
|
1543
1557
|
params: { files: n }
|
|
1544
1558
|
}
|
|
1545
1559
|
]
|
|
@@ -1679,7 +1693,7 @@ let Wt = class extends ee {
|
|
|
1679
1693
|
pasteTo: { unitId: n, subUnitId: r, range: kn(o) },
|
|
1680
1694
|
pasteType: s
|
|
1681
1695
|
}, d);
|
|
1682
|
-
const { ranges: [l, g], mapFunc: h } =
|
|
1696
|
+
const { ranges: [l, g], mapFunc: h } = ci([a, o]), { row: m, col: f } = h(l.startRow, l.startColumn), { row: p, col: w } = h(g.startRow, g.startColumn), S = u.attachRangeWithCoord({
|
|
1683
1697
|
startRow: m,
|
|
1684
1698
|
endRow: m,
|
|
1685
1699
|
startColumn: f,
|
|
@@ -1723,19 +1737,19 @@ let Wt = class extends ee {
|
|
|
1723
1737
|
});
|
|
1724
1738
|
}
|
|
1725
1739
|
};
|
|
1726
|
-
|
|
1727
|
-
rt(0,
|
|
1728
|
-
rt(1,
|
|
1740
|
+
Bt = Js([
|
|
1741
|
+
rt(0, di),
|
|
1742
|
+
rt(1, ee),
|
|
1729
1743
|
rt(2, ae),
|
|
1730
|
-
rt(3,
|
|
1744
|
+
rt(3, ds),
|
|
1731
1745
|
rt(4, G)
|
|
1732
|
-
],
|
|
1733
|
-
var
|
|
1734
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1746
|
+
], Bt);
|
|
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
|
|
1752
|
+
let jt = 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
|
}
|
|
@@ -1755,7 +1769,7 @@ let Bt = class extends ee {
|
|
|
1755
1769
|
new Vn(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
|
}
|
|
@@ -1784,7 +1798,7 @@ let Bt = class extends ee {
|
|
|
1784
1798
|
new mn(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
|
}
|
|
@@ -1804,10 +1818,10 @@ let Bt = class extends ee {
|
|
|
1804
1818
|
fe(([e, n]) => e ? e.activeSheet$.pipe(
|
|
1805
1819
|
fe((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
1827
|
new Hn(s).id,
|
|
@@ -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);
|
|
@@ -1852,10 +1866,10 @@ let Bt = class extends ee {
|
|
|
1852
1866
|
fe(([e, n]) => e ? e.activeSheet$.pipe(
|
|
1853
1867
|
fe((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
1875
|
new gn(s).id,
|
|
@@ -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,20 +1917,20 @@ let Bt = class extends ee {
|
|
|
1903
1917
|
);
|
|
1904
1918
|
}
|
|
1905
1919
|
};
|
|
1906
|
-
|
|
1920
|
+
jt = to([
|
|
1907
1921
|
it(0, ae),
|
|
1908
|
-
it(1,
|
|
1909
|
-
it(2,
|
|
1922
|
+
it(1, ee),
|
|
1923
|
+
it(2, Si),
|
|
1910
1924
|
it(3, de),
|
|
1911
|
-
it(4, A(
|
|
1912
|
-
],
|
|
1913
|
-
var
|
|
1914
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1925
|
+
it(4, A(vi))
|
|
1926
|
+
], jt);
|
|
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
|
|
1919
|
-
function
|
|
1932
|
+
const io = "univer-sheet-float-dom-";
|
|
1933
|
+
function Gr(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,
|
|
1922
1936
|
// left means the left of pic is in a viewMainLeft
|
|
@@ -1935,7 +1949,7 @@ function Vr(i, t, e, n, r, s = !1) {
|
|
|
1935
1949
|
};
|
|
1936
1950
|
_ && (Ge.isDefine(T.top) && (T.top = _.top), Ge.isDefine(T.left) && (T.left = _.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) + R,
|
|
1952
|
+
const N = e.rowStartY(l - h) + E, F = e.colStartX(c - g) + R, ne = e.rowStartY(l) + E, z = e.colStartX(c) + R;
|
|
1939
1953
|
if (g === 0)
|
|
1940
1954
|
m.left = !1, M = (f - v) * o, b = (p - v) * o;
|
|
1941
1955
|
else {
|
|
@@ -1947,7 +1961,7 @@ function Vr(i, t, e, n, r, s = !1) {
|
|
|
1947
1961
|
m.top = !1, V = (w - C) * a, Y = (S - C) * a;
|
|
1948
1962
|
else {
|
|
1949
1963
|
const K = w - (N - E), W = S - (N - E);
|
|
1950
|
-
S <
|
|
1964
|
+
S < ne ? (V = K * a, Y = W * a) : w <= ne && S >= ne ? (V = K * a, Y = Math.max(I, (S - C) * a)) : w > ne && (m.top = !1, V = Math.max((w - C) * a, I), Y = Math.max((S - 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,
|
|
@@ -1963,7 +1977,7 @@ const me = (i, t, e, n, r) => {
|
|
|
1963
1977
|
right: s + a,
|
|
1964
1978
|
top: o,
|
|
1965
1979
|
bottom: o + d
|
|
1966
|
-
}, l =
|
|
1980
|
+
}, l = Gr(c, t, e, n, r), { scaleX: g, scaleY: h } = t.getAncestorScale();
|
|
1967
1981
|
return {
|
|
1968
1982
|
startX: l.left,
|
|
1969
1983
|
endX: l.right,
|
|
@@ -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
|
+
ie(this, "_domLayerInfoMap", /* @__PURE__ */ new Map());
|
|
1999
|
+
ie(this, "_transformChange$", new an());
|
|
2000
|
+
ie(this, "transformChange$", this._transformChange$.asObservable());
|
|
2001
|
+
ie(this, "_add$", new an());
|
|
2002
|
+
ie(this, "add$", this._add$.asObservable());
|
|
2003
|
+
ie(this, "_remove$", new an());
|
|
2004
|
+
ie(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
|
}
|
|
@@ -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(An.CHART), f.addObject(N,
|
|
2058
|
-
const F = new yt(),
|
|
2071
|
+
b && N.setObjectType(An.CHART), f.addObject(N, Qt), a.allowTransform !== !1 && f.attachTransformerTo(N);
|
|
2072
|
+
const F = new yt(), ne = me(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,
|
|
@@ -2129,7 +2143,7 @@ let lt = class extends ee {
|
|
|
2129
2143
|
return r ? { render: r, unitId: n, subUnitId: e.getSheetId() } : null;
|
|
2130
2144
|
}),
|
|
2131
2145
|
fe(
|
|
2132
|
-
(e) => e ?
|
|
2146
|
+
(e) => e ? Ri(e.render.scene.getViewport(cr.VIEW_MAIN).onScrollAfter$).pipe(pe(() => ({ unitId: e.unitId, subUnitId: e.subUnitId }))) : wn(null)
|
|
2133
2147
|
)
|
|
2134
2148
|
).subscribe((e) => {
|
|
2135
2149
|
if (!e) return;
|
|
@@ -2142,10 +2156,10 @@ let lt = class extends ee {
|
|
|
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
|
}
|
|
@@ -2243,7 +2257,7 @@ let lt = class extends ee {
|
|
|
2243
2257
|
data: d,
|
|
2244
2258
|
allowTransform: u
|
|
2245
2259
|
};
|
|
2246
|
-
return this._commandService.executeCommand(
|
|
2260
|
+
return this._commandService.executeCommand(zt.id, {
|
|
2247
2261
|
unitId: r,
|
|
2248
2262
|
drawings: [g]
|
|
2249
2263
|
}), this._add$.next({ unitId: r, subUnitId: s, id: c }), {
|
|
@@ -2286,7 +2300,7 @@ let lt = class extends ee {
|
|
|
2286
2300
|
const { componentKey: l, data: g, allowTransform: h = !0 } = e, m = r != null ? r : He(), { position: f, position$: p } = this._createRangePositionObserver(t, u, c.skeleton);
|
|
2287
2301
|
if (this._getPosition(f, o) == null)
|
|
2288
2302
|
return;
|
|
2289
|
-
const S = d.scene, { scaleX: I } = S.getAncestorScale(), D =
|
|
2303
|
+
const S = d.scene, { scaleX: I } = S.getAncestorScale(), D = Pt(f, n, I), v = {
|
|
2290
2304
|
unitId: o,
|
|
2291
2305
|
subUnitId: a,
|
|
2292
2306
|
drawingId: m,
|
|
@@ -2308,10 +2322,10 @@ let lt = class extends ee {
|
|
|
2308
2322
|
const F = N.getActiveSheet().getSheetId();
|
|
2309
2323
|
if (!b || !M)
|
|
2310
2324
|
return;
|
|
2311
|
-
const
|
|
2312
|
-
if (!
|
|
2325
|
+
const ne = (_ = this._renderManagerService.getRenderById(R)) == null ? void 0 : _.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;
|
|
@@ -2323,12 +2337,12 @@ let lt = class extends ee {
|
|
|
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:
|
|
2340
|
+
const { left: ft, top: pt, width: wt, height: _t, angle: Zt, flipX: qt, flipY: St, skewX: vt, skewY: Ue } = V, It = De({ unitId: R, subUnitId: E, drawingId: T }), le = W.getObject(It);
|
|
2327
2341
|
if (le != null) {
|
|
2328
|
-
le.transformByState({ left: ft, top: pt, width: wt, height: _t, angle:
|
|
2342
|
+
le.transformByState({ left: ft, top: pt, width: wt, height: _t, angle: Zt, flipX: qt, 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,
|
|
@@ -2338,10 +2352,10 @@ let lt = class extends ee {
|
|
|
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 ue = new $e(It,
|
|
2344
|
-
Pe && ue.setObjectType(An.CHART), W.addObject(ue,
|
|
2357
|
+
const ue = new $e(It, re);
|
|
2358
|
+
Pe && ue.setObjectType(An.CHART), W.addObject(ue, Qt), b.allowTransform !== !1 && W.attachTransformerTo(ue);
|
|
2345
2359
|
const he = new yt(), Ct = W.getMainViewport(), { rowHeaderWidth: Ae, columnHeaderHeight: Qe } = z.skeleton, Rt = {
|
|
2346
2360
|
top: Qe,
|
|
2347
2361
|
left: Ae,
|
|
@@ -2385,7 +2399,7 @@ let lt = class extends ee {
|
|
|
2385
2399
|
}
|
|
2386
2400
|
}), this._canvasFloatDomService.addFloatDom(et), this.disposeWithMe(p.subscribe(($) => {
|
|
2387
2401
|
var Tn, On, Un, Pn;
|
|
2388
|
-
const En =
|
|
2402
|
+
const En = Pt({
|
|
2389
2403
|
startX: $.startX,
|
|
2390
2404
|
startY: $.startY,
|
|
2391
2405
|
endX: $.endX,
|
|
@@ -2396,14 +2410,14 @@ let lt = class extends ee {
|
|
|
2396
2410
|
left: f.absolute.left,
|
|
2397
2411
|
top: f.absolute.top
|
|
2398
2412
|
}
|
|
2399
|
-
}, n),
|
|
2413
|
+
}, n), zr = De({ unitId: R, subUnitId: E, drawingId: T }), Kr = new $e(zr, {
|
|
2400
2414
|
left: En.startX,
|
|
2401
2415
|
top: En.startY,
|
|
2402
2416
|
width: (Un = n.width) != null ? Un : $.width,
|
|
2403
2417
|
height: (Pn = n.height) != null ? Pn : $.height,
|
|
2404
2418
|
zIndex: this._drawingManagerService.getDrawingOrder(R, E).length - 1
|
|
2405
|
-
}),
|
|
2406
|
-
Ne.next(
|
|
2419
|
+
}), Jr = me(Kr, K.renderUnit.scene, z.skeleton, M.worksheet, ge);
|
|
2420
|
+
Ne.next(Jr);
|
|
2407
2421
|
}));
|
|
2408
2422
|
const tt = (y = this._renderManagerService.getRenderById(R)) == null ? void 0 : y.with(X);
|
|
2409
2423
|
tt == null || tt.currentSkeleton$.subscribe(($) => {
|
|
@@ -2477,18 +2491,18 @@ let lt = class extends ee {
|
|
|
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(_);
|
|
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:
|
|
2500
|
+
const { left: K, top: W, width: Oe, height: ft, angle: pt, flipX: wt, flipY: _t, skewX: Zt, skewY: qt } = ne, St = De({ unitId: _, subUnitId: y, drawingId: R }), vt = Y.getObject(St);
|
|
2487
2501
|
if (vt != null) {
|
|
2488
|
-
vt.transformByState({ left: K, top: W, width: Oe, height: ft, angle: pt, flipX: wt, flipY: _t, skewX:
|
|
2502
|
+
vt.transformByState({ left: K, top: W, width: Oe, height: ft, angle: pt, flipX: wt, flipY: _t, skewX: Zt, skewY: qt });
|
|
2489
2503
|
return;
|
|
2490
2504
|
}
|
|
2491
|
-
const Ue =
|
|
2505
|
+
const Ue = Pt({
|
|
2492
2506
|
startX: w.startX,
|
|
2493
2507
|
startY: 0,
|
|
2494
2508
|
endX: f.endX,
|
|
@@ -2506,15 +2520,15 @@ let lt = class extends ee {
|
|
|
2506
2520
|
height: Ue.height,
|
|
2507
2521
|
zIndex: this._drawingManagerService.getDrawingOrder(_, y).length - 1
|
|
2508
2522
|
}, le = new $e(St, It);
|
|
2509
|
-
Y.addObject(le,
|
|
2510
|
-
const
|
|
2523
|
+
Y.addObject(le, Qt), T.allowTransform !== !1 && Y.attachTransformerTo(le);
|
|
2524
|
+
const re = new yt(), Pe = Y.getMainViewport(), ue = {
|
|
2511
2525
|
top: 0,
|
|
2512
2526
|
//viewMain.top,
|
|
2513
2527
|
left: Pe.left,
|
|
2514
2528
|
bottom: Pe.bottom,
|
|
2515
2529
|
right: Pe.right
|
|
2516
2530
|
}, he = {
|
|
2517
|
-
dispose:
|
|
2531
|
+
dispose: re,
|
|
2518
2532
|
rect: le,
|
|
2519
2533
|
// position$,
|
|
2520
2534
|
unitId: _,
|
|
@@ -2560,7 +2574,7 @@ let lt = class extends ee {
|
|
|
2560
2574
|
);
|
|
2561
2575
|
});
|
|
2562
2576
|
this.disposeWithMe(p.subscribe((B) => {
|
|
2563
|
-
const Ne =
|
|
2577
|
+
const Ne = Pt({
|
|
2564
2578
|
startX: B.startX,
|
|
2565
2579
|
startY: 0,
|
|
2566
2580
|
endX: B.endX,
|
|
@@ -2583,9 +2597,9 @@ let lt = class extends ee {
|
|
|
2583
2597
|
const ge = (C = this._renderManagerService.getRenderById(_)) == null ? void 0 : C.with(X);
|
|
2584
2598
|
ge == null || ge.currentSkeleton$.subscribe((B) => {
|
|
2585
2599
|
B && c.sheetId !== B.sheetId && this._removeDom(m, !0);
|
|
2586
|
-
}),
|
|
2600
|
+
}), re.add(() => {
|
|
2587
2601
|
this._canvasFloatDomService.removeFloatDom(R);
|
|
2588
|
-
}), Rt &&
|
|
2602
|
+
}), Rt && re.add(Rt), this._domLayerInfoMap.set(R, he);
|
|
2589
2603
|
}
|
|
2590
2604
|
return {
|
|
2591
2605
|
id: m,
|
|
@@ -2612,11 +2626,11 @@ let lt = class extends ee {
|
|
|
2612
2626
|
a.next(p), u.next(w);
|
|
2613
2627
|
}, l = new yt();
|
|
2614
2628
|
l.add(e.engine.clientRect$.subscribe(() => c())), l.add(this._commandService.onCommandExecuted((p) => {
|
|
2615
|
-
if (p.id ===
|
|
2629
|
+
if (p.id === mr.id && p.params.rowsAutoHeightInfo.findIndex((S) => S.row === r) > -1) {
|
|
2616
2630
|
c();
|
|
2617
2631
|
return;
|
|
2618
2632
|
}
|
|
2619
|
-
(
|
|
2633
|
+
(ji.indexOf(p.id) > -1 || p.id === li.id || p.id === $n.id) && c();
|
|
2620
2634
|
}));
|
|
2621
2635
|
const g = (p, w) => {
|
|
2622
2636
|
r = p, s = w, c();
|
|
@@ -2660,14 +2674,14 @@ let lt = class extends ee {
|
|
|
2660
2674
|
};
|
|
2661
2675
|
}
|
|
2662
2676
|
};
|
|
2663
|
-
lt =
|
|
2664
|
-
be(0, A(
|
|
2677
|
+
lt = ro([
|
|
2678
|
+
be(0, A(ee)),
|
|
2665
2679
|
be(1, de),
|
|
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;
|
|
@@ -2678,22 +2692,22 @@ function st(i, t, e) {
|
|
|
2678
2692
|
bottom: r.endY
|
|
2679
2693
|
};
|
|
2680
2694
|
}
|
|
2681
|
-
function
|
|
2695
|
+
function Pt(i, t, e) {
|
|
2682
2696
|
var u, c;
|
|
2683
2697
|
e = e != null ? e : 1;
|
|
2684
2698
|
const n = i.endX - i.startX, r = i.endY - i.startY, s = (u = t == null ? void 0 : t.width) != null ? u : n, o = (c = t == null ? void 0 : t.height) != null ? c : r;
|
|
2685
2699
|
let a = 0, d = 0;
|
|
2686
2700
|
if (t) {
|
|
2687
2701
|
if (t.horizonOffsetAlign === "right") {
|
|
2688
|
-
const l =
|
|
2702
|
+
const l = At(t.marginX, n * e);
|
|
2689
2703
|
a = i.endX - l - s;
|
|
2690
2704
|
} else
|
|
2691
|
-
a = i.startX +
|
|
2705
|
+
a = i.startX + At(t.marginX, n);
|
|
2692
2706
|
if (t.verticalOffsetAlign === "bottom") {
|
|
2693
|
-
const l =
|
|
2707
|
+
const l = At(t.marginY, r * e);
|
|
2694
2708
|
d = i.endY - l - o;
|
|
2695
2709
|
} else
|
|
2696
|
-
d = i.startY +
|
|
2710
|
+
d = i.startY + At(t.marginY, r);
|
|
2697
2711
|
}
|
|
2698
2712
|
return {
|
|
2699
2713
|
rotate: 0,
|
|
@@ -2709,15 +2723,15 @@ function Ut(i, t, e) {
|
|
|
2709
2723
|
}
|
|
2710
2724
|
};
|
|
2711
2725
|
}
|
|
2712
|
-
function
|
|
2726
|
+
function At(i, t) {
|
|
2713
2727
|
if (i === void 0) return 0;
|
|
2714
2728
|
if (typeof i == "number") return i;
|
|
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
|
-
const { width: a, height: d, angle: u, left: c, top: l } = o.transform, g =
|
|
2734
|
+
const { width: a, height: d, angle: u, left: c, top: l } = o.transform, g = Gr(
|
|
2721
2735
|
{
|
|
2722
2736
|
left: c != null ? c : 0,
|
|
2723
2737
|
right: (c != null ? c : 0) + (a != null ? a : 0),
|
|
@@ -2756,14 +2770,14 @@ const io = (i) => {
|
|
|
2756
2770
|
};
|
|
2757
2771
|
return [o.drawingId, p];
|
|
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
|
|
2780
|
+
let Ft = 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
|
}
|
|
@@ -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,22 +2858,21 @@ let jt = class extends ee {
|
|
|
2844
2858
|
);
|
|
2845
2859
|
}
|
|
2846
2860
|
};
|
|
2847
|
-
|
|
2848
|
-
Me(0, A(
|
|
2849
|
-
Me(1, A(
|
|
2861
|
+
Ft = ao([
|
|
2862
|
+
Me(0, A(ui)),
|
|
2863
|
+
Me(1, A(Nr)),
|
|
2850
2864
|
Me(2, ae),
|
|
2851
|
-
Me(3,
|
|
2865
|
+
Me(3, ee),
|
|
2852
2866
|
Me(4, A(lt)),
|
|
2853
|
-
Me(5, A(
|
|
2867
|
+
Me(5, A(Ar)),
|
|
2854
2868
|
Me(6, A(qe))
|
|
2855
|
-
],
|
|
2856
|
-
var
|
|
2857
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
2869
|
+
], Ft);
|
|
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
|
|
2862
|
-
mr.id,
|
|
2874
|
+
}, Se = (i, t) => (e, n) => t(e, n, i);
|
|
2875
|
+
const uo = [
|
|
2863
2876
|
fr.id,
|
|
2864
2877
|
pr.id,
|
|
2865
2878
|
wr.id,
|
|
@@ -2867,9 +2880,9 @@ const lo = [
|
|
|
2867
2880
|
Sr.id,
|
|
2868
2881
|
vr.id,
|
|
2869
2882
|
Ir.id,
|
|
2883
|
+
Cr.id,
|
|
2870
2884
|
fn.id,
|
|
2871
2885
|
pn.id,
|
|
2872
|
-
Cr.id,
|
|
2873
2886
|
Rr.id,
|
|
2874
2887
|
Dr.id,
|
|
2875
2888
|
br.id,
|
|
@@ -2877,18 +2890,19 @@ const lo = [
|
|
|
2877
2890
|
yr.id,
|
|
2878
2891
|
Er.id,
|
|
2879
2892
|
Tr.id,
|
|
2880
|
-
Or.id
|
|
2881
|
-
|
|
2882
|
-
|
|
2893
|
+
Or.id,
|
|
2894
|
+
Ur.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
|
+
mr.id,
|
|
2902
|
+
Yi.id,
|
|
2903
|
+
Xi.id
|
|
2890
2904
|
];
|
|
2891
|
-
let Rn = class extends
|
|
2905
|
+
let Rn = 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,56 +2911,56 @@ 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: [] };
|
|
2904
2918
|
const t = i.id;
|
|
2905
|
-
if (t ===
|
|
2919
|
+
if (t === fr.id)
|
|
2906
2920
|
return this._moveRowInterceptor(i.params, "insert");
|
|
2907
|
-
if ([
|
|
2921
|
+
if ([Tr.id, Or.id, Ur.id].includes(t))
|
|
2908
2922
|
return this._moveRangeInterceptor(i.params);
|
|
2909
|
-
if (t === fr.id)
|
|
2910
|
-
return this._moveColInterceptor(i.params, "insert");
|
|
2911
2923
|
if (t === pr.id)
|
|
2912
|
-
return this.
|
|
2924
|
+
return this._moveColInterceptor(i.params, "insert");
|
|
2913
2925
|
if (t === wr.id)
|
|
2926
|
+
return this._moveRowInterceptor(i.params, "remove");
|
|
2927
|
+
if (t === _r.id)
|
|
2914
2928
|
return this._moveColInterceptor(i.params, "remove");
|
|
2915
|
-
if (t ===
|
|
2929
|
+
if (t === Sr.id) {
|
|
2916
2930
|
const { range: e } = i.params;
|
|
2917
2931
|
return this._getRangeMoveUndo(
|
|
2918
2932
|
e,
|
|
2919
2933
|
0
|
|
2920
2934
|
/* deleteLeft */
|
|
2921
2935
|
);
|
|
2922
|
-
} else if (t ===
|
|
2936
|
+
} else if (t === vr.id) {
|
|
2923
2937
|
const { range: e } = i.params;
|
|
2924
2938
|
return this._getRangeMoveUndo(
|
|
2925
2939
|
e,
|
|
2926
2940
|
1
|
|
2927
2941
|
/* deleteUp */
|
|
2928
2942
|
);
|
|
2929
|
-
} else if (t ===
|
|
2943
|
+
} else if (t === Ir.id) {
|
|
2930
2944
|
const { range: e } = i.params;
|
|
2931
2945
|
return this._getRangeMoveUndo(
|
|
2932
2946
|
e,
|
|
2933
2947
|
2
|
|
2934
2948
|
/* insertDown */
|
|
2935
2949
|
);
|
|
2936
|
-
} else if (t ===
|
|
2950
|
+
} else if (t === Cr.id) {
|
|
2937
2951
|
const { range: e } = i.params;
|
|
2938
2952
|
return this._getRangeMoveUndo(
|
|
2939
2953
|
e,
|
|
2940
2954
|
3
|
|
2941
2955
|
/* insertRight */
|
|
2942
2956
|
);
|
|
2943
|
-
} else if (t ===
|
|
2957
|
+
} else if (t === br.id || t === Mr.id) {
|
|
2944
2958
|
const e = i.params, { unitId: n, subUnitId: r, ranges: s } = e;
|
|
2945
2959
|
return this._getDrawingUndoForRowVisible(n, r, s);
|
|
2946
|
-
} else if (t ===
|
|
2960
|
+
} else if (t === yr.id || t === Er.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 === fn.id || t === pn.id || t ===
|
|
2963
|
+
} else if (t === fn.id || t === pn.id || t === Rr.id || t === Dr.id) {
|
|
2950
2964
|
const e = i.params, { unitId: n, subUnitId: r, ranges: s } = e, o = t === fn.id || t === pn.id;
|
|
2951
2965
|
return this._getDrawingUndoForRowAndColSize(n, r, s, o);
|
|
2952
2966
|
}
|
|
@@ -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;
|
|
@@ -3612,7 +3626,7 @@ let Rn = class extends ee {
|
|
|
3612
3626
|
const { from: c, to: l } = a, { row: g, column: h } = c, { row: m, column: f } = l;
|
|
3613
3627
|
for (let p = 0; p < e.length; p++) {
|
|
3614
3628
|
const w = e[p], { startRow: S, endRow: I, startColumn: D, endColumn: v } = w;
|
|
3615
|
-
if (
|
|
3629
|
+
if (bi.intersects(
|
|
3616
3630
|
{
|
|
3617
3631
|
startRow: S,
|
|
3618
3632
|
endRow: I,
|
|
@@ -3641,18 +3655,18 @@ 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
|
-
Rn =
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3658
|
+
Rn = lo([
|
|
3659
|
+
Se(1, ee),
|
|
3660
|
+
Se(2, G),
|
|
3661
|
+
Se(3, Je),
|
|
3662
|
+
Se(4, A(X)),
|
|
3663
|
+
Se(5, A(Vt)),
|
|
3664
|
+
Se(6, oe),
|
|
3665
|
+
Se(7, ae),
|
|
3666
|
+
Se(8, de)
|
|
3653
3667
|
], Rn);
|
|
3654
|
-
function
|
|
3655
|
-
const i =
|
|
3668
|
+
function go() {
|
|
3669
|
+
const i = Ce(Te), t = Ce(bn), e = Ce(yn), [n, r] = Ee([ye.CELL_ADDRESS]), [s, o] = Ee(!1), [a, d] = Ee(null), u = Fe(() => e.getCellImagesInSelection(), [e]), c = Fe(() => e.getDataColumns(), [e]), l = Fe(() => e.getSelectionRowRange(), [e]), g = c.length > 0, h = Fe(() => c.map((C) => ({
|
|
3656
3670
|
label: C.label,
|
|
3657
3671
|
value: String(C.index)
|
|
3658
3672
|
})), [c]), [m, f] = Ee(
|
|
@@ -3668,7 +3682,7 @@ function ho() {
|
|
|
3668
3682
|
endColumn: _
|
|
3669
3683
|
}];
|
|
3670
3684
|
}, [n, m, l]);
|
|
3671
|
-
|
|
3685
|
+
hi(p);
|
|
3672
3686
|
const w = Et((C) => {
|
|
3673
3687
|
C.length !== 0 && r(C);
|
|
3674
3688
|
}, []), S = Et((C) => {
|
|
@@ -3691,13 +3705,13 @@ function ho() {
|
|
|
3691
3705
|
}
|
|
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
|
-
/* @__PURE__ */ L(
|
|
3695
|
-
/* @__PURE__ */ L(
|
|
3708
|
+
/* @__PURE__ */ L(tn, { label: i.t("sheetImage.save.imageCount"), children: /* @__PURE__ */ L("div", { className: "univer-text-sm univer-text-gray-600", children: u.length }) }),
|
|
3709
|
+
/* @__PURE__ */ L(tn, { label: i.t("sheetImage.save.fileNameConfig"), children: /* @__PURE__ */ Xe(qi, { value: n, onChange: w, direction: "vertical", children: [
|
|
3696
3710
|
/* @__PURE__ */ L(Gn, { value: ye.CELL_ADDRESS, disabled: !g, children: i.t("sheetImage.save.useRowCol") }),
|
|
3697
3711
|
g && /* @__PURE__ */ L(Gn, { value: ye.COLUMN_VALUE, children: i.t("sheetImage.save.useColumnValue") })
|
|
3698
3712
|
] }) }),
|
|
3699
|
-
v && /* @__PURE__ */ L(
|
|
3700
|
-
|
|
3713
|
+
v && /* @__PURE__ */ L(tn, { label: i.t("sheetImage.save.selectColumn"), children: /* @__PURE__ */ L(
|
|
3714
|
+
Qi,
|
|
3701
3715
|
{
|
|
3702
3716
|
value: m,
|
|
3703
3717
|
options: h,
|
|
@@ -3725,9 +3739,9 @@ function ho() {
|
|
|
3725
3739
|
)
|
|
3726
3740
|
] });
|
|
3727
3741
|
}
|
|
3728
|
-
const
|
|
3742
|
+
const mo = (i) => {
|
|
3729
3743
|
var S;
|
|
3730
|
-
const t =
|
|
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;
|
|
@@ -3751,7 +3765,7 @@ const go = (i) => {
|
|
|
3751
3765
|
});
|
|
3752
3766
|
}), v;
|
|
3753
3767
|
}
|
|
3754
|
-
|
|
3768
|
+
kr(() => {
|
|
3755
3769
|
const I = c.clearControl$.subscribe((v) => {
|
|
3756
3770
|
v === !0 && g(!1);
|
|
3757
3771
|
}), D = c.changeStart$.subscribe((v) => {
|
|
@@ -3780,7 +3794,7 @@ const go = (i) => {
|
|
|
3780
3794
|
drawingId: C.drawingId,
|
|
3781
3795
|
anchorType: I
|
|
3782
3796
|
}));
|
|
3783
|
-
t.executeCommand(
|
|
3797
|
+
t.executeCommand(Kt.id, {
|
|
3784
3798
|
unitId: D[0].unitId,
|
|
3785
3799
|
drawings: v
|
|
3786
3800
|
});
|
|
@@ -3788,7 +3802,7 @@ const go = (i) => {
|
|
|
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,17 +3813,17 @@ 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(
|
|
3803
|
-
/* @__PURE__ */ L(
|
|
3804
|
-
/* @__PURE__ */ L(
|
|
3805
|
-
/* @__PURE__ */ L(
|
|
3816
|
+
/* @__PURE__ */ L("div", { children: /* @__PURE__ */ Xe(ts, { value: m, onChange: w, direction: "vertical", children: [
|
|
3817
|
+
/* @__PURE__ */ L(nn, { value: O.Both, children: e.t("drawing-anchor.both") }),
|
|
3818
|
+
/* @__PURE__ */ L(nn, { value: O.Position, children: e.t("drawing-anchor.position") }),
|
|
3819
|
+
/* @__PURE__ */ L(nn, { value: O.None, children: e.t("drawing-anchor.none") })
|
|
3806
3820
|
] }) })
|
|
3807
3821
|
]
|
|
3808
3822
|
}
|
|
3809
3823
|
);
|
|
3810
|
-
},
|
|
3811
|
-
const i =
|
|
3812
|
-
return
|
|
3824
|
+
}, fo = () => {
|
|
3825
|
+
const i = Ce(ae), t = i.getFocusDrawings(), [e, n] = Ee(t);
|
|
3826
|
+
return kr(() => {
|
|
3813
3827
|
const r = i.focus$.subscribe((s) => {
|
|
3814
3828
|
n(s);
|
|
3815
3829
|
});
|
|
@@ -3817,68 +3831,68 @@ 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
|
-
},
|
|
3824
|
-
function
|
|
3837
|
+
}, Yr = "sheet.menu.image";
|
|
3838
|
+
function po(i) {
|
|
3825
3839
|
return {
|
|
3826
|
-
id:
|
|
3827
|
-
type:
|
|
3840
|
+
id: Yr,
|
|
3841
|
+
type: Xt.SUBITEMS,
|
|
3828
3842
|
icon: "AddImageIcon",
|
|
3829
3843
|
tooltip: "sheetImage.title",
|
|
3830
|
-
hidden$:
|
|
3831
|
-
disabled$:
|
|
3844
|
+
hidden$: Yt(i, k.UNIVER_SHEET),
|
|
3845
|
+
disabled$: gi(i, { workbookTypes: [gn], worksheetTypes: [mn], rangeTypes: [Ki] })
|
|
3832
3846
|
};
|
|
3833
3847
|
}
|
|
3834
|
-
function
|
|
3848
|
+
function wo(i) {
|
|
3835
3849
|
return {
|
|
3836
|
-
id:
|
|
3850
|
+
id: Jt.id,
|
|
3837
3851
|
title: "sheetImage.upload.float",
|
|
3838
|
-
type:
|
|
3839
|
-
hidden$:
|
|
3852
|
+
type: Xt.BUTTON,
|
|
3853
|
+
hidden$: Yt(i, k.UNIVER_SHEET)
|
|
3840
3854
|
};
|
|
3841
3855
|
}
|
|
3842
|
-
function
|
|
3856
|
+
function _o(i) {
|
|
3843
3857
|
return {
|
|
3844
3858
|
id: Mn.id,
|
|
3845
3859
|
title: "sheetImage.upload.cell",
|
|
3846
|
-
type:
|
|
3847
|
-
hidden$:
|
|
3860
|
+
type: Xt.BUTTON,
|
|
3861
|
+
hidden$: Yt(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
3883
|
function dn(i) {
|
|
3870
3884
|
const t = i.get(de), e = i.get(ut), n = at([
|
|
3871
|
-
|
|
3885
|
+
Yt(i, k.UNIVER_SHEET),
|
|
3872
3886
|
t.getCurrentTypeOfUnit$(k.UNIVER_SHEET).pipe(
|
|
3873
3887
|
fe((r) => r ? e.selectionMoveEnd$.pipe(
|
|
3874
3888
|
pe(() => {
|
|
3875
|
-
if (!
|
|
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
|
})
|
|
@@ -3889,45 +3903,45 @@ function dn(i) {
|
|
|
3889
3903
|
);
|
|
3890
3904
|
return {
|
|
3891
3905
|
id: ct.id,
|
|
3892
|
-
type:
|
|
3906
|
+
type: Xt.BUTTON,
|
|
3893
3907
|
icon: "DownloadImageIcon",
|
|
3894
3908
|
title: "sheetImage.save.menuLabel",
|
|
3895
3909
|
hidden$: n
|
|
3896
3910
|
};
|
|
3897
3911
|
}
|
|
3898
|
-
const
|
|
3899
|
-
[
|
|
3900
|
-
[
|
|
3912
|
+
const Co = {
|
|
3913
|
+
[gs.MEDIA]: {
|
|
3914
|
+
[Yr]: {
|
|
3901
3915
|
order: 0,
|
|
3902
|
-
menuItemFactory:
|
|
3903
|
-
[
|
|
3916
|
+
menuItemFactory: po,
|
|
3917
|
+
[Jt.id]: {
|
|
3904
3918
|
order: 0,
|
|
3905
|
-
menuItemFactory:
|
|
3919
|
+
menuItemFactory: wo
|
|
3906
3920
|
},
|
|
3907
3921
|
[Mn.id]: {
|
|
3908
3922
|
order: 1,
|
|
3909
|
-
menuItemFactory:
|
|
3923
|
+
menuItemFactory: _o
|
|
3910
3924
|
}
|
|
3911
3925
|
}
|
|
3912
3926
|
},
|
|
3913
|
-
[
|
|
3914
|
-
[
|
|
3927
|
+
[sn.MAIN_AREA]: {
|
|
3928
|
+
[on.OTHERS]: {
|
|
3915
3929
|
[ct.id]: {
|
|
3916
3930
|
order: 10,
|
|
3917
3931
|
menuItemFactory: dn
|
|
3918
3932
|
}
|
|
3919
3933
|
}
|
|
3920
3934
|
},
|
|
3921
|
-
[
|
|
3922
|
-
[
|
|
3935
|
+
[sn.COL_HEADER]: {
|
|
3936
|
+
[on.OTHERS]: {
|
|
3923
3937
|
[ct.id]: {
|
|
3924
3938
|
order: 10,
|
|
3925
3939
|
menuItemFactory: dn
|
|
3926
3940
|
}
|
|
3927
3941
|
}
|
|
3928
3942
|
},
|
|
3929
|
-
[
|
|
3930
|
-
[
|
|
3943
|
+
[sn.ROW_HEADER]: {
|
|
3944
|
+
[on.OTHERS]: {
|
|
3931
3945
|
[ct.id]: {
|
|
3932
3946
|
order: 10,
|
|
3933
3947
|
menuItemFactory: dn
|
|
@@ -3936,9 +3950,9 @@ const Io = {
|
|
|
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,10 +3990,10 @@ const Co = {
|
|
|
3976
3990
|
priority: 100,
|
|
3977
3991
|
preconditions: mt,
|
|
3978
3992
|
staticParameters: {
|
|
3979
|
-
direction:
|
|
3993
|
+
direction: Ie.RIGHT
|
|
3980
3994
|
}
|
|
3981
|
-
},
|
|
3982
|
-
id:
|
|
3995
|
+
}, yo = {
|
|
3996
|
+
id: $r.id,
|
|
3983
3997
|
description: "shortcut.drawing-delete",
|
|
3984
3998
|
group: "4_drawing-view",
|
|
3985
3999
|
// when focusing on any other input tag do not trigger this shortcut
|
|
@@ -3987,48 +4001,48 @@ 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
|
|
4009
|
+
let Lt = 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(
|
|
4015
|
+
this.disposeWithMe(i.register(jr, 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
|
+
Jt,
|
|
4009
4023
|
Mn,
|
|
4010
|
-
Xt,
|
|
4011
|
-
ht,
|
|
4012
4024
|
zt,
|
|
4013
|
-
|
|
4014
|
-
|
|
4025
|
+
ht,
|
|
4026
|
+
Kt,
|
|
4015
4027
|
Fr,
|
|
4028
|
+
H,
|
|
4029
|
+
Lr,
|
|
4030
|
+
xr,
|
|
4031
|
+
Br,
|
|
4032
|
+
gt,
|
|
4016
4033
|
$r,
|
|
4017
4034
|
Wr,
|
|
4018
|
-
gt,
|
|
4019
|
-
kr,
|
|
4020
|
-
xr,
|
|
4021
4035
|
ct
|
|
4022
4036
|
].forEach((i) => this.disposeWithMe(this._commandService.registerCommand(i)));
|
|
4023
4037
|
}
|
|
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,63 +4051,63 @@ let Ft = class extends ee {
|
|
|
4037
4051
|
this._initCommands(), this._initCustomComponents(), this._initMenus(), this._initShortcuts();
|
|
4038
4052
|
}
|
|
4039
4053
|
};
|
|
4040
|
-
|
|
4041
|
-
Be(0, A(
|
|
4042
|
-
Be(1,
|
|
4054
|
+
Lt = To([
|
|
4055
|
+
Be(0, A(Ar)),
|
|
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
|
-
],
|
|
4048
|
-
var
|
|
4049
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
4061
|
+
], Lt);
|
|
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
|
-
}, ln = (i, t) => (e, n) => t(e, n, i),
|
|
4053
|
-
const
|
|
4054
|
-
let
|
|
4066
|
+
}, ln = (i, t) => (e, n) => t(e, n, i), Xr = (i, t, e) => Po(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4067
|
+
const No = "SHEET_IMAGE_UI_PLUGIN";
|
|
4068
|
+
let Ht = 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],
|
|
4081
|
+
[Lt],
|
|
4082
|
+
[kt],
|
|
4067
4083
|
[Ft],
|
|
4068
|
-
[Nt],
|
|
4069
4084
|
[jt],
|
|
4070
4085
|
[Bt],
|
|
4071
|
-
[Wt],
|
|
4072
|
-
[kt],
|
|
4073
4086
|
[$t],
|
|
4074
4087
|
[xt],
|
|
4088
|
+
[Wt],
|
|
4075
4089
|
[yn, { useClass: vn }]
|
|
4076
|
-
]),
|
|
4090
|
+
]), en(this._injector, [
|
|
4077
4091
|
[lt]
|
|
4078
4092
|
]);
|
|
4079
4093
|
}
|
|
4080
4094
|
onReady() {
|
|
4081
|
-
|
|
4082
|
-
[
|
|
4083
|
-
[
|
|
4095
|
+
en(this._injector, [
|
|
4096
|
+
[Bt],
|
|
4097
|
+
[Wt]
|
|
4084
4098
|
]);
|
|
4085
4099
|
}
|
|
4086
4100
|
onRendered() {
|
|
4087
|
-
this._registerRenderModules(),
|
|
4088
|
-
[Bt],
|
|
4101
|
+
this._registerRenderModules(), en(this._injector, [
|
|
4089
4102
|
[jt],
|
|
4090
4103
|
[Ft],
|
|
4091
|
-
[
|
|
4092
|
-
[$t]
|
|
4104
|
+
[Lt],
|
|
4105
|
+
[$t],
|
|
4106
|
+
[xt]
|
|
4093
4107
|
]);
|
|
4094
4108
|
}
|
|
4095
4109
|
onSteady() {
|
|
4096
|
-
this._injector.get(
|
|
4110
|
+
this._injector.get(kt);
|
|
4097
4111
|
}
|
|
4098
4112
|
_registerRenderModules() {
|
|
4099
4113
|
[
|
|
@@ -4106,37 +4120,37 @@ let Lt = class extends Ui {
|
|
|
4106
4120
|
});
|
|
4107
4121
|
}
|
|
4108
4122
|
};
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4123
|
+
Xr(Ht, "type", k.UNIVER_SHEET);
|
|
4124
|
+
Xr(Ht, "pluginName", No);
|
|
4125
|
+
Ht = Ao([
|
|
4126
|
+
Oi(os, ws, Rs, ki),
|
|
4113
4127
|
ln(1, A(qe)),
|
|
4114
|
-
ln(2,
|
|
4115
|
-
ln(3,
|
|
4116
|
-
],
|
|
4128
|
+
ln(2, ee),
|
|
4129
|
+
ln(3, Ui)
|
|
4130
|
+
], Ht);
|
|
4117
4131
|
export {
|
|
4118
4132
|
vn as BatchSaveImagesService,
|
|
4119
4133
|
H as ClearSheetDrawingTransformerOperation,
|
|
4120
|
-
|
|
4121
|
-
|
|
4134
|
+
$r as DeleteDrawingsCommand,
|
|
4135
|
+
Lr as EditSheetDrawingOperation,
|
|
4122
4136
|
ye as FileNamePart,
|
|
4123
|
-
|
|
4137
|
+
xr as GroupSheetDrawingCommand,
|
|
4124
4138
|
yn as IBatchSaveImagesService,
|
|
4125
|
-
|
|
4126
|
-
|
|
4139
|
+
Jt as InsertFloatImageCommand,
|
|
4140
|
+
zt as InsertSheetDrawingCommand,
|
|
4127
4141
|
gt as MoveDrawingsCommand,
|
|
4128
4142
|
ht as RemoveSheetDrawingCommand,
|
|
4129
|
-
|
|
4130
|
-
|
|
4143
|
+
Yr as SHEETS_IMAGE_MENU_ID,
|
|
4144
|
+
io as SHEET_FLOAT_DOM_PREFIX,
|
|
4131
4145
|
ct as SaveCellImagesCommand,
|
|
4132
|
-
|
|
4133
|
-
|
|
4146
|
+
Wr as SetDrawingArrangeCommand,
|
|
4147
|
+
Kt as SetSheetDrawingCommand,
|
|
4134
4148
|
lt as SheetCanvasFloatDomManagerService,
|
|
4135
|
-
|
|
4149
|
+
mo as SheetDrawingAnchor,
|
|
4136
4150
|
dt as SheetDrawingUpdateController,
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4151
|
+
Fr as SidebarSheetDrawingOperation,
|
|
4152
|
+
Br as UngroupSheetDrawingCommand,
|
|
4153
|
+
Ht as UniverSheetsDrawingUIPlugin,
|
|
4140
4154
|
me as calcSheetFloatDomPosition,
|
|
4141
4155
|
J as drawingPositionToTransform,
|
|
4142
4156
|
j as transformToDrawingPosition
|