@netless/app-slide 0.0.54 → 0.0.57
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 +114 -118
- package/dist/main.cjs.js.map +1 -1
- package/dist/main.es.js +472 -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 +16 -31
- package/src/SlidePreviewer/index.ts +1 -0
- 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 {
|
|
@@ -30764,6 +30653,9 @@ void main() {
|
|
|
30764
30653
|
set on(t3) {
|
|
30765
30654
|
this.target.fillActive = t3 === "true";
|
|
30766
30655
|
}
|
|
30656
|
+
get designColor() {
|
|
30657
|
+
return this.target.fillColorFilter.designColor;
|
|
30658
|
+
}
|
|
30767
30659
|
}
|
|
30768
30660
|
class wM {
|
|
30769
30661
|
constructor(t3, e3) {
|
|
@@ -30817,7 +30709,7 @@ void main() {
|
|
|
30817
30709
|
}
|
|
30818
30710
|
execAction(t3) {
|
|
30819
30711
|
var e3;
|
|
30820
|
-
if (t3.action === "ppaction://hlinksldjump") {
|
|
30712
|
+
if (this.ctx.eventHub.emit(zR.userInput), t3.action === "ppaction://hlinksldjump") {
|
|
30821
30713
|
const n2 = ((e3 = t3 == null ? void 0 : t3.target) !== null && e3 !== void 0 ? e3 : "").match(/slide(\d+)\.xml/);
|
|
30822
30714
|
n2 && n2[1] && this.ctx.eventHub.emit(zR.requestGotoSlide, Number(n2[1]));
|
|
30823
30715
|
} else if (t3.action === "ppaction://hlinkshowjump?jump=nextslide")
|
|
@@ -30838,7 +30730,29 @@ void main() {
|
|
|
30838
30730
|
class SM {
|
|
30839
30731
|
constructor(t3, e3, n2) {
|
|
30840
30732
|
var i2, r3, o3, s3, a2, l2;
|
|
30841
|
-
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")))
|
|
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
|
+
}
|
|
30755
|
+
});
|
|
30842
30756
|
}
|
|
30843
30757
|
updateScale() {
|
|
30844
30758
|
this.container && (this.container.scale.x = this.designScale.x * this.scaleExt.x * this.scaleOrigin.x, this.container.scale.y = this.designScale.y * this.scaleExt.y * this.scaleOrigin.y);
|
|
@@ -30875,15 +30789,14 @@ void main() {
|
|
|
30875
30789
|
return this.scaleExt.x * this.scaleOrigin.x * this.designWidth / this.ctx.stageWidth;
|
|
30876
30790
|
}
|
|
30877
30791
|
set ppt_w(t3) {
|
|
30878
|
-
this.scaleExt.x = t3 * this.ctx.stageWidth / this.designWidth, this.updateScale();
|
|
30792
|
+
this.designWidth && (this.scaleExt.x = t3 * this.ctx.stageWidth / this.designWidth, this.updateScale());
|
|
30879
30793
|
}
|
|
30880
30794
|
get ppt_h() {
|
|
30881
30795
|
const t3 = this.designHeight || this.container.height;
|
|
30882
30796
|
return this.scaleExt.y * this.scaleOrigin.y * t3 / this.ctx.stageHeight;
|
|
30883
30797
|
}
|
|
30884
30798
|
set ppt_h(t3) {
|
|
30885
|
-
|
|
30886
|
-
this.scaleExt.y = t3 * this.ctx.stageHeight / e3, this.updateScale();
|
|
30799
|
+
this.designHeight && (this.scaleExt.y = t3 * this.ctx.stageHeight / this.designHeight, this.updateScale());
|
|
30887
30800
|
}
|
|
30888
30801
|
get ppt_x() {
|
|
30889
30802
|
return (this.container.position.x - this.container.pivot.x) / this.ctx.stageWidth;
|
|
@@ -30907,6 +30820,18 @@ void main() {
|
|
|
30907
30820
|
set r(t3) {
|
|
30908
30821
|
this.container.rotation = t3;
|
|
30909
30822
|
}
|
|
30823
|
+
set xshear(t3) {
|
|
30824
|
+
this.container.skew.x = t3;
|
|
30825
|
+
}
|
|
30826
|
+
get xshear() {
|
|
30827
|
+
return this.container.skew.x;
|
|
30828
|
+
}
|
|
30829
|
+
set yshear(t3) {
|
|
30830
|
+
this.container.skew.y = t3;
|
|
30831
|
+
}
|
|
30832
|
+
get yshear() {
|
|
30833
|
+
return this.container.skew.y;
|
|
30834
|
+
}
|
|
30910
30835
|
}
|
|
30911
30836
|
class EM {
|
|
30912
30837
|
constructor(t3) {
|
|
@@ -30980,7 +30905,7 @@ void main() {
|
|
|
30980
30905
|
}
|
|
30981
30906
|
class IM extends Gx {
|
|
30982
30907
|
constructor() {
|
|
30983
|
-
super(void 0, "\nvarying vec2 vTextureCoord;\n\nuniform vec4 color;\nuniform sampler2D uSampler;\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n\n if (texColor.a > 0.0) {\n vec4 resultColor = color;\n resultColor = resultColor * texColor.a;\n gl_FragColor = resultColor;\n } else {\n gl_FragColor = texColor;\n }\n}\n", { color: new Float32Array([0, 0, 0, 0]), active: 0 }), this.currentColor = "#FFFFFFFF";
|
|
30908
|
+
super(void 0, "\nvarying vec2 vTextureCoord;\n\nuniform vec4 color;\nuniform sampler2D uSampler;\n\nvoid main(void){\n vec4 texColor = texture2D(uSampler, vTextureCoord);\n\n if (texColor.a > 0.0) {\n vec4 resultColor = color;\n resultColor = resultColor * texColor.a;\n gl_FragColor = resultColor;\n } else {\n gl_FragColor = texColor;\n }\n}\n", { color: new Float32Array([0, 0, 0, 0]), active: 0 }), this.currentColor = "#FFFFFFFF", this.designColor = "#FFFFFFFF";
|
|
30984
30909
|
}
|
|
30985
30910
|
set color(t3) {
|
|
30986
30911
|
this.currentColor = t3;
|
|
@@ -31020,6 +30945,8 @@ void main() {
|
|
|
31020
30945
|
}
|
|
31021
30946
|
clearOnSlideChange() {
|
|
31022
30947
|
}
|
|
30948
|
+
initOnReuse() {
|
|
30949
|
+
}
|
|
31023
30950
|
getTextElement() {
|
|
31024
30951
|
return null;
|
|
31025
30952
|
}
|
|
@@ -31048,28 +30975,33 @@ void main() {
|
|
|
31048
30975
|
}
|
|
31049
30976
|
}
|
|
31050
30977
|
class UM {
|
|
31051
|
-
constructor(t3, e3, n2, i2, r3, o3, s3, a2, l2) {
|
|
31052
|
-
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`;
|
|
31053
30980
|
}
|
|
31054
30981
|
createPaths() {
|
|
31055
30982
|
if (this.type === "ww")
|
|
31056
30983
|
return null;
|
|
31057
30984
|
{
|
|
31058
|
-
|
|
31059
|
-
|
|
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 };
|
|
31060
30988
|
}
|
|
31061
30989
|
}
|
|
30990
|
+
getLineStyle() {
|
|
30991
|
+
const t3 = { width: this.lineWidth };
|
|
30992
|
+
return this.type === "dotted" && (t3.dash = "" + this.lineWidth), t3;
|
|
30993
|
+
}
|
|
31062
30994
|
preRender() {
|
|
31063
30995
|
const t3 = this.createPaths();
|
|
31064
30996
|
if (t3) {
|
|
31065
30997
|
const { paths: e3, width: n2, height: i2 } = t3, r3 = e3.reduce((t4, e4) => t4 + e4.hash, "");
|
|
31066
|
-
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);
|
|
31067
30999
|
}
|
|
31068
31000
|
}
|
|
31069
31001
|
render() {
|
|
31070
31002
|
if (this.ghcTextureId) {
|
|
31071
31003
|
const t3 = this.ctx.graphicsTexture.getGraphicsData(this.ghcTextureId);
|
|
31072
|
-
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);
|
|
31073
31005
|
}
|
|
31074
31006
|
}
|
|
31075
31007
|
destroy() {
|
|
@@ -31459,7 +31391,7 @@ void main(void){
|
|
|
31459
31391
|
`), { arg: e3 });
|
|
31460
31392
|
}
|
|
31461
31393
|
}
|
|
31462
|
-
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" };
|
|
31463
31395
|
class pA extends Gx {
|
|
31464
31396
|
constructor(t3, e3, n2) {
|
|
31465
31397
|
var i2;
|
|
@@ -31505,10 +31437,10 @@ void main(void){
|
|
|
31505
31437
|
}
|
|
31506
31438
|
class vA {
|
|
31507
31439
|
constructor(t3, e3, n2, i2, r3) {
|
|
31508
|
-
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;
|
|
31509
31441
|
}
|
|
31510
31442
|
get displayObject() {
|
|
31511
|
-
return this._displayObject;
|
|
31443
|
+
return this._displayObject || (this._displayObject = this.createDisplayObject()), this._displayObject;
|
|
31512
31444
|
}
|
|
31513
31445
|
set displayObject(t3) {
|
|
31514
31446
|
this._displayObject && this._displayObject.destroy({ children: true, texture: true }), this._displayObject = t3;
|
|
@@ -31603,8 +31535,12 @@ void main(void){
|
|
|
31603
31535
|
constructor(t3, e3, n2) {
|
|
31604
31536
|
var i2;
|
|
31605
31537
|
super(t3, e3, n2), this.textureContainer = new ty(), this.underline = null, this.cacheSprite = new OT();
|
|
31606
|
-
const { shapeId: r3, paragraphIndex: o3, lineIndex: s3, unitIndex: a2, lineHeight: l2, width: u2, underLine: h2, fill: c2 } = t3,
|
|
31607
|
-
|
|
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();
|
|
31608
31544
|
}
|
|
31609
31545
|
createStrokeFill() {
|
|
31610
31546
|
const { stroke: t3, lineWidth: e3, lineHeight: n2 } = this.json;
|
|
@@ -31619,8 +31555,12 @@ void main(void){
|
|
|
31619
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 });
|
|
31620
31556
|
}
|
|
31621
31557
|
createTextGraphics() {
|
|
31622
|
-
|
|
31623
|
-
|
|
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 });
|
|
31624
31564
|
}
|
|
31625
31565
|
getIterateEntry() {
|
|
31626
31566
|
return null;
|
|
@@ -31652,7 +31592,7 @@ void main(void){
|
|
|
31652
31592
|
}
|
|
31653
31593
|
if (this.textGraphics.displayObject) {
|
|
31654
31594
|
const e4 = this.textGraphics.displayObject;
|
|
31655
|
-
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) {
|
|
31656
31596
|
const n3 = this.textFill.displayObject;
|
|
31657
31597
|
if (n3)
|
|
31658
31598
|
n3.mask = e4, n3.addChild(e4), n3.position.x = -u2, e4.position.x += u2, t3 = true, this.textureContainer.addChild(n3);
|
|
@@ -31678,7 +31618,7 @@ void main(void){
|
|
|
31678
31618
|
r3 ? e4.position.y = h2 > 0 ? h2 : 0 : e4.position.x = u2, this.textureContainer.addChild(e4);
|
|
31679
31619
|
}
|
|
31680
31620
|
if (this.underline && (this.underline.render(), this.underline.sprite)) {
|
|
31681
|
-
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));
|
|
31682
31622
|
const t4 = this.textFill.getClonedDisplayObject();
|
|
31683
31623
|
t4 ? (t4.mask = this.underline.sprite, t4.addChild(this.underline.sprite), this.textureContainer.addChild(t4)) : this.textureContainer.addChild(this.underline.sprite);
|
|
31684
31624
|
}
|
|
@@ -31997,6 +31937,11 @@ void main(void){
|
|
|
31997
31937
|
}
|
|
31998
31938
|
if (n2.join("") !== "MLLLC")
|
|
31999
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
|
+
}
|
|
32000
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;
|
|
32001
31946
|
if (Number.isNaN(r3) || Number.isNaN(o3))
|
|
32002
31947
|
return false;
|
|
@@ -32071,7 +32016,7 @@ void main(void){
|
|
|
32071
32016
|
});
|
|
32072
32017
|
}, this.json = t3, this.json.fillStyle && this.json.fillStyle.fillType === "groupFill" && i2 && (this.json.fillStyle = i2), this.id = t3.id;
|
|
32073
32018
|
const { fillStyle: o3, lineStyle: s3 } = this.json;
|
|
32074
|
-
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), ((r3 = s3 == null ? void 0 : s3.fill) === null || r3 === void 0 ? void 0 : r3.fillType) === "solidFill" && (this.strokeColorFilter.currentColor = 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);
|
|
32075
32020
|
}
|
|
32076
32021
|
get interactiveContainer() {
|
|
32077
32022
|
return this.renderContainer;
|
|
@@ -32101,7 +32046,7 @@ void main(void){
|
|
|
32101
32046
|
return this;
|
|
32102
32047
|
}
|
|
32103
32048
|
getIterateEntry(t3, e3, n2) {
|
|
32104
|
-
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);
|
|
32105
32050
|
}
|
|
32106
32051
|
createStrokeGraphics() {
|
|
32107
32052
|
var t3, e3, n2, i2;
|
|
@@ -32109,8 +32054,8 @@ void main(void){
|
|
|
32109
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;
|
|
32110
32055
|
}
|
|
32111
32056
|
createStrokeFill() {
|
|
32112
|
-
const { geometry:
|
|
32113
|
-
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 });
|
|
32114
32059
|
}
|
|
32115
32060
|
createBackgroundGraphics() {
|
|
32116
32061
|
var t3;
|
|
@@ -32123,14 +32068,14 @@ void main(void){
|
|
|
32123
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 });
|
|
32124
32069
|
}
|
|
32125
32070
|
createBackground() {
|
|
32126
|
-
var t3, e3, n2, i2, r3, o3, s3;
|
|
32127
|
-
const { pivot:
|
|
32128
|
-
|
|
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);
|
|
32129
32074
|
}
|
|
32130
32075
|
createPathFill() {
|
|
32131
32076
|
var t3, e3, n2;
|
|
32132
|
-
const { displayObject: i2 } = this.strokeFill, r3 = (t3 = this.strokeGraphics) === null || t3 === void 0 ? void 0 : t3.displayObject;
|
|
32133
|
-
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);
|
|
32134
32079
|
}
|
|
32135
32080
|
createFilledPathMask() {
|
|
32136
32081
|
var t3, e3, n2;
|
|
@@ -32146,27 +32091,38 @@ void main(void){
|
|
|
32146
32091
|
}
|
|
32147
32092
|
}
|
|
32148
32093
|
createArrow() {
|
|
32149
|
-
this.arrowList.
|
|
32150
|
-
|
|
32151
|
-
|
|
32152
|
-
|
|
32153
|
-
|
|
32154
|
-
|
|
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);
|
|
32155
32114
|
});
|
|
32156
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
|
+
}
|
|
32157
32120
|
preRender(t3) {
|
|
32158
32121
|
var e3, n2, i2;
|
|
32159
|
-
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;
|
|
32160
32123
|
t3.addSubMTask(() => LA(this, void 0, void 0, function* () {
|
|
32161
|
-
for (const t4 of
|
|
32162
|
-
this.ctx.graphicsTexture.addGraphics(t4.id, [t4], t4.hash, ((
|
|
32163
|
-
})), t3.addSubMTask(() => LA(this, void 0, void 0, function* () {
|
|
32164
|
-
var t4;
|
|
32165
|
-
(t4 = r3 || []) === null || t4 === void 0 || t4.forEach((t5, e4) => {
|
|
32166
|
-
var n3, i3;
|
|
32167
|
-
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 }));
|
|
32168
|
-
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);
|
|
32169
|
-
});
|
|
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);
|
|
32170
32126
|
})), (i2 = this.text) === null || i2 === void 0 || i2.createParagraphs(this.json.id, t3);
|
|
32171
32127
|
}
|
|
32172
32128
|
subClassRender() {
|
|
@@ -32201,7 +32157,7 @@ void main(void){
|
|
|
32201
32157
|
}
|
|
32202
32158
|
this.renderContainer.addChild(this.container);
|
|
32203
32159
|
}
|
|
32204
|
-
if (this.needCacheAsBitMap
|
|
32160
|
+
if (this.needCacheAsBitMap, this.json.id === "background" && this.ctx.hasBackgroundFillShape) {
|
|
32205
32161
|
const t5 = Hy.create({ width: this.json.width, height: this.json.height, resolution: Math.ceil(this.ctx.renderer.resolution) });
|
|
32206
32162
|
this.ctx.renderer.render(this.renderContainer, { renderTexture: t5 }), this.ctx.bgTexture = t5;
|
|
32207
32163
|
}
|
|
@@ -32209,9 +32165,11 @@ void main(void){
|
|
|
32209
32165
|
}
|
|
32210
32166
|
clearOnSlideChange() {
|
|
32211
32167
|
}
|
|
32168
|
+
initOnReuse() {
|
|
32169
|
+
}
|
|
32212
32170
|
destroy() {
|
|
32213
|
-
var t3, e3, n2;
|
|
32214
|
-
(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 = [];
|
|
32215
32173
|
}
|
|
32216
32174
|
}
|
|
32217
32175
|
var FA = function(t3, e3, n2, i2) {
|
|
@@ -32317,8 +32275,8 @@ void main(void){
|
|
|
32317
32275
|
}
|
|
32318
32276
|
setControllerPosition() {
|
|
32319
32277
|
var t3;
|
|
32320
|
-
const { target: e3 } = this, { stageWidth: n2, stageHeight: i2 } = this.ctx, r3 = e3.getGlobalPosition(), o3 =
|
|
32321
|
-
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%" });
|
|
32322
32280
|
}
|
|
32323
32281
|
createMediaController() {
|
|
32324
32282
|
this.setControllerPosition(), this.createButton();
|
|
@@ -32532,7 +32490,7 @@ void main(void){
|
|
|
32532
32490
|
}
|
|
32533
32491
|
class jA extends DA {
|
|
32534
32492
|
constructor(t3, e3, n2, i2) {
|
|
32535
|
-
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 });
|
|
32536
32494
|
}
|
|
32537
32495
|
applyCommand(t3, e3) {
|
|
32538
32496
|
var n2, i2, r3, o3, s3;
|
|
@@ -32551,9 +32509,11 @@ void main(void){
|
|
|
32551
32509
|
const { displayObject: o3 } = this.picFill;
|
|
32552
32510
|
if (o3) {
|
|
32553
32511
|
const s3 = (t3 = this.backgroundGraphics) === null || t3 === void 0 ? void 0 : t3.getClonedDisplayObject();
|
|
32554
|
-
((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", () => {
|
|
32555
32515
|
this.mediaPlayer.showController();
|
|
32556
|
-
}),
|
|
32516
|
+
}), this.container.on("mouseout", () => {
|
|
32557
32517
|
this.mediaPlayer.hideController();
|
|
32558
32518
|
}, false));
|
|
32559
32519
|
}
|
|
@@ -32565,10 +32525,13 @@ void main(void){
|
|
|
32565
32525
|
this.renderPic();
|
|
32566
32526
|
}
|
|
32567
32527
|
clearOnSlideChange() {
|
|
32568
|
-
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);
|
|
32569
32532
|
}
|
|
32570
32533
|
destroy() {
|
|
32571
|
-
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();
|
|
32572
32535
|
}
|
|
32573
32536
|
}
|
|
32574
32537
|
var VA = function(t3, e3, n2, i2) {
|
|
@@ -32642,6 +32605,9 @@ void main(void){
|
|
|
32642
32605
|
clearOnSlideChange() {
|
|
32643
32606
|
this.children.forEach((t3) => t3.clearOnSlideChange());
|
|
32644
32607
|
}
|
|
32608
|
+
initOnReuse() {
|
|
32609
|
+
this.children.forEach((t3) => t3.initOnReuse());
|
|
32610
|
+
}
|
|
32645
32611
|
destroy() {
|
|
32646
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 });
|
|
32647
32613
|
}
|
|
@@ -32768,6 +32734,7 @@ void main(void){
|
|
|
32768
32734
|
if (t4) {
|
|
32769
32735
|
t4.interactiveContainer.interactive = true, t4.interactiveContainer.cursor = "pointer";
|
|
32770
32736
|
const n2 = () => {
|
|
32737
|
+
this.ctx.eventHub.emit(zR.userInput);
|
|
32771
32738
|
const t5 = `shape ${e3} onClick`, { mode: n3 } = this.ctx;
|
|
32772
32739
|
n3 !== "interactive" && n3 !== "sync" || this.ctx.eventHub.emit(zR.interactiveSeqAction, { action: t5, seqId: this.json.ctn.id }), n3 !== "sync" && n3 !== "local" || this.globalEventHub.emit(t5);
|
|
32773
32740
|
};
|
|
@@ -33036,9 +33003,7 @@ void main(void){
|
|
|
33036
33003
|
const i2 = e3 / t4, r3 = (n2 = this.path) === null || n2 === void 0 ? void 0 : n2.getPoint(i2);
|
|
33037
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);
|
|
33038
33005
|
}, this.onSeekToStart = () => {
|
|
33039
|
-
|
|
33040
|
-
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);
|
|
33041
|
-
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);
|
|
33042
33007
|
}, this.onSeekToEnd = () => {
|
|
33043
33008
|
var t4, e3, n2;
|
|
33044
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);
|
|
@@ -33113,8 +33078,10 @@ void main(void){
|
|
|
33113
33078
|
}
|
|
33114
33079
|
class mR extends JA {
|
|
33115
33080
|
constructor(t3) {
|
|
33116
|
-
super(t3), this.isConflict = false, this.activeWhenConflict = "next", this.startColorString = null, this.currentColorString = "#FFFFFFFF", this.onTimelineStart = (t4) => {
|
|
33117
|
-
|
|
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);
|
|
33118
33085
|
const [e3] = this.json.cBhvr.attrList[0].split(".");
|
|
33119
33086
|
YA(this.timingTarget, e3 + ".on", "true");
|
|
33120
33087
|
}, this.onTimeNodeEnd = () => {
|
|
@@ -33122,10 +33089,12 @@ void main(void){
|
|
|
33122
33089
|
const [t4] = this.json.cBhvr.attrList[0].split(".");
|
|
33123
33090
|
YA(this.timingTarget, t4 + ".on", "false");
|
|
33124
33091
|
}
|
|
33092
|
+
this.isTimelineStart = false;
|
|
33125
33093
|
}, this.onSeekToStart = () => {
|
|
33126
|
-
|
|
33127
|
-
|
|
33128
|
-
|
|
33094
|
+
var t4;
|
|
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())) {
|
|
33096
|
+
const [t5] = this.json.cBhvr.attrList[0].split(".");
|
|
33097
|
+
YA(this.timingTarget, t5 + ".on", "false");
|
|
33129
33098
|
}
|
|
33130
33099
|
}, this.onTimeNodeStart = () => {
|
|
33131
33100
|
if (this.timingTarget) {
|
|
@@ -33136,7 +33105,7 @@ void main(void){
|
|
|
33136
33105
|
const n2 = t4 / e3;
|
|
33137
33106
|
this.to.interpolationFrom(this.from, n2, this.target), this.timingTarget && YA(this.timingTarget, this.json.cBhvr.attrList[0], this.target.toHexString());
|
|
33138
33107
|
}, this.onSeekToEnd = () => {
|
|
33139
|
-
this.onTimeUpdate({ duration: 1, delta: 1 });
|
|
33108
|
+
this.isTimelineStart || this.onTimelineStart({ isReverse: false, activeCount: 0, id: "" }), this.onTimeUpdate({ duration: 1, delta: 1 });
|
|
33140
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);
|
|
33141
33110
|
}
|
|
33142
33111
|
get modifyAttrKey() {
|
|
@@ -33196,7 +33165,7 @@ void main(void){
|
|
|
33196
33165
|
this.isApplied = false;
|
|
33197
33166
|
}), this.commonTimeNode.on("timeNodeEnd", () => {
|
|
33198
33167
|
this.isApplied = false;
|
|
33199
|
-
}), 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);
|
|
33200
33169
|
}
|
|
33201
33170
|
get modifyAttrKey() {
|
|
33202
33171
|
var t3, e3, n2, i2;
|
|
@@ -33268,7 +33237,7 @@ void main(void){
|
|
|
33268
33237
|
constructor(t3) {
|
|
33269
33238
|
var e3, n2;
|
|
33270
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 = () => {
|
|
33271
|
-
this.isActive && (this.isActive = false, this.
|
|
33240
|
+
this.isActive && (this.isActive = false, this.seekToEnd(false, true));
|
|
33272
33241
|
}, this.handleActive = (t4 = true) => {
|
|
33273
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) {
|
|
33274
33243
|
if (this.json.restart === "never")
|
|
@@ -33421,25 +33390,26 @@ void main(void){
|
|
|
33421
33390
|
isNatureTimeEnd() {
|
|
33422
33391
|
return this.duration >= 0 && this.timeDelta >= this.duration;
|
|
33423
33392
|
}
|
|
33424
|
-
|
|
33425
|
-
if (!this.json.presetClass)
|
|
33426
|
-
return;
|
|
33393
|
+
findTargets() {
|
|
33427
33394
|
const t3 = [], e3 = (n2) => {
|
|
33428
33395
|
n2.forEach((n3) => {
|
|
33429
33396
|
var i2, r3, o3;
|
|
33430
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);
|
|
33431
33398
|
});
|
|
33432
33399
|
};
|
|
33433
|
-
e3(this.json.childTnLst || []), t3
|
|
33400
|
+
return e3(this.json.childTnLst || []), t3;
|
|
33401
|
+
}
|
|
33402
|
+
setPreStyle() {
|
|
33403
|
+
this.json.presetClass && this.findTargets().forEach((t3) => {
|
|
33434
33404
|
if (this.json.iterate) {
|
|
33435
|
-
let
|
|
33405
|
+
let e3 = 0, n2 = true;
|
|
33436
33406
|
for (; n2; ) {
|
|
33437
|
-
const i2 = this.ctx.timingTargets.getTarget(
|
|
33438
|
-
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;
|
|
33439
33409
|
}
|
|
33440
33410
|
} else {
|
|
33441
|
-
const
|
|
33442
|
-
|
|
33411
|
+
const e3 = this.ctx.timingTargets.getTarget(t3, false);
|
|
33412
|
+
e3 && this.setPreStyleForTarget(e3);
|
|
33443
33413
|
}
|
|
33444
33414
|
});
|
|
33445
33415
|
}
|
|
@@ -33623,10 +33593,10 @@ void main(void){
|
|
|
33623
33593
|
}
|
|
33624
33594
|
resetAllInteractiveSeq() {
|
|
33625
33595
|
var t3;
|
|
33626
|
-
((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) => {
|
|
33627
33597
|
var e3, n2, i2;
|
|
33628
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";
|
|
33629
|
-
})).forEach((t4) => {
|
|
33599
|
+
})) || []).forEach((t4) => {
|
|
33630
33600
|
t4.setCurrentStep(0, "start");
|
|
33631
33601
|
});
|
|
33632
33602
|
}
|
|
@@ -33669,7 +33639,7 @@ void main(void){
|
|
|
33669
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)));
|
|
33670
33640
|
}
|
|
33671
33641
|
initOnReuse() {
|
|
33672
|
-
this.globalEventHub.on("c:prev slide", () => {
|
|
33642
|
+
super.initOnReuse(), this.globalEventHub.on("c:prev slide", () => {
|
|
33673
33643
|
this.ctx.eventHub.emit(zR.requestPrevSlide);
|
|
33674
33644
|
}), this.globalEventHub.on("c:next slide", () => {
|
|
33675
33645
|
this.ctx.eventHub.emit(zR.requestNextSlide);
|
|
@@ -33710,7 +33680,9 @@ void main(void){
|
|
|
33710
33680
|
}
|
|
33711
33681
|
clearOnTransactionEnd() {
|
|
33712
33682
|
var t3, e3;
|
|
33713
|
-
|
|
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;
|
|
33714
33686
|
}
|
|
33715
33687
|
destroy() {
|
|
33716
33688
|
var t3, e3;
|
|
@@ -33737,11 +33709,11 @@ void main(void){
|
|
|
33737
33709
|
}
|
|
33738
33710
|
nextStep() {
|
|
33739
33711
|
var t3;
|
|
33740
|
-
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);
|
|
33741
33713
|
}
|
|
33742
33714
|
prevStep() {
|
|
33743
33715
|
var t3;
|
|
33744
|
-
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);
|
|
33745
33717
|
}
|
|
33746
33718
|
applyInteractiveAction(t3) {
|
|
33747
33719
|
var e3;
|
|
@@ -33918,7 +33890,7 @@ void main(void){
|
|
|
33918
33890
|
};
|
|
33919
33891
|
class kR {
|
|
33920
33892
|
constructor(t3, e3, n2, i2, r3, o3, s3) {
|
|
33921
|
-
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);
|
|
33922
33894
|
}
|
|
33923
33895
|
setSnapshotCache(t3) {
|
|
33924
33896
|
this.snapshotCache = t3;
|
|
@@ -33929,7 +33901,7 @@ void main(void){
|
|
|
33929
33901
|
createCtx(t3) {
|
|
33930
33902
|
const { task: e3 } = this.stageStates[t3];
|
|
33931
33903
|
e3.addMTask(() => {
|
|
33932
|
-
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() };
|
|
33933
33905
|
return this.stageCtxs[t3] = i2, Promise.resolve();
|
|
33934
33906
|
});
|
|
33935
33907
|
}
|
|
@@ -34049,7 +34021,7 @@ void main(void){
|
|
|
34049
34021
|
});
|
|
34050
34022
|
};
|
|
34051
34023
|
r2.skipHello();
|
|
34052
|
-
const HR = { randomBar: "RandomLines", circle: "Shape", ripple: "Ripples", wipe: "Erase", dissolve: "Dissolve", morph: "Smooth", fade: "FadeInOut", push: "Push", split: "Separation", reveal: "Display", pull: "Uncover", cover: "Cover", flash: "Flash", checker: "Checkerboard", blinds: "WindowShades", curtains: "Curtain", fallOver: "Fall", drape: "Suspension", wheel: "Clock", comb: "Combing", warp: "Scale", peelOff: "PeelOff", flip: "Flip" }, zR = { mainSeqStepChange: "mainSeqStepChange", mainSeqStateChange: "mainSeqStateChange", interactiveSeqStateChange: "interactiveSeqStateChange", interactiveSeqAction: "interactiveSeqAction", mainSeqStepStart: "mainSeqStepStart", mainSeqStepEnd: "mainSeqStepEnd", slideChange: "slideChange", renderStart: "renderStart", renderEnd: "renderEnd", hyperlinkTrigger: "hyperlinkTrigger", animateStart: "animateStart", animateEnd: "animateEnd", mediaSeek: "mediaSeek", mediaPlay: "mediaPlay", mediaPause: "mediaPause", requestNextSlide: "requestNextSlide", requestPrevSlide: "requestPrevSlide", requestGotoSlide: "requestGotoSlide" };
|
|
34024
|
+
const HR = { randomBar: "RandomLines", circle: "Shape", ripple: "Ripples", wipe: "Erase", dissolve: "Dissolve", morph: "Smooth", fade: "FadeInOut", push: "Push", split: "Separation", reveal: "Display", pull: "Uncover", cover: "Cover", flash: "Flash", checker: "Checkerboard", blinds: "WindowShades", curtains: "Curtain", fallOver: "Fall", drape: "Suspension", wheel: "Clock", comb: "Combing", warp: "Scale", peelOff: "PeelOff", flip: "Flip" }, zR = { mainSeqStepChange: "mainSeqStepChange", mainSeqStateChange: "mainSeqStateChange", interactiveSeqStateChange: "interactiveSeqStateChange", interactiveSeqAction: "interactiveSeqAction", mainSeqStepStart: "mainSeqStepStart", mainSeqStepEnd: "mainSeqStepEnd", slideChange: "slideChange", renderStart: "renderStart", renderEnd: "renderEnd", hyperlinkTrigger: "hyperlinkTrigger", animateStart: "animateStart", animateEnd: "animateEnd", mediaSeek: "mediaSeek", mediaPlay: "mediaPlay", mediaPause: "mediaPause", requestNextSlide: "requestNextSlide", requestPrevSlide: "requestPrevSlide", requestGotoSlide: "requestGotoSlide", userInput: "userInput" };
|
|
34053
34025
|
class jR extends a.a {
|
|
34054
34026
|
constructor(t3, e3 = {}) {
|
|
34055
34027
|
super(), this.loader = new KE(true), this.transactionPlayer = new og(), this.transactionSprite = new OT(), this.isForward = true, this.drawCall = 0, this.scale = 1, this.prevSlideBase64 = null, this.fps = new qE(), this.designWidth = 0, this.designHeight = 0, this.currentIndex = 0, this.slideCount = 0, this.runtime = { drawCall: 0, fps: 0 }, this.mode = t3;
|
|
@@ -34061,7 +34033,7 @@ void main(void){
|
|
|
34061
34033
|
}, this.fps.on("update", (t4) => {
|
|
34062
34034
|
if (t4 < this.config.minFPS) {
|
|
34063
34035
|
if (this.config.autoResolution) {
|
|
34064
|
-
const t5 =
|
|
34036
|
+
const t5 = 0.7 * this.scale, e4 = this.app.renderer.resolution, n3 = Math.max(t5, e4 - 0.1);
|
|
34065
34037
|
n3 >= t5 && this.updateResolution(n3);
|
|
34066
34038
|
}
|
|
34067
34039
|
if (this.config.autoFPS) {
|
|
@@ -34122,7 +34094,7 @@ void main(void){
|
|
|
34122
34094
|
return GR(this, void 0, void 0, function* () {
|
|
34123
34095
|
this.emit(zR.renderStart, t3);
|
|
34124
34096
|
const r3 = yield this.stagePool.getStage(t3);
|
|
34125
|
-
this.translateEvent(r3.ctx.eventHub, [zR.mainSeqStepChange, zR.mainSeqStateChange, zR.hyperlinkTrigger, zR.interactiveSeqAction, zR.mainSeqStepStart, zR.mainSeqStepEnd, zR.animateStart, zR.animateEnd, zR.mediaPlay, zR.mediaPause, zR.mediaSeek, zR.requestGotoSlide, zR.requestNextSlide, zR.requestPrevSlide, zR.interactiveSeqStateChange]), this.currentIndex = Number(t3);
|
|
34097
|
+
this.translateEvent(r3.ctx.eventHub, [zR.mainSeqStepChange, zR.mainSeqStateChange, zR.hyperlinkTrigger, zR.interactiveSeqAction, zR.mainSeqStepStart, zR.mainSeqStepEnd, zR.animateStart, zR.animateEnd, zR.mediaPlay, zR.mediaPause, zR.mediaSeek, zR.requestGotoSlide, zR.requestNextSlide, zR.requestPrevSlide, zR.interactiveSeqStateChange, zR.userInput]), this.currentIndex = Number(t3);
|
|
34126
34098
|
const { width: o3, height: s3, slideCount: a2 } = r3.json;
|
|
34127
34099
|
this.slideCount = a2, this.designWidth = o3, this.designHeight = s3, r3.json.transition && r3.json.transition.type && !this.prevSlideBase64 && this.currentStage && (this.prevSlideBase64 = this.getBase64(this.currentStage)), (n2 = this.currentStage) === null || n2 === void 0 || n2.clearOnSlideChange();
|
|
34128
34100
|
const l2 = this.currentStage;
|
|
@@ -34132,12 +34104,16 @@ void main(void){
|
|
|
34132
34104
|
const n3 = t3.toString() + (this.isForward || e3 ? "-start" : "-end"), r4 = yield (i2 = this.snapshotCache) === null || i2 === void 0 ? void 0 : i2.getItem(n3);
|
|
34133
34105
|
u2 = r4 || this.getBase64(this.currentStage);
|
|
34134
34106
|
}
|
|
34135
|
-
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(() => {
|
|
34136
34110
|
}), this.preload(t3 - 1).catch(() => {
|
|
34137
34111
|
});
|
|
34138
34112
|
});
|
|
34139
34113
|
}
|
|
34140
34114
|
getBase64(t3) {
|
|
34115
|
+
if (!t3.container.transform)
|
|
34116
|
+
return null;
|
|
34141
34117
|
const e3 = Hy.create({ width: this.designWidth, height: this.designHeight, resolution: 1 });
|
|
34142
34118
|
this.app.renderer.render(t3.container, { renderTexture: e3 });
|
|
34143
34119
|
const n2 = this.app.renderer.plugins.extract.base64(e3, "image/jpeg");
|
|
@@ -34154,7 +34130,8 @@ void main(void){
|
|
|
34154
34130
|
}, 100), new Promise((o5) => {
|
|
34155
34131
|
var s4, l2, u2;
|
|
34156
34132
|
(s4 = this.transactionPlayer) === null || s4 === void 0 || s4.play({ reverse: !this.isForward, prevTextureUrl: t3, nextTextureUrl: e3, textureWidth: this.designWidth, textureHeight: this.designHeight, presetType: HR[n2.type], stageWidth: this.designWidth, stageHeight: this.designHeight, duration: (u2 = (l2 = this.currentStage) === null || l2 === void 0 ? void 0 : l2.json.transition) === null || u2 === void 0 ? void 0 : u2.dur, delay: 0, clearColor: this.config.transactionBgColor, onTransactionEnd: () => {
|
|
34157
|
-
|
|
34133
|
+
var t4, e4;
|
|
34134
|
+
o5(), i2.container.visible = false, r3.container.visible = true, (t4 = this.app.stage) === null || t4 === void 0 || t4.removeChild(this.transactionSprite), (e4 = this.app.ticker) === null || e4 === void 0 || e4.remove(a2);
|
|
34158
34135
|
} });
|
|
34159
34136
|
});
|
|
34160
34137
|
}
|
|
@@ -34170,7 +34147,9 @@ void main(void){
|
|
|
34170
34147
|
}
|
|
34171
34148
|
updateResolution(t3) {
|
|
34172
34149
|
this.app.ticker.addOnce(() => {
|
|
34173
|
-
|
|
34150
|
+
let e3 = BR.isDesktop() ? t3 : 1;
|
|
34151
|
+
for (; e3 * this.designWidth > 5120 || e3 * this.designHeight > 5120; )
|
|
34152
|
+
e3 -= 0.1;
|
|
34174
34153
|
this.app.renderer.resolution = e3, this.app.renderer.plugins.interaction.resolution = this.app.renderer.resolution, this.app.renderer.resize(this.designWidth, this.designHeight);
|
|
34175
34154
|
});
|
|
34176
34155
|
}
|
|
@@ -34240,7 +34219,7 @@ void main(void){
|
|
|
34240
34219
|
this.app.ticker.start();
|
|
34241
34220
|
}
|
|
34242
34221
|
getSnapshot() {
|
|
34243
|
-
return this.currentStage
|
|
34222
|
+
return this.currentStage && this.getBase64(this.currentStage) || "";
|
|
34244
34223
|
}
|
|
34245
34224
|
createSnapshotForNextSlide(t3) {
|
|
34246
34225
|
var e3, n2;
|
|
@@ -34308,7 +34287,7 @@ void main(void){
|
|
|
34308
34287
|
return true;
|
|
34309
34288
|
var i2 = (n2 = (e3 = t3) === null || e3 === void 0 ? void 0 : e3.ownerDocument) === null || n2 === void 0 ? void 0 : n2.defaultView;
|
|
34310
34289
|
return !!(i2 && t3 instanceof i2.Element);
|
|
34311
|
-
}, 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) {
|
|
34312
34291
|
return parseFloat(t3 || "0");
|
|
34313
34292
|
}, sP = function(t3, e3, n2) {
|
|
34314
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);
|
|
@@ -34454,7 +34433,7 @@ void main(void){
|
|
|
34454
34433
|
}, t3;
|
|
34455
34434
|
}(), EP = function(t3, e3) {
|
|
34456
34435
|
this.activeTargets = [], this.skippedTargets = [], this.observationTargets = [], this.observer = t3, this.callback = e3;
|
|
34457
|
-
}, MP = new WeakMap(), AP = function(t3, e3) {
|
|
34436
|
+
}, MP = /* @__PURE__ */ new WeakMap(), AP = function(t3, e3) {
|
|
34458
34437
|
for (var n2 = 0; n2 < t3.length; n2 += 1)
|
|
34459
34438
|
if (t3[n2].target === e3)
|
|
34460
34439
|
return n2;
|
|
@@ -34628,7 +34607,7 @@ void main(void){
|
|
|
34628
34607
|
});
|
|
34629
34608
|
}
|
|
34630
34609
|
return t3.prototype.replaceIdleTask = function() {
|
|
34631
|
-
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++)
|
|
34632
34611
|
this.tasks[i2].state === "idle" && ((t4 = this.tasks[i2 + 1]) === null || t4 === void 0 ? void 0 : t4.state) === "idle" && n2.add(i2);
|
|
34633
34612
|
Array.from(n2).forEach(function(t5) {
|
|
34634
34613
|
e3.tasks.splice(t5, 1);
|
|
@@ -35608,11 +35587,13 @@ void main(void){
|
|
|
35608
35587
|
return t3.prototype.createStats = function() {
|
|
35609
35588
|
var t4 = this;
|
|
35610
35589
|
this.stateId = setInterval(function() {
|
|
35611
|
-
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));
|
|
35612
35591
|
}, 500);
|
|
35613
35592
|
}, t3.prototype.createControllerGUI = function() {
|
|
35614
35593
|
var t4, e3, n2, i2, r3, o3 = new GC({ autoPlace: true, closed: true });
|
|
35615
|
-
|
|
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;
|
|
35616
35597
|
}, t3.prototype.addEventListener = function() {
|
|
35617
35598
|
var t4, e3 = this;
|
|
35618
35599
|
this.controller.autoFps.onChange(function(t5) {
|
|
@@ -35625,6 +35606,8 @@ void main(void){
|
|
|
35625
35606
|
e3.data.autoResolution = t5, e3.player.updateConfig(e3.data);
|
|
35626
35607
|
}), this.controller.resolution.onChange(function(t5) {
|
|
35627
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);
|
|
35628
35611
|
}), this.controller.moreCalculation.onChange(function(n2) {
|
|
35629
35612
|
t4 && e3.player.app.ticker.remove(t4), n2 > 0 && (t4 = function() {
|
|
35630
35613
|
for (var t5 = ""; t5.length < 8e3 * n2; )
|
|
@@ -35653,7 +35636,7 @@ void main(void){
|
|
|
35653
35636
|
}, t3;
|
|
35654
35637
|
}(), jC = function() {
|
|
35655
35638
|
function t3() {
|
|
35656
|
-
this.autoUnlock = Object.create(null), this.locks = Object.create(null);
|
|
35639
|
+
this.autoUnlock = /* @__PURE__ */ Object.create(null), this.locks = /* @__PURE__ */ Object.create(null);
|
|
35657
35640
|
}
|
|
35658
35641
|
return t3.prototype.addLock = function(t4, e3) {
|
|
35659
35642
|
var n2 = this;
|
|
@@ -35800,20 +35783,33 @@ void main(void){
|
|
|
35800
35783
|
});
|
|
35801
35784
|
});
|
|
35802
35785
|
}
|
|
35803
|
-
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 = "";
|
|
35804
35787
|
try {
|
|
35805
|
-
tI = "0.2.
|
|
35788
|
+
tI = "0.2.6";
|
|
35806
35789
|
} catch (t3) {
|
|
35807
35790
|
tI = "dev";
|
|
35808
35791
|
}
|
|
35809
35792
|
var eI = function(t3) {
|
|
35810
35793
|
function e3(e4) {
|
|
35811
35794
|
var n2 = t3.call(this) || this;
|
|
35812
|
-
return n2.iosResetCache = [], n2.needClearCacheImage = false, n2.version = tI, n2.__slideState = Object(l.cloneDeep)(QC), 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() {
|
|
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() {
|
|
35813
35796
|
return n2.frameResizeHandler();
|
|
35814
35797
|
}), n2.timestamp = function() {
|
|
35815
35798
|
return Date.now();
|
|
35816
|
-
}, n2.mode = "local", 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.
|
|
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() {
|
|
35802
|
+
setTimeout(function() {
|
|
35803
|
+
var t4 = Date.now();
|
|
35804
|
+
Math.abs(t4 - n2.userInputTime) > 500 && n2.enableGlobalClick && n2.nextStep();
|
|
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());
|
|
35812
|
+
}, n2.persistLog = function() {
|
|
35817
35813
|
return XC(n2, void 0, void 0, function() {
|
|
35818
35814
|
var t4, e5;
|
|
35819
35815
|
return qC(this, function(n3) {
|
|
@@ -35909,49 +35905,49 @@ void main(void){
|
|
|
35909
35905
|
n2.renderSlide(t4, e5);
|
|
35910
35906
|
} else
|
|
35911
35907
|
t4 === -1 && n2.renderSlide(n2.slideCount, true);
|
|
35912
|
-
}, e4.timestamp && (n2.timestamp = e4.timestamp), n2.config = e4, n2.syncQueue = new zC(n2.receiveSyncHandler), n2.mode = e4.mode, n2.anchor = e4.anchor, n2.resize = e4.resize || false, n2.interactive = e4.interactive, n2.cacheImage.style.position = "absolute", n2.cacheImage.style.zIndex = "100", n2.frame.style.cssText = "width:100%;height:100%;display:flex;justify-content:center;align-items:center;visibility:hidden;position:relative;z-index:1;", n2.setMedianControllerAttribute(), n2.frame.appendChild(n2.medianController), n2.anchor.appendChild(n2.frame), n2.frameResizeObserver.observe(n2.frame), n2.on($C.syncReceive, function(t4) {
|
|
35908
|
+
}, e4.timestamp && (n2.timestamp = e4.timestamp), n2.config = e4, n2.syncQueue = new zC(n2.receiveSyncHandler), n2.mode = e4.mode, n2.anchor = e4.anchor, n2.enableGlobalClick = !Object(l.isUndefined)(e4.enableGlobalClick) && e4.enableGlobalClick, n2.resize = e4.resize || false, n2.interactive = e4.interactive, n2.cacheImage.style.position = "absolute", n2.cacheImage.style.zIndex = "100", n2.frame.style.cssText = "width:100%;height:100%;display:flex;justify-content:center;align-items:center;visibility:hidden;position:relative;z-index:1;", n2.setMedianControllerAttribute(), n2.frame.appendChild(n2.medianController), n2.anchor.appendChild(n2.frame), n2.frameResizeObserver.observe(n2.frame), n2.on($C.syncReceive, function(t4) {
|
|
35913
35909
|
n2.lock.unlock(t4.type, t4.uuid), n2.syncQueue.addTask(t4);
|
|
35914
35910
|
}), n2.renderingTaskManager.eventHub.on("task-error", function(t4) {
|
|
35915
35911
|
var e5 = t4.error, i2 = t4.task;
|
|
35916
35912
|
n2.emit($C.renderError, { error: e5, index: i2.slideIndex });
|
|
35917
|
-
}), 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;
|
|
35918
35914
|
}
|
|
35919
35915
|
return VC(e3, t3), e3.prototype.initPlayer = function(t4) {
|
|
35920
|
-
var e4 = this,
|
|
35921
|
-
return
|
|
35922
|
-
|
|
35923
|
-
}),
|
|
35924
|
-
|
|
35925
|
-
}),
|
|
35926
|
-
|
|
35927
|
-
}),
|
|
35928
|
-
|
|
35929
|
-
}),
|
|
35930
|
-
|
|
35931
|
-
}),
|
|
35932
|
-
var
|
|
35933
|
-
|
|
35934
|
-
}),
|
|
35935
|
-
|
|
35936
|
-
}),
|
|
35937
|
-
|
|
35938
|
-
}),
|
|
35939
|
-
var
|
|
35940
|
-
|
|
35941
|
-
}),
|
|
35942
|
-
|
|
35943
|
-
}),
|
|
35944
|
-
|
|
35945
|
-
}),
|
|
35946
|
-
var
|
|
35947
|
-
|
|
35948
|
-
}),
|
|
35949
|
-
var
|
|
35950
|
-
|
|
35951
|
-
}),
|
|
35952
|
-
var
|
|
35953
|
-
t5.isPlaying ? (
|
|
35954
|
-
}),
|
|
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) {
|
|
35945
|
+
var e5 = { type: "pause", time: t5.time };
|
|
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) {
|
|
35948
|
+
var e5 = { type: "pause", time: 0 };
|
|
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;
|
|
35955
35951
|
}, e3.prototype.createController = function() {
|
|
35956
35952
|
this.player && (this.playerController = new HC({ player: this.player, params: this.player.config || {}, target: this.frame }));
|
|
35957
35953
|
}, e3.prototype.setMedianControllerAttribute = function() {
|
|
@@ -35974,7 +35970,7 @@ void main(void){
|
|
|
35974
35970
|
return qC(this, function(s3) {
|
|
35975
35971
|
switch (s3.label) {
|
|
35976
35972
|
case 0:
|
|
35977
|
-
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];
|
|
35978
35974
|
case 1:
|
|
35979
35975
|
s3.sent(), s3.label = 2;
|
|
35980
35976
|
case 2:
|
|
@@ -35983,7 +35979,7 @@ void main(void){
|
|
|
35983
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);
|
|
35984
35980
|
}, 3e3)];
|
|
35985
35981
|
case 3:
|
|
35986
|
-
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];
|
|
35987
35983
|
}
|
|
35988
35984
|
});
|
|
35989
35985
|
});
|
|
@@ -36076,21 +36072,21 @@ void main(void){
|
|
|
36076
36072
|
}, e3.prototype.poseRenderSlide = function(t4, e4) {
|
|
36077
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);
|
|
36078
36074
|
}, e3.prototype.doRenderSlide = function(t4, e4) {
|
|
36079
|
-
var n2, i2 = this;
|
|
36075
|
+
var n2, i2, r3, o3 = this;
|
|
36080
36076
|
if (e4 === void 0 && (e4 = true), !this.player)
|
|
36081
36077
|
return Promise.resolve();
|
|
36082
36078
|
if (this.needCreateNewPlayer() && (this.iosResetCache = [], this.iosNewPlayer = this.initPlayer(this.config), this.iosNewPlayer.setResourceData(this.__slideState.taskId, this.__slideState.url)), this.iosNewPlayer) {
|
|
36083
|
-
var
|
|
36084
|
-
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));
|
|
36085
36081
|
}
|
|
36086
|
-
var
|
|
36082
|
+
var a2 = Math.random().toString(32).substr(2);
|
|
36087
36083
|
return this.player.isForward = e4, this.renderingTaskManager.addTask(function() {
|
|
36088
|
-
return
|
|
36089
|
-
}, t4,
|
|
36090
|
-
|
|
36084
|
+
return o3._renderSlide(t4);
|
|
36085
|
+
}, t4, a2), new Promise(function(t5) {
|
|
36086
|
+
o3.renderingTaskManager.eventHub.once("task-end-" + a2, t5);
|
|
36091
36087
|
});
|
|
36092
36088
|
}, e3.prototype.nextStep = function() {
|
|
36093
|
-
!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());
|
|
36094
36090
|
}, e3.prototype.doNextStep = function() {
|
|
36095
36091
|
if (this.player) {
|
|
36096
36092
|
this.player.nextStep();
|
|
@@ -36098,7 +36094,7 @@ void main(void){
|
|
|
36098
36094
|
this.__slideState.mainSeqStep = t4, this.emitStateChange();
|
|
36099
36095
|
}
|
|
36100
36096
|
}, e3.prototype.prevStep = function() {
|
|
36101
|
-
!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());
|
|
36102
36098
|
}, e3.prototype.doPrevStep = function() {
|
|
36103
36099
|
if (this.player) {
|
|
36104
36100
|
this.player.prevStep();
|
|
@@ -36108,7 +36104,7 @@ void main(void){
|
|
|
36108
36104
|
}, e3.prototype.isSlideStateReady = function(t4) {
|
|
36109
36105
|
return t4.taskId.length > 0 && t4.url.length > 0 && t4.currentSlideIndex > 0;
|
|
36110
36106
|
}, e3.prototype.emitStateChange = function() {
|
|
36111
|
-
if (this.mode !== "local") {
|
|
36107
|
+
if (this.mode !== "local" && !this.isSyncingSlideState) {
|
|
36112
36108
|
var t4 = this.slideState;
|
|
36113
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");
|
|
36114
36110
|
}
|
|
@@ -36151,23 +36147,23 @@ void main(void){
|
|
|
36151
36147
|
});
|
|
36152
36148
|
});
|
|
36153
36149
|
}, e3.prototype.release = function() {
|
|
36154
|
-
var t4;
|
|
36150
|
+
var t4, e4;
|
|
36155
36151
|
return XC(this, void 0, void 0, function() {
|
|
36156
|
-
var
|
|
36157
|
-
return qC(this, function(
|
|
36158
|
-
switch (
|
|
36152
|
+
var n2, i2, r3, o3, s3 = this;
|
|
36153
|
+
return qC(this, function(a2) {
|
|
36154
|
+
switch (a2.label) {
|
|
36159
36155
|
case 0:
|
|
36160
36156
|
if (this.isReleasing)
|
|
36161
36157
|
return [2, KC(function() {
|
|
36162
|
-
return !
|
|
36158
|
+
return !s3.isReleasing;
|
|
36163
36159
|
}, 6e4)];
|
|
36164
|
-
for (
|
|
36165
|
-
(
|
|
36166
|
-
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)];
|
|
36167
36163
|
case 1:
|
|
36168
|
-
return
|
|
36164
|
+
return a2.sent(), [4, this.player.clock.delay(333)];
|
|
36169
36165
|
case 2:
|
|
36170
|
-
|
|
36166
|
+
a2.sent(), this.player.view && (this.player.view.style.visibility = "visible");
|
|
36171
36167
|
try {
|
|
36172
36168
|
this.frame.removeChild(this.cacheImage);
|
|
36173
36169
|
} catch (t5) {
|
|
@@ -36181,7 +36177,7 @@ void main(void){
|
|
|
36181
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() {
|
|
36182
36178
|
});
|
|
36183
36179
|
try {
|
|
36184
|
-
((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);
|
|
36185
36181
|
} catch (t5) {
|
|
36186
36182
|
}
|
|
36187
36183
|
}, e3.disposeLocalCache = function() {
|
|
@@ -36189,6 +36185,15 @@ void main(void){
|
|
|
36189
36185
|
}, e3;
|
|
36190
36186
|
}(a.a);
|
|
36191
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
|
+
}
|
|
36192
36197
|
var colorString = { exports: {} };
|
|
36193
36198
|
var colorName = {
|
|
36194
36199
|
"aliceblue": [240, 248, 255],
|
|
@@ -36546,6 +36551,41 @@ function hexDouble(num) {
|
|
|
36546
36551
|
return str.length < 2 ? "0" + str : str;
|
|
36547
36552
|
}
|
|
36548
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);
|
|
36549
36589
|
function guessBgColor(el) {
|
|
36550
36590
|
try {
|
|
36551
36591
|
const bg = window.getComputedStyle(el).backgroundColor;
|
|
@@ -36642,11 +36682,11 @@ class SlideController {
|
|
|
36642
36682
|
payload: event
|
|
36643
36683
|
};
|
|
36644
36684
|
log("[Slide] dispatch", event);
|
|
36645
|
-
this.
|
|
36685
|
+
this.context.dispatchMagixEvent(Slide.SLIDE_EVENTS.syncDispatch, payload);
|
|
36646
36686
|
}
|
|
36647
36687
|
};
|
|
36648
36688
|
this.magixEventListener = (ev) => {
|
|
36649
|
-
if (ev.event ===
|
|
36689
|
+
if (ev.event === Slide.SLIDE_EVENTS.syncDispatch && isObj(ev.payload)) {
|
|
36650
36690
|
const { type, payload } = ev.payload;
|
|
36651
36691
|
if (type === Slide.SLIDE_EVENTS.syncDispatch) {
|
|
36652
36692
|
this.syncStateOnce();
|
|
@@ -36658,13 +36698,7 @@ class SlideController {
|
|
|
36658
36698
|
this.onStateChange = (state) => {
|
|
36659
36699
|
if (this.context.getIsWritable()) {
|
|
36660
36700
|
verbose("[Slide] state change", JSON.stringify(state, null, 2));
|
|
36661
|
-
this.context.
|
|
36662
|
-
}
|
|
36663
|
-
};
|
|
36664
|
-
this.onSeeked = () => {
|
|
36665
|
-
const state = this.context.getAttributes().state;
|
|
36666
|
-
if (state) {
|
|
36667
|
-
this.slide.setSlideState(deepClone(state));
|
|
36701
|
+
this.context.storage.setState({ state });
|
|
36668
36702
|
}
|
|
36669
36703
|
};
|
|
36670
36704
|
this.pollCount = 0;
|
|
@@ -36729,7 +36763,6 @@ class SlideController {
|
|
|
36729
36763
|
this.onTransitionEnd = onTransitionEnd;
|
|
36730
36764
|
this.onError = onError;
|
|
36731
36765
|
this.context = context;
|
|
36732
|
-
this.channel = `channel-${context.appId}`;
|
|
36733
36766
|
this.room = context.getRoom();
|
|
36734
36767
|
this.player = this.room ? void 0 : context.getDisplayer();
|
|
36735
36768
|
this.slide = this.createSlide(anchor);
|
|
@@ -36769,17 +36802,9 @@ class SlideController {
|
|
|
36769
36802
|
});
|
|
36770
36803
|
return disposer;
|
|
36771
36804
|
});
|
|
36772
|
-
this.sideEffect.add(() => {
|
|
36773
|
-
|
|
36774
|
-
|
|
36775
|
-
});
|
|
36776
|
-
this.sideEffect.add(() => {
|
|
36777
|
-
const displayer = context.getDisplayer();
|
|
36778
|
-
displayer.addMagixEventListener(this.channel, this.magixEventListener, {
|
|
36779
|
-
fireSelfEventAfterCommit: true
|
|
36780
|
-
});
|
|
36781
|
-
return () => displayer.removeMagixEventListener(this.channel);
|
|
36782
|
-
});
|
|
36805
|
+
this.sideEffect.add(() => context.addMagixEventListener(Slide.SLIDE_EVENTS.syncDispatch, this.magixEventListener, {
|
|
36806
|
+
fireSelfEventAfterCommit: true
|
|
36807
|
+
}));
|
|
36783
36808
|
slide.on(Slide.SLIDE_EVENTS.slideChange, this.onPageChanged);
|
|
36784
36809
|
slide.on(Slide.SLIDE_EVENTS.renderStart, this.onTransitionStart);
|
|
36785
36810
|
slide.on(Slide.SLIDE_EVENTS.renderEnd, this.onTransitionEnd);
|
|
@@ -36792,7 +36817,7 @@ class SlideController {
|
|
|
36792
36817
|
}
|
|
36793
36818
|
syncStateOnce() {
|
|
36794
36819
|
if (this.syncStateOnceFlag) {
|
|
36795
|
-
const { state } = __spreadValues(__spreadValues({}, EmptyAttributes), this.context.
|
|
36820
|
+
const { state } = __spreadValues(__spreadValues({}, EmptyAttributes), this.context.storage.state);
|
|
36796
36821
|
if (state) {
|
|
36797
36822
|
log("[Slide] sync with state (once)", deepClone(state));
|
|
36798
36823
|
this.slide.setSlideState(deepClone(state));
|
|
@@ -36817,6 +36842,7 @@ class SlideController {
|
|
|
36817
36842
|
mode: "interactive",
|
|
36818
36843
|
resize: true,
|
|
36819
36844
|
controller: logger.enable,
|
|
36845
|
+
enableGlobalClick: true,
|
|
36820
36846
|
renderOptions: {
|
|
36821
36847
|
minFPS: 25,
|
|
36822
36848
|
maxFPS: 30,
|
|
@@ -37764,6 +37790,9 @@ class DocsViewer {
|
|
|
37764
37790
|
$pageNumberInput.disabled = true;
|
|
37765
37791
|
}
|
|
37766
37792
|
this.$pageNumberInput = $pageNumberInput;
|
|
37793
|
+
this.sideEffect.addEventListener($pageNumberInput, "focus", () => {
|
|
37794
|
+
$pageNumberInput.select();
|
|
37795
|
+
});
|
|
37767
37796
|
this.sideEffect.addEventListener($pageNumberInput, "change", () => {
|
|
37768
37797
|
if (this.readonly) {
|
|
37769
37798
|
return;
|
|
@@ -37806,7 +37835,7 @@ class DocsViewer {
|
|
|
37806
37835
|
return `${this.namespace}-${className}`;
|
|
37807
37836
|
}
|
|
37808
37837
|
}
|
|
37809
|
-
const ClickThroughAppliances = new Set(["clicker"]);
|
|
37838
|
+
const ClickThroughAppliances = /* @__PURE__ */ new Set(["clicker"]);
|
|
37810
37839
|
class SlideDocsViewer {
|
|
37811
37840
|
constructor({ box, view, mountSlideController, mountWhiteboard }) {
|
|
37812
37841
|
this.slideController = null;
|
|
@@ -37950,7 +37979,56 @@ class SlideDocsViewer {
|
|
|
37950
37979
|
return `${this.namespace}-${className}`;
|
|
37951
37980
|
}
|
|
37952
37981
|
}
|
|
37953
|
-
|
|
37982
|
+
let useFreezer = false;
|
|
37983
|
+
const FreezerLength = 2;
|
|
37984
|
+
const apps = {
|
|
37985
|
+
map: /* @__PURE__ */ new Map(),
|
|
37986
|
+
queue: [],
|
|
37987
|
+
validateQueue() {
|
|
37988
|
+
log("[Slide] freezer: validate", this.queue);
|
|
37989
|
+
while (this.queue.length > FreezerLength) {
|
|
37990
|
+
const appId = this.queue.pop();
|
|
37991
|
+
const slide = this.map.get(appId);
|
|
37992
|
+
if (slide) {
|
|
37993
|
+
log("[Slide] freezer: validate-freeze", appId, this.queue);
|
|
37994
|
+
slide.freeze();
|
|
37995
|
+
}
|
|
37996
|
+
}
|
|
37997
|
+
},
|
|
37998
|
+
set(appId, slide) {
|
|
37999
|
+
log("[Slide] freezer: add", appId, this.queue);
|
|
38000
|
+
this.map.set(appId, slide);
|
|
38001
|
+
if (!this.queue.includes(appId)) {
|
|
38002
|
+
this.queue.unshift(appId);
|
|
38003
|
+
}
|
|
38004
|
+
this.validateQueue();
|
|
38005
|
+
},
|
|
38006
|
+
delete(appId) {
|
|
38007
|
+
log("[Slide] freezer: delete", appId, this.queue);
|
|
38008
|
+
this.map.delete(appId);
|
|
38009
|
+
this.queue = this.queue.filter((id) => id !== appId);
|
|
38010
|
+
},
|
|
38011
|
+
focus(appId) {
|
|
38012
|
+
const slide = this.map.get(appId);
|
|
38013
|
+
const index = this.queue.indexOf(appId);
|
|
38014
|
+
if (index > -1) {
|
|
38015
|
+
this.queue.splice(index, 1);
|
|
38016
|
+
}
|
|
38017
|
+
this.queue.unshift(appId);
|
|
38018
|
+
this.validateQueue();
|
|
38019
|
+
log("[Slide] freezer: focus", appId, this.queue);
|
|
38020
|
+
if (slide) {
|
|
38021
|
+
slide.unfreeze();
|
|
38022
|
+
}
|
|
38023
|
+
}
|
|
38024
|
+
};
|
|
38025
|
+
const addHooks = (emitter) => {
|
|
38026
|
+
useFreezer = true;
|
|
38027
|
+
emitter.on("focus", ({ appId }) => {
|
|
38028
|
+
apps.focus(appId);
|
|
38029
|
+
});
|
|
38030
|
+
};
|
|
38031
|
+
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";
|
|
37954
38032
|
function previewSlide({
|
|
37955
38033
|
container,
|
|
37956
38034
|
taskId,
|
|
@@ -38051,6 +38129,7 @@ class SlidePreviewer {
|
|
|
38051
38129
|
mode: "local",
|
|
38052
38130
|
resize: true,
|
|
38053
38131
|
controller: this.debug,
|
|
38132
|
+
enableGlobalClick: true,
|
|
38054
38133
|
renderOptions: {
|
|
38055
38134
|
minFPS: 25,
|
|
38056
38135
|
maxFPS: 30,
|
|
@@ -38106,16 +38185,15 @@ class SlidePreviewer {
|
|
|
38106
38185
|
return `${this.namespace}-${className}`;
|
|
38107
38186
|
}
|
|
38108
38187
|
}
|
|
38109
|
-
const version = "0.0.
|
|
38188
|
+
const version = "0.0.57";
|
|
38110
38189
|
const SlideApp = {
|
|
38111
38190
|
kind: "Slide",
|
|
38112
38191
|
setup(context) {
|
|
38113
38192
|
console.log("[Slide] setup @ " + version);
|
|
38114
38193
|
if (context.getIsWritable()) {
|
|
38115
|
-
|
|
38194
|
+
context.storage.ensureState(EmptyAttributes);
|
|
38116
38195
|
}
|
|
38117
|
-
|
|
38118
|
-
if (!(attributes == null ? void 0 : attributes.taskId)) {
|
|
38196
|
+
if (!context.storage.state.taskId) {
|
|
38119
38197
|
throw new Error("[Slide] no taskId");
|
|
38120
38198
|
}
|
|
38121
38199
|
const view = context.getView();
|
|
@@ -38153,7 +38231,15 @@ const SlideApp = {
|
|
|
38153
38231
|
if (useFreezer)
|
|
38154
38232
|
apps.set(context.appId, slideController);
|
|
38155
38233
|
((_a = logger.apps)[_b = context.appId] || (_a[_b] = {})).controller = slideController;
|
|
38156
|
-
slideController.readyPromise.then(options.onReady)
|
|
38234
|
+
slideController.readyPromise.then(options.onReady).then(() => {
|
|
38235
|
+
const room2 = context.getRoom();
|
|
38236
|
+
let synced = false;
|
|
38237
|
+
if (room2 && context.getIsWritable()) {
|
|
38238
|
+
syncSceneWithSlide(room2, context, slideController.slide, baseScenePath);
|
|
38239
|
+
synced = true;
|
|
38240
|
+
}
|
|
38241
|
+
log("[Slide] page to", slideController.slide.slideState.currentSlideIndex, synced);
|
|
38242
|
+
});
|
|
38157
38243
|
return slideController;
|
|
38158
38244
|
};
|
|
38159
38245
|
docsViewer = new SlideDocsViewer({
|
|
@@ -38194,6 +38280,56 @@ const SlideApp = {
|
|
|
38194
38280
|
}
|
|
38195
38281
|
});
|
|
38196
38282
|
docsViewer.mount();
|
|
38283
|
+
return {
|
|
38284
|
+
slide: () => {
|
|
38285
|
+
var _a;
|
|
38286
|
+
return (_a = docsViewer == null ? void 0 : docsViewer.slideController) == null ? void 0 : _a.slide;
|
|
38287
|
+
},
|
|
38288
|
+
nextStep: () => {
|
|
38289
|
+
var _a;
|
|
38290
|
+
if (docsViewer && docsViewer.slideController) {
|
|
38291
|
+
(_a = docsViewer == null ? void 0 : docsViewer.slideController) == null ? void 0 : _a.slide.nextStep();
|
|
38292
|
+
return true;
|
|
38293
|
+
}
|
|
38294
|
+
return false;
|
|
38295
|
+
},
|
|
38296
|
+
prevStep: () => {
|
|
38297
|
+
var _a;
|
|
38298
|
+
if (docsViewer && docsViewer.slideController) {
|
|
38299
|
+
(_a = docsViewer == null ? void 0 : docsViewer.slideController) == null ? void 0 : _a.slide.prevStep();
|
|
38300
|
+
return true;
|
|
38301
|
+
}
|
|
38302
|
+
return false;
|
|
38303
|
+
},
|
|
38304
|
+
position: () => {
|
|
38305
|
+
const controller = docsViewer == null ? void 0 : docsViewer.slideController;
|
|
38306
|
+
if (controller) {
|
|
38307
|
+
return [controller.page, controller.pageCount];
|
|
38308
|
+
}
|
|
38309
|
+
},
|
|
38310
|
+
nextPage: () => {
|
|
38311
|
+
const controller = docsViewer == null ? void 0 : docsViewer.slideController;
|
|
38312
|
+
if (controller) {
|
|
38313
|
+
const { page, pageCount } = controller;
|
|
38314
|
+
if (pageCount > 0 && page < pageCount) {
|
|
38315
|
+
controller.jumpToPage(page + 1);
|
|
38316
|
+
return true;
|
|
38317
|
+
}
|
|
38318
|
+
}
|
|
38319
|
+
return false;
|
|
38320
|
+
},
|
|
38321
|
+
prevPage: () => {
|
|
38322
|
+
const controller = docsViewer == null ? void 0 : docsViewer.slideController;
|
|
38323
|
+
if (controller) {
|
|
38324
|
+
const { page, pageCount } = controller;
|
|
38325
|
+
if (pageCount > 0 && page > 1) {
|
|
38326
|
+
controller.jumpToPage(page - 1);
|
|
38327
|
+
return true;
|
|
38328
|
+
}
|
|
38329
|
+
}
|
|
38330
|
+
return false;
|
|
38331
|
+
}
|
|
38332
|
+
};
|
|
38197
38333
|
}
|
|
38198
38334
|
};
|
|
38199
38335
|
export { DefaultUrl, FreezerLength, SlidePreviewer, addHooks, apps, SlideApp as default, previewSlide, version };
|