@realsee/dnalogel 3.50.11 → 3.50.13

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.
@@ -1,31 +1,31 @@
1
- var U = Object.defineProperty, _ = Object.defineProperties;
2
- var x = Object.getOwnPropertyDescriptors;
1
+ var B = Object.defineProperty, U = Object.defineProperties;
2
+ var _ = Object.getOwnPropertyDescriptors;
3
3
  var f = Object.getOwnPropertySymbols;
4
- var E = Object.prototype.hasOwnProperty, L = Object.prototype.propertyIsEnumerable;
5
- var y = (m, i, e) => i in m ? U(m, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : m[i] = e, r = (m, i) => {
4
+ var x = Object.prototype.hasOwnProperty, E = Object.prototype.propertyIsEnumerable;
5
+ var y = (m, i, e) => i in m ? B(m, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : m[i] = e, r = (m, i) => {
6
6
  for (var e in i || (i = {}))
7
- E.call(i, e) && y(m, e, i[e]);
7
+ x.call(i, e) && y(m, e, i[e]);
8
8
  if (f)
9
9
  for (var e of f(i))
10
- L.call(i, e) && y(m, e, i[e]);
10
+ E.call(i, e) && y(m, e, i[e]);
11
11
  return m;
12
- }, g = (m, i) => _(m, x(i));
13
- var a = (m, i, e) => (y(m, typeof i != "symbol" ? i + "" : i, e), e);
14
- var u = (m, i, e) => new Promise((t, n) => {
15
- var l = (c) => {
12
+ }, g = (m, i) => U(m, _(i));
13
+ var u = (m, i, e) => (y(m, typeof i != "symbol" ? i + "" : i, e), e);
14
+ var a = (m, i, e) => new Promise((t, n) => {
15
+ var c = (l) => {
16
16
  try {
17
- s(e.next(c));
17
+ o(e.next(l));
18
18
  } catch (d) {
19
19
  n(d);
20
20
  }
21
- }, o = (c) => {
21
+ }, s = (l) => {
22
22
  try {
23
- s(e.throw(c));
23
+ o(e.throw(l));
24
24
  } catch (d) {
25
25
  n(d);
26
26
  }
27
- }, s = (c) => c.done ? t(c.value) : Promise.resolve(c.value).then(l, o);
28
- s((e = e.apply(m, i)).next());
27
+ }, o = (l) => l.done ? t(l.value) : Promise.resolve(l.value).then(c, s);
28
+ o((e = e.apply(m, i)).next());
29
29
  });
30
30
  import { globalModules as O } from "./utils/Modules/Global.js";
31
31
  import { Subscribe as S } from "../shared-utils/Subscribe.js";
@@ -50,33 +50,33 @@ import { Circle as C } from "./Objects/Circle/index.js";
50
50
  import { Cylinder as R } from "./Objects/Cylinder/index.js";
51
51
  import { Box as D } from "./Objects/Box/index.js";
52
52
  import { forReverseEach as z } from "../shared-utils/forReverseEach.js";
53
- import { Line as j } from "./Objects/Line/index.js";
54
- import { hotkeys as B } from "../vendor/hotkeys-js/dist/hotkeys.esm.js";
53
+ import { Line as L } from "./Objects/Line/index.js";
54
+ import { hotkeys as j } from "../vendor/hotkeys-js/dist/hotkeys.esm.js";
55
55
  const h = class extends S {
56
56
  constructor(e, t) {
57
57
  super();
58
- a(this, "group");
59
- a(this, "theme");
60
- a(this, "five");
61
- a(this, "creatingItem", null);
58
+ u(this, "group");
59
+ u(this, "theme");
60
+ u(this, "five");
61
+ u(this, "creatingItem", null);
62
62
  /**
63
63
  * @description: 撤销
64
64
  */
65
- a(this, "undo", () => {
65
+ u(this, "undo", () => {
66
66
  var e;
67
67
  console.log("undo"), (e = this.creatingItem) == null || e.undo(), this.five.needsRender = !0;
68
68
  });
69
69
  /**
70
70
  * @description: 重做
71
71
  */
72
- a(this, "redo", () => {
72
+ u(this, "redo", () => {
73
73
  var e;
74
74
  console.log("redo"), (e = this.creatingItem) == null || e.redo(), this.five.needsRender = !0;
75
75
  });
76
- this.five = e, this.theme = t, this.group = new k(), this.group.name = "Sculpt", e.scene.add(this.group), h.modules.init(e), B("ctrl+z", this.undo), B("ctrl+shift+z", this.redo), h.modules.fiveDomEvents.addEventListener(this.group, "click", ({ intersects: n, origDomEvent: l }) => {
77
- var s;
78
- const o = M((s = n == null ? void 0 : n[0]) == null ? void 0 : s.object, (c) => c.isSculptObject);
79
- return o && !o.editing ? this.emit("click", l, o) : !1;
76
+ this.five = e, this.theme = t, this.group = new k(), this.group.name = "Sculpt", e.scene.add(this.group), h.modules.init(e), j("ctrl+z", this.undo), j("ctrl+shift+z", this.redo), h.modules.fiveDomEvents.addEventListener(this.group, "click", ({ intersects: n, origDomEvent: c }) => {
77
+ var o;
78
+ const s = M((o = n == null ? void 0 : n[0]) == null ? void 0 : o.object, (l) => l.isSculptObject);
79
+ return s && !s.editing ? this.emit("click", c, s) : !1;
80
80
  }), window.__SCULPT_DEBUG__ = this, window.__SCULPT_MODULES_DEBUG__ = h.modules;
81
81
  }
82
82
  get data() {
@@ -97,14 +97,14 @@ const h = class extends S {
97
97
  * @description: 加载数据 展示
98
98
  */
99
99
  load(e, t) {
100
- var l;
100
+ var c;
101
101
  this.clear();
102
- const n = (l = e == null ? void 0 : e.items) == null ? void 0 : l.map((o) => {
103
- var c;
104
- const s = g(r({}, o), {
105
- style: r(r({}, (c = this.theme) == null ? void 0 : c[o.type.toLowerCase()]), o.style)
102
+ const n = (c = e == null ? void 0 : e.items) == null ? void 0 : c.map((s) => {
103
+ var l;
104
+ const o = g(r({}, s), {
105
+ style: r(r({}, (l = this.theme) == null ? void 0 : l[s.type.toLowerCase()]), s.style)
106
106
  });
107
- return o.type === "Point" ? new w(s, t) : o.type === "line" ? new j(s, t) : o.type === "Polyline" ? new I(s, t) : o.type === "Polygon" ? new P(s, t) : o.type === "Prism" ? new v(s, t) : o.type === "Rectangle" ? new b(s, t) : o.type === "Circle" ? new C(s, t) : o.type === "Cylinder" ? new R(s, t) : o.type === "Box" ? new D(s, t) : null;
107
+ return s.type === "Point" ? new w(o, t) : s.type === "line" ? new L(o, t) : s.type === "Polyline" ? new I(o, t) : s.type === "Polygon" ? new P(o, t) : s.type === "Prism" ? new v(o, t) : s.type === "Rectangle" ? new b(o, t) : s.type === "Circle" ? new C(o, t) : s.type === "Cylinder" ? new R(o, t) : s.type === "Box" ? new D(o, t) : null;
108
108
  });
109
109
  this.group.add(...n), this.five.needsRender = !0;
110
110
  }
@@ -118,16 +118,16 @@ const h = class extends S {
118
118
  * @description: 放置物体
119
119
  */
120
120
  putObject(e) {
121
- var l;
121
+ var c;
122
122
  this.group.add(e);
123
123
  const t = h.modules.object3DHelper, n = t.addObject3DHelper(e);
124
- return (l = n == null ? void 0 : n.moveController) == null || l.moveByMouse(), t;
124
+ return (c = n == null ? void 0 : n.moveController) == null || c.moveByMouse(), t;
125
125
  }
126
126
  /**
127
127
  * @description: 开始绘制点
128
128
  */
129
129
  createPoint(e) {
130
- return u(this, null, function* () {
130
+ return a(this, null, function* () {
131
131
  var t;
132
132
  return this.createItem(w, r(r({}, (t = this.theme) == null ? void 0 : t.point), e));
133
133
  });
@@ -135,17 +135,25 @@ const h = class extends S {
135
135
  /**
136
136
  * @description: 开始绘制线段
137
137
  */
138
- createline(e) {
139
- return u(this, null, function* () {
138
+ createLine(e) {
139
+ return a(this, null, function* () {
140
140
  var t;
141
- return this.createItem(j, r(r({}, (t = this.theme) == null ? void 0 : t.line), e));
141
+ return this.createItem(L, r(r({}, (t = this.theme) == null ? void 0 : t.line), e));
142
+ });
143
+ }
144
+ /**
145
+ * @deprecated use createLine instead
146
+ */
147
+ createline(...e) {
148
+ return a(this, null, function* () {
149
+ this.createLine(...e);
142
150
  });
143
151
  }
144
152
  /**
145
153
  * @description: 开始绘制空间折线
146
154
  */
147
155
  createPolyline(e) {
148
- return u(this, null, function* () {
156
+ return a(this, null, function* () {
149
157
  var t;
150
158
  return this.createItem(I, r(r({}, (t = this.theme) == null ? void 0 : t.polyline), e));
151
159
  });
@@ -154,7 +162,7 @@ const h = class extends S {
154
162
  * @description: 开始绘制平面多边形
155
163
  */
156
164
  createPolygon(e) {
157
- return u(this, null, function* () {
165
+ return a(this, null, function* () {
158
166
  var t;
159
167
  return this.createItem(P, r(r({}, (t = this.theme) == null ? void 0 : t.polygon), e));
160
168
  });
@@ -163,7 +171,7 @@ const h = class extends S {
163
171
  * @description: 开始绘制多棱柱
164
172
  */
165
173
  createPrism(e) {
166
- return u(this, null, function* () {
174
+ return a(this, null, function* () {
167
175
  var t;
168
176
  return this.createItem(v, r(r({}, (t = this.theme) == null ? void 0 : t.prism), e));
169
177
  });
@@ -172,7 +180,7 @@ const h = class extends S {
172
180
  * @description: 开始绘制矩形
173
181
  */
174
182
  createRectangle(e) {
175
- return u(this, null, function* () {
183
+ return a(this, null, function* () {
176
184
  var t;
177
185
  return this.createItem(b, r(r({}, (t = this.theme) == null ? void 0 : t.rectangle), e));
178
186
  });
@@ -181,7 +189,7 @@ const h = class extends S {
181
189
  * @description: 开始绘制圆形
182
190
  */
183
191
  createCircle(e) {
184
- return u(this, null, function* () {
192
+ return a(this, null, function* () {
185
193
  var t;
186
194
  return this.createItem(C, r(r({}, (t = this.theme) == null ? void 0 : t.circle), e));
187
195
  });
@@ -190,7 +198,7 @@ const h = class extends S {
190
198
  * @description: 开始绘制圆柱
191
199
  */
192
200
  createCylinder(e) {
193
- return u(this, null, function* () {
201
+ return a(this, null, function* () {
194
202
  var t;
195
203
  return this.createItem(R, r(r({}, (t = this.theme) == null ? void 0 : t.cylinder), e));
196
204
  });
@@ -199,7 +207,7 @@ const h = class extends S {
199
207
  * @description: 开始绘制 Box
200
208
  */
201
209
  createBox(e) {
202
- return u(this, null, function* () {
210
+ return a(this, null, function* () {
203
211
  var t;
204
212
  return this.createItem(D, r(r({}, (t = this.theme) == null ? void 0 : t.box), e));
205
213
  });
@@ -219,19 +227,19 @@ const h = class extends S {
219
227
  z(this.items, (e) => e.delete()), this.five.needsRender = !0;
220
228
  }
221
229
  createItem(e, ...t) {
222
- return u(this, null, function* () {
230
+ return a(this, null, function* () {
223
231
  this.creatingItem && (this.creatingItem.stopCreating(), this.creatingItem = null);
224
232
  const n = new e();
225
- return this.creatingItem = n, this.group.add(n), yield n.create(...t).then((...l) => (this.creatingItem = null, l)).catch((l) => {
226
- console.error(l), this.group.remove(n);
233
+ return this.creatingItem = n, this.group.add(n), yield n.create(...t).then((...c) => (this.creatingItem = null, c)).catch((c) => {
234
+ console.error(c), this.group.remove(n);
227
235
  }), n;
228
236
  });
229
237
  }
230
238
  };
231
239
  let p = h;
232
- a(p, "modules", O);
233
- const ae = (m) => new p(m);
240
+ u(p, "modules", O);
241
+ const ue = (m) => new p(m);
234
242
  export {
235
243
  p as Sculpt,
236
- ae as SculptPlugin
244
+ ue as SculptPlugin
237
245
  };
@@ -58,7 +58,7 @@ declare abstract class Controller<PluginState extends State = State, PluginEvent
58
58
  * @realsee/dnalogel 版本号
59
59
  */
60
60
  readonly VERSION: string;
61
- readonly NAME?: string;
61
+ NAME?: string;
62
62
  five: Five;
63
63
  workUtil: WorkUtil;
64
64
  fiveUtil: FiveUtil;
@@ -18,7 +18,7 @@ let P = class {
18
18
  /**
19
19
  * @realsee/dnalogel 版本号
20
20
  */
21
- i(this, "VERSION", "3.50.11");
21
+ i(this, "VERSION", "3.50.13");
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.50.11",
3
+ "%c %c@realsee/dnalogel %cv3.50.13",
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",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@realsee/dnalogel",
3
- "version": "3.50.11",
3
+ "version": "3.50.13",
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)