@realsee/dnalogel 3.50.7 → 3.50.8
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/CHANGELOG.md +3 -0
- package/dist/index.cjs.js +3 -3
- package/dist/index.js +7 -5
- package/dist/index.umd.js +3 -3
- package/libs/CruisePlugin/Work.js +92 -90
- package/libs/base/BasePlugin.js +1 -1
- package/libs/shared-utils/logger.js +1 -1
- package/package.json +1 -1
|
@@ -14,18 +14,18 @@ var k = (h, l, t) => (I(h, typeof l != "symbol" ? l + "" : l, t), t);
|
|
|
14
14
|
var y = (h, l, t) => new Promise((e, r) => {
|
|
15
15
|
var i = (n) => {
|
|
16
16
|
try {
|
|
17
|
-
|
|
18
|
-
} catch (
|
|
19
|
-
r(
|
|
17
|
+
p(t.next(n));
|
|
18
|
+
} catch (a) {
|
|
19
|
+
r(a);
|
|
20
20
|
}
|
|
21
21
|
}, s = (n) => {
|
|
22
22
|
try {
|
|
23
|
-
|
|
24
|
-
} catch (
|
|
25
|
-
r(
|
|
23
|
+
p(t.throw(n));
|
|
24
|
+
} catch (a) {
|
|
25
|
+
r(a);
|
|
26
26
|
}
|
|
27
|
-
},
|
|
28
|
-
|
|
27
|
+
}, p = (n) => n.done ? e(n.value) : Promise.resolve(n.value).then(i, s);
|
|
28
|
+
p((t = t.apply(h, l)).next());
|
|
29
29
|
});
|
|
30
30
|
import { GuideLinePlugin as K } from "../GuideLinePlugin/index.js";
|
|
31
31
|
import { uuid as S } from "../shared-utils/uuid.js";
|
|
@@ -256,28 +256,28 @@ class Sr extends G {
|
|
|
256
256
|
*/
|
|
257
257
|
load(t, e, r) {
|
|
258
258
|
return y(this, null, function* () {
|
|
259
|
-
var
|
|
259
|
+
var o, m;
|
|
260
260
|
this.clear();
|
|
261
261
|
const i = this.data ? JSON.parse(JSON.stringify(this.data)) : void 0, s = yield this.formatData(t);
|
|
262
262
|
this.data = g({ id: s.keyframesId }, s), this.hooks.emit("dataChange", s, i);
|
|
263
|
-
let
|
|
264
|
-
const
|
|
265
|
-
|
|
263
|
+
let p = [], n;
|
|
264
|
+
const a = this.data.keyframes.filter((f) => f.data.panoIndex !== void 0);
|
|
265
|
+
a.filter((f, u) => {
|
|
266
266
|
var d;
|
|
267
|
-
return f.data.panoIndex !== ((d =
|
|
267
|
+
return f.data.panoIndex !== ((d = a[u - 1]) == null ? void 0 : d.data.panoIndex);
|
|
268
268
|
}).map((f) => f.data.panoIndex).forEach((f) => {
|
|
269
269
|
var d, v;
|
|
270
270
|
const u = (d = this.workUtil.getObserver(f)) == null ? void 0 : d.floorIndex;
|
|
271
271
|
if (u !== void 0)
|
|
272
272
|
if (n === u) {
|
|
273
|
-
const c =
|
|
274
|
-
|
|
273
|
+
const c = p.length - 1;
|
|
274
|
+
p[c] = [...(v = p[c]) != null ? v : [], f];
|
|
275
275
|
} else {
|
|
276
276
|
n = u;
|
|
277
|
-
const c =
|
|
278
|
-
|
|
277
|
+
const c = p.length;
|
|
278
|
+
p[c] = [f];
|
|
279
279
|
}
|
|
280
|
-
}), !this.GuideLine && ((
|
|
280
|
+
}), !this.GuideLine && ((o = this.config) == null ? void 0 : o.useGuideLine) !== !1 && s.useGuildLine !== !1 && (this.GuideLine = K(this.five, this.config)), (m = this.GuideLine) == null || m.load({ routes: p.map((f) => ({ panoIndexList: f })), config: s.guildPluginOptions }), e ? this.setState(e, { userAction: r }) : (this.setState({ playing: !1 }, { userAction: !1 }), this.handleVisible(this.state.visible), this.handleEnable(this.state.enabled), this.changePlayState(this.state.playing, { userAction: !1 }), this.changeSpeed(this.state.speed)), this.clearPauseData(), console.debug("WORKPLUGIN loaded", s), this.hooks.emit("dataLoaded", s);
|
|
281
281
|
});
|
|
282
282
|
}
|
|
283
283
|
/**
|
|
@@ -310,33 +310,33 @@ class Sr extends G {
|
|
|
310
310
|
keyframesId: S(),
|
|
311
311
|
keyframes: e.keyframes.map((r, i) => {
|
|
312
312
|
var n;
|
|
313
|
-
const s = e.keyframes[i + 1],
|
|
314
|
-
return x(g({ id: (n = r.uuid) != null ? n : S(), moveIndex: i, stay:
|
|
313
|
+
const s = e.keyframes[i + 1], p = (() => !s || s.start === void 0 || r.end === void 0 ? 0 : s.start - r.end)();
|
|
314
|
+
return x(g({ id: (n = r.uuid) != null ? n : S(), moveIndex: i, stay: p, index: i }, r), { guildPluginOptions: e.guildPluginOptions });
|
|
315
315
|
})
|
|
316
316
|
};
|
|
317
317
|
if (e.panoIndexList) {
|
|
318
318
|
let r = [];
|
|
319
|
-
const { moveEffect: i, moveToFirstPanoEffect: s, moveToFirstPanoDuration:
|
|
320
|
-
return this.privateState.moveToFirstPanoEffect = s, this.privateState.moveToFirstPanoDuration =
|
|
321
|
-
const
|
|
319
|
+
const { moveEffect: i, moveToFirstPanoEffect: s, moveToFirstPanoDuration: p } = e;
|
|
320
|
+
return this.privateState.moveToFirstPanoEffect = s, this.privateState.moveToFirstPanoDuration = p, e.panoIndexList.forEach((n, a) => {
|
|
321
|
+
const o = (() => {
|
|
322
322
|
var v, c;
|
|
323
|
-
const
|
|
324
|
-
if (
|
|
323
|
+
const m = e.panoIndexList.slice(a).find((P) => P !== n);
|
|
324
|
+
if (m === void 0)
|
|
325
325
|
return;
|
|
326
|
-
const f = this.workUtil.getObserverPosition(n), u = this.workUtil.getObserverPosition(
|
|
327
|
-
if (!u || !f || ((v = this.workUtil.getObserver(n)) == null ? void 0 : v.floorIndex) !== ((c = this.workUtil.getObserver(
|
|
326
|
+
const f = this.workUtil.getObserverPosition(n), u = this.workUtil.getObserverPosition(m);
|
|
327
|
+
if (!u || !f || ((v = this.workUtil.getObserver(n)) == null ? void 0 : v.floorIndex) !== ((c = this.workUtil.getObserver(m)) == null ? void 0 : c.floorIndex))
|
|
328
328
|
return;
|
|
329
329
|
const d = new U.Vector3().subVectors(u, f);
|
|
330
330
|
return A(d.normalize());
|
|
331
331
|
})();
|
|
332
332
|
e.moveType === void 0 || e.moveType === "justMove" ? r.push({
|
|
333
|
-
moveIndex:
|
|
333
|
+
moveIndex: a,
|
|
334
334
|
stay: e.stay,
|
|
335
|
-
data: g({ effect: "Move", panoIndex: n, moveEffect: i },
|
|
336
|
-
}) : e.moveType === "moveAndRotate" && (r.push({ moveIndex:
|
|
335
|
+
data: g({ effect: "Move", panoIndex: n, moveEffect: i }, o != null ? o : {})
|
|
336
|
+
}) : e.moveType === "moveAndRotate" && (r.push({ moveIndex: a, stay: e.stay, data: { effect: "Move", panoIndex: n, moveEffect: i } }), o && r.push({ moveIndex: a, stay: e.stay, data: g({ effect: "Rotate", panoIndex: n }, o) }));
|
|
337
337
|
}), {
|
|
338
338
|
keyframesId: S(),
|
|
339
|
-
keyframes: r.map((n,
|
|
339
|
+
keyframes: r.map((n, a) => g({ id: S(), index: a }, n)),
|
|
340
340
|
guildPluginOptions: e.guildPluginOptions,
|
|
341
341
|
useGuildLine: e.useGuildLine
|
|
342
342
|
};
|
|
@@ -356,47 +356,47 @@ class Sr extends G {
|
|
|
356
356
|
const { data: e, state: r, privateState: i, hooks: s } = this;
|
|
357
357
|
if (i.playing || !(e != null && e.keyframes) || (e == null ? void 0 : e.keyframes.length) === 0)
|
|
358
358
|
return;
|
|
359
|
-
const
|
|
360
|
-
i.playId =
|
|
361
|
-
const n = e.keyframes,
|
|
359
|
+
const p = S();
|
|
360
|
+
i.playId = p, i.playing = !0, i.broke = !1;
|
|
361
|
+
const n = e.keyframes, a = this.getPauseData();
|
|
362
362
|
(t == null ? void 0 : t.notEmitEvent) !== !0 && s.emit("play", { userAction: (u = t == null ? void 0 : t.userAction) != null ? u : !0 });
|
|
363
|
-
let
|
|
363
|
+
let o = !1;
|
|
364
364
|
const f = yield (() => y(this, null, function* () {
|
|
365
365
|
var d, v;
|
|
366
366
|
if ((t == null ? void 0 : t.playFromIndex) !== void 0)
|
|
367
367
|
return t.playFromIndex;
|
|
368
368
|
if ((t == null ? void 0 : t.playFromId) !== void 0)
|
|
369
369
|
return (d = this.data) == null ? void 0 : d.keyframes.findIndex((c) => c.id === t.playFromId);
|
|
370
|
-
if (
|
|
371
|
-
const c = (v = this.data) == null ? void 0 : v.keyframes.find((P) => P.id ===
|
|
372
|
-
if (
|
|
370
|
+
if (a != null && a.id) {
|
|
371
|
+
const c = (v = this.data) == null ? void 0 : v.keyframes.find((P) => P.id === a.id);
|
|
372
|
+
if (a != null && a.fiveState && (yield this.move(a.fiveState, {
|
|
373
373
|
moveEffect: i.moveToFirstPanoEffect,
|
|
374
374
|
duration: i.moveToFirstPanoDuration
|
|
375
375
|
})), c) {
|
|
376
376
|
if (c.data.effect === "Move")
|
|
377
377
|
return c.index;
|
|
378
378
|
if (c.data.effect === "Rotate") {
|
|
379
|
-
const P =
|
|
380
|
-
return yield this.playKeyframe(c, { duration: P }),
|
|
379
|
+
const P = a.duration !== void 0 ? a.duration * (1 - a.playedProgress) : void 0;
|
|
380
|
+
return yield this.playKeyframe(c, { duration: P }), o = !0, c.index + 1;
|
|
381
381
|
}
|
|
382
382
|
}
|
|
383
383
|
}
|
|
384
384
|
}))();
|
|
385
385
|
this.clearPauseData();
|
|
386
386
|
for (const d of n) {
|
|
387
|
-
if (i.broke || !r.playing || !i.playing ||
|
|
387
|
+
if (i.broke || !r.playing || !i.playing || p !== i.playId)
|
|
388
388
|
return;
|
|
389
389
|
if (!(f !== void 0 && d.index < f))
|
|
390
390
|
try {
|
|
391
391
|
s.emit("playIndexChange", d.index, d), yield this.playKeyframe(d, {
|
|
392
|
-
moveEffect:
|
|
393
|
-
duration:
|
|
394
|
-
}), d.stay && (yield O(d.stay)),
|
|
392
|
+
moveEffect: o === !1 ? i.moveToFirstPanoEffect : void 0,
|
|
393
|
+
duration: o === !1 && typeof i.moveToFirstPanoDuration == "number" ? i.moveToFirstPanoDuration : void 0
|
|
394
|
+
}), d.stay && (yield O(d.stay)), o === !1 && (o = !0);
|
|
395
395
|
} catch (v) {
|
|
396
396
|
return console.error(v), Promise.resolve("broke");
|
|
397
397
|
}
|
|
398
398
|
}
|
|
399
|
-
r.playing &&
|
|
399
|
+
r.playing && p === i.playId && (this.setState({ playing: !1 }, { userAction: !1 }), s.emit("end"), this.clearPauseData());
|
|
400
400
|
});
|
|
401
401
|
}
|
|
402
402
|
/**
|
|
@@ -411,12 +411,14 @@ class Sr extends G {
|
|
|
411
411
|
* @description: Change play speed
|
|
412
412
|
*/
|
|
413
413
|
changeSpeed(t, e = !0) {
|
|
414
|
-
|
|
415
|
-
|
|
414
|
+
var n;
|
|
415
|
+
const { state: r, privateState: i, hooks: s } = this, { currentPlayKeyframe: p } = i;
|
|
416
|
+
if (s.emit("speedChange", t, { userAction: e }), r.playing && p)
|
|
416
417
|
try {
|
|
417
|
-
const
|
|
418
|
-
|
|
419
|
-
} catch (
|
|
418
|
+
const a = p.originDuration !== void 0 ? p.originDuration * (1 - this.getProgress()) : void 0, o = p.keyframe, { privateState: m } = this;
|
|
419
|
+
((n = this.privateState.currentPlayKeyframe) == null ? void 0 : n.keyframe.id) !== o.id && (this.privateState.currentPlayKeyframe = { keyframe: o }), m.currentPlayQueue.push(this.getPlayPromise(o, { duration: a }));
|
|
420
|
+
} catch (a) {
|
|
421
|
+
console.error(a);
|
|
420
422
|
}
|
|
421
423
|
}
|
|
422
424
|
/**
|
|
@@ -462,29 +464,29 @@ class Sr extends G {
|
|
|
462
464
|
var s;
|
|
463
465
|
const i = t.data;
|
|
464
466
|
if (e.duration = (s = e.duration) != null ? s : t.start !== void 0 && t.end !== void 0 ? t.end - t.start : void 0, !!i)
|
|
465
|
-
return new Promise((
|
|
466
|
-
let
|
|
467
|
+
return new Promise((p, n) => {
|
|
468
|
+
let a = !1;
|
|
467
469
|
this.addInterruptListener(() => {
|
|
468
|
-
if (!
|
|
469
|
-
return this.hooks.emit("broke"), this.privateState.broke = !0, this.setState({ playing: !1 }),
|
|
470
|
+
if (!a)
|
|
471
|
+
return this.hooks.emit("broke"), this.privateState.broke = !0, this.setState({ playing: !1 }), a = !0, n(new Error("play is interupted"));
|
|
470
472
|
});
|
|
471
473
|
try {
|
|
472
|
-
if (
|
|
474
|
+
if (a)
|
|
473
475
|
return;
|
|
474
|
-
const
|
|
475
|
-
|
|
476
|
+
const o = () => {
|
|
477
|
+
p(), a = !0;
|
|
476
478
|
};
|
|
477
479
|
switch (i.effect) {
|
|
478
480
|
case "Move":
|
|
479
|
-
this.move(i, e).then(
|
|
481
|
+
this.move(i, e).then(o);
|
|
480
482
|
break;
|
|
481
483
|
case "Rotate":
|
|
482
|
-
this.rotate(i, e).then(
|
|
484
|
+
this.rotate(i, e).then(o);
|
|
483
485
|
break;
|
|
484
486
|
default:
|
|
485
|
-
this.rotate(i, e).then(
|
|
487
|
+
this.rotate(i, e).then(o);
|
|
486
488
|
}
|
|
487
|
-
} catch (
|
|
489
|
+
} catch (o) {
|
|
488
490
|
}
|
|
489
491
|
});
|
|
490
492
|
});
|
|
@@ -539,26 +541,26 @@ class Sr extends G {
|
|
|
539
541
|
*/
|
|
540
542
|
updateCamera(r) {
|
|
541
543
|
return y(this, arguments, function* (t, e = {}) {
|
|
542
|
-
const { five: i, privateState: s, state:
|
|
544
|
+
const { five: i, privateState: s, state: p } = this, n = (() => {
|
|
543
545
|
var u, d;
|
|
544
|
-
const
|
|
545
|
-
if ((
|
|
546
|
+
const m = (u = p.config) == null ? void 0 : u.speedConfig, f = (d = t.rotateSpeed) != null ? d : m == null ? void 0 : m.rotateSpeed;
|
|
547
|
+
if ((m == null ? void 0 : m.rotateSpeedUnit) === void 0)
|
|
546
548
|
return f;
|
|
547
549
|
if (f !== void 0)
|
|
548
|
-
return
|
|
549
|
-
})(),
|
|
550
|
+
return m.rotateSpeedUnit === "rad/ms" ? f : f / 1e3;
|
|
551
|
+
})(), a = (() => {
|
|
550
552
|
if (e.duration)
|
|
551
553
|
return e.duration;
|
|
552
554
|
if (n) {
|
|
553
|
-
const
|
|
554
|
-
return L(
|
|
555
|
+
const m = this.five.getCurrentState();
|
|
556
|
+
return L(m, t) / n;
|
|
555
557
|
}
|
|
556
558
|
return 800;
|
|
557
559
|
})();
|
|
558
|
-
s.currentPlayKeyframe && (s.currentPlayKeyframe.originDuration =
|
|
559
|
-
const
|
|
560
|
-
return new Promise((
|
|
561
|
-
T(() => i.updateCamera(t,
|
|
560
|
+
s.currentPlayKeyframe && (s.currentPlayKeyframe.originDuration = a);
|
|
561
|
+
const o = this.getSpeededDuration(a);
|
|
562
|
+
return new Promise((m) => {
|
|
563
|
+
T(() => i.updateCamera(t, o)), setTimeout(() => m(), o);
|
|
562
564
|
});
|
|
563
565
|
});
|
|
564
566
|
}
|
|
@@ -570,36 +572,36 @@ class Sr extends G {
|
|
|
570
572
|
const { five: r, privateState: i, state: s } = this;
|
|
571
573
|
if (typeof t.panoIndex != "number" || t.panoIndex === r.panoIndex)
|
|
572
574
|
return;
|
|
573
|
-
const
|
|
574
|
-
|
|
575
|
+
const p = r.getCurrentState().mode !== "Panorama";
|
|
576
|
+
p && (this.privateState.modeChanging = !0);
|
|
575
577
|
const n = (() => {
|
|
576
578
|
var f, u;
|
|
577
|
-
const
|
|
578
|
-
if ((
|
|
579
|
-
return
|
|
580
|
-
if (
|
|
581
|
-
return
|
|
582
|
-
})(),
|
|
579
|
+
const o = (f = s.config) == null ? void 0 : f.speedConfig, m = (u = t.moveSpeed) != null ? u : o == null ? void 0 : o.moveSpeed;
|
|
580
|
+
if ((o == null ? void 0 : o.moveSpeedUnit) === void 0)
|
|
581
|
+
return m;
|
|
582
|
+
if (m !== void 0)
|
|
583
|
+
return o.moveSpeedUnit === "m/ms" ? m : m / 1e3;
|
|
584
|
+
})(), a = (() => {
|
|
583
585
|
if (e != null && e.duration)
|
|
584
586
|
return e.duration;
|
|
585
587
|
if (n && typeof r.panoIndex == "number" && typeof t.panoIndex == "number") {
|
|
586
|
-
const
|
|
587
|
-
return
|
|
588
|
+
const o = this.workUtil.getObserverPosition(r.panoIndex), m = this.workUtil.getObserverPosition(t.panoIndex);
|
|
589
|
+
return o && m ? o.distanceTo(m) / n : 800;
|
|
588
590
|
}
|
|
589
591
|
return 800;
|
|
590
592
|
})();
|
|
591
|
-
i.currentPlayKeyframe && (i.currentPlayKeyframe.originDuration =
|
|
592
|
-
var
|
|
593
|
+
i.currentPlayKeyframe && (i.currentPlayKeyframe.originDuration = a), yield new Promise((o) => {
|
|
594
|
+
var m, f, u;
|
|
593
595
|
this.fiveUtil.moveToPano(t.panoIndex, {
|
|
594
596
|
latitude: t.latitude,
|
|
595
597
|
longitude: t.longitude,
|
|
596
598
|
fov: t.fov,
|
|
597
|
-
duration: this.getSpeededDuration(
|
|
598
|
-
effect: (u = (f = e == null ? void 0 : e.moveEffect) != null ? f : (
|
|
599
|
-
moveCancelCallback: () =>
|
|
600
|
-
moveEndCallback: () =>
|
|
601
|
-
}),
|
|
602
|
-
}),
|
|
599
|
+
duration: this.getSpeededDuration(a),
|
|
600
|
+
effect: (u = (f = e == null ? void 0 : e.moveEffect) != null ? f : (m = this.state.config) == null ? void 0 : m.moveEffect) != null ? u : t.moveEffect,
|
|
601
|
+
moveCancelCallback: () => o(),
|
|
602
|
+
moveEndCallback: () => o()
|
|
603
|
+
}), p && r.once("panoArrived", () => o());
|
|
604
|
+
}), p && (this.privateState.modeChanging = !1);
|
|
603
605
|
});
|
|
604
606
|
}
|
|
605
607
|
/**
|
package/libs/base/BasePlugin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function A() {
|
|
2
2
|
console.debug(
|
|
3
|
-
"%c %c@realsee/dnalogel %cv3.50.
|
|
3
|
+
"%c %c@realsee/dnalogel %cv3.50.8",
|
|
4
4
|
[
|
|
5
5
|
"background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAMCAMAAACHgmeRAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABLFBMVEUAAAAapPoap/oaqvkbrfkbr/gZnfwZoPsaqfnD4v/E4/8Ylv0clPm93/+/4P/B4f8Yj/683/8Wif+33P8Uhv+x2f8ShP+s1v8Pgf+n0/8Nf/+h0f8Lff8Lff8Nf/9dl/+czv8KfP8KfP+Lxf+Uyv+Xy/+Hwv+Jw/+Mxf+Oxv+RyP8aovsapfoap/oZmfwZm/wZnvsYnPsYkf4YlP0NePsDYfgYcfi43f+63v8Xiv8Xjf4EWfwCV/sWZ/qz2v+02/8Vh/8WiP8EUf8CTf4WXv2u1/+v2P8Thf8Thv8ETf8CR/8VV/+o1f+q1f8Qgv8Rg/8DSv8BRf8UVP+j0v+k0v8OgP8Pgf8DR/8DQv9Nhf+dzv+fz/+Kv/+Vyv+Xy/+azf+Oxv+Qx/+SyP////8MUhLdAAAAK3RSTlMACEWQ2bd98uQECPXxqO7c+Pb49vj2+Pb49vj23Oul8fMHA+TwerXXjEIG2P+bHgAAAAFiS0dEY1y+LaoAAAB+SURBVAjXY2BgZGJmYWVgYGBgY9fW0eVg4ORi4NbTNzDk4eXjZxAwMjYxNTO3EGQQsrSytrG1sxdmEHFwdHJ2cXUTZRBz9/D08vbxFWeQ8PMPCAwKDpFkkAoNC4+IjIqWZpCRlZOPiY2LV2BQVGJQTkhMUlEFWaOmrqGpxQAAyg0S9Dq+VPYAAAAASUVORK5CYII=')",
|
|
6
6
|
"background-repeat: no-repeat",
|