@realsee/dnalogel 3.49.7-alpha.0 → 3.49.7

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.
@@ -12,6 +12,11 @@ export declare class LightTag {
12
12
  * @default true
13
13
  */
14
14
  intersectCheck: boolean;
15
+ /**
16
+ * @description 模拟3D
17
+ * @default true
18
+ */
19
+ simulate3D: boolean;
15
20
  private tagWrapper;
16
21
  private five;
17
22
  private originPosition?;
@@ -1,6 +1,6 @@
1
- var m = Object.defineProperty;
2
- var h = (n, o, t) => o in n ? m(n, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[o] = t;
3
- var a = (n, o, t) => (h(n, typeof o != "symbol" ? o + "" : o, t), t);
1
+ var h = Object.defineProperty;
2
+ var m = (n, o, t) => o in n ? h(n, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[o] = t;
3
+ var l = (n, o, t) => (m(n, typeof o != "symbol" ? o + "" : o, t), t);
4
4
  import { BaseTag as g } from "./BaseTag.js";
5
5
  import * as c from "three";
6
6
  import "../../../shared-utils/Subscribe.js";
@@ -46,11 +46,11 @@ import "../../../shared-utils/five/getFloorIndex.js";
46
46
  import "../../../shared-utils/safeObj.js";
47
47
  import "../../utils/Cache.js";
48
48
  const b = new c.Vector2();
49
- class lt extends g {
49
+ class at extends g {
50
50
  constructor(t, e) {
51
51
  super(t, e);
52
- a(this, "__Object__");
53
- a(this, "requestIdleCallbackId");
52
+ l(this, "__Object__");
53
+ l(this, "requestIdleCallbackId");
54
54
  }
55
55
  /**
56
56
  * @description 展开自己,收起其他标签
@@ -65,18 +65,21 @@ class lt extends g {
65
65
  t.target === "TagPoint" && this.unfoldAndFoldOthers();
66
66
  }
67
67
  updateVisible() {
68
+ if (typeof window.requestIdleCallback == "undefined") {
69
+ super.updateVisible();
70
+ return;
71
+ }
68
72
  const t = () => {
69
73
  this.requestIdleCallbackId && cancelIdleCallback(this.requestIdleCallbackId), this.requestIdleCallbackId = requestIdleCallback(() => {
70
74
  super.updateVisible();
71
75
  });
72
76
  };
73
- typeof window.requestIdleCallback == "undefined" && super.updateVisible();
74
77
  let e = !1;
75
78
  requestIdleCallback(() => {
76
79
  e = !0;
77
80
  }), t(), setTimeout(() => {
78
- e || super.updateVisible();
79
- }, 50);
81
+ e || (this.requestIdleCallbackId && cancelIdleCallback(this.requestIdleCallbackId), super.updateVisible());
82
+ }, 200);
80
83
  }
81
84
  applyVisible() {
82
85
  var t, e, s, i;
@@ -103,10 +106,10 @@ class lt extends g {
103
106
  this.originPosition = t, this.position = t, this.cache.clear(), this.updateVisible(), this.updateScreenPosition(), this.updateZIndex(), this.plugin.addRenderQueue({ type: "TagContainerSvelte", keys: ["tags"] });
104
107
  }
105
108
  updateScreenPosition(t) {
106
- var l;
109
+ var a;
107
110
  if (this.stickType !== "2DPoint" && this.stickType !== "3DPoint")
108
111
  return;
109
- const { force: e = !1 } = t != null ? t : {}, s = e ? this.state.visible : this.currentVisible, i = (l = this.__Object__) != null ? l : {
112
+ const { force: e = !1 } = t != null ? t : {}, s = e ? this.state.visible : this.currentVisible, i = (a = this.__Object__) != null ? a : {
110
113
  timeoutId: void 0,
111
114
  inAnimation: !1
112
115
  };
@@ -145,5 +148,5 @@ class lt extends g {
145
148
  }
146
149
  }
147
150
  export {
148
- lt as PointTag
151
+ at as PointTag
149
152
  };
@@ -54,7 +54,7 @@ class M extends I {
54
54
  }
55
55
  class X extends C {
56
56
  constructor(e) {
57
- var s, r, c, a, g;
57
+ var s, r, c, g, a;
58
58
  super();
59
59
  h(this, "name", "LineMesh");
60
60
  h(this, "points");
@@ -72,9 +72,9 @@ class X extends C {
72
72
  dashScale: 40,
73
73
  opacity: (c = e == null ? void 0 : e.opacity) != null ? c : 1,
74
74
  transparent: !0,
75
- dashed: (a = e == null ? void 0 : e.dashed) != null ? a : !1
75
+ dashed: (g = e == null ? void 0 : e.dashed) != null ? g : !1
76
76
  }), n = new S({
77
- color: new u.Color((g = e == null ? void 0 : e.lineColor) != null ? g : b),
77
+ color: new u.Color((a = e == null ? void 0 : e.lineColor) != null ? a : b),
78
78
  linewidth: t.linewidth * 0.9,
79
79
  dashScale: t.dashScale,
80
80
  opacity: t.opacity * 0.7,
@@ -172,11 +172,11 @@ class X extends C {
172
172
  return [this.points[n - 1], t];
173
173
  }).filter(d).map((t) => D(this, t));
174
174
  i.forEach(([t, n], s) => {
175
- var a;
175
+ var g;
176
176
  const r = R(t, n);
177
- this.lengthDoms[s] = (a = this.lengthDoms[s]) != null ? a : (() => {
178
- const g = new x(this.five);
179
- return g.intersectCheck = !1, g;
177
+ this.lengthDoms[s] = (g = this.lengthDoms[s]) != null ? g : (() => {
178
+ const a = new x(this.five);
179
+ return a.intersectCheck = !1, a.simulate3D = !0, a;
180
180
  })(), this.lengthDoms[s].setPosition(r, [t, n]);
181
181
  const c = t.distanceTo(n).toFixed(2);
182
182
  this.lengthDoms[s].lengthDom !== c && (this.lengthDoms[s].lengthDom = c, c === "0.00" ? this.lengthDoms[s].container.innerHTML = "" : this.lengthDoms[s].container.innerHTML = v(c + "m"));
@@ -18,8 +18,8 @@ import { anyPositionToVector3 as P } from "../../shared-utils/positionToVector3.
18
18
  import { ColoredMesh as _ } from "../utils/three/ColoredMesh.js";
19
19
  import { getGeometryInfo as A } from "../../shared-utils/three/geometryUtil.js";
20
20
  import { LightTag as S } from "../../shared-utils/tag.js";
21
- import { getLengthHTML as M } from "../utils/Meshes/getLengthHTML.js";
22
- import { applyObjectMatrixWorld as B } from "../../shared-utils/three/applyObjectMatrixWorld.js";
21
+ import { getLengthHTML as D } from "../utils/Meshes/getLengthHTML.js";
22
+ import { applyObjectMatrixWorld as M } from "../../shared-utils/three/applyObjectMatrixWorld.js";
23
23
  const p = new l.BufferGeometry();
24
24
  p.name = "blankGeometry";
25
25
  p.isBlank = !0;
@@ -58,7 +58,7 @@ class G extends _ {
58
58
  }
59
59
  updateMatrixWorld(e) {
60
60
  if (super.updateMatrixWorld(e), this.center) {
61
- const s = B(this, this.center).toArray().join(",");
61
+ const s = M(this, this.center).toArray().join(",");
62
62
  s !== this.lastRenderAreaItem && (this.updateAreaItems(), this.lastRenderAreaItem = s);
63
63
  }
64
64
  }
@@ -66,9 +66,9 @@ class G extends _ {
66
66
  this._paramsStyle = h(h({}, this._paramsStyle), e), super.setStyle(this._paramsStyle), this.updateAreaItems();
67
67
  }
68
68
  setPoints(e) {
69
- var o;
69
+ var n;
70
70
  const s = e.map(P);
71
- this.points = s, this.geometry = (o = I(this.points, { checkLinesIntersect: !0 })) != null ? o : p, this.planeHelperNeedUpdate = !0, this.geometryInfoNeedUpdate = !0, this.updateAreaItems();
71
+ this.points = s, this.geometry = (n = I(this.points, { checkLinesIntersect: !0 })) != null ? n : p, this.planeHelperNeedUpdate = !0, this.geometryInfoNeedUpdate = !0, this.updateAreaItems();
72
72
  }
73
73
  /**
74
74
  * @description: 获取一个点投影在当前平面上的点
@@ -86,21 +86,21 @@ class G extends _ {
86
86
  this.points.length >= 3 ? this.planeHelper = new l.Plane().setFromCoplanarPoints(this.points[0], this.points[1], this.points[2]) : this.planeHelper = null, this.planeHelperNeedUpdate = !1;
87
87
  }
88
88
  updateAreaItems() {
89
- var o;
89
+ var n;
90
90
  const e = () => {
91
- var n;
92
- (n = this.areaDom) == null || n.destroy(), this.areaDom = void 0;
91
+ var o;
92
+ (o = this.areaDom) == null || o.destroy(), this.areaDom = void 0;
93
93
  };
94
94
  if (!this._paramsStyle.lengthEnable || !this.geometryInfo)
95
95
  return e();
96
96
  if (!this.five)
97
97
  return console.error("Five not found");
98
- this.areaDom = (o = this.areaDom) != null ? o : (() => {
99
- const n = new S(this.five);
100
- return n.intersectCheck = !1, n;
98
+ this.areaDom = (n = this.areaDom) != null ? n : (() => {
99
+ const o = new S(this.five);
100
+ return o.intersectCheck = !1, o.simulate3D = !0, o;
101
101
  })(), this.areaDom.setPosition(this.center);
102
102
  const s = this.geometryInfo.area.toFixed(2);
103
- s === "0.00" ? this.areaDom.container.innerHTML = "" : this.areaDom.container.innerHTML = M(s + "m²");
103
+ s === "0.00" ? this.areaDom.container.innerHTML = "" : this.areaDom.container.innerHTML = D(s + "m²");
104
104
  }
105
105
  }
106
106
  export {
@@ -18,7 +18,7 @@ let P = class {
18
18
  /**
19
19
  * @realsee/dnalogel 版本号
20
20
  */
21
- i(this, "VERSION", "3.49.7-alpha.0");
21
+ i(this, "VERSION", "3.49.7");
22
22
  i(this, "NAME");
23
23
  i(this, "five");
24
24
  i(this, "workUtil");
@@ -1,6 +1,6 @@
1
1
  function A() {
2
2
  console.debug(
3
- "%c %c@realsee/dnalogel %cv3.49.7-alpha.0",
3
+ "%c %c@realsee/dnalogel %cv3.49.7",
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",
@@ -12,6 +12,11 @@ export declare class LightTag {
12
12
  * @default true
13
13
  */
14
14
  intersectCheck: boolean;
15
+ /**
16
+ * @description 模拟3D
17
+ * @default true
18
+ */
19
+ simulate3D: boolean;
15
20
  private tagWrapper;
16
21
  private five;
17
22
  private originPosition?;
@@ -20,6 +20,11 @@ class E {
20
20
  * @default true
21
21
  */
22
22
  s(this, "intersectCheck", !0);
23
+ /**
24
+ * @description 模拟3D
25
+ * @default true
26
+ */
27
+ s(this, "simulate3D", !1);
23
28
  s(this, "tagWrapper");
24
29
  s(this, "five");
25
30
  s(this, "originPosition");
@@ -94,6 +99,8 @@ class E {
94
99
  return;
95
100
  }
96
101
  const o = (() => {
102
+ if (!this.simulate3D)
103
+ return 1;
97
104
  const r = 2 * Math.tan(0.5 * this.five.camera.fov / 180 * Math.PI), a = this.transformedPosition.distanceTo(this.five.camera.position);
98
105
  return Math.max(Math.min(1 - r * a / 40, 1), 0.5);
99
106
  })(), n = (() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@realsee/dnalogel",
3
- "version": "3.49.7-alpha.0",
3
+ "version": "3.49.7",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./libs/index.js",
6
6
  "types": "./libs/index.d.ts",
package/README.md DELETED
@@ -1,116 +0,0 @@
1
- <p align="center">
2
- <a href="https://realsee.js.org/"><img src="https://vrlab-public.ljcdn.com/common/file/web/ea031fa5-ad82-46b3-86c8-7b20ec1e635a.jpg" width="60" /></a>
3
- </p>
4
-
5
-
6
- <p align="center">
7
- <a href="https://www.npmjs.com/package/@realsee/dnalogel">
8
- <img src="https://img.shields.io/npm/v/@realsee/dnalogel.svg" alt="npm version" >
9
- </a>
10
- <a href="https://packagephobia.now.sh/result?p=@realsee/dnalogel">
11
- <img src="https://packagephobia.now.sh/badge?p=@realsee/dnalogel" alt="install size" >
12
- </a>
13
- <a href="https://github.com/realsee-developer/dnalogel/blob/main/TERMS.txt">
14
- <img src="https://img.shields.io/npm/l/@realsee/dnalogel.svg" alt="license">
15
- </a>
16
- </p>
17
-
18
- <h1 align="center">@realsee/dnalogel</h1>
19
-
20
- # 👀 Overview
21
-
22
- @realsee/dnalogel 将 [如视(realsee.com)](https://realsee.com) **VR 空间交互** 常用能力沉淀,并以 `Five Plugins` 形式进行抽象。
23
- 结合[如视三维空间重建渲染引擎 Five](https://open-platform.realsee.com/developer/docs/five/intro/)
24
- 与 [如视开放 API](https://open-platform.realsee.com/developer/openapi/?id=1001) ,可以制作出丰富多彩的三维空间应用。不论是经过线上环境千锤百炼的刚需功能,还是灵感一现的炫酷尝试,所有已经落地的功能我们均毫无保留的开源至github [realsee-developer/dnalogel](https://github.com/realsee-developer/dnalogel) 。
25
-
26
- # 🔨 Usage
27
-
28
- **1、安装**
29
-
30
- ```bash
31
- npm install @realsee/dnalogel
32
- ```
33
-
34
- ```bash
35
- yarn add @realsee/dnalogel
36
- ```
37
-
38
- **2、插件注册**
39
-
40
- ```js
41
- import { Five } from '@realsee/five'
42
- import { Plugin } from '@realsee/dnalogel'
43
- const five = new Five({
44
- plugins: [[Plugin, 'PluginName', initOptions]],
45
- })
46
- ```
47
-
48
- **3、插件方法使用**
49
-
50
- ```js
51
- // 不同插件提供的方法可能存在差异,请参考各插件 API 文档
52
- five.plugins.PluginName.load(data)
53
- five.plugins.PluginName.enable()
54
- five.plugins.PluginName.disable()
55
- five.plugins.PluginName.dispose()
56
- ```
57
-
58
- **4、插件依赖数据获取**
59
-
60
- 您可以通过 [open API](https://open-platform.realsee.com/developer/open/api#/) 查看数据获取方式及相关 open API 。
61
-
62
- # 📖 Documents
63
-
64
- - [说明文档](https://open-platform.realsee.com/developer/docs/dnalogel/intro/)
65
- - [API 文档](https://open-platform.realsee.com/developer/openapi/?id=1001)
66
- - [demo 源码](https://github.com/realsee-developer/dnalogel)
67
- - [数据依赖来源:open API](https://open-platform.realsee.com/developer/openapi/?id=1001)
68
-
69
- # 💡 Preview
70
-
71
- 我们为每个插件书写了简单的效果示例,您可点击预览:
72
- [@realsee/dnalogel showcase](https://realsee-developer.github.io/dnalogel/)
73
-
74
- # 🧾 Lists
75
-
76
- - 🔌 ModelViewPlugin:模型小窗插件
77
- - 🔌 PanoFloorplanRadarPlugin:全景户型雷达图插件
78
- - 🔌 ModelRoomLabelPlugin:模型态房屋标签插件
79
- - 🔌 TopviewFloorplanPlugin:俯视模型户型图插件
80
- - 🔌 ModelChassisCompassPlugin:模型底盘指南针插件
81
- - 🔌 ModelEntryDoorGuidePlugin:模型入户门引导插件
82
- - 🔌 CSS3DRenderPlugin:CSS3D渲染插件
83
- - 🔌 CameraMovementPlugin:相机运镜插件
84
- - 🔌 ModelFloorplanPlugin:模型户型图插件
85
- - 🔌 PanoRulerPlugin:全景标尺插件
86
- - 🔌 PanoCompassPlugin:全景指南针插件
87
- - 其他插件持续更新中...
88
-
89
- # 可能遇到的问题
90
-
91
- 1. webpack打包出现以下错误
92
-
93
- ```bash
94
- Module not found: Error: Can't resolve '@realsee/five/line' in 'xxx/node_modules/@realsee/dnalogel/libs'
95
- Did you mean 'index.js'?
96
- BREAKING CHANGE: The request '@realsee/five/line' failed to resolve only because it was resolved as fully specified
97
- (probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
98
- The extension in the request is mandatory for it to be fully specified.
99
- Add the extension to the request.
100
- ```
101
-
102
- 解决方案:在webpack配置里加以下rule
103
- 参考:[resolvefullyspecified](https://webpack.js.org/configuration/module/#resolvefullyspecified)
104
-
105
- ```js
106
- {
107
- test: /\.m?js$/,
108
- resolve: {
109
- fullySpecified: false, // disable the behaviour
110
- },
111
- },
112
- ```
113
-
114
- # License
115
-
116
- [TERMS](https://github.com/realsee-developer/dnalogel/blob/main/TERMS.txt)