@realsee/dnalogel 3.42.0-alpha-tag.19 → 3.42.0-alpha-tag.21
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/PanoTagPlugin/controller/Tag/ModelTag.d.ts +0 -2
- package/dist/PanoTagPlugin/controller/Tag/PlaneTag.d.ts +0 -2
- package/dist/index.cjs.js +51 -51
- package/dist/index.js +2710 -2695
- package/dist/index.umd.js +42 -42
- package/libs/CruisePlugin/Move.js +3 -2
- package/libs/CruisePlugin/Work.js +3 -2
- package/libs/CruisePlugin/index.js +7 -6
- package/libs/GuideLinePlugin/Controller.js +5 -4
- package/libs/GuideLinePlugin/GuideLineItem.js +3 -2
- package/libs/GuideLinePlugin/GuideLineModeItem.js +3 -2
- package/libs/GuideLinePlugin/index.js +7 -6
- package/libs/ModelMakerPlugin/index.js +1 -1
- package/libs/ModelMakerPlugin/item/baseItem.js +7 -6
- package/libs/ModelMakerPlugin/item/boxItem.js +3 -2
- package/libs/ModelMakerPlugin/item/polygonItem.js +7 -6
- package/libs/ModelMakerPlugin/item/prismItem.js +7 -6
- package/libs/ModelMakerPlugin/utils/getFiveDomEvent.js +4 -3
- package/libs/PanoTagPlugin/controller/Tag/BaseTag.js +93 -95
- package/libs/PanoTagPlugin/controller/Tag/ModelTag.d.ts +0 -2
- package/libs/PanoTagPlugin/controller/Tag/ModelTag.js +1 -5
- package/libs/PanoTagPlugin/controller/Tag/PlaneTag.d.ts +0 -2
- package/libs/PanoTagPlugin/controller/Tag/PlaneTag.js +1 -5
- package/libs/PanoTagPlugin/controller/Tag/PointTag.js +2 -2
- package/libs/PanoTagPlugin/controller/TagRender.js +3 -2
- package/libs/PanoTagPlugin/controller/TagUtil.js +3 -2
- package/libs/PanoTagPlugin/controller/index.js +47 -46
- package/libs/PanoTagPlugin/index.js +14 -13
- package/libs/PanoTagPlugin/typings/index.js +1 -1
- package/libs/PanoTagPlugin/utils/tag/calculateTagConfig.js +1 -1
- package/libs/base/BasePlugin.js +1 -1
- package/libs/index.js +1 -1
- package/libs/shared-utils/five/FiveDomEvents.js +92 -88
- package/libs/shared-utils/logger.js +1 -1
- package/libs/shared-utils/three/THREERaycaster.js +30 -8
- package/package.json +1 -1
|
@@ -12,19 +12,19 @@ var u = (d, a, e) => a in d ? D(d, a, { enumerable: !0, configurable: !0, writab
|
|
|
12
12
|
}, m = (d, a) => P(d, U(a));
|
|
13
13
|
var l = (d, a, e) => (u(d, typeof a != "symbol" ? a + "" : a, e), e);
|
|
14
14
|
var p = (d, a, e) => new Promise((t, i) => {
|
|
15
|
-
var o = (
|
|
15
|
+
var o = (s) => {
|
|
16
16
|
try {
|
|
17
|
-
n(e.next(
|
|
17
|
+
n(e.next(s));
|
|
18
18
|
} catch (h) {
|
|
19
19
|
i(h);
|
|
20
20
|
}
|
|
21
|
-
},
|
|
21
|
+
}, r = (s) => {
|
|
22
22
|
try {
|
|
23
|
-
n(e.throw(
|
|
23
|
+
n(e.throw(s));
|
|
24
24
|
} catch (h) {
|
|
25
25
|
i(h);
|
|
26
26
|
}
|
|
27
|
-
}, n = (
|
|
27
|
+
}, n = (s) => s.done ? t(s.value) : Promise.resolve(s.value).then(o, r);
|
|
28
28
|
n((e = e.apply(d, a)).next());
|
|
29
29
|
});
|
|
30
30
|
import * as v from "three";
|
|
@@ -174,6 +174,7 @@ import "../../shared-utils/url/absoluteUrl.js";
|
|
|
174
174
|
import "../../shared-utils/five/getFiveModel.js";
|
|
175
175
|
import "../../shared-utils/five/FiveDomEvents.js";
|
|
176
176
|
import "../../shared-utils/five/calculateThreeMouse.js";
|
|
177
|
+
import "../../shared-utils/three/THREERaycaster.js";
|
|
177
178
|
import "../../base/BasePlugin.js";
|
|
178
179
|
import "../../shared-utils/Utils/FiveUtil.js";
|
|
179
180
|
import "../../shared-utils/Utils/BaseUtil.js";
|
|
@@ -181,8 +182,8 @@ import "../../shared-utils/Utils/WorkUtil.js";
|
|
|
181
182
|
import "../utils/requestIdleCallback.js";
|
|
182
183
|
import "../Components/TagItem.js";
|
|
183
184
|
import "../Components/Common/TagPoint.js";
|
|
184
|
-
const S = "Dnalogel-PanoTagPlugin",
|
|
185
|
-
class
|
|
185
|
+
const S = "Dnalogel-PanoTagPlugin", zi = (d) => `${S}--${d}`;
|
|
186
|
+
class xi extends R {
|
|
186
187
|
constructor(e, t) {
|
|
187
188
|
super(e);
|
|
188
189
|
/** state */
|
|
@@ -222,8 +223,8 @@ class zi extends R {
|
|
|
222
223
|
if (!t.state)
|
|
223
224
|
return console.warn("Clickhandler: params.tag.state is undefined");
|
|
224
225
|
const i = t.can("fold"), o = t.can("unfold");
|
|
225
|
-
i && o && (e.tag.state.unfolded = !e.tag.state.unfolded, e.tag.state.unfolded && this.tags.forEach((
|
|
226
|
-
|
|
226
|
+
i && o && (e.tag.state.unfolded = !e.tag.state.unfolded, e.tag.state.unfolded && this.tags.forEach((r) => {
|
|
227
|
+
r.id !== e.tag.id && r.state && r.can("fold") && (r.state.unfolded = !1);
|
|
227
228
|
}), this.addRenderQueue({ type: "TagContainerSvelte", keys: ["tags"] }));
|
|
228
229
|
});
|
|
229
230
|
l(this, "handleFiveCameraUpdate", () => {
|
|
@@ -250,10 +251,10 @@ class zi extends R {
|
|
|
250
251
|
t.position.copy(i.position), t.quaternion.copy(i.quaternion);
|
|
251
252
|
const o = this.five.camera.position;
|
|
252
253
|
t.lookAt(o.clone().setY(t.position.y));
|
|
253
|
-
const
|
|
254
|
-
|
|
255
|
-
i.quaternion.copy(
|
|
256
|
-
}),
|
|
254
|
+
const r = i.quaternion.clone(), n = t.quaternion.clone(), s = q();
|
|
255
|
+
s.onUpdate(({ progress: g }) => {
|
|
256
|
+
i.quaternion.copy(r.clone().slerp(n, g));
|
|
257
|
+
}), s.play();
|
|
257
258
|
});
|
|
258
259
|
}));
|
|
259
260
|
/** 楼层切换时,需要更新标签可见性 */
|
|
@@ -267,9 +268,9 @@ class zi extends R {
|
|
|
267
268
|
this.renderQueue.forEach((e, t) => {
|
|
268
269
|
const i = t.split("-")[0], o = t.split("-").slice(1);
|
|
269
270
|
if (i === "TagContainerSvelte") {
|
|
270
|
-
const
|
|
271
|
+
const r = this.filterPointTag.filter((s) => s.screenPosition), n = {
|
|
271
272
|
hooks: this.hooks,
|
|
272
|
-
tags:
|
|
273
|
+
tags: r,
|
|
273
274
|
state: this.state,
|
|
274
275
|
temporaryState: this.temporaryState,
|
|
275
276
|
mediaStore: this.mediaStore,
|
|
@@ -278,13 +279,13 @@ class zi extends R {
|
|
|
278
279
|
zIndex: this.params.containerZIndex
|
|
279
280
|
};
|
|
280
281
|
if (this.TagContainerSvelte) {
|
|
281
|
-
let
|
|
282
|
+
let s = {};
|
|
282
283
|
if (o.length === 0)
|
|
283
|
-
|
|
284
|
+
s = n;
|
|
284
285
|
else
|
|
285
286
|
for (const h of o)
|
|
286
|
-
|
|
287
|
-
this.TagContainerSvelte.$set(
|
|
287
|
+
s[h] = n[h];
|
|
288
|
+
this.TagContainerSvelte.$set(s);
|
|
288
289
|
} else {
|
|
289
290
|
if (!this.container)
|
|
290
291
|
return console.error("updateRenderPlaneTag: tag2DContainer not found");
|
|
@@ -292,8 +293,8 @@ class zi extends R {
|
|
|
292
293
|
target: this.container,
|
|
293
294
|
props: m(f({}, n), { state: m(f({}, this.state), { enabled: !1 }) })
|
|
294
295
|
}), V(() => {
|
|
295
|
-
var
|
|
296
|
-
(
|
|
296
|
+
var s;
|
|
297
|
+
(s = this.TagContainerSvelte) == null || s.$set({ state: this.state });
|
|
297
298
|
});
|
|
298
299
|
}
|
|
299
300
|
}
|
|
@@ -310,9 +311,9 @@ class zi extends R {
|
|
|
310
311
|
}
|
|
311
312
|
}
|
|
312
313
|
appendTo(e) {
|
|
313
|
-
var i, o,
|
|
314
|
+
var i, o, r, n;
|
|
314
315
|
this.container = e, (i = this.css3DRenderPlugin) == null || i.appendToFrontFiveContainer(this.container);
|
|
315
|
-
const t = (
|
|
316
|
+
const t = (r = (o = this.TagContainerSvelte) == null ? void 0 : o.$$) == null ? void 0 : r.root;
|
|
316
317
|
t && t !== this.container && ((n = this.TagContainerSvelte) == null || n.$destroy(), this.TagContainerSvelte = void 0);
|
|
317
318
|
}
|
|
318
319
|
/**
|
|
@@ -329,8 +330,8 @@ class zi extends R {
|
|
|
329
330
|
if (this.debug)
|
|
330
331
|
try {
|
|
331
332
|
A(this.five, this.tags);
|
|
332
|
-
} catch (
|
|
333
|
-
console.error(
|
|
333
|
+
} catch (r) {
|
|
334
|
+
console.error(r);
|
|
334
335
|
}
|
|
335
336
|
return t;
|
|
336
337
|
});
|
|
@@ -341,17 +342,17 @@ class zi extends R {
|
|
|
341
342
|
addTag(e) {
|
|
342
343
|
return p(this, null, function* () {
|
|
343
344
|
const i = (Array.isArray(e) ? e : [e]).filter((o) => o.position).map((o) => {
|
|
344
|
-
const
|
|
345
|
-
if (
|
|
345
|
+
const r = B(o);
|
|
346
|
+
if (r === "2DPoint" || r === "3DPoint")
|
|
346
347
|
return new x(this, o);
|
|
347
|
-
if (
|
|
348
|
+
if (r === "Model")
|
|
348
349
|
return new Q(this, o);
|
|
349
|
-
if (
|
|
350
|
+
if (r === "Plane")
|
|
350
351
|
return new $(this, o);
|
|
351
352
|
});
|
|
352
353
|
return i.forEach(I), this.tags.push(...i), this.tagsLengthWillUpdate = !0, N(this.five).then(() => p(this, null, function* () {
|
|
353
|
-
var o,
|
|
354
|
-
this.store.eventListenerDisposer && ((
|
|
354
|
+
var o, r;
|
|
355
|
+
this.store.eventListenerDisposer && ((r = (o = this.store).eventListenerDisposer) == null || r.call(o)), this.state.enabled && this.handleEnable(), this.addResizeListener(), this.clearUnusedPanelTag(), this.addMediaModelTag(i), i.forEach((n) => n.updateVisible()), this.setUnfolded(), this.addRenderQueue({ type: "TagContainerSvelte" });
|
|
355
356
|
}));
|
|
356
357
|
});
|
|
357
358
|
}
|
|
@@ -417,11 +418,11 @@ class zi extends R {
|
|
|
417
418
|
* @description 销毁
|
|
418
419
|
*/
|
|
419
420
|
dispose() {
|
|
420
|
-
var e, t, i, o,
|
|
421
|
-
this.pauseCurrentMedia(), this.disposeAllCSS3DContainer(), (e = this.TagContainerSvelte) == null || e.$destroy(), this.filterCSS3DTag.forEach((
|
|
421
|
+
var e, t, i, o, r, n;
|
|
422
|
+
this.pauseCurrentMedia(), this.disposeAllCSS3DContainer(), (e = this.TagContainerSvelte) == null || e.$destroy(), this.filterCSS3DTag.forEach((s) => {
|
|
422
423
|
var h;
|
|
423
|
-
return (h =
|
|
424
|
-
}), this.tags.forEach((
|
|
424
|
+
return (h = s.tag3DContentSvelte) == null ? void 0 : h.svelteApp.$destroy();
|
|
425
|
+
}), this.tags.forEach((s) => s.cache.clear()), this.tags = [], this.tagsLengthWillUpdate = !0, (t = this.store.disposers) == null || t.forEach((s) => s == null ? void 0 : s()), this.store.disposers = [], (o = (i = this.store).eventListenerDisposer) == null || o.call(i), this.store.eventListenerDisposer = void 0, (n = (r = this.store).resizeObserverDisposer) == null || n.call(r), this.store.resizeObserverDisposer = void 0, this.store.resizeObserverDisposerAdding = !1, this.five.scene.remove(this.group), this.group.remove(...this.group.children), this.gltfObjectGroup.remove(...this.gltfObjectGroup.children), this.imagePlaneGroup.remove(...this.imagePlaneGroup.children), this.five.needsRender = !0, this.store.disposed = !0, this.hooks.emit("dispose");
|
|
425
426
|
}
|
|
426
427
|
/**
|
|
427
428
|
* @description 闪烁标签
|
|
@@ -494,7 +495,7 @@ class zi extends R {
|
|
|
494
495
|
*/
|
|
495
496
|
destroyTagById(e) {
|
|
496
497
|
(Array.isArray(e) ? e : [e]).forEach((i) => {
|
|
497
|
-
const o = this.tags.findIndex((
|
|
498
|
+
const o = this.tags.findIndex((r) => r.id === i);
|
|
498
499
|
o !== -1 && this.tags.splice(o, 1);
|
|
499
500
|
}), this.tagsLengthWillUpdate = !0;
|
|
500
501
|
}
|
|
@@ -531,8 +532,8 @@ class zi extends R {
|
|
|
531
532
|
handleDisable() {
|
|
532
533
|
var e, t, i;
|
|
533
534
|
this.pauseCurrentMedia(), this.state.enabled = !1, (t = (e = this.store).eventListenerDisposer) == null || t.call(e), this.five.scene.remove(this.group), (i = this.TagContainerSvelte) == null || i.$set({ tags: [] }), this.filterCSS3DTag.forEach((o) => {
|
|
534
|
-
var
|
|
535
|
-
(
|
|
535
|
+
var r;
|
|
536
|
+
(r = o.tag3DContentSvelte) == null || r.dispose(), o.tag3DContentSvelte = void 0;
|
|
536
537
|
}), this.five.needsRender = !0;
|
|
537
538
|
}
|
|
538
539
|
/**
|
|
@@ -565,17 +566,17 @@ class zi extends R {
|
|
|
565
566
|
this.state.enabled && (this.filterPointTag.forEach((h) => h.updateScreenPosition({ force: !0 })), this.show());
|
|
566
567
|
}, i = () => {
|
|
567
568
|
this.state.enabled && this.hide();
|
|
568
|
-
}, { observe: o, unobserve:
|
|
569
|
+
}, { observe: o, unobserve: r } = C(
|
|
569
570
|
y(() => {
|
|
570
571
|
this.store.resizeObserverDisposer && i();
|
|
571
572
|
}, 500),
|
|
572
573
|
e
|
|
573
|
-
), { observe: n, unobserve:
|
|
574
|
+
), { observe: n, unobserve: s } = C(
|
|
574
575
|
_(() => t(), 400),
|
|
575
576
|
e
|
|
576
577
|
);
|
|
577
578
|
return o(), n(), () => {
|
|
578
|
-
|
|
579
|
+
r(), s();
|
|
579
580
|
};
|
|
580
581
|
}
|
|
581
582
|
setUnfoldedByCamera() {
|
|
@@ -595,12 +596,12 @@ class zi extends R {
|
|
|
595
596
|
});
|
|
596
597
|
}
|
|
597
598
|
changeTagMode(e, t) {
|
|
598
|
-
var i, o,
|
|
599
|
-
((i = e.config) == null ? void 0 : i.renderType) !== "Mesh" && ((n = (
|
|
599
|
+
var i, o, r, n, s, h;
|
|
600
|
+
((i = e.config) == null ? void 0 : i.renderType) !== "Mesh" && ((n = (r = (o = e.tag3DContentSvelte) == null ? void 0 : o.css3DInstance) == null ? void 0 : r.css3DObject) == null ? void 0 : n.mode) !== t && ((s = e.config) != null && s.tag3DConfig ? e.config.tag3DConfig.mode = t : e.config ? e.config.tag3DConfig = { mode: t } : e.config = { tag3DConfig: { mode: t } }, (h = this.store.css3DRenderDisposer.get(e.id)) == null || h.forEach((g) => g == null ? void 0 : g()), e.tag3DContentSvelte = void 0);
|
|
600
601
|
}
|
|
601
602
|
}
|
|
602
603
|
export {
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
604
|
+
xi as PanoTagPluginController,
|
|
605
|
+
xi as default,
|
|
606
|
+
zi as pluginFlag
|
|
606
607
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import t from "./controller/index.js";
|
|
2
|
-
import { pluginFlag as
|
|
3
|
-
import { defaultGlobalConfig as
|
|
4
|
-
import { ContentType as
|
|
5
|
-
import { BaseTag as
|
|
2
|
+
import { pluginFlag as $r } from "./controller/index.js";
|
|
3
|
+
import { defaultGlobalConfig as rt } from "./typings/tag/TagConfig.js";
|
|
4
|
+
import { ContentType as pt, DimensionType as it, PointType as mt } from "./Archive/deprecated.js";
|
|
5
|
+
import { BaseTag as nt } from "./controller/Tag/BaseTag.js";
|
|
6
6
|
import "three";
|
|
7
7
|
import "../vendor/object-assign-deep/objectAssignDeep.js";
|
|
8
8
|
import "./utils/addDebugPoints.js";
|
|
@@ -142,6 +142,7 @@ import "../shared-utils/five/fiveModelLoad.js";
|
|
|
142
142
|
import "../shared-utils/five/getFiveModel.js";
|
|
143
143
|
import "../shared-utils/five/FiveDomEvents.js";
|
|
144
144
|
import "../shared-utils/five/calculateThreeMouse.js";
|
|
145
|
+
import "../shared-utils/three/THREERaycaster.js";
|
|
145
146
|
import "../base/BasePlugin.js";
|
|
146
147
|
import "../shared-utils/Utils/FiveUtil.js";
|
|
147
148
|
import "../shared-utils/Utils/BaseUtil.js";
|
|
@@ -155,15 +156,15 @@ import "./Components/TagContainer.js";
|
|
|
155
156
|
import "./Components/TagItem.js";
|
|
156
157
|
import "./Components/Common/TagPoint.js";
|
|
157
158
|
import "../shared-utils/animationFrame/BetterTween.js";
|
|
158
|
-
const
|
|
159
|
+
const Yr = (o, r) => new t(o, r);
|
|
159
160
|
export {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
161
|
+
nt as BaseTag,
|
|
162
|
+
pt as ContentType,
|
|
163
|
+
it as DimensionType,
|
|
164
|
+
Yr as PanoTagPlugin,
|
|
164
165
|
t as PanoTagPluginController,
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
166
|
+
mt as PointType,
|
|
167
|
+
Yr as default,
|
|
168
|
+
rt as defaultGlobalConfig,
|
|
169
|
+
$r as pluginFlag
|
|
169
170
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { defaultGlobalConfig as O } from "./tag/TagConfig.js";
|
|
2
2
|
import { ContentType as R, DimensionType as S, PointType as U } from "../Archive/deprecated.js";
|
|
3
3
|
import { BaseTag as W } from "../controller/Tag/BaseTag.js";
|
|
4
|
+
import "../../shared-utils/Subscribe.js";
|
|
4
5
|
import "../utils/tag/calculateTagConfig.js";
|
|
5
6
|
import "../../vendor/object-assign-deep/objectAssignDeep.js";
|
|
6
7
|
import "../../shared-utils/typescript/entries.js";
|
|
@@ -18,7 +19,6 @@ import "../../CSS3DRenderPlugin/utils/getAllCSS3DObject.js";
|
|
|
18
19
|
import "../../shared-utils/util.js";
|
|
19
20
|
import "../../CSS3DRenderPlugin/utils/createResizeObserver.js";
|
|
20
21
|
import "../../CSS3DRenderPlugin/utils/even.js";
|
|
21
|
-
import "../../shared-utils/Subscribe.js";
|
|
22
22
|
import "../../CSS3DRenderPlugin/utils/three/CSS3DObject.js";
|
|
23
23
|
import "../../CSS3DRenderPlugin/utils/three/OpacityMesh.js";
|
|
24
24
|
import "../../shared-utils/three/centerPoint.js";
|
|
@@ -24,6 +24,7 @@ import "../../../CSS3DRenderPlugin/utils/three/CSS3DRender.js";
|
|
|
24
24
|
import "../../../CSS3DRenderPlugin/utils/generateBehindFiveElement.js";
|
|
25
25
|
import "../../../shared-utils/three/THREESphere.js";
|
|
26
26
|
import "animejs";
|
|
27
|
+
import "../../../shared-utils/Subscribe.js";
|
|
27
28
|
import "./calculateTagConfig.js";
|
|
28
29
|
import "./format.js";
|
|
29
30
|
import "../../../shared-utils/three/blink.js";
|
|
@@ -46,7 +47,6 @@ import "three/examples/jsm/renderers/CSS3DRenderer";
|
|
|
46
47
|
import "../../../CSS3DRenderPlugin/utils/getAllCSS3DObject.js";
|
|
47
48
|
import "../../../CSS3DRenderPlugin/utils/createResizeObserver.js";
|
|
48
49
|
import "../../../CSS3DRenderPlugin/utils/even.js";
|
|
49
|
-
import "../../../shared-utils/Subscribe.js";
|
|
50
50
|
import "../../../CSS3DRenderPlugin/utils/three/CSS3DObject.js";
|
|
51
51
|
import "../../../CSS3DRenderPlugin/utils/three/OpacityMesh.js";
|
|
52
52
|
import "../../../shared-utils/three/getObjectVisible.js";
|
package/libs/base/BasePlugin.js
CHANGED
package/libs/index.js
CHANGED
|
@@ -366,6 +366,7 @@ import "./PanoTagPlugin/controller/TagUtil.js";
|
|
|
366
366
|
import "./PanoTagPlugin/tag.config.js";
|
|
367
367
|
import "./PanoTagPlugin/utils/normalPositionToPositions.js";
|
|
368
368
|
import "./shared-utils/five/FiveDomEvents.js";
|
|
369
|
+
import "./shared-utils/three/THREERaycaster.js";
|
|
369
370
|
import "./PanoTagPlugin/utils/DebugUtil.js";
|
|
370
371
|
import "./PanoTagPlugin/controller/Tag/PointTag.js";
|
|
371
372
|
import "./PanoTagPlugin/utils/requestIdleCallback.js";
|
|
@@ -454,7 +455,6 @@ import "./Sculpt/Meshes/Area.js";
|
|
|
454
455
|
import "./Sculpt/Meshes/PolygonWithEdge.js";
|
|
455
456
|
import "./Sculpt/Meshes/Polygon.js";
|
|
456
457
|
import "./Sculpt/utils/three/ColoredMesh.js";
|
|
457
|
-
import "./shared-utils/three/THREERaycaster.js";
|
|
458
458
|
import "./Sculpt/Objects/Polygon/Editor.js";
|
|
459
459
|
import "./Sculpt/Objects/Prism/index.js";
|
|
460
460
|
import "./Sculpt/Meshes/Prism.js";
|
|
@@ -1,53 +1,57 @@
|
|
|
1
|
-
var
|
|
1
|
+
var M = Object.defineProperty;
|
|
2
2
|
var L = Object.getOwnPropertySymbols;
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var x = Object.prototype.hasOwnProperty, I = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var b = (c, e, t) => e in c ? M(c, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : c[e] = t, D = (c, e) => {
|
|
5
5
|
for (var t in e || (e = {}))
|
|
6
|
-
|
|
6
|
+
x.call(e, t) && b(c, t, e[t]);
|
|
7
7
|
if (L)
|
|
8
8
|
for (var t of L(e))
|
|
9
|
-
|
|
10
|
-
return
|
|
9
|
+
I.call(e, t) && b(c, t, e[t]);
|
|
10
|
+
return c;
|
|
11
11
|
};
|
|
12
|
-
var
|
|
13
|
-
import * as I from "three";
|
|
12
|
+
var a = (c, e, t) => (b(c, typeof e != "symbol" ? e + "" : e, t), t);
|
|
14
13
|
import { getObjectVisible as $ } from "../three/getObjectVisible.js";
|
|
15
14
|
import { calculateThreeMouse as W } from "./calculateThreeMouse.js";
|
|
16
15
|
import { getFiveModel as j } from "./getFiveModel.js";
|
|
17
|
-
|
|
16
|
+
import { THREERaycaster as w } from "../three/THREERaycaster.js";
|
|
17
|
+
class B {
|
|
18
18
|
constructor(e, t) {
|
|
19
|
-
|
|
19
|
+
a(this, "five");
|
|
20
20
|
/**
|
|
21
21
|
* @description: 拖动中
|
|
22
22
|
*/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
a(this, "dragging", !1);
|
|
24
|
+
a(this, "boundObject", {});
|
|
25
|
+
a(this, "config");
|
|
26
|
+
a(this, "handleWantsGesture", (e, t) => {
|
|
27
27
|
if (t.length !== 1)
|
|
28
28
|
return;
|
|
29
29
|
const n = t[0];
|
|
30
|
+
if (n.raycaster) {
|
|
31
|
+
const r = new w();
|
|
32
|
+
r.ray = n.raycaster.ray, r.near = n.raycaster.near, r.far = n.raycaster.far, r.camera = n.raycaster.camera, r.layers = n.raycaster.layers, r.params = n.raycaster.params, n.raycaster = r;
|
|
33
|
+
}
|
|
30
34
|
if (n) {
|
|
31
35
|
if (e === "mouseMove" && this.onDomEvent("hover", n), e === "tap") {
|
|
32
|
-
const
|
|
33
|
-
if (
|
|
36
|
+
const r = this.onDomEvent("click", n), o = this.onDomEvent("wantDblclick", n, void 0, this.boundObject.dblclick);
|
|
37
|
+
if (r === !1 || o === !1)
|
|
34
38
|
return !1;
|
|
35
39
|
}
|
|
36
40
|
if (this.dragging)
|
|
37
41
|
return !1;
|
|
38
42
|
}
|
|
39
43
|
});
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
this.onDomEvent(e,
|
|
44
|
+
a(this, "handleDomEvent", (e, t, n) => {
|
|
45
|
+
const r = { x: t.clientX, y: t.clientY };
|
|
46
|
+
this.onDomEvent(e, r, t, n);
|
|
43
47
|
});
|
|
44
|
-
|
|
48
|
+
a(this, "handleMouseEvent", (e) => {
|
|
45
49
|
this.handleDomEvent(e.type, e);
|
|
46
50
|
});
|
|
47
|
-
|
|
51
|
+
a(this, "handleMousedown", (e) => {
|
|
48
52
|
this.handleDomEvent("mousedown", e), this.handleDomEvent("dragstart", e, this.haveDragEventObject);
|
|
49
53
|
});
|
|
50
|
-
|
|
54
|
+
a(this, "handleMouseup", (e) => {
|
|
51
55
|
var t;
|
|
52
56
|
this.dragging = !1, (t = this.haveDragEventObject) == null || t.forEach((n) => {
|
|
53
57
|
n._dragging && (n._dragging = !1, this.notify({
|
|
@@ -58,7 +62,7 @@ class N {
|
|
|
58
62
|
}));
|
|
59
63
|
}), this.handleDomEvent("mouseup", e);
|
|
60
64
|
});
|
|
61
|
-
|
|
65
|
+
a(this, "handleMousemove", (e) => {
|
|
62
66
|
var t;
|
|
63
67
|
this.dragging && ((t = this.boundObject.drag) == null || t.forEach((n) => {
|
|
64
68
|
n._dragging && this.notify({
|
|
@@ -70,81 +74,81 @@ class N {
|
|
|
70
74
|
}));
|
|
71
75
|
});
|
|
72
76
|
// eslint-disable-next-line complexity
|
|
73
|
-
|
|
74
|
-
var u,
|
|
75
|
-
if (!t || !
|
|
77
|
+
a(this, "onDomEvent", (e, t, n, r = this.boundObject[e]) => {
|
|
78
|
+
var u, l, m;
|
|
79
|
+
if (!t || !r || (r == null ? void 0 : r.length) === 0 || !this.model.loaded)
|
|
76
80
|
return;
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
const
|
|
80
|
-
console.debug(
|
|
81
|
-
const
|
|
82
|
-
if (
|
|
81
|
+
const o = (u = t.raycaster) != null ? u : this.getRaycaster(t);
|
|
82
|
+
o.params.Points.threshold = 0.02;
|
|
83
|
+
const i = o.intersectObjects(r, !0);
|
|
84
|
+
console.debug(i);
|
|
85
|
+
const f = this.model.intersectRaycaster(o), h = 0.01;
|
|
86
|
+
if (f.length > 0 && i.length > 0 && f[0].distance + h < i[0].distance)
|
|
83
87
|
return;
|
|
84
|
-
const
|
|
88
|
+
const s = (l = i == null ? void 0 : i[0]) == null ? void 0 : l.object;
|
|
85
89
|
if (e === "wantDblclick")
|
|
86
90
|
return !1;
|
|
87
|
-
if ((!
|
|
88
|
-
for (const
|
|
89
|
-
|
|
90
|
-
if (
|
|
91
|
+
if ((!s || !this.objectIsBound(s)) && e === "hover")
|
|
92
|
+
for (const v of (m = this.boundObject.hover) != null ? m : [])
|
|
93
|
+
v._hovered && this.notify({ eventName: "unHover", object: v });
|
|
94
|
+
if (s && s && this.notify({ eventName: e, object: s, originEvent: n, raycaster: o, intersects: i }))
|
|
91
95
|
return !1;
|
|
92
96
|
});
|
|
93
|
-
|
|
97
|
+
a(this, "objectIsBound", (e) => {
|
|
94
98
|
let t = e._domEvent, n = e.parent;
|
|
95
99
|
for (; typeof t == "undefined" && n; )
|
|
96
100
|
t = n._domEvent, n = n.parent;
|
|
97
101
|
return !!t;
|
|
98
102
|
});
|
|
99
|
-
|
|
100
|
-
var
|
|
101
|
-
const { eventName: t, object: n, originEvent:
|
|
102
|
-
let
|
|
103
|
-
const
|
|
103
|
+
a(this, "notify", (e) => {
|
|
104
|
+
var m, v, y;
|
|
105
|
+
const { eventName: t, object: n, originEvent: r, raycaster: o, intersects: i } = e;
|
|
106
|
+
let f = !1, h = [];
|
|
107
|
+
const s = [];
|
|
104
108
|
let u = n;
|
|
105
|
-
for (
|
|
106
|
-
u = u.parent,
|
|
107
|
-
const
|
|
108
|
-
if (!((
|
|
109
|
-
for (const
|
|
110
|
-
if (
|
|
109
|
+
for (s.push(u); u.parent; )
|
|
110
|
+
u = u.parent, s.push(u);
|
|
111
|
+
const l = s.at(-1);
|
|
112
|
+
if (!((m = this.config) != null && m.noEmitWhenNotInScene && l.type !== "Scene")) {
|
|
113
|
+
for (const d of s) {
|
|
114
|
+
if (f)
|
|
111
115
|
break;
|
|
112
|
-
|
|
113
|
-
const
|
|
114
|
-
if (!
|
|
116
|
+
d.draggable && (t === "dragstart" && (d._dragging = !0, this.dragging = !0), t === "dragend" && (d._dragging = !1, this.dragging = !1));
|
|
117
|
+
const _ = d._domEvent;
|
|
118
|
+
if (!_)
|
|
115
119
|
continue;
|
|
116
|
-
const
|
|
117
|
-
if (
|
|
118
|
-
for (const [H, E] of
|
|
119
|
-
if (E != null && E.noEmitWhenNotInScene &&
|
|
120
|
+
const O = _[`${t}Handler`];
|
|
121
|
+
if (O)
|
|
122
|
+
for (const [H, E] of O) {
|
|
123
|
+
if (E != null && E.noEmitWhenNotInScene && l.type !== "Scene" || ((v = this.config) != null && v.noEmitWhenHide || E != null && E.noEmitWhenHide) && !$(d))
|
|
120
124
|
continue;
|
|
121
125
|
if (t === "hover") {
|
|
122
|
-
if (
|
|
126
|
+
if (d._hovered)
|
|
123
127
|
continue;
|
|
124
|
-
|
|
125
|
-
for (const g of (
|
|
126
|
-
g !==
|
|
128
|
+
d._hovered = !0;
|
|
129
|
+
for (const g of (y = this.boundObject.hover) != null ? y : [])
|
|
130
|
+
g !== d && g._hovered && this.notify({ eventName: "unHover", object: g });
|
|
127
131
|
}
|
|
128
132
|
if (t === "unHover") {
|
|
129
|
-
if (!
|
|
133
|
+
if (!d._hovered)
|
|
130
134
|
continue;
|
|
131
|
-
|
|
135
|
+
d._hovered = !1;
|
|
132
136
|
}
|
|
133
|
-
const
|
|
137
|
+
const p = H({
|
|
134
138
|
type: t,
|
|
135
|
-
target:
|
|
136
|
-
origDomEvent:
|
|
137
|
-
raycaster:
|
|
138
|
-
intersects:
|
|
139
|
+
target: d,
|
|
140
|
+
origDomEvent: r,
|
|
141
|
+
raycaster: o,
|
|
142
|
+
intersects: i,
|
|
139
143
|
stopPropagation: () => {
|
|
140
|
-
|
|
144
|
+
f = !0;
|
|
141
145
|
}
|
|
142
146
|
});
|
|
143
|
-
h.push(
|
|
147
|
+
h.push(p != null ? p : !0);
|
|
144
148
|
}
|
|
145
149
|
}
|
|
146
150
|
if (t === "click" || t === "wantDblclick")
|
|
147
|
-
return h.some((
|
|
151
|
+
return h.some((d) => d === !0);
|
|
148
152
|
}
|
|
149
153
|
});
|
|
150
154
|
this.five = e, this.config = t, e.on("wantsGesture", this.handleWantsGesture), document.addEventListener("mousedown", this.handleMousedown), document.addEventListener("dblclick", this.handleMouseEvent), document.addEventListener("mouseup", this.handleMouseup), document.addEventListener("mousemove", this.handleMousemove);
|
|
@@ -160,10 +164,10 @@ class N {
|
|
|
160
164
|
* @note: 注意:目前需要触发物体的 added 事件和 removed 事件才会生效
|
|
161
165
|
* @todo: added 和 removed 还是不太智能
|
|
162
166
|
*/
|
|
163
|
-
addAutoBindEventListener(e, t, n,
|
|
164
|
-
const
|
|
165
|
-
return e.addEventListener("added",
|
|
166
|
-
e.removeEventListener("added",
|
|
167
|
+
addAutoBindEventListener(e, t, n, r) {
|
|
168
|
+
const o = () => this.addEventListener(e, t, n, r), i = () => this.removeEventListener(e, t, n, r);
|
|
169
|
+
return e.addEventListener("added", o), e.addEventListener("removed", i), e.addEventListener("dispose", i), () => {
|
|
170
|
+
e.removeEventListener("added", o), e.removeEventListener("removed", i), e.removeEventListener("dispose", i);
|
|
167
171
|
};
|
|
168
172
|
}
|
|
169
173
|
/**
|
|
@@ -173,25 +177,25 @@ class N {
|
|
|
173
177
|
* @param params.callback: 返回 false 可以不阻止 five 的 tap 事件; default: true
|
|
174
178
|
* @return {void}
|
|
175
179
|
*/
|
|
176
|
-
addEventListener(e, t, n,
|
|
177
|
-
e._domEvent || (e._domEvent = {}), e._domEvent[`${t}Handler`] || (e._domEvent[`${t}Handler`] = []), this.boundObject[t] || (this.boundObject[t] = []), this.boundObject[t].includes(e) || this.boundObject[t].push(e), e._domEvent[`${t}Handler`].push([n, D({ noEmitWhenHide: !1, noEmitWhenNotInScene: !1 },
|
|
180
|
+
addEventListener(e, t, n, r) {
|
|
181
|
+
e._domEvent || (e._domEvent = {}), e._domEvent[`${t}Handler`] || (e._domEvent[`${t}Handler`] = []), this.boundObject[t] || (this.boundObject[t] = []), this.boundObject[t].includes(e) || this.boundObject[t].push(e), e._domEvent[`${t}Handler`].push([n, D({ noEmitWhenHide: !1, noEmitWhenNotInScene: !1 }, r)]);
|
|
178
182
|
}
|
|
179
|
-
removeEventListener(e, t, n, ...
|
|
180
|
-
var
|
|
183
|
+
removeEventListener(e, t, n, ...r) {
|
|
184
|
+
var i, f;
|
|
181
185
|
if (!e._domEvent || (t === void 0 && (Object.keys(this.boundObject).forEach((h) => {
|
|
182
|
-
var u,
|
|
183
|
-
const
|
|
184
|
-
|
|
186
|
+
var u, l;
|
|
187
|
+
const s = (u = this.boundObject[h]) == null ? void 0 : u.findIndex((m) => m === e);
|
|
188
|
+
s !== -1 && ((l = this.boundObject[h]) == null || l.splice(s, 1));
|
|
185
189
|
}), e._domEvent = {}), !e._domEvent[`${t}Handler`]))
|
|
186
190
|
return;
|
|
187
191
|
if (n === void 0) {
|
|
188
192
|
delete e._domEvent[`${t}Handler`];
|
|
189
193
|
return;
|
|
190
194
|
}
|
|
191
|
-
const
|
|
192
|
-
if (
|
|
193
|
-
const h = (
|
|
194
|
-
h !== -1 && ((
|
|
195
|
+
const o = e._domEvent[`${t}Handler`].findIndex((h) => h[0] === n);
|
|
196
|
+
if (o !== -1 && (e._domEvent[`${t}Handler`].splice(o, 1), e._domEvent[`${t}Handler`].length === 0 && delete e._domEvent[`${t}Handler`], e._domEvent && Object.keys(e._domEvent).length === 0 && delete e._domEvent, !e._domEvent)) {
|
|
197
|
+
const h = (i = this.boundObject[t]) == null ? void 0 : i.findIndex((s) => s === e);
|
|
198
|
+
h !== -1 && ((f = this.boundObject[t]) == null || f.splice(h, 1));
|
|
195
199
|
}
|
|
196
200
|
}
|
|
197
201
|
clear() {
|
|
@@ -210,10 +214,10 @@ class N {
|
|
|
210
214
|
const t = this.five.getElement();
|
|
211
215
|
if (!t)
|
|
212
216
|
return;
|
|
213
|
-
const n = W(e, t),
|
|
214
|
-
return
|
|
217
|
+
const n = W(e, t), r = new w();
|
|
218
|
+
return r.setFromCamera(n, this.five.camera), r;
|
|
215
219
|
}
|
|
216
220
|
}
|
|
217
221
|
export {
|
|
218
|
-
|
|
222
|
+
B as FiveDomEvents
|
|
219
223
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function A() {
|
|
2
2
|
console.debug(
|
|
3
|
-
"%c %c@realsee/dnalogel %cv3.42.0-alpha-tag.
|
|
3
|
+
"%c %c@realsee/dnalogel %cv3.42.0-alpha-tag.21",
|
|
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",
|