@univerjs/slides 0.1.16 → 0.2.0

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