@univerjs/slides 0.9.4-nightly.202507290713 → 0.9.4-nightly.202507290757
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 +265 -243
- package/lib/index.js +265 -243
- package/lib/types/views/render/adaptors/shape-adaptor.d.ts +2 -2
- package/lib/umd/index.js +1 -1
- package/package.json +3 -3
package/lib/es/index.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
var
|
|
2
|
-
var be = (r, e, i) => e in r ?
|
|
3
|
-
var
|
|
4
|
-
import { Plugin as me, merge as De, UniverInstanceType as Oe, Inject as H, Injector as G, IConfigService as we, Registry as Ee, LocaleService as
|
|
5
|
-
import { IRenderingEngine as ze, IRenderManagerService as Ae, Liquid as Le, DocumentViewModel as Ne, DocumentSkeleton as He, Documents as We, SceneViewer as _e, Scene as
|
|
6
|
-
const
|
|
7
|
-
var
|
|
8
|
-
for (var t = n > 1 ? void 0 : n ?
|
|
1
|
+
var Pe = Object.defineProperty;
|
|
2
|
+
var be = (r, e, i) => e in r ? Pe(r, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : r[e] = i;
|
|
3
|
+
var g = (r, e, i) => be(r, typeof e != "symbol" ? e + "" : e, i);
|
|
4
|
+
import { Plugin as me, merge as De, UniverInstanceType as Oe, Inject as H, Injector as G, IConfigService as we, Registry as Ee, LocaleService as oe, PageElementType as Y, DocumentDataModel as Me, getColorStyle as re, BasicShapes as ee, sortRules as ke, SlideDataModel as Ve, IContextService as Xe, Styles as je, Worksheet as Re } from "@univerjs/core";
|
|
5
|
+
import { IRenderingEngine as ze, IRenderManagerService as Ae, Liquid as Le, DocumentViewModel as Ne, DocumentSkeleton as He, Documents as We, SceneViewer as _e, Scene as le, Viewport as C, ScrollBar as ve, Image as Se, PageLayoutType as ge, RichText as Ce, Rect as U, Circle as Ye, Slide as $e, SpreadsheetSkeleton as Fe, Spreadsheet as Ke, SpreadsheetRowHeader as Be, SpreadsheetColumnHeader as qe, getColor as pe } from "@univerjs/engine-render";
|
|
6
|
+
const Ue = "slides.config", ue = {};
|
|
7
|
+
var Ge = Object.getOwnPropertyDescriptor, Ze = (r, e, i, n) => {
|
|
8
|
+
for (var t = n > 1 ? void 0 : n ? Ge(e, i) : e, a = r.length - 1, s; a >= 0; a--)
|
|
9
9
|
(s = r[a]) && (t = s(t) || t);
|
|
10
10
|
return t;
|
|
11
|
-
},
|
|
12
|
-
const
|
|
11
|
+
}, te = (r, e) => (i, n) => e(i, n, r);
|
|
12
|
+
const Je = "slides";
|
|
13
13
|
var q;
|
|
14
14
|
let fe = (q = class extends me {
|
|
15
15
|
// private _canvasView: CanvasView | null = null;
|
|
16
16
|
constructor(e = ue, i, n, t) {
|
|
17
17
|
super();
|
|
18
|
-
|
|
18
|
+
g(this, "_canvasEngine", null);
|
|
19
19
|
this._config = e, this._injector = i, this._renderManagerService = n, this._configService = t;
|
|
20
20
|
const { ...a } = De(
|
|
21
21
|
{},
|
|
22
22
|
ue,
|
|
23
23
|
this._config
|
|
24
24
|
);
|
|
25
|
-
this._configService.setConfig(
|
|
25
|
+
this._configService.setConfig(Ue, a), this._initializeDependencies(this._injector);
|
|
26
26
|
}
|
|
27
27
|
initialize() {
|
|
28
28
|
this.initCanvasEngine();
|
|
@@ -49,16 +49,16 @@ let fe = (q = class extends me {
|
|
|
49
49
|
e.add(n);
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
|
-
},
|
|
53
|
-
fe =
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
}, g(q, "pluginName", Je), g(q, "type", Oe.UNIVER_SLIDE), q);
|
|
53
|
+
fe = Ze([
|
|
54
|
+
te(1, H(G)),
|
|
55
|
+
te(2, Ae),
|
|
56
|
+
te(3, we)
|
|
57
57
|
], fe);
|
|
58
58
|
class $ {
|
|
59
59
|
constructor() {
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
g(this, "zIndex", 0);
|
|
61
|
+
g(this, "viewKey", null);
|
|
62
62
|
}
|
|
63
63
|
check(e) {
|
|
64
64
|
if (e === this.viewKey)
|
|
@@ -68,17 +68,17 @@ class $ {
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
const W = Ee.create();
|
|
71
|
-
var
|
|
72
|
-
for (var t = n > 1 ? void 0 : n ?
|
|
71
|
+
var Qe = Object.getOwnPropertyDescriptor, et = (r, e, i, n) => {
|
|
72
|
+
for (var t = n > 1 ? void 0 : n ? Qe(e, i) : e, a = r.length - 1, s; a >= 0; a--)
|
|
73
73
|
(s = r[a]) && (t = s(t) || t);
|
|
74
74
|
return t;
|
|
75
|
-
},
|
|
76
|
-
let
|
|
75
|
+
}, tt = (r, e) => (i, n) => e(i, n, r);
|
|
76
|
+
let ie = class extends $ {
|
|
77
77
|
constructor(e) {
|
|
78
78
|
super();
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
g(this, "zIndex", 5);
|
|
80
|
+
g(this, "viewKey", Y.DOCUMENT);
|
|
81
|
+
g(this, "_liquid", new Le());
|
|
82
82
|
this._localeService = e;
|
|
83
83
|
}
|
|
84
84
|
check(e) {
|
|
@@ -87,20 +87,20 @@ let re = class extends $ {
|
|
|
87
87
|
}
|
|
88
88
|
// eslint-disable-next-line max-lines-per-function
|
|
89
89
|
convert(e, i) {
|
|
90
|
-
var
|
|
90
|
+
var de, he;
|
|
91
91
|
const {
|
|
92
92
|
id: n,
|
|
93
93
|
zIndex: t,
|
|
94
94
|
left: a = 0,
|
|
95
95
|
top: s = 0,
|
|
96
|
-
width:
|
|
96
|
+
width: l,
|
|
97
97
|
height: c,
|
|
98
98
|
angle: _,
|
|
99
99
|
scaleX: v,
|
|
100
|
-
scaleY:
|
|
101
|
-
skewX:
|
|
102
|
-
skewY:
|
|
103
|
-
flipX:
|
|
100
|
+
scaleY: p,
|
|
101
|
+
skewX: d,
|
|
102
|
+
skewY: h,
|
|
103
|
+
flipX: f,
|
|
104
104
|
flipY: u,
|
|
105
105
|
title: D,
|
|
106
106
|
description: V,
|
|
@@ -108,22 +108,22 @@ let re = class extends $ {
|
|
|
108
108
|
} = e;
|
|
109
109
|
if (P == null)
|
|
110
110
|
return;
|
|
111
|
-
const x = new Me(P),
|
|
111
|
+
const x = new Me(P), o = new Ne(x), S = He.create(o, this._localeService), I = new We("__DocsRender__", S);
|
|
112
112
|
S.calculate();
|
|
113
|
-
const
|
|
113
|
+
const b = new _e("__DocsViewer__" + n, {
|
|
114
114
|
top: s,
|
|
115
115
|
left: a,
|
|
116
|
-
width:
|
|
116
|
+
width: l,
|
|
117
117
|
height: c,
|
|
118
118
|
zIndex: t,
|
|
119
119
|
angle: _,
|
|
120
120
|
scaleX: v,
|
|
121
|
-
scaleY:
|
|
122
|
-
skewX:
|
|
123
|
-
skewY:
|
|
124
|
-
flipX:
|
|
121
|
+
scaleY: p,
|
|
122
|
+
skewX: d,
|
|
123
|
+
skewY: h,
|
|
124
|
+
flipX: f,
|
|
125
125
|
flipY: u
|
|
126
|
-
}),
|
|
126
|
+
}), w = new le("__DocsScene__" + n, b), T = new C("__DocsViewPort_" + n, w, {
|
|
127
127
|
left: 0,
|
|
128
128
|
top: 0,
|
|
129
129
|
bottom: 0,
|
|
@@ -132,19 +132,19 @@ let re = class extends $ {
|
|
|
132
132
|
explicitViewportHeightSet: !1,
|
|
133
133
|
isWheelPreventDefaultX: !0
|
|
134
134
|
});
|
|
135
|
-
|
|
135
|
+
w.attachControl(), w.onMouseWheel$.subscribeEvent((E, N) => {
|
|
136
136
|
const m = E;
|
|
137
137
|
if (m.ctrlKey) {
|
|
138
138
|
const j = Math.abs(m.deltaX);
|
|
139
139
|
let M = j < 40 ? 0.2 : j < 80 ? 0.4 : 0.2;
|
|
140
|
-
M *= m.deltaY > 0 ? -1 : 1,
|
|
140
|
+
M *= m.deltaY > 0 ? -1 : 1, w.scaleX < 1 && (M /= 2), w.scaleX + M > 4 ? w.scale(4, 4) : w.scaleX + M < 0.1 ? w.scale(0.1, 0.1) : (m.deltaY > 0, m.preventDefault());
|
|
141
141
|
} else
|
|
142
142
|
T.onMouseWheel(m, N);
|
|
143
143
|
}), new ve(T, {
|
|
144
144
|
mainScene: i
|
|
145
|
-
}),
|
|
146
|
-
const
|
|
147
|
-
I.resize(
|
|
145
|
+
}), w.addObject(I);
|
|
146
|
+
const y = S.getActualSize();
|
|
147
|
+
I.resize(y.actualWidth, y.actualHeight), w.resize(y.actualWidth, y.actualHeight + 200), (de = I.getSkeleton()) == null || de.getPageSize(), I.pageRender$.subscribe((E) => {
|
|
148
148
|
const { page: N, pageLeft: m, pageTop: j, ctx: M } = E, { width: Z, height: J, marginBottom: Q, marginLeft: k, marginRight: F, marginTop: K } = N;
|
|
149
149
|
M.save(), M.translate(m - 0.5, j - 0.5), M.restore();
|
|
150
150
|
});
|
|
@@ -152,11 +152,11 @@ let re = class extends $ {
|
|
|
152
152
|
if (A == null)
|
|
153
153
|
return;
|
|
154
154
|
const { pages: L } = A, O = [], z = /* @__PURE__ */ new Map();
|
|
155
|
-
this._recalculateSizeBySkeleton(I,
|
|
155
|
+
this._recalculateSizeBySkeleton(I, w, S);
|
|
156
156
|
for (let E = 0, N = L.length; E < N; E++) {
|
|
157
157
|
const m = L[E], { skeDrawings: j, marginLeft: M, marginTop: Z, pageWidth: J, pageHeight: Q } = m;
|
|
158
158
|
this._liquid.translatePagePadding(m), j.forEach((k) => {
|
|
159
|
-
const { aLeft: F, aTop: K, height: Ie, width: xe, drawingOrigin: Te } = k, { docTransform:
|
|
159
|
+
const { aLeft: F, aTop: K, height: Ie, width: xe, drawingOrigin: Te } = k, { docTransform: yt } = Te, ye = new Se(k.drawingId, {
|
|
160
160
|
// url: docTransform.imageProperties?.contentUrl || '',
|
|
161
161
|
left: F + X + this._liquid.x,
|
|
162
162
|
top: K + R + this._liquid.y,
|
|
@@ -167,7 +167,7 @@ let re = class extends $ {
|
|
|
167
167
|
z.set(k.drawingId, {
|
|
168
168
|
marginLeft: this._liquid.x,
|
|
169
169
|
marginTop: this._liquid.y
|
|
170
|
-
}), O.push(
|
|
170
|
+
}), O.push(ye);
|
|
171
171
|
}), this._liquid.translatePage(
|
|
172
172
|
m,
|
|
173
173
|
I.pageLayoutType,
|
|
@@ -175,9 +175,9 @@ let re = class extends $ {
|
|
|
175
175
|
I.pageMarginTop
|
|
176
176
|
);
|
|
177
177
|
}
|
|
178
|
-
return
|
|
179
|
-
|
|
180
|
-
}), (
|
|
178
|
+
return w.addObjects(O), O.forEach((E) => {
|
|
179
|
+
w.attachTransformerTo(E);
|
|
180
|
+
}), (he = w.getTransformer()) == null || he.changing$.subscribe((E) => {
|
|
181
181
|
const { objects: N } = E;
|
|
182
182
|
N.forEach((m) => {
|
|
183
183
|
const { oKey: j, left: M, top: Z, height: J, width: Q } = m, k = z.get(j), F = (k == null ? void 0 : k.marginLeft) || 0, K = (k == null ? void 0 : k.marginTop) || 0;
|
|
@@ -188,27 +188,27 @@ let re = class extends $ {
|
|
|
188
188
|
width: Q
|
|
189
189
|
});
|
|
190
190
|
}), S == null || S.calculate();
|
|
191
|
-
}), this._calculatePagePosition(I,
|
|
191
|
+
}), this._calculatePagePosition(I, w, T), b;
|
|
192
192
|
}
|
|
193
193
|
_recalculateSizeBySkeleton(e, i, n) {
|
|
194
|
-
var
|
|
195
|
-
const t = (
|
|
194
|
+
var l;
|
|
195
|
+
const t = (l = n.getSkeletonData()) == null ? void 0 : l.pages;
|
|
196
196
|
if (t == null)
|
|
197
197
|
return;
|
|
198
198
|
let a = 0, s = 0;
|
|
199
199
|
for (let c = 0, _ = t.length; c < _; c++) {
|
|
200
|
-
const v = t[c], { pageWidth:
|
|
201
|
-
e.pageLayoutType ===
|
|
200
|
+
const v = t[c], { pageWidth: p, pageHeight: d } = v;
|
|
201
|
+
e.pageLayoutType === ge.VERTICAL ? (s += d, s += e.pageMarginTop, c === _ - 1 && (s += e.pageMarginTop), a = Math.max(a, p)) : e.pageLayoutType === ge.HORIZONTAL && (a += p, c !== _ - 1 && (a += e.pageMarginLeft), s = Math.max(s, d));
|
|
202
202
|
}
|
|
203
203
|
e.resize(a, s), i.resize(a, s);
|
|
204
204
|
}
|
|
205
205
|
_calculatePagePosition(e, i, n, t = 1) {
|
|
206
|
-
const a = i == null ? void 0 : i.getParent(), { width: s, height:
|
|
207
|
-
if (a == null || s === Number.POSITIVE_INFINITY ||
|
|
206
|
+
const a = i == null ? void 0 : i.getParent(), { width: s, height: l, pageMarginLeft: c, pageMarginTop: _ } = e;
|
|
207
|
+
if (a == null || s === Number.POSITIVE_INFINITY || l === Number.POSITIVE_INFINITY)
|
|
208
208
|
return;
|
|
209
|
-
const { width: v, height:
|
|
210
|
-
let
|
|
211
|
-
if (v > (s + c * 2) * t ? (
|
|
209
|
+
const { width: v, height: p } = a;
|
|
210
|
+
let d = 0, h = 0, f = 0, u = 0, D = Number.POSITIVE_INFINITY;
|
|
211
|
+
if (v > (s + c * 2) * t ? (d = v / 2 - s * t / 2, d /= t, f = (v - c * 2) / t, D = 0) : (d = c, f = s + c * 2, D = (f - v / t) / 2), p > l ? (h = p / 2 - l / 2, u = (p - _ * 2) / t) : (h = _, u = l + _ * 2), i.resize(f, u + 200), e.translate(d, h), D !== Number.POSITIVE_INFINITY && n != null) {
|
|
212
212
|
const V = n.transScroll2ViewportScrollValue(D, 0).x;
|
|
213
213
|
n.scrollToBarPos({
|
|
214
214
|
x: V
|
|
@@ -217,23 +217,23 @@ let re = class extends $ {
|
|
|
217
217
|
return this;
|
|
218
218
|
}
|
|
219
219
|
};
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
],
|
|
223
|
-
class
|
|
220
|
+
ie = et([
|
|
221
|
+
tt(0, H(oe))
|
|
222
|
+
], ie);
|
|
223
|
+
class rt {
|
|
224
224
|
constructor() {
|
|
225
|
-
|
|
225
|
+
g(this, "zIndex", 5);
|
|
226
226
|
}
|
|
227
227
|
create(e) {
|
|
228
|
-
return e.createInstance(
|
|
228
|
+
return e.createInstance(ie);
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
|
-
W.add(new
|
|
232
|
-
class
|
|
231
|
+
W.add(new rt());
|
|
232
|
+
class it extends $ {
|
|
233
233
|
constructor() {
|
|
234
234
|
super(...arguments);
|
|
235
|
-
|
|
236
|
-
|
|
235
|
+
g(this, "zIndex", 1);
|
|
236
|
+
g(this, "viewKey", Y.IMAGE);
|
|
237
237
|
}
|
|
238
238
|
check(i) {
|
|
239
239
|
if (i === this.viewKey)
|
|
@@ -245,56 +245,56 @@ class rt extends $ {
|
|
|
245
245
|
zIndex: t,
|
|
246
246
|
left: a = 0,
|
|
247
247
|
top: s = 0,
|
|
248
|
-
width:
|
|
248
|
+
width: l,
|
|
249
249
|
height: c,
|
|
250
250
|
angle: _,
|
|
251
251
|
scaleX: v,
|
|
252
|
-
scaleY:
|
|
253
|
-
skewX:
|
|
254
|
-
skewY:
|
|
255
|
-
flipX:
|
|
252
|
+
scaleY: p,
|
|
253
|
+
skewX: d,
|
|
254
|
+
skewY: h,
|
|
255
|
+
flipX: f,
|
|
256
256
|
flipY: u,
|
|
257
257
|
title: D,
|
|
258
258
|
description: V,
|
|
259
259
|
image: P = {}
|
|
260
|
-
} = i, { imageProperties: x, placeholder:
|
|
260
|
+
} = i, { imageProperties: x, placeholder: o, link: S } = P, I = (x == null ? void 0 : x.contentUrl) || "";
|
|
261
261
|
return new Se(n, {
|
|
262
262
|
url: I,
|
|
263
263
|
top: s,
|
|
264
264
|
left: a,
|
|
265
|
-
width:
|
|
265
|
+
width: l,
|
|
266
266
|
height: c,
|
|
267
267
|
zIndex: t,
|
|
268
268
|
angle: _,
|
|
269
269
|
scaleX: v,
|
|
270
|
-
scaleY:
|
|
271
|
-
skewX:
|
|
272
|
-
skewY:
|
|
273
|
-
flipX:
|
|
270
|
+
scaleY: p,
|
|
271
|
+
skewX: d,
|
|
272
|
+
skewY: h,
|
|
273
|
+
flipX: f,
|
|
274
274
|
flipY: u,
|
|
275
275
|
forceRender: !0
|
|
276
276
|
});
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
|
-
class
|
|
279
|
+
class nt {
|
|
280
280
|
constructor() {
|
|
281
|
-
|
|
281
|
+
g(this, "zIndex", 4);
|
|
282
282
|
}
|
|
283
283
|
create(e) {
|
|
284
|
-
return e.createInstance(
|
|
284
|
+
return e.createInstance(it);
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
|
-
W.add(new
|
|
288
|
-
var
|
|
289
|
-
for (var t = n > 1 ? void 0 : n ?
|
|
287
|
+
W.add(new nt());
|
|
288
|
+
var at = Object.getOwnPropertyDescriptor, st = (r, e, i, n) => {
|
|
289
|
+
for (var t = n > 1 ? void 0 : n ? at(e, i) : e, a = r.length - 1, s; a >= 0; a--)
|
|
290
290
|
(s = r[a]) && (t = s(t) || t);
|
|
291
291
|
return t;
|
|
292
|
-
},
|
|
293
|
-
let
|
|
292
|
+
}, ct = (r, e) => (i, n) => e(i, n, r);
|
|
293
|
+
let ne = class extends $ {
|
|
294
294
|
constructor(e) {
|
|
295
295
|
super();
|
|
296
|
-
|
|
297
|
-
|
|
296
|
+
g(this, "zIndex", 2);
|
|
297
|
+
g(this, "viewKey", Y.TEXT);
|
|
298
298
|
this._localeService = e;
|
|
299
299
|
}
|
|
300
300
|
check(e) {
|
|
@@ -307,55 +307,55 @@ let ie = class extends $ {
|
|
|
307
307
|
zIndex: t,
|
|
308
308
|
left: a = 0,
|
|
309
309
|
top: s = 0,
|
|
310
|
-
width:
|
|
310
|
+
width: l,
|
|
311
311
|
height: c,
|
|
312
312
|
angle: _,
|
|
313
313
|
scaleX: v,
|
|
314
|
-
scaleY:
|
|
315
|
-
skewX:
|
|
316
|
-
skewY:
|
|
317
|
-
flipX:
|
|
314
|
+
scaleY: p,
|
|
315
|
+
skewX: d,
|
|
316
|
+
skewY: h,
|
|
317
|
+
flipX: f,
|
|
318
318
|
flipY: u,
|
|
319
319
|
title: D,
|
|
320
320
|
description: V,
|
|
321
321
|
richText: P = {}
|
|
322
|
-
} = e, { text: x, ff:
|
|
322
|
+
} = e, { text: x, ff: o, fs: S, it: I, bl: b, ul: w, st: T, ol: y, bg: X, bd: R, cl: A, rich: L } = P;
|
|
323
323
|
let O = {
|
|
324
324
|
top: s,
|
|
325
325
|
left: a,
|
|
326
|
-
width:
|
|
326
|
+
width: l,
|
|
327
327
|
height: c,
|
|
328
328
|
zIndex: t,
|
|
329
329
|
angle: _,
|
|
330
330
|
scaleX: v,
|
|
331
|
-
scaleY:
|
|
332
|
-
skewX:
|
|
333
|
-
skewY:
|
|
334
|
-
flipX:
|
|
331
|
+
scaleY: p,
|
|
332
|
+
skewX: d,
|
|
333
|
+
skewY: h,
|
|
334
|
+
flipX: f,
|
|
335
335
|
flipY: u,
|
|
336
336
|
forceRender: !0
|
|
337
337
|
}, z = !1;
|
|
338
|
-
if (x != null ? (O = { ...O, text: x, ff:
|
|
338
|
+
if (x != null ? (O = { ...O, text: x, ff: o, fs: S, it: I, bl: b, ul: w, st: T, ol: y, bg: X, bd: R, cl: A }, z = !0) : L != null && (O = { ...O, richText: L }, z = !0), z !== !1)
|
|
339
339
|
return new Ce(this._localeService, n, O);
|
|
340
340
|
}
|
|
341
341
|
};
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
],
|
|
345
|
-
class
|
|
342
|
+
ne = st([
|
|
343
|
+
ct(0, H(oe))
|
|
344
|
+
], ne);
|
|
345
|
+
class ot {
|
|
346
346
|
constructor() {
|
|
347
|
-
|
|
347
|
+
g(this, "zIndex", 0);
|
|
348
348
|
}
|
|
349
349
|
create(e) {
|
|
350
|
-
return e.createInstance(
|
|
350
|
+
return e.createInstance(ne);
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
|
-
W.add(new
|
|
354
|
-
class
|
|
353
|
+
W.add(new ot());
|
|
354
|
+
class lt extends $ {
|
|
355
355
|
constructor() {
|
|
356
356
|
super(...arguments);
|
|
357
|
-
|
|
358
|
-
|
|
357
|
+
g(this, "zIndex", 2);
|
|
358
|
+
g(this, "viewKey", Y.SHAPE);
|
|
359
359
|
}
|
|
360
360
|
check(i) {
|
|
361
361
|
if (i === this.viewKey)
|
|
@@ -367,80 +367,102 @@ class ot extends $ {
|
|
|
367
367
|
zIndex: t,
|
|
368
368
|
left: a = 0,
|
|
369
369
|
top: s = 0,
|
|
370
|
-
width:
|
|
370
|
+
width: l,
|
|
371
371
|
height: c,
|
|
372
372
|
angle: _,
|
|
373
373
|
scaleX: v,
|
|
374
|
-
scaleY:
|
|
375
|
-
skewX:
|
|
376
|
-
skewY:
|
|
377
|
-
flipX:
|
|
374
|
+
scaleY: p,
|
|
375
|
+
skewX: d,
|
|
376
|
+
skewY: h,
|
|
377
|
+
flipX: f,
|
|
378
378
|
flipY: u,
|
|
379
379
|
title: D,
|
|
380
380
|
description: V
|
|
381
|
-
} = i, { shapeType: P, text: x, shapeProperties:
|
|
382
|
-
if (
|
|
383
|
-
const { outlineFill:
|
|
384
|
-
T.strokeWidth = X, T.stroke =
|
|
381
|
+
} = i, { shapeType: P, text: x, shapeProperties: o, placeholder: S, link: I } = i.shape || {}, b = o == null ? "" : re(o.shapeBackgroundFill) || "rgba(255,255,255,1)", w = o == null ? void 0 : o.outline, T = {};
|
|
382
|
+
if (w) {
|
|
383
|
+
const { outlineFill: y, weight: X } = w;
|
|
384
|
+
T.strokeWidth = X, T.stroke = re(y) || "rgba(0,0,0,1)";
|
|
385
385
|
}
|
|
386
|
-
if (P ===
|
|
386
|
+
if (P === ee.Rect)
|
|
387
387
|
return new U(n, {
|
|
388
|
-
fill:
|
|
388
|
+
fill: b,
|
|
389
389
|
top: s,
|
|
390
390
|
left: a,
|
|
391
|
-
width:
|
|
391
|
+
width: l,
|
|
392
392
|
height: c,
|
|
393
393
|
zIndex: t,
|
|
394
394
|
angle: _,
|
|
395
395
|
scaleX: v,
|
|
396
|
-
scaleY:
|
|
397
|
-
skewX:
|
|
398
|
-
skewY:
|
|
399
|
-
flipX:
|
|
396
|
+
scaleY: p,
|
|
397
|
+
skewX: d,
|
|
398
|
+
skewY: h,
|
|
399
|
+
flipX: f,
|
|
400
400
|
flipY: u,
|
|
401
401
|
forceRender: !0,
|
|
402
402
|
...T
|
|
403
403
|
});
|
|
404
|
-
if (P ===
|
|
405
|
-
const
|
|
404
|
+
if (P === ee.RoundRect) {
|
|
405
|
+
const y = (o == null ? void 0 : o.radius) || 0;
|
|
406
406
|
return new U(n, {
|
|
407
|
-
fill:
|
|
407
|
+
fill: b,
|
|
408
408
|
top: s,
|
|
409
409
|
left: a,
|
|
410
|
-
width:
|
|
410
|
+
width: l,
|
|
411
411
|
height: c,
|
|
412
412
|
zIndex: t,
|
|
413
413
|
angle: _,
|
|
414
414
|
scaleX: v,
|
|
415
|
-
scaleY:
|
|
416
|
-
skewX:
|
|
417
|
-
skewY:
|
|
418
|
-
flipX:
|
|
415
|
+
scaleY: p,
|
|
416
|
+
skewX: d,
|
|
417
|
+
skewY: h,
|
|
418
|
+
flipX: f,
|
|
419
419
|
flipY: u,
|
|
420
420
|
forceRender: !0,
|
|
421
|
-
radius:
|
|
421
|
+
radius: y,
|
|
422
|
+
...T
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
if (P === ee.Ellipse) {
|
|
426
|
+
console.warn(o == null ? void 0 : o.radius);
|
|
427
|
+
const y = (o == null ? void 0 : o.radius) || 0;
|
|
428
|
+
return new Ye(n, {
|
|
429
|
+
fill: b,
|
|
430
|
+
top: s,
|
|
431
|
+
left: a,
|
|
432
|
+
width: l,
|
|
433
|
+
height: c,
|
|
434
|
+
zIndex: t,
|
|
435
|
+
angle: _,
|
|
436
|
+
scaleX: v,
|
|
437
|
+
scaleY: p,
|
|
438
|
+
skewX: d,
|
|
439
|
+
skewY: h,
|
|
440
|
+
flipX: f,
|
|
441
|
+
flipY: u,
|
|
442
|
+
forceRender: !0,
|
|
443
|
+
radius: y,
|
|
422
444
|
...T
|
|
423
445
|
});
|
|
424
446
|
}
|
|
425
447
|
}
|
|
426
448
|
}
|
|
427
|
-
class
|
|
449
|
+
class dt {
|
|
428
450
|
constructor() {
|
|
429
|
-
|
|
451
|
+
g(this, "zIndex", 2);
|
|
430
452
|
}
|
|
431
453
|
create(e) {
|
|
432
|
-
return e.createInstance(
|
|
454
|
+
return e.createInstance(lt);
|
|
433
455
|
}
|
|
434
456
|
}
|
|
435
|
-
W.add(new
|
|
436
|
-
var
|
|
437
|
-
for (var t = n > 1 ? void 0 : n ?
|
|
457
|
+
W.add(new dt());
|
|
458
|
+
var ht = Object.getOwnPropertyDescriptor, gt = (r, e, i, n) => {
|
|
459
|
+
for (var t = n > 1 ? void 0 : n ? ht(e, i) : e, a = r.length - 1, s; a >= 0; a--)
|
|
438
460
|
(s = r[a]) && (t = s(t) || t);
|
|
439
461
|
return t;
|
|
440
462
|
}, pt = (r, e) => (i, n) => e(i, n, r);
|
|
441
|
-
let
|
|
463
|
+
let ae = class {
|
|
442
464
|
constructor(r) {
|
|
443
|
-
|
|
465
|
+
g(this, "_adaptors", []);
|
|
444
466
|
this._injector = r, this._adaptorLoader();
|
|
445
467
|
}
|
|
446
468
|
convertToRenderObjects(r, e) {
|
|
@@ -468,20 +490,20 @@ let ne = class {
|
|
|
468
490
|
});
|
|
469
491
|
}
|
|
470
492
|
};
|
|
471
|
-
|
|
493
|
+
ae = gt([
|
|
472
494
|
pt(0, H(G))
|
|
473
|
-
],
|
|
474
|
-
var
|
|
475
|
-
for (var t = n > 1 ? void 0 : n ?
|
|
495
|
+
], ae);
|
|
496
|
+
var ut = Object.getOwnPropertyDescriptor, ft = (r, e, i, n) => {
|
|
497
|
+
for (var t = n > 1 ? void 0 : n ? ut(e, i) : e, a = r.length - 1, s; a >= 0; a--)
|
|
476
498
|
(s = r[a]) && (t = s(t) || t);
|
|
477
499
|
return t;
|
|
478
|
-
},
|
|
479
|
-
let
|
|
500
|
+
}, wt = (r, e) => (i, n) => e(i, n, r), _t = /* @__PURE__ */ ((r) => (r.MAIN = "__SLIDERender__", r.SCENE_VIEWER = "__SLIDEViewer__", r.SCENE = "__SLIDEScene__", r.VIEWPORT = "__SLIDEViewPort_", r))(_t || {});
|
|
501
|
+
let se = class extends $ {
|
|
480
502
|
constructor(e) {
|
|
481
503
|
super();
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
504
|
+
g(this, "zIndex", 6);
|
|
505
|
+
g(this, "viewKey", Y.SLIDE);
|
|
506
|
+
g(this, "_ObjectProvider", null);
|
|
485
507
|
this._injector = e;
|
|
486
508
|
}
|
|
487
509
|
check(e) {
|
|
@@ -494,14 +516,14 @@ let ae = class extends $ {
|
|
|
494
516
|
zIndex: t,
|
|
495
517
|
left: a = 0,
|
|
496
518
|
top: s = 0,
|
|
497
|
-
width:
|
|
519
|
+
width: l,
|
|
498
520
|
height: c,
|
|
499
521
|
angle: _,
|
|
500
522
|
scaleX: v,
|
|
501
|
-
scaleY:
|
|
502
|
-
skewX:
|
|
503
|
-
skewY:
|
|
504
|
-
flipX:
|
|
523
|
+
scaleY: p,
|
|
524
|
+
skewX: d,
|
|
525
|
+
skewY: h,
|
|
526
|
+
flipX: f,
|
|
505
527
|
flipY: u,
|
|
506
528
|
title: D,
|
|
507
529
|
description: V,
|
|
@@ -509,37 +531,37 @@ let ae = class extends $ {
|
|
|
509
531
|
} = e;
|
|
510
532
|
if (P == null)
|
|
511
533
|
return;
|
|
512
|
-
const x = new Ve(P),
|
|
534
|
+
const x = new Ve(P), o = new $e("__SLIDERender__" + n, {
|
|
513
535
|
top: s,
|
|
514
536
|
left: a,
|
|
515
|
-
width:
|
|
537
|
+
width: l,
|
|
516
538
|
height: c,
|
|
517
539
|
zIndex: t,
|
|
518
540
|
angle: _,
|
|
519
541
|
scaleX: v,
|
|
520
|
-
scaleY:
|
|
521
|
-
skewX:
|
|
522
|
-
skewY:
|
|
523
|
-
flipX:
|
|
542
|
+
scaleY: p,
|
|
543
|
+
skewX: d,
|
|
544
|
+
skewY: h,
|
|
545
|
+
flipX: f,
|
|
524
546
|
flipY: u,
|
|
525
547
|
forceRender: !0
|
|
526
548
|
});
|
|
527
|
-
|
|
549
|
+
o.enableNav(), o.enableSelectedClipElement();
|
|
528
550
|
const S = x.getPageOrder(), I = x.getPages();
|
|
529
551
|
if (!S || !I)
|
|
530
|
-
return
|
|
531
|
-
this._ObjectProvider = new
|
|
532
|
-
for (let
|
|
533
|
-
const T = I[S[
|
|
534
|
-
|
|
552
|
+
return o;
|
|
553
|
+
this._ObjectProvider = new ae(this._injector);
|
|
554
|
+
for (let b = 0, w = S.length; b < w; b++) {
|
|
555
|
+
const T = I[S[b]], { id: y } = T;
|
|
556
|
+
o.addPageScene(this._createScene(y, o, T, i, x));
|
|
535
557
|
}
|
|
536
|
-
return
|
|
558
|
+
return o.activeFirstPage(), o;
|
|
537
559
|
}
|
|
538
560
|
_createScene(e, i, n, t, a) {
|
|
539
|
-
var
|
|
540
|
-
const { width: s, height:
|
|
561
|
+
var h;
|
|
562
|
+
const { width: s, height: l } = i, c = new le(e, i, {
|
|
541
563
|
width: s,
|
|
542
|
-
height:
|
|
564
|
+
height: l
|
|
543
565
|
});
|
|
544
566
|
new C(`PageViewer_${e}`, c, {
|
|
545
567
|
left: 0,
|
|
@@ -549,48 +571,48 @@ let ae = class extends $ {
|
|
|
549
571
|
explicitViewportWidthSet: !1,
|
|
550
572
|
explicitViewportHeightSet: !1
|
|
551
573
|
}).closeClip();
|
|
552
|
-
const { pageElements: v, pageBackgroundFill:
|
|
553
|
-
return this._addBackgroundRect(c,
|
|
554
|
-
c.attachTransformerTo(
|
|
574
|
+
const { pageElements: v, pageBackgroundFill: p } = n, d = (h = this._ObjectProvider) == null ? void 0 : h.convertToRenderObjects(v, t);
|
|
575
|
+
return this._addBackgroundRect(c, p, a), c.addObjects(d), d == null || d.forEach((f) => {
|
|
576
|
+
c.attachTransformerTo(f);
|
|
555
577
|
}), c;
|
|
556
578
|
}
|
|
557
579
|
_addBackgroundRect(e, i, n) {
|
|
558
|
-
const t = n.getPageSize(), { width: a = 0, height: s = 0 } = t,
|
|
580
|
+
const t = n.getPageSize(), { width: a = 0, height: s = 0 } = t, l = new U("canvas", {
|
|
559
581
|
left: 0,
|
|
560
582
|
top: 0,
|
|
561
583
|
width: a,
|
|
562
584
|
height: s,
|
|
563
585
|
strokeWidth: 1,
|
|
564
586
|
stroke: "rgba(198,198,198, 1)",
|
|
565
|
-
fill:
|
|
587
|
+
fill: re(i) || "rgba(255,255,255, 1)",
|
|
566
588
|
zIndex: 0,
|
|
567
589
|
evented: !1
|
|
568
590
|
});
|
|
569
|
-
e.addObject(
|
|
591
|
+
e.addObject(l, 0);
|
|
570
592
|
}
|
|
571
593
|
};
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
],
|
|
575
|
-
class
|
|
594
|
+
se = ft([
|
|
595
|
+
wt(0, H(G))
|
|
596
|
+
], se);
|
|
597
|
+
class vt {
|
|
576
598
|
constructor() {
|
|
577
|
-
|
|
599
|
+
g(this, "zIndex", 6);
|
|
578
600
|
}
|
|
579
601
|
create(e) {
|
|
580
|
-
return e.createInstance(
|
|
602
|
+
return e.createInstance(se);
|
|
581
603
|
}
|
|
582
604
|
}
|
|
583
|
-
W.add(new
|
|
584
|
-
var
|
|
585
|
-
for (var t = n > 1 ? void 0 : n ?
|
|
605
|
+
W.add(new vt());
|
|
606
|
+
var St = Object.getOwnPropertyDescriptor, It = (r, e, i, n) => {
|
|
607
|
+
for (var t = n > 1 ? void 0 : n ? St(e, i) : e, a = r.length - 1, s; a >= 0; a--)
|
|
586
608
|
(s = r[a]) && (t = s(t) || t);
|
|
587
609
|
return t;
|
|
588
610
|
}, B = (r, e) => (i, n) => e(i, n, r);
|
|
589
|
-
let
|
|
611
|
+
let ce = class extends $ {
|
|
590
612
|
constructor(e, i, n, t) {
|
|
591
613
|
super();
|
|
592
|
-
|
|
593
|
-
|
|
614
|
+
g(this, "zIndex", 4);
|
|
615
|
+
g(this, "viewKey", Y.SPREADSHEET);
|
|
594
616
|
this._localeService = e, this._contextService = i, this._configService = n, this._injector = t;
|
|
595
617
|
}
|
|
596
618
|
check(e) {
|
|
@@ -603,20 +625,20 @@ let se = class extends $ {
|
|
|
603
625
|
zIndex: t,
|
|
604
626
|
left: a = 0,
|
|
605
627
|
top: s = 0,
|
|
606
|
-
width:
|
|
628
|
+
width: l,
|
|
607
629
|
height: c,
|
|
608
630
|
angle: _,
|
|
609
631
|
scaleX: v,
|
|
610
|
-
scaleY:
|
|
611
|
-
skewX:
|
|
612
|
-
skewY:
|
|
613
|
-
flipX:
|
|
632
|
+
scaleY: p,
|
|
633
|
+
skewX: d,
|
|
634
|
+
skewY: h,
|
|
635
|
+
flipX: f,
|
|
614
636
|
flipY: u,
|
|
615
637
|
spreadsheet: D
|
|
616
638
|
} = e;
|
|
617
639
|
if (D == null)
|
|
618
640
|
return;
|
|
619
|
-
const { worksheet: V, styles: P } = D, x = new je(P),
|
|
641
|
+
const { worksheet: V, styles: P } = D, x = new je(P), o = new Fe(
|
|
620
642
|
new Re(n, V, x),
|
|
621
643
|
// FIXME: worksheet in slide doesn't has a Worksheet object
|
|
622
644
|
x,
|
|
@@ -624,33 +646,33 @@ let se = class extends $ {
|
|
|
624
646
|
this._contextService,
|
|
625
647
|
this._configService,
|
|
626
648
|
this._injector
|
|
627
|
-
), { rowTotalHeight: S, columnTotalWidth: I, rowHeaderWidth:
|
|
649
|
+
), { rowTotalHeight: S, columnTotalWidth: I, rowHeaderWidth: b, columnHeaderHeight: w } = o, T = I + V.rowHeader.width || 0, y = S + V.columnHeader.height || 0, X = new _e("spreadInSlideSceneViewer" + n, {
|
|
628
650
|
top: s,
|
|
629
651
|
left: a,
|
|
630
|
-
width:
|
|
652
|
+
width: l,
|
|
631
653
|
height: c,
|
|
632
654
|
zIndex: t,
|
|
633
655
|
angle: _,
|
|
634
656
|
scaleX: v,
|
|
635
|
-
scaleY:
|
|
636
|
-
skewX:
|
|
637
|
-
skewY:
|
|
638
|
-
flipX:
|
|
657
|
+
scaleY: p,
|
|
658
|
+
skewX: d,
|
|
659
|
+
skewY: h,
|
|
660
|
+
flipX: f,
|
|
639
661
|
flipY: u,
|
|
640
662
|
forceRender: !0
|
|
641
|
-
}), R = new
|
|
663
|
+
}), R = new le("spreadInSlideScene" + n, X, {
|
|
642
664
|
width: T,
|
|
643
|
-
height:
|
|
665
|
+
height: y
|
|
644
666
|
});
|
|
645
|
-
this._updateViewport(n,
|
|
646
|
-
const A = new
|
|
667
|
+
this._updateViewport(n, b, w, R, i);
|
|
668
|
+
const A = new Ke("testSheetViewer", o, !1), L = new Be("spreadInSlideRow", o), O = new qe("spreadInSlideColumn", o), z = new U("spreadInSlideLeftTop", {
|
|
647
669
|
zIndex: 2,
|
|
648
670
|
left: -1,
|
|
649
671
|
top: -1,
|
|
650
|
-
width:
|
|
651
|
-
height:
|
|
652
|
-
fill:
|
|
653
|
-
stroke:
|
|
672
|
+
width: b,
|
|
673
|
+
height: w,
|
|
674
|
+
fill: pe([248, 249, 250]),
|
|
675
|
+
stroke: pe([217, 217, 217]),
|
|
654
676
|
strokeWidth: 1
|
|
655
677
|
});
|
|
656
678
|
return A.zIndex = 10, R.addObjects([A], 1), R.addObjects([L, O, z], 2), X;
|
|
@@ -659,9 +681,9 @@ let se = class extends $ {
|
|
|
659
681
|
_updateViewport(e, i, n, t, a) {
|
|
660
682
|
if (a == null)
|
|
661
683
|
return;
|
|
662
|
-
const s = i * t.scaleX,
|
|
684
|
+
const s = i * t.scaleX, l = n * t.scaleY, c = new C("spreadInSlideViewMain" + e, t, {
|
|
663
685
|
left: s,
|
|
664
|
-
top:
|
|
686
|
+
top: l,
|
|
665
687
|
bottom: 0,
|
|
666
688
|
right: 0,
|
|
667
689
|
explicitViewportWidthSet: !1,
|
|
@@ -669,7 +691,7 @@ let se = class extends $ {
|
|
|
669
691
|
isWheelPreventDefaultX: !0
|
|
670
692
|
}), _ = new C("spreadInSlideViewTop" + e, t, {
|
|
671
693
|
left: s,
|
|
672
|
-
height:
|
|
694
|
+
height: l,
|
|
673
695
|
top: 0,
|
|
674
696
|
right: 0,
|
|
675
697
|
explicitViewportWidthSet: !1,
|
|
@@ -677,7 +699,7 @@ let se = class extends $ {
|
|
|
677
699
|
}), v = new C("spreadInSlideViewLeft" + e, t, {
|
|
678
700
|
left: 0,
|
|
679
701
|
bottom: 0,
|
|
680
|
-
top:
|
|
702
|
+
top: l,
|
|
681
703
|
width: s,
|
|
682
704
|
explicitViewportHeightSet: !1,
|
|
683
705
|
isWheelPreventDefaultX: !0
|
|
@@ -686,51 +708,51 @@ let se = class extends $ {
|
|
|
686
708
|
left: 0,
|
|
687
709
|
top: 0,
|
|
688
710
|
width: s,
|
|
689
|
-
height:
|
|
711
|
+
height: l,
|
|
690
712
|
isWheelPreventDefaultX: !0
|
|
691
|
-
}), c.onScrollAfter$.subscribeEvent((
|
|
692
|
-
const { scrollX:
|
|
713
|
+
}), c.onScrollAfter$.subscribeEvent((p) => {
|
|
714
|
+
const { scrollX: d, scrollY: h, viewportScrollX: f, viewportScrollY: u } = p;
|
|
693
715
|
_.updateScrollVal({
|
|
694
|
-
scrollX:
|
|
695
|
-
viewportScrollX:
|
|
716
|
+
scrollX: d,
|
|
717
|
+
viewportScrollX: f
|
|
696
718
|
}), v.updateScrollVal({
|
|
697
|
-
scrollY:
|
|
719
|
+
scrollY: h,
|
|
698
720
|
viewportScrollY: u
|
|
699
721
|
});
|
|
700
722
|
}), t.attachControl(), new ve(c, {
|
|
701
723
|
mainScene: a
|
|
702
|
-
}), t.onMouseWheel$.subscribeEvent((
|
|
703
|
-
const
|
|
704
|
-
if (
|
|
705
|
-
const
|
|
706
|
-
let u =
|
|
707
|
-
u *=
|
|
724
|
+
}), t.onMouseWheel$.subscribeEvent((p, d) => {
|
|
725
|
+
const h = p;
|
|
726
|
+
if (h.ctrlKey) {
|
|
727
|
+
const f = Math.abs(h.deltaX);
|
|
728
|
+
let u = f < 40 ? 0.05 : f < 80 ? 0.02 : 0.01;
|
|
729
|
+
u *= h.deltaY > 0 ? -1 : 1, t.scaleX < 1 && (u /= 2), t.scaleX + u > 4 ? t.scale(4, 4) : t.scaleX + u < 0.1 ? t.scale(0.1, 0.1) : (t.scaleBy(u, u), h.preventDefault());
|
|
708
730
|
} else
|
|
709
|
-
c.onMouseWheel(
|
|
731
|
+
c.onMouseWheel(h, d);
|
|
710
732
|
});
|
|
711
733
|
}
|
|
712
734
|
};
|
|
713
|
-
|
|
714
|
-
B(0, H(
|
|
735
|
+
ce = It([
|
|
736
|
+
B(0, H(oe)),
|
|
715
737
|
B(1, Xe),
|
|
716
738
|
B(2, we),
|
|
717
739
|
B(3, H(G))
|
|
718
|
-
],
|
|
719
|
-
class
|
|
740
|
+
], ce);
|
|
741
|
+
class xt {
|
|
720
742
|
constructor() {
|
|
721
|
-
|
|
743
|
+
g(this, "zIndex", 4);
|
|
722
744
|
}
|
|
723
745
|
create(e) {
|
|
724
|
-
return e.createInstance(
|
|
746
|
+
return e.createInstance(ce);
|
|
725
747
|
}
|
|
726
748
|
}
|
|
727
|
-
W.add(new
|
|
728
|
-
var
|
|
749
|
+
W.add(new xt());
|
|
750
|
+
var Tt = /* @__PURE__ */ ((r) => (r.COMPONENT = "__slideRender__", r.SCENE = "__mainScene__", r.VIEW = "__mainView__", r))(Tt || {});
|
|
729
751
|
export {
|
|
730
752
|
W as CanvasObjectProviderRegistry,
|
|
731
753
|
$ as ObjectAdaptor,
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
754
|
+
ae as ObjectProvider,
|
|
755
|
+
Tt as SLIDE_KEY,
|
|
756
|
+
_t as SLIDE_VIEW_KEY,
|
|
735
757
|
fe as UniverSlidesPlugin
|
|
736
758
|
};
|