@univerjs/slides 0.1.10 → 0.1.12
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 +1 -1
- package/lib/es/index.js +258 -262
- package/lib/types/index.d.ts +1 -1
- package/lib/types/locale/index.d.ts +1 -0
- package/lib/types/locale/ru-RU.d.ts +4 -0
- package/lib/types/slides-plugin.d.ts +3 -3
- package/lib/types/views/render/adaptor.d.ts +4 -4
- package/lib/types/views/render/adaptors/docs-adaptor.d.ts +3 -3
- package/lib/types/views/render/adaptors/image-adaptor.d.ts +3 -3
- package/lib/types/views/render/adaptors/rich-text-adaptor.d.ts +3 -3
- package/lib/types/views/render/adaptors/shape-adaptor.d.ts +3 -3
- package/lib/types/views/render/adaptors/slide-adaptor.d.ts +3 -3
- package/lib/types/views/render/adaptors/spreadsheet-adaptor.d.ts +3 -3
- package/lib/types/views/render/canvas-view.d.ts +2 -2
- package/lib/types/views/render/object-provider.d.ts +2 -2
- package/lib/umd/index.js +1 -1
- package/package.json +10 -10
package/lib/es/index.js
CHANGED
|
@@ -1,22 +1,20 @@
|
|
|
1
|
-
var
|
|
2
|
-
var xe = (a, e, r) => e in a ?
|
|
3
|
-
var
|
|
4
|
-
import { Registry as Ce, LocaleService as ne, PageElementType as F, DocumentDataModel as je, getColorStyle as te, ShapeType as fe, SlideDataModel as Me, IContextService as Le, ObjectMatrix as Ne, Styles as ze, Worksheet as Ve, sortRules as Xe, OnLifecycle as Ae, LifecycleStages as Ue, RxDisposable as We, UniverInstanceType as M, debounce as $e, IUniverInstanceService as
|
|
1
|
+
var Re = Object.defineProperty;
|
|
2
|
+
var xe = (a, e, r) => e in a ? Re(a, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : a[e] = r;
|
|
3
|
+
var h = (a, e, r) => (xe(a, typeof e != "symbol" ? e + "" : e, r), r);
|
|
4
|
+
import { Registry as Ce, LocaleService as ne, PageElementType as F, DocumentDataModel as je, getColorStyle as te, ShapeType as fe, SlideDataModel as Me, IContextService as Le, ObjectMatrix as Ne, Styles as ze, Worksheet as Ve, sortRules as Xe, OnLifecycle as Ae, LifecycleStages as Ue, RxDisposable as We, UniverInstanceType as M, debounce as $e, IUniverInstanceService as Pe, Plugin as He } from "@univerjs/core";
|
|
5
5
|
import { Liquid as Ye, DocumentViewModel as Fe, DocumentSkeleton as Be, Documents as Ke, SceneViewer as me, Scene as ie, Viewport as X, EVENT_TYPE as pe, ScrollBar as ue, Rect as Y, Picture as Te, PageLayoutType as ve, RichText as ke, Slide as Oe, SpreadsheetSkeleton as qe, Spreadsheet as Ge, SpreadsheetRowHeader as Ze, SpreadsheetColumnHeader as Je, getColor as we, IRenderManagerService as Qe, IRenderingEngine as et } from "@univerjs/engine-render";
|
|
6
6
|
import { Inject as A, Injector as se } from "@wendellhu/redi";
|
|
7
7
|
import { takeUntil as Se } from "rxjs";
|
|
8
|
-
const Yt = {}, tt = {};
|
|
8
|
+
const Yt = {}, tt = {}, Ft = {};
|
|
9
9
|
class B {
|
|
10
10
|
constructor() {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
h(this, "zIndex", 0);
|
|
12
|
+
h(this, "viewKey", null);
|
|
13
13
|
}
|
|
14
14
|
check(e) {
|
|
15
15
|
if (e === this.viewKey)
|
|
16
16
|
return this;
|
|
17
17
|
}
|
|
18
|
-
convert(e, r) {
|
|
19
|
-
}
|
|
20
18
|
create(e) {
|
|
21
19
|
}
|
|
22
20
|
}
|
|
@@ -29,9 +27,9 @@ var rt = Object.defineProperty, nt = Object.getOwnPropertyDescriptor, it = (a, e
|
|
|
29
27
|
let le = class extends B {
|
|
30
28
|
constructor(e) {
|
|
31
29
|
super();
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
h(this, "zIndex", 5);
|
|
31
|
+
h(this, "viewKey", F.DOCUMENT);
|
|
32
|
+
h(this, "_liquid", new Ye());
|
|
35
33
|
this._localeService = e;
|
|
36
34
|
}
|
|
37
35
|
check(e) {
|
|
@@ -46,38 +44,38 @@ let le = class extends B {
|
|
|
46
44
|
zIndex: t,
|
|
47
45
|
left: s = 0,
|
|
48
46
|
top: i = 0,
|
|
49
|
-
width:
|
|
50
|
-
height:
|
|
47
|
+
width: o,
|
|
48
|
+
height: c,
|
|
51
49
|
angle: l,
|
|
52
|
-
scaleX:
|
|
53
|
-
scaleY:
|
|
50
|
+
scaleX: g,
|
|
51
|
+
scaleY: p,
|
|
54
52
|
skewX: d,
|
|
55
|
-
skewY:
|
|
56
|
-
flipX:
|
|
53
|
+
skewY: u,
|
|
54
|
+
flipX: _,
|
|
57
55
|
flipY: f,
|
|
58
|
-
title:
|
|
59
|
-
description:
|
|
56
|
+
title: y,
|
|
57
|
+
description: E,
|
|
60
58
|
document: T
|
|
61
59
|
} = e;
|
|
62
60
|
if (T == null)
|
|
63
61
|
return;
|
|
64
|
-
const
|
|
62
|
+
const P = new je(T), w = new Fe(P), I = Be.create(w, this._localeService), S = new Ke("__DocsRender__", I);
|
|
65
63
|
I.calculate();
|
|
66
64
|
const D = new me("__DocsViewer__" + n, {
|
|
67
65
|
top: i,
|
|
68
66
|
left: s,
|
|
69
|
-
width:
|
|
70
|
-
height:
|
|
67
|
+
width: o,
|
|
68
|
+
height: c,
|
|
71
69
|
zIndex: t,
|
|
72
70
|
angle: l,
|
|
73
|
-
scaleX:
|
|
74
|
-
scaleY:
|
|
71
|
+
scaleX: g,
|
|
72
|
+
scaleY: p,
|
|
75
73
|
skewX: d,
|
|
76
|
-
skewY:
|
|
77
|
-
flipX:
|
|
74
|
+
skewY: u,
|
|
75
|
+
flipX: _,
|
|
78
76
|
flipY: f,
|
|
79
77
|
isTransformer: !0
|
|
80
|
-
}), v = new ie("__DocsScene__" + n, D),
|
|
78
|
+
}), v = new ie("__DocsScene__" + n, D), b = new X("__DocsViewPort_" + n, v, {
|
|
81
79
|
left: 0,
|
|
82
80
|
top: 0,
|
|
83
81
|
bottom: 0,
|
|
@@ -91,18 +89,18 @@ let le = class extends B {
|
|
|
91
89
|
let x = z < 40 ? 0.2 : z < 80 ? 0.4 : 0.2;
|
|
92
90
|
x *= O.deltaY > 0 ? -1 : 1, v.scaleX < 1 && (x /= 2), v.scaleX + x > 4 ? v.scale(4, 4) : v.scaleX + x < 0.1 ? v.scale(0.1, 0.1) : (O.deltaY > 0, O.preventDefault());
|
|
93
91
|
} else
|
|
94
|
-
|
|
95
|
-
}), new ue(
|
|
92
|
+
b.onMouseWheel(O, W);
|
|
93
|
+
}), new ue(b, {
|
|
96
94
|
mainScene: r
|
|
97
95
|
}), v.addObject(S);
|
|
98
96
|
const m = I.getActualSize();
|
|
99
97
|
S.resize(m.actualWidth, m.actualHeight), v.resize(m.actualWidth, m.actualHeight + 200);
|
|
100
|
-
const
|
|
98
|
+
const R = (k = S.getSkeleton()) == null ? void 0 : k.getPageSize();
|
|
101
99
|
S.onPageRenderObservable.add((N) => {
|
|
102
100
|
const { page: W, pageLeft: O, pageTop: z, ctx: x } = N, { width: q, height: G, marginBottom: ae, marginLeft: j, marginRight: Z, marginTop: J } = W;
|
|
103
101
|
x.save(), x.translate(O - 0.5, z - 0.5), Y.drawWith(x, {
|
|
104
|
-
width: (
|
|
105
|
-
height: (
|
|
102
|
+
width: (R == null ? void 0 : R.width) || q,
|
|
103
|
+
height: (R == null ? void 0 : R.height) || G,
|
|
106
104
|
strokeWidth: 1,
|
|
107
105
|
stroke: "rgba(198,198,198, 1)",
|
|
108
106
|
fill: "rgba(255,255,255, 1)",
|
|
@@ -117,11 +115,11 @@ let le = class extends B {
|
|
|
117
115
|
for (let N = 0, W = C.length; N < W; N++) {
|
|
118
116
|
const O = C[N], { skeDrawings: z, marginLeft: x, marginTop: q, pageWidth: G, pageHeight: ae } = O;
|
|
119
117
|
this._liquid.translatePagePadding(O), z.forEach((j) => {
|
|
120
|
-
const { aLeft: Z, aTop: J, height: De, width:
|
|
118
|
+
const { aLeft: Z, aTop: J, height: De, width: ye, drawingOrigin: Xt } = j, Ee = new Te(j.objectId, {
|
|
121
119
|
// url: objectTransform.imageProperties?.contentUrl || '',
|
|
122
120
|
left: Z + H + this._liquid.x,
|
|
123
121
|
top: J + U + this._liquid.y,
|
|
124
|
-
width:
|
|
122
|
+
width: ye,
|
|
125
123
|
height: De,
|
|
126
124
|
zIndex: 11,
|
|
127
125
|
isTransformer: !0
|
|
@@ -129,7 +127,7 @@ let le = class extends B {
|
|
|
129
127
|
K.set(j.objectId, {
|
|
130
128
|
marginLeft: this._liquid.x,
|
|
131
129
|
marginTop: this._liquid.y
|
|
132
|
-
}), V.push(
|
|
130
|
+
}), V.push(Ee);
|
|
133
131
|
}), this._liquid.translatePage(
|
|
134
132
|
O,
|
|
135
133
|
S.pageLayoutType,
|
|
@@ -148,30 +146,30 @@ let le = class extends B {
|
|
|
148
146
|
width: ae
|
|
149
147
|
});
|
|
150
148
|
}), I == null || I.calculate();
|
|
151
|
-
}), v.closeTransformer(), this._calculatePagePosition(S, v,
|
|
149
|
+
}), v.closeTransformer(), this._calculatePagePosition(S, v, b), D;
|
|
152
150
|
}
|
|
153
151
|
_recalculateSizeBySkeleton(e, r, n) {
|
|
154
|
-
var
|
|
155
|
-
const t = (
|
|
152
|
+
var o;
|
|
153
|
+
const t = (o = n.getSkeletonData()) == null ? void 0 : o.pages;
|
|
156
154
|
if (t == null)
|
|
157
155
|
return;
|
|
158
156
|
let s = 0, i = 0;
|
|
159
|
-
for (let
|
|
160
|
-
const
|
|
161
|
-
e.pageLayoutType === ve.VERTICAL ? (i += d, i += e.pageMarginTop,
|
|
157
|
+
for (let c = 0, l = t.length; c < l; c++) {
|
|
158
|
+
const g = t[c], { pageWidth: p, pageHeight: d } = g;
|
|
159
|
+
e.pageLayoutType === ve.VERTICAL ? (i += d, i += e.pageMarginTop, c === l - 1 && (i += e.pageMarginTop), s = Math.max(s, p)) : e.pageLayoutType === ve.HORIZONTAL && (s += p, c !== l - 1 && (s += e.pageMarginLeft), i = Math.max(i, d));
|
|
162
160
|
}
|
|
163
161
|
e.resize(s, i), r.resize(s, i);
|
|
164
162
|
}
|
|
165
163
|
_calculatePagePosition(e, r, n, t = 1) {
|
|
166
|
-
const s = r == null ? void 0 : r.getParent(), { width: i, height:
|
|
167
|
-
if (s == null || i === Number.POSITIVE_INFINITY ||
|
|
164
|
+
const s = r == null ? void 0 : r.getParent(), { width: i, height: o, pageMarginLeft: c, pageMarginTop: l } = e;
|
|
165
|
+
if (s == null || i === Number.POSITIVE_INFINITY || o === Number.POSITIVE_INFINITY)
|
|
168
166
|
return;
|
|
169
|
-
const { width:
|
|
170
|
-
let d = 0,
|
|
171
|
-
if (
|
|
172
|
-
const
|
|
167
|
+
const { width: g, height: p } = s;
|
|
168
|
+
let d = 0, u = 0, _ = 0, f = 0, y = Number.POSITIVE_INFINITY;
|
|
169
|
+
if (g > (i + c * 2) * t ? (d = g / 2 - i * t / 2, d /= t, _ = (g - c * 2) / t, y = 0) : (d = c, _ = i + c * 2, y = (_ - g / t) / 2), p > o ? (u = p / 2 - o / 2, f = (p - l * 2) / t) : (u = l, f = o + l * 2), r.resize(_, f + 200), e.translate(d, u), y !== Number.POSITIVE_INFINITY && n != null) {
|
|
170
|
+
const E = n.getBarScroll(y, 0).x;
|
|
173
171
|
n.scrollTo({
|
|
174
|
-
x:
|
|
172
|
+
x: E
|
|
175
173
|
});
|
|
176
174
|
}
|
|
177
175
|
return this;
|
|
@@ -182,7 +180,7 @@ le = it([
|
|
|
182
180
|
], le);
|
|
183
181
|
class at {
|
|
184
182
|
constructor() {
|
|
185
|
-
|
|
183
|
+
h(this, "zIndex", 5);
|
|
186
184
|
}
|
|
187
185
|
create(e) {
|
|
188
186
|
return e.createInstance(le);
|
|
@@ -192,8 +190,8 @@ $.add(new at());
|
|
|
192
190
|
class ct extends B {
|
|
193
191
|
constructor() {
|
|
194
192
|
super(...arguments);
|
|
195
|
-
|
|
196
|
-
|
|
193
|
+
h(this, "zIndex", 1);
|
|
194
|
+
h(this, "viewKey", F.IMAGE);
|
|
197
195
|
}
|
|
198
196
|
check(r) {
|
|
199
197
|
if (r === this.viewKey)
|
|
@@ -205,32 +203,32 @@ class ct extends B {
|
|
|
205
203
|
zIndex: t,
|
|
206
204
|
left: s = 0,
|
|
207
205
|
top: i = 0,
|
|
208
|
-
width:
|
|
209
|
-
height:
|
|
206
|
+
width: o,
|
|
207
|
+
height: c,
|
|
210
208
|
angle: l,
|
|
211
|
-
scaleX:
|
|
212
|
-
scaleY:
|
|
209
|
+
scaleX: g,
|
|
210
|
+
scaleY: p,
|
|
213
211
|
skewX: d,
|
|
214
|
-
skewY:
|
|
215
|
-
flipX:
|
|
212
|
+
skewY: u,
|
|
213
|
+
flipX: _,
|
|
216
214
|
flipY: f,
|
|
217
|
-
title:
|
|
218
|
-
description:
|
|
215
|
+
title: y,
|
|
216
|
+
description: E,
|
|
219
217
|
image: T = {}
|
|
220
|
-
} = r, { imageProperties:
|
|
218
|
+
} = r, { imageProperties: P, placeholder: w, link: I } = T, S = (P == null ? void 0 : P.contentUrl) || "";
|
|
221
219
|
return new Te(n, {
|
|
222
220
|
url: S,
|
|
223
221
|
top: i,
|
|
224
222
|
left: s,
|
|
225
|
-
width:
|
|
226
|
-
height:
|
|
223
|
+
width: o,
|
|
224
|
+
height: c,
|
|
227
225
|
zIndex: t,
|
|
228
226
|
angle: l,
|
|
229
|
-
scaleX:
|
|
230
|
-
scaleY:
|
|
227
|
+
scaleX: g,
|
|
228
|
+
scaleY: p,
|
|
231
229
|
skewX: d,
|
|
232
|
-
skewY:
|
|
233
|
-
flipX:
|
|
230
|
+
skewY: u,
|
|
231
|
+
flipX: _,
|
|
234
232
|
flipY: f,
|
|
235
233
|
isTransformer: !0,
|
|
236
234
|
forceRender: !0
|
|
@@ -239,7 +237,7 @@ class ct extends B {
|
|
|
239
237
|
}
|
|
240
238
|
class ot {
|
|
241
239
|
constructor() {
|
|
242
|
-
|
|
240
|
+
h(this, "zIndex", 4);
|
|
243
241
|
}
|
|
244
242
|
create(e) {
|
|
245
243
|
return e.createInstance(ct);
|
|
@@ -254,8 +252,8 @@ var lt = Object.defineProperty, dt = Object.getOwnPropertyDescriptor, ht = (a, e
|
|
|
254
252
|
let de = class extends B {
|
|
255
253
|
constructor(e) {
|
|
256
254
|
super();
|
|
257
|
-
|
|
258
|
-
|
|
255
|
+
h(this, "zIndex", 2);
|
|
256
|
+
h(this, "viewKey", F.TEXT);
|
|
259
257
|
this._localeService = e;
|
|
260
258
|
}
|
|
261
259
|
check(e) {
|
|
@@ -268,36 +266,36 @@ let de = class extends B {
|
|
|
268
266
|
zIndex: t,
|
|
269
267
|
left: s = 0,
|
|
270
268
|
top: i = 0,
|
|
271
|
-
width:
|
|
272
|
-
height:
|
|
269
|
+
width: o,
|
|
270
|
+
height: c,
|
|
273
271
|
angle: l,
|
|
274
|
-
scaleX:
|
|
275
|
-
scaleY:
|
|
272
|
+
scaleX: g,
|
|
273
|
+
scaleY: p,
|
|
276
274
|
skewX: d,
|
|
277
|
-
skewY:
|
|
278
|
-
flipX:
|
|
275
|
+
skewY: u,
|
|
276
|
+
flipX: _,
|
|
279
277
|
flipY: f,
|
|
280
|
-
title:
|
|
281
|
-
description:
|
|
278
|
+
title: y,
|
|
279
|
+
description: E,
|
|
282
280
|
richText: T = {}
|
|
283
|
-
} = e, { text:
|
|
281
|
+
} = e, { text: P, ff: w, fs: I, it: S, bl: D, ul: v, st: b, ol: m, bg: R, bd: H, cl: U, rich: L } = T;
|
|
284
282
|
let C = {
|
|
285
283
|
top: i,
|
|
286
284
|
left: s,
|
|
287
|
-
width:
|
|
288
|
-
height:
|
|
285
|
+
width: o,
|
|
286
|
+
height: c,
|
|
289
287
|
zIndex: t,
|
|
290
288
|
angle: l,
|
|
291
|
-
scaleX:
|
|
292
|
-
scaleY:
|
|
289
|
+
scaleX: g,
|
|
290
|
+
scaleY: p,
|
|
293
291
|
skewX: d,
|
|
294
|
-
skewY:
|
|
295
|
-
flipX:
|
|
292
|
+
skewY: u,
|
|
293
|
+
flipX: _,
|
|
296
294
|
flipY: f,
|
|
297
295
|
isTransformer: !0,
|
|
298
296
|
forceRender: !0
|
|
299
297
|
}, V = !1;
|
|
300
|
-
if (
|
|
298
|
+
if (P != null ? (C = { ...C, text: P, ff: w, fs: I, it: S, bl: D, ul: v, st: b, ol: m, bg: R, bd: H, cl: U }, V = !0) : L != null && (C = { ...C, richText: L }, V = !0), V !== !1)
|
|
301
299
|
return new ke(this._localeService, n, C);
|
|
302
300
|
}
|
|
303
301
|
};
|
|
@@ -306,7 +304,7 @@ de = ht([
|
|
|
306
304
|
], de);
|
|
307
305
|
class pt {
|
|
308
306
|
constructor() {
|
|
309
|
-
|
|
307
|
+
h(this, "zIndex", 0);
|
|
310
308
|
}
|
|
311
309
|
create(e) {
|
|
312
310
|
return e.createInstance(de);
|
|
@@ -316,8 +314,8 @@ $.add(new pt());
|
|
|
316
314
|
class ut extends B {
|
|
317
315
|
constructor() {
|
|
318
316
|
super(...arguments);
|
|
319
|
-
|
|
320
|
-
|
|
317
|
+
h(this, "zIndex", 2);
|
|
318
|
+
h(this, "viewKey", F.SHAPE);
|
|
321
319
|
}
|
|
322
320
|
check(r) {
|
|
323
321
|
if (r === this.viewKey)
|
|
@@ -329,40 +327,40 @@ class ut extends B {
|
|
|
329
327
|
zIndex: t,
|
|
330
328
|
left: s = 0,
|
|
331
329
|
top: i = 0,
|
|
332
|
-
width:
|
|
333
|
-
height:
|
|
330
|
+
width: o,
|
|
331
|
+
height: c,
|
|
334
332
|
angle: l,
|
|
335
|
-
scaleX:
|
|
336
|
-
scaleY:
|
|
333
|
+
scaleX: g,
|
|
334
|
+
scaleY: p,
|
|
337
335
|
skewX: d,
|
|
338
|
-
skewY:
|
|
339
|
-
flipX:
|
|
336
|
+
skewY: u,
|
|
337
|
+
flipX: _,
|
|
340
338
|
flipY: f,
|
|
341
|
-
title:
|
|
342
|
-
description:
|
|
343
|
-
} = r, { shapeType: T, text:
|
|
339
|
+
title: y,
|
|
340
|
+
description: E
|
|
341
|
+
} = r, { shapeType: T, text: P, shapeProperties: w, placeholder: I, link: S } = r.shape || {}, D = w == null ? "" : te(w.shapeBackgroundFill) || "rgba(255,255,255,1)", v = w == null ? void 0 : w.outline, b = {};
|
|
344
342
|
if (v) {
|
|
345
|
-
const { outlineFill: m, weight:
|
|
346
|
-
|
|
343
|
+
const { outlineFill: m, weight: R } = v;
|
|
344
|
+
b.strokeWidth = R, b.stroke = te(m) || "rgba(0,0,0,1)";
|
|
347
345
|
}
|
|
348
346
|
if (T === fe.RECTANGLE)
|
|
349
347
|
return new Y(n, {
|
|
350
348
|
fill: D,
|
|
351
349
|
top: i,
|
|
352
350
|
left: s,
|
|
353
|
-
width:
|
|
354
|
-
height:
|
|
351
|
+
width: o,
|
|
352
|
+
height: c,
|
|
355
353
|
zIndex: t,
|
|
356
354
|
angle: l,
|
|
357
|
-
scaleX:
|
|
358
|
-
scaleY:
|
|
355
|
+
scaleX: g,
|
|
356
|
+
scaleY: p,
|
|
359
357
|
skewX: d,
|
|
360
|
-
skewY:
|
|
361
|
-
flipX:
|
|
358
|
+
skewY: u,
|
|
359
|
+
flipX: _,
|
|
362
360
|
flipY: f,
|
|
363
361
|
isTransformer: !0,
|
|
364
362
|
forceRender: !0,
|
|
365
|
-
...
|
|
363
|
+
...b
|
|
366
364
|
});
|
|
367
365
|
if (T === fe.ROUND_RECTANGLE) {
|
|
368
366
|
const m = (w == null ? void 0 : w.radius) || 0;
|
|
@@ -370,27 +368,27 @@ class ut extends B {
|
|
|
370
368
|
fill: D,
|
|
371
369
|
top: i,
|
|
372
370
|
left: s,
|
|
373
|
-
width:
|
|
374
|
-
height:
|
|
371
|
+
width: o,
|
|
372
|
+
height: c,
|
|
375
373
|
zIndex: t,
|
|
376
374
|
angle: l,
|
|
377
|
-
scaleX:
|
|
378
|
-
scaleY:
|
|
375
|
+
scaleX: g,
|
|
376
|
+
scaleY: p,
|
|
379
377
|
skewX: d,
|
|
380
|
-
skewY:
|
|
381
|
-
flipX:
|
|
378
|
+
skewY: u,
|
|
379
|
+
flipX: _,
|
|
382
380
|
flipY: f,
|
|
383
381
|
isTransformer: !0,
|
|
384
382
|
forceRender: !0,
|
|
385
383
|
radius: m,
|
|
386
|
-
...
|
|
384
|
+
...b
|
|
387
385
|
});
|
|
388
386
|
}
|
|
389
387
|
}
|
|
390
388
|
}
|
|
391
389
|
class _t {
|
|
392
390
|
constructor() {
|
|
393
|
-
|
|
391
|
+
h(this, "zIndex", 2);
|
|
394
392
|
}
|
|
395
393
|
create(e) {
|
|
396
394
|
return e.createInstance(ut);
|
|
@@ -405,9 +403,9 @@ var ft = Object.defineProperty, vt = Object.getOwnPropertyDescriptor, wt = (a, e
|
|
|
405
403
|
let he = class extends B {
|
|
406
404
|
constructor(e) {
|
|
407
405
|
super();
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
406
|
+
h(this, "zIndex", 6);
|
|
407
|
+
h(this, "viewKey", F.SLIDE);
|
|
408
|
+
h(this, "_ObjectProvider", null);
|
|
411
409
|
this._injector = e;
|
|
412
410
|
}
|
|
413
411
|
check(e) {
|
|
@@ -420,65 +418,65 @@ let he = class extends B {
|
|
|
420
418
|
zIndex: t,
|
|
421
419
|
left: s = 0,
|
|
422
420
|
top: i = 0,
|
|
423
|
-
width:
|
|
424
|
-
height:
|
|
421
|
+
width: o,
|
|
422
|
+
height: c,
|
|
425
423
|
angle: l,
|
|
426
|
-
scaleX:
|
|
427
|
-
scaleY:
|
|
424
|
+
scaleX: g,
|
|
425
|
+
scaleY: p,
|
|
428
426
|
skewX: d,
|
|
429
|
-
skewY:
|
|
430
|
-
flipX:
|
|
427
|
+
skewY: u,
|
|
428
|
+
flipX: _,
|
|
431
429
|
flipY: f,
|
|
432
|
-
title:
|
|
433
|
-
description:
|
|
430
|
+
title: y,
|
|
431
|
+
description: E,
|
|
434
432
|
slide: T
|
|
435
433
|
} = e;
|
|
436
434
|
if (T == null)
|
|
437
435
|
return;
|
|
438
|
-
const
|
|
436
|
+
const P = new Me(T), w = new Oe("__SLIDERender__" + n, {
|
|
439
437
|
top: i,
|
|
440
438
|
left: s,
|
|
441
|
-
width:
|
|
442
|
-
height:
|
|
439
|
+
width: o,
|
|
440
|
+
height: c,
|
|
443
441
|
zIndex: t,
|
|
444
442
|
angle: l,
|
|
445
|
-
scaleX:
|
|
446
|
-
scaleY:
|
|
443
|
+
scaleX: g,
|
|
444
|
+
scaleY: p,
|
|
447
445
|
skewX: d,
|
|
448
|
-
skewY:
|
|
449
|
-
flipX:
|
|
446
|
+
skewY: u,
|
|
447
|
+
flipX: _,
|
|
450
448
|
flipY: f,
|
|
451
449
|
isTransformer: !1,
|
|
452
450
|
forceRender: !0
|
|
453
451
|
});
|
|
454
452
|
w.enableNav(), w.enableSelectedClipElement();
|
|
455
|
-
const I =
|
|
453
|
+
const I = P.getPageOrder(), S = P.getPages();
|
|
456
454
|
if (!I || !S)
|
|
457
455
|
return w;
|
|
458
456
|
this._ObjectProvider = new re(this._injector);
|
|
459
457
|
for (let D = 0, v = I.length; D < v; D++) {
|
|
460
|
-
const
|
|
461
|
-
w.addPage(this._createScene(m, w,
|
|
458
|
+
const b = S[I[D]], { id: m } = b;
|
|
459
|
+
w.addPage(this._createScene(m, w, b, r, P));
|
|
462
460
|
}
|
|
463
461
|
return w.activeFirstPage(), w;
|
|
464
462
|
}
|
|
465
463
|
_createScene(e, r, n, t, s) {
|
|
466
|
-
var
|
|
467
|
-
const { width: i, height:
|
|
464
|
+
var u;
|
|
465
|
+
const { width: i, height: o } = r, c = new ie(e, r, {
|
|
468
466
|
width: i,
|
|
469
|
-
height:
|
|
467
|
+
height: o
|
|
470
468
|
});
|
|
471
|
-
new X(`PageViewer_${e}`,
|
|
469
|
+
new X(`PageViewer_${e}`, c, {
|
|
472
470
|
left: 0,
|
|
473
471
|
top: 0,
|
|
474
472
|
bottom: 0,
|
|
475
473
|
right: 0
|
|
476
474
|
}).closeClip();
|
|
477
|
-
const { pageElements:
|
|
478
|
-
return
|
|
475
|
+
const { pageElements: g, pageBackgroundFill: p } = n, d = (u = this._ObjectProvider) == null ? void 0 : u.convertToRenderObjects(g, t);
|
|
476
|
+
return c.openTransformer(), this._addBackgroundRect(c, p, s), c.addObjects(d), c;
|
|
479
477
|
}
|
|
480
478
|
_addBackgroundRect(e, r, n) {
|
|
481
|
-
const t = n.getPageSize(), { width: s = 0, height: i = 0 } = t,
|
|
479
|
+
const t = n.getPageSize(), { width: s = 0, height: i = 0 } = t, o = new Y("canvas", {
|
|
482
480
|
left: 0,
|
|
483
481
|
top: 0,
|
|
484
482
|
width: s,
|
|
@@ -489,7 +487,7 @@ let he = class extends B {
|
|
|
489
487
|
zIndex: 0,
|
|
490
488
|
evented: !1
|
|
491
489
|
});
|
|
492
|
-
e.addObject(
|
|
490
|
+
e.addObject(o, 0);
|
|
493
491
|
}
|
|
494
492
|
};
|
|
495
493
|
he = wt([
|
|
@@ -497,23 +495,23 @@ he = wt([
|
|
|
497
495
|
], he);
|
|
498
496
|
class It {
|
|
499
497
|
constructor() {
|
|
500
|
-
|
|
498
|
+
h(this, "zIndex", 6);
|
|
501
499
|
}
|
|
502
500
|
create(e) {
|
|
503
501
|
return e.createInstance(he);
|
|
504
502
|
}
|
|
505
503
|
}
|
|
506
504
|
$.add(new It());
|
|
507
|
-
var
|
|
508
|
-
for (var t = n > 1 ? void 0 : n ?
|
|
505
|
+
var bt = Object.defineProperty, Pt = Object.getOwnPropertyDescriptor, mt = (a, e, r, n) => {
|
|
506
|
+
for (var t = n > 1 ? void 0 : n ? Pt(e, r) : e, s = a.length - 1, i; s >= 0; s--)
|
|
509
507
|
(i = a[s]) && (t = (n ? i(e, r, t) : i(t)) || t);
|
|
510
|
-
return n && t &&
|
|
508
|
+
return n && t && bt(e, r, t), t;
|
|
511
509
|
}, Ie = (a, e) => (r, n) => e(r, n, a);
|
|
512
510
|
let ge = class extends B {
|
|
513
511
|
constructor(e, r) {
|
|
514
512
|
super();
|
|
515
|
-
|
|
516
|
-
|
|
513
|
+
h(this, "zIndex", 4);
|
|
514
|
+
h(this, "viewKey", F.SPREADSHEET);
|
|
517
515
|
this._localeService = e, this._contextService = r;
|
|
518
516
|
}
|
|
519
517
|
check(e) {
|
|
@@ -526,52 +524,52 @@ let ge = class extends B {
|
|
|
526
524
|
zIndex: t,
|
|
527
525
|
left: s = 0,
|
|
528
526
|
top: i = 0,
|
|
529
|
-
width:
|
|
530
|
-
height:
|
|
527
|
+
width: o,
|
|
528
|
+
height: c,
|
|
531
529
|
angle: l,
|
|
532
|
-
scaleX:
|
|
533
|
-
scaleY:
|
|
530
|
+
scaleX: g,
|
|
531
|
+
scaleY: p,
|
|
534
532
|
skewX: d,
|
|
535
|
-
skewY:
|
|
536
|
-
flipX:
|
|
533
|
+
skewY: u,
|
|
534
|
+
flipX: _,
|
|
537
535
|
flipY: f,
|
|
538
|
-
spreadsheet:
|
|
536
|
+
spreadsheet: y
|
|
539
537
|
} = e;
|
|
540
|
-
if (
|
|
538
|
+
if (y == null)
|
|
541
539
|
return;
|
|
542
|
-
const { worksheet:
|
|
543
|
-
new Ve(n,
|
|
540
|
+
const { worksheet: E, styles: T } = y, { cellData: P } = E, w = new Ne(P), I = new ze(T), S = new qe(
|
|
541
|
+
new Ve(n, E, I),
|
|
544
542
|
// FIXME: worksheet in slide doesn't has a Worksheet object
|
|
545
|
-
|
|
543
|
+
E,
|
|
546
544
|
w,
|
|
547
545
|
I,
|
|
548
546
|
this._localeService,
|
|
549
547
|
this._contextService
|
|
550
|
-
), { rowTotalHeight: D, columnTotalWidth: v, rowHeaderWidth:
|
|
548
|
+
), { rowTotalHeight: D, columnTotalWidth: v, rowHeaderWidth: b, columnHeaderHeight: m } = S, R = v + E.rowHeader.width || 0, H = D + E.columnHeader.height || 0, U = new me("spreadInSlideSceneViewer" + n, {
|
|
551
549
|
top: i,
|
|
552
550
|
left: s,
|
|
553
|
-
width:
|
|
554
|
-
height:
|
|
551
|
+
width: o,
|
|
552
|
+
height: c,
|
|
555
553
|
zIndex: t,
|
|
556
554
|
angle: l,
|
|
557
|
-
scaleX:
|
|
558
|
-
scaleY:
|
|
555
|
+
scaleX: g,
|
|
556
|
+
scaleY: p,
|
|
559
557
|
skewX: d,
|
|
560
|
-
skewY:
|
|
561
|
-
flipX:
|
|
558
|
+
skewY: u,
|
|
559
|
+
flipX: _,
|
|
562
560
|
flipY: f,
|
|
563
561
|
isTransformer: !0,
|
|
564
562
|
forceRender: !0
|
|
565
563
|
}), L = new ie("spreadInSlideScene" + n, U, {
|
|
566
|
-
width:
|
|
564
|
+
width: R,
|
|
567
565
|
height: H
|
|
568
566
|
});
|
|
569
|
-
this._updateViewport(n,
|
|
567
|
+
this._updateViewport(n, b, m, L, r);
|
|
570
568
|
const C = new Ge("testSheetViewer", S, !1), V = new Ze("spreadInSlideRow", S), K = new Je("spreadInSlideColumn", S), k = new Y("spreadInSlideLeftTop", {
|
|
571
569
|
zIndex: 2,
|
|
572
570
|
left: -1,
|
|
573
571
|
top: -1,
|
|
574
|
-
width:
|
|
572
|
+
width: b,
|
|
575
573
|
height: m,
|
|
576
574
|
fill: we([248, 249, 250]),
|
|
577
575
|
stroke: we([217, 217, 217]),
|
|
@@ -582,22 +580,22 @@ let ge = class extends B {
|
|
|
582
580
|
_updateViewport(e, r, n, t, s) {
|
|
583
581
|
if (s == null)
|
|
584
582
|
return;
|
|
585
|
-
const i = r * t.scaleX,
|
|
583
|
+
const i = r * t.scaleX, o = n * t.scaleY, c = new X("spreadInSlideViewMain" + e, t, {
|
|
586
584
|
left: i,
|
|
587
|
-
top:
|
|
585
|
+
top: o,
|
|
588
586
|
bottom: 0,
|
|
589
587
|
right: 0,
|
|
590
588
|
isWheelPreventDefaultX: !0
|
|
591
589
|
}), l = new X("spreadInSlideViewTop" + e, t, {
|
|
592
590
|
left: i,
|
|
593
|
-
height:
|
|
591
|
+
height: o,
|
|
594
592
|
top: 0,
|
|
595
593
|
right: 0,
|
|
596
594
|
isWheelPreventDefaultX: !0
|
|
597
|
-
}),
|
|
595
|
+
}), g = new X("spreadInSlideViewLeft" + e, t, {
|
|
598
596
|
left: 0,
|
|
599
597
|
bottom: 0,
|
|
600
|
-
top:
|
|
598
|
+
top: o,
|
|
601
599
|
width: i,
|
|
602
600
|
isWheelPreventDefaultX: !0
|
|
603
601
|
});
|
|
@@ -605,27 +603,27 @@ let ge = class extends B {
|
|
|
605
603
|
left: 0,
|
|
606
604
|
top: 0,
|
|
607
605
|
width: i,
|
|
608
|
-
height:
|
|
606
|
+
height: o,
|
|
609
607
|
isWheelPreventDefaultX: !0
|
|
610
|
-
}),
|
|
611
|
-
const { scrollX: d, scrollY:
|
|
608
|
+
}), c.onScrollAfterObserver.add((p) => {
|
|
609
|
+
const { scrollX: d, scrollY: u, actualScrollX: _, actualScrollY: f } = p;
|
|
612
610
|
l.updateScroll({
|
|
613
611
|
scrollX: d,
|
|
614
|
-
actualScrollX:
|
|
615
|
-
}),
|
|
616
|
-
scrollY:
|
|
612
|
+
actualScrollX: _
|
|
613
|
+
}), g.updateScroll({
|
|
614
|
+
scrollY: u,
|
|
617
615
|
actualScrollY: f
|
|
618
616
|
});
|
|
619
|
-
}), t.attachControl(), new ue(
|
|
617
|
+
}), t.attachControl(), new ue(c, {
|
|
620
618
|
mainScene: s
|
|
621
|
-
}), t.on(pe.wheel, (
|
|
622
|
-
const
|
|
623
|
-
if (
|
|
624
|
-
const
|
|
625
|
-
let f =
|
|
626
|
-
f *=
|
|
619
|
+
}), t.on(pe.wheel, (p, d) => {
|
|
620
|
+
const u = p;
|
|
621
|
+
if (u.ctrlKey) {
|
|
622
|
+
const _ = Math.abs(u.deltaX);
|
|
623
|
+
let f = _ < 40 ? 0.05 : _ < 80 ? 0.02 : 0.01;
|
|
624
|
+
f *= u.deltaY > 0 ? -1 : 1, t.scaleX < 1 && (f /= 2), t.scaleX + f > 4 ? t.scale(4, 4) : t.scaleX + f < 0.1 ? t.scale(0.1, 0.1) : (t.scaleBy(f, f), u.preventDefault());
|
|
627
625
|
} else
|
|
628
|
-
|
|
626
|
+
c.onMouseWheel(u, d);
|
|
629
627
|
});
|
|
630
628
|
}
|
|
631
629
|
};
|
|
@@ -635,21 +633,21 @@ ge = mt([
|
|
|
635
633
|
], ge);
|
|
636
634
|
class Tt {
|
|
637
635
|
constructor() {
|
|
638
|
-
|
|
636
|
+
h(this, "zIndex", 4);
|
|
639
637
|
}
|
|
640
638
|
create(e) {
|
|
641
639
|
return e.createInstance(ge);
|
|
642
640
|
}
|
|
643
641
|
}
|
|
644
642
|
$.add(new Tt());
|
|
645
|
-
var Ot = Object.defineProperty, Dt = Object.getOwnPropertyDescriptor,
|
|
643
|
+
var Ot = Object.defineProperty, Dt = Object.getOwnPropertyDescriptor, yt = (a, e, r, n) => {
|
|
646
644
|
for (var t = n > 1 ? void 0 : n ? Dt(e, r) : e, s = a.length - 1, i; s >= 0; s--)
|
|
647
645
|
(i = a[s]) && (t = (n ? i(e, r, t) : i(t)) || t);
|
|
648
646
|
return n && t && Ot(e, r, t), t;
|
|
649
|
-
},
|
|
647
|
+
}, Et = (a, e) => (r, n) => e(r, n, a);
|
|
650
648
|
let re = class {
|
|
651
649
|
constructor(a) {
|
|
652
|
-
|
|
650
|
+
h(this, "_adaptors", []);
|
|
653
651
|
this._injector = a, this._adaptorLoader();
|
|
654
652
|
}
|
|
655
653
|
convertToRenderObjects(a, e) {
|
|
@@ -674,20 +672,20 @@ let re = class {
|
|
|
674
672
|
});
|
|
675
673
|
}
|
|
676
674
|
};
|
|
677
|
-
re =
|
|
678
|
-
|
|
675
|
+
re = yt([
|
|
676
|
+
Et(0, A(se))
|
|
679
677
|
], re);
|
|
680
|
-
var
|
|
678
|
+
var Rt = Object.defineProperty, xt = Object.getOwnPropertyDescriptor, Ct = (a, e, r, n) => {
|
|
681
679
|
for (var t = n > 1 ? void 0 : n ? xt(e, r) : e, s = a.length - 1, i; s >= 0; s--)
|
|
682
680
|
(i = a[s]) && (t = (n ? i(e, r, t) : i(t)) || t);
|
|
683
|
-
return n && t &&
|
|
681
|
+
return n && t && Rt(e, r, t), t;
|
|
684
682
|
}, ce = (a, e) => (r, n) => e(r, n, a), jt = /* @__PURE__ */ ((a) => (a.COMPONENT = "__slideRender__", a.SCENE = "__mainScene__", a.VIEW = "__mainView__", a))(jt || {});
|
|
685
683
|
let ee = class extends We {
|
|
686
684
|
constructor(e, r, n) {
|
|
687
685
|
super();
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
686
|
+
h(this, "_objectProvider", null);
|
|
687
|
+
h(this, "_activePageId", "");
|
|
688
|
+
h(this, "_refreshThumb", $e(() => {
|
|
691
689
|
this.createThumbs();
|
|
692
690
|
}, 300));
|
|
693
691
|
this._univerInstanceService = e, this._injector = r, this._renderManagerService = n, this._initializeDependencies(this._injector), this._initialize();
|
|
@@ -707,10 +705,10 @@ let ee = class extends We {
|
|
|
707
705
|
if (e)
|
|
708
706
|
n = r.getPage(e);
|
|
709
707
|
else {
|
|
710
|
-
const
|
|
711
|
-
if (
|
|
708
|
+
const o = r.getPages(), c = r.getPageOrder();
|
|
709
|
+
if (c == null || o == null)
|
|
712
710
|
return;
|
|
713
|
-
n = c[
|
|
711
|
+
n = o[c[0]], e = n.id;
|
|
714
712
|
}
|
|
715
713
|
const t = this._currentRender();
|
|
716
714
|
if (n == null || t == null || t.mainComponent == null)
|
|
@@ -723,14 +721,14 @@ let ee = class extends We {
|
|
|
723
721
|
this._createScene(s, n);
|
|
724
722
|
}
|
|
725
723
|
_scrollToCenter() {
|
|
726
|
-
var
|
|
727
|
-
const e = (
|
|
724
|
+
var c;
|
|
725
|
+
const e = (c = this._currentRender()) == null ? void 0 : c.scene, r = e == null ? void 0 : e.getViewport("__mainView__"), n = this._getCenterPositionViewPort(e);
|
|
728
726
|
if (!r || !n)
|
|
729
727
|
return;
|
|
730
|
-
const { left: t, top: s } = n, { x: i, y:
|
|
728
|
+
const { left: t, top: s } = n, { x: i, y: o } = r.getBarScroll(t, s);
|
|
731
729
|
r.scrollTo({
|
|
732
730
|
x: i,
|
|
733
|
-
y:
|
|
731
|
+
y: o
|
|
734
732
|
});
|
|
735
733
|
}
|
|
736
734
|
_create(e) {
|
|
@@ -744,58 +742,55 @@ let ee = class extends We {
|
|
|
744
742
|
const r = this._univerInstanceService.getUnit(e, M.UNIVER_SLIDE);
|
|
745
743
|
if (r == null)
|
|
746
744
|
return;
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
n == null && t != null ? this._renderManagerService.createRenderWithParent(e, t) : this._renderManagerService.createRender(e);
|
|
751
|
-
const s = this._renderManagerService.getRenderById(e);
|
|
752
|
-
if (s == null)
|
|
745
|
+
this._renderManagerService.createRender(e);
|
|
746
|
+
const n = this._renderManagerService.getRenderById(e);
|
|
747
|
+
if (n == null)
|
|
753
748
|
return;
|
|
754
|
-
const { scene:
|
|
755
|
-
|
|
749
|
+
const { scene: t, engine: s } = n;
|
|
750
|
+
s.onTransformChangeObservable.addOnce(() => {
|
|
756
751
|
this._scrollToCenter();
|
|
757
|
-
}),
|
|
752
|
+
}), s.onTransformChangeObservable.add(() => {
|
|
758
753
|
setTimeout(() => {
|
|
759
754
|
this.createThumbs();
|
|
760
755
|
}, 300);
|
|
761
|
-
}),
|
|
762
|
-
const
|
|
756
|
+
}), t.resize(2400, 1800);
|
|
757
|
+
const i = new X("__mainView__", t, {
|
|
763
758
|
left: 0,
|
|
764
759
|
top: 0,
|
|
765
760
|
bottom: 0,
|
|
766
761
|
right: 0,
|
|
767
762
|
isWheelPreventDefaultX: !0
|
|
768
763
|
});
|
|
769
|
-
|
|
770
|
-
const
|
|
771
|
-
if (
|
|
772
|
-
const
|
|
773
|
-
let
|
|
774
|
-
|
|
764
|
+
t.attachControl(), t.on(pe.wheel, (c, l) => {
|
|
765
|
+
const g = c;
|
|
766
|
+
if (g.ctrlKey) {
|
|
767
|
+
const p = Math.abs(g.deltaX);
|
|
768
|
+
let d = p < 40 ? 0.2 : p < 80 ? 0.4 : 0.2;
|
|
769
|
+
d *= g.deltaY > 0 ? -1 : 1, t.scaleX < 1 && (d /= 2), t.scaleX + d > 4 ? t.scale(4, 4) : t.scaleX + d < 0.1 ? t.scale(0.1, 0.1) : (g.deltaY > 0, g.preventDefault());
|
|
775
770
|
} else
|
|
776
|
-
|
|
777
|
-
}),
|
|
771
|
+
i.onMouseWheel(g, l);
|
|
772
|
+
}), t.onFileLoadedObservable.add(() => {
|
|
778
773
|
this._refreshThumb();
|
|
779
|
-
}), ue.attachTo(
|
|
780
|
-
const
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
const
|
|
784
|
-
|
|
774
|
+
}), ue.attachTo(i), this._renderManagerService.setCurrent(e);
|
|
775
|
+
const o = this._createSlide(t);
|
|
776
|
+
n.mainComponent = o, n.components.set("__slideRender__", o), this._createSlidePages(r, o), s.runRenderLoop(() => {
|
|
777
|
+
t.render();
|
|
778
|
+
const c = document.getElementById("app");
|
|
779
|
+
c && (c.innerText = `fps:${Math.round(s.getFps()).toString()}`);
|
|
785
780
|
});
|
|
786
781
|
}
|
|
787
782
|
_createSlide(e) {
|
|
788
|
-
const r = this._univerInstanceService.getCurrentUnitForType(M.UNIVER_SLIDE), { width: n, height: t } = e, s = r.getPageSize(), { width: i = 100, height:
|
|
783
|
+
const r = this._univerInstanceService.getCurrentUnitForType(M.UNIVER_SLIDE), { width: n, height: t } = e, s = r.getPageSize(), { width: i = 100, height: o = 100 } = s, c = new Oe("__slideRender__", {
|
|
789
784
|
left: (n - i) / 2,
|
|
790
|
-
top: (t -
|
|
785
|
+
top: (t - o) / 2,
|
|
791
786
|
width: i,
|
|
792
|
-
height:
|
|
787
|
+
height: o,
|
|
793
788
|
zIndex: 10
|
|
794
789
|
});
|
|
795
|
-
return
|
|
790
|
+
return c.enableNav(), c.enableSelectedClipElement(), e.addObject(c), c;
|
|
796
791
|
}
|
|
797
792
|
_addBackgroundRect(e, r) {
|
|
798
|
-
const t = this._univerInstanceService.getCurrentUnitForType(M.UNIVER_SLIDE).getPageSize(), { width: s = 0, height: i = 0 } = t,
|
|
793
|
+
const t = this._univerInstanceService.getCurrentUnitForType(M.UNIVER_SLIDE).getPageSize(), { width: s = 0, height: i = 0 } = t, o = new Y("canvas", {
|
|
799
794
|
left: 0,
|
|
800
795
|
top: 0,
|
|
801
796
|
width: s,
|
|
@@ -806,7 +801,7 @@ let ee = class extends We {
|
|
|
806
801
|
zIndex: 0,
|
|
807
802
|
evented: !1
|
|
808
803
|
});
|
|
809
|
-
e.addObject(
|
|
804
|
+
e.addObject(o, 0);
|
|
810
805
|
}
|
|
811
806
|
_getCenterPositionViewPort(e) {
|
|
812
807
|
if (!e)
|
|
@@ -824,15 +819,15 @@ let ee = class extends We {
|
|
|
824
819
|
const { engine: t } = n;
|
|
825
820
|
if (t == null)
|
|
826
821
|
return;
|
|
827
|
-
const { width: s, height: i } = r, { width:
|
|
828
|
-
r.renderToThumb(l, e,
|
|
822
|
+
const { width: s, height: i } = r, { width: o = s, height: c = i } = t, l = t.getCanvas().getContext();
|
|
823
|
+
r.renderToThumb(l, e, o / s, c / i);
|
|
829
824
|
}
|
|
830
825
|
_createSlidePages(e, r) {
|
|
831
826
|
const n = e.getPages(), t = e.getPageOrder();
|
|
832
827
|
if (!(!n || !t) && t.length !== 0) {
|
|
833
828
|
for (let s = 0, i = t.length; s < i; s++) {
|
|
834
|
-
const
|
|
835
|
-
this._createScene(
|
|
829
|
+
const o = t[s];
|
|
830
|
+
this._createScene(o, n[o]), this._createThumb(o);
|
|
836
831
|
}
|
|
837
832
|
this._activePageId = t[0], r.activeFirstPage();
|
|
838
833
|
}
|
|
@@ -852,9 +847,9 @@ let ee = class extends We {
|
|
|
852
847
|
const n = this._currentRender();
|
|
853
848
|
if (!n || !this._objectProvider)
|
|
854
849
|
return;
|
|
855
|
-
const { scene: t, mainComponent: s } = n, i = s, { width:
|
|
856
|
-
width:
|
|
857
|
-
height:
|
|
850
|
+
const { scene: t, mainComponent: s } = n, i = s, { width: o, height: c } = i, l = new ie(e, i, {
|
|
851
|
+
width: o,
|
|
852
|
+
height: c
|
|
858
853
|
});
|
|
859
854
|
new X(`PageViewer_${e}`, l, {
|
|
860
855
|
left: 0,
|
|
@@ -862,14 +857,14 @@ let ee = class extends We {
|
|
|
862
857
|
bottom: 0,
|
|
863
858
|
right: 0
|
|
864
859
|
}).closeClip();
|
|
865
|
-
const { pageElements:
|
|
866
|
-
if (!
|
|
860
|
+
const { pageElements: p, pageBackgroundFill: d } = r, u = this._objectProvider.convertToRenderObjects(p, t);
|
|
861
|
+
if (!u || !i)
|
|
867
862
|
return;
|
|
868
|
-
l.openTransformer(), this._addBackgroundRect(l, d), l.addObjects(
|
|
869
|
-
const
|
|
870
|
-
return
|
|
863
|
+
l.openTransformer(), this._addBackgroundRect(l, d), l.addObjects(u);
|
|
864
|
+
const _ = l.getTransformer();
|
|
865
|
+
return _ == null || _.onChangeEndObservable.add(() => {
|
|
871
866
|
this._thumbSceneRender(this._activePageId, i);
|
|
872
|
-
}),
|
|
867
|
+
}), _ == null || _.onClearControlObservable.add(() => {
|
|
873
868
|
this._thumbSceneRender(this._activePageId, i);
|
|
874
869
|
}), i.addPage(l), l;
|
|
875
870
|
}
|
|
@@ -879,7 +874,7 @@ let ee = class extends We {
|
|
|
879
874
|
};
|
|
880
875
|
ee = Ct([
|
|
881
876
|
Ae(Ue.Ready, ee),
|
|
882
|
-
ce(0,
|
|
877
|
+
ce(0, Pe),
|
|
883
878
|
ce(1, A(se)),
|
|
884
879
|
ce(2, Qe)
|
|
885
880
|
], ee);
|
|
@@ -890,12 +885,12 @@ var Mt = Object.defineProperty, Lt = Object.getOwnPropertyDescriptor, Nt = (a, e
|
|
|
890
885
|
}, oe = (a, e) => (r, n) => e(r, n, a);
|
|
891
886
|
const zt = {}, Vt = "slides";
|
|
892
887
|
var Q;
|
|
893
|
-
let
|
|
888
|
+
let be = (Q = class extends He {
|
|
894
889
|
constructor(e = {}, r, n, t) {
|
|
895
890
|
super();
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
891
|
+
h(this, "_config");
|
|
892
|
+
h(this, "_canvasEngine", null);
|
|
893
|
+
h(this, "_canvasView", null);
|
|
899
894
|
this._univerInstanceService = r, this._localeService = n, this._injector = t, this._config = Object.assign(zt, e), this._initializeDependencies(this._injector);
|
|
900
895
|
}
|
|
901
896
|
initialize() {
|
|
@@ -923,16 +918,17 @@ let Pe = (Q = class extends He {
|
|
|
923
918
|
e.add(n);
|
|
924
919
|
});
|
|
925
920
|
}
|
|
926
|
-
},
|
|
927
|
-
|
|
928
|
-
oe(1,
|
|
921
|
+
}, h(Q, "pluginName", Vt), h(Q, "type", M.UNIVER_SLIDE), Q);
|
|
922
|
+
be = Nt([
|
|
923
|
+
oe(1, Pe),
|
|
929
924
|
oe(2, A(ne)),
|
|
930
925
|
oe(3, A(se))
|
|
931
|
-
],
|
|
926
|
+
], be);
|
|
932
927
|
export {
|
|
933
928
|
ee as CanvasView,
|
|
934
929
|
jt as SLIDE_KEY,
|
|
935
|
-
|
|
930
|
+
be as UniverSlidesPlugin,
|
|
936
931
|
Yt as enUS,
|
|
932
|
+
Ft as ruRU,
|
|
937
933
|
tt as zhCN
|
|
938
934
|
};
|