@realsee/dnalogel 3.10.1 → 3.10.3
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/AreaMakerPlugin/Controller.d.ts +0 -2
- package/dist/AreaMakerPlugin/utils/Item.d.ts +1 -0
- package/dist/CruisePlugin/BaseController.d.ts +6 -0
- package/dist/CruisePlugin/Work.d.ts +6 -2
- package/dist/GuideLinePlugin/Controller.d.ts +1 -1
- package/dist/PanoTagPlugin/utils/index.d.ts +0 -1
- package/dist/index.cjs.js +49 -49
- package/dist/index.js +1994 -1994
- package/dist/index.umd.js +41 -41
- package/libs/AreaMakerPlugin/Controller.d.ts +0 -2
- package/libs/AreaMakerPlugin/Controller.js +58 -59
- package/libs/AreaMakerPlugin/index.js +3 -2
- package/libs/AreaMakerPlugin/utils/Item.d.ts +1 -0
- package/libs/AreaMakerPlugin/utils/Item.js +35 -32
- package/libs/CruisePlugin/BaseController.d.ts +6 -0
- package/libs/CruisePlugin/BaseController.js +52 -51
- package/libs/CruisePlugin/Work.d.ts +6 -2
- package/libs/CruisePlugin/Work.js +82 -83
- package/libs/CruisePlugin/index.js +1 -1
- package/libs/GuideLinePlugin/Controller.d.ts +1 -1
- package/libs/GuideLinePlugin/Controller.js +14 -14
- package/libs/GuideLinePlugin/GuideLineItem.js +1 -1
- package/libs/GuideLinePlugin/GuideLineModeItem.js +1 -1
- package/libs/GuideLinePlugin/index.js +12 -12
- package/libs/PanoTagPlugin/controller/index.js +1 -1
- package/libs/PanoTagPlugin/index.js +1 -1
- package/libs/PanoTagPlugin/utils/index.d.ts +0 -1
- package/libs/PanoTagPlugin/utils/index.js +4 -6
- package/libs/base/BasePlugin.js +1 -1
- package/libs/index.js +5 -5
- package/libs/shared-utils/logger.js +1 -1
- package/package.json +1 -1
- /package/dist/{PanoTagPlugin/utils → shared-utils/dom}/resizeObserver.d.ts +0 -0
- /package/libs/{PanoTagPlugin/utils → shared-utils/dom}/resizeObserver.d.ts +0 -0
- /package/libs/{PanoTagPlugin/utils → shared-utils/dom}/resizeObserver.js +0 -0
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var u = (a, s, e) => s in a ?
|
|
1
|
+
var c = Object.defineProperty;
|
|
2
|
+
var f = Object.getOwnPropertySymbols;
|
|
3
|
+
var v = Object.prototype.hasOwnProperty, S = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var u = (a, s, e) => s in a ? c(a, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[s] = e, g = (a, s) => {
|
|
5
5
|
for (var e in s || (s = {}))
|
|
6
|
-
|
|
7
|
-
if (
|
|
8
|
-
for (var e of
|
|
9
|
-
|
|
6
|
+
v.call(s, e) && u(a, e, s[e]);
|
|
7
|
+
if (f)
|
|
8
|
+
for (var e of f(s))
|
|
9
|
+
S.call(s, e) && u(a, e, s[e]);
|
|
10
10
|
return a;
|
|
11
11
|
};
|
|
12
12
|
var d = (a, s, e) => (u(a, typeof s != "symbol" ? s + "" : s, e), e);
|
|
13
|
-
var
|
|
13
|
+
var p = (a, s, e) => new Promise((t, i) => {
|
|
14
14
|
var r = (h) => {
|
|
15
15
|
try {
|
|
16
16
|
n(e.next(h));
|
|
17
17
|
} catch (o) {
|
|
18
|
-
|
|
18
|
+
i(o);
|
|
19
19
|
}
|
|
20
|
-
},
|
|
20
|
+
}, m = (h) => {
|
|
21
21
|
try {
|
|
22
22
|
n(e.throw(h));
|
|
23
23
|
} catch (o) {
|
|
24
|
-
|
|
24
|
+
i(o);
|
|
25
25
|
}
|
|
26
|
-
}, n = (h) => h.done ?
|
|
26
|
+
}, n = (h) => h.done ? t(h.value) : Promise.resolve(h.value).then(r, m);
|
|
27
27
|
n((e = e.apply(a, s)).next());
|
|
28
28
|
});
|
|
29
|
-
import { Controller as
|
|
30
|
-
import { equal as
|
|
31
|
-
import { objectAssignDeepExports as
|
|
29
|
+
import { Controller as y } from "../base/BasePlugin.js";
|
|
30
|
+
import { equal as L } from "../shared-utils/equal.js";
|
|
31
|
+
import { objectAssignDeepExports as C } from "../vendor/object-assign-deep/objectAssignDeep.js";
|
|
32
32
|
import "../shared-utils/Subscribe.js";
|
|
33
33
|
import "hammerjs";
|
|
34
34
|
import "three";
|
|
@@ -51,10 +51,10 @@ import "../CSS3DRenderPlugin/utils/three/CSS3DGroup.js";
|
|
|
51
51
|
import "../CSS3DRenderPlugin/utils/generateBehindFiveElement.js";
|
|
52
52
|
import "../shared-utils/url/absoluteUrl.js";
|
|
53
53
|
import "../shared-utils/isTruelyObject.js";
|
|
54
|
-
const
|
|
55
|
-
class
|
|
56
|
-
constructor(e,
|
|
57
|
-
super(e,
|
|
54
|
+
const b = "CruisePlugin", l = `${b}`, R = (a) => `${l}--${a}`;
|
|
55
|
+
class T extends y {
|
|
56
|
+
constructor(e, t) {
|
|
57
|
+
super(e, t);
|
|
58
58
|
d(this, "state", {
|
|
59
59
|
visible: !0,
|
|
60
60
|
enabled: !0,
|
|
@@ -64,6 +64,7 @@ class X extends L {
|
|
|
64
64
|
});
|
|
65
65
|
d(this, "data");
|
|
66
66
|
d(this, "config");
|
|
67
|
+
d(this, "pauseDataMap", /* @__PURE__ */ new Map());
|
|
67
68
|
d(this, "privateState", {
|
|
68
69
|
playing: !1,
|
|
69
70
|
broke: !1,
|
|
@@ -79,7 +80,7 @@ class X extends L {
|
|
|
79
80
|
d(this, "disableErrorLog", () => {
|
|
80
81
|
console.error(`${l} is disabled`);
|
|
81
82
|
});
|
|
82
|
-
this.config =
|
|
83
|
+
this.config = t, Object.assign(window, { [`__${b}_DEBUG__`]: this });
|
|
83
84
|
}
|
|
84
85
|
/**
|
|
85
86
|
* @description Play | Continue play. if have been paused, continue play from the pause position; if playing, do nothing
|
|
@@ -97,7 +98,7 @@ class X extends L {
|
|
|
97
98
|
* @description Show guide line
|
|
98
99
|
*/
|
|
99
100
|
show(e) {
|
|
100
|
-
return
|
|
101
|
+
return p(this, null, function* () {
|
|
101
102
|
this.setState({ visible: !0 }, e);
|
|
102
103
|
});
|
|
103
104
|
}
|
|
@@ -105,7 +106,7 @@ class X extends L {
|
|
|
105
106
|
* @description Hide guide line
|
|
106
107
|
*/
|
|
107
108
|
hide(e) {
|
|
108
|
-
return
|
|
109
|
+
return p(this, null, function* () {
|
|
109
110
|
this.setState({ visible: !1 }, e);
|
|
110
111
|
});
|
|
111
112
|
}
|
|
@@ -130,50 +131,50 @@ class X extends L {
|
|
|
130
131
|
/**
|
|
131
132
|
* @description Set state
|
|
132
133
|
*/
|
|
133
|
-
setState(e,
|
|
134
|
+
setState(e, t) {
|
|
134
135
|
var r;
|
|
135
136
|
if (this.state.disposed)
|
|
136
137
|
return this.disposedErrorLog();
|
|
137
138
|
if (!this.state.enabled && e.enabled !== !0 && e.disposed !== !0)
|
|
138
139
|
return this.disableErrorLog();
|
|
139
|
-
const
|
|
140
|
-
this.state =
|
|
140
|
+
const i = g({}, this.state);
|
|
141
|
+
this.state = C({}, this.state, e), e.disposed !== void 0 && e.disposed !== i.disposed && e.disposed && this.handleDispose(), e.visible !== void 0 && e.visible !== i.visible && this.handleVisible(e.visible, t == null ? void 0 : t.userAction), e.enabled !== void 0 && e.enabled !== i.enabled && this.handleEnable(e.enabled, t == null ? void 0 : t.userAction), e.playing !== void 0 && e.playing !== i.playing && this.changePlayState(e.playing, t), e.speed !== void 0 && e.speed !== i.speed && this.changeSpeed(e.speed), L(i, this.state, { deep: !0 }) || this.hooks.emit("stateChange", { state: this.state, prevState: i, userAction: (r = t == null ? void 0 : t.userAction) != null ? r : !0 });
|
|
141
142
|
}
|
|
142
143
|
/**
|
|
143
144
|
* @description Clear pause data
|
|
144
145
|
*/
|
|
145
146
|
clearPauseData() {
|
|
146
|
-
var e,
|
|
147
|
+
var e, t;
|
|
147
148
|
if ((e = this.data) != null && e.id)
|
|
148
|
-
return
|
|
149
|
+
return this.pauseDataMap.delete((t = this.data) == null ? void 0 : t.id);
|
|
149
150
|
}
|
|
150
|
-
changePlayState(e,
|
|
151
|
+
changePlayState(e, t) {
|
|
151
152
|
this.actionIfStateIsEnabled(
|
|
152
153
|
() => {
|
|
153
|
-
var
|
|
154
|
-
return this.hooks.emit("playStateChange", e ? "playing" : "pause", { userAction: (
|
|
154
|
+
var i;
|
|
155
|
+
return this.hooks.emit("playStateChange", e ? "playing" : "pause", { userAction: (i = t == null ? void 0 : t.userAction) != null ? i : !0 });
|
|
155
156
|
}
|
|
156
|
-
), e ? this.handlePlay(
|
|
157
|
+
), e ? this.handlePlay(t) : this.handlePause(t), this.state.playing = e;
|
|
157
158
|
}
|
|
158
|
-
handleEnable(e,
|
|
159
|
-
var
|
|
160
|
-
e ? ((
|
|
159
|
+
handleEnable(e, t = !0) {
|
|
160
|
+
var i, r;
|
|
161
|
+
e ? ((i = this.GuideLine) == null || i.enable(), this.hooks.emit("enable", { userAction: t })) : ((r = this.GuideLine) == null || r.disable(), this.changePlayState(!1, { userAction: t }), this.hooks.emit("disable", { userAction: t })), this.state.enabled = e;
|
|
161
162
|
}
|
|
162
|
-
handleVisible(e,
|
|
163
|
-
var
|
|
164
|
-
e ? ((
|
|
163
|
+
handleVisible(e, t = !0) {
|
|
164
|
+
var i, r;
|
|
165
|
+
e ? ((i = this.GuideLine) == null || i.show(), this.actionIfStateIsEnabled(() => this.hooks.emit("show", { userAction: t }))) : ((r = this.GuideLine) == null || r.hide(), this.actionIfStateIsEnabled(() => this.hooks.emit("hide", { userAction: t }))), this.state.visible = e;
|
|
165
166
|
}
|
|
166
167
|
/**
|
|
167
168
|
* @description: listen interupted by five gesture
|
|
168
169
|
*/
|
|
169
170
|
addInterruptListener(e) {
|
|
170
|
-
const
|
|
171
|
+
const t = () => {
|
|
171
172
|
this.privateState.modeChanging || e();
|
|
172
|
-
},
|
|
173
|
-
r !== "mouseMove" && (e(), this.five.off("gesture",
|
|
173
|
+
}, i = (r) => {
|
|
174
|
+
r !== "mouseMove" && (e(), this.five.off("gesture", i));
|
|
174
175
|
};
|
|
175
|
-
return this.five.on("gesture",
|
|
176
|
-
this.five.off("gesture",
|
|
176
|
+
return this.five.on("gesture", i), this.five.once("wantsChangeMode", t), () => {
|
|
177
|
+
this.five.off("gesture", i), this.five.off("wantsChangeMode", t);
|
|
177
178
|
};
|
|
178
179
|
}
|
|
179
180
|
/**
|
|
@@ -191,16 +192,16 @@ class X extends L {
|
|
|
191
192
|
getPauseData() {
|
|
192
193
|
var e;
|
|
193
194
|
if ((e = this.data) != null && e.id)
|
|
194
|
-
return
|
|
195
|
+
return this.pauseDataMap.get(this.data.id);
|
|
195
196
|
}
|
|
196
197
|
/**
|
|
197
198
|
* @description Set pause data
|
|
198
199
|
*/
|
|
199
200
|
setPauseData() {
|
|
200
|
-
var
|
|
201
|
-
const e = (
|
|
201
|
+
var t;
|
|
202
|
+
const e = (t = this.data) == null ? void 0 : t.id;
|
|
202
203
|
if (e)
|
|
203
|
-
return
|
|
204
|
+
return this.pauseDataMap.set(e, {
|
|
204
205
|
fiveState: this.five.getCurrentState(),
|
|
205
206
|
playedProgress: this.getProgress()
|
|
206
207
|
});
|
|
@@ -219,13 +220,13 @@ class X extends L {
|
|
|
219
220
|
/**
|
|
220
221
|
* @description Action function if plugin is enable
|
|
221
222
|
*/
|
|
222
|
-
actionIfStateIsEnabled(e,
|
|
223
|
+
actionIfStateIsEnabled(e, t) {
|
|
223
224
|
if (this.state.enabled)
|
|
224
225
|
return e();
|
|
225
|
-
|
|
226
|
+
t != null && t.warnLog && this.disableWarnLog();
|
|
226
227
|
}
|
|
227
228
|
}
|
|
228
229
|
export {
|
|
229
|
-
|
|
230
|
-
|
|
230
|
+
T as default,
|
|
231
|
+
R as pluginFlag
|
|
231
232
|
};
|
|
@@ -75,10 +75,14 @@ export default class WalkController extends CruiseController<PluginData, Config>
|
|
|
75
75
|
/**
|
|
76
76
|
* @description Set pause data
|
|
77
77
|
*/
|
|
78
|
-
protected setPauseData(): Map<string, {
|
|
78
|
+
protected setPauseData(): Map<string | number, {
|
|
79
79
|
fiveState: Partial<State>;
|
|
80
80
|
id?: string | number;
|
|
81
|
-
playedProgress: number;
|
|
81
|
+
playedProgress: number; /**
|
|
82
|
+
* privateState.playing 和 state.playing 的区别:
|
|
83
|
+
* state.playing 先为true,然后才 handleplay,handleplay方法内会检查privateState.playing,如果已经开始(privateState.playing === true),就不执行操作,如果为false,就执行操作
|
|
84
|
+
* 其实就是加了一个不允许重复执行handleplay的逻辑
|
|
85
|
+
*/
|
|
82
86
|
duration?: number;
|
|
83
87
|
}>;
|
|
84
88
|
/**
|
|
@@ -11,8 +11,8 @@ var I = (h, l, t) => l in h ? D(h, l, { enumerable: !0, configurable: !0, writab
|
|
|
11
11
|
return h;
|
|
12
12
|
}, x = (h, l) => C(h, K(l));
|
|
13
13
|
var k = (h, l, t) => (I(h, typeof l != "symbol" ? l + "" : l, t), t);
|
|
14
|
-
var y = (h, l, t) => new Promise((
|
|
15
|
-
var
|
|
14
|
+
var y = (h, l, t) => new Promise((e, r) => {
|
|
15
|
+
var i = (d) => {
|
|
16
16
|
try {
|
|
17
17
|
s(t.next(d));
|
|
18
18
|
} catch (o) {
|
|
@@ -24,7 +24,7 @@ var y = (h, l, t) => new Promise((i, r) => {
|
|
|
24
24
|
} catch (o) {
|
|
25
25
|
r(o);
|
|
26
26
|
}
|
|
27
|
-
}, s = (d) => d.done ?
|
|
27
|
+
}, s = (d) => d.done ? e(d.value) : Promise.resolve(d.value).then(i, n);
|
|
28
28
|
s((t = t.apply(h, l)).next());
|
|
29
29
|
});
|
|
30
30
|
import { GuideLinePlugin as M } from "../GuideLinePlugin/index.js";
|
|
@@ -82,9 +82,9 @@ import "../PanoTagPlugin/utils/addDebugPoints.js";
|
|
|
82
82
|
import "../PanoTagPlugin/utils/tag/tagCheck.js";
|
|
83
83
|
import "../PanoTagPlugin/utils/debounce.js";
|
|
84
84
|
import "../PanoTagPlugin/utils/throttle.js";
|
|
85
|
-
import "../PanoTagPlugin/utils/resizeObserver.js";
|
|
86
85
|
import "../PanoTagPlugin/utils/tag/format.js";
|
|
87
86
|
import "../shared-utils/audio.js";
|
|
87
|
+
import "../shared-utils/dom/resizeObserver.js";
|
|
88
88
|
import "../PanoTagPlugin/controller/TagRender.js";
|
|
89
89
|
import "../PanoTagPlugin/controller/TagComputer.js";
|
|
90
90
|
import "../PanoTagPlugin/utils/tagPosition.js";
|
|
@@ -202,10 +202,9 @@ import "./utils/getFiveStateOnCurve.js";
|
|
|
202
202
|
import "../shared-utils/formatRad.js";
|
|
203
203
|
import "./Work.js";
|
|
204
204
|
import "./utils/coordinatesToVector.js";
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
super(t, i);
|
|
205
|
+
class tr extends R {
|
|
206
|
+
constructor(t, e) {
|
|
207
|
+
super(t, e);
|
|
209
208
|
k(this, "state", {
|
|
210
209
|
visible: !0,
|
|
211
210
|
enabled: !0,
|
|
@@ -228,19 +227,19 @@ class er extends R {
|
|
|
228
227
|
broke: !1,
|
|
229
228
|
modeChanging: !1
|
|
230
229
|
});
|
|
231
|
-
this.config =
|
|
230
|
+
this.config = e, Object.assign(window, { __WalkPlugin_DEBUG__: this });
|
|
232
231
|
}
|
|
233
232
|
/**
|
|
234
233
|
* @description Load Data and State
|
|
235
234
|
*/
|
|
236
|
-
load(t,
|
|
235
|
+
load(t, e, r) {
|
|
237
236
|
return y(this, null, function* () {
|
|
238
237
|
var a, m;
|
|
239
238
|
if (this.state.disposed)
|
|
240
239
|
return this.disposedErrorLog();
|
|
241
240
|
this.clear();
|
|
242
|
-
const
|
|
243
|
-
this.data = g({ id: n.keyframesId }, n), this.hooks.emit("dataChange", n,
|
|
241
|
+
const i = this.data ? JSON.parse(JSON.stringify(this.data)) : void 0, n = yield this.formatData(t);
|
|
242
|
+
this.data = g({ id: n.keyframesId }, n), this.hooks.emit("dataChange", n, i);
|
|
244
243
|
let s = [], d;
|
|
245
244
|
const o = this.data.keyframes.filter((p) => p.data.panoIndex !== void 0);
|
|
246
245
|
o.filter((p, f) => {
|
|
@@ -258,7 +257,7 @@ class er extends R {
|
|
|
258
257
|
const c = s.length;
|
|
259
258
|
s[c] = [p];
|
|
260
259
|
}
|
|
261
|
-
}), !this.GuideLine && ((a = this.config) == null ? void 0 : a.useGuideLine) !== !1 && n.useGuildLine !== !1 && (this.GuideLine = M(this.five, this.config)), (m = this.GuideLine) == null || m.load({ routes: s.map((p) => ({ panoIndexList: p })), config: n.guildPluginOptions }),
|
|
260
|
+
}), !this.GuideLine && ((a = this.config) == null ? void 0 : a.useGuideLine) !== !1 && n.useGuildLine !== !1 && (this.GuideLine = M(this.five, this.config)), (m = this.GuideLine) == null || m.load({ routes: s.map((p) => ({ panoIndexList: p })), config: n.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", n), this.hooks.emit("dataLoaded", n);
|
|
262
261
|
});
|
|
263
262
|
}
|
|
264
263
|
/**
|
|
@@ -267,8 +266,8 @@ class er extends R {
|
|
|
267
266
|
* @param {string} options.id play from keyframes id
|
|
268
267
|
*/
|
|
269
268
|
playFrom(t) {
|
|
270
|
-
const { index:
|
|
271
|
-
this.state.playing && this.setState({ playing: !1 }, { userAction:
|
|
269
|
+
const { index: e, id: r, userAction: i } = t;
|
|
270
|
+
this.state.playing && this.setState({ playing: !1 }, { userAction: i }), this.setState({ playing: !0 }, { userAction: i, playFromIndex: e, playFromId: r });
|
|
272
271
|
}
|
|
273
272
|
/**
|
|
274
273
|
* @description Play from first keyframe
|
|
@@ -282,21 +281,21 @@ class er extends R {
|
|
|
282
281
|
formatData(t) {
|
|
283
282
|
return y(this, null, function* () {
|
|
284
283
|
this.five.work || (yield U(this.five));
|
|
285
|
-
const
|
|
286
|
-
const
|
|
287
|
-
return typeof
|
|
284
|
+
const e = this.five.work.observers, r = (() => {
|
|
285
|
+
const i = t;
|
|
286
|
+
return typeof i == "object" && i !== null && i.version && i.data ? i.data : i;
|
|
288
287
|
})();
|
|
289
288
|
if (r.keyframes)
|
|
290
289
|
return {
|
|
291
290
|
keyframesId: S(),
|
|
292
|
-
keyframes: r.keyframes.map((
|
|
291
|
+
keyframes: r.keyframes.map((i, n) => {
|
|
293
292
|
var o;
|
|
294
|
-
const s = r.keyframes[n + 1], d = (() => !s || s.start === void 0 ||
|
|
295
|
-
return x(g({ id: (o =
|
|
293
|
+
const s = r.keyframes[n + 1], d = (() => !s || s.start === void 0 || i.end === void 0 ? 0 : s.start - i.end)();
|
|
294
|
+
return x(g({ id: (o = i.uuid) != null ? o : S(), moveIndex: n, stay: d, index: n }, i), { guildPluginOptions: r.guildPluginOptions });
|
|
296
295
|
})
|
|
297
296
|
};
|
|
298
297
|
if (r.panoIndexList) {
|
|
299
|
-
let
|
|
298
|
+
let i = [];
|
|
300
299
|
const { moveEffect: n, moveToFirstPanoEffect: s, moveToFirstPanoDuration: d } = r;
|
|
301
300
|
return this.privateState.moveToFirstPanoEffect = s, this.privateState.moveToFirstPanoDuration = d, r.panoIndexList.forEach((o, a) => {
|
|
302
301
|
const m = (() => {
|
|
@@ -304,20 +303,20 @@ class er extends R {
|
|
|
304
303
|
const p = r.panoIndexList.slice(a).find((F) => F !== o);
|
|
305
304
|
if (p === void 0)
|
|
306
305
|
return;
|
|
307
|
-
const f = (c =
|
|
308
|
-
if (!u || !f || ((w =
|
|
306
|
+
const f = (c = e[o]) == null ? void 0 : c.position, u = (P = e[p]) == null ? void 0 : P.position;
|
|
307
|
+
if (!u || !f || ((w = e[o]) == null ? void 0 : w.floorIndex) !== ((b = e[p]) == null ? void 0 : b.floorIndex))
|
|
309
308
|
return;
|
|
310
309
|
const v = new O.Vector3().subVectors(u, f);
|
|
311
310
|
return _(v.normalize());
|
|
312
311
|
})();
|
|
313
|
-
r.moveType === void 0 || r.moveType === "justMove" ?
|
|
312
|
+
r.moveType === void 0 || r.moveType === "justMove" ? i.push({
|
|
314
313
|
moveIndex: a,
|
|
315
314
|
stay: r.stay,
|
|
316
315
|
data: g({ effect: "Move", panoIndex: o, moveEffect: n }, m != null ? m : {})
|
|
317
|
-
}) : r.moveType === "moveAndRotate" && (
|
|
316
|
+
}) : r.moveType === "moveAndRotate" && (i.push({ moveIndex: a, stay: r.stay, data: { effect: "Move", panoIndex: o, moveEffect: n } }), m && i.push({ moveIndex: a, stay: r.stay, data: g({ effect: "Rotate", panoIndex: o }, m) }));
|
|
318
317
|
}), {
|
|
319
318
|
keyframesId: S(),
|
|
320
|
-
keyframes:
|
|
319
|
+
keyframes: i.map((o, a) => g({ id: S(), index: a }, o)),
|
|
321
320
|
guildPluginOptions: r.guildPluginOptions,
|
|
322
321
|
useGuildLine: r.useGuildLine
|
|
323
322
|
};
|
|
@@ -334,12 +333,12 @@ class er extends R {
|
|
|
334
333
|
handlePlay(t) {
|
|
335
334
|
return y(this, null, function* () {
|
|
336
335
|
var f;
|
|
337
|
-
const { data:
|
|
338
|
-
if (
|
|
336
|
+
const { data: e, state: r, privateState: i, hooks: n } = this;
|
|
337
|
+
if (i.playing || !(e != null && e.keyframes) || (e == null ? void 0 : e.keyframes.length) === 0)
|
|
339
338
|
return;
|
|
340
339
|
const s = S();
|
|
341
|
-
|
|
342
|
-
const d =
|
|
340
|
+
i.playId = s, i.playing = !0, i.broke = !1;
|
|
341
|
+
const d = e.keyframes, o = this.getPauseData();
|
|
343
342
|
(t == null ? void 0 : t.notEmitEvent) !== !0 && n.emit("play", { userAction: (f = t == null ? void 0 : t.userAction) != null ? f : !0 });
|
|
344
343
|
let a = !1;
|
|
345
344
|
const p = yield (() => y(this, null, function* () {
|
|
@@ -351,8 +350,8 @@ class er extends R {
|
|
|
351
350
|
if (o != null && o.id) {
|
|
352
351
|
const c = (v = this.data) == null ? void 0 : v.keyframes.find((P) => P.id === o.id);
|
|
353
352
|
if (o != null && o.fiveState && (yield this.move(o.fiveState, {
|
|
354
|
-
moveEffect:
|
|
355
|
-
duration:
|
|
353
|
+
moveEffect: i.moveToFirstPanoEffect,
|
|
354
|
+
duration: i.moveToFirstPanoDuration
|
|
356
355
|
})), c) {
|
|
357
356
|
if (c.data.effect === "Move")
|
|
358
357
|
return c.index;
|
|
@@ -365,19 +364,19 @@ class er extends R {
|
|
|
365
364
|
}))();
|
|
366
365
|
this.clearPauseData();
|
|
367
366
|
for (const u of d) {
|
|
368
|
-
if (
|
|
367
|
+
if (i.broke || !r.playing || !i.playing || s !== i.playId)
|
|
369
368
|
return;
|
|
370
369
|
if (!(p !== void 0 && u.index < p))
|
|
371
370
|
try {
|
|
372
371
|
n.emit("playIndexChange", u.index, u), yield this.playKeyframe(u, {
|
|
373
|
-
moveEffect: a === !1 ?
|
|
374
|
-
duration: a === !1 && typeof
|
|
372
|
+
moveEffect: a === !1 ? i.moveToFirstPanoEffect : void 0,
|
|
373
|
+
duration: a === !1 && typeof i.moveToFirstPanoDuration == "number" ? i.moveToFirstPanoDuration : void 0
|
|
375
374
|
}), u.stay && (yield Q(u.stay)), a === !1 && (a = !0);
|
|
376
375
|
} catch (v) {
|
|
377
376
|
return console.error(v), Promise.resolve("broke");
|
|
378
377
|
}
|
|
379
378
|
}
|
|
380
|
-
r.playing && s ===
|
|
379
|
+
r.playing && s === i.playId && (this.setState({ playing: !1 }, { userAction: !1 }), n.emit("end"), this.clearPauseData());
|
|
381
380
|
});
|
|
382
381
|
}
|
|
383
382
|
/**
|
|
@@ -385,18 +384,18 @@ class er extends R {
|
|
|
385
384
|
*/
|
|
386
385
|
handlePause(t) {
|
|
387
386
|
var n;
|
|
388
|
-
const { state:
|
|
389
|
-
|
|
387
|
+
const { state: e, privateState: r, hooks: i } = this;
|
|
388
|
+
e.playing = !1, r.playing !== !1 && (r.playing = !1, (t == null ? void 0 : t.userAction) !== !1 && this.setPauseData(), r.broke || this.forceInteruptUpdateCamera(), (t == null ? void 0 : t.notEmitEvent) !== !0 && i.emit("pause", { userAction: (n = t == null ? void 0 : t.userAction) != null ? n : !0 }));
|
|
390
389
|
}
|
|
391
390
|
/**
|
|
392
391
|
* @description: Change play speed
|
|
393
392
|
*/
|
|
394
|
-
changeSpeed(t,
|
|
395
|
-
const { state: r, privateState:
|
|
396
|
-
if (n.emit("speedChange", t, { userAction:
|
|
393
|
+
changeSpeed(t, e = !0) {
|
|
394
|
+
const { state: r, privateState: i, hooks: n } = this, { currentPlayKeyframe: s } = i;
|
|
395
|
+
if (n.emit("speedChange", t, { userAction: e }), r.playing && s)
|
|
397
396
|
try {
|
|
398
397
|
const d = s.originDuration !== void 0 ? s.originDuration * (1 - this.getProgress()) : void 0, o = this.playKeyframe(s.keyframe, { duration: d });
|
|
399
|
-
|
|
398
|
+
i.currentPlayQueue.push(o);
|
|
400
399
|
} catch (d) {
|
|
401
400
|
}
|
|
402
401
|
}
|
|
@@ -410,12 +409,12 @@ class er extends R {
|
|
|
410
409
|
* @description Set pause data
|
|
411
410
|
*/
|
|
412
411
|
setPauseData() {
|
|
413
|
-
var t,
|
|
414
|
-
if ((t = this.data) != null && t.
|
|
415
|
-
return
|
|
416
|
-
id: (
|
|
412
|
+
var t, e, r;
|
|
413
|
+
if ((t = this.data) != null && t.id)
|
|
414
|
+
return this.pauseDataMap.set(this.data.id, {
|
|
415
|
+
id: (e = this.privateState.currentPlayKeyframe) == null ? void 0 : e.keyframe.id,
|
|
417
416
|
fiveState: this.five.getCurrentState(),
|
|
418
|
-
duration: (
|
|
417
|
+
duration: (r = this.privateState.currentPlayKeyframe) == null ? void 0 : r.originDuration,
|
|
419
418
|
playedProgress: this.getProgress()
|
|
420
419
|
});
|
|
421
420
|
}
|
|
@@ -428,21 +427,21 @@ class er extends R {
|
|
|
428
427
|
/**
|
|
429
428
|
* @description Play single keyframe
|
|
430
429
|
*/
|
|
431
|
-
playKeyframe(t,
|
|
430
|
+
playKeyframe(t, e) {
|
|
432
431
|
return y(this, null, function* () {
|
|
433
|
-
var
|
|
432
|
+
var i;
|
|
434
433
|
const { privateState: r } = this;
|
|
435
|
-
return ((
|
|
434
|
+
return ((i = this.privateState.currentPlayKeyframe) == null ? void 0 : i.keyframe.id) !== t.id && (this.privateState.currentPlayKeyframe = { keyframe: t }), r.currentPlayQueue.push(this.getPlayPromise(t, e)), this.actionPromiseQueue();
|
|
436
435
|
});
|
|
437
436
|
}
|
|
438
437
|
/**
|
|
439
438
|
* @description: getPlayPromise
|
|
440
439
|
*/
|
|
441
440
|
getPlayPromise(r) {
|
|
442
|
-
return y(this, arguments, function* (t,
|
|
441
|
+
return y(this, arguments, function* (t, e = {}) {
|
|
443
442
|
var n;
|
|
444
|
-
const
|
|
445
|
-
if (
|
|
443
|
+
const i = t.data;
|
|
444
|
+
if (e.duration = (n = e.duration) != null ? n : t.start !== void 0 && t.end !== void 0 ? t.end - t.start : void 0, !!i)
|
|
446
445
|
return new Promise((s, d) => {
|
|
447
446
|
let o = !1;
|
|
448
447
|
this.addInterruptListener(() => {
|
|
@@ -455,15 +454,15 @@ class er extends R {
|
|
|
455
454
|
const a = () => {
|
|
456
455
|
s(), o = !0;
|
|
457
456
|
};
|
|
458
|
-
switch (
|
|
457
|
+
switch (i.effect) {
|
|
459
458
|
case "Move":
|
|
460
|
-
this.move(
|
|
459
|
+
this.move(i, e).then(a);
|
|
461
460
|
break;
|
|
462
461
|
case "Rotate":
|
|
463
|
-
this.rotate(
|
|
462
|
+
this.rotate(i, e).then(a);
|
|
464
463
|
break;
|
|
465
464
|
default:
|
|
466
|
-
this.rotate(
|
|
465
|
+
this.rotate(i, e).then(a);
|
|
467
466
|
}
|
|
468
467
|
} catch (a) {
|
|
469
468
|
}
|
|
@@ -476,29 +475,29 @@ class er extends R {
|
|
|
476
475
|
actionPromiseQueue() {
|
|
477
476
|
return y(this, null, function* () {
|
|
478
477
|
const { privateState: t } = this;
|
|
479
|
-
return new Promise((
|
|
478
|
+
return new Promise((e, r) => {
|
|
480
479
|
if (t.currentPlayQueue.length === 0) {
|
|
481
|
-
|
|
480
|
+
e();
|
|
482
481
|
return;
|
|
483
482
|
}
|
|
484
|
-
const
|
|
485
|
-
if (!
|
|
486
|
-
|
|
483
|
+
const i = t.currentPlayQueue.shift();
|
|
484
|
+
if (!i) {
|
|
485
|
+
e();
|
|
487
486
|
return;
|
|
488
487
|
}
|
|
489
|
-
|
|
488
|
+
i.then(e, r);
|
|
490
489
|
}).then(() => t.currentPlayQueue.length === 0 ? Promise.resolve() : this.actionPromiseQueue());
|
|
491
490
|
});
|
|
492
491
|
}
|
|
493
492
|
/**
|
|
494
493
|
* @description Action move keyframe
|
|
495
494
|
*/
|
|
496
|
-
move(t,
|
|
495
|
+
move(t, e) {
|
|
497
496
|
return y(this, null, function* () {
|
|
498
497
|
if (t.mode && t.mode !== this.five.currentMode)
|
|
499
498
|
yield this.changeMode(t);
|
|
500
499
|
else if (t.panoIndex !== this.five.panoIndex)
|
|
501
|
-
yield this.changePano(t,
|
|
500
|
+
yield this.changePano(t, e);
|
|
502
501
|
else
|
|
503
502
|
return Promise.resolve();
|
|
504
503
|
});
|
|
@@ -506,21 +505,21 @@ class er extends R {
|
|
|
506
505
|
/**
|
|
507
506
|
* @description Action rotate keyframe
|
|
508
507
|
*/
|
|
509
|
-
rotate(t,
|
|
508
|
+
rotate(t, e) {
|
|
510
509
|
return y(this, null, function* () {
|
|
511
510
|
if (t.mode && t.mode !== this.five.currentMode)
|
|
512
511
|
yield this.changeMode({ mode: t.mode, panoIndex: t.panoIndex });
|
|
513
512
|
else if (t.panoIndex && t.panoIndex !== this.five.panoIndex)
|
|
514
|
-
return yield this.changePano(t,
|
|
515
|
-
yield this.updateCamera(t,
|
|
513
|
+
return yield this.changePano(t, e);
|
|
514
|
+
yield this.updateCamera(t, e);
|
|
516
515
|
});
|
|
517
516
|
}
|
|
518
517
|
/**
|
|
519
518
|
* @description Update five camera
|
|
520
519
|
*/
|
|
521
520
|
updateCamera(r) {
|
|
522
|
-
return y(this, arguments, function* (t,
|
|
523
|
-
const { five:
|
|
521
|
+
return y(this, arguments, function* (t, e = {}) {
|
|
522
|
+
const { five: i, privateState: n, state: s } = this, d = (() => {
|
|
524
523
|
var f, u;
|
|
525
524
|
const m = (f = s.config) == null ? void 0 : f.speedConfig, p = (u = t.rotateSpeed) != null ? u : m == null ? void 0 : m.rotateSpeed;
|
|
526
525
|
if ((m == null ? void 0 : m.rotateSpeedUnit) === void 0)
|
|
@@ -528,8 +527,8 @@ class er extends R {
|
|
|
528
527
|
if (p !== void 0)
|
|
529
528
|
return m.rotateSpeedUnit === "rad/ms" ? p : p / 1e3;
|
|
530
529
|
})(), o = (() => {
|
|
531
|
-
if (
|
|
532
|
-
return
|
|
530
|
+
if (e.duration)
|
|
531
|
+
return e.duration;
|
|
533
532
|
if (d) {
|
|
534
533
|
const m = this.five.getCurrentState();
|
|
535
534
|
return A(m, t) / d;
|
|
@@ -539,16 +538,16 @@ class er extends R {
|
|
|
539
538
|
n.currentPlayKeyframe && (n.currentPlayKeyframe.originDuration = o);
|
|
540
539
|
const a = this.getSpeededDuration(o);
|
|
541
540
|
return new Promise((m) => {
|
|
542
|
-
G(() =>
|
|
541
|
+
G(() => i.updateCamera(t, a)), setTimeout(() => m(), a);
|
|
543
542
|
});
|
|
544
543
|
});
|
|
545
544
|
}
|
|
546
545
|
/**
|
|
547
546
|
* @description: Change five pano
|
|
548
547
|
*/
|
|
549
|
-
changePano(t,
|
|
548
|
+
changePano(t, e) {
|
|
550
549
|
return y(this, null, function* () {
|
|
551
|
-
const { five: r, privateState:
|
|
550
|
+
const { five: r, privateState: i, state: n } = this;
|
|
552
551
|
if (typeof t.panoIndex != "number" || t.panoIndex === r.panoIndex)
|
|
553
552
|
return;
|
|
554
553
|
const s = r.getCurrentState().mode !== "Panorama";
|
|
@@ -561,22 +560,22 @@ class er extends R {
|
|
|
561
560
|
if (m !== void 0)
|
|
562
561
|
return a.moveSpeedUnit === "m/ms" ? m : m / 1e3;
|
|
563
562
|
})(), o = (() => {
|
|
564
|
-
if (
|
|
565
|
-
return
|
|
563
|
+
if (e != null && e.duration)
|
|
564
|
+
return e.duration;
|
|
566
565
|
if (d && typeof r.panoIndex == "number" && typeof t.panoIndex == "number") {
|
|
567
566
|
const a = r.work.observers[r.panoIndex].position, m = r.work.observers[t.panoIndex].position;
|
|
568
567
|
return a.distanceTo(m) / d;
|
|
569
568
|
}
|
|
570
569
|
return 800;
|
|
571
570
|
})();
|
|
572
|
-
|
|
571
|
+
i.currentPlayKeyframe && (i.currentPlayKeyframe.originDuration = o), yield new Promise((a) => {
|
|
573
572
|
var m, p, f;
|
|
574
573
|
r.moveToPano(t.panoIndex, {
|
|
575
574
|
latitude: t.latitude,
|
|
576
575
|
longitude: t.longitude,
|
|
577
576
|
fov: t.fov,
|
|
578
577
|
duration: this.getSpeededDuration(o),
|
|
579
|
-
effect: (f = (p =
|
|
578
|
+
effect: (f = (p = e == null ? void 0 : e.moveEffect) != null ? p : (m = this.state.config) == null ? void 0 : m.moveEffect) != null ? f : t.moveEffect,
|
|
580
579
|
moveCancelCallback: () => a(),
|
|
581
580
|
moveEndCallback: () => a()
|
|
582
581
|
}), s && r.once("panoArrived", () => a());
|
|
@@ -586,12 +585,12 @@ class er extends R {
|
|
|
586
585
|
/**
|
|
587
586
|
* @description Change five mode
|
|
588
587
|
*/
|
|
589
|
-
changeMode(t,
|
|
588
|
+
changeMode(t, e) {
|
|
590
589
|
return y(this, null, function* () {
|
|
591
|
-
t.mode && t.mode !== this.five.currentMode && (this.privateState.modeChanging = !0, yield this.five.changeMode(t.mode, t,
|
|
590
|
+
t.mode && t.mode !== this.five.currentMode && (this.privateState.modeChanging = !0, yield this.five.changeMode(t.mode, t, e), this.privateState.modeChanging = !1);
|
|
592
591
|
});
|
|
593
592
|
}
|
|
594
593
|
}
|
|
595
594
|
export {
|
|
596
|
-
|
|
595
|
+
tr as default
|
|
597
596
|
};
|