@realsee/dnalogel 3.44.4 → 3.44.5

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/index.js CHANGED
@@ -48,7 +48,7 @@ import up from "earcut";
48
48
  import { GLTFLoader as fp } from "@realsee/five/gltf-loader";
49
49
  function mp() {
50
50
  console.debug(
51
- "%c %c@realsee/dnalogel %cv3.44.4",
51
+ "%c %c@realsee/dnalogel %cv3.44.5",
52
52
  [
53
53
  "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=')",
54
54
  "background-repeat: no-repeat",
@@ -8163,7 +8163,7 @@ let Fi = class {
8163
8163
  /**
8164
8164
  * @realsee/dnalogel 版本号
8165
8165
  */
8166
- d(this, "VERSION", "3.44.4");
8166
+ d(this, "VERSION", "3.44.5");
8167
8167
  d(this, "NAME");
8168
8168
  d(this, "five");
8169
8169
  d(this, "workUtil");
@@ -28759,74 +28759,6 @@ class wM extends yM {
28759
28759
  d(this, "temporaryState", { visible: !0 });
28760
28760
  /** 点标签 */
28761
28761
  d(this, "TagContainerSvelte");
28762
- /**
28763
- * @description 渲染3D贴片
28764
- */
28765
- d(this, "updateRender3DDomTag", (e) => {
28766
- (e ? yi(e) : this.filterCSS3DTag).forEach((s) => {
28767
- var o, r, a, l, c, h;
28768
- if (s.tag3DContentSvelte) {
28769
- const { svelteApp: u, css3DInstance: f, initialNormal: m, currentNormal: v } = s.tag3DContentSvelte;
28770
- if ((r = f == null ? void 0 : f.css3DObject) == null || r.setVisible((this.state.visible && ((o = s.state) == null ? void 0 : o.visible)) !== !1), u.$set({ tag: s, hooks: this.hooks, state: this.state, temporaryState: this.temporaryState }), !m.equals(v)) {
28771
- const p = new Cl().setFromUnitVectors(m, v);
28772
- f.css3DObject.setRotationFromQuaternion(p);
28773
- }
28774
- return;
28775
- } else {
28776
- if (ii(s) && !((a = s.model) != null && a.object) || ((l = s.state) == null ? void 0 : l.visible) === !1 || !this.state.visible || !this.state.enabled || !this.css3DRenderPlugin)
28777
- return;
28778
- if (s.stickType === "3DPoint" && !s.normal)
28779
- return console.error("updateRenderPlaneTag: 三维点标签缺少法向量!");
28780
- const u = this.getPositions(s);
28781
- if (!u)
28782
- return;
28783
- const f = s.computeNormal();
28784
- if (!f)
28785
- return;
28786
- const m = s.getConfig(), v = x({
28787
- wrapperStyle: { zIndex: `${Math.round((1e4 - ((c = s.getDistance()) != null ? c : 0)) * 100)}` }
28788
- }, m.tag3DConfig);
28789
- if (s.computeRenderType() === "BehindDom" || v.mode === "behind") {
28790
- v.mode = "behind", v.container = document.createElement("div");
28791
- const A = "black";
28792
- v.container.style.backgroundColor = A, v.container.style.border = `3px solid ${A}`, this.css3DRenderPlugin.hooks.on("render", () => {
28793
- var y;
28794
- if (p.css3DObject.opacityMesh && m.clickable !== !1) {
28795
- const I = this.addObjectClickHandler(s, p.css3DObject.opacityMesh, (P) => {
28796
- this.hooks.emit("click", { event: P, target: "TagContent", tag: s });
28797
- });
28798
- (y = this.store.css3DRenderDisposer.get(s.id)) == null || y.push(I);
28799
- }
28800
- });
28801
- }
28802
- const p = this.css3DRenderPlugin.create3DDomContainer(u, v);
28803
- if (!p)
28804
- return;
28805
- this.store.css3DRenderDisposer.set(s.id, [p.dispose]);
28806
- const g = new gg({
28807
- target: p.container,
28808
- props: {
28809
- tag: s,
28810
- hooks: this.hooks,
28811
- /** 模型标签要等模型加载好之后再展示 */
28812
- state: this.state,
28813
- mediaStore: this.mediaStore,
28814
- temporaryState: this.temporaryState
28815
- }
28816
- });
28817
- s.tag3DContentSvelte = {
28818
- svelteApp: g,
28819
- domContainer: p,
28820
- css3DInstance: p,
28821
- initialNormal: f,
28822
- currentNormal: f,
28823
- dispose: () => {
28824
- g.$destroy(), p.dispose();
28825
- }
28826
- }, ii(s) && ((h = s.model) != null && h.object) && this.updateTagCss3DObjectMatrix(s, s.model.object);
28827
- }
28828
- }), this.clearUnusedPanelTag();
28829
- });
28830
28762
  this.group.name = "PanoTagPluginModelGroup", this.gltfObjectGroup.name = "PanoTagPluginGLTFObjectGroup", this.imagePlaneGroup.name = "ImagePlaneGroup", this.group.add(this.gltfObjectGroup), this.group.add(this.imagePlaneGroup);
28831
28763
  }
28832
28764
  /**
@@ -28851,6 +28783,74 @@ class wM extends yM {
28851
28783
  (o = (s = i.mediaPlane) == null ? void 0 : s.parent) == null || o.remove(i.mediaPlane);
28852
28784
  }), this.tags = [], this.tagsLengthWillUpdate = !0, this.hooks.emit("tagsLengthChange"), (e = this.TagContainerSvelte) == null || e.$destroy(), this.TagContainerSvelte = void 0, this.disposeAllCSS3DContainer()), this.enabledModelTagSet.clear(), this.cache.clear();
28853
28785
  }
28786
+ /**
28787
+ * @description 渲染3D贴片
28788
+ */
28789
+ updateRender3DDomTag(e) {
28790
+ (e ? yi(e) : this.filterCSS3DTag).forEach((s) => {
28791
+ var o, r, a, l, c, h;
28792
+ if (s.tag3DContentSvelte) {
28793
+ const { svelteApp: u, css3DInstance: f, initialNormal: m, currentNormal: v } = s.tag3DContentSvelte;
28794
+ if ((r = f == null ? void 0 : f.css3DObject) == null || r.setVisible((this.state.visible && ((o = s.state) == null ? void 0 : o.visible)) !== !1), u.$set({ tag: s, hooks: this.hooks, state: this.state, temporaryState: this.temporaryState }), !m.equals(v)) {
28795
+ const p = new Cl().setFromUnitVectors(m, v);
28796
+ f.css3DObject.setRotationFromQuaternion(p);
28797
+ }
28798
+ return;
28799
+ } else {
28800
+ if (ii(s) && !((a = s.model) != null && a.object) || ((l = s.state) == null ? void 0 : l.visible) === !1 || !this.state.visible || !this.state.enabled || !this.css3DRenderPlugin)
28801
+ return;
28802
+ if (s.stickType === "3DPoint" && !s.normal)
28803
+ return console.error("updateRenderPlaneTag: 三维点标签缺少法向量!");
28804
+ const u = this.getPositions(s);
28805
+ if (!u)
28806
+ return;
28807
+ const f = s.computeNormal();
28808
+ if (!f)
28809
+ return;
28810
+ const m = s.getConfig(), v = x({
28811
+ wrapperStyle: { zIndex: `${Math.round((1e4 - ((c = s.getDistance()) != null ? c : 0)) * 100)}` }
28812
+ }, m.tag3DConfig);
28813
+ if (s.computeRenderType() === "BehindDom" || v.mode === "behind") {
28814
+ v.mode = "behind", v.container = document.createElement("div");
28815
+ const A = "black";
28816
+ v.container.style.backgroundColor = A, v.container.style.border = `3px solid ${A}`, this.css3DRenderPlugin.hooks.on("render", () => {
28817
+ var y;
28818
+ if (p.css3DObject.opacityMesh && m.clickable !== !1) {
28819
+ const I = this.addObjectClickHandler(s, p.css3DObject.opacityMesh, (P) => {
28820
+ this.hooks.emit("click", { event: P, target: "TagContent", tag: s });
28821
+ });
28822
+ (y = this.store.css3DRenderDisposer.get(s.id)) == null || y.push(I);
28823
+ }
28824
+ });
28825
+ }
28826
+ const p = this.css3DRenderPlugin.create3DDomContainer(u, v);
28827
+ if (!p)
28828
+ return;
28829
+ this.store.css3DRenderDisposer.set(s.id, [p.dispose]);
28830
+ const g = new gg({
28831
+ target: p.container,
28832
+ props: {
28833
+ tag: s,
28834
+ hooks: this.hooks,
28835
+ /** 模型标签要等模型加载好之后再展示 */
28836
+ state: this.state,
28837
+ mediaStore: this.mediaStore,
28838
+ temporaryState: this.temporaryState
28839
+ }
28840
+ });
28841
+ s.tag3DContentSvelte = {
28842
+ svelteApp: g,
28843
+ domContainer: p,
28844
+ css3DInstance: p,
28845
+ initialNormal: f,
28846
+ currentNormal: f,
28847
+ dispose: () => {
28848
+ g.$destroy(), p.dispose();
28849
+ }
28850
+ }, ii(s) && ((h = s.model) != null && h.object) && this.updateTagCss3DObjectMatrix(s, s.model.object);
28851
+ }
28852
+ }), this.clearUnusedPanelTag();
28853
+ }
28854
28854
  /** 更新标签中多媒体面片的位置
28855
28855
  * @param tag 标签
28856
28856
  * @param model 模型
@@ -28898,8 +28898,44 @@ class wM extends yM {
28898
28898
  class CM {
28899
28899
  constructor(t) {
28900
28900
  d(this, "plugin");
28901
+ d(this, "logBinded", !1);
28901
28902
  this.plugin = t;
28902
28903
  }
28904
+ get debug() {
28905
+ return this.plugin.debug;
28906
+ }
28907
+ addDebugPoints() {
28908
+ try {
28909
+ uC(this.plugin.five, this.plugin.tags);
28910
+ } catch (t) {
28911
+ console.error(t);
28912
+ }
28913
+ }
28914
+ bindLog() {
28915
+ if (this.logBinded)
28916
+ return;
28917
+ this.logBinded = !0;
28918
+ const t = (e) => {
28919
+ Object.getOwnPropertyNames(e).forEach((i) => {
28920
+ typeof e[i] == "function" && (e[i] = new Proxy(e[i], {
28921
+ apply: (s, o, r) => (["render"].includes(i) || this.addLog(i, ...r), s.apply(o, r))
28922
+ }));
28923
+ });
28924
+ };
28925
+ t(this.plugin), t(this.plugin.constructor.prototype);
28926
+ }
28927
+ addLog(t, ...e) {
28928
+ if (this.debug) {
28929
+ let i = new Error().stack;
28930
+ console.debug(
28931
+ `%cPanoTagPlugin%c${t}`,
28932
+ "background-color: #35e0ed; color: black; padding:0 6px; border-radius: 3px",
28933
+ "padding: 0 3px; color: #f3f47c",
28934
+ ...e,
28935
+ { stack: i }
28936
+ );
28937
+ }
28938
+ }
28903
28939
  closeIntersectRaycaster() {
28904
28940
  this.plugin.tags.forEach((t) => {
28905
28941
  var e;
@@ -29931,7 +29967,7 @@ class pl extends wM {
29931
29967
  }
29932
29968
  }), this.renderQueue.clear();
29933
29969
  });
29934
- this.params = Qe({}, { debug: !1, config: this.config }, x({}, i)), this.debug = this.params.debug, this.config = this.params.config, CC(1, { namespace: $l.PlayAudio });
29970
+ this.params = Qe({}, { debug: !1, config: this.config }, x({}, i)), this.debug = this.params.debug, this.config = this.params.config, this.debug && this.debugUtil.bindLog(), CC(1, { namespace: $l.PlayAudio });
29935
29971
  try {
29936
29972
  Array.isArray(window.__PANOTAGPLUGIN_DEBUG_LIST__) || (window.__PANOTAGPLUGIN_DEBUG_LIST__ = []), window.__PANOTAGPLUGIN_DEBUG_LIST__.push(this), window.__PANOTAGPLUGIN_DEBUG__ || Object.defineProperty(window, "__PANOTAGPLUGIN_DEBUG__", {
29937
29973
  get: function() {
@@ -29943,7 +29979,7 @@ class pl extends wM {
29943
29979
  }
29944
29980
  appendTo(e) {
29945
29981
  var s, o, r, a;
29946
- this.container = e, (s = this.css3DRenderPlugin) == null || s.appendToFrontFiveContainer(this.container);
29982
+ this.debugUtil.addLog("appendTo"), this.container = e, (s = this.css3DRenderPlugin) == null || s.appendToFrontFiveContainer(this.container);
29947
29983
  const i = (r = (o = this.TagContainerSvelte) == null ? void 0 : o.$$) == null ? void 0 : r.root;
29948
29984
  i && i !== this.container && ((a = this.TagContainerSvelte) == null || a.$destroy(), this.TagContainerSvelte = void 0);
29949
29985
  }
@@ -29958,13 +29994,7 @@ class pl extends wM {
29958
29994
  contentTypeConfig: (o = e.contentTypeConfig) != null ? o : {}
29959
29995
  });
29960
29996
  const i = yield this.addTag(e.tagList);
29961
- if (this.hooks.emit("loaded"), this.debug)
29962
- try {
29963
- uC(this.five, this.tags);
29964
- } catch (r) {
29965
- console.error(r);
29966
- }
29967
- return i;
29997
+ return this.hooks.emit("loaded"), i;
29968
29998
  });
29969
29999
  }
29970
30000
  /**