@univerjs/sheets-drawing-ui 0.5.1-nightly.202412061606 → 0.5.1-nightly.202412081606
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +2 -2
- package/lib/es/index.js +69 -66
- package/lib/umd/index.js +2 -2
- package/package.json +12 -12
package/lib/es/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var Nn = Object.defineProperty;
|
|
2
2
|
var jn = (i, e, n) => e in i ? Nn(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n;
|
|
3
|
-
var
|
|
4
|
-
import { CommandType as Y, ICommandService as
|
|
3
|
+
var V = (i, e, n) => jn(i, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { CommandType as Y, ICommandService as F, IUndoRedoService as fe, sequenceExecute as Lt, LocaleService as Je, IUniverInstanceService as pe, useDependency as le, Inject as N, Injector as Ie, IContextService as Gt, RxDisposable as Wn, UniverInstanceType as G, connectInjector as xn, toDisposable as $n, FOCUSING_COMMON_DRAWINGS as ge, DrawingTypeEnum as k, Disposable as Z, ArrangeTypeEnum as De, createDocumentModelWithStyle as Bn, ObjectRelativeFromH as Ln, ObjectRelativeFromV as Gn, BooleanNumber as Fn, PositionedObjectLayoutType as Vn, WrapTextType as kn, BuildTextUtils as Hn, Range as Yn, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as be, DOCS_ZEN_EDITOR_UNIT_ID_KEY as ye, InterceptorEffectEnum as Xn, ObjectMatrix as zn, Tools as ve, UserManagerService as Kn, IPermissionService as Jn, Rectangle as qn, Direction as re, FOCUSING_FX_BAR_EDITOR as Zn, EDITOR_ACTIVATED as Qn, FOCUSING_PANEL_EDITOR as er, LifecycleService as tr, LifecycleStages as nr, DisposableCollection as rr, fromEventSubject as ir, generateRandomId as sr, DependentOn as or, Plugin as ar, registerDependencies as cr, touchDependencies as nt, IConfigService as dr } from "@univerjs/core";
|
|
5
5
|
import { DocDrawingController as lr, UniverDocsDrawingPlugin as ur } from "@univerjs/docs-drawing";
|
|
6
6
|
import { IDrawingManagerService as q, IImageIoService as Ft, DRAWING_IMAGE_ALLOW_IMAGE_LIST as bt, DRAWING_IMAGE_COUNT_LIMIT as yt, ImageUploadStatusType as ue, DRAWING_IMAGE_ALLOW_SIZE as Ot, getImageSize as Tt, DRAWING_IMAGE_WIDTH_LIMIT as Et, DRAWING_IMAGE_HEIGHT_LIMIT as Pt, getDrawingShapeKeyByDrawingSearch as rt, UniverDrawingPlugin as hr } from "@univerjs/drawing";
|
|
7
7
|
import { ImageCropperObject as gr, COMPONENT_IMAGE_POPUP_MENU as mr, OpenImageCropOperation as fr, ImageResetSizeOperation as pr, DrawingRenderService as Vt, DrawingCommonPanel as wr, UniverDrawingUIPlugin as _r } from "@univerjs/drawing-ui";
|
|
@@ -29,7 +29,7 @@ const li = "sheets-drawing-ui.config", ui = {}, W = {
|
|
|
29
29
|
type: Y.COMMAND,
|
|
30
30
|
handler: (i, e) => {
|
|
31
31
|
var I, S, R;
|
|
32
|
-
const n = i.get(
|
|
32
|
+
const n = i.get(F), t = i.get(fe), r = i.get(qe), s = i.get(z);
|
|
33
33
|
if (!e) return !1;
|
|
34
34
|
const { drawings: o } = e, d = [];
|
|
35
35
|
o.forEach((_) => {
|
|
@@ -81,7 +81,7 @@ const li = "sheets-drawing-ui.config", ui = {}, W = {
|
|
|
81
81
|
id: "sheet.operation.edit-sheet-image",
|
|
82
82
|
type: Y.OPERATION,
|
|
83
83
|
handler: (i, e) => {
|
|
84
|
-
const n = i.get(q), t = i.get(
|
|
84
|
+
const n = i.get(q), t = i.get(F);
|
|
85
85
|
return e == null ? !1 : (n.focusDrawing([e]), t.executeCommand(wn.id, { value: "open" }), !0);
|
|
86
86
|
}
|
|
87
87
|
};
|
|
@@ -142,11 +142,11 @@ var Si = Object.defineProperty, Ii = Object.getOwnPropertyDescriptor, Ci = (i, e
|
|
|
142
142
|
let Le = class extends Wn {
|
|
143
143
|
constructor(e, n, t, r, s, o, d) {
|
|
144
144
|
super();
|
|
145
|
-
|
|
145
|
+
V(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
|
|
146
146
|
this._injector = e, this._drawingManagerService = n, this._canvasPopManagerService = t, this._renderManagerService = r, this._univerInstanceService = s, this._contextService = o, this._uiPartsService = d, this._init();
|
|
147
147
|
}
|
|
148
148
|
_init() {
|
|
149
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
149
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(G.UNIVER_SHEET).pipe(Nt(this.dispose$)).subscribe((e) => this._create(e)), this._univerInstanceService.getTypeOfUnitDisposed$(G.UNIVER_SHEET).pipe(Nt(this.dispose$)).subscribe((e) => this._dispose(e)), this._univerInstanceService.getAllUnitsForType(G.UNIVER_SHEET).forEach((e) => this._create(e)), this._uiPartsService.registerComponent(jr.CONTENT, () => xn(vi, this._injector));
|
|
150
150
|
}
|
|
151
151
|
_dispose(e) {
|
|
152
152
|
const n = e.getUnitId();
|
|
@@ -230,7 +230,7 @@ let Le = class extends Wn {
|
|
|
230
230
|
index: 0,
|
|
231
231
|
commandId: _n.id,
|
|
232
232
|
commandParams: { unitId: e, subUnitId: n, drawingId: t },
|
|
233
|
-
disable: r ===
|
|
233
|
+
disable: r === k.DRAWING_DOM
|
|
234
234
|
},
|
|
235
235
|
{
|
|
236
236
|
label: "image-popup.delete",
|
|
@@ -244,14 +244,14 @@ let Le = class extends Wn {
|
|
|
244
244
|
index: 2,
|
|
245
245
|
commandId: fr.id,
|
|
246
246
|
commandParams: { unitId: e, subUnitId: n, drawingId: t },
|
|
247
|
-
disable: r ===
|
|
247
|
+
disable: r === k.DRAWING_DOM
|
|
248
248
|
},
|
|
249
249
|
{
|
|
250
250
|
label: "image-popup.reset",
|
|
251
251
|
index: 3,
|
|
252
252
|
commandId: pr.id,
|
|
253
253
|
commandParams: [{ unitId: e, subUnitId: n, drawingId: t }],
|
|
254
|
-
disable: r ===
|
|
254
|
+
disable: r === k.DRAWING_DOM
|
|
255
255
|
}
|
|
256
256
|
];
|
|
257
257
|
}
|
|
@@ -377,7 +377,7 @@ function bi(i) {
|
|
|
377
377
|
unitId: s,
|
|
378
378
|
subUnitId: o,
|
|
379
379
|
drawingId: d,
|
|
380
|
-
drawingType:
|
|
380
|
+
drawingType: k.DRAWING_GROUP,
|
|
381
381
|
transform: l
|
|
382
382
|
};
|
|
383
383
|
e.push({
|
|
@@ -405,7 +405,7 @@ function yi(i) {
|
|
|
405
405
|
unitId: s,
|
|
406
406
|
subUnitId: o,
|
|
407
407
|
drawingId: d,
|
|
408
|
-
drawingType:
|
|
408
|
+
drawingType: k.DRAWING_GROUP,
|
|
409
409
|
transform: {
|
|
410
410
|
left: 0,
|
|
411
411
|
top: 0
|
|
@@ -421,7 +421,7 @@ const vn = {
|
|
|
421
421
|
id: "sheet.command.group-sheet-image",
|
|
422
422
|
type: Y.COMMAND,
|
|
423
423
|
handler: (i, e) => {
|
|
424
|
-
const n = i.get(
|
|
424
|
+
const n = i.get(F), t = i.get(fe), r = i.get(z);
|
|
425
425
|
if (!e) return !1;
|
|
426
426
|
const s = [];
|
|
427
427
|
e.forEach(({ parent: u, children: m }) => {
|
|
@@ -447,7 +447,7 @@ const vn = {
|
|
|
447
447
|
type: Y.COMMAND,
|
|
448
448
|
handler: (i, e) => {
|
|
449
449
|
var I, S, R;
|
|
450
|
-
const n = i.get(
|
|
450
|
+
const n = i.get(F), t = i.get(fe), r = i.get(z), s = i.get(qe);
|
|
451
451
|
if (!e) return !1;
|
|
452
452
|
const o = e.drawings, d = o.map((_) => _.unitId), l = r.getBatchAddOp(o), { unitId: g, subUnitId: c, undo: a, redo: h, objects: u } = l, m = s.onCommandExecute({ id: Qe.id, params: e }), f = { id: T.id, params: { op: h, unitId: g, subUnitId: c, objects: u, type: E.INSERT } }, p = { id: T.id, params: { op: a, unitId: g, subUnitId: c, objects: u, type: E.REMOVE } };
|
|
453
453
|
return Lt([...(I = m.preRedos) != null ? I : [], f, ...m.redos], n) ? (t.pushUndoRedo({
|
|
@@ -470,7 +470,7 @@ const vn = {
|
|
|
470
470
|
id: "sheet.command.set-drawing-arrange",
|
|
471
471
|
type: Y.COMMAND,
|
|
472
472
|
handler: (i, e) => {
|
|
473
|
-
const n = i.get(
|
|
473
|
+
const n = i.get(F), t = i.get(fe);
|
|
474
474
|
if (!e) return !1;
|
|
475
475
|
const r = i.get(z), { unitId: s, subUnitId: o, drawingIds: d, arrangeType: l } = e, g = { unitId: s, subUnitId: o, drawingIds: d };
|
|
476
476
|
let c;
|
|
@@ -491,7 +491,7 @@ const vn = {
|
|
|
491
491
|
id: "sheet.command.set-sheet-image",
|
|
492
492
|
type: Y.COMMAND,
|
|
493
493
|
handler: (i, e) => {
|
|
494
|
-
const n = i.get(
|
|
494
|
+
const n = i.get(F), t = i.get(fe), r = i.get(z);
|
|
495
495
|
if (!e) return !1;
|
|
496
496
|
const { drawings: s } = e, o = r.getBatchUpdateOp(s), { unitId: d, subUnitId: l, undo: g, redo: c, objects: a } = o;
|
|
497
497
|
return n.syncExecuteCommand(T.id, { unitId: d, subUnitId: l, op: c, objects: a, type: E.UPDATE }) ? (t.pushUndoRedo({
|
|
@@ -510,7 +510,7 @@ const vn = {
|
|
|
510
510
|
id: "sheet.command.ungroup-sheet-image",
|
|
511
511
|
type: Y.COMMAND,
|
|
512
512
|
handler: (i, e) => {
|
|
513
|
-
const n = i.get(
|
|
513
|
+
const n = i.get(F), t = i.get(fe), r = i.get(z);
|
|
514
514
|
if (!e) return !1;
|
|
515
515
|
const s = [];
|
|
516
516
|
e.forEach(({ parent: u, children: m }) => {
|
|
@@ -558,7 +558,7 @@ function Cn(i, e, n, t, r) {
|
|
|
558
558
|
let Se = class extends Z {
|
|
559
559
|
constructor(e, n, t, r, s, o, d, l, g, c, a, h, u) {
|
|
560
560
|
super();
|
|
561
|
-
|
|
561
|
+
V(this, "_workbookSelections");
|
|
562
562
|
this._context = e, this._skeletonManagerService = n, this._commandService = t, this._selectionRenderService = r, this._imageIoService = s, this._fileOpenerService = o, this._sheetDrawingService = d, this._drawingManagerService = l, this._contextService = g, this._messageService = c, this._localeService = a, this._injector = u, this._workbookSelections = h.getWorkbookSelections(this._context.unitId), this._updateImageListener(), this._updateOrderListener(), this._groupDrawingListener(), this._focusDrawingListener();
|
|
563
563
|
}
|
|
564
564
|
async insertFloatImage() {
|
|
@@ -611,7 +611,7 @@ let Se = class extends Z {
|
|
|
611
611
|
unitId: r,
|
|
612
612
|
subUnitId: s,
|
|
613
613
|
drawingId: o,
|
|
614
|
-
drawingType:
|
|
614
|
+
drawingType: k.DRAWING_IMAGE,
|
|
615
615
|
imageSourceType: d,
|
|
616
616
|
source: l,
|
|
617
617
|
transform: B(p, this._selectionRenderService, this._skeletonManagerService),
|
|
@@ -679,7 +679,7 @@ let Se = class extends Z {
|
|
|
679
679
|
unitId: a.getUnitId(),
|
|
680
680
|
subUnitId: a.getUnitId(),
|
|
681
681
|
drawingId: t,
|
|
682
|
-
drawingType:
|
|
682
|
+
drawingType: k.DRAWING_IMAGE,
|
|
683
683
|
imageSourceType: r,
|
|
684
684
|
source: s,
|
|
685
685
|
transform: ai(u),
|
|
@@ -814,7 +814,7 @@ let Se = class extends Z {
|
|
|
814
814
|
};
|
|
815
815
|
Se = Ei([
|
|
816
816
|
K(1, N(Q)),
|
|
817
|
-
K(2,
|
|
817
|
+
K(2, F),
|
|
818
818
|
K(3, Ce),
|
|
819
819
|
K(4, Ft),
|
|
820
820
|
K(5, Wr),
|
|
@@ -920,7 +920,7 @@ let Ge = class extends Z {
|
|
|
920
920
|
}
|
|
921
921
|
};
|
|
922
922
|
Ge = Ni([
|
|
923
|
-
ce(0,
|
|
923
|
+
ce(0, F),
|
|
924
924
|
ce(1, N(qe)),
|
|
925
925
|
ce(2, pe),
|
|
926
926
|
ce(3, N(Ie)),
|
|
@@ -962,7 +962,7 @@ var $i = Object.defineProperty, Bi = Object.getOwnPropertyDescriptor, Li = (i, e
|
|
|
962
962
|
let Ve = class extends Z {
|
|
963
963
|
constructor(e, n, t, r) {
|
|
964
964
|
super();
|
|
965
|
-
|
|
965
|
+
V(this, "_isSetCursor", !1);
|
|
966
966
|
this._hoverManagerService = e, this._renderManagerService = n, this._selectionsService = t, this._drawingRenderService = r;
|
|
967
967
|
}
|
|
968
968
|
_initHover() {
|
|
@@ -984,7 +984,7 @@ var Gi = Object.defineProperty, Fi = Object.getOwnPropertyDescriptor, Vi = (i, e
|
|
|
984
984
|
let ke = class extends Z {
|
|
985
985
|
constructor(e, n, t) {
|
|
986
986
|
super();
|
|
987
|
-
|
|
987
|
+
V(this, "_copyInfo");
|
|
988
988
|
this._sheetClipboardService = e, this._renderManagerService = n, this._sheetDrawingService = t, this._initCopyPaste();
|
|
989
989
|
}
|
|
990
990
|
_initCopyPaste() {
|
|
@@ -1122,7 +1122,7 @@ let He = class extends Z {
|
|
|
1122
1122
|
super(), this._drawingManagerService = i, this._renderManagerService = e, this._permissionService = n, this._univerInstanceService = t, this._userManagerService = r, this._initDrawingVisible(), this._initDrawingEditable(), this._initViewPermissionChange(), this._initEditPermissionChange();
|
|
1123
1123
|
}
|
|
1124
1124
|
_initDrawingVisible() {
|
|
1125
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1125
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(G.UNIVER_SHEET);
|
|
1126
1126
|
this.disposeWithMe(
|
|
1127
1127
|
Te([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
|
|
1128
1128
|
if (!e) {
|
|
@@ -1151,7 +1151,7 @@ let He = class extends Z {
|
|
|
1151
1151
|
);
|
|
1152
1152
|
}
|
|
1153
1153
|
_initDrawingEditable() {
|
|
1154
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1154
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(G.UNIVER_SHEET);
|
|
1155
1155
|
this.disposeWithMe(
|
|
1156
1156
|
Te([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
|
|
1157
1157
|
if (!e) {
|
|
@@ -1180,7 +1180,7 @@ let He = class extends Z {
|
|
|
1180
1180
|
);
|
|
1181
1181
|
}
|
|
1182
1182
|
_initViewPermissionChange() {
|
|
1183
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1183
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(G.UNIVER_SHEET);
|
|
1184
1184
|
this.disposeWithMe(
|
|
1185
1185
|
Te([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
|
|
1186
1186
|
e && e.activeSheet$.subscribe((t) => {
|
|
@@ -1219,7 +1219,7 @@ let He = class extends Z {
|
|
|
1219
1219
|
);
|
|
1220
1220
|
}
|
|
1221
1221
|
_initEditPermissionChange() {
|
|
1222
|
-
const i = this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
1222
|
+
const i = this._univerInstanceService.getCurrentTypeOfUnit$(G.UNIVER_SHEET);
|
|
1223
1223
|
this.disposeWithMe(
|
|
1224
1224
|
Te([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
|
|
1225
1225
|
e && e.activeSheet$.subscribe((t) => {
|
|
@@ -1307,7 +1307,7 @@ let Ye = class extends Z {
|
|
|
1307
1307
|
const d = this._drawingManagerService.getDrawingDataForUnit(t), l = d == null ? void 0 : d[e.subUnitId];
|
|
1308
1308
|
if (!l)
|
|
1309
1309
|
return n(i);
|
|
1310
|
-
const { scaleX: g, scaleY: c } = s.scene, a = i ? { ...i } : { startColumn: 0, endColumn: 0, endRow: 0, startRow: 0 }, h = l.order.map((u) => l.data[u]).filter((u) => u.drawingType !==
|
|
1310
|
+
const { scaleX: g, scaleY: c } = s.scene, a = i ? { ...i } : { startColumn: 0, endColumn: 0, endRow: 0, startRow: 0 }, h = l.order.map((u) => l.data[u]).filter((u) => u.drawingType !== k.DRAWING_DOM);
|
|
1311
1311
|
return h.length ? (h.forEach((u) => {
|
|
1312
1312
|
if (!u.groupId && u.transform && ve.isDefine(u.transform.left) && ve.isDefine(u.transform.top) && ve.isDefine(u.transform.width) && ve.isDefine(u.transform.height)) {
|
|
1313
1313
|
const m = o.skeleton.getCellIndexByOffset(u.transform.left, u.transform.top, g, c, { x: 0, y: 0 }), f = o.skeleton.getCellIndexByOffset(u.transform.left + u.transform.width, u.transform.top + u.transform.height, g, c, { x: 0, y: 0 });
|
|
@@ -2077,7 +2077,7 @@ let wt = class extends Z {
|
|
|
2077
2077
|
};
|
|
2078
2078
|
wt = Zi([
|
|
2079
2079
|
te(1, X),
|
|
2080
|
-
te(2,
|
|
2080
|
+
te(2, F),
|
|
2081
2081
|
te(3, Ce),
|
|
2082
2082
|
te(4, N(Q)),
|
|
2083
2083
|
te(5, N(qe)),
|
|
@@ -2140,7 +2140,7 @@ const bn = {
|
|
|
2140
2140
|
id: "sheet.command.delete-drawing",
|
|
2141
2141
|
type: Y.COMMAND,
|
|
2142
2142
|
handler: (i) => {
|
|
2143
|
-
const e = i.get(
|
|
2143
|
+
const e = i.get(F), t = i.get(z).getFocusDrawings();
|
|
2144
2144
|
if (t.length === 0)
|
|
2145
2145
|
return !1;
|
|
2146
2146
|
const r = t[0].unitId, s = t.map((o) => {
|
|
@@ -2162,20 +2162,20 @@ const bn = {
|
|
|
2162
2162
|
type: Y.COMMAND,
|
|
2163
2163
|
handler: (i) => {
|
|
2164
2164
|
var n, t;
|
|
2165
|
-
return (t = (n = i.get(X).getCurrentTypeOfRenderer(
|
|
2165
|
+
return (t = (n = i.get(X).getCurrentTypeOfRenderer(G.UNIVER_SHEET)) == null ? void 0 : n.with(Se).insertFloatImage()) != null ? t : !1;
|
|
2166
2166
|
}
|
|
2167
2167
|
}, It = {
|
|
2168
2168
|
id: "sheet.command.insert-cell-image",
|
|
2169
2169
|
type: Y.COMMAND,
|
|
2170
2170
|
handler: (i) => {
|
|
2171
2171
|
var n, t;
|
|
2172
|
-
return (t = (n = i.get(X).getCurrentTypeOfRenderer(
|
|
2172
|
+
return (t = (n = i.get(X).getCurrentTypeOfRenderer(G.UNIVER_SHEET)) == null ? void 0 : n.with(Se).insertCellImage()) != null ? t : !1;
|
|
2173
2173
|
}
|
|
2174
2174
|
}, Re = {
|
|
2175
2175
|
id: "sheet.command.move-drawing",
|
|
2176
2176
|
type: Y.COMMAND,
|
|
2177
2177
|
handler: (i, e) => {
|
|
2178
|
-
const n = i.get(
|
|
2178
|
+
const n = i.get(F), t = i.get(z), r = i.get(Ce), { direction: s } = e, o = t.getFocusDrawings();
|
|
2179
2179
|
if (o.length === 0)
|
|
2180
2180
|
return !1;
|
|
2181
2181
|
const d = o[0].unitId, l = o.map((c) => {
|
|
@@ -2201,7 +2201,7 @@ function os(i) {
|
|
|
2201
2201
|
type: _t.SUBITEMS,
|
|
2202
2202
|
icon: yn,
|
|
2203
2203
|
tooltip: "sheetImage.title",
|
|
2204
|
-
hidden$: Ht(i,
|
|
2204
|
+
hidden$: Ht(i, G.UNIVER_SHEET),
|
|
2205
2205
|
disabled$: Pr(i, { workbookTypes: [ut], worksheetTypes: [xe], rangeTypes: [ii] })
|
|
2206
2206
|
};
|
|
2207
2207
|
}
|
|
@@ -2210,7 +2210,7 @@ function as(i) {
|
|
|
2210
2210
|
id: St.id,
|
|
2211
2211
|
title: "sheetImage.upload.float",
|
|
2212
2212
|
type: _t.BUTTON,
|
|
2213
|
-
hidden$: Ht(i,
|
|
2213
|
+
hidden$: Ht(i, G.UNIVER_SHEET)
|
|
2214
2214
|
};
|
|
2215
2215
|
}
|
|
2216
2216
|
function cs(i) {
|
|
@@ -2252,7 +2252,7 @@ function je() {
|
|
|
2252
2252
|
}
|
|
2253
2253
|
const Ms = (i) => {
|
|
2254
2254
|
var S;
|
|
2255
|
-
const e = le(
|
|
2255
|
+
const e = le(F), n = le(Je), t = le(q), r = le(X), { drawings: s } = i, o = s[0];
|
|
2256
2256
|
if (o == null)
|
|
2257
2257
|
return;
|
|
2258
2258
|
const { unitId: d } = o, l = r.getRenderById(d), g = l == null ? void 0 : l.scene;
|
|
@@ -2452,7 +2452,7 @@ let Xe = class extends Z {
|
|
|
2452
2452
|
Xe = Ns([
|
|
2453
2453
|
We(0, N(Br)),
|
|
2454
2454
|
We(1, Lr),
|
|
2455
|
-
We(2,
|
|
2455
|
+
We(2, F),
|
|
2456
2456
|
We(3, Gr)
|
|
2457
2457
|
], Xe);
|
|
2458
2458
|
var js = Object.defineProperty, Ws = Object.getOwnPropertyDescriptor, xs = (i, e, n, t) => {
|
|
@@ -2515,15 +2515,15 @@ const dt = (i, e, n, t) => {
|
|
|
2515
2515
|
let ze = class extends Z {
|
|
2516
2516
|
constructor(e, n, t, r, s, o, d) {
|
|
2517
2517
|
super();
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2518
|
+
V(this, "_domLayerMap", /* @__PURE__ */ new Map());
|
|
2519
|
+
V(this, "_domLayerInfoMap", /* @__PURE__ */ new Map());
|
|
2520
|
+
V(this, "_transformChange$", new it());
|
|
2521
|
+
V(this, "transformChange$", this._transformChange$.asObservable());
|
|
2522
|
+
V(this, "_add$", new it());
|
|
2523
|
+
V(this, "add$", this._add$.asObservable());
|
|
2524
|
+
V(this, "_remove$", new it());
|
|
2525
|
+
V(this, "remove$", this._remove$.asObservable());
|
|
2526
|
+
V(this, "_hooks", []);
|
|
2527
2527
|
this._renderManagerService = e, this._univerInstanceService = n, this._commandService = t, this._drawingManagerService = r, this._canvasFloatDomService = s, this._sheetDrawingService = o, this._lifecycleService = d, this._drawingAddListener(), this._featureUpdateListener(), this._deleteListener(), this._bindScrollEvent();
|
|
2528
2528
|
}
|
|
2529
2529
|
_bindScrollEvent() {
|
|
@@ -2562,7 +2562,7 @@ let ze = class extends Z {
|
|
|
2562
2562
|
this._drawingManagerService.add$.subscribe((e) => {
|
|
2563
2563
|
e.forEach((n) => {
|
|
2564
2564
|
var Rt, Mt, Dt;
|
|
2565
|
-
const { unitId: t, subUnitId: r, drawingId: s } = n, o = H(this._univerInstanceService, { unitId: t, subUnitId: r }), d = this._drawingManagerService.getDrawingByParam(n), l = this._univerInstanceService.getUnit(t,
|
|
2565
|
+
const { unitId: t, subUnitId: r, drawingId: s } = n, o = H(this._univerInstanceService, { unitId: t, subUnitId: r }), d = this._drawingManagerService.getDrawingByParam(n), l = this._univerInstanceService.getUnit(t, G.UNIVER_SHEET);
|
|
2566
2566
|
if (!l)
|
|
2567
2567
|
return;
|
|
2568
2568
|
const g = l.getActiveSheet().getSheetId();
|
|
@@ -2572,7 +2572,7 @@ let ze = class extends Z {
|
|
|
2572
2572
|
if (!c)
|
|
2573
2573
|
return;
|
|
2574
2574
|
const { transform: a, drawingType: h, data: u } = d;
|
|
2575
|
-
if (h !==
|
|
2575
|
+
if (h !== k.DRAWING_DOM && h !== k.DRAWING_CHART)
|
|
2576
2576
|
return;
|
|
2577
2577
|
const m = this._getSceneAndTransformerByDrawingSearch(t);
|
|
2578
2578
|
if (m == null)
|
|
@@ -2593,8 +2593,11 @@ let ze = class extends Z {
|
|
|
2593
2593
|
width: S,
|
|
2594
2594
|
height: R,
|
|
2595
2595
|
zIndex: this._drawingManagerService.getDrawingOrder(t, r).length - 1
|
|
2596
|
-
}, M = h ===
|
|
2597
|
-
|
|
2596
|
+
}, M = h === k.DRAWING_CHART;
|
|
2597
|
+
if (M) {
|
|
2598
|
+
const L = u ? u.backgroundColor : "white";
|
|
2599
|
+
D.fill = L, D.rotateEnabled = !1, u && u.border && (D.stroke = u.border), D.paintFirst = "stroke", D.strokeWidth = 1, D.borderEnabled = !1, D.radius = 8;
|
|
2600
|
+
}
|
|
2598
2601
|
const U = new Ut(A, D);
|
|
2599
2602
|
M && U.setObjectType(Ir.CHART), f.addObject(U, Cr), d.allowTransform !== !1 && f.attachTransformerTo(U);
|
|
2600
2603
|
const x = this._ensureMap(t, r), ee = new rr(), Un = dt(U, m.renderObject, c.skeleton, o.worksheet), tt = new kr(Un), An = {
|
|
@@ -2608,26 +2611,26 @@ let ze = class extends Z {
|
|
|
2608
2611
|
position$: tt,
|
|
2609
2612
|
id: s,
|
|
2610
2613
|
componentKey: d.componentKey,
|
|
2611
|
-
onPointerDown: (
|
|
2612
|
-
p.dispatchEvent(new PointerEvent(
|
|
2614
|
+
onPointerDown: (L) => {
|
|
2615
|
+
p.dispatchEvent(new PointerEvent(L.type, L));
|
|
2613
2616
|
},
|
|
2614
|
-
onPointerMove: (
|
|
2615
|
-
p.dispatchEvent(new PointerEvent(
|
|
2617
|
+
onPointerMove: (L) => {
|
|
2618
|
+
p.dispatchEvent(new PointerEvent(L.type, L));
|
|
2616
2619
|
},
|
|
2617
|
-
onPointerUp: (
|
|
2618
|
-
p.dispatchEvent(new PointerEvent(
|
|
2620
|
+
onPointerUp: (L) => {
|
|
2621
|
+
p.dispatchEvent(new PointerEvent(L.type, L));
|
|
2619
2622
|
},
|
|
2620
|
-
onWheel: (
|
|
2621
|
-
p.dispatchEvent(new WheelEvent(
|
|
2623
|
+
onWheel: (L) => {
|
|
2624
|
+
p.dispatchEvent(new WheelEvent(L.type, L));
|
|
2622
2625
|
},
|
|
2623
2626
|
props: (Dt = (Mt = x.get(s)) == null ? void 0 : Mt.props) != null ? Dt : this._getFloatDomProps(s),
|
|
2624
2627
|
data: u,
|
|
2625
2628
|
unitId: t
|
|
2626
2629
|
});
|
|
2627
2630
|
const Ct = U.onTransformChange$.subscribeEvent(() => {
|
|
2628
|
-
const
|
|
2631
|
+
const L = dt(U, m.renderObject, c.skeleton, o.worksheet);
|
|
2629
2632
|
tt.next(
|
|
2630
|
-
|
|
2633
|
+
L
|
|
2631
2634
|
);
|
|
2632
2635
|
});
|
|
2633
2636
|
ee.add(() => {
|
|
@@ -2662,7 +2665,7 @@ let ze = class extends Z {
|
|
|
2662
2665
|
});
|
|
2663
2666
|
};
|
|
2664
2667
|
this.disposeWithMe(
|
|
2665
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
2668
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(G.UNIVER_SHEET).pipe(
|
|
2666
2669
|
se((n) => !!n),
|
|
2667
2670
|
jt((n) => n.activeSheet$),
|
|
2668
2671
|
se((n) => !!n),
|
|
@@ -2722,7 +2725,7 @@ let ze = class extends Z {
|
|
|
2722
2725
|
this._drawingManagerService.update$.subscribe((e) => {
|
|
2723
2726
|
e.forEach((n) => {
|
|
2724
2727
|
const t = this._drawingManagerService.getDrawingByParam(n);
|
|
2725
|
-
if (!t || t.drawingType !==
|
|
2728
|
+
if (!t || t.drawingType !== k.DRAWING_DOM && t.drawingType !== k.DRAWING_CHART)
|
|
2726
2729
|
return;
|
|
2727
2730
|
const r = {
|
|
2728
2731
|
...t.transform
|
|
@@ -2763,7 +2766,7 @@ let ze = class extends Z {
|
|
|
2763
2766
|
unitId: r,
|
|
2764
2767
|
subUnitId: s,
|
|
2765
2768
|
drawingId: c,
|
|
2766
|
-
drawingType: e.type ||
|
|
2769
|
+
drawingType: e.type || k.DRAWING_DOM,
|
|
2767
2770
|
componentKey: d,
|
|
2768
2771
|
sheetTransform: a,
|
|
2769
2772
|
transform: {
|
|
@@ -2813,7 +2816,7 @@ let ze = class extends Z {
|
|
|
2813
2816
|
ze = xs([
|
|
2814
2817
|
de(0, N(X)),
|
|
2815
2818
|
de(1, pe),
|
|
2816
|
-
de(2, N(
|
|
2819
|
+
de(2, N(F)),
|
|
2817
2820
|
de(3, q),
|
|
2818
2821
|
de(4, N(Fr)),
|
|
2819
2822
|
de(5, z),
|
|
@@ -2870,11 +2873,11 @@ let Ke = class extends ar {
|
|
|
2870
2873
|
[wt],
|
|
2871
2874
|
[ft]
|
|
2872
2875
|
].forEach((i) => {
|
|
2873
|
-
this.disposeWithMe(this._renderManagerService.registerRenderModule(
|
|
2876
|
+
this.disposeWithMe(this._renderManagerService.registerRenderModule(G.UNIVER_SHEET, i));
|
|
2874
2877
|
});
|
|
2875
2878
|
}
|
|
2876
2879
|
};
|
|
2877
|
-
Pn(Ke, "type",
|
|
2880
|
+
Pn(Ke, "type", G.UNIVER_SHEET);
|
|
2878
2881
|
Pn(Ke, "pluginName", Fs);
|
|
2879
2882
|
Ke = Gs([
|
|
2880
2883
|
or(hr, ur, _r, Rr),
|