@anov/3d-ability 0.0.124 → 0.0.126

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.
Files changed (74) hide show
  1. package/dist/business/Area/Fence/FenceBase.d.ts +35 -0
  2. package/dist/business/Area/Fence/fence_base_01.d.ts +11 -0
  3. package/dist/business/Area/Fence/fence_feeting_01.d.ts +11 -0
  4. package/dist/business/Area/Fence/fence_roll_01.d.ts +11 -0
  5. package/dist/business/Area/FillArea/FillAreaBase.d.ts +32 -0
  6. package/dist/business/Area/FillArea/fillArea_face_01.d.ts +11 -0
  7. package/dist/business/Area/FillArea/fillArea_line_01.d.ts +10 -0
  8. package/dist/business/Box/index.d.ts +13 -0
  9. package/dist/business/Box/index.js +97 -0
  10. package/dist/business/Box/index.js.map +1 -0
  11. package/dist/business/Box/interface.d.ts +10 -0
  12. package/dist/business/Box/interface.js +2 -0
  13. package/dist/business/Box/interface.js.map +1 -0
  14. package/dist/business/Box/types.d.ts +10 -0
  15. package/dist/business/Box/types.js +2 -0
  16. package/dist/business/Box/types.js.map +1 -0
  17. package/dist/business/Cylinder/index.d.ts +13 -0
  18. package/dist/business/Cylinder/index.js +95 -0
  19. package/dist/business/Cylinder/index.js.map +1 -0
  20. package/dist/business/Cylinder/interface.d.ts +10 -0
  21. package/dist/business/Cylinder/interface.js +2 -0
  22. package/dist/business/Cylinder/interface.js.map +1 -0
  23. package/dist/business/Cylinder/types.d.ts +9 -0
  24. package/dist/business/Cylinder/types.js +2 -0
  25. package/dist/business/Cylinder/types.js.map +1 -0
  26. package/dist/business/InfoPanel/index.d.ts +42 -0
  27. package/dist/business/InfoPanel/index.js +288 -0
  28. package/dist/business/InfoPanel/index.js.map +1 -0
  29. package/dist/business/InfoPanel/type.d.ts +52 -0
  30. package/dist/business/InfoPanel/type.js +2 -0
  31. package/dist/business/InfoPanel/type.js.map +1 -0
  32. package/dist/business/Line/index.d.ts +13 -0
  33. package/dist/business/Line/index.js +110 -0
  34. package/dist/business/Line/index.js.map +1 -0
  35. package/dist/business/Line/interface.d.ts +9 -0
  36. package/dist/business/Line/interface.js +2 -0
  37. package/dist/business/Line/interface.js.map +1 -0
  38. package/dist/business/Line/types.d.ts +6 -0
  39. package/dist/business/Line/types.js +2 -0
  40. package/dist/business/Line/types.js.map +1 -0
  41. package/dist/business/Plane/index.d.ts +13 -0
  42. package/dist/business/Plane/index.js +96 -0
  43. package/dist/business/Plane/index.js.map +1 -0
  44. package/dist/business/Plane/interface.d.ts +19 -0
  45. package/dist/business/Plane/interface.js +2 -0
  46. package/dist/business/Plane/interface.js.map +1 -0
  47. package/dist/business/Plane/types.d.ts +8 -0
  48. package/dist/business/Plane/types.js +2 -0
  49. package/dist/business/Plane/types.js.map +1 -0
  50. package/dist/business/Sphere/index.d.ts +13 -0
  51. package/dist/business/Sphere/index.js +89 -0
  52. package/dist/business/Sphere/index.js.map +1 -0
  53. package/dist/business/Sphere/interface.d.ts +10 -0
  54. package/dist/business/Sphere/interface.js +2 -0
  55. package/dist/business/Sphere/interface.js.map +1 -0
  56. package/dist/business/Sphere/types.d.ts +6 -0
  57. package/dist/business/Sphere/types.js +2 -0
  58. package/dist/business/Sphere/types.js.map +1 -0
  59. package/dist/business/VideoPanel/index.d.ts +59 -0
  60. package/dist/business/VideoPanel/index.js +364 -0
  61. package/dist/business/VideoPanel/index.js.map +1 -0
  62. package/dist/business/VideoPanel/type.d.ts +62 -0
  63. package/dist/business/VideoPanel/type.js +2 -0
  64. package/dist/business/VideoPanel/type.js.map +1 -0
  65. package/dist/business/index.d.ts +7 -0
  66. package/dist/business/index.js +7 -0
  67. package/dist/business/index.js.map +1 -1
  68. package/dist/core/Material/SurfaceMaterial/index.d.ts +4 -2
  69. package/dist/core/Material/SurfaceMaterial/index.js +8 -2
  70. package/dist/core/Material/SurfaceMaterial/index.js.map +1 -1
  71. package/dist/core/WeatherSystem/objects/rain/index.d.ts +1 -1
  72. package/dist/core/WeatherSystem/objects/rain/index.js +5 -6
  73. package/dist/core/WeatherSystem/objects/rain/index.js.map +1 -1
  74. package/package.json +3 -3
@@ -0,0 +1,364 @@
1
+ var _excluded = ["value"];
2
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
3
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
5
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
6
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
7
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
8
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
9
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
10
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
11
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
12
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
13
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
14
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
15
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
16
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
17
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
18
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
19
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
20
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
21
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
22
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
23
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
24
+ /**
25
+ * @file index.ts
26
+ * @description 视频面板
27
+ * @author xingwei
28
+ * @createTime 2025-08-22
29
+ * @lastEditTime 2025-08-22
30
+ */
31
+
32
+ import ObjectLayer from "../Base/ObjectLayer";
33
+ import _ from 'lodash';
34
+ import { Group, Vector3, createLabel } from '@anov/3d-core';
35
+ var DEFAULT_OPTION = {
36
+ position: [0, 0, 0],
37
+ width: 300,
38
+ height: 200,
39
+ bgColor: '#fff',
40
+ borderRadius: 8,
41
+ closeable: true,
42
+ padding: '10px',
43
+ volume: 0.5,
44
+ src: '',
45
+ autoplay: false,
46
+ controls: false,
47
+ loop: false,
48
+ muted: false,
49
+ poster: '',
50
+ videoHeight: 150
51
+ };
52
+ var VideoPanel = /*#__PURE__*/function (_ObjectLayer) {
53
+ _inherits(VideoPanel, _ObjectLayer);
54
+ var _super = _createSuper(VideoPanel);
55
+ function VideoPanel(option) {
56
+ var _this;
57
+ _classCallCheck(this, VideoPanel);
58
+ _this = _super.call(this);
59
+ _defineProperty(_assertThisInitialized(_this), "_title", void 0);
60
+ _defineProperty(_assertThisInitialized(_this), "_width", void 0);
61
+ _defineProperty(_assertThisInitialized(_this), "_height", void 0);
62
+ _defineProperty(_assertThisInitialized(_this), "_bgColor", void 0);
63
+ _defineProperty(_assertThisInitialized(_this), "_position", void 0);
64
+ _defineProperty(_assertThisInitialized(_this), "_borderRadius", 10);
65
+ _defineProperty(_assertThisInitialized(_this), "_bgUrl", void 0);
66
+ _defineProperty(_assertThisInitialized(_this), "_className", void 0);
67
+ _defineProperty(_assertThisInitialized(_this), "_customStyle", void 0);
68
+ _defineProperty(_assertThisInitialized(_this), "_closeable", void 0);
69
+ _defineProperty(_assertThisInitialized(_this), "_padding", void 0);
70
+ _defineProperty(_assertThisInitialized(_this), "_group", void 0);
71
+ _defineProperty(_assertThisInitialized(_this), "_videoElement", void 0);
72
+ _defineProperty(_assertThisInitialized(_this), "_src", void 0);
73
+ _defineProperty(_assertThisInitialized(_this), "_autoplay", void 0);
74
+ _defineProperty(_assertThisInitialized(_this), "_controls", void 0);
75
+ _defineProperty(_assertThisInitialized(_this), "_loop", void 0);
76
+ _defineProperty(_assertThisInitialized(_this), "_muted", void 0);
77
+ _defineProperty(_assertThisInitialized(_this), "_poster", void 0);
78
+ _defineProperty(_assertThisInitialized(_this), "_volume", void 0);
79
+ _defineProperty(_assertThisInitialized(_this), "_videoHeight", void 0);
80
+ _defineProperty(_assertThisInitialized(_this), "_videoWidth", void 0);
81
+ _defineProperty(_assertThisInitialized(_this), "_onClose", void 0);
82
+ _defineProperty(_assertThisInitialized(_this), "visible", false);
83
+ var params = _.mergeWith(_.cloneDeep(DEFAULT_OPTION), option);
84
+ var _title = params.title,
85
+ _width = params.width,
86
+ _height = params.height,
87
+ _bgColor = params.bgColor,
88
+ _position = params.position,
89
+ _bgUrl = params.bgUrl,
90
+ _className = params.className,
91
+ _customStyle = params.customStyle,
92
+ _borderRadius = params.borderRadius,
93
+ _padding = params.padding,
94
+ _closeable = params.closeable,
95
+ _autoplay = params.autoplay,
96
+ _controls = params.controls,
97
+ _loop = params.loop,
98
+ _muted = params.muted,
99
+ _poster = params.poster,
100
+ _volume = params.volume,
101
+ _src = params.src,
102
+ _videoHeight = params.videoHeight,
103
+ _videoWidth = params.videoWidth,
104
+ _onClose = params.onClose;
105
+ Object.assign(_assertThisInitialized(_this), {
106
+ _videoWidth: _videoWidth,
107
+ _videoHeight: _videoHeight,
108
+ _title: _title,
109
+ _autoplay: _autoplay,
110
+ _loop: _loop,
111
+ _muted: _muted,
112
+ _volume: _volume,
113
+ _poster: _poster,
114
+ _controls: _controls,
115
+ _src: _src,
116
+ _width: _width,
117
+ _height: _height,
118
+ _bgColor: _bgColor,
119
+ _position: _position,
120
+ _bgUrl: _bgUrl,
121
+ _className: _className,
122
+ _customStyle: _customStyle,
123
+ _borderRadius: _borderRadius,
124
+ _padding: _padding,
125
+ _closeable: _closeable,
126
+ _onClose: _onClose
127
+ });
128
+ _this._videoElement = _this.createVideoDom();
129
+ _this._group = new Group();
130
+ _this._group.visible = _this.visible;
131
+ _this.init();
132
+ return _this;
133
+ }
134
+ _createClass(VideoPanel, [{
135
+ key: "init",
136
+ value: function init() {
137
+ this.createBox();
138
+ }
139
+ }, {
140
+ key: "createBox",
141
+ value: function createBox() {
142
+ var _this$_title;
143
+ // 使用 DocumentFragment 减少重排
144
+ // const fragment = document.createDocumentFragment();
145
+ var bgDom = this.createBgDom(); //创建容器盒子
146
+ var videoContainer = document.createElement('div');
147
+ if ((_this$_title = this._title) !== null && _this$_title !== void 0 && _this$_title.value || this._closeable) {
148
+ var headerDom = this.createHeaderDom(); //创建头部盒子
149
+ bgDom.appendChild(headerDom);
150
+ }
151
+ videoContainer.appendChild(this._videoElement);
152
+ bgDom.appendChild(videoContainer);
153
+ var bgObject = createLabel(bgDom);
154
+ bgObject.position.set(0, 0, 0);
155
+ bgObject.center.set(0.5, 0.5);
156
+ this._group.add(bgObject);
157
+ this.add(this._group);
158
+ this.applyPosition(); // 初始化自动定位
159
+ }
160
+ /** 创建背景 */
161
+ }, {
162
+ key: "createBgDom",
163
+ value: function createBgDom() {
164
+ //创建容器盒子
165
+ var bgDom = document.createElement('div');
166
+ Object.assign(bgDom.style, {
167
+ width: "".concat(this._width, "px"),
168
+ height: "".concat(this._height, "px"),
169
+ // left: `${this._position[0]}px`,
170
+ // top: `${this._position[1]}px`,
171
+ overflow: 'hidden',
172
+ padding: this._padding,
173
+ borderRadius: this._bgUrl ? '' : "".concat(this._borderRadius, "px"),
174
+ backgroundColor: this._bgUrl ? '' : this._bgColor,
175
+ backgroundImage: this._bgUrl ? "url(".concat(this._bgUrl, ")") : '',
176
+ backgroundSize: this._bgUrl ? 'contain' : '',
177
+ backgroundRepeat: this._bgUrl ? 'no-repeat' : '',
178
+ boxSizing: 'border-box',
179
+ display: 'flex'
180
+ });
181
+ if (this._className) bgDom.className = this._className;
182
+ if (this._customStyle) Object.assign(bgDom.style, this._customStyle);
183
+ return bgDom;
184
+ }
185
+ /** 创建头部 */
186
+ }, {
187
+ key: "createHeaderDom",
188
+ value: function createHeaderDom() {
189
+ var _this$_title2,
190
+ _this2 = this;
191
+ var headerDom = document.createElement('div');
192
+ headerDom.className = 'video-panel-header';
193
+ headerDom.style.display = 'flex';
194
+ headerDom.style.alignItems = 'center';
195
+ headerDom.style.justifyContent = 'flex-end';
196
+ if ((_this$_title2 = this._title) !== null && _this$_title2 !== void 0 && _this$_title2.value) {
197
+ // 创建标题
198
+ var titleDom = document.createElement('p');
199
+ titleDom.className = 'panel-title';
200
+ titleDom.style.display = 'flex';
201
+ titleDom.style.flex = '1';
202
+ titleDom.textContent = this._title.value;
203
+ var _this$_title3 = this._title,
204
+ titleValue = _this$_title3.value,
205
+ titleStyle = _objectWithoutProperties(_this$_title3, _excluded);
206
+ // 正确设置样式的方式
207
+ Object.assign(titleDom.style, titleStyle); //待测试
208
+
209
+ headerDom.appendChild(titleDom);
210
+ }
211
+
212
+ // 创建关闭按钮
213
+ if (this._closeable) {
214
+ var _this$_title4, _this$_title5;
215
+ var closeDom = document.createElement('div');
216
+ closeDom.className = 'panel-close';
217
+ closeDom.style.cursor = 'pointer';
218
+ closeDom.style.fontSize = (_this$_title4 = this._title) === null || _this$_title4 === void 0 ? void 0 : _this$_title4.fontSize;
219
+ closeDom.style.color = (_this$_title5 = this._title) === null || _this$_title5 === void 0 ? void 0 : _this$_title5.color;
220
+ closeDom.textContent = 'x';
221
+ closeDom.style.pointerEvents = 'auto';
222
+ closeDom.onclick = function () {
223
+ _this2.close();
224
+ };
225
+ headerDom.appendChild(closeDom);
226
+ }
227
+ return headerDom;
228
+ }
229
+ }, {
230
+ key: "createVideoDom",
231
+ value: function createVideoDom() {
232
+ var videoDom = document.createElement('video');
233
+ videoDom.style.width = this._videoWidth ? "".concat(this._videoWidth, "px") : '100%';
234
+ videoDom.style.height = this._videoHeight ? "".concat(this._videoHeight, "px") : '100%';
235
+ videoDom.style.objectFit = 'cover';
236
+ videoDom.src = this._src;
237
+ videoDom.autoplay = this._autoplay;
238
+ videoDom.controls = this._controls;
239
+ videoDom.loop = this._loop;
240
+ videoDom.muted = this._muted;
241
+ videoDom.volume = this._volume;
242
+ if (this._poster) videoDom.poster = this._poster;
243
+ return videoDom;
244
+ }
245
+
246
+ /** 自动定位面板 */
247
+ }, {
248
+ key: "applyPosition",
249
+ value: function applyPosition() {
250
+ var offset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Vector3(0, 0, 0);
251
+ if (Array.isArray(this._position)) {
252
+ // 如果是数组 [x, y]
253
+ var _this$_position = _slicedToArray(this._position, 3),
254
+ x = _this$_position[0],
255
+ y = _this$_position[1],
256
+ z = _this$_position[2];
257
+ this._group.position.set(x, -y, z); // 注意y轴取反
258
+ }
259
+ }
260
+ }, {
261
+ key: "open",
262
+ value: function open() {
263
+ this.visible = true;
264
+ this._group.visible = true;
265
+
266
+ // 同步 DOM 节点显示
267
+ // this._group.children.forEach((child: any) => {
268
+ // if (child.element) {
269
+ // child.element.style.display = 'block';
270
+ // }
271
+ // });
272
+ }
273
+ }, {
274
+ key: "close",
275
+ value: function close() {
276
+ this.visible = false;
277
+ this._group.visible = false;
278
+
279
+ // 同步 DOM 节点隐藏
280
+ // this._group.children.forEach((child: any) => {
281
+ // if (child.element) {
282
+ // child.element.style.display = 'none';
283
+ // }
284
+ // });
285
+ if (this._onClose) {
286
+ this._onClose();
287
+ }
288
+ }
289
+ }, {
290
+ key: "update",
291
+ value: function update(option) {
292
+ if (option.src) {
293
+ this._src = option.src;
294
+ this._videoElement.src = option.src;
295
+ }
296
+ if (option.autoplay !== undefined) this._autoplay = option.autoplay;
297
+ if (option.controls !== undefined) this._videoElement.controls = option.controls;
298
+ if (option.loop !== undefined) this._videoElement.loop = option.loop;
299
+ if (option.muted !== undefined) this._videoElement.muted = option.muted;
300
+ if (option.volume !== undefined) this._videoElement.volume = option.volume;
301
+ if (option.poster) this._videoElement.poster = option.poster;
302
+ }
303
+
304
+ // 视频控制方法
305
+ }, {
306
+ key: "play",
307
+ value: function play() {
308
+ this._videoElement.play();
309
+ }
310
+ }, {
311
+ key: "pause",
312
+ value: function pause() {
313
+ this._videoElement.pause();
314
+ }
315
+ }, {
316
+ key: "setVolume",
317
+ value: function setVolume(volume) {
318
+ this._videoElement.volume = Math.max(0, Math.min(1, volume));
319
+ }
320
+ }, {
321
+ key: "seek",
322
+ value: function seek(time) {
323
+ this._videoElement.currentTime = time;
324
+ }
325
+ }, {
326
+ key: "toggleMute",
327
+ value: function toggleMute() {
328
+ this._videoElement.muted = !this._videoElement.muted;
329
+ }
330
+ }, {
331
+ key: "duration",
332
+ get: function get() {
333
+ return this._videoElement.duration;
334
+ }
335
+ }, {
336
+ key: "currentTime",
337
+ get: function get() {
338
+ return this._videoElement.currentTime;
339
+ }
340
+ }, {
341
+ key: "isPlaying",
342
+ get: function get() {
343
+ return !this._videoElement.paused && !this._videoElement.ended;
344
+ }
345
+ }, {
346
+ key: "destroy",
347
+ value: function destroy() {
348
+ this._group.clear();
349
+ this.remove(this._group);
350
+ // 清理DOM引用
351
+ this._group.children.forEach(function (child) {
352
+ if (child.element && child.element.parentNode) {
353
+ child.element.parentNode.removeChild(child.element);
354
+ }
355
+ });
356
+ this._videoElement.pause();
357
+ this._videoElement.src = '';
358
+ this._videoElement.load(); // 清理视频资源
359
+ }
360
+ }]);
361
+ return VideoPanel;
362
+ }(ObjectLayer);
363
+ export { VideoPanel };
364
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ObjectLayer","_","Group","Vector3","createLabel","DEFAULT_OPTION","position","width","height","bgColor","borderRadius","closeable","padding","volume","src","autoplay","controls","loop","muted","poster","videoHeight","VideoPanel","_ObjectLayer","_inherits","_super","_createSuper","option","_this","_classCallCheck","call","_defineProperty","_assertThisInitialized","params","mergeWith","cloneDeep","_title","title","_width","_height","_bgColor","_position","_bgUrl","bgUrl","_className","className","_customStyle","customStyle","_borderRadius","_padding","_closeable","_autoplay","_controls","_loop","_muted","_poster","_volume","_src","_videoHeight","_videoWidth","videoWidth","_onClose","onClose","Object","assign","_videoElement","createVideoDom","_group","visible","init","_createClass","key","value","createBox","_this$_title","bgDom","createBgDom","videoContainer","document","createElement","headerDom","createHeaderDom","appendChild","bgObject","set","center","add","applyPosition","style","concat","overflow","backgroundColor","backgroundImage","backgroundSize","backgroundRepeat","boxSizing","display","_this$_title2","_this2","alignItems","justifyContent","titleDom","flex","textContent","_this$_title3","titleValue","titleStyle","_objectWithoutProperties","_excluded","_this$_title4","_this$_title5","closeDom","cursor","fontSize","color","pointerEvents","onclick","close","videoDom","objectFit","offset","arguments","length","undefined","Array","isArray","_this$_position","_slicedToArray","x","y","z","open","update","play","pause","setVolume","Math","max","min","seek","time","currentTime","toggleMute","get","duration","paused","ended","destroy","clear","remove","children","forEach","child","element","parentNode","removeChild","load"],"sources":["../../../src/business/VideoPanel/index.ts"],"sourcesContent":["/**\n * @file index.ts\n * @description 视频面板\n * @author xingwei\n * @createTime 2025-08-22\n * @lastEditTime 2025-08-22\n */\n\nimport ObjectLayer from \"../Base/ObjectLayer\";\nimport _ from 'lodash'\nimport { Group, Vector3, createLabel, CSS2DRenderer} from '@anov/3d-core'\nimport type {Option, TitleOption} from './type'\nimport { IPanel } from './type'\n\nconst DEFAULT_OPTION = {\n position: [0, 0, 0],\n width: 300,\n height: 200,\n bgColor: '#fff',\n borderRadius: 8,\n closeable: true,\n padding: '10px',\n volume: 0.5,\n src: '',\n autoplay: false,\n controls: false,\n loop: false,\n muted: false,\n poster: '',\n videoHeight: 150\n}\n\nclass VideoPanel extends ObjectLayer implements IPanel{\n private _title: TitleOption\n private _width: number\n private _height: number\n private _bgColor: string\n private _position: Array<number>\n private _borderRadius: number = 10\n private _bgUrl: string\n private _className: string\n private _customStyle: any\n private _closeable: boolean\n private _padding: string \n private _group: Group\n\n private _videoElement: HTMLVideoElement;\n private _src: string;\n private _autoplay: boolean;\n private _controls: boolean;\n private _loop: boolean;\n private _muted: boolean;\n private _poster?: string;\n private _volume: number;\n private _videoHeight: number;\n private _videoWidth: number;\n\n private _onClose: Function\n visible: boolean = false;\n\n constructor(option: Option) {\n super();\n const params = _.mergeWith(_.cloneDeep(DEFAULT_OPTION), option)\n const {\n title: _title,\n width: _width,\n height: _height,\n bgColor: _bgColor,\n position: _position,\n bgUrl: _bgUrl,\n className: _className,\n customStyle: _customStyle,\n borderRadius: _borderRadius,\n padding: _padding,\n closeable: _closeable,\n autoplay: _autoplay,\n controls: _controls,\n loop: _loop,\n muted: _muted,\n poster: _poster,\n volume: _volume,\n src: _src,\n videoHeight: _videoHeight,\n videoWidth: _videoWidth,\n onClose: _onClose\n } = params;\n\n Object.assign(this, {\n _videoWidth, _videoHeight, _title, _autoplay, _loop, _muted, _volume, _poster, _controls, _src, _width, _height, _bgColor, _position,\n _bgUrl, _className, _customStyle, _borderRadius, _padding,_closeable, _onClose\n });\n \n this._videoElement = this.createVideoDom();\n this._group = new Group()\n this._group.visible = this.visible\n this.init()\n }\n private init(){\n this.createBox()\n }\n\n\n private createBox(){\n // 使用 DocumentFragment 减少重排\n // const fragment = document.createDocumentFragment();\n const bgDom = this.createBgDom() //创建容器盒子\n const videoContainer = document.createElement('div');\n \n if(this._title?.value || this._closeable){\n const headerDom = this.createHeaderDom() //创建头部盒子\n bgDom.appendChild(headerDom)\n }\n videoContainer.appendChild(this._videoElement)\n bgDom.appendChild(videoContainer)\n\n const bgObject = createLabel(bgDom);\n bgObject.position.set(0, 0, 0);\n bgObject.center.set(0.5, 0.5);\n\n this._group.add(bgObject);\n\n this.add(this._group)\n this.applyPosition(); // 初始化自动定位\n }\n /** 创建背景 */\n private createBgDom(){\n //创建容器盒子\n const bgDom = document.createElement('div');\n Object.assign(bgDom.style, {\n width: `${this._width}px`,\n height: `${this._height}px`,\n // left: `${this._position[0]}px`,\n // top: `${this._position[1]}px`,\n overflow: 'hidden',\n padding: this._padding,\n borderRadius: this._bgUrl ? '' : `${this._borderRadius}px`,\n backgroundColor: this._bgUrl ? '' : this._bgColor,\n backgroundImage: this._bgUrl ? `url(${this._bgUrl})` : '',\n backgroundSize: this._bgUrl ? 'contain' : '',\n backgroundRepeat: this._bgUrl ? 'no-repeat' : '',\n boxSizing: 'border-box',\n display: 'flex',\n \n });\n \n if (this._className) bgDom.className = this._className;\n if (this._customStyle) Object.assign(bgDom.style, this._customStyle);\n return bgDom;\n }\n /** 创建头部 */\n private createHeaderDom(){\n const headerDom = document.createElement('div')\n headerDom.className = 'video-panel-header'\n headerDom.style.display = 'flex'\n headerDom.style.alignItems = 'center'\n headerDom.style.justifyContent = 'flex-end'\n if(this._title?.value) {\n // 创建标题\n const titleDom = document.createElement('p')\n titleDom.className = 'panel-title'\n titleDom.style.display = 'flex'\n titleDom.style.flex = '1'\n titleDom.textContent = this._title.value\n const {value: titleValue, ...titleStyle} = this._title\n // 正确设置样式的方式\n Object.assign(titleDom.style, titleStyle) //待测试\n\n headerDom.appendChild(titleDom)\n }\n \n // 创建关闭按钮\n if(this._closeable){\n const closeDom = document.createElement('div')\n closeDom.className = 'panel-close'\n closeDom.style.cursor = 'pointer'\n closeDom.style.fontSize = this._title?.fontSize\n closeDom.style.color = this._title?.color\n closeDom.textContent = 'x'\n closeDom.style.pointerEvents = 'auto'\n closeDom.onclick = () => {\n this.close()\n }\n \n headerDom.appendChild(closeDom)\n }\n return headerDom\n }\n private createVideoDom(){\n \n const videoDom = document.createElement('video');\n videoDom.style.width = this._videoWidth ? `${this._videoWidth}px` : '100%';\n videoDom.style.height = this._videoHeight ? `${this._videoHeight}px` : '100%';\n videoDom.style.objectFit = 'cover';\n videoDom.src = this._src;\n videoDom.autoplay = this._autoplay;\n videoDom.controls = this._controls;\n videoDom.loop = this._loop;\n videoDom.muted = this._muted;\n videoDom.volume = this._volume;\n\n if(this._poster) videoDom.poster = this._poster;\n return videoDom;\n }\n\n /** 自动定位面板 */\n private applyPosition(offset: Vector3 = new Vector3(0, 0, 0)) {\n if (Array.isArray(this._position)) {\n // 如果是数组 [x, y]\n const [x, y, z] = this._position;\n this._group.position.set(x, -y, z); // 注意y轴取反\n }\n }\n\n public open(){\n this.visible = true\n this._group.visible = true;\n\n // 同步 DOM 节点显示\n // this._group.children.forEach((child: any) => {\n // if (child.element) {\n // child.element.style.display = 'block';\n // }\n // });\n }\n public close(){\n this.visible = false\n this._group.visible = false;\n\n // 同步 DOM 节点隐藏\n // this._group.children.forEach((child: any) => {\n // if (child.element) {\n // child.element.style.display = 'none';\n // }\n // });\n if(this._onClose){\n this._onClose()\n }\n }\n public update(option: Option){\n if (option.src) {\n this._src = option.src;\n this._videoElement.src = option.src;\n }\n if (option.autoplay !== undefined) this._autoplay = option.autoplay;\n if (option.controls !== undefined) this._videoElement.controls = option.controls;\n if (option.loop !== undefined) this._videoElement.loop = option.loop;\n if (option.muted !== undefined) this._videoElement.muted = option.muted;\n if (option.volume !== undefined) this._videoElement.volume = option.volume;\n if (option.poster) this._videoElement.poster = option.poster;\n }\n\n // 视频控制方法\n public play(): void {\n this._videoElement.play();\n }\n\n public pause(): void {\n this._videoElement.pause();\n }\n\n public setVolume(volume: number): void {\n this._videoElement.volume = Math.max(0, Math.min(1, volume));\n }\n\n public seek(time: number): void {\n this._videoElement.currentTime = time;\n }\n\n public toggleMute(): void {\n this._videoElement.muted = !this._videoElement.muted;\n }\n\n public get duration(): number {\n return this._videoElement.duration;\n }\n\n public get currentTime(): number {\n return this._videoElement.currentTime;\n }\n\n public get isPlaying(): boolean {\n return !this._videoElement.paused && !this._videoElement.ended;\n }\n\n destroy(): void {\n this._group.clear();\n this.remove(this._group)\n // 清理DOM引用\n this._group.children.forEach((child: any) => {\n if (child.element && child.element.parentNode) {\n child.element.parentNode.removeChild(child.element);\n }\n });\n this._videoElement.pause();\n this._videoElement.src = '';\n this._videoElement.load(); // 清理视频资源\n }\n}\n\nexport {VideoPanel}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,WAAW;AAClB,OAAOC,CAAC,MAAM,QAAQ;AACtB,SAASC,KAAK,EAAEC,OAAO,EAAEC,WAAW,QAAsB,eAAe;AAIzE,IAAMC,cAAc,GAAG;EACnBC,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;EACnBC,KAAK,EAAE,GAAG;EACVC,MAAM,EAAE,GAAG;EACXC,OAAO,EAAE,MAAM;EACfC,YAAY,EAAE,CAAC;EACfC,SAAS,EAAE,IAAI;EACfC,OAAO,EAAE,MAAM;EACfC,MAAM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IAAI,CAAC9E,aAAa,CAACgF,MAAM,IAAI,CAAC,IAAI,CAAChF,aAAa,CAACiF,KAAK;IAClE;EAAC;IAAA3E,GAAA;IAAAC,KAAA,EAED,SAAA2E,QAAA,EAAgB;MACZ,IAAI,CAAChF,MAAM,CAACiF,KAAK,CAAC,CAAC;MACnB,IAAI,CAACC,MAAM,CAAC,IAAI,CAAClF,MAAM,CAAC;MACxB;MACA,IAAI,CAACA,MAAM,CAACmF,QAAQ,CAACC,OAAO,CAAC,UAACC,KAAU,EAAK;QACzC,IAAIA,KAAK,CAACC,OAAO,IAAID,KAAK,CAACC,OAAO,CAACC,UAAU,EAAE;UAC3CF,KAAK,CAACC,OAAO,CAACC,UAAU,CAACC,WAAW,CAACH,KAAK,CAACC,OAAO,CAAC;QACvD;MACJ,CAAC,CAAC;MACF,IAAI,CAACxF,aAAa,CAACqE,KAAK,CAAC,CAAC;MAC1B,IAAI,CAACrE,aAAa,CAAClD,GAAG,GAAG,EAAE;MAC3B,IAAI,CAACkD,aAAa,CAAC2F,IAAI,CAAC,CAAC,CAAC,CAAC;IAC/B;EAAC;EAAA,OAAAtI,UAAA;AAAA,EAxQoBrB,WAAW;AA2QpC,SAAQqB,UAAU"}
@@ -0,0 +1,62 @@
1
+ import { Vector3 } from '@anov/3d-core';
2
+ export interface IPanel {
3
+ /** 打开面板 */
4
+ open: () => void;
5
+ /** 关闭面板 */
6
+ close: () => void;
7
+ /** 更新面板 */
8
+ update: (option: Option) => void;
9
+ /** 销毁面板 */
10
+ destroy: () => void;
11
+ /**播放 */
12
+ play: () => void;
13
+ /**暂停 */
14
+ pause: () => void;
15
+ /**设置音量 */
16
+ setVolume: (volume: number) => void;
17
+ /**跳转 */
18
+ seek: (time: number) => void;
19
+ /** 切换静音 */
20
+ toggleMute: () => void;
21
+ /**获取视频时长 */
22
+ get duration(): number;
23
+ /**获取当前播放时间 */
24
+ get currentTime(): number;
25
+ /**获取是否播放中 */
26
+ get isPlaying(): boolean;
27
+ }
28
+ export type Option = Partial<{
29
+ title: TitleOption;
30
+ position: Vector3;
31
+ width: number | string;
32
+ height: number | string;
33
+ bgColor: string;
34
+ bgUrl: string;
35
+ borderRadius: number;
36
+ padding: string;
37
+ closeable: boolean;
38
+ className: string;
39
+ customStyle: object;
40
+ autoplay: boolean;
41
+ loop: boolean;
42
+ controls: boolean;
43
+ muted: boolean;
44
+ src: string;
45
+ volume: number;
46
+ poster: string;
47
+ videoWidth: number;
48
+ videoHeight: number;
49
+ onClose: () => void;
50
+ }>;
51
+ export type TitleOption = Partial<{
52
+ value: string;
53
+ fontSize: string;
54
+ color: string;
55
+ fontFamily: string;
56
+ fontWeight: number;
57
+ lineHeight: number | string;
58
+ textAlign: string;
59
+ padding: string;
60
+ margin: string;
61
+ icon: string;
62
+ }>;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["../../../src/business/VideoPanel/type.ts"],"sourcesContent":["\nimport { Vector3 } from '@anov/3d-core'\n\nexport interface IPanel {\n /** 打开面板 */\n open: () => void;\n /** 关闭面板 */\n close: () => void;\n /** 更新面板 */\n update: (option: Option) => void;\n /** 销毁面板 */\n destroy: () => void;\n /**播放 */\n play: () => void;\n /**暂停 */\n pause: () => void;\n /**设置音量 */\n setVolume: (volume: number) => void;\n /**跳转 */\n seek: (time: number) => void;\n /** 切换静音 */\n toggleMute: () => void;\n /**获取视频时长 */\n get duration(): number;\n /**获取当前播放时间 */\n get currentTime(): number;\n /**获取是否播放中 */\n get isPlaying(): boolean;\n}\n\n// 面板配置项\nexport type Option = Partial<{\n title: TitleOption; // 标题\n position: Vector3; // 位置\n width: number | string; // 宽度\n height: number | string; // 高度\n bgColor: string; // 背景颜色\n bgUrl: string; // 背景图片\n borderRadius: number; // 圆角\n padding: string; // 内边距\n closeable: boolean; // 是否显示关闭按钮\n className: string; // 自定义类名\n customStyle: object; // 自定义样式\n autoplay: boolean; // 是否自动播放\n loop: boolean; // 是否循环播放\n controls: boolean; // 是否显示控制按钮\n muted: boolean; // 是否静音\n src: string; // 视频地址\n volume: number; // 音量\n poster: string; // 视频封面\n videoWidth: number; // 视频宽度\n videoHeight: number; // 视频高度\n onClose: () => void; // 关闭回调\n}>\n\n// 标题\nexport type TitleOption = Partial<{\n value: string;\n fontSize: string;\n color: string;\n fontFamily: string;\n fontWeight: number;\n lineHeight: number | string;\n textAlign: string;\n padding: string;\n margin: string;\n icon: string;\n}>"],"mappings":""}
@@ -8,3 +8,10 @@ export * from './Flyline';
8
8
  export * from './HeatMap';
9
9
  export * from './Mark';
10
10
  export * from './SplitBuilding';
11
+ export * from './InfoPanel';
12
+ export * from './VideoPanel';
13
+ export * from './Box';
14
+ export * from './Sphere';
15
+ export * from './Line';
16
+ export * from './Cylinder';
17
+ export * from './Plane';
@@ -8,4 +8,11 @@ export * from "./Flyline";
8
8
  export * from "./HeatMap";
9
9
  export * from "./Mark";
10
10
  export * from "./SplitBuilding";
11
+ export * from "./InfoPanel";
12
+ export * from "./VideoPanel";
13
+ export * from "./Box";
14
+ export * from "./Sphere";
15
+ export * from "./Line";
16
+ export * from "./Cylinder";
17
+ export * from "./Plane";
11
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../../src/business/index.ts"],"sourcesContent":["export * from './Poi'\nexport * from './Spline'\nexport * from './Area'\nexport * from './TrafficComponents'\nexport * from './Batch'\nexport * from './MaterialSwitch'\nexport * from './Flyline'\nexport * from './HeatMap'\nexport * from './Mark'\nexport * from './SplitBuilding'\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
1
+ {"version":3,"names":[],"sources":["../../src/business/index.ts"],"sourcesContent":["export * from './Poi'\nexport * from './Spline'\nexport * from './Area'\nexport * from './TrafficComponents'\nexport * from './Batch'\nexport * from './MaterialSwitch'\nexport * from './Flyline'\nexport * from './HeatMap'\nexport * from './Mark'\nexport * from './SplitBuilding'\nexport * from './InfoPanel'\nexport * from './VideoPanel'\nexport * from './Box'\nexport * from './Sphere'\nexport * from './Line'\nexport * from './Cylinder'\nexport * from './Plane'"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
@@ -10,9 +10,11 @@ export declare enum EMaterialType {
10
10
  Dirt = "Dirt",// 土壤
11
11
  Fabric = "Fabric",// 布料
12
12
  Floor = "Floor",// 地板
13
- Marble = "Marble",// 大理石
13
+ Marble = "Marble",// 石材
14
14
  Metal = "Metal",// 金属
15
- Road = "Road"
15
+ Road = "Road",// 道路
16
+ Snow = "snow",// 雪地
17
+ Leather = "leather"
16
18
  }
17
19
  export declare class SurfaceMaterial {
18
20
  private static cache;
@@ -25,8 +25,10 @@ export var EMaterialType = /*#__PURE__*/function (EMaterialType) {
25
25
  EMaterialType["Marble"] = "Marble";
26
26
  EMaterialType["Metal"] = "Metal";
27
27
  EMaterialType["Road"] = "Road";
28
+ EMaterialType["Snow"] = "snow";
29
+ EMaterialType["Leather"] = "leather";
28
30
  return EMaterialType;
29
- }({}); // 道路
31
+ }({}); // 皮革
30
32
  var SOURCE_PATH = {
31
33
  Plaster: "".concat(SOURCE_BASE_PATH, "/material/plaster.glb"),
32
34
  // 涂料
@@ -47,11 +49,15 @@ var SOURCE_PATH = {
47
49
  Floor: "".concat(SOURCE_BASE_PATH, "/material/floor.glb"),
48
50
  // 地板
49
51
  Marble: "".concat(SOURCE_BASE_PATH, "/material/marble.glb"),
50
- // 大理石
52
+ // 石材
51
53
  Metal: "".concat(SOURCE_BASE_PATH, "/material/metal.glb"),
52
54
  // 金属
53
55
  Road: "".concat(SOURCE_BASE_PATH, "/material/road.glb"),
54
56
  // 道路
57
+ Leather: "".concat(SOURCE_BASE_PATH, "/material/leather.glb"),
58
+ // 皮革
59
+ Snow: "".concat(SOURCE_BASE_PATH, "/material/snow.glb"),
60
+ // 雪地
55
61
  Emissive: "".concat(SOURCE_BASE_PATH, "/material/emissive.glb"),
56
62
  // 发光材质(适用于夜晚窗户)
57
63
  Fresnel_Transparent: "".concat(SOURCE_BASE_PATH, "/material/emissive2.glb")