@netless/app-slide 0.0.55 → 0.0.58
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/dist/SlideController/index.d.ts +2 -4
- package/dist/index.d.ts +16 -2
- package/dist/main.cjs.js +102 -106
- package/dist/main.cjs.js.map +1 -1
- package/dist/main.es.js +439 -336
- package/dist/main.es.js.map +1 -1
- package/dist/main.iife.js +154 -158
- package/dist/main.iife.js.map +1 -1
- package/dist/typings.d.ts +5 -0
- package/package.json +2 -2
- package/src/DocsViewer/index.ts +3 -0
- package/src/DocsViewer/style.scss +1 -1
- package/src/SlideController/index.ts +20 -38
- package/src/index.ts +78 -9
- package/src/typings.ts +6 -0
package/dist/main.es.js
CHANGED
|
@@ -17,99 +17,6 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
function clamp$1(value, min, max) {
|
|
21
|
-
return Math.min(Math.max(value, min), max);
|
|
22
|
-
}
|
|
23
|
-
function isObj(obj) {
|
|
24
|
-
return typeof obj === "object" && obj !== null;
|
|
25
|
-
}
|
|
26
|
-
function deepClone(obj) {
|
|
27
|
-
return JSON.parse(JSON.stringify(obj));
|
|
28
|
-
}
|
|
29
|
-
class Logger {
|
|
30
|
-
constructor(enable) {
|
|
31
|
-
this.enable = enable;
|
|
32
|
-
this.apps = {};
|
|
33
|
-
this.level = "debug";
|
|
34
|
-
this._onMessage = (ev) => {
|
|
35
|
-
if (isObj(ev.data)) {
|
|
36
|
-
if (typeof ev.data.slide === "boolean") {
|
|
37
|
-
this.enable = ev.data.slide;
|
|
38
|
-
} else if (ev.data.slide === "__instance") {
|
|
39
|
-
console.log(this);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
window.addEventListener("message", this._onMessage);
|
|
44
|
-
}
|
|
45
|
-
log(...args) {
|
|
46
|
-
if (this.enable) {
|
|
47
|
-
console.log(...args);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
verbose(...args) {
|
|
51
|
-
if (this.enable && this.level === "verbose") {
|
|
52
|
-
console.log(...args);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
dispose(appId) {
|
|
56
|
-
this.enable = false;
|
|
57
|
-
delete this.apps[appId];
|
|
58
|
-
window.removeEventListener("message", this._onMessage);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
const logger = new Logger(false);
|
|
62
|
-
const log = logger.log.bind(logger);
|
|
63
|
-
const verbose = logger.verbose.bind(logger);
|
|
64
|
-
let useFreezer = false;
|
|
65
|
-
const FreezerLength = 2;
|
|
66
|
-
const apps = {
|
|
67
|
-
map: new Map(),
|
|
68
|
-
queue: [],
|
|
69
|
-
validateQueue() {
|
|
70
|
-
log("[Slide] freezer: validate", this.queue);
|
|
71
|
-
while (this.queue.length > FreezerLength) {
|
|
72
|
-
const appId = this.queue.pop();
|
|
73
|
-
const slide = this.map.get(appId);
|
|
74
|
-
if (slide) {
|
|
75
|
-
log("[Slide] freezer: validate-freeze", appId, this.queue);
|
|
76
|
-
slide.freeze();
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
set(appId, slide) {
|
|
81
|
-
log("[Slide] freezer: add", appId, this.queue);
|
|
82
|
-
this.map.set(appId, slide);
|
|
83
|
-
if (!this.queue.includes(appId)) {
|
|
84
|
-
this.queue.unshift(appId);
|
|
85
|
-
}
|
|
86
|
-
this.validateQueue();
|
|
87
|
-
},
|
|
88
|
-
delete(appId) {
|
|
89
|
-
log("[Slide] freezer: delete", appId, this.queue);
|
|
90
|
-
this.map.delete(appId);
|
|
91
|
-
this.queue = this.queue.filter((id) => id !== appId);
|
|
92
|
-
},
|
|
93
|
-
focus(appId) {
|
|
94
|
-
const slide = this.map.get(appId);
|
|
95
|
-
const index = this.queue.indexOf(appId);
|
|
96
|
-
if (index > -1) {
|
|
97
|
-
this.queue.splice(index, 1);
|
|
98
|
-
}
|
|
99
|
-
this.queue.unshift(appId);
|
|
100
|
-
this.validateQueue();
|
|
101
|
-
log("[Slide] freezer: focus", appId, this.queue);
|
|
102
|
-
if (slide) {
|
|
103
|
-
slide.unfreeze();
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
const addHooks = (emitter) => {
|
|
108
|
-
useFreezer = true;
|
|
109
|
-
emitter.on("focus", ({ appId }) => {
|
|
110
|
-
apps.focus(appId);
|
|
111
|
-
});
|
|
112
|
-
};
|
|
113
20
|
const e = "!#%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", s = e.length, t = Array(20), r = () => {
|
|
114
21
|
for (let r2 = 0; r2 < 20; r2++)
|
|
115
22
|
t[r2] = e.charAt(Math.random() * s);
|
|
@@ -117,7 +24,7 @@ const e = "!#%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr
|
|
|
117
24
|
};
|
|
118
25
|
class o {
|
|
119
26
|
constructor() {
|
|
120
|
-
this.disposers = new Map();
|
|
27
|
+
this.disposers = /* @__PURE__ */ new Map();
|
|
121
28
|
}
|
|
122
29
|
add(e2, s2 = r()) {
|
|
123
30
|
return this.flush(s2), this.disposers.set(s2, e2()), s2;
|
|
@@ -165,27 +72,6 @@ class o {
|
|
|
165
72
|
}), this.disposers.clear();
|
|
166
73
|
}
|
|
167
74
|
}
|
|
168
|
-
function isObject(val) {
|
|
169
|
-
return val != null && typeof val === "object" && !Array.isArray(val);
|
|
170
|
-
}
|
|
171
|
-
function ensureAttributes(context, initAttrs) {
|
|
172
|
-
let attrs = context.getAttributes();
|
|
173
|
-
if (!attrs) {
|
|
174
|
-
context.setAttributes(initAttrs);
|
|
175
|
-
attrs = context.getAttributes();
|
|
176
|
-
}
|
|
177
|
-
if (!attrs) {
|
|
178
|
-
throw new Error("[NetlessAppMonaco] No attributes");
|
|
179
|
-
}
|
|
180
|
-
if (isObject(initAttrs)) {
|
|
181
|
-
Object.keys(initAttrs).forEach((key) => {
|
|
182
|
-
if (!Object.prototype.hasOwnProperty.call(attrs, key)) {
|
|
183
|
-
context.updateAttributes([key], initAttrs[key]);
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
return attrs;
|
|
188
|
-
}
|
|
189
75
|
var Slide = function(t2) {
|
|
190
76
|
var e2 = {};
|
|
191
77
|
function n(i) {
|
|
@@ -203,7 +89,7 @@ var Slide = function(t2) {
|
|
|
203
89
|
return t3;
|
|
204
90
|
if (4 & e3 && typeof t3 == "object" && t3 && t3.__esModule)
|
|
205
91
|
return t3;
|
|
206
|
-
var i = Object.create(null);
|
|
92
|
+
var i = /* @__PURE__ */ Object.create(null);
|
|
207
93
|
if (n.r(i), Object.defineProperty(i, "default", { enumerable: true, value: t3 }), 2 & e3 && typeof t3 != "string")
|
|
208
94
|
for (var r2 in t3)
|
|
209
95
|
n.d(i, r2, function(e4) {
|
|
@@ -239,7 +125,7 @@ var Slide = function(t2) {
|
|
|
239
125
|
function u() {
|
|
240
126
|
this._events = new o2(), this._eventsCount = 0;
|
|
241
127
|
}
|
|
242
|
-
Object.create && (o2.prototype = Object.create(null), new o2().__proto__ || (r2 = false)), u.prototype.eventNames = function() {
|
|
128
|
+
Object.create && (o2.prototype = /* @__PURE__ */ Object.create(null), new o2().__proto__ || (r2 = false)), u.prototype.eventNames = function() {
|
|
243
129
|
var t3, e3, n2 = [];
|
|
244
130
|
if (this._eventsCount === 0)
|
|
245
131
|
return n2;
|
|
@@ -6052,7 +5938,7 @@ var Slide = function(t2) {
|
|
|
6052
5938
|
function u() {
|
|
6053
5939
|
this._events = new o2(), this._eventsCount = 0;
|
|
6054
5940
|
}
|
|
6055
|
-
Object.create && (o2.prototype = Object.create(null), new o2().__proto__ || (r2 = false)), u.prototype.eventNames = function() {
|
|
5941
|
+
Object.create && (o2.prototype = /* @__PURE__ */ Object.create(null), new o2().__proto__ || (r2 = false)), u.prototype.eventNames = function() {
|
|
6056
5942
|
var t3, e3, n2 = [];
|
|
6057
5943
|
if (this._eventsCount === 0)
|
|
6058
5944
|
return n2;
|
|
@@ -12251,7 +12137,7 @@ var Slide = function(t2) {
|
|
|
12251
12137
|
} };
|
|
12252
12138
|
}
|
|
12253
12139
|
function Wo(t3, e3) {
|
|
12254
|
-
const n2 = e3.isWebGL2, i2 = new WeakMap();
|
|
12140
|
+
const n2 = e3.isWebGL2, i2 = /* @__PURE__ */ new WeakMap();
|
|
12255
12141
|
return { get: function(t4) {
|
|
12256
12142
|
return t4.isInterleavedBufferAttribute && (t4 = t4.data), i2.get(t4);
|
|
12257
12143
|
}, remove: function(e4) {
|
|
@@ -12583,7 +12469,7 @@ var Slide = function(t2) {
|
|
|
12583
12469
|
};
|
|
12584
12470
|
}
|
|
12585
12471
|
function es(t3) {
|
|
12586
|
-
let e3 = new WeakMap();
|
|
12472
|
+
let e3 = /* @__PURE__ */ new WeakMap();
|
|
12587
12473
|
function n2(t4, e4) {
|
|
12588
12474
|
return e4 === pt ? t4.mapping = ct : e4 === ft && (t4.mapping = dt), t4;
|
|
12589
12475
|
}
|
|
@@ -12612,7 +12498,7 @@ var Slide = function(t2) {
|
|
|
12612
12498
|
}
|
|
12613
12499
|
return r3;
|
|
12614
12500
|
}, dispose: function() {
|
|
12615
|
-
e3 = new WeakMap();
|
|
12501
|
+
e3 = /* @__PURE__ */ new WeakMap();
|
|
12616
12502
|
} };
|
|
12617
12503
|
}
|
|
12618
12504
|
function ns(t3) {
|
|
@@ -12649,7 +12535,7 @@ var Slide = function(t2) {
|
|
|
12649
12535
|
} };
|
|
12650
12536
|
}
|
|
12651
12537
|
function is(t3, e3, n2, i2) {
|
|
12652
|
-
const r3 = {}, o3 = new WeakMap();
|
|
12538
|
+
const r3 = {}, o3 = /* @__PURE__ */ new WeakMap();
|
|
12653
12539
|
function s3(t4) {
|
|
12654
12540
|
const a3 = t4.target;
|
|
12655
12541
|
a3.index !== null && e3.remove(a3.index);
|
|
@@ -12788,7 +12674,7 @@ var Slide = function(t2) {
|
|
|
12788
12674
|
} };
|
|
12789
12675
|
}
|
|
12790
12676
|
function us(t3, e3, n2, i2) {
|
|
12791
|
-
let r3 = new WeakMap();
|
|
12677
|
+
let r3 = /* @__PURE__ */ new WeakMap();
|
|
12792
12678
|
function o3(t4) {
|
|
12793
12679
|
const e4 = t4.target;
|
|
12794
12680
|
e4.removeEventListener("dispose", o3), n2.remove(e4.instanceMatrix), e4.instanceColor !== null && n2.remove(e4.instanceColor);
|
|
@@ -12797,7 +12683,7 @@ var Slide = function(t2) {
|
|
|
12797
12683
|
const s3 = i2.render.frame, a2 = t4.geometry, l2 = e3.get(t4, a2);
|
|
12798
12684
|
return r3.get(l2) !== s3 && (e3.update(l2), r3.set(l2, s3)), t4.isInstancedMesh && (t4.hasEventListener("dispose", o3) === false && t4.addEventListener("dispose", o3), n2.update(t4.instanceMatrix, 34962), t4.instanceColor !== null && n2.update(t4.instanceColor, 34962)), l2;
|
|
12799
12685
|
}, dispose: function() {
|
|
12800
|
-
r3 = new WeakMap();
|
|
12686
|
+
r3 = /* @__PURE__ */ new WeakMap();
|
|
12801
12687
|
} };
|
|
12802
12688
|
}
|
|
12803
12689
|
Zo.physical = { uniforms: Po([Zo.standard.uniforms, { clearcoat: { value: 0 }, clearcoatMap: { value: null }, clearcoatRoughness: { value: 0 }, clearcoatRoughnessMap: { value: null }, clearcoatNormalScale: { value: new ei(1, 1) }, clearcoatNormalMap: { value: null }, sheen: { value: new Dr(0) }, transmission: { value: 0 }, transmissionMap: { value: null }, transmissionSamplerSize: { value: new ei() }, transmissionSamplerMap: { value: null }, thickness: { value: 0 }, thicknessMap: { value: null }, attenuationDistance: { value: 0 }, attenuationColor: { value: new Dr(0) } }]), vertexShader: qo.meshphysical_vert, fragmentShader: qo.meshphysical_frag };
|
|
@@ -13451,7 +13337,7 @@ var Slide = function(t2) {
|
|
|
13451
13337
|
}, programs: s3 };
|
|
13452
13338
|
}
|
|
13453
13339
|
function Da() {
|
|
13454
|
-
let t3 = new WeakMap();
|
|
13340
|
+
let t3 = /* @__PURE__ */ new WeakMap();
|
|
13455
13341
|
return { get: function(e3) {
|
|
13456
13342
|
let n2 = t3.get(e3);
|
|
13457
13343
|
return n2 === void 0 && (n2 = {}, t3.set(e3, n2)), n2;
|
|
@@ -13460,7 +13346,7 @@ var Slide = function(t2) {
|
|
|
13460
13346
|
}, update: function(e3, n2, i2) {
|
|
13461
13347
|
t3.get(e3)[n2] = i2;
|
|
13462
13348
|
}, dispose: function() {
|
|
13463
|
-
t3 = new WeakMap();
|
|
13349
|
+
t3 = /* @__PURE__ */ new WeakMap();
|
|
13464
13350
|
} };
|
|
13465
13351
|
}
|
|
13466
13352
|
function Fa(t3, e3) {
|
|
@@ -13498,12 +13384,12 @@ var Slide = function(t2) {
|
|
|
13498
13384
|
} };
|
|
13499
13385
|
}
|
|
13500
13386
|
function ka(t3) {
|
|
13501
|
-
let e3 = new WeakMap();
|
|
13387
|
+
let e3 = /* @__PURE__ */ new WeakMap();
|
|
13502
13388
|
return { get: function(n2, i2) {
|
|
13503
13389
|
let r3;
|
|
13504
13390
|
return e3.has(n2) === false ? (r3 = new Ua(t3), e3.set(n2, [r3])) : i2 >= e3.get(n2).length ? (r3 = new Ua(t3), e3.get(n2).push(r3)) : r3 = e3.get(n2)[i2], r3;
|
|
13505
13391
|
}, dispose: function() {
|
|
13506
|
-
e3 = new WeakMap();
|
|
13392
|
+
e3 = /* @__PURE__ */ new WeakMap();
|
|
13507
13393
|
} };
|
|
13508
13394
|
}
|
|
13509
13395
|
function Ga() {
|
|
@@ -13640,12 +13526,12 @@ var Slide = function(t2) {
|
|
|
13640
13526
|
} };
|
|
13641
13527
|
}
|
|
13642
13528
|
function Wa(t3, e3) {
|
|
13643
|
-
let n2 = new WeakMap();
|
|
13529
|
+
let n2 = /* @__PURE__ */ new WeakMap();
|
|
13644
13530
|
return { get: function(i2, r3 = 0) {
|
|
13645
13531
|
let o3;
|
|
13646
13532
|
return n2.has(i2) === false ? (o3 = new Va(t3, e3), n2.set(i2, [o3])) : r3 >= n2.get(i2).length ? (o3 = new Va(t3, e3), n2.get(i2).push(o3)) : o3 = n2.get(i2)[r3], o3;
|
|
13647
13533
|
}, dispose: function() {
|
|
13648
|
-
n2 = new WeakMap();
|
|
13534
|
+
n2 = /* @__PURE__ */ new WeakMap();
|
|
13649
13535
|
} };
|
|
13650
13536
|
}
|
|
13651
13537
|
class Xa extends Rr {
|
|
@@ -13983,7 +13869,7 @@ var Slide = function(t2) {
|
|
|
13983
13869
|
} };
|
|
13984
13870
|
}
|
|
13985
13871
|
function Ja(t3, e3, n2, i2, r3, o3, s3) {
|
|
13986
|
-
const a2 = r3.isWebGL2, l2 = r3.maxTextures, u2 = r3.maxCubemapSize, h2 = r3.maxTextureSize, c2 = r3.maxSamples, d2 = new WeakMap();
|
|
13872
|
+
const a2 = r3.isWebGL2, l2 = r3.maxTextures, u2 = r3.maxCubemapSize, h2 = r3.maxTextureSize, c2 = r3.maxSamples, d2 = /* @__PURE__ */ new WeakMap();
|
|
13987
13873
|
let p2, f2 = false;
|
|
13988
13874
|
try {
|
|
13989
13875
|
f2 = typeof OffscreenCanvas != "undefined" && new OffscreenCanvas(1, 1).getContext("2d") !== null;
|
|
@@ -14460,7 +14346,7 @@ var Slide = function(t2) {
|
|
|
14460
14346
|
super();
|
|
14461
14347
|
const n2 = this, i2 = t3.state;
|
|
14462
14348
|
let r3 = null, o3 = 1, s3 = null, a2 = "local-floor", l2 = null, u2 = null, h2 = null, c2 = null;
|
|
14463
|
-
const d2 = [], p2 = new Map(), f2 = new Lo();
|
|
14349
|
+
const d2 = [], p2 = /* @__PURE__ */ new Map(), f2 = new Lo();
|
|
14464
14350
|
f2.layers.enable(1), f2.viewport = new li();
|
|
14465
14351
|
const m2 = new Lo();
|
|
14466
14352
|
m2.layers.enable(2), m2.viewport = new li();
|
|
@@ -14870,7 +14756,7 @@ var Slide = function(t2) {
|
|
|
14870
14756
|
e4.isScene !== true && (e4 = j2);
|
|
14871
14757
|
const i3 = Z2.get(t4), r4 = d2.state.lights, o4 = d2.state.shadowsArray, s4 = r4.state.version, a3 = et2.getParameters(t4, r4.state, o4, e4, n3), l3 = et2.getProgramCacheKey(a3);
|
|
14872
14758
|
let u3 = i3.programs;
|
|
14873
|
-
i3.environment = t4.isMeshStandardMaterial ? e4.environment : null, i3.fog = e4.fog, i3.envMap = K2.get(t4.envMap || i3.environment), u3 === void 0 && (t4.addEventListener("dispose", wt2), u3 = new Map(), i3.programs = u3);
|
|
14759
|
+
i3.environment = t4.isMeshStandardMaterial ? e4.environment : null, i3.fog = e4.fog, i3.envMap = K2.get(t4.envMap || i3.environment), u3 === void 0 && (t4.addEventListener("dispose", wt2), u3 = /* @__PURE__ */ new Map(), i3.programs = u3);
|
|
14874
14760
|
let h3 = u3.get(l3);
|
|
14875
14761
|
if (h3 !== void 0) {
|
|
14876
14762
|
if (i3.currentProgram === h3 && i3.lightsStateVersion === s4)
|
|
@@ -22440,7 +22326,7 @@ var Slide = function(t2) {
|
|
|
22440
22326
|
i2 === void 0 ? console.warn("PixiJS Deprecation Warning: ", e3 + "\nDeprecated since v" + t3) : (i2 = i2.split("\n").splice(n2).join("\n"), console.groupCollapsed ? (console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s", "color:#614108;background:#fffbe6", "font-weight:normal;color:#614108;background:#fffbe6", e3 + "\nDeprecated since v" + t3), console.warn(i2), console.groupEnd()) : (console.warn("PixiJS Deprecation Warning: ", e3 + "\nDeprecated since v" + t3), console.warn(i2))), Yv[e3] = true;
|
|
22441
22327
|
}
|
|
22442
22328
|
}
|
|
22443
|
-
var Jv = {}, Kv = Object.create(null), $v = Object.create(null);
|
|
22329
|
+
var Jv = {}, Kv = /* @__PURE__ */ Object.create(null), $v = /* @__PURE__ */ Object.create(null);
|
|
22444
22330
|
function Qv() {
|
|
22445
22331
|
var t3;
|
|
22446
22332
|
for (t3 in Kv)
|
|
@@ -28216,7 +28102,7 @@ var Slide = function(t2) {
|
|
|
28216
28102
|
return n2.dropShadow && (m2 += n2.dropShadowDistance), new t3(e3, n2, p2, m2, l2, u2, f2 + n2.leading, h2, s3);
|
|
28217
28103
|
}, t3.wordWrap = function(e3, n2, i2) {
|
|
28218
28104
|
i2 === void 0 && (i2 = t3._canvas);
|
|
28219
|
-
for (var r3 = i2.getContext("2d"), o3 = 0, s3 = "", a2 = "", l2 = Object.create(null), u2 = n2.letterSpacing, h2 = n2.whiteSpace, c2 = t3.collapseSpaces(h2), d2 = t3.collapseNewlines(h2), p2 = !c2, f2 = n2.wordWrapWidth + u2, m2 = t3.tokenize(e3), g2 = 0; g2 < m2.length; g2++) {
|
|
28105
|
+
for (var r3 = i2.getContext("2d"), o3 = 0, s3 = "", a2 = "", l2 = /* @__PURE__ */ Object.create(null), u2 = n2.letterSpacing, h2 = n2.whiteSpace, c2 = t3.collapseSpaces(h2), d2 = t3.collapseNewlines(h2), p2 = !c2, f2 = n2.wordWrapWidth + u2, m2 = t3.tokenize(e3), g2 = 0; g2 < m2.length; g2++) {
|
|
28220
28106
|
var v2 = m2[g2];
|
|
28221
28107
|
if (t3.isNewline(v2)) {
|
|
28222
28108
|
if (!d2) {
|
|
@@ -30188,7 +30074,7 @@ void main() {
|
|
|
30188
30074
|
calcFps() {
|
|
30189
30075
|
requestAnimationFrame((t3) => {
|
|
30190
30076
|
const e3 = t3 - this.prevTime;
|
|
30191
|
-
this.valueTotal += e3, this.times += 1, this.times > 20 && (this.value = Math.floor(
|
|
30077
|
+
this.valueTotal += e3, this.times += 1, this.times > 20 && (this.value = Math.floor(1e3 * this.times / this.valueTotal), this.valueTotal = 0, this.times = 0, this.destroyed || this.emit("update", this.value)), this.prevTime = t3, this.destroyed || this.calcFps();
|
|
30192
30078
|
});
|
|
30193
30079
|
}
|
|
30194
30080
|
destroy() {
|
|
@@ -30399,7 +30285,7 @@ void main() {
|
|
|
30399
30285
|
if (n2 && !n2.applied) {
|
|
30400
30286
|
if (!(n2.triggerTime <= this.timestamp))
|
|
30401
30287
|
break;
|
|
30402
|
-
n2.fn(), n2.applied = true, t5 = this.callbackList.length;
|
|
30288
|
+
n2.running = true, n2.fn(), n2.applied = true, t5 = this.callbackList.length;
|
|
30403
30289
|
}
|
|
30404
30290
|
}
|
|
30405
30291
|
}
|
|
@@ -30407,11 +30293,11 @@ void main() {
|
|
|
30407
30293
|
}
|
|
30408
30294
|
setTimeout(t3, e3) {
|
|
30409
30295
|
const n2 = iM(), i2 = this.timestamp + Math.max(e3 || 16, 16);
|
|
30410
|
-
return this.callbackList.push({ fn: t3, triggerTime: i2, id: n2, applied: false }), this.callbackList.sort((t4, e4) => t4.triggerTime - e4.triggerTime), n2;
|
|
30296
|
+
return this.callbackList.push({ fn: t3, triggerTime: i2, id: n2, applied: false, running: false }), this.callbackList.sort((t4, e4) => t4.triggerTime - e4.triggerTime), n2;
|
|
30411
30297
|
}
|
|
30412
30298
|
clearTimeout(t3) {
|
|
30413
30299
|
const e3 = this.callbackList.findIndex((e4) => e4.id === t3);
|
|
30414
|
-
e3 >= 0 && this.callbackList.splice(e3, 1);
|
|
30300
|
+
e3 >= 0 && !this.callbackList[e3].running && this.callbackList.splice(e3, 1);
|
|
30415
30301
|
}
|
|
30416
30302
|
delay(t3) {
|
|
30417
30303
|
return new Promise((e3) => {
|
|
@@ -30459,7 +30345,7 @@ void main() {
|
|
|
30459
30345
|
};
|
|
30460
30346
|
class aM {
|
|
30461
30347
|
constructor(t3) {
|
|
30462
|
-
this.gifs = Object.create(null), this.textures = Object.create(null), this.frames = Object.create(null), this.spriteSheets = [], this.loader = t3;
|
|
30348
|
+
this.gifs = /* @__PURE__ */ Object.create(null), this.textures = /* @__PURE__ */ Object.create(null), this.frames = /* @__PURE__ */ Object.create(null), this.spriteSheets = [], this.loader = t3;
|
|
30463
30349
|
}
|
|
30464
30350
|
getTexture(t3) {
|
|
30465
30351
|
return this.textures[t3] || null;
|
|
@@ -30492,7 +30378,7 @@ void main() {
|
|
|
30492
30378
|
});
|
|
30493
30379
|
}
|
|
30494
30380
|
destroy() {
|
|
30495
|
-
this.spriteSheets.forEach((t3) => t3.destroy(true)), this.spriteSheets = [], this.gifs = Object.create(null), this.textures = Object.create(null), this.frames = Object.create(null);
|
|
30381
|
+
this.spriteSheets.forEach((t3) => t3.destroy(true)), this.spriteSheets = [], this.gifs = /* @__PURE__ */ Object.create(null), this.textures = /* @__PURE__ */ Object.create(null), this.frames = /* @__PURE__ */ Object.create(null);
|
|
30496
30382
|
}
|
|
30497
30383
|
}
|
|
30498
30384
|
var lM = n(3), uM = n.n(lM);
|
|
@@ -30590,7 +30476,7 @@ void main() {
|
|
|
30590
30476
|
};
|
|
30591
30477
|
class gM {
|
|
30592
30478
|
constructor() {
|
|
30593
|
-
this.imgElements = [], this.svgElements = [], this.idToHashMap = Object.create(null), this.textures = Object.create(null), this.graphics = [], this.hashToIdMap = Object.create(null);
|
|
30479
|
+
this.imgElements = [], this.svgElements = [], this.idToHashMap = /* @__PURE__ */ Object.create(null), this.textures = /* @__PURE__ */ Object.create(null), this.graphics = [], this.hashToIdMap = /* @__PURE__ */ Object.create(null);
|
|
30594
30480
|
}
|
|
30595
30481
|
render(t3, e3, n2) {
|
|
30596
30482
|
return mM(this, void 0, void 0, function* () {
|
|
@@ -30687,7 +30573,7 @@ void main() {
|
|
|
30687
30573
|
Object.keys(this.textures).forEach((t3) => {
|
|
30688
30574
|
var e3;
|
|
30689
30575
|
(e3 = this.textures[t3]) === null || e3 === void 0 || e3.texture.destroy(true);
|
|
30690
|
-
}), this.textures = Object.create(null), this.imgElements.forEach((t3) => fM.collectObject(t3)), this.svgElements.forEach((t3) => pM.collectObject(t3)), this.graphics = [];
|
|
30576
|
+
}), this.textures = /* @__PURE__ */ Object.create(null), this.imgElements.forEach((t3) => fM.collectObject(t3)), this.svgElements.forEach((t3) => pM.collectObject(t3)), this.graphics = [];
|
|
30691
30577
|
}
|
|
30692
30578
|
}
|
|
30693
30579
|
class vM {
|
|
@@ -30706,7 +30592,10 @@ void main() {
|
|
|
30706
30592
|
}
|
|
30707
30593
|
class _M {
|
|
30708
30594
|
constructor(t3) {
|
|
30709
|
-
this.eventHub = t3, this.targets = Object.create(null);
|
|
30595
|
+
this.eventHub = t3, this.targets = /* @__PURE__ */ Object.create(null);
|
|
30596
|
+
}
|
|
30597
|
+
getTargets() {
|
|
30598
|
+
return Object.keys(this.targets).map((t3) => this.targets[t3]);
|
|
30710
30599
|
}
|
|
30711
30600
|
addTarget(t3, e3) {
|
|
30712
30601
|
this.targets[t3] = e3;
|
|
@@ -30717,10 +30606,10 @@ void main() {
|
|
|
30717
30606
|
getTarget(t3, e3, n2 = { type: "el", index: 0, id: "" }) {
|
|
30718
30607
|
var i2, r3;
|
|
30719
30608
|
let o3 = this.targets[t3.id];
|
|
30720
|
-
return t3.type !== "shape" ? o3 : (t3.type === "shape" && t3.txEl && (o3 = (i2 = o3 == null ? void 0 : o3.getTextElement(t3.txEl.type, t3.txEl.range)) !== null && i2 !== void 0 ? i2 : null), t3.type === "shape" && t3.bg && n2.index === 0 && (e3 = false, o3 = (r3 = o3 == null ? void 0 : o3.getBgElement()) !== null && r3 !== void 0 ? r3 : null, this.eventHub.emit("IterateTimeNodeEnd", n2.id)), e3 && o3 ? o3.getIterateEntry(n2.type, n2.index, n2.id) : o3);
|
|
30609
|
+
return t3.type !== "shape" ? o3 : (t3.type === "shape" && t3.txEl && (o3 = (i2 = o3 == null ? void 0 : o3.getTextElement(t3.txEl.type, t3.txEl.range)) !== null && i2 !== void 0 ? i2 : null), t3.type === "shape" && t3.bg && n2.index === 0 && (e3 = false, o3 = (r3 = o3 == null ? void 0 : o3.getBgElement()) !== null && r3 !== void 0 ? r3 : null, this.eventHub.emit("IterateTimeNodeEnd", n2.id)), e3 && o3 ? o3.getIterateEntry(n2.type, n2.index, n2.id) : (o3 || this.eventHub.emit("IterateTimeNodeEnd", n2.id), o3));
|
|
30721
30610
|
}
|
|
30722
30611
|
clearTargets() {
|
|
30723
|
-
this.targets = Object.create(null);
|
|
30612
|
+
this.targets = /* @__PURE__ */ Object.create(null);
|
|
30724
30613
|
}
|
|
30725
30614
|
}
|
|
30726
30615
|
class yM {
|
|
@@ -30841,10 +30730,28 @@ void main() {
|
|
|
30841
30730
|
class SM {
|
|
30842
30731
|
constructor(t3, e3, n2) {
|
|
30843
30732
|
var i2, r3, o3, s3, a2, l2;
|
|
30844
|
-
this.scaleExt = { x: 1, y: 1 }, this.scaleOrigin = { x: 1, y: 1 }, this.designScale = { x: 1, y: 1 }, this.bound = new d_(0, 0, 1, 1), this.pptX = 0, this.pptY = 0, this.presetSubType = 0, this.designWidth = 0, this.designHeight = 0, this.designX = 0, this.designY = 0, this.hasPreset = false, this.container = new ty(), this.ctx = e3, this.style = new wM(this.container, t3.hardHidden), this.designGlobalPosition = { x: n2.x + ((r3 = (i2 = t3.position) === null || i2 === void 0 ? void 0 : i2.x) !== null && r3 !== void 0 ? r3 : 0), y: n2.y + ((s3 = (o3 = t3.position) === null || o3 === void 0 ? void 0 : o3.y) !== null && s3 !== void 0 ? s3 : 0) }, (t3.hlinkClick || t3.hlinkHover) && (this.hyperlink = new TM(this.container, this.ctx), t3.hlinkHover && ((a2 = this.hyperlink) === null || a2 === void 0 || a2.addAction(t3.hlinkHover, "hover")), t3.hlinkClick && ((l2 = this.hyperlink) === null || l2 === void 0 || l2.addAction(t3.hlinkClick, "click"))), this.ctx.clock.waitUntil(() =>
|
|
30845
|
-
|
|
30846
|
-
|
|
30847
|
-
|
|
30733
|
+
this.scaleExt = { x: 1, y: 1 }, this.scaleOrigin = { x: 1, y: 1 }, this.designScale = { x: 1, y: 1 }, this.bound = new d_(0, 0, 1, 1), this.pptX = 0, this.pptY = 0, this.presetSubType = 0, this.designWidth = 0, this.designHeight = 0, this.designX = 0, this.designY = 0, this.hasPreset = false, this.container = new ty(), this.ctx = e3, this.style = new wM(this.container, t3.hardHidden), this.designGlobalPosition = { x: n2.x + ((r3 = (i2 = t3.position) === null || i2 === void 0 ? void 0 : i2.x) !== null && r3 !== void 0 ? r3 : 0), y: n2.y + ((s3 = (o3 = t3.position) === null || o3 === void 0 ? void 0 : o3.y) !== null && s3 !== void 0 ? s3 : 0) }, (t3.hlinkClick || t3.hlinkHover) && (this.hyperlink = new TM(this.container, this.ctx), t3.hlinkHover && ((a2 = this.hyperlink) === null || a2 === void 0 || a2.addAction(t3.hlinkHover, "hover")), t3.hlinkClick && ((l2 = this.hyperlink) === null || l2 === void 0 || l2.addAction(t3.hlinkClick, "click"))), this.ctx.clock.waitUntil(() => {
|
|
30734
|
+
try {
|
|
30735
|
+
return !!this.container.width;
|
|
30736
|
+
} catch (t4) {
|
|
30737
|
+
return false;
|
|
30738
|
+
}
|
|
30739
|
+
}, 3e3).then(() => {
|
|
30740
|
+
try {
|
|
30741
|
+
this.designWidth = this.designWidth || this.container.width;
|
|
30742
|
+
} catch (t4) {
|
|
30743
|
+
}
|
|
30744
|
+
}), this.ctx.clock.waitUntil(() => {
|
|
30745
|
+
try {
|
|
30746
|
+
return !!this.container.height;
|
|
30747
|
+
} catch (t4) {
|
|
30748
|
+
return false;
|
|
30749
|
+
}
|
|
30750
|
+
}, 3e3).then(() => {
|
|
30751
|
+
try {
|
|
30752
|
+
this.designHeight = this.designHeight || this.container.height;
|
|
30753
|
+
} catch (t4) {
|
|
30754
|
+
}
|
|
30848
30755
|
});
|
|
30849
30756
|
}
|
|
30850
30757
|
updateScale() {
|
|
@@ -31038,6 +30945,8 @@ void main() {
|
|
|
31038
30945
|
}
|
|
31039
30946
|
clearOnSlideChange() {
|
|
31040
30947
|
}
|
|
30948
|
+
initOnReuse() {
|
|
30949
|
+
}
|
|
31041
30950
|
getTextElement() {
|
|
31042
30951
|
return null;
|
|
31043
30952
|
}
|
|
@@ -31066,28 +30975,33 @@ void main() {
|
|
|
31066
30975
|
}
|
|
31067
30976
|
}
|
|
31068
30977
|
class UM {
|
|
31069
|
-
constructor(t3, e3, n2, i2, r3, o3, s3, a2, l2) {
|
|
31070
|
-
this.ctx = t3, this.type = e3, this.lineWidth = n2, this.width = i2, this.
|
|
30978
|
+
constructor(t3, e3, n2, i2, r3, o3, s3, a2, l2, u2, h2) {
|
|
30979
|
+
this.ctx = t3, this.type = e3, this.lineWidth = n2, this.width = i2, this.height = r3, this.fillColor = o3, this.isHorz = s3, this.renderContainer = new ty(), this.ghcTextureId = `${a2}-text-p${l2}-l${u2}-u${h2}-underLine`;
|
|
31071
30980
|
}
|
|
31072
30981
|
createPaths() {
|
|
31073
30982
|
if (this.type === "ww")
|
|
31074
30983
|
return null;
|
|
31075
30984
|
{
|
|
31076
|
-
|
|
31077
|
-
|
|
30985
|
+
console.log("line width", this.lineWidth);
|
|
30986
|
+
let t3 = `M 0,0 L ${9525 * this.width},0`, [e3, n2] = [this.width, this.lineWidth];
|
|
30987
|
+
return this.isHorz || (t3 = "M 0,0 L 0," + 9525 * this.height, [e3, n2] = [this.lineWidth, this.height]), { paths: [{ id: iM(), path: t3, fill: "norm", hasStroke: true, scale: { x: 1, y: 1 }, hash: uM()(t3) }], width: e3, height: n2 };
|
|
31078
30988
|
}
|
|
31079
30989
|
}
|
|
30990
|
+
getLineStyle() {
|
|
30991
|
+
const t3 = { width: this.lineWidth };
|
|
30992
|
+
return this.type === "dotted" && (t3.dash = "" + this.lineWidth), t3;
|
|
30993
|
+
}
|
|
31080
30994
|
preRender() {
|
|
31081
30995
|
const t3 = this.createPaths();
|
|
31082
30996
|
if (t3) {
|
|
31083
30997
|
const { paths: e3, width: n2, height: i2 } = t3, r3 = e3.reduce((t4, e4) => t4 + e4.hash, "");
|
|
31084
|
-
this.ctx.graphicsTexture.addGraphics(this.ghcTextureId, e3, r3, { x: 0, y: 0 }, n2, i2,
|
|
30998
|
+
this.ctx.graphicsTexture.addGraphics(this.ghcTextureId, e3, r3, { x: 0, y: 0 }, n2, i2, this.getLineStyle(), this.ctx.objectPoolGroup, false, null, this.fillColor);
|
|
31085
30999
|
}
|
|
31086
31000
|
}
|
|
31087
31001
|
render() {
|
|
31088
31002
|
if (this.ghcTextureId) {
|
|
31089
31003
|
const t3 = this.ctx.graphicsTexture.getGraphicsData(this.ghcTextureId);
|
|
31090
|
-
t3 && (this.sprite = new OT(), this.sprite.texture = t3.texture, this.sprite.pivot.x = t3.pivot.x
|
|
31004
|
+
t3 && (this.sprite = new OT(), this.sprite.texture = t3.texture, this.sprite.pivot.x = t3.pivot.x);
|
|
31091
31005
|
}
|
|
31092
31006
|
}
|
|
31093
31007
|
destroy() {
|
|
@@ -31477,7 +31391,7 @@ void main(void){
|
|
|
31477
31391
|
`), { arg: e3 });
|
|
31478
31392
|
}
|
|
31479
31393
|
}
|
|
31480
|
-
const cA = [aA], dA = { clrChange: "\nvec4 transform(vec4 texColor, vec4 arg1, vec4 arg2) {\n float epsilon = 0.001;\n vec3 colorDiff = arg1.rgb - (texColor.rgb / max(texColor.a, 0.0000000001));\n float colorDistance = length(colorDiff);\n if (colorDistance < epsilon) {\n arg2.rgb *= arg2.a;\n return arg2;\n } else {\n return texColor;\n }\n}\n", changeBulletColor: "\nvec4 transform(vec4 texColor, vec4 arg1, vec4 arg2) {\n
|
|
31394
|
+
const cA = [aA], dA = { clrChange: "\nvec4 transform(vec4 texColor, vec4 arg1, vec4 arg2) {\n float epsilon = 0.001;\n vec3 colorDiff = arg1.rgb - (texColor.rgb / max(texColor.a, 0.0000000001));\n float colorDistance = length(colorDiff);\n if (colorDistance < epsilon) {\n arg2.rgb *= arg2.a;\n return arg2;\n } else {\n return texColor;\n }\n}\n", changeBulletColor: "\nvec4 transform(vec4 texColor, vec4 arg1, vec4 arg2) {\n if (texColor.a == 0.0) {\n return texColor;\n } else {\n return arg2;\n }\n}\n" };
|
|
31481
31395
|
class pA extends Gx {
|
|
31482
31396
|
constructor(t3, e3, n2) {
|
|
31483
31397
|
var i2;
|
|
@@ -31523,10 +31437,10 @@ void main(void){
|
|
|
31523
31437
|
}
|
|
31524
31438
|
class vA {
|
|
31525
31439
|
constructor(t3, e3, n2, i2, r3) {
|
|
31526
|
-
this.ctx = t3, this.fillStyle = e3, this.width = n2, this.height = i2, this.config = r3, this.clonedObjects = [], this._displayObject = null
|
|
31440
|
+
this.ctx = t3, this.fillStyle = e3, this.width = n2, this.height = i2, this.config = r3, this.clonedObjects = [], this._displayObject = null;
|
|
31527
31441
|
}
|
|
31528
31442
|
get displayObject() {
|
|
31529
|
-
return this._displayObject;
|
|
31443
|
+
return this._displayObject || (this._displayObject = this.createDisplayObject()), this._displayObject;
|
|
31530
31444
|
}
|
|
31531
31445
|
set displayObject(t3) {
|
|
31532
31446
|
this._displayObject && this._displayObject.destroy({ children: true, texture: true }), this._displayObject = t3;
|
|
@@ -31621,8 +31535,12 @@ void main(void){
|
|
|
31621
31535
|
constructor(t3, e3, n2) {
|
|
31622
31536
|
var i2;
|
|
31623
31537
|
super(t3, e3, n2), this.textureContainer = new ty(), this.underline = null, this.cacheSprite = new OT();
|
|
31624
|
-
const { shapeId: r3, paragraphIndex: o3, lineIndex: s3, unitIndex: a2, lineHeight: l2, width: u2, underLine: h2, fill: c2 } = t3,
|
|
31625
|
-
|
|
31538
|
+
const { shapeId: r3, paragraphIndex: o3, lineIndex: s3, unitIndex: a2, lineHeight: l2, width: u2, underLine: h2, fill: c2, height: d2, isHorz: p2, lineWidth: f2 } = t3, m2 = ((i2 = c2 == null ? void 0 : c2.fill) === null || i2 === void 0 ? void 0 : i2.fillType) === "solidFill" ? c2.fill.color : null;
|
|
31539
|
+
if (h2) {
|
|
31540
|
+
const t4 = p2 ? l2 / 16 : f2 / 16;
|
|
31541
|
+
this.underline = new UM(e3, h2.type, t4, u2, d2, m2, p2, r3, o3, s3, a2);
|
|
31542
|
+
}
|
|
31543
|
+
this.textGraphics = this.createTextGraphics(), this.textFill = this.createTextFill(), this.strokeGraphics = this.createStrokeGraphics(), this.strokeFill = this.createStrokeFill();
|
|
31626
31544
|
}
|
|
31627
31545
|
createStrokeFill() {
|
|
31628
31546
|
const { stroke: t3, lineWidth: e3, lineHeight: n2 } = this.json;
|
|
@@ -31637,8 +31555,12 @@ void main(void){
|
|
|
31637
31555
|
return t3 ? new vA(this.ctx, e3 == null ? void 0 : e3.fill, n2, Math.max(r3, i2), { useFilter: false, useSlideBackgroundFill: false }) : new vA(this.ctx, e3 == null ? void 0 : e3.fill, r3, i2, { useFilter: false, useSlideBackgroundFill: false });
|
|
31638
31556
|
}
|
|
31639
31557
|
createTextGraphics() {
|
|
31640
|
-
|
|
31641
|
-
|
|
31558
|
+
var t3;
|
|
31559
|
+
const { fill: e3, content: n2 } = this.json;
|
|
31560
|
+
let i2 = "#000000";
|
|
31561
|
+
((t3 = e3 == null ? void 0 : e3.fill) === null || t3 === void 0 ? void 0 : t3.fillType) === "solidFill" && (i2 = e3.fill.color);
|
|
31562
|
+
const r3 = (e3 == null ? void 0 : e3.key) ? { fillType: "blipFill", src: e3.key, filters: [{ type: "changeBulletColor", args: ["#000000", i2] }] } : void 0;
|
|
31563
|
+
return new vA(this.ctx, r3, (e3 == null ? void 0 : e3.width) || 0, (e3 == null ? void 0 : e3.height) || 0, { useFilter: n2 === "\u25FE", useSlideBackgroundFill: false });
|
|
31642
31564
|
}
|
|
31643
31565
|
getIterateEntry() {
|
|
31644
31566
|
return null;
|
|
@@ -31670,7 +31592,7 @@ void main(void){
|
|
|
31670
31592
|
}
|
|
31671
31593
|
if (this.textGraphics.displayObject) {
|
|
31672
31594
|
const e4 = this.textGraphics.displayObject;
|
|
31673
|
-
if (e4.scale.x = 0.5, e4.scale.y = 0.5, r3
|
|
31595
|
+
if (e4.scale.x = 0.5, e4.scale.y = 0.5, r3 && (e4.position.y = h2 > 0 ? h2 : 0), f2) {
|
|
31674
31596
|
const n3 = this.textFill.displayObject;
|
|
31675
31597
|
if (n3)
|
|
31676
31598
|
n3.mask = e4, n3.addChild(e4), n3.position.x = -u2, e4.position.x += u2, t3 = true, this.textureContainer.addChild(n3);
|
|
@@ -31696,7 +31618,7 @@ void main(void){
|
|
|
31696
31618
|
r3 ? e4.position.y = h2 > 0 ? h2 : 0 : e4.position.x = u2, this.textureContainer.addChild(e4);
|
|
31697
31619
|
}
|
|
31698
31620
|
if (this.underline && (this.underline.render(), this.underline.sprite)) {
|
|
31699
|
-
this.underline.sprite.position.y = o3 ? o3 - n2 / 16 : i2, this.underline.sprite.position.x = 0;
|
|
31621
|
+
r3 ? (this.underline.sprite.position.y = o3 ? o3 - n2 / 16 : i2, this.underline.sprite.position.x = 0) : (this.underline.sprite.position.x = 0, this.underline.sprite.position.y = 0), document.body.appendChild(this.ctx.renderer.plugins.extract.image(this.underline.sprite));
|
|
31700
31622
|
const t4 = this.textFill.getClonedDisplayObject();
|
|
31701
31623
|
t4 ? (t4.mask = this.underline.sprite, t4.addChild(this.underline.sprite), this.textureContainer.addChild(t4)) : this.textureContainer.addChild(this.underline.sprite);
|
|
31702
31624
|
}
|
|
@@ -32015,6 +31937,11 @@ void main(void){
|
|
|
32015
31937
|
}
|
|
32016
31938
|
if (n2.join("") !== "MLLLC")
|
|
32017
31939
|
return false;
|
|
31940
|
+
for (let t4 = 0; t4 < 3; t4++) {
|
|
31941
|
+
const e4 = i2[t4], n3 = i2[t4 + 1];
|
|
31942
|
+
if (e4.x !== n3.x && e4.y !== n3.y)
|
|
31943
|
+
return false;
|
|
31944
|
+
}
|
|
32018
31945
|
const r3 = i2.slice(0, 4).reduce((t4, e4) => t4 + e4.x, 0) / 4, o3 = i2.slice(0, 4).reduce((t4, e4) => t4 + e4.y, 0) / 4;
|
|
32019
31946
|
if (Number.isNaN(r3) || Number.isNaN(o3))
|
|
32020
31947
|
return false;
|
|
@@ -32089,7 +32016,7 @@ void main(void){
|
|
|
32089
32016
|
});
|
|
32090
32017
|
}, this.json = t3, this.json.fillStyle && this.json.fillStyle.fillType === "groupFill" && i2 && (this.json.fillStyle = i2), this.id = t3.id;
|
|
32091
32018
|
const { fillStyle: o3, lineStyle: s3 } = this.json;
|
|
32092
|
-
this.container.name = t3.id, this.renderContainer.name = t3.id + "-render-container", this.backgroundFill = this.createBackgroundFill(), this.backgroundGraphics = this.createBackgroundGraphics(), this.strokeFill = this.createStrokeFill(), this.strokeGraphics = this.createStrokeGraphics(), this.ctx.timingTargets.addTarget(this.id, this), (o3 == null ? void 0 : o3.fillType) === "solidFill" && (this.fillColorFilter.currentColor = o3.color, this.fillColorFilter.designColor = o3.color), ((r3 = s3 == null ? void 0 : s3.fill) === null || r3 === void 0 ? void 0 : r3.fillType) === "solidFill" && (this.strokeColorFilter.currentColor = s3.fill.color, this.strokeColorFilter.designColor = s3.fill.color), this.updateTransform(this.json), t3.textBody && (this.text = new EA(t3.textBody, this.ctx, t3.textBody.iterateType, { x: this.designGlobalPosition.x, y: this.designGlobalPosition.y })), this.container.hitArea = new g_(1, 1, this.json.width, this.json.height);
|
|
32019
|
+
this.container.name = t3.id, this.renderContainer.name = t3.id + "-render-container", this.generateArrowList(), this.backgroundFill = this.createBackgroundFill(), this.backgroundGraphics = this.createBackgroundGraphics(), this.strokeFill = this.createStrokeFill(), this.strokeGraphics = this.createStrokeGraphics(), this.ctx.timingTargets.addTarget(this.id, this), (o3 == null ? void 0 : o3.fillType) === "solidFill" && (this.fillColorFilter.currentColor = o3.color, this.fillColorFilter.designColor = o3.color), ((r3 = s3 == null ? void 0 : s3.fill) === null || r3 === void 0 ? void 0 : r3.fillType) === "solidFill" && (this.strokeColorFilter.currentColor = s3.fill.color, this.strokeColorFilter.designColor = s3.fill.color), this.updateTransform(this.json), t3.textBody && (this.text = new EA(t3.textBody, this.ctx, t3.textBody.iterateType, { x: this.designGlobalPosition.x, y: this.designGlobalPosition.y })), this.container.hitArea = new g_(1, 1, this.json.width, this.json.height);
|
|
32093
32020
|
}
|
|
32094
32021
|
get interactiveContainer() {
|
|
32095
32022
|
return this.renderContainer;
|
|
@@ -32119,7 +32046,7 @@ void main(void){
|
|
|
32119
32046
|
return this;
|
|
32120
32047
|
}
|
|
32121
32048
|
getIterateEntry(t3, e3, n2) {
|
|
32122
|
-
return t3 === "el"
|
|
32049
|
+
return t3 === "el" ? e3 === 0 ? this : (this.ctx.eventHub.emit("IterateTimeNodeEnd", n2), null) : this.text ? this.text.getIterateEntry(e3 - 1, n2) || null : (this.ctx.eventHub.emit("IterateTimeNodeEnd", n2), null);
|
|
32123
32050
|
}
|
|
32124
32051
|
createStrokeGraphics() {
|
|
32125
32052
|
var t3, e3, n2, i2;
|
|
@@ -32127,8 +32054,8 @@ void main(void){
|
|
|
32127
32054
|
return s3 && ((e3 = s3.fill) === null || e3 === void 0 ? void 0 : e3.fillType) !== "noFill" ? new OA(r3 + "-path-graphics", this.ctx, (n2 = o3 == null ? void 0 : o3.paths) !== null && n2 !== void 0 ? n2 : [], (i2 = o3 == null ? void 0 : o3.hash) !== null && i2 !== void 0 ? i2 : "", u2 || { x: 0, y: 0 }, h2, c2, s3, false, null, d2) : null;
|
|
32128
32055
|
}
|
|
32129
32056
|
createStrokeFill() {
|
|
32130
|
-
const { geometry:
|
|
32131
|
-
return new vA(this.ctx,
|
|
32057
|
+
const [t3, e3] = this.calculateFillObjectOffset(), { geometry: n2, lineStyle: i2, width: r3, height: o3 } = this.json, s3 = (n2 == null ? void 0 : n2.lineTransform) || NA, a2 = Object(l.isNumber)(i2 == null ? void 0 : i2.width) ? i2.width : 1;
|
|
32058
|
+
return new vA(this.ctx, i2 == null ? void 0 : i2.fill, (s3.width || r3) + a2 + t3, Math.max((s3.height || o3) + a2, e3), { useFilter: false, useSlideBackgroundFill: false });
|
|
32132
32059
|
}
|
|
32133
32060
|
createBackgroundGraphics() {
|
|
32134
32061
|
var t3;
|
|
@@ -32141,14 +32068,14 @@ void main(void){
|
|
|
32141
32068
|
return new vA(this.ctx, n2, (a2.width || i2) + ((t3 = o3 == null ? void 0 : o3.width) !== null && t3 !== void 0 ? t3 : 0), (a2.height || r3) + ((e3 = o3 == null ? void 0 : o3.width) !== null && e3 !== void 0 ? e3 : 0), { useFilter: false, useSlideBackgroundFill: this.json.useBgFill });
|
|
32142
32069
|
}
|
|
32143
32070
|
createBackground() {
|
|
32144
|
-
var t3, e3, n2, i2, r3, o3, s3;
|
|
32145
|
-
const { pivot:
|
|
32146
|
-
|
|
32071
|
+
var t3, e3, n2, i2, r3, o3, s3, a2;
|
|
32072
|
+
const { pivot: l2, width: u2, height: h2 } = ((t3 = this.json.geometry) === null || t3 === void 0 ? void 0 : t3.fillTransform) || NA, { displayObject: c2 } = this.backgroundFill;
|
|
32073
|
+
c2 ? (this.json.useBgFill && ((n2 = this.backgroundGraphics) === null || n2 === void 0 ? void 0 : n2.displayObject) ? (this.needCacheAsBitMap = true, c2.mask = this.backgroundGraphics.displayObject, c2.pivot.x = ((i2 = this.json.position) === null || i2 === void 0 ? void 0 : i2.x) || 0, c2.pivot.y = ((r3 = this.json.position) === null || r3 === void 0 ? void 0 : r3.y) || 0, this.container.addChild(this.backgroundGraphics.displayObject)) : ((o3 = this.json.fillStyle) === null || o3 === void 0 ? void 0 : o3.fillType) === "gifFill" ? (c2.height = h2 || this.designHeight, c2.width = u2 || this.designWidth, c2 instanceof jE && c2.play(), ((s3 = this.backgroundGraphics) === null || s3 === void 0 ? void 0 : s3.isNeedMask(c2.width, c2.height)) && (c2.mask = this.backgroundGraphics.displayObject, this.backgroundGraphics.displayObject && this.container.addChild(this.backgroundGraphics.displayObject))) : ((a2 = this.backgroundGraphics) === null || a2 === void 0 ? void 0 : a2.isNeedMask(c2.width, c2.height)) && (this.needCacheAsBitMap = true, c2.mask = this.backgroundGraphics.displayObject, this.backgroundGraphics.displayObject && this.container.addChild(this.backgroundGraphics.displayObject)), c2.x = l2.x, c2.y = l2.y, this.container.addChild(c2)) : this.backgroundFill.hasFill && ((e3 = this.backgroundGraphics) === null || e3 === void 0 ? void 0 : e3.displayObject) && this.container.addChild(this.backgroundGraphics.displayObject);
|
|
32147
32074
|
}
|
|
32148
32075
|
createPathFill() {
|
|
32149
32076
|
var t3, e3, n2;
|
|
32150
|
-
const { displayObject: i2 } = this.strokeFill, r3 = (t3 = this.strokeGraphics) === null || t3 === void 0 ? void 0 : t3.displayObject;
|
|
32151
|
-
i2 ? (((e3 = this.strokeGraphics) === null || e3 === void 0 ? void 0 : e3.isNeedMask(i2.width, i2.height)) && r3 && (this.needCacheAsBitMap = true, i2.pivot.x = r3.pivot.x, i2.pivot.y = r3.pivot.y, r3.pivot.x = 0, r3.pivot.y = 0, i2.mask = r3, i2.addChild(r3)), this.container.addChild(i2)) : this.strokeFill.hasFill && ((n2 = this.strokeGraphics) === null || n2 === void 0 ? void 0 : n2.displayObject) && this.container.addChild(this.strokeGraphics.displayObject);
|
|
32077
|
+
const { displayObject: i2 } = this.strokeFill, r3 = (t3 = this.strokeGraphics) === null || t3 === void 0 ? void 0 : t3.displayObject, [o3, s3] = this.calculateFillObjectOffset();
|
|
32078
|
+
i2 ? (((e3 = this.strokeGraphics) === null || e3 === void 0 ? void 0 : e3.isNeedMask(i2.width, i2.height)) && r3 && (this.needCacheAsBitMap = true, i2.pivot.x = r3.pivot.x, i2.pivot.y = r3.pivot.y, r3.pivot.x = 0, r3.pivot.y = 0, i2.mask = r3, i2.addChild(r3), i2.position.x = -o3 / 2, i2.position.y = -s3 / 2, r3.position.x = o3 / 2, r3.position.y = s3 / 2), this.container.addChild(i2)) : this.strokeFill.hasFill && ((n2 = this.strokeGraphics) === null || n2 === void 0 ? void 0 : n2.displayObject) && this.container.addChild(this.strokeGraphics.displayObject);
|
|
32152
32079
|
}
|
|
32153
32080
|
createFilledPathMask() {
|
|
32154
32081
|
var t3, e3, n2;
|
|
@@ -32164,27 +32091,38 @@ void main(void){
|
|
|
32164
32091
|
}
|
|
32165
32092
|
}
|
|
32166
32093
|
createArrow() {
|
|
32167
|
-
this.arrowList.
|
|
32168
|
-
|
|
32169
|
-
|
|
32170
|
-
|
|
32171
|
-
|
|
32172
|
-
|
|
32094
|
+
if (!this.arrowList.length)
|
|
32095
|
+
return;
|
|
32096
|
+
const t3 = new ty(), e3 = this.strokeFill.getClonedDisplayObject(), [n2, i2] = this.calculateFillObjectOffset();
|
|
32097
|
+
this.arrowList.forEach((e4) => {
|
|
32098
|
+
const n3 = this.ctx.graphicsTexture.getGraphicsData(e4.graphicsId);
|
|
32099
|
+
if (n3) {
|
|
32100
|
+
const { texture: i3 } = n3, r4 = new OT(i3);
|
|
32101
|
+
r4.pivot.x = e4.pivot.x, r4.pivot.y = e4.pivot.y, r4.position.x = e4.position.x + e4.pivot.x, r4.position.y = e4.position.y + e4.pivot.y, r4.rotation = e4.rotate / 180 * Math.PI, t3.addChild(r4);
|
|
32102
|
+
}
|
|
32103
|
+
}), this.arrowRenderTexture = Hy.create({ width: t3.width, height: t3.height, resolution: 1 }), this.ctx.renderer.render(t3, { renderTexture: this.arrowRenderTexture });
|
|
32104
|
+
const r3 = new OT();
|
|
32105
|
+
r3.texture = this.arrowRenderTexture, e3 && (e3.mask = r3, e3.position.x = -n2 / 2, e3.position.y = -i2 / 2, r3.position.x = -n2 / 2, r3.position.y = -i2 / 2, this.container.addChild(e3), this.container.addChild(r3));
|
|
32106
|
+
}
|
|
32107
|
+
generateArrowList() {
|
|
32108
|
+
var t3, e3;
|
|
32109
|
+
const { lineArrowList: n2, lineStyle: i2, id: r3 } = this.json, o3 = ((t3 = i2 == null ? void 0 : i2.fill) === null || t3 === void 0 ? void 0 : t3.fillType) === "solidFill" ? i2.fill.color : null;
|
|
32110
|
+
(e3 = n2 || []) === null || e3 === void 0 || e3.forEach((t4, e4) => {
|
|
32111
|
+
var n3, s3;
|
|
32112
|
+
const a2 = new IA(Object.assign(Object.assign({}, t4), { fillStyle: i2 == null ? void 0 : i2.fill, lineWidth: (n3 = i2 == null ? void 0 : i2.width) !== null && n3 !== void 0 ? n3 : 0 }));
|
|
32113
|
+
a2.graphicsId = `${r3}-arrow-${e4}-graphics`, a2.textureId = `${r3}-arrow-${e4}-fill`, this.ctx.graphicsTexture.addGraphics(a2.graphicsId, (s3 = a2.paths) !== null && s3 !== void 0 ? s3 : [], a2.hash, { x: 0, y: 0 }, a2.width, a2.height, void 0, this.ctx.objectPoolGroup, true, o3, null), this.arrowList.push(a2);
|
|
32173
32114
|
});
|
|
32174
32115
|
}
|
|
32116
|
+
calculateFillObjectOffset() {
|
|
32117
|
+
let [t3, e3] = [0, 0];
|
|
32118
|
+
return this.arrowList.length && (t3 = this.arrowList.reduce((t4, e4) => Math.max(t4, e4.width), 0), e3 = this.arrowList.reduce((t4, e4) => Math.max(t4, e4.height), 0)), [t3, e3];
|
|
32119
|
+
}
|
|
32175
32120
|
preRender(t3) {
|
|
32176
32121
|
var e3, n2, i2;
|
|
32177
|
-
const {
|
|
32122
|
+
const { lineStyle: r3, geometry: o3 } = this.json, { width: s3, height: a2 } = (o3 == null ? void 0 : o3.lineTransform) || NA, l2 = s3 || this.json.width, u2 = a2 || this.json.height, h2 = ((e3 = o3 == null ? void 0 : o3.paths) === null || e3 === void 0 ? void 0 : e3.filter((t4) => t4.fill !== "none" && t4.fill !== "norm")) || [], c2 = ((n2 = r3 == null ? void 0 : r3.fill) === null || n2 === void 0 ? void 0 : n2.fillType) === "solidFill" ? r3.fill.color : null;
|
|
32178
32123
|
t3.addSubMTask(() => LA(this, void 0, void 0, function* () {
|
|
32179
|
-
for (const t4 of
|
|
32180
|
-
this.ctx.graphicsTexture.addGraphics(t4.id, [t4], t4.hash, ((
|
|
32181
|
-
})), t3.addSubMTask(() => LA(this, void 0, void 0, function* () {
|
|
32182
|
-
var t4;
|
|
32183
|
-
(t4 = r3 || []) === null || t4 === void 0 || t4.forEach((t5, e4) => {
|
|
32184
|
-
var n3, i3;
|
|
32185
|
-
const r4 = new IA(Object.assign(Object.assign({}, t5), { fillStyle: o3 == null ? void 0 : o3.fill, lineWidth: (n3 = o3 == null ? void 0 : o3.width) !== null && n3 !== void 0 ? n3 : 0 }));
|
|
32186
|
-
r4.graphicsId = `${s3}-arrow-${e4}-graphics`, r4.textureId = `${s3}-arrow-${e4}-fill`, this.ctx.graphicsTexture.addGraphics(r4.graphicsId, (i3 = r4.paths) !== null && i3 !== void 0 ? i3 : [], r4.hash, r4.pivot || { x: 0, y: 0 }, r4.width, r4.height, void 0, this.ctx.objectPoolGroup, true, p2, null), this.arrowList.push(r4);
|
|
32187
|
-
});
|
|
32124
|
+
for (const t4 of h2)
|
|
32125
|
+
this.ctx.graphicsTexture.addGraphics(t4.id, [t4], t4.hash, ((o3 == null ? void 0 : o3.lineTransform) || NA).pivot, l2, u2, r3, this.ctx.objectPoolGroup, true, null, c2);
|
|
32188
32126
|
})), (i2 = this.text) === null || i2 === void 0 || i2.createParagraphs(this.json.id, t3);
|
|
32189
32127
|
}
|
|
32190
32128
|
subClassRender() {
|
|
@@ -32219,7 +32157,7 @@ void main(void){
|
|
|
32219
32157
|
}
|
|
32220
32158
|
this.renderContainer.addChild(this.container);
|
|
32221
32159
|
}
|
|
32222
|
-
if (this.needCacheAsBitMap
|
|
32160
|
+
if (this.needCacheAsBitMap, this.json.id === "background" && this.ctx.hasBackgroundFillShape) {
|
|
32223
32161
|
const t5 = Hy.create({ width: this.json.width, height: this.json.height, resolution: Math.ceil(this.ctx.renderer.resolution) });
|
|
32224
32162
|
this.ctx.renderer.render(this.renderContainer, { renderTexture: t5 }), this.ctx.bgTexture = t5;
|
|
32225
32163
|
}
|
|
@@ -32227,9 +32165,11 @@ void main(void){
|
|
|
32227
32165
|
}
|
|
32228
32166
|
clearOnSlideChange() {
|
|
32229
32167
|
}
|
|
32168
|
+
initOnReuse() {
|
|
32169
|
+
}
|
|
32230
32170
|
destroy() {
|
|
32231
|
-
var t3, e3, n2;
|
|
32232
|
-
(t3 = this.text) === null || t3 === void 0 || t3.destroy(), this.fillColorFilter.destroy(), this.strokeColorFilter.destroy(), this.backgroundFill.destroy(), (e3 = this.backgroundGraphics) === null || e3 === void 0 || e3.destroy(), this.strokeFill.destroy(), (n2 = this.strokeGraphics) === null || n2 === void 0 || n2.destroy(), this.renderContainer.destroy(), this.arrowList = [];
|
|
32171
|
+
var t3, e3, n2, i2;
|
|
32172
|
+
(t3 = this.text) === null || t3 === void 0 || t3.destroy(), this.fillColorFilter.destroy(), this.strokeColorFilter.destroy(), this.backgroundFill.destroy(), (e3 = this.backgroundGraphics) === null || e3 === void 0 || e3.destroy(), this.strokeFill.destroy(), (n2 = this.strokeGraphics) === null || n2 === void 0 || n2.destroy(), this.renderContainer.destroy(), (i2 = this.arrowRenderTexture) === null || i2 === void 0 || i2.destroy(true), this.arrowList = [];
|
|
32233
32173
|
}
|
|
32234
32174
|
}
|
|
32235
32175
|
var FA = function(t3, e3, n2, i2) {
|
|
@@ -32335,8 +32275,8 @@ void main(void){
|
|
|
32335
32275
|
}
|
|
32336
32276
|
setControllerPosition() {
|
|
32337
32277
|
var t3;
|
|
32338
|
-
const { target: e3 } = this, { stageWidth: n2, stageHeight: i2 } = this.ctx, r3 = e3.getGlobalPosition(), o3 =
|
|
32339
|
-
r3.y = r3.y + this.height - 50, r3.x = Math.max(r3.x, 0), r3.x = Math.min(r3.x, n2 - 300 *
|
|
32278
|
+
const { target: e3 } = this, { stageWidth: n2, stageHeight: i2 } = this.ctx, r3 = e3.getGlobalPosition(), o3 = Number((t3 = this.container) === null || t3 === void 0 ? void 0 : t3.getAttribute("data-scale")), s3 = n2 * o3, a2 = 1 / o3 * (300 > s3 ? s3 / 300 : 1);
|
|
32279
|
+
r3.y = r3.y + this.height - 50, r3.x = Math.max(r3.x, 0), r3.x = Math.min(r3.x, n2 - 300 * a2), r3.y = Math.max(r3.y, 0), r3.y = Math.min(r3.y, i2 - 50), BA(this.mediaController, { height: "50px", borderRadius: "25px", width: "300px", flexDirection: "row", alignItems: "center", position: "absolute", left: r3.x + "px", top: r3.y + "px", display: "none", background: "#fff", zIndex: "2", border: "1px solid #ccc", transform: `scale(${a2})`, transformOrigin: "0 100%" });
|
|
32340
32280
|
}
|
|
32341
32281
|
createMediaController() {
|
|
32342
32282
|
this.setControllerPosition(), this.createButton();
|
|
@@ -32550,7 +32490,7 @@ void main(void){
|
|
|
32550
32490
|
}
|
|
32551
32491
|
class jA extends DA {
|
|
32552
32492
|
constructor(t3, e3, n2, i2) {
|
|
32553
|
-
super(Object.assign(Object.assign({}, t3), { type: "Shape", useBgFill: false, textRotateWithShape: true, isPicture: true }), e3, n2, i2), this.cmd = new xM(this), this.media = t3 == null ? void 0 : t3.media, this.picFill = new vA(this.ctx, t3.picFill, t3.width, t3.height, { useFilter: false, useSlideBackgroundFill: false });
|
|
32493
|
+
super(Object.assign(Object.assign({}, t3), { type: "Shape", useBgFill: false, textRotateWithShape: true, isPicture: true }), e3, n2, i2), this.isInteractiveOutside = false, this.cmd = new xM(this), this.media = t3 == null ? void 0 : t3.media, this.picFill = new vA(this.ctx, t3.picFill, t3.width, t3.height, { useFilter: false, useSlideBackgroundFill: false });
|
|
32554
32494
|
}
|
|
32555
32495
|
applyCommand(t3, e3) {
|
|
32556
32496
|
var n2, i2, r3, o3, s3;
|
|
@@ -32569,9 +32509,11 @@ void main(void){
|
|
|
32569
32509
|
const { displayObject: o3 } = this.picFill;
|
|
32570
32510
|
if (o3) {
|
|
32571
32511
|
const s3 = (t3 = this.backgroundGraphics) === null || t3 === void 0 ? void 0 : t3.getClonedDisplayObject();
|
|
32572
|
-
((e3 = this.backgroundGraphics) === null || e3 === void 0 ? void 0 : e3.isNeedMask(o3.width, o3.height)) && s3 && (o3.mask = s3, this.container.addChild(s3)), o3.width = this.designWidth, o3.height = this.designHeight, o3 instanceof jE &&
|
|
32512
|
+
((e3 = this.backgroundGraphics) === null || e3 === void 0 ? void 0 : e3.isNeedMask(o3.width, o3.height)) && s3 && (o3.mask = s3, this.container.addChild(s3)), o3.width = this.designWidth, o3.height = this.designHeight, o3 instanceof jE && this.ctx.slideScopeEventHub.once("slide-render", (t4) => {
|
|
32513
|
+
this.ctx.slideIndex === t4 && o3.play();
|
|
32514
|
+
}), this.container.addChild(o3), ((n2 = this.media) === null || n2 === void 0 ? void 0 : n2.type) === "video" && this.media.src ? (this.mediaPlayer = new GA({ id: this.json.id + "-video", ctx: this.ctx, video: this.media, height: this.designHeight, width: this.designWidth, target: o3, container: this.container, canvasElement: this.ctx.view }), (i2 = this.mediaPlayer) === null || i2 === void 0 || i2.sprite) : ((r3 = this.media) === null || r3 === void 0 ? void 0 : r3.type) === "audio" && this.media.src && (this.mediaPlayer = new zA({ id: this.json.id + "-audio", ctx: this.ctx, audio: this.media, height: this.designHeight, width: this.designWidth, target: o3, canvasElement: this.ctx.view })), this.mediaPlayer && (this.isInteractiveOutside = this.container.interactive, this.container.interactive = true, this.container.on("mouseover", () => {
|
|
32573
32515
|
this.mediaPlayer.showController();
|
|
32574
|
-
}),
|
|
32516
|
+
}), this.container.on("mouseout", () => {
|
|
32575
32517
|
this.mediaPlayer.hideController();
|
|
32576
32518
|
}, false));
|
|
32577
32519
|
}
|
|
@@ -32583,10 +32525,13 @@ void main(void){
|
|
|
32583
32525
|
this.renderPic();
|
|
32584
32526
|
}
|
|
32585
32527
|
clearOnSlideChange() {
|
|
32586
|
-
super.clearOnSlideChange(), this.mediaPlayer && (this.
|
|
32528
|
+
super.clearOnSlideChange(), this.mediaPlayer && (this.container.interactive = false, this.mediaPlayer.stop(), this.mediaPlayer.hideController());
|
|
32529
|
+
}
|
|
32530
|
+
initOnReuse() {
|
|
32531
|
+
super.initOnReuse(), this.mediaPlayer && (this.container.interactive = true);
|
|
32587
32532
|
}
|
|
32588
32533
|
destroy() {
|
|
32589
|
-
this.mediaPlayer && (this.picFill.displayObject && (this.
|
|
32534
|
+
this.mediaPlayer && (this.picFill.displayObject && !this.isInteractiveOutside && (this.container.interactive = false), this.mediaPlayer.destroy(), this.mediaPlayer = void 0), this.picFill.destroy();
|
|
32590
32535
|
}
|
|
32591
32536
|
}
|
|
32592
32537
|
var VA = function(t3, e3, n2, i2) {
|
|
@@ -32660,6 +32605,9 @@ void main(void){
|
|
|
32660
32605
|
clearOnSlideChange() {
|
|
32661
32606
|
this.children.forEach((t3) => t3.clearOnSlideChange());
|
|
32662
32607
|
}
|
|
32608
|
+
initOnReuse() {
|
|
32609
|
+
this.children.forEach((t3) => t3.initOnReuse());
|
|
32610
|
+
}
|
|
32663
32611
|
destroy() {
|
|
32664
32612
|
this.cacheSprite && this.cacheSprite.destroy({ texture: true }), this.children.forEach((t3) => t3.destroy()), this.container.destroy({ children: true, texture: true, baseTexture: true }), this.cacheContainer.destroy({ children: true, texture: true, baseTexture: true });
|
|
32665
32613
|
}
|
|
@@ -33055,9 +33003,7 @@ void main(void){
|
|
|
33055
33003
|
const i2 = e3 / t4, r3 = (n2 = this.path) === null || n2 === void 0 ? void 0 : n2.getPoint(i2);
|
|
33056
33004
|
this.timingTarget && r3 && (this.timingTarget.ppt_x = r3.x + this.timingTarget.design_ppt_x, this.timingTarget.ppt_y = r3.y + +this.timingTarget.design_ppt_y);
|
|
33057
33005
|
}, this.onSeekToStart = () => {
|
|
33058
|
-
|
|
33059
|
-
const i2 = (e3 = (t4 = this.commonTimeNode.json) === null || t4 === void 0 ? void 0 : t4.spd) !== null && e3 !== void 0 ? e3 : 1, r3 = (n2 = this.path) === null || n2 === void 0 ? void 0 : n2.getPoint(i2 > 0 ? 0 : 1);
|
|
33060
|
-
this.timingTarget && r3 && (this.timingTarget.ppt_x = r3.x + this.timingTarget.design_ppt_x, this.timingTarget.ppt_y = r3.y + this.timingTarget.design_ppt_y);
|
|
33006
|
+
this.timingTarget && (this.timingTarget.ppt_x = this.timingTarget.design_ppt_x, this.timingTarget.ppt_y = this.timingTarget.design_ppt_y);
|
|
33061
33007
|
}, this.onSeekToEnd = () => {
|
|
33062
33008
|
var t4, e3, n2;
|
|
33063
33009
|
const i2 = (e3 = (t4 = this.commonTimeNode.json) === null || t4 === void 0 ? void 0 : t4.spd) !== null && e3 !== void 0 ? e3 : 1, r3 = (n2 = this.path) === null || n2 === void 0 ? void 0 : n2.getPoint(i2 > 0 ? 1 : 0);
|
|
@@ -33132,8 +33078,10 @@ void main(void){
|
|
|
33132
33078
|
}
|
|
33133
33079
|
class mR extends JA {
|
|
33134
33080
|
constructor(t3) {
|
|
33135
|
-
super(t3), this.isConflict = false, this.activeWhenConflict = "next", this.startColorString = null, this.currentColorString = "#FFFFFFFF", this.onTimelineStart = (t4) => {
|
|
33136
|
-
|
|
33081
|
+
super(t3), this.isConflict = false, this.activeWhenConflict = "next", this.isTimelineStart = false, this.startColorString = null, this.currentColorString = "#FFFFFFFF", this.onTimelineStart = (t4) => {
|
|
33082
|
+
if (this.isTimelineStart)
|
|
33083
|
+
return;
|
|
33084
|
+
this.isTimelineStart = true, t4.isReverse || this.updateCurrentValue(), this.from.isInit() || this.from.fromHexString(this.currentColorString), this.to.isInit() || this.from.by(this.by, this.to);
|
|
33137
33085
|
const [e3] = this.json.cBhvr.attrList[0].split(".");
|
|
33138
33086
|
YA(this.timingTarget, e3 + ".on", "true");
|
|
33139
33087
|
}, this.onTimeNodeEnd = () => {
|
|
@@ -33141,6 +33089,7 @@ void main(void){
|
|
|
33141
33089
|
const [t4] = this.json.cBhvr.attrList[0].split(".");
|
|
33142
33090
|
YA(this.timingTarget, t4 + ".on", "false");
|
|
33143
33091
|
}
|
|
33092
|
+
this.isTimelineStart = false;
|
|
33144
33093
|
}, this.onSeekToStart = () => {
|
|
33145
33094
|
var t4;
|
|
33146
33095
|
if (this.timingTarget && (this.onTimeUpdate({ duration: 1, delta: 0 }), ((t4 = this.timingTarget.fill) === null || t4 === void 0 ? void 0 : t4.designColor.toUpperCase()) === this.from.toHexString().toUpperCase())) {
|
|
@@ -33156,7 +33105,7 @@ void main(void){
|
|
|
33156
33105
|
const n2 = t4 / e3;
|
|
33157
33106
|
this.to.interpolationFrom(this.from, n2, this.target), this.timingTarget && YA(this.timingTarget, this.json.cBhvr.attrList[0], this.target.toHexString());
|
|
33158
33107
|
}, this.onSeekToEnd = () => {
|
|
33159
|
-
this.onTimeUpdate({ duration: 1, delta: 1 });
|
|
33108
|
+
this.isTimelineStart || this.onTimelineStart({ isReverse: false, activeCount: 0, id: "" }), this.onTimeUpdate({ duration: 1, delta: 1 });
|
|
33160
33109
|
}, this.json.clrSpc === "rgb" ? (this.from = new MM(this.json.from), this.to = new MM(this.json.to), this.by = new MM(this.json.by), this.target = new MM()) : (this.from = new EM(this.json.from), this.to = new EM(this.json.to), this.by = new EM(this.json.by), this.target = new EM()), this.commonTimeNode.on("timeNodeStart", this.onTimeNodeStart), this.commonTimeNode.on("timeNodeCreate", this.onTimeNodeStart), this.commonTimeNode.on("timelineStart", this.onTimelineStart), this.commonTimeNode.on("timeNodeEnd", this.onTimeNodeEnd), this.commonTimeNode.on("timeUpdate", this.onTimeUpdate);
|
|
33161
33110
|
}
|
|
33162
33111
|
get modifyAttrKey() {
|
|
@@ -33216,7 +33165,7 @@ void main(void){
|
|
|
33216
33165
|
this.isApplied = false;
|
|
33217
33166
|
}), this.commonTimeNode.on("timeNodeEnd", () => {
|
|
33218
33167
|
this.isApplied = false;
|
|
33219
|
-
}), this.commonTimeNode.on("timeUpdate", this.onTimeUpdate);
|
|
33168
|
+
}), this.commonTimeNode.on("timeUpdate", this.onTimeUpdate), this.commonTimeNode.on("seekToStart", this.onSeekToStart), this.commonTimeNode.on("seekToEnd", this.onSeekToEnd);
|
|
33220
33169
|
}
|
|
33221
33170
|
get modifyAttrKey() {
|
|
33222
33171
|
var t3, e3, n2, i2;
|
|
@@ -33288,7 +33237,7 @@ void main(void){
|
|
|
33288
33237
|
constructor(t3) {
|
|
33289
33238
|
var e3, n2;
|
|
33290
33239
|
super(), this.uuid = Date.now().toString(32) + Math.random().toString(32).substring(2), this.isSub = false, this.isShadow = false, this.startCount = 0, this.applyCount = 0, this.isReverse = false, this.isConflictDispose = false, this.isIterateEnd = false, this.parentTimeNode = null, this.isActive = false, this.isDestroy = false, this.shouldSeekOnStart = false, this.repeatTimeoutId = "", this.iterateShadows = [], this.isEndEventsEmitted = false, this.tmFilter = [], this.timeDelta = 0, this.isIterate = false, this.iterateType = "el", this.iterateIndex = 0, this.children = [], this.subList = [], this.duration = 0, this.isNegativeSpeed = false, this.handleEndCond = () => {
|
|
33291
|
-
this.isActive && (this.isActive = false, this.
|
|
33240
|
+
this.isActive && (this.isActive = false, this.seekToEnd(false, true));
|
|
33292
33241
|
}, this.handleActive = (t4 = true) => {
|
|
33293
33242
|
if (this.isActive = true, this.applyCount += 1, this.json.iterate || this.emit("timeNodeStart", { id: this.uuid, activeCount: this.applyCount, isReverse: this.isReverse }), this.startCount > 0 && this.json.restart) {
|
|
33294
33243
|
if (this.json.restart === "never")
|
|
@@ -33441,25 +33390,26 @@ void main(void){
|
|
|
33441
33390
|
isNatureTimeEnd() {
|
|
33442
33391
|
return this.duration >= 0 && this.timeDelta >= this.duration;
|
|
33443
33392
|
}
|
|
33444
|
-
|
|
33445
|
-
if (!this.json.presetClass)
|
|
33446
|
-
return;
|
|
33393
|
+
findTargets() {
|
|
33447
33394
|
const t3 = [], e3 = (n2) => {
|
|
33448
33395
|
n2.forEach((n3) => {
|
|
33449
33396
|
var i2, r3, o3;
|
|
33450
33397
|
n3.cBhvr && n3.cBhvr.target && t3.findIndex((t4) => t4.id === n3.cBhvr.target.id) < 0 && t3.push(n3.cBhvr.target), ((r3 = (i2 = n3 == null ? void 0 : n3.cBhvr) === null || i2 === void 0 ? void 0 : i2.ctn) === null || r3 === void 0 ? void 0 : r3.childTnLst) && n3.cBhvr.ctn.childTnLst.length > 0 && e3(n3.cBhvr.ctn.childTnLst), ((o3 = n3 == null ? void 0 : n3.ctn) === null || o3 === void 0 ? void 0 : o3.childTnLst) && n3.ctn.childTnLst.length > 0 && e3(n3.ctn.childTnLst);
|
|
33451
33398
|
});
|
|
33452
33399
|
};
|
|
33453
|
-
e3(this.json.childTnLst || []), t3
|
|
33400
|
+
return e3(this.json.childTnLst || []), t3;
|
|
33401
|
+
}
|
|
33402
|
+
setPreStyle() {
|
|
33403
|
+
this.json.presetClass && this.findTargets().forEach((t3) => {
|
|
33454
33404
|
if (this.json.iterate) {
|
|
33455
|
-
let
|
|
33405
|
+
let e3 = 0, n2 = true;
|
|
33456
33406
|
for (; n2; ) {
|
|
33457
|
-
const i2 = this.ctx.timingTargets.getTarget(
|
|
33458
|
-
i2 && (this.setPreStyleForTarget(i2),
|
|
33407
|
+
const i2 = this.ctx.timingTargets.getTarget(t3, true, { type: this.json.iterate.type, index: e3, id: "" });
|
|
33408
|
+
i2 && (this.setPreStyleForTarget(i2), e3 += 1), n2 = !!i2;
|
|
33459
33409
|
}
|
|
33460
33410
|
} else {
|
|
33461
|
-
const
|
|
33462
|
-
|
|
33411
|
+
const e3 = this.ctx.timingTargets.getTarget(t3, false);
|
|
33412
|
+
e3 && this.setPreStyleForTarget(e3);
|
|
33463
33413
|
}
|
|
33464
33414
|
});
|
|
33465
33415
|
}
|
|
@@ -33643,10 +33593,10 @@ void main(void){
|
|
|
33643
33593
|
}
|
|
33644
33594
|
resetAllInteractiveSeq() {
|
|
33645
33595
|
var t3;
|
|
33646
|
-
((t3 = this.tmRoot) === null || t3 === void 0 ? void 0 : t3.commonTimeNode.children.filter((t4) => {
|
|
33596
|
+
(((t3 = this.tmRoot) === null || t3 === void 0 ? void 0 : t3.commonTimeNode.children.filter((t4) => {
|
|
33647
33597
|
var e3, n2, i2;
|
|
33648
33598
|
return ((e3 = t4.json) === null || e3 === void 0 ? void 0 : e3.type) === "seq" && ((i2 = (n2 = t4.json) === null || n2 === void 0 ? void 0 : n2.ctn) === null || i2 === void 0 ? void 0 : i2.nodeType) === "interactiveSeq";
|
|
33649
|
-
})).forEach((t4) => {
|
|
33599
|
+
})) || []).forEach((t4) => {
|
|
33650
33600
|
t4.setCurrentStep(0, "start");
|
|
33651
33601
|
});
|
|
33652
33602
|
}
|
|
@@ -33689,7 +33639,7 @@ void main(void){
|
|
|
33689
33639
|
return !!t3 && (t3.type === "Picture" || t3.type === "Shape" ? t3.useBgFill : !(!t3.children || !Object(l.isArray)(t3.children)) && t3.children.some((t4) => this.detectUseBackgroundFill(t4)));
|
|
33690
33640
|
}
|
|
33691
33641
|
initOnReuse() {
|
|
33692
|
-
this.globalEventHub.on("c:prev slide", () => {
|
|
33642
|
+
super.initOnReuse(), this.globalEventHub.on("c:prev slide", () => {
|
|
33693
33643
|
this.ctx.eventHub.emit(zR.requestPrevSlide);
|
|
33694
33644
|
}), this.globalEventHub.on("c:next slide", () => {
|
|
33695
33645
|
this.ctx.eventHub.emit(zR.requestNextSlide);
|
|
@@ -33730,7 +33680,9 @@ void main(void){
|
|
|
33730
33680
|
}
|
|
33731
33681
|
clearOnTransactionEnd() {
|
|
33732
33682
|
var t3, e3;
|
|
33733
|
-
|
|
33683
|
+
this.ctx.timingTargets.getTargets().forEach((t4) => {
|
|
33684
|
+
t4.hasPreset = false;
|
|
33685
|
+
}), (t3 = this.timing) === null || t3 === void 0 || t3.resetAllInteractiveSeq(), (e3 = this.timing) === null || e3 === void 0 || e3.destroy(), this.timing = void 0;
|
|
33734
33686
|
}
|
|
33735
33687
|
destroy() {
|
|
33736
33688
|
var t3, e3;
|
|
@@ -33757,11 +33709,11 @@ void main(void){
|
|
|
33757
33709
|
}
|
|
33758
33710
|
nextStep() {
|
|
33759
33711
|
var t3;
|
|
33760
|
-
this.hasTiming() && ((t3 = this.timing) === null || t3 === void 0 ? void 0 : t3.hasMainSeq()) ? this.globalEventHub.emit("shape slide onNext") : this.ctx.eventHub.emit(zR.requestNextSlide);
|
|
33712
|
+
this.hasTiming() && ((t3 = this.timing) === null || t3 === void 0 ? void 0 : t3.hasMainSeq()) ? (this.globalEventHub.emit("shape slide onStopAudio"), this.globalEventHub.emit("shape slide onNext")) : this.ctx.eventHub.emit(zR.requestNextSlide);
|
|
33761
33713
|
}
|
|
33762
33714
|
prevStep() {
|
|
33763
33715
|
var t3;
|
|
33764
|
-
this.hasTiming() && ((t3 = this.timing) === null || t3 === void 0 ? void 0 : t3.hasMainSeq()) ? this.globalEventHub.emit("shape slide onPrev") : this.ctx.eventHub.emit(zR.requestPrevSlide);
|
|
33716
|
+
this.hasTiming() && ((t3 = this.timing) === null || t3 === void 0 ? void 0 : t3.hasMainSeq()) ? (this.globalEventHub.emit("shape slide onStopAudio"), this.globalEventHub.emit("shape slide onPrev")) : this.ctx.eventHub.emit(zR.requestPrevSlide);
|
|
33765
33717
|
}
|
|
33766
33718
|
applyInteractiveAction(t3) {
|
|
33767
33719
|
var e3;
|
|
@@ -33938,7 +33890,7 @@ void main(void){
|
|
|
33938
33890
|
};
|
|
33939
33891
|
class kR {
|
|
33940
33892
|
constructor(t3, e3, n2, i2, r3, o3, s3) {
|
|
33941
|
-
this.loader = t3, this.mode = e3, this.renderer = n2, this.ticker = i2, this.view = r3, this.clock = o3, this.objPoolGroup = s3, this.currentStageIndex = 0, this.cacheCount = BR.isDesktop() ? 2 : 1, this.stageStates = Object.create(null), this.stageJsons = Object.create(null), this.stageCtxs = Object.create(null), this.stageImpls = Object.create(null), this.taskId = "", this.url = "", this.microTaskManager = new RR(i2);
|
|
33893
|
+
this.loader = t3, this.mode = e3, this.renderer = n2, this.ticker = i2, this.view = r3, this.clock = o3, this.objPoolGroup = s3, this.currentStageIndex = 0, this.cacheCount = BR.isDesktop() ? 2 : 1, this.stageStates = /* @__PURE__ */ Object.create(null), this.stageJsons = /* @__PURE__ */ Object.create(null), this.stageCtxs = /* @__PURE__ */ Object.create(null), this.stageImpls = /* @__PURE__ */ Object.create(null), this.taskId = "", this.url = "", this.microTaskManager = new RR(i2);
|
|
33942
33894
|
}
|
|
33943
33895
|
setSnapshotCache(t3) {
|
|
33944
33896
|
this.snapshotCache = t3;
|
|
@@ -33949,7 +33901,7 @@ void main(void){
|
|
|
33949
33901
|
createCtx(t3) {
|
|
33950
33902
|
const { task: e3 } = this.stageStates[t3];
|
|
33951
33903
|
e3.addMTask(() => {
|
|
33952
|
-
const e4 = new aM(this.loader), n2 = new a.a(), i2 = { mode: this.mode, renderer: this.renderer, graphicsTexture: new gM(), stageWidth: 0, stageHeight: 0, ticker: this.ticker, timingTargets: new _M(n2), eventHub: n2, view: this.view, medias: Object.create(null), lastViewedIndex: 0, conflictTimeNodeManager: new vM(), clock: this.clock, spriteTexture: e4, slideIndex: t3, objectPoolGroup: this.objPoolGroup, hasBackgroundFillShape: false };
|
|
33904
|
+
const e4 = new aM(this.loader), n2 = new a.a(), i2 = { mode: this.mode, renderer: this.renderer, graphicsTexture: new gM(), stageWidth: 0, stageHeight: 0, ticker: this.ticker, timingTargets: new _M(n2), eventHub: n2, view: this.view, medias: /* @__PURE__ */ Object.create(null), lastViewedIndex: 0, conflictTimeNodeManager: new vM(), clock: this.clock, spriteTexture: e4, slideIndex: t3, objectPoolGroup: this.objPoolGroup, hasBackgroundFillShape: false, slideScopeEventHub: new a.a() };
|
|
33953
33905
|
return this.stageCtxs[t3] = i2, Promise.resolve();
|
|
33954
33906
|
});
|
|
33955
33907
|
}
|
|
@@ -34081,7 +34033,7 @@ void main(void){
|
|
|
34081
34033
|
}, this.fps.on("update", (t4) => {
|
|
34082
34034
|
if (t4 < this.config.minFPS) {
|
|
34083
34035
|
if (this.config.autoResolution) {
|
|
34084
|
-
const t5 =
|
|
34036
|
+
const t5 = 0.7 * this.scale, e4 = this.app.renderer.resolution, n3 = Math.max(t5, e4 - 0.1);
|
|
34085
34037
|
n3 >= t5 && this.updateResolution(n3);
|
|
34086
34038
|
}
|
|
34087
34039
|
if (this.config.autoFPS) {
|
|
@@ -34152,12 +34104,16 @@ void main(void){
|
|
|
34152
34104
|
const n3 = t3.toString() + (this.isForward || e3 ? "-start" : "-end"), r4 = yield (i2 = this.snapshotCache) === null || i2 === void 0 ? void 0 : i2.getItem(n3);
|
|
34153
34105
|
u2 = r4 || this.getBase64(this.currentStage);
|
|
34154
34106
|
}
|
|
34155
|
-
r3.container.visible = false, this.app.stage.addChild(r3.container)
|
|
34107
|
+
r3.container.visible = false, this.app.stage.addChild(r3.container);
|
|
34108
|
+
let { transition: h2 } = r3.json;
|
|
34109
|
+
!this.isForward && (l2 == null ? void 0 : l2.json.transition) && (h2 = l2.json.transition), this.prevSlideBase64 && u2 && h2 && h2.type && l2 && r3 && (yield this.playTransaction(this.prevSlideBase64, u2, h2, l2, r3), this.prevSlideBase64 = null), this.isForward ? yield r3.startTiming() : r3.setMainSeqApplied(), this.updateResolution(this.config.resolution * this.scale), r3.container.visible = true, l2 && (l2.setMainSeqStep(0, "start"), l2.clearOnTransactionEnd(), this.app.stage.removeChild(l2.container)), r3.ctx.slideScopeEventHub.emit("slide-render", r3.ctx.slideIndex), this.emit(zR.renderEnd, t3), this.emit(zR.slideChange, t3), this.preload(t3 + 1).catch(() => {
|
|
34156
34110
|
}), this.preload(t3 - 1).catch(() => {
|
|
34157
34111
|
});
|
|
34158
34112
|
});
|
|
34159
34113
|
}
|
|
34160
34114
|
getBase64(t3) {
|
|
34115
|
+
if (!t3.container.transform)
|
|
34116
|
+
return null;
|
|
34161
34117
|
const e3 = Hy.create({ width: this.designWidth, height: this.designHeight, resolution: 1 });
|
|
34162
34118
|
this.app.renderer.render(t3.container, { renderTexture: e3 });
|
|
34163
34119
|
const n2 = this.app.renderer.plugins.extract.base64(e3, "image/jpeg");
|
|
@@ -34191,7 +34147,9 @@ void main(void){
|
|
|
34191
34147
|
}
|
|
34192
34148
|
updateResolution(t3) {
|
|
34193
34149
|
this.app.ticker.addOnce(() => {
|
|
34194
|
-
|
|
34150
|
+
let e3 = BR.isDesktop() ? t3 : 1;
|
|
34151
|
+
for (; e3 * this.designWidth > 5120 || e3 * this.designHeight > 5120; )
|
|
34152
|
+
e3 -= 0.1;
|
|
34195
34153
|
this.app.renderer.resolution = e3, this.app.renderer.plugins.interaction.resolution = this.app.renderer.resolution, this.app.renderer.resize(this.designWidth, this.designHeight);
|
|
34196
34154
|
});
|
|
34197
34155
|
}
|
|
@@ -34261,7 +34219,7 @@ void main(void){
|
|
|
34261
34219
|
this.app.ticker.start();
|
|
34262
34220
|
}
|
|
34263
34221
|
getSnapshot() {
|
|
34264
|
-
return this.currentStage
|
|
34222
|
+
return this.currentStage && this.getBase64(this.currentStage) || "";
|
|
34265
34223
|
}
|
|
34266
34224
|
createSnapshotForNextSlide(t3) {
|
|
34267
34225
|
var e3, n2;
|
|
@@ -34329,7 +34287,7 @@ void main(void){
|
|
|
34329
34287
|
return true;
|
|
34330
34288
|
var i2 = (n2 = (e3 = t3) === null || e3 === void 0 ? void 0 : e3.ownerDocument) === null || n2 === void 0 ? void 0 : n2.defaultView;
|
|
34331
34289
|
return !!(i2 && t3 instanceof i2.Element);
|
|
34332
|
-
}, tP = typeof window != "undefined" ? window : {}, eP = new WeakMap(), nP = /auto|scroll/, iP = /^tb|vertical/, rP = /msie|trident/i.test(tP.navigator && tP.navigator.userAgent), oP = function(t3) {
|
|
34290
|
+
}, tP = typeof window != "undefined" ? window : {}, eP = /* @__PURE__ */ new WeakMap(), nP = /auto|scroll/, iP = /^tb|vertical/, rP = /msie|trident/i.test(tP.navigator && tP.navigator.userAgent), oP = function(t3) {
|
|
34333
34291
|
return parseFloat(t3 || "0");
|
|
34334
34292
|
}, sP = function(t3, e3, n2) {
|
|
34335
34293
|
return t3 === void 0 && (t3 = 0), e3 === void 0 && (e3 = 0), n2 === void 0 && (n2 = false), new ZR((n2 ? e3 : t3) || 0, (n2 ? t3 : e3) || 0);
|
|
@@ -34475,7 +34433,7 @@ void main(void){
|
|
|
34475
34433
|
}, t3;
|
|
34476
34434
|
}(), EP = function(t3, e3) {
|
|
34477
34435
|
this.activeTargets = [], this.skippedTargets = [], this.observationTargets = [], this.observer = t3, this.callback = e3;
|
|
34478
|
-
}, MP = new WeakMap(), AP = function(t3, e3) {
|
|
34436
|
+
}, MP = /* @__PURE__ */ new WeakMap(), AP = function(t3, e3) {
|
|
34479
34437
|
for (var n2 = 0; n2 < t3.length; n2 += 1)
|
|
34480
34438
|
if (t3[n2].target === e3)
|
|
34481
34439
|
return n2;
|
|
@@ -34649,7 +34607,7 @@ void main(void){
|
|
|
34649
34607
|
});
|
|
34650
34608
|
}
|
|
34651
34609
|
return t3.prototype.replaceIdleTask = function() {
|
|
34652
|
-
for (var t4, e3 = this, n2 = new Set(), i2 = 0, r3 = this.tasks.length; i2 < r3; i2++)
|
|
34610
|
+
for (var t4, e3 = this, n2 = /* @__PURE__ */ new Set(), i2 = 0, r3 = this.tasks.length; i2 < r3; i2++)
|
|
34653
34611
|
this.tasks[i2].state === "idle" && ((t4 = this.tasks[i2 + 1]) === null || t4 === void 0 ? void 0 : t4.state) === "idle" && n2.add(i2);
|
|
34654
34612
|
Array.from(n2).forEach(function(t5) {
|
|
34655
34613
|
e3.tasks.splice(t5, 1);
|
|
@@ -35629,11 +35587,13 @@ void main(void){
|
|
|
35629
35587
|
return t3.prototype.createStats = function() {
|
|
35630
35588
|
var t4 = this;
|
|
35631
35589
|
this.stateId = setInterval(function() {
|
|
35632
|
-
t4.player.view && (t4.controller.runTimeFps.setValue(t4.player.runtime.
|
|
35590
|
+
t4.player.view && (t4.controller.runTimeFps.setValue(t4.player.fps.value), t4.controller.drawCall.setValue(t4.player.runtime.drawCall), t4.controller.runTimeResolution.setValue(t4.player.view.width + "*" + t4.player.view.height));
|
|
35633
35591
|
}, 500);
|
|
35634
35592
|
}, t3.prototype.createControllerGUI = function() {
|
|
35635
35593
|
var t4, e3, n2, i2, r3, o3 = new GC({ autoPlace: true, closed: true });
|
|
35636
|
-
|
|
35594
|
+
o3.domElement.style.opacity = ".6", o3.domElement.style.transformOrigin = "100% 0", o3.domElement.style.transform = "scale(1)", this.target.appendChild(o3.domElement), o3.domElement.style.position = "absolute", o3.domElement.style.right = "0", o3.domElement.style.top = "0", o3.domElement.style.zIndex = "2";
|
|
35595
|
+
var s3 = o3.add({ FPS: 0 }, "FPS", 0), a2 = o3.add({ drawCall: 0 }, "drawCall", 0), l2 = o3.add({ "\u5206\u8FA8\u7387": "" }, "\u5206\u8FA8\u7387", ""), u2 = o3.add({ "\u989D\u5916\u8BA1\u7B97": 0 }, "\u989D\u5916\u8BA1\u7B97", 0, 200), h2 = o3.addFolder("renderOptions");
|
|
35596
|
+
return this.controller = { runTimeResolution: l2, runTimeFps: s3, drawCall: a2, moreCalculation: u2, minFPS: h2.add({ "\u6700\u4F4Efps": (t4 = this.data.minFPS) !== null && t4 !== void 0 ? t4 : 40 }, "\u6700\u4F4Efps", 0, 60), maxFPS: h2.add({ "\u6700\u9AD8fps": (e3 = this.data.maxFPS) !== null && e3 !== void 0 ? e3 : 50 }, "\u6700\u9AD8fps", 0, 60), resolution: h2.add({ "\u76EE\u6807\u5206\u8FA8\u500D\u7387": (n2 = this.data.resolution) !== null && n2 !== void 0 ? n2 : window.devicePixelRatio }, "\u76EE\u6807\u5206\u8FA8\u500D\u7387", 0.5, 6), autoResolution: h2.add({ "\u81EA\u52A8\u5206\u8FA8\u7387": (i2 = this.data.autoResolution) !== null && i2 !== void 0 && i2 }, "\u81EA\u52A8\u5206\u8FA8\u7387", true), autoFps: h2.add({ "\u81EA\u52A8fps": (r3 = this.data.autoFPS) === null || r3 === void 0 || r3 }, "\u81EA\u52A8fps", true), transactionBgColor: h2.addColor({ "\u5207\u9875\u80CC\u666F\u8272": this.data.transactionBgColor }, "\u5207\u9875\u80CC\u666F\u8272") }, this.controller.runTimeFps.disabled = true, this.controller.runTimeResolution.disabled = true, o3;
|
|
35637
35597
|
}, t3.prototype.addEventListener = function() {
|
|
35638
35598
|
var t4, e3 = this;
|
|
35639
35599
|
this.controller.autoFps.onChange(function(t5) {
|
|
@@ -35646,6 +35606,8 @@ void main(void){
|
|
|
35646
35606
|
e3.data.autoResolution = t5, e3.player.updateConfig(e3.data);
|
|
35647
35607
|
}), this.controller.resolution.onChange(function(t5) {
|
|
35648
35608
|
e3.data.resolution = t5, e3.player.updateConfig(e3.data);
|
|
35609
|
+
}), this.controller.transactionBgColor.onChange(function(t5) {
|
|
35610
|
+
e3.data.transactionBgColor = t5, e3.player.updateConfig(e3.data);
|
|
35649
35611
|
}), this.controller.moreCalculation.onChange(function(n2) {
|
|
35650
35612
|
t4 && e3.player.app.ticker.remove(t4), n2 > 0 && (t4 = function() {
|
|
35651
35613
|
for (var t5 = ""; t5.length < 8e3 * n2; )
|
|
@@ -35674,7 +35636,7 @@ void main(void){
|
|
|
35674
35636
|
}, t3;
|
|
35675
35637
|
}(), jC = function() {
|
|
35676
35638
|
function t3() {
|
|
35677
|
-
this.autoUnlock = Object.create(null), this.locks = Object.create(null);
|
|
35639
|
+
this.autoUnlock = /* @__PURE__ */ Object.create(null), this.locks = /* @__PURE__ */ Object.create(null);
|
|
35678
35640
|
}
|
|
35679
35641
|
return t3.prototype.addLock = function(t4, e3) {
|
|
35680
35642
|
var n2 = this;
|
|
@@ -35821,27 +35783,32 @@ void main(void){
|
|
|
35821
35783
|
});
|
|
35822
35784
|
});
|
|
35823
35785
|
}
|
|
35824
|
-
var $C = { syncDispatch: "syncDispatch", syncReceive: "syncReceive", renderStart: "renderStart", renderEnd: "renderEnd", renderError: "renderError", slideChange: "slideChange", mainSeqStepStart: "mainSeqStepStart", mainSeqStepEnd: "mainSeqStepEnd", animateStart: "animateStart", animateEnd: "animateEnd", stateChange: "stateChange" }, QC = { taskId: "", url: "", currentSlideIndex: -1, mainSeqStep: -1, mainSeqState: null, mediaState: Object.create(null), interactiveSeqState: Object.create(null) }, tI = "";
|
|
35786
|
+
var $C = { syncDispatch: "syncDispatch", syncReceive: "syncReceive", renderStart: "renderStart", renderEnd: "renderEnd", renderError: "renderError", slideChange: "slideChange", mainSeqStepStart: "mainSeqStepStart", mainSeqStepEnd: "mainSeqStepEnd", animateStart: "animateStart", animateEnd: "animateEnd", stateChange: "stateChange" }, QC = { taskId: "", url: "", currentSlideIndex: -1, mainSeqStep: -1, mainSeqState: null, mediaState: /* @__PURE__ */ Object.create(null), interactiveSeqState: /* @__PURE__ */ Object.create(null) }, tI = "";
|
|
35825
35787
|
try {
|
|
35826
|
-
tI = "0.2.
|
|
35788
|
+
tI = "0.2.6";
|
|
35827
35789
|
} catch (t3) {
|
|
35828
35790
|
tI = "dev";
|
|
35829
35791
|
}
|
|
35830
35792
|
var eI = function(t3) {
|
|
35831
35793
|
function e3(e4) {
|
|
35832
35794
|
var n2 = t3.call(this) || this;
|
|
35833
|
-
return n2.iosResetCache = [], n2.needClearCacheImage = false, n2.version = tI, n2.__slideState = Object(l.cloneDeep)(QC), n2.
|
|
35795
|
+
return n2.iosResetCache = [], n2.needClearCacheImage = false, n2.version = tI, n2.__slideState = Object(l.cloneDeep)(QC), n2.userInputTime = 0, n2.isSyncingSlideState = false, n2.resize = false, n2.isAnimating = false, n2.renderingTaskManager = new LP(), n2.isLoading = false, n2.interactive = true, n2.frameWidth = 1, n2.frameHeight = 1, n2.frame = document.createElement("div"), n2.medianController = document.createElement("div"), n2.frameResizeObserver = new ZC(function() {
|
|
35834
35796
|
return n2.frameResizeHandler();
|
|
35835
35797
|
}), n2.timestamp = function() {
|
|
35836
35798
|
return Date.now();
|
|
35837
|
-
}, n2.mode = "local", n2.enableGlobalClick = false, n2.log = "", n2.logId = "", n2.lastEmitedState = null, n2.playerController = null, n2.lock = new jC(), n2.isInitResized = false, n2.cacheImage = document.createElement("img"), n2.isFrowning = false, n2.isReleasing = false, n2.designWidth = 0, n2.designHeight = 0, n2._slideCount = 0, n2.userInputHandle = function() {
|
|
35838
|
-
n2.
|
|
35839
|
-
|
|
35840
|
-
}, 100);
|
|
35841
|
-
}, n2.handleViewClick = function(t4) {
|
|
35799
|
+
}, n2.mode = "local", n2.enableGlobalClick = false, n2.log = "", n2.logId = "", n2.lastEmitedState = null, n2.playerController = null, n2.lock = new jC(), n2.isInitResized = false, n2.cacheImage = document.createElement("img"), n2.isFrowning = false, n2.isReleasing = false, n2.isTouchStart = false, n2.touchStartId = void 0, n2.designWidth = 0, n2.designHeight = 0, n2._slideCount = 0, n2.userInputHandle = function() {
|
|
35800
|
+
n2.userInputTime = Date.now();
|
|
35801
|
+
}, n2.handleViewClick = function() {
|
|
35842
35802
|
setTimeout(function() {
|
|
35843
|
-
|
|
35803
|
+
var t4 = Date.now();
|
|
35804
|
+
Math.abs(t4 - n2.userInputTime) > 500 && n2.enableGlobalClick && n2.nextStep();
|
|
35844
35805
|
});
|
|
35806
|
+
}, n2.handleViewTouchStart = function() {
|
|
35807
|
+
window.clearTimeout(n2.touchStartId), n2.isTouchStart = true, n2.touchStartId = setTimeout(function() {
|
|
35808
|
+
n2.isTouchStart = false;
|
|
35809
|
+
}, 350);
|
|
35810
|
+
}, n2.handleViewTouchEnd = function() {
|
|
35811
|
+
n2.isTouchStart && (n2.isTouchStart = false, n2.handleViewClick());
|
|
35845
35812
|
}, n2.persistLog = function() {
|
|
35846
35813
|
return XC(n2, void 0, void 0, function() {
|
|
35847
35814
|
var t4, e5;
|
|
@@ -35943,44 +35910,44 @@ void main(void){
|
|
|
35943
35910
|
}), n2.renderingTaskManager.eventHub.on("task-error", function(t4) {
|
|
35944
35911
|
var e5 = t4.error, i2 = t4.task;
|
|
35945
35912
|
n2.emit($C.renderError, { error: e5, index: i2.slideIndex });
|
|
35946
|
-
}), window.addEventListener("__slide_log__", n2.handleLogDownload), window.addEventListener("__slide_state__", n2.handleSlideStateLog), window.addEventListener("__slide_ref__", n2.handleSlideRef), n2.persistLogId = window.setInterval(n2.persistLog, 5e3), n2.resizeView = Object(l.debounce)(n2.resizeView.bind(n2), 50), n2.player = n2.initPlayer(e4), n2.player.view && n2.frame.appendChild(n2.player.view), n2;
|
|
35913
|
+
}), window.addEventListener("__slide_log__", n2.handleLogDownload), window.addEventListener("__slide_state__", n2.handleSlideStateLog), window.addEventListener("__slide_ref__", n2.handleSlideRef), n2.persistLogId = window.setInterval(n2.persistLog, 5e3), n2.resizeView = Object(l.debounce)(n2.resizeView.bind(n2), 50), n2.player = n2.initPlayer(e4), (e4 == null ? void 0 : e4.controller) && n2.createController(), n2.player.view && n2.frame.appendChild(n2.player.view), n2.handleViewClick = Object(l.debounce)(n2.handleViewClick, 300), n2;
|
|
35947
35914
|
}
|
|
35948
35915
|
return VC(e3, t3), e3.prototype.initPlayer = function(t4) {
|
|
35949
|
-
var e4, n2 = this,
|
|
35950
|
-
return
|
|
35951
|
-
|
|
35952
|
-
}),
|
|
35953
|
-
|
|
35954
|
-
}),
|
|
35955
|
-
|
|
35956
|
-
}),
|
|
35957
|
-
|
|
35958
|
-
}),
|
|
35959
|
-
|
|
35960
|
-
}),
|
|
35961
|
-
var e5 = t5.id,
|
|
35962
|
-
|
|
35963
|
-
}),
|
|
35964
|
-
|
|
35965
|
-
}),
|
|
35966
|
-
|
|
35967
|
-
}),
|
|
35968
|
-
var e5 = t5.action,
|
|
35969
|
-
|
|
35970
|
-
}),
|
|
35971
|
-
|
|
35972
|
-
}),
|
|
35973
|
-
|
|
35974
|
-
}),
|
|
35975
|
-
var e5 = { type: "play", time:
|
|
35976
|
-
|
|
35977
|
-
}),
|
|
35916
|
+
var e4, n2, i2, r3 = this, o3 = new jR(this.mode);
|
|
35917
|
+
return o3.setInteractive(this.interactive), o3.updateConfig(t4.renderOptions || {}), o3.on(zR.renderStart, function(t5) {
|
|
35918
|
+
r3.isLoading = true, r3.emit($C.renderStart, t5);
|
|
35919
|
+
}), o3.on(zR.renderEnd, function(t5) {
|
|
35920
|
+
r3.isLoading = false, r3.player && (r3.designHeight = r3.player.designHeight, r3.designWidth = r3.player.designWidth, r3.cacheImage.style.width = r3.player.designWidth + "px", r3.cacheImage.style.height = r3.player.designHeight + "px", r3._slideCount = r3.player.slideCount), r3.emit($C.renderEnd, t5);
|
|
35921
|
+
}), o3.on(zR.slideChange, function(t5) {
|
|
35922
|
+
r3.__slideState.currentSlideIndex = t5, r3.emit($C.slideChange, t5);
|
|
35923
|
+
}), o3.on(zR.mainSeqStateChange, function(t5) {
|
|
35924
|
+
r3.__slideState.mainSeqState = t5, r3.emitStateChange();
|
|
35925
|
+
}), o3.on(zR.mainSeqStepChange, function(t5) {
|
|
35926
|
+
r3.__slideState.mainSeqStep = t5, r3.emitStateChange();
|
|
35927
|
+
}), o3.on(zR.interactiveSeqStateChange, function(t5) {
|
|
35928
|
+
var e5 = t5.id, n3 = t5.state;
|
|
35929
|
+
r3.__slideState.interactiveSeqState[e5] = n3, r3.emitStateChange();
|
|
35930
|
+
}), o3.on(zR.animateStart, function() {
|
|
35931
|
+
r3.isAnimating !== true && (r3.isAnimating = true, r3.emit($C.animateStart));
|
|
35932
|
+
}), o3.on(zR.animateEnd, function() {
|
|
35933
|
+
r3.isAnimating !== false && (r3.isAnimating = false, r3.emit($C.animateEnd));
|
|
35934
|
+
}), o3.on(zR.interactiveSeqAction, function(t5) {
|
|
35935
|
+
var e5 = t5.action, n3 = t5.seqId;
|
|
35936
|
+
r3.emitSyncDispatch({ slideIndex: r3.__slideState.currentSlideIndex, type: "interactiveAnim", action: e5, seqId: n3 }), r3.emitStateChange();
|
|
35937
|
+
}), o3.on(zR.mainSeqStepStart, function(t5) {
|
|
35938
|
+
r3.emit($C.mainSeqStepStart, t5);
|
|
35939
|
+
}), o3.on(zR.mainSeqStepEnd, function(t5) {
|
|
35940
|
+
r3.emit($C.mainSeqStepEnd, t5);
|
|
35941
|
+
}), o3.on(zR.mediaPlay, function(t5) {
|
|
35942
|
+
var e5 = { type: "play", time: r3.timestamp() - 1e3 * t5.time };
|
|
35943
|
+
r3.__slideState.mediaState[t5.id] = e5, r3.emitSyncDispatch({ slideIndex: r3.__slideState.currentSlideIndex, type: "mediaPlay", id: t5.id, state: e5 }), r3.emitStateChange();
|
|
35944
|
+
}), o3.on(zR.mediaPause, function(t5) {
|
|
35978
35945
|
var e5 = { type: "pause", time: t5.time };
|
|
35979
|
-
|
|
35980
|
-
}),
|
|
35946
|
+
r3.__slideState.mediaState[t5.id] = e5, r3.emitSyncDispatch({ slideIndex: r3.__slideState.currentSlideIndex, type: "mediaPause", id: t5.id, state: e5 }), r3.emitStateChange();
|
|
35947
|
+
}), o3.on(zR.mediaSeek, function(t5) {
|
|
35981
35948
|
var e5 = { type: "pause", time: 0 };
|
|
35982
|
-
t5.isPlaying ? (e5.type = "play",
|
|
35983
|
-
}),
|
|
35949
|
+
t5.isPlaying ? (e5.type = "play", r3.__slideState.mediaState[t5.id] ? e5.time = r3.__slideState.mediaState[t5.id].time - 1e3 * t5.time : e5.time = r3.timestamp() - 1e3 * t5.time, r3.__slideState.mediaState[t5.id] = e5) : (e5.type = "pause", e5.time = t5.time, r3.__slideState.mediaState[t5.id] = e5), r3.emitSyncDispatch({ slideIndex: r3.__slideState.currentSlideIndex, type: "mediaSeek", id: t5.id, time: t5.time, state: e5 }), r3.emitStateChange();
|
|
35950
|
+
}), o3.on(zR.requestPrevSlide, this.handlePrevSlide), o3.on(zR.requestNextSlide, this.handleNextSlide), o3.on(zR.requestGotoSlide, this.handleGotoSlide), (e4 = o3.view) === null || e4 === void 0 || e4.addEventListener("touchend", this.handleViewTouchEnd), (n2 = o3.view) === null || n2 === void 0 || n2.addEventListener("touchstart", this.handleViewTouchStart), (i2 = o3.view) === null || i2 === void 0 || i2.addEventListener("click", this.handleViewClick), o3.on(zR.userInput, this.userInputHandle), o3;
|
|
35984
35951
|
}, e3.prototype.createController = function() {
|
|
35985
35952
|
this.player && (this.playerController = new HC({ player: this.player, params: this.player.config || {}, target: this.frame }));
|
|
35986
35953
|
}, e3.prototype.setMedianControllerAttribute = function() {
|
|
@@ -36003,7 +35970,7 @@ void main(void){
|
|
|
36003
35970
|
return qC(this, function(s3) {
|
|
36004
35971
|
switch (s3.label) {
|
|
36005
35972
|
case 0:
|
|
36006
|
-
return this.log += "=== stateChange receive [" + new Date().toISOString() + "] ===\n", this.log += JSON.stringify(t4, null, 2), this.log += "\n\n", t4.taskId && t4.taskId !== this.__slideState.taskId && (this.__slideState.taskId = t4.taskId, (e4 = this.player) === null || e4 === void 0 || e4.setResourceData(t4.taskId, this.__slideState.url)), t4.url && t4.url !== this.__slideState.url && (this.__slideState.url = t4.url, (n2 = this.player) === null || n2 === void 0 || n2.setResourceData(this.__slideState.taskId, t4.url)), Number.isInteger(t4.currentSlideIndex) && t4.currentSlideIndex !== this.__slideState.currentSlideIndex ? (this.__slideState.currentSlideIndex = t4.currentSlideIndex, [4, this.doRenderSlide(t4.currentSlideIndex)]) : [3, 2];
|
|
35973
|
+
return this.isSyncingSlideState = true, this.log += "=== stateChange receive [" + new Date().toISOString() + "] ===\n", this.log += JSON.stringify(t4, null, 2), this.log += "\n\n", t4.taskId && t4.taskId !== this.__slideState.taskId && (this.__slideState.taskId = t4.taskId, (e4 = this.player) === null || e4 === void 0 || e4.setResourceData(t4.taskId, this.__slideState.url)), t4.url && t4.url !== this.__slideState.url && (this.__slideState.url = t4.url, (n2 = this.player) === null || n2 === void 0 || n2.setResourceData(this.__slideState.taskId, t4.url)), Number.isInteger(t4.currentSlideIndex) && t4.currentSlideIndex !== this.__slideState.currentSlideIndex ? (this.__slideState.currentSlideIndex = t4.currentSlideIndex, [4, this.doRenderSlide(t4.currentSlideIndex)]) : [3, 2];
|
|
36007
35974
|
case 1:
|
|
36008
35975
|
s3.sent(), s3.label = 2;
|
|
36009
35976
|
case 2:
|
|
@@ -36012,7 +35979,7 @@ void main(void){
|
|
|
36012
35979
|
return ((e5 = o3.player) === null || e5 === void 0 ? void 0 : e5.currentIndex) === t4.currentSlideIndex && ((n3 = o3.player) === null || n3 === void 0 ? void 0 : n3.currentStage);
|
|
36013
35980
|
}, 3e3)];
|
|
36014
35981
|
case 3:
|
|
36015
|
-
return s3.sent(), r3 = false, Number.isInteger(t4.mainSeqStep) && t4.mainSeqStep !== this.__slideState.mainSeqStep && (r3 = true, this.__slideState.mainSeqStep = t4.mainSeqStep), t4.mainSeqState && t4.mainSeqState !== this.__slideState.mainSeqState && (r3 = true, this.__slideState.mainSeqState = t4.mainSeqState), r3 && this.setMainSeqStep(this.__slideState.mainSeqStep, this.__slideState.mainSeqState === "idle" ? "start" : "end"), t4.mediaState && (this.initMedia(t4), this.__slideState.mediaState = t4.mediaState), t4.interactiveSeqState && (this.initInteractiveSeq(t4), this.__slideState.interactiveSeqState = t4.interactiveSeqState), [2];
|
|
35982
|
+
return s3.sent(), r3 = false, Number.isInteger(t4.mainSeqStep) && t4.mainSeqStep !== this.__slideState.mainSeqStep && (r3 = true, this.__slideState.mainSeqStep = t4.mainSeqStep), t4.mainSeqState && t4.mainSeqState !== this.__slideState.mainSeqState && (r3 = true, this.__slideState.mainSeqState = t4.mainSeqState), r3 && this.setMainSeqStep(this.__slideState.mainSeqStep, this.__slideState.mainSeqState === "idle" ? "start" : "end"), t4.mediaState && (this.initMedia(t4), this.__slideState.mediaState = t4.mediaState), t4.interactiveSeqState && (this.initInteractiveSeq(t4), this.__slideState.interactiveSeqState = t4.interactiveSeqState), this.isSyncingSlideState = false, [2];
|
|
36016
35983
|
}
|
|
36017
35984
|
});
|
|
36018
35985
|
});
|
|
@@ -36105,21 +36072,21 @@ void main(void){
|
|
|
36105
36072
|
}, e3.prototype.poseRenderSlide = function(t4, e4) {
|
|
36106
36073
|
this.isLoading = true, this.mode === "interactive" ? this.emitSyncDispatch({ slideIndex: this.__slideState.currentSlideIndex, type: "renderSlide", index: t4, isForward: e4 }) : this.mode === "sync" ? (this.doRenderSlide(t4, e4), this.emitSyncDispatch({ slideIndex: this.__slideState.currentSlideIndex, type: "renderSlide", index: t4, isForward: e4 })) : this.doRenderSlide(t4, e4);
|
|
36107
36074
|
}, e3.prototype.doRenderSlide = function(t4, e4) {
|
|
36108
|
-
var n2, i2 = this;
|
|
36075
|
+
var n2, i2, r3, o3 = this;
|
|
36109
36076
|
if (e4 === void 0 && (e4 = true), !this.player)
|
|
36110
36077
|
return Promise.resolve();
|
|
36111
36078
|
if (this.needCreateNewPlayer() && (this.iosResetCache = [], this.iosNewPlayer = this.initPlayer(this.config), this.iosNewPlayer.setResourceData(this.__slideState.taskId, this.__slideState.url)), this.iosNewPlayer) {
|
|
36112
|
-
var
|
|
36113
|
-
this.cacheImage.src =
|
|
36079
|
+
var s3 = this.player.getSnapshot();
|
|
36080
|
+
this.cacheImage.src = s3, this.frame.appendChild(this.cacheImage), this.player.destroy(), (n2 = this.playerController) === null || n2 === void 0 || n2.destroy(), this.player = this.iosNewPlayer, this.iosNewPlayer = void 0, ((i2 = this.config) === null || i2 === void 0 ? void 0 : i2.controller) && this.createController(), this.needClearCacheImage = true, ((r3 = this == null ? void 0 : this.player) === null || r3 === void 0 ? void 0 : r3.view) && (this.player.view.style.visibility = "hidden", this.frame.appendChild(this.player.view));
|
|
36114
36081
|
}
|
|
36115
|
-
var
|
|
36082
|
+
var a2 = Math.random().toString(32).substr(2);
|
|
36116
36083
|
return this.player.isForward = e4, this.renderingTaskManager.addTask(function() {
|
|
36117
|
-
return
|
|
36118
|
-
}, t4,
|
|
36119
|
-
|
|
36084
|
+
return o3._renderSlide(t4);
|
|
36085
|
+
}, t4, a2), new Promise(function(t5) {
|
|
36086
|
+
o3.renderingTaskManager.eventHub.once("task-end-" + a2, t5);
|
|
36120
36087
|
});
|
|
36121
36088
|
}, e3.prototype.nextStep = function() {
|
|
36122
|
-
!this.isLoading && this.player && (this.player.mainSeqHasNextStep() ? this.mode === "interactive" ? this.emitSyncDispatch({ slideIndex: this.__slideState.currentSlideIndex, type: "nextStep", next: this.player.mainSeqStep() + 1 }) : this.mode === "sync" ? (this.doNextStep(), this.emitSyncDispatch({ slideIndex: this.__slideState.currentSlideIndex, type: "nextStep", next: this.player.mainSeqStep() })) : this.doNextStep() : this.handleNextSlide());
|
|
36089
|
+
!this.isLoading && this.player && this.interactive && (this.player.mainSeqHasNextStep() ? this.mode === "interactive" ? this.emitSyncDispatch({ slideIndex: this.__slideState.currentSlideIndex, type: "nextStep", next: this.player.mainSeqStep() + 1 }) : this.mode === "sync" ? (this.doNextStep(), this.emitSyncDispatch({ slideIndex: this.__slideState.currentSlideIndex, type: "nextStep", next: this.player.mainSeqStep() })) : this.doNextStep() : this.handleNextSlide());
|
|
36123
36090
|
}, e3.prototype.doNextStep = function() {
|
|
36124
36091
|
if (this.player) {
|
|
36125
36092
|
this.player.nextStep();
|
|
@@ -36127,7 +36094,7 @@ void main(void){
|
|
|
36127
36094
|
this.__slideState.mainSeqStep = t4, this.emitStateChange();
|
|
36128
36095
|
}
|
|
36129
36096
|
}, e3.prototype.prevStep = function() {
|
|
36130
|
-
!this.isLoading && this.player && (this.player.mainSeqHasPrevStep() ? this.mode === "interactive" ? this.emitSyncDispatch({ type: "prevStep", slideIndex: this.__slideState.currentSlideIndex, next: this.player.mainSeqStep() - 1 }) : this.mode === "sync" ? (this.doPrevStep(), this.emitSyncDispatch({ slideIndex: this.__slideState.currentSlideIndex, type: "prevStep", next: this.player.mainSeqStep() })) : this.doPrevStep() : this.handlePrevSlide());
|
|
36097
|
+
!this.isLoading && this.player && this.interactive && (this.player.mainSeqHasPrevStep() ? this.mode === "interactive" ? this.emitSyncDispatch({ type: "prevStep", slideIndex: this.__slideState.currentSlideIndex, next: this.player.mainSeqStep() - 1 }) : this.mode === "sync" ? (this.doPrevStep(), this.emitSyncDispatch({ slideIndex: this.__slideState.currentSlideIndex, type: "prevStep", next: this.player.mainSeqStep() })) : this.doPrevStep() : this.handlePrevSlide());
|
|
36131
36098
|
}, e3.prototype.doPrevStep = function() {
|
|
36132
36099
|
if (this.player) {
|
|
36133
36100
|
this.player.prevStep();
|
|
@@ -36137,7 +36104,7 @@ void main(void){
|
|
|
36137
36104
|
}, e3.prototype.isSlideStateReady = function(t4) {
|
|
36138
36105
|
return t4.taskId.length > 0 && t4.url.length > 0 && t4.currentSlideIndex > 0;
|
|
36139
36106
|
}, e3.prototype.emitStateChange = function() {
|
|
36140
|
-
if (this.mode !== "local") {
|
|
36107
|
+
if (this.mode !== "local" && !this.isSyncingSlideState) {
|
|
36141
36108
|
var t4 = this.slideState;
|
|
36142
36109
|
!Object(l.isEqual)(this.lastEmitedState, t4) && this.isSlideStateReady(t4) && (this.lastEmitedState = t4, this.emit($C.stateChange, t4), this.log += "=== stateChange dispatch [" + new Date().toISOString() + "] ===\n", this.log += JSON.stringify(this.slideState, null, 2), this.log += "\n\n");
|
|
36143
36110
|
}
|
|
@@ -36180,23 +36147,23 @@ void main(void){
|
|
|
36180
36147
|
});
|
|
36181
36148
|
});
|
|
36182
36149
|
}, e3.prototype.release = function() {
|
|
36183
|
-
var t4;
|
|
36150
|
+
var t4, e4;
|
|
36184
36151
|
return XC(this, void 0, void 0, function() {
|
|
36185
|
-
var
|
|
36186
|
-
return qC(this, function(
|
|
36187
|
-
switch (
|
|
36152
|
+
var n2, i2, r3, o3, s3 = this;
|
|
36153
|
+
return qC(this, function(a2) {
|
|
36154
|
+
switch (a2.label) {
|
|
36188
36155
|
case 0:
|
|
36189
36156
|
if (this.isReleasing)
|
|
36190
36157
|
return [2, KC(function() {
|
|
36191
|
-
return !
|
|
36158
|
+
return !s3.isReleasing;
|
|
36192
36159
|
}, 6e4)];
|
|
36193
|
-
for (
|
|
36194
|
-
(
|
|
36195
|
-
return [4, this.setSlideState(
|
|
36160
|
+
for (i2 in this.isReleasing = true, this.player = this.initPlayer(this.config), ((t4 = this.config) === null || t4 === void 0 ? void 0 : t4.controller) && this.createController(), this.player.view && (this.frame.appendChild(this.player.view), this.player.view.style.visibility = "hidden"), n2 = this.__slideState, this.__slideState = Object(l.cloneDeep)(QC), n2.mediaState)
|
|
36161
|
+
(r3 = n2.mediaState[i2]).type === "play" && (o3 = Math.max((e4 = r3.frozenTime) !== null && e4 !== void 0 ? e4 : 0, r3.time), r3.time = this.timestamp() - (o3 - r3.time), r3.frozenTime = void 0);
|
|
36162
|
+
return [4, this.setSlideState(n2)];
|
|
36196
36163
|
case 1:
|
|
36197
|
-
return
|
|
36164
|
+
return a2.sent(), [4, this.player.clock.delay(333)];
|
|
36198
36165
|
case 2:
|
|
36199
|
-
|
|
36166
|
+
a2.sent(), this.player.view && (this.player.view.style.visibility = "visible");
|
|
36200
36167
|
try {
|
|
36201
36168
|
this.frame.removeChild(this.cacheImage);
|
|
36202
36169
|
} catch (t5) {
|
|
@@ -36210,7 +36177,7 @@ void main(void){
|
|
|
36210
36177
|
this.playerController && this.playerController.destroy(), this.frameResizeObserver.disconnect(), (t4 = this.player) === null || t4 === void 0 || t4.removeAllListeners(), (e4 = this.player) === null || e4 === void 0 || e4.destroy(), (n2 = this.player) === null || n2 === void 0 || n2.removeAllListeners(), window.removeEventListener("__slide_log__", this.handleLogDownload), window.removeEventListener("__slide_state__", this.handleSlideStateLog), window.removeEventListener("__slide_ref__", this.handleSlideRef), window.clearInterval(this.persistLogId), YC && YC.removeItem(this.logId).catch(function() {
|
|
36211
36178
|
});
|
|
36212
36179
|
try {
|
|
36213
|
-
((i2 = this.player) === null || i2 === void 0 ? void 0 : i2.view) && this.anchor.removeChild(this.player.view);
|
|
36180
|
+
((i2 = this.player) === null || i2 === void 0 ? void 0 : i2.view) && this.anchor.removeChild(this.player.view), this.anchor.removeChild(this.frame);
|
|
36214
36181
|
} catch (t5) {
|
|
36215
36182
|
}
|
|
36216
36183
|
}, e3.disposeLocalCache = function() {
|
|
@@ -36218,6 +36185,15 @@ void main(void){
|
|
|
36218
36185
|
}, e3;
|
|
36219
36186
|
}(a.a);
|
|
36220
36187
|
}]);
|
|
36188
|
+
function clamp$1(value, min, max) {
|
|
36189
|
+
return Math.min(Math.max(value, min), max);
|
|
36190
|
+
}
|
|
36191
|
+
function isObj(obj) {
|
|
36192
|
+
return typeof obj === "object" && obj !== null;
|
|
36193
|
+
}
|
|
36194
|
+
function deepClone(obj) {
|
|
36195
|
+
return JSON.parse(JSON.stringify(obj));
|
|
36196
|
+
}
|
|
36221
36197
|
var colorString = { exports: {} };
|
|
36222
36198
|
var colorName = {
|
|
36223
36199
|
"aliceblue": [240, 248, 255],
|
|
@@ -36575,6 +36551,41 @@ function hexDouble(num) {
|
|
|
36575
36551
|
return str.length < 2 ? "0" + str : str;
|
|
36576
36552
|
}
|
|
36577
36553
|
var ColorString = colorString.exports;
|
|
36554
|
+
class Logger {
|
|
36555
|
+
constructor(enable) {
|
|
36556
|
+
this.enable = enable;
|
|
36557
|
+
this.apps = {};
|
|
36558
|
+
this.level = "debug";
|
|
36559
|
+
this._onMessage = (ev) => {
|
|
36560
|
+
if (isObj(ev.data)) {
|
|
36561
|
+
if (typeof ev.data.slide === "boolean") {
|
|
36562
|
+
this.enable = ev.data.slide;
|
|
36563
|
+
} else if (ev.data.slide === "__instance") {
|
|
36564
|
+
console.log(this);
|
|
36565
|
+
}
|
|
36566
|
+
}
|
|
36567
|
+
};
|
|
36568
|
+
window.addEventListener("message", this._onMessage);
|
|
36569
|
+
}
|
|
36570
|
+
log(...args) {
|
|
36571
|
+
if (this.enable) {
|
|
36572
|
+
console.log(...args);
|
|
36573
|
+
}
|
|
36574
|
+
}
|
|
36575
|
+
verbose(...args) {
|
|
36576
|
+
if (this.enable && this.level === "verbose") {
|
|
36577
|
+
console.log(...args);
|
|
36578
|
+
}
|
|
36579
|
+
}
|
|
36580
|
+
dispose(appId) {
|
|
36581
|
+
this.enable = false;
|
|
36582
|
+
delete this.apps[appId];
|
|
36583
|
+
window.removeEventListener("message", this._onMessage);
|
|
36584
|
+
}
|
|
36585
|
+
}
|
|
36586
|
+
const logger = new Logger(false);
|
|
36587
|
+
const log = logger.log.bind(logger);
|
|
36588
|
+
const verbose = logger.verbose.bind(logger);
|
|
36578
36589
|
function guessBgColor(el) {
|
|
36579
36590
|
try {
|
|
36580
36591
|
const bg = window.getComputedStyle(el).backgroundColor;
|
|
@@ -36671,29 +36682,21 @@ class SlideController {
|
|
|
36671
36682
|
payload: event
|
|
36672
36683
|
};
|
|
36673
36684
|
log("[Slide] dispatch", event);
|
|
36674
|
-
this.
|
|
36685
|
+
this.context.dispatchMagixEvent(Slide.SLIDE_EVENTS.syncDispatch, payload);
|
|
36675
36686
|
}
|
|
36676
36687
|
};
|
|
36677
36688
|
this.magixEventListener = (ev) => {
|
|
36678
|
-
|
|
36679
|
-
|
|
36680
|
-
|
|
36681
|
-
|
|
36682
|
-
|
|
36683
|
-
this.slide.emit(Slide.SLIDE_EVENTS.syncReceive, payload);
|
|
36684
|
-
}
|
|
36689
|
+
const { type, payload } = ev.payload;
|
|
36690
|
+
if (type === Slide.SLIDE_EVENTS.syncDispatch) {
|
|
36691
|
+
this.syncStateOnce();
|
|
36692
|
+
log("[Slide] receive", payload);
|
|
36693
|
+
this.slide.emit(Slide.SLIDE_EVENTS.syncReceive, payload);
|
|
36685
36694
|
}
|
|
36686
36695
|
};
|
|
36687
36696
|
this.onStateChange = (state) => {
|
|
36688
36697
|
if (this.context.getIsWritable()) {
|
|
36689
36698
|
verbose("[Slide] state change", JSON.stringify(state, null, 2));
|
|
36690
|
-
this.context.
|
|
36691
|
-
}
|
|
36692
|
-
};
|
|
36693
|
-
this.onSeeked = () => {
|
|
36694
|
-
const state = this.context.getAttributes().state;
|
|
36695
|
-
if (state) {
|
|
36696
|
-
this.slide.setSlideState(deepClone(state));
|
|
36699
|
+
this.context.storage.setState({ state });
|
|
36697
36700
|
}
|
|
36698
36701
|
};
|
|
36699
36702
|
this.pollCount = 0;
|
|
@@ -36758,7 +36761,6 @@ class SlideController {
|
|
|
36758
36761
|
this.onTransitionEnd = onTransitionEnd;
|
|
36759
36762
|
this.onError = onError;
|
|
36760
36763
|
this.context = context;
|
|
36761
|
-
this.channel = `channel-${context.appId}`;
|
|
36762
36764
|
this.room = context.getRoom();
|
|
36763
36765
|
this.player = this.room ? void 0 : context.getDisplayer();
|
|
36764
36766
|
this.slide = this.createSlide(anchor);
|
|
@@ -36798,17 +36800,9 @@ class SlideController {
|
|
|
36798
36800
|
});
|
|
36799
36801
|
return disposer;
|
|
36800
36802
|
});
|
|
36801
|
-
this.sideEffect.add(() => {
|
|
36802
|
-
|
|
36803
|
-
|
|
36804
|
-
});
|
|
36805
|
-
this.sideEffect.add(() => {
|
|
36806
|
-
const displayer = context.getDisplayer();
|
|
36807
|
-
displayer.addMagixEventListener(this.channel, this.magixEventListener, {
|
|
36808
|
-
fireSelfEventAfterCommit: true
|
|
36809
|
-
});
|
|
36810
|
-
return () => displayer.removeMagixEventListener(this.channel);
|
|
36811
|
-
});
|
|
36803
|
+
this.sideEffect.add(() => context.addMagixEventListener(Slide.SLIDE_EVENTS.syncDispatch, this.magixEventListener, {
|
|
36804
|
+
fireSelfEventAfterCommit: true
|
|
36805
|
+
}));
|
|
36812
36806
|
slide.on(Slide.SLIDE_EVENTS.slideChange, this.onPageChanged);
|
|
36813
36807
|
slide.on(Slide.SLIDE_EVENTS.renderStart, this.onTransitionStart);
|
|
36814
36808
|
slide.on(Slide.SLIDE_EVENTS.renderEnd, this.onTransitionEnd);
|
|
@@ -36821,7 +36815,7 @@ class SlideController {
|
|
|
36821
36815
|
}
|
|
36822
36816
|
syncStateOnce() {
|
|
36823
36817
|
if (this.syncStateOnceFlag) {
|
|
36824
|
-
const { state } = __spreadValues(__spreadValues({}, EmptyAttributes), this.context.
|
|
36818
|
+
const { state } = __spreadValues(__spreadValues({}, EmptyAttributes), this.context.storage.state);
|
|
36825
36819
|
if (state) {
|
|
36826
36820
|
log("[Slide] sync with state (once)", deepClone(state));
|
|
36827
36821
|
this.slide.setSlideState(deepClone(state));
|
|
@@ -37794,6 +37788,9 @@ class DocsViewer {
|
|
|
37794
37788
|
$pageNumberInput.disabled = true;
|
|
37795
37789
|
}
|
|
37796
37790
|
this.$pageNumberInput = $pageNumberInput;
|
|
37791
|
+
this.sideEffect.addEventListener($pageNumberInput, "focus", () => {
|
|
37792
|
+
$pageNumberInput.select();
|
|
37793
|
+
});
|
|
37797
37794
|
this.sideEffect.addEventListener($pageNumberInput, "change", () => {
|
|
37798
37795
|
if (this.readonly) {
|
|
37799
37796
|
return;
|
|
@@ -37836,7 +37833,7 @@ class DocsViewer {
|
|
|
37836
37833
|
return `${this.namespace}-${className}`;
|
|
37837
37834
|
}
|
|
37838
37835
|
}
|
|
37839
|
-
const ClickThroughAppliances = new Set(["clicker"]);
|
|
37836
|
+
const ClickThroughAppliances = /* @__PURE__ */ new Set(["clicker"]);
|
|
37840
37837
|
class SlideDocsViewer {
|
|
37841
37838
|
constructor({ box, view, mountSlideController, mountWhiteboard }) {
|
|
37842
37839
|
this.slideController = null;
|
|
@@ -37980,7 +37977,56 @@ class SlideDocsViewer {
|
|
|
37980
37977
|
return `${this.namespace}-${className}`;
|
|
37981
37978
|
}
|
|
37982
37979
|
}
|
|
37983
|
-
|
|
37980
|
+
let useFreezer = false;
|
|
37981
|
+
const FreezerLength = 2;
|
|
37982
|
+
const apps = {
|
|
37983
|
+
map: /* @__PURE__ */ new Map(),
|
|
37984
|
+
queue: [],
|
|
37985
|
+
validateQueue() {
|
|
37986
|
+
log("[Slide] freezer: validate", this.queue);
|
|
37987
|
+
while (this.queue.length > FreezerLength) {
|
|
37988
|
+
const appId = this.queue.pop();
|
|
37989
|
+
const slide = this.map.get(appId);
|
|
37990
|
+
if (slide) {
|
|
37991
|
+
log("[Slide] freezer: validate-freeze", appId, this.queue);
|
|
37992
|
+
slide.freeze();
|
|
37993
|
+
}
|
|
37994
|
+
}
|
|
37995
|
+
},
|
|
37996
|
+
set(appId, slide) {
|
|
37997
|
+
log("[Slide] freezer: add", appId, this.queue);
|
|
37998
|
+
this.map.set(appId, slide);
|
|
37999
|
+
if (!this.queue.includes(appId)) {
|
|
38000
|
+
this.queue.unshift(appId);
|
|
38001
|
+
}
|
|
38002
|
+
this.validateQueue();
|
|
38003
|
+
},
|
|
38004
|
+
delete(appId) {
|
|
38005
|
+
log("[Slide] freezer: delete", appId, this.queue);
|
|
38006
|
+
this.map.delete(appId);
|
|
38007
|
+
this.queue = this.queue.filter((id) => id !== appId);
|
|
38008
|
+
},
|
|
38009
|
+
focus(appId) {
|
|
38010
|
+
const slide = this.map.get(appId);
|
|
38011
|
+
const index = this.queue.indexOf(appId);
|
|
38012
|
+
if (index > -1) {
|
|
38013
|
+
this.queue.splice(index, 1);
|
|
38014
|
+
}
|
|
38015
|
+
this.queue.unshift(appId);
|
|
38016
|
+
this.validateQueue();
|
|
38017
|
+
log("[Slide] freezer: focus", appId, this.queue);
|
|
38018
|
+
if (slide) {
|
|
38019
|
+
slide.unfreeze();
|
|
38020
|
+
}
|
|
38021
|
+
}
|
|
38022
|
+
};
|
|
38023
|
+
const addHooks = (emitter) => {
|
|
38024
|
+
useFreezer = true;
|
|
38025
|
+
emitter.on("focus", ({ appId }) => {
|
|
38026
|
+
apps.focus(appId);
|
|
38027
|
+
});
|
|
38028
|
+
};
|
|
38029
|
+
var styles = ".netless-app-slide-content{position:relative;height:100%;overflow:hidden}.netless-app-slide-preview-mask{display:none;position:absolute;z-index:200;top:0;left:0;width:100%;height:100%}.netless-app-slide-preview{display:flex;flex-direction:column;align-items:center;position:absolute;z-index:300;top:0;left:0;width:33%;max-width:200px;height:100%;padding-top:10px;transform:translate(-100%);background:rgba(237,237,240,.9);box-shadow:inset -1px 0 #0000001c;transition:transform .4s}.netless-app-slide-preview-active .netless-app-slide-preview-mask{display:block}.netless-app-slide-preview-active .netless-app-slide-preview{transform:translate(0)}.netless-app-slide-preview-page{position:relative;display:block;width:55%;margin-bottom:10px;font-size:0;color:transparent;outline:none;border:7px solid transparent;border-radius:4px;transition:border-color .3s;user-select:none}.netless-app-slide-preview-page:hover,.netless-app-slide-preview-page.netless-app-slide-preview-page-active{border-color:#444e601a}.netless-app-slide-preview-page>img{width:100%;height:auto;box-sizing:border-box;border:1px solid rgba(0,0,0,.5);border-radius:1px;background-color:#fff;box-shadow:0 2px 8px #0000004d}.netless-app-slide-preview-page-name{position:absolute;top:1px;left:-10px;transform:translate(-100%);text-align:right;font-size:12px;color:#5f5f5f;user-select:none}.netless-app-slide-footer{box-sizing:border-box;height:26px;display:flex;align-items:center;padding:0 16px;border-top:1px solid #eeeef7;color:#191919}.netless-app-slide-float-footer{width:100%;min-height:26px;position:absolute;left:0;bottom:0;z-index:2000;background:rgba(249,249,252,.9);transition:opacity .4s}.netless-app-slide-footer-btn{box-sizing:border-box;width:26px;height:26px;font-size:0;margin:0;padding:3px;border:none;border-radius:1px;outline:none;color:currentColor;background:transparent;transition:background .4s;cursor:pointer;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-slide-footer-btn:hover{background:rgba(237,237,240,.9)}@media (hover: none){.netless-app-slide-footer-btn:hover{background:transparent!important}}.netless-app-slide-footer-btn>svg{width:100%;height:100%}.netless-app-slide-footer-btn>svg:nth-of-type(2){display:none}.netless-app-slide-footer-btn.netless-app-slide-footer-btn-playing>svg:nth-of-type(1){display:none}.netless-app-slide-footer-btn.netless-app-slide-footer-btn-playing>svg:nth-of-type(2){display:initial}.netless-app-slide-footer-btn~.netless-app-slide-footer-btn{margin-left:15px}.netless-app-slide-page-jumps{flex:1;display:flex;justify-content:center;align-items:center}.netless-app-slide-page-number{margin-left:auto;font-size:13px;user-select:none;white-space:nowrap;word-break:keep-all}.netless-app-slide-page-number-input{border:none;outline:none;width:3em;margin:0;padding:0 2px;text-align:right;font-size:13px;line-height:1;font-weight:400;font-family:inherit;border-radius:2px;color:currentColor;background:transparent;transition:background .4s;user-select:text;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-slide-page-number-input:hover,.netless-app-slide-page-number-input:focus,.netless-app-slide-page-number-input:active{background:#fff;box-shadow:#63636333 0 2px 8px}.netless-app-slide-readonly.netless-app-slide-footer{display:none}.telebox-color-scheme-dark .netless-app-slide-page-number-input{color:#a6a6a8}.telebox-color-scheme-dark .netless-app-slide-page-number-input:active,.telebox-color-scheme-dark .netless-app-slide-page-number-input:focus,.telebox-color-scheme-dark .netless-app-slide-page-number-input:hover{color:#222}.telebox-color-scheme-dark .netless-app-slide-footer{color:#a6a6a8;background:#2d2d33;border-top:none}.telebox-color-scheme-dark .netless-app-slide-footer-btn:hover{background:#212126}.telebox-color-scheme-dark .netless-app-slide-preview{background:rgba(50,50,50,.9)}.netless-app-slide-wb-view{position:absolute;top:0;left:0;width:100%;height:100%;z-index:100;overflow:hidden}.netless-app-slide-slide{width:100%;height:100%;display:flex;align-items:center;justify-content:center}.netless-app-slide-slide canvas{transform:scale(var(--netless-app-slide-scale, 1))}\n";
|
|
37984
38030
|
function previewSlide({
|
|
37985
38031
|
container,
|
|
37986
38032
|
taskId,
|
|
@@ -38137,16 +38183,15 @@ class SlidePreviewer {
|
|
|
38137
38183
|
return `${this.namespace}-${className}`;
|
|
38138
38184
|
}
|
|
38139
38185
|
}
|
|
38140
|
-
const version = "0.0.
|
|
38186
|
+
const version = "0.0.58";
|
|
38141
38187
|
const SlideApp = {
|
|
38142
38188
|
kind: "Slide",
|
|
38143
38189
|
setup(context) {
|
|
38144
38190
|
console.log("[Slide] setup @ " + version);
|
|
38145
38191
|
if (context.getIsWritable()) {
|
|
38146
|
-
|
|
38192
|
+
context.storage.ensureState(EmptyAttributes);
|
|
38147
38193
|
}
|
|
38148
|
-
|
|
38149
|
-
if (!(attributes == null ? void 0 : attributes.taskId)) {
|
|
38194
|
+
if (!context.storage.state.taskId) {
|
|
38150
38195
|
throw new Error("[Slide] no taskId");
|
|
38151
38196
|
}
|
|
38152
38197
|
const view = context.getView();
|
|
@@ -38184,7 +38229,15 @@ const SlideApp = {
|
|
|
38184
38229
|
if (useFreezer)
|
|
38185
38230
|
apps.set(context.appId, slideController);
|
|
38186
38231
|
((_a = logger.apps)[_b = context.appId] || (_a[_b] = {})).controller = slideController;
|
|
38187
|
-
slideController.readyPromise.then(options.onReady)
|
|
38232
|
+
slideController.readyPromise.then(options.onReady).then(() => {
|
|
38233
|
+
const room2 = context.getRoom();
|
|
38234
|
+
let synced = false;
|
|
38235
|
+
if (room2 && context.getIsWritable()) {
|
|
38236
|
+
syncSceneWithSlide(room2, context, slideController.slide, baseScenePath);
|
|
38237
|
+
synced = true;
|
|
38238
|
+
}
|
|
38239
|
+
log("[Slide] page to", slideController.slide.slideState.currentSlideIndex, synced);
|
|
38240
|
+
});
|
|
38188
38241
|
return slideController;
|
|
38189
38242
|
};
|
|
38190
38243
|
docsViewer = new SlideDocsViewer({
|
|
@@ -38225,6 +38278,56 @@ const SlideApp = {
|
|
|
38225
38278
|
}
|
|
38226
38279
|
});
|
|
38227
38280
|
docsViewer.mount();
|
|
38281
|
+
return {
|
|
38282
|
+
slide: () => {
|
|
38283
|
+
var _a;
|
|
38284
|
+
return (_a = docsViewer == null ? void 0 : docsViewer.slideController) == null ? void 0 : _a.slide;
|
|
38285
|
+
},
|
|
38286
|
+
nextStep: () => {
|
|
38287
|
+
var _a;
|
|
38288
|
+
if (docsViewer && docsViewer.slideController) {
|
|
38289
|
+
(_a = docsViewer == null ? void 0 : docsViewer.slideController) == null ? void 0 : _a.slide.nextStep();
|
|
38290
|
+
return true;
|
|
38291
|
+
}
|
|
38292
|
+
return false;
|
|
38293
|
+
},
|
|
38294
|
+
prevStep: () => {
|
|
38295
|
+
var _a;
|
|
38296
|
+
if (docsViewer && docsViewer.slideController) {
|
|
38297
|
+
(_a = docsViewer == null ? void 0 : docsViewer.slideController) == null ? void 0 : _a.slide.prevStep();
|
|
38298
|
+
return true;
|
|
38299
|
+
}
|
|
38300
|
+
return false;
|
|
38301
|
+
},
|
|
38302
|
+
position: () => {
|
|
38303
|
+
const controller = docsViewer == null ? void 0 : docsViewer.slideController;
|
|
38304
|
+
if (controller) {
|
|
38305
|
+
return [controller.page, controller.pageCount];
|
|
38306
|
+
}
|
|
38307
|
+
},
|
|
38308
|
+
nextPage: () => {
|
|
38309
|
+
const controller = docsViewer == null ? void 0 : docsViewer.slideController;
|
|
38310
|
+
if (controller) {
|
|
38311
|
+
const { page, pageCount } = controller;
|
|
38312
|
+
if (pageCount > 0 && page < pageCount) {
|
|
38313
|
+
controller.jumpToPage(page + 1);
|
|
38314
|
+
return true;
|
|
38315
|
+
}
|
|
38316
|
+
}
|
|
38317
|
+
return false;
|
|
38318
|
+
},
|
|
38319
|
+
prevPage: () => {
|
|
38320
|
+
const controller = docsViewer == null ? void 0 : docsViewer.slideController;
|
|
38321
|
+
if (controller) {
|
|
38322
|
+
const { page, pageCount } = controller;
|
|
38323
|
+
if (pageCount > 0 && page > 1) {
|
|
38324
|
+
controller.jumpToPage(page - 1);
|
|
38325
|
+
return true;
|
|
38326
|
+
}
|
|
38327
|
+
}
|
|
38328
|
+
return false;
|
|
38329
|
+
}
|
|
38330
|
+
};
|
|
38228
38331
|
}
|
|
38229
38332
|
};
|
|
38230
38333
|
export { DefaultUrl, FreezerLength, SlidePreviewer, addHooks, apps, SlideApp as default, previewSlide, version };
|