@anov/3d 0.0.287 → 0.0.289

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 (99) hide show
  1. package/dist/anov3d.js +40 -43
  2. package/dist/anov3d.js.map +1 -1
  3. package/dist/applicationApi.js +94 -118
  4. package/dist/applicationApi.js.map +1 -1
  5. package/dist/hooksManager.js +10 -10
  6. package/dist/hooksManager.js.map +1 -1
  7. package/dist/index.js +1 -1
  8. package/dist/index.js.map +1 -1
  9. package/dist/messageStatus.js +3 -3
  10. package/dist/messageStatus.js.map +1 -1
  11. package/dist/module/animation/index.js +61 -113
  12. package/dist/module/animation/index.js.map +1 -1
  13. package/dist/module/animation/motion/index.js +58 -91
  14. package/dist/module/animation/motion/index.js.map +1 -1
  15. package/dist/module/animation/strategy.js +7 -21
  16. package/dist/module/animation/strategy.js.map +1 -1
  17. package/dist/module/camera/index.js +216 -278
  18. package/dist/module/camera/index.js.map +1 -1
  19. package/dist/module/develop/index.js +27 -35
  20. package/dist/module/develop/index.js.map +1 -1
  21. package/dist/module/entity/area/index.js +29 -87
  22. package/dist/module/entity/area/index.js.map +1 -1
  23. package/dist/module/entity/bar/index.js +5 -24
  24. package/dist/module/entity/bar/index.js.map +1 -1
  25. package/dist/module/entity/bar/style/bar_01.js +13 -52
  26. package/dist/module/entity/bar/style/bar_01.js.map +1 -1
  27. package/dist/module/entity/bar/style/index.js +7 -21
  28. package/dist/module/entity/bar/style/index.js.map +1 -1
  29. package/dist/module/entity/baseEntity.js +43 -66
  30. package/dist/module/entity/baseEntity.js.map +1 -1
  31. package/dist/module/entity/batch/index.js +77 -168
  32. package/dist/module/entity/batch/index.js.map +1 -1
  33. package/dist/module/entity/dispose.js +14 -16
  34. package/dist/module/entity/dispose.js.map +1 -1
  35. package/dist/module/entity/flyline/index.js +34 -90
  36. package/dist/module/entity/flyline/index.js.map +1 -1
  37. package/dist/module/entity/group/index.js +59 -75
  38. package/dist/module/entity/group/index.js.map +1 -1
  39. package/dist/module/entity/heatmap/index.js +62 -79
  40. package/dist/module/entity/heatmap/index.js.map +1 -1
  41. package/dist/module/entity/hybridList.js +49 -67
  42. package/dist/module/entity/hybridList.js.map +1 -1
  43. package/dist/module/entity/index.js +442 -644
  44. package/dist/module/entity/index.js.map +1 -1
  45. package/dist/module/entity/infoPanel/index.js +23 -76
  46. package/dist/module/entity/infoPanel/index.js.map +1 -1
  47. package/dist/module/entity/light/pointLight/index.js +48 -84
  48. package/dist/module/entity/light/pointLight/index.js.map +1 -1
  49. package/dist/module/entity/mark/index.js +51 -101
  50. package/dist/module/entity/mark/index.js.map +1 -1
  51. package/dist/module/entity/model/index.js +108 -151
  52. package/dist/module/entity/model/index.js.map +1 -1
  53. package/dist/module/entity/model/load/loadFbx.js +8 -8
  54. package/dist/module/entity/model/load/loadFbx.js.map +1 -1
  55. package/dist/module/entity/model/load/loadGlb.js +13 -11
  56. package/dist/module/entity/model/load/loadGlb.js.map +1 -1
  57. package/dist/module/entity/model/load.js +19 -57
  58. package/dist/module/entity/model/load.js.map +1 -1
  59. package/dist/module/entity/poi/index.js +34 -90
  60. package/dist/module/entity/poi/index.js.map +1 -1
  61. package/dist/module/entity/shape/index.js +67 -136
  62. package/dist/module/entity/shape/index.js.map +1 -1
  63. package/dist/module/entity/spline/index.js +22 -75
  64. package/dist/module/entity/spline/index.js.map +1 -1
  65. package/dist/module/entity/strategy.js +92 -274
  66. package/dist/module/entity/strategy.js.map +1 -1
  67. package/dist/module/entity/traffic/realismTraffic/index.js +59 -88
  68. package/dist/module/entity/traffic/realismTraffic/index.js.map +1 -1
  69. package/dist/module/entity/traffic/streamerTraffic/index.js +50 -81
  70. package/dist/module/entity/traffic/streamerTraffic/index.js.map +1 -1
  71. package/dist/module/entity/utils.js +11 -13
  72. package/dist/module/entity/utils.js.map +1 -1
  73. package/dist/module/entity/videoPanel/index.js +23 -76
  74. package/dist/module/entity/videoPanel/index.js.map +1 -1
  75. package/dist/module/environment/index.js +54 -73
  76. package/dist/module/environment/index.js.map +1 -1
  77. package/dist/module/environment/season/index.js +342 -184
  78. package/dist/module/environment/season/index.js.map +1 -1
  79. package/dist/module/eventBus/entityEvents.js +1 -1
  80. package/dist/module/eventBus/entityEvents.js.map +1 -1
  81. package/dist/module/eventBus/index.js +79 -93
  82. package/dist/module/eventBus/index.js.map +1 -1
  83. package/dist/module/material/index.js +279 -334
  84. package/dist/module/material/index.js.map +1 -1
  85. package/dist/module/scene/fileParse.js +276 -369
  86. package/dist/module/scene/fileParse.js.map +1 -1
  87. package/dist/module/scene/index.js +106 -161
  88. package/dist/module/scene/index.js.map +1 -1
  89. package/dist/module/tool/index.js +26 -33
  90. package/dist/module/tool/index.js.map +1 -1
  91. package/dist/sdkEntry.js +2 -23
  92. package/dist/sdkEntry.js.map +1 -1
  93. package/dist/utils/abstract.js +12 -15
  94. package/dist/utils/abstract.js.map +1 -1
  95. package/dist/utils/index.js +23 -24
  96. package/dist/utils/index.js.map +1 -1
  97. package/dist/utils/messageFn.js +17 -18
  98. package/dist/utils/messageFn.js.map +1 -1
  99. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"names":["BuildingSplit","BuildingSplitManage","hybridList","Tool","app","_classCallCheck","_defineProperty","buildingMap","Map","_createClass","key","value","buildingSplit","json","_building","building","entityId","floor","animation","has","get","entity","Error","concat","set","result","split","_objectSpread"],"sources":["../../../src/module/tool/index.ts"],"sourcesContent":["import { BuildingSplit as BuildingSplitManage } from '@anov/3d-ability'\nimport type Anov3D from '../..'\nimport type { BaseModule } from '../../utils/abstract'\nimport { hybridList } from '../entity'\n\ntype ResourceParams = {\n url: string\n}\n\ntype LanelineControl = {\n index: number\n direction?: number\n}\n\nexport type CreateTransParams = {\n path: string\n width?: number\n divide?: number\n resource: ResourceParams[]\n baseTime?: number\n totalNum?: number\n control?: LanelineControl[]\n}\n\nclass Tool implements BaseModule {\n app: Anov3D\n buildingMap: Map<string, BuildingSplitManage>\n\n constructor(app: Anov3D) {\n this.app = app\n this.buildingMap = new Map()\n }\n\n // 楼层拆分\n buildingSplit(json) {\n let building: BuildingSplitManage = null\n const { entityId, floor, animation } = json\n\n if (this.buildingMap.has(entityId)) {\n building = this.buildingMap.get(entityId)\n }\n else {\n const entity = hybridList.get(entityId)\n if (!entity)\n throw new Error(`id: ${entityId} 找不到该模型`)\n building = new BuildingSplitManage(entity)\n this.buildingMap.set(entityId, building)\n }\n const result = building?.split({ floor, animation })\n return { ...json, ...result }\n }\n}\n\nexport default Tool"],"mappings":";;;;;;;;;AAAA,SAASA,aAAa,IAAIC,mBAAmB,QAAQ,kBAAkB;AAGvE,SAASC,UAAU;AAAmB,IAqBhCC,IAAI;EAIR,SAAAA,KAAYC,GAAW,EAAE;IAAAC,eAAA,OAAAF,IAAA;IAAAG,eAAA;IAAAA,eAAA;IACvB,IAAI,CAACF,GAAG,GAAGA,GAAG;IACd,IAAI,CAACG,WAAW,GAAG,IAAIC,GAAG,CAAC,CAAC;EAC9B;;EAEA;EAAAC,YAAA,CAAAN,IAAA;IAAAO,GAAA;IAAAC,KAAA,EACA,SAAAC,cAAcC,IAAI,EAAE;MAAA,IAAAC,SAAA;MAClB,IAAIC,QAA6B,GAAG,IAAI;MACxC,IAAQC,QAAQ,GAAuBH,IAAI,CAAnCG,QAAQ;QAAEC,KAAK,GAAgBJ,IAAI,CAAzBI,KAAK;QAAEC,SAAS,GAAKL,IAAI,CAAlBK,SAAS;MAElC,IAAI,IAAI,CAACX,WAAW,CAACY,GAAG,CAACH,QAAQ,CAAC,EAAE;QAClCD,QAAQ,GAAG,IAAI,CAACR,WAAW,CAACa,GAAG,CAACJ,QAAQ,CAAC;MAC3C,CAAC,MACI;QACH,IAAMK,MAAM,GAAGnB,UAAU,CAACkB,GAAG,CAACJ,QAAQ,CAAC;QACvC,IAAI,CAACK,MAAM,EACT,MAAM,IAAIC,KAAK,QAAAC,MAAA,CAAQP,QAAQ,0CAAS,CAAC;QAC3CD,QAAQ,GAAG,IAAId,mBAAmB,CAACoB,MAAM,CAAC;QAC1C,IAAI,CAACd,WAAW,CAACiB,GAAG,CAACR,QAAQ,EAAED,QAAQ,CAAC;MAC1C;MACA,IAAMU,MAAM,IAAAX,SAAA,GAAGC,QAAQ,cAAAD,SAAA,uBAARA,SAAA,CAAUY,KAAK,CAAC;QAAET,KAAK,EAALA,KAAK;QAAEC,SAAS,EAATA;MAAU,CAAC,CAAC;MACpD,OAAAS,aAAA,CAAAA,aAAA,KAAYd,IAAI,GAAKY,MAAM;IAC7B;EAAC;EAAA,OAAAtB,IAAA;AAAA;AAGH,eAAeA,IAAI"}
1
+ {"version":3,"names":["BuildingSplit","BuildingSplitManage","hybridList","Tool","constructor","app","_defineProperty","buildingMap","Map","buildingSplit","json","_building","building","entityId","floor","animation","has","get","entity","Error","set","result","split","_objectSpread"],"sources":["../../../src/module/tool/index.ts"],"sourcesContent":["import { BuildingSplit as BuildingSplitManage } from '@anov/3d-ability'\nimport type Anov3D from '../..'\nimport type { BaseModule } from '../../utils/abstract'\nimport { hybridList } from '../entity'\n\ntype ResourceParams = {\n url: string\n}\n\ntype LanelineControl = {\n index: number\n direction?: number\n}\n\nexport type CreateTransParams = {\n path: string\n width?: number\n divide?: number\n resource: ResourceParams[]\n baseTime?: number\n totalNum?: number\n control?: LanelineControl[]\n}\n\nclass Tool implements BaseModule {\n app: Anov3D\n buildingMap: Map<string, BuildingSplitManage>\n\n constructor(app: Anov3D) {\n this.app = app\n this.buildingMap = new Map()\n }\n\n // 楼层拆分\n buildingSplit(json) {\n let building: BuildingSplitManage = null\n const { entityId, floor, animation } = json\n\n if (this.buildingMap.has(entityId)) {\n building = this.buildingMap.get(entityId)\n }\n else {\n const entity = hybridList.get(entityId)\n if (!entity)\n throw new Error(`id: ${entityId} 找不到该模型`)\n building = new BuildingSplitManage(entity)\n this.buildingMap.set(entityId, building)\n }\n const result = building?.split({ floor, animation })\n return { ...json, ...result }\n }\n}\n\nexport default Tool"],"mappings":";;;;;AAAA,SAASA,aAAa,IAAIC,mBAAmB,QAAQ,kBAAkB;AAGvE,SAASC,UAAU;AAqBnB,MAAMC,IAAI,CAAuB;EAI/BC,WAAWA,CAACC,GAAW,EAAE;IAAAC,eAAA;IAAAA,eAAA;IACvB,IAAI,CAACD,GAAG,GAAGA,GAAG;IACd,IAAI,CAACE,WAAW,GAAG,IAAIC,GAAG,CAAC,CAAC;EAC9B;;EAEA;EACAC,aAAaA,CAACC,IAAI,EAAE;IAAA,IAAAC,SAAA;IAClB,IAAIC,QAA6B,GAAG,IAAI;IACxC,MAAM;MAAEC,QAAQ;MAAEC,KAAK;MAAEC;IAAU,CAAC,GAAGL,IAAI;IAE3C,IAAI,IAAI,CAACH,WAAW,CAACS,GAAG,CAACH,QAAQ,CAAC,EAAE;MAClCD,QAAQ,GAAG,IAAI,CAACL,WAAW,CAACU,GAAG,CAACJ,QAAQ,CAAC;IAC3C,CAAC,MACI;MACH,MAAMK,MAAM,GAAGhB,UAAU,CAACe,GAAG,CAACJ,QAAQ,CAAC;MACvC,IAAI,CAACK,MAAM,EACT,MAAM,IAAIC,KAAK,CAAE,OAAMN,QAAS,SAAQ,CAAC;MAC3CD,QAAQ,GAAG,IAAIX,mBAAmB,CAACiB,MAAM,CAAC;MAC1C,IAAI,CAACX,WAAW,CAACa,GAAG,CAACP,QAAQ,EAAED,QAAQ,CAAC;IAC1C;IACA,MAAMS,MAAM,IAAAV,SAAA,GAAGC,QAAQ,cAAAD,SAAA,uBAARA,SAAA,CAAUW,KAAK,CAAC;MAAER,KAAK;MAAEC;IAAU,CAAC,CAAC;IACpD,OAAAQ,aAAA,CAAAA,aAAA,KAAYb,IAAI,GAAKW,MAAM;EAC7B;AACF;AAEA,eAAelB,IAAI"}
package/dist/sdkEntry.js CHANGED
@@ -1,17 +1,4 @@
1
- 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); }
2
1
  var _dec, _class;
3
- 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); } }
4
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
5
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
- 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); }
7
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
8
- 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); }
9
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
10
- 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); }; }
11
- 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); }
12
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
13
- 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; } }
14
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
15
2
  import Environment from "./module/environment";
16
3
  import Camera from "./module/camera";
17
4
  import { Scene } from "./module/scene";
@@ -22,7 +9,7 @@ import Entity from "./module/entity";
22
9
  import AnimationManage from "./module/animation";
23
10
  import MaterialManage from "./module/material";
24
11
  import Tool from "./module/tool";
25
- var App = (_dec = provide([{
12
+ let App = (_dec = provide([{
26
13
  name: 'camera',
27
14
  module: Camera
28
15
  }, {
@@ -46,14 +33,6 @@ var App = (_dec = provide([{
46
33
  }, {
47
34
  name: 'material',
48
35
  module: MaterialManage
49
- }]), _dec(_class = /*#__PURE__*/function (_Anov3DCore) {
50
- _inherits(App, _Anov3DCore);
51
- var _super = _createSuper(App);
52
- function App() {
53
- _classCallCheck(this, App);
54
- return _super.apply(this, arguments);
55
- }
56
- return _createClass(App);
57
- }(Anov3DCore)) || _class);
36
+ }]), _dec(_class = class App extends Anov3DCore {}) || _class);
58
37
  export default App;
59
38
  //# sourceMappingURL=sdkEntry.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Environment","Camera","Scene","provide","Anov3DCore","Develop","Entity","AnimationManage","MaterialManage","Tool","App","_dec","name","module","_class","_Anov3DCore","_inherits","_super","_createSuper","_classCallCheck","apply","arguments","_createClass"],"sources":["../src/sdkEntry.ts"],"sourcesContent":["import Environment from './module/environment'\nimport Camera from './module/camera'\nimport { Scene } from './module/scene'\nimport { provide } from './utils/abstract'\nimport Anov3DCore from './anov3d'\nimport Develop from './module/develop'\nimport Entity from './module/entity'\nimport AnimationManage from './module/animation'\nimport MaterialManage from './module/material'\nimport Tool from './module/tool'\n\nexport type Override<P, S> = Omit<P, keyof S> & S\n\n@provide(\n [\n {\n name: 'camera',\n module: Camera,\n },\n {\n name: 'tool',\n module: Tool,\n },\n {\n name: 'environment',\n module: Environment,\n },\n {\n name: 'scene',\n module: Scene,\n },\n {\n name: 'develop',\n module: Develop,\n },\n {\n name: 'entity',\n module: Entity,\n },\n {\n name: 'animation',\n module: AnimationManage,\n },\n {\n name: 'material',\n module: MaterialManage,\n },\n ],\n)\nclass App extends Anov3DCore {}\n\nexport default App\n"],"mappings":";;;;;;;;;;;;;;AAAA,OAAOA,WAAW;AAClB,OAAOC,MAAM;AACb,SAASC,KAAK;AACd,SAASC,OAAO;AAChB,OAAOC,UAAU;AACjB,OAAOC,OAAO;AACd,OAAOC,MAAM;AACb,OAAOC,eAAe;AACtB,OAAOC,cAAc;AACrB,OAAOC,IAAI;AAAqB,IAwC1BC,GAAG,IAAAC,IAAA,GApCRR,OAAO,CACN,CACE;EACES,IAAI,EAAE,QAAQ;EACdC,MAAM,EAAEZ;AACV,CAAC,EACD;EACEW,IAAI,EAAE,MAAM;EACZC,MAAM,EAAEJ;AACV,CAAC,EACD;EACEG,IAAI,EAAE,aAAa;EACnBC,MAAM,EAAEb;AACV,CAAC,EACD;EACEY,IAAI,EAAE,OAAO;EACbC,MAAM,EAAEX;AACV,CAAC,EACD;EACEU,IAAI,EAAE,SAAS;EACfC,MAAM,EAAER;AACV,CAAC,EACD;EACEO,IAAI,EAAE,QAAQ;EACdC,MAAM,EAAEP;AACV,CAAC,EACD;EACEM,IAAI,EAAE,WAAW;EACjBC,MAAM,EAAEN;AACV,CAAC,EACD;EACEK,IAAI,EAAE,UAAU;EAChBC,MAAM,EAAEL;AACV,CAAC,CAEL,CAAC,EAAAG,IAAA,CAAAG,MAAA,0BAAAC,WAAA;EAAAC,SAAA,CAAAN,GAAA,EAAAK,WAAA;EAAA,IAAAE,MAAA,GAAAC,YAAA,CAAAR,GAAA;EAAA,SAAAA,IAAA;IAAAS,eAAA,OAAAT,GAAA;IAAA,OAAAO,MAAA,CAAAG,KAAA,OAAAC,SAAA;EAAA;EAAA,OAAAC,YAAA,CAAAZ,GAAA;AAAA,EACiBN,UAAU,MAAAU,MAAA;AAE5B,eAAeJ,GAAG"}
1
+ {"version":3,"names":["Environment","Camera","Scene","provide","Anov3DCore","Develop","Entity","AnimationManage","MaterialManage","Tool","App","_dec","name","module","_class"],"sources":["../src/sdkEntry.ts"],"sourcesContent":["import Environment from './module/environment'\nimport Camera from './module/camera'\nimport { Scene } from './module/scene'\nimport { provide } from './utils/abstract'\nimport Anov3DCore from './anov3d'\nimport Develop from './module/develop'\nimport Entity from './module/entity'\nimport AnimationManage from './module/animation'\nimport MaterialManage from './module/material'\nimport Tool from './module/tool'\n\nexport type Override<P, S> = Omit<P, keyof S> & S\n\n@provide(\n [\n {\n name: 'camera',\n module: Camera,\n },\n {\n name: 'tool',\n module: Tool,\n },\n {\n name: 'environment',\n module: Environment,\n },\n {\n name: 'scene',\n module: Scene,\n },\n {\n name: 'develop',\n module: Develop,\n },\n {\n name: 'entity',\n module: Entity,\n },\n {\n name: 'animation',\n module: AnimationManage,\n },\n {\n name: 'material',\n module: MaterialManage,\n },\n ],\n)\nclass App extends Anov3DCore {}\n\nexport default App\n"],"mappings":";AAAA,OAAOA,WAAW;AAClB,OAAOC,MAAM;AACb,SAASC,KAAK;AACd,SAASC,OAAO;AAChB,OAAOC,UAAU;AACjB,OAAOC,OAAO;AACd,OAAOC,MAAM;AACb,OAAOC,eAAe;AACtB,OAAOC,cAAc;AACrB,OAAOC,IAAI;AAAqB,IAwC1BC,GAAG,IAAAC,IAAA,GApCRR,OAAO,CACN,CACE;EACES,IAAI,EAAE,QAAQ;EACdC,MAAM,EAAEZ;AACV,CAAC,EACD;EACEW,IAAI,EAAE,MAAM;EACZC,MAAM,EAAEJ;AACV,CAAC,EACD;EACEG,IAAI,EAAE,aAAa;EACnBC,MAAM,EAAEb;AACV,CAAC,EACD;EACEY,IAAI,EAAE,OAAO;EACbC,MAAM,EAAEX;AACV,CAAC,EACD;EACEU,IAAI,EAAE,SAAS;EACfC,MAAM,EAAER;AACV,CAAC,EACD;EACEO,IAAI,EAAE,QAAQ;EACdC,MAAM,EAAEP;AACV,CAAC,EACD;EACEM,IAAI,EAAE,WAAW;EACjBC,MAAM,EAAEN;AACV,CAAC,EACD;EACEK,IAAI,EAAE,UAAU;EAChBC,MAAM,EAAEL;AACV,CAAC,CAEL,CAAC,EAAAG,IAAA,CAAAG,MAAA,GAnCD,MAoCMJ,GAAG,SAASN,UAAU,CAAC,EAAE,KAAAU,MAAA;AAE/B,eAAeJ,GAAG"}
@@ -1,24 +1,21 @@
1
- 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); }
2
- 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); } }
3
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
4
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
5
1
  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; }
6
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
- 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); }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
3
+ 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); }
8
4
  import { utils } from '@anov/3d-core';
9
- export var provide = function provide(modules) {
10
- return function (targetClass) {
11
- utils.emitter.on('instantiation-completed', function (app) {
12
- modules.forEach(function (module) {
5
+ export const provide = modules => {
6
+ return targetClass => {
7
+ utils.emitter.on('instantiation-completed', app => {
8
+ modules.forEach(module => {
13
9
  // eslint-disable-next-line new-cap
14
10
  targetClass.prototype[module.name] = new module.module(app);
15
11
  });
16
12
  });
17
13
  };
18
14
  };
19
- export var BaseModule = /*#__PURE__*/_createClass(function BaseModule(app) {
20
- _classCallCheck(this, BaseModule);
21
- _defineProperty(this, "app", void 0);
22
- this.app = app;
23
- });
15
+ export class BaseModule {
16
+ constructor(app) {
17
+ _defineProperty(this, "app", void 0);
18
+ this.app = app;
19
+ }
20
+ }
24
21
  //# sourceMappingURL=abstract.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["utils","provide","modules","targetClass","emitter","on","app","forEach","module","prototype","name","BaseModule","_createClass","_classCallCheck","_defineProperty"],"sources":["../../src/utils/abstract.ts"],"sourcesContent":["import { utils } from '@anov/3d-core'\nimport type Anov3D from '../sdkEntry'\n\nexport const provide = (modules: any): any => {\n return (targetClass: any) => {\n utils.emitter.on('instantiation-completed', (app) => {\n modules.forEach((module: any) => {\n // eslint-disable-next-line new-cap\n targetClass.prototype[module.name] = new module.module(app)\n })\n })\n }\n}\n\nexport class BaseModule {\n app: Anov3D\n constructor(app: Anov3D) {\n this.app = app\n }\n}\n"],"mappings":";;;;;;;AAAA,SAASA,KAAK,QAAQ,eAAe;AAGrC,OAAO,IAAMC,OAAO,GAAG,SAAVA,OAAOA,CAAIC,OAAY,EAAU;EAC5C,OAAO,UAACC,WAAgB,EAAK;IAC3BH,KAAK,CAACI,OAAO,CAACC,EAAE,CAAC,yBAAyB,EAAE,UAACC,GAAG,EAAK;MACnDJ,OAAO,CAACK,OAAO,CAAC,UAACC,MAAW,EAAK;QAC/B;QACAL,WAAW,CAACM,SAAS,CAACD,MAAM,CAACE,IAAI,CAAC,GAAG,IAAIF,MAAM,CAACA,MAAM,CAACF,GAAG,CAAC;MAC7D,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC;AACH,CAAC;AAED,WAAaK,UAAU,gBAAAC,YAAA,CAErB,SAAAD,WAAYL,GAAW,EAAE;EAAAO,eAAA,OAAAF,UAAA;EAAAG,eAAA;EACvB,IAAI,CAACR,GAAG,GAAGA,GAAG;AAChB,CAAC"}
1
+ {"version":3,"names":["utils","provide","modules","targetClass","emitter","on","app","forEach","module","prototype","name","BaseModule","constructor","_defineProperty"],"sources":["../../src/utils/abstract.ts"],"sourcesContent":["import { utils } from '@anov/3d-core'\nimport type Anov3D from '../sdkEntry'\n\nexport const provide = (modules: any): any => {\n return (targetClass: any) => {\n utils.emitter.on('instantiation-completed', (app) => {\n modules.forEach((module: any) => {\n // eslint-disable-next-line new-cap\n targetClass.prototype[module.name] = new module.module(app)\n })\n })\n }\n}\n\nexport class BaseModule {\n app: Anov3D\n constructor(app: Anov3D) {\n this.app = app\n }\n}\n"],"mappings":";;;AAAA,SAASA,KAAK,QAAQ,eAAe;AAGrC,OAAO,MAAMC,OAAO,GAAIC,OAAY,IAAU;EAC5C,OAAQC,WAAgB,IAAK;IAC3BH,KAAK,CAACI,OAAO,CAACC,EAAE,CAAC,yBAAyB,EAAGC,GAAG,IAAK;MACnDJ,OAAO,CAACK,OAAO,CAAEC,MAAW,IAAK;QAC/B;QACAL,WAAW,CAACM,SAAS,CAACD,MAAM,CAACE,IAAI,CAAC,GAAG,IAAIF,MAAM,CAACA,MAAM,CAACF,GAAG,CAAC;MAC7D,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC;AACH,CAAC;AAED,OAAO,MAAMK,UAAU,CAAC;EAEtBC,WAAWA,CAACN,GAAW,EAAE;IAAAO,eAAA;IACvB,IAAI,CAACP,GAAG,GAAGA,GAAG;EAChB;AACF"}
@@ -1,4 +1,3 @@
1
- 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); }
2
1
  import { Vector3 } from '@anov/3d-core';
3
2
  import { messageStatus } from "../messageStatus";
4
3
  import { MessageType, sendToMessage } from "./messageFn";
@@ -8,13 +7,13 @@ import { MessageType, sendToMessage } from "./messageFn";
8
7
  * @param obj
9
8
  * @param key
10
9
  */
11
- export var getValueByKey = function getValueByKey(obj, key) {
10
+ export const getValueByKey = (obj, key) => {
12
11
  if (!key) return undefined;
13
- var keys = key.split('.');
14
- var middleObj = obj;
15
- for (var index = 0; index < keys.length; index++) {
16
- var currentKey = keys[index];
17
- if (_typeof(middleObj) === 'object') {
12
+ const keys = key.split('.');
13
+ let middleObj = obj;
14
+ for (let index = 0; index < keys.length; index++) {
15
+ const currentKey = keys[index];
16
+ if (typeof middleObj === 'object') {
18
17
  if (!(currentKey in middleObj)) return undefined;else middleObj = middleObj[currentKey];
19
18
  } else {
20
19
  return undefined;
@@ -28,20 +27,20 @@ export var getValueByKey = function getValueByKey(obj, key) {
28
27
  * @param iEngine
29
28
  * @param fnkey
30
29
  */
31
- export var getFnByFnkey = function getFnByFnkey(iEngine, fnkey, id) {
32
- var handleFunction = getValueByKey(iEngine, fnkey);
30
+ export const getFnByFnkey = (iEngine, fnkey, id) => {
31
+ const handleFunction = getValueByKey(iEngine, fnkey);
33
32
  if (typeof handleFunction !== 'function') {
34
33
  sendToMessage({
35
34
  messageType: MessageType.Api,
36
35
  messageName: fnkey,
37
36
  status: messageStatus.ModuleNotRegister.code
38
37
  }, {
39
- id: id
38
+ id
40
39
  });
41
40
  throw new Error('this function is not exist');
42
41
  }
43
- var fnkeyArrary = fnkey.split('.');
44
- var context = iEngine;
42
+ const fnkeyArrary = fnkey.split('.');
43
+ let context = iEngine;
45
44
  if (fnkeyArrary.length > 1) context = getValueByKey(iEngine, fnkeyArrary.slice(0, fnkeyArrary.length - 1).join('.'));
46
45
  return handleFunction.bind(context);
47
46
  };
@@ -51,19 +50,19 @@ export var getFnByFnkey = function getFnByFnkey(iEngine, fnkey, id) {
51
50
  * @param scene
52
51
  * @returns
53
52
  */
54
- export var getSceneInfo = function getSceneInfo(scene) {
55
- var objects = 0;
56
- var vertices = 0;
57
- var triangles = 0;
58
- for (var i = 0, l = scene.children.length; i < l; i++) {
59
- var object = scene.children[i];
60
- object.traverseVisible(function (object) {
53
+ export const getSceneInfo = scene => {
54
+ let objects = 0;
55
+ let vertices = 0;
56
+ let triangles = 0;
57
+ for (let i = 0, l = scene.children.length; i < l; i++) {
58
+ const object = scene.children[i];
59
+ object.traverseVisible(object => {
61
60
  objects++;
62
61
 
63
62
  // @ts-ignore
64
63
  if (object.isMesh || object.isPoints) {
65
64
  // @ts-ignore
66
- var geometry = object.geometry;
65
+ const geometry = object.geometry;
67
66
  if (geometry && geometry.attributes.position) {
68
67
  vertices += geometry.attributes.position.count;
69
68
 
@@ -76,12 +75,12 @@ export var getSceneInfo = function getSceneInfo(scene) {
76
75
  });
77
76
  }
78
77
  return {
79
- objects: objects,
80
- vertices: vertices,
81
- triangles: triangles
78
+ objects,
79
+ vertices,
80
+ triangles
82
81
  };
83
82
  };
84
- export var object2Vector3 = function object2Vector3(obj) {
83
+ export const object2Vector3 = obj => {
85
84
  return new Vector3(obj.x, obj.y, obj.z);
86
85
  };
87
86
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Vector3","messageStatus","MessageType","sendToMessage","getValueByKey","obj","key","undefined","keys","split","middleObj","index","length","currentKey","_typeof","getFnByFnkey","iEngine","fnkey","id","handleFunction","messageType","Api","messageName","status","ModuleNotRegister","code","Error","fnkeyArrary","context","slice","join","bind","getSceneInfo","scene","objects","vertices","triangles","i","l","children","object","traverseVisible","isMesh","isPoints","geometry","attributes","position","count","object2Vector3","x","y","z"],"sources":["../../src/utils/index.ts"],"sourcesContent":["import type { Scene } from '@anov/3d-core'\nimport { Vector3 } from '@anov/3d-core'\nimport type Anov3D from '..'\nimport { messageStatus } from '../messageStatus'\nimport { MessageType, sendToMessage } from './messageFn'\n\ninterface ObjectType {\n [key: string]: any\n\n}\n\n/**\n * get value by key\n * notic: to mark proxy, so need take it layer by layer\n * @param obj\n * @param key\n */\nexport const getValueByKey = <T extends ObjectType>(obj: T, key: string) => {\n if (!key)\n return undefined\n\n const keys = key.split('.')\n let middleObj = obj\n\n for (let index = 0; index < keys.length; index++) {\n const currentKey = keys[index]\n\n if (typeof middleObj === 'object') {\n if (!(currentKey in (middleObj)))\n return undefined\n else\n middleObj = middleObj[currentKey]\n }\n else {\n return undefined\n }\n }\n\n return middleObj\n}\n\n/**\n * getFnByFnkey\n * @param iEngine\n * @param fnkey\n */\nexport const getFnByFnkey = (iEngine: Anov3D, fnkey: string, id: string) => {\n const handleFunction = getValueByKey(iEngine, fnkey) as any\n\n if (typeof handleFunction !== 'function') {\n sendToMessage(\n {\n messageType: MessageType.Api,\n messageName: fnkey,\n status: messageStatus.ModuleNotRegister.code,\n },\n {\n id,\n },\n )\n throw new Error('this function is not exist')\n }\n\n const fnkeyArrary = fnkey.split('.')\n\n let context: any = iEngine\n\n if (fnkeyArrary.length > 1)\n context = getValueByKey(iEngine, fnkeyArrary.slice(0, fnkeyArrary.length - 1).join('.'))\n\n return handleFunction.bind(context)\n}\n\n/**\n * get scene object vertice and triangle\n * @param scene\n * @returns\n */\nexport const getSceneInfo = (scene: Scene) => {\n let objects = 0\n let vertices = 0\n let triangles = 0\n\n for (let i = 0, l = scene.children.length; i < l; i++) {\n const object = scene.children[i]\n\n object.traverseVisible((object) => {\n objects++\n\n // @ts-ignore\n if (object.isMesh || object.isPoints) {\n // @ts-ignore\n const geometry = object.geometry\n\n if (geometry && geometry.attributes.position) {\n vertices += geometry.attributes.position.count\n\n // @ts-ignore\n if (object.isMesh) {\n if (geometry.index !== null)\n\n triangles += geometry.index.count / 3\n\n else\n\n triangles += geometry.attributes.position.count / 3\n }\n }\n }\n })\n }\n\n return {\n objects,\n vertices,\n triangles,\n }\n}\n\nexport const object2Vector3 = (obj: { x: number; y: number; z: number }) => {\n return new Vector3(obj.x, obj.y, obj.z)\n}\n"],"mappings":"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"}
1
+ {"version":3,"names":["Vector3","messageStatus","MessageType","sendToMessage","getValueByKey","obj","key","undefined","keys","split","middleObj","index","length","currentKey","getFnByFnkey","iEngine","fnkey","id","handleFunction","messageType","Api","messageName","status","ModuleNotRegister","code","Error","fnkeyArrary","context","slice","join","bind","getSceneInfo","scene","objects","vertices","triangles","i","l","children","object","traverseVisible","isMesh","isPoints","geometry","attributes","position","count","object2Vector3","x","y","z"],"sources":["../../src/utils/index.ts"],"sourcesContent":["import type { Scene } from '@anov/3d-core'\nimport { Vector3 } from '@anov/3d-core'\nimport type Anov3D from '..'\nimport { messageStatus } from '../messageStatus'\nimport { MessageType, sendToMessage } from './messageFn'\n\ninterface ObjectType {\n [key: string]: any\n\n}\n\n/**\n * get value by key\n * notic: to mark proxy, so need take it layer by layer\n * @param obj\n * @param key\n */\nexport const getValueByKey = <T extends ObjectType>(obj: T, key: string) => {\n if (!key)\n return undefined\n\n const keys = key.split('.')\n let middleObj = obj\n\n for (let index = 0; index < keys.length; index++) {\n const currentKey = keys[index]\n\n if (typeof middleObj === 'object') {\n if (!(currentKey in (middleObj)))\n return undefined\n else\n middleObj = middleObj[currentKey]\n }\n else {\n return undefined\n }\n }\n\n return middleObj\n}\n\n/**\n * getFnByFnkey\n * @param iEngine\n * @param fnkey\n */\nexport const getFnByFnkey = (iEngine: Anov3D, fnkey: string, id: string) => {\n const handleFunction = getValueByKey(iEngine, fnkey) as any\n\n if (typeof handleFunction !== 'function') {\n sendToMessage(\n {\n messageType: MessageType.Api,\n messageName: fnkey,\n status: messageStatus.ModuleNotRegister.code,\n },\n {\n id,\n },\n )\n throw new Error('this function is not exist')\n }\n\n const fnkeyArrary = fnkey.split('.')\n\n let context: any = iEngine\n\n if (fnkeyArrary.length > 1)\n context = getValueByKey(iEngine, fnkeyArrary.slice(0, fnkeyArrary.length - 1).join('.'))\n\n return handleFunction.bind(context)\n}\n\n/**\n * get scene object vertice and triangle\n * @param scene\n * @returns\n */\nexport const getSceneInfo = (scene: Scene) => {\n let objects = 0\n let vertices = 0\n let triangles = 0\n\n for (let i = 0, l = scene.children.length; i < l; i++) {\n const object = scene.children[i]\n\n object.traverseVisible((object) => {\n objects++\n\n // @ts-ignore\n if (object.isMesh || object.isPoints) {\n // @ts-ignore\n const geometry = object.geometry\n\n if (geometry && geometry.attributes.position) {\n vertices += geometry.attributes.position.count\n\n // @ts-ignore\n if (object.isMesh) {\n if (geometry.index !== null)\n\n triangles += geometry.index.count / 3\n\n else\n\n triangles += geometry.attributes.position.count / 3\n }\n }\n }\n })\n }\n\n return {\n objects,\n vertices,\n triangles,\n }\n}\n\nexport const object2Vector3 = (obj: { x: number; y: number; z: number }) => {\n return new Vector3(obj.x, obj.y, obj.z)\n}\n"],"mappings":"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"}
@@ -1,18 +1,17 @@
1
- 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); }
2
1
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
2
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
3
  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; }
5
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
- 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); }
4
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
5
+ 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); }
7
6
  import { v4 as uuidv4 } from 'uuid';
8
7
  import { utils } from '@anov/3d-core';
9
8
  import { EMessageStatus, codeMessageMap } from "../messageStatus";
10
- export var MessageType = /*#__PURE__*/function (MessageType) {
9
+ export let MessageType = /*#__PURE__*/function (MessageType) {
11
10
  MessageType[MessageType["Event"] = 0] = "Event";
12
11
  MessageType[MessageType["Api"] = 1] = "Api";
13
12
  return MessageType;
14
13
  }({});
15
- var getResponseMsg = function getResponseMsg(status) {
14
+ const getResponseMsg = status => {
16
15
  var _codeMessageMap$statu;
17
16
  // @ts-ignore
18
17
  return (_codeMessageMap$statu = codeMessageMap[status]) !== null && _codeMessageMap$statu !== void 0 ? _codeMessageMap$statu : '未知错误';
@@ -25,18 +24,18 @@ var getResponseMsg = function getResponseMsg(status) {
25
24
  * @param res
26
25
  * @returns
27
26
  */
28
- export var sendToMessage = function sendToMessage(messageBody, res) {
27
+ export const sendToMessage = (messageBody, res) => {
29
28
  var _res$failMessage, _ref;
30
- var messageType = messageBody.messageType,
31
- messageName = messageBody.messageName,
32
- _messageBody$status = messageBody.status,
33
- status = _messageBody$status === void 0 ? EMessageStatus.Success : _messageBody$status,
34
- id = messageBody.id,
35
- _messageBody$global = messageBody.global,
36
- global = _messageBody$global === void 0 ? true : _messageBody$global;
37
- var uid = uuidv4();
38
- var responseMsg = getResponseMsg(status);
39
- var response = {
29
+ const {
30
+ messageType,
31
+ messageName,
32
+ status = EMessageStatus.Success,
33
+ id,
34
+ global = true
35
+ } = messageBody;
36
+ const uid = uuidv4();
37
+ const responseMsg = getResponseMsg(status);
38
+ const response = {
40
39
  id: id !== null && id !== void 0 ? id : uid,
41
40
  name: messageName,
42
41
  code: status,
@@ -45,8 +44,8 @@ export var sendToMessage = function sendToMessage(messageBody, res) {
45
44
  result: _objectSpread({}, (_ref = res) !== null && _ref !== void 0 ? _ref : {})
46
45
  };
47
46
  if (messageType === MessageType.Api) utils.emitter.emit('message', response);else if (messageType === MessageType.Event) utils.emitter.emit('event', _objectSpread(_objectSpread({}, response), {}, {
48
- name: "".concat(response.name),
49
- global: global
47
+ name: `${response.name}`,
48
+ global
50
49
  }));
51
50
  };
52
51
  //# sourceMappingURL=messageFn.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["v4","uuidv4","utils","EMessageStatus","codeMessageMap","MessageType","getResponseMsg","status","_codeMessageMap$statu","sendToMessage","messageBody","res","_res$failMessage","_ref","messageType","messageName","_messageBody$status","Success","id","_messageBody$global","global","uid","responseMsg","response","name","code","msg","failMessage","result","_objectSpread","Api","emitter","emit","Event","concat"],"sources":["../../src/utils/messageFn.ts"],"sourcesContent":["import { v4 as uuidv4 } from 'uuid'\nimport { utils } from '@anov/3d-core'\nimport { EMessageStatus, codeMessageMap } from '../messageStatus'\n\nexport enum MessageType {\n Event,\n Api,\n}\n\ntype MessageDataType = {\n messageType: MessageType\n messageName: string\n status?: number\n id?: string\n global?: boolean // is global event, default is true, only for event\n}\n\nconst getResponseMsg = (status: number) => {\n // @ts-ignore\n return codeMessageMap[status] ?? '未知错误'\n}\n\n/**\n * sendToMessage\n * @param messageName\n * @param status\n * @param res\n * @returns\n */\nexport const sendToMessage = (messageBody: MessageDataType, res?: unknown) => {\n const { messageType, messageName, status = EMessageStatus.Success, id, global = true } = messageBody\n\n const uid = uuidv4()\n const responseMsg = getResponseMsg(status)\n\n const response = {\n id: id ?? uid,\n name: messageName,\n code: status,\n // @ts-ignore\n msg: res?.failMessage ?? responseMsg,\n result: {\n ...(res as any ?? {}),\n },\n }\n\n if (messageType === MessageType.Api)\n utils.emitter.emit('message', response)\n else if (messageType === MessageType.Event)\n utils.emitter.emit('event', { ...response, name: `${response.name}`, global })\n}"],"mappings":";;;;;;AAAA,SAASA,EAAE,IAAIC,MAAM,QAAQ,MAAM;AACnC,SAASC,KAAK,QAAQ,eAAe;AACrC,SAASC,cAAc,EAAEC,cAAc;AAEvC,WAAYC,WAAW,0BAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AAavB,IAAMC,cAAc,GAAG,SAAjBA,cAAcA,CAAIC,MAAc,EAAK;EAAA,IAAAC,qBAAA;EACzC;EACA,QAAAA,qBAAA,GAAOJ,cAAc,CAACG,MAAM,CAAC,cAAAC,qBAAA,cAAAA,qBAAA,GAAI,MAAM;AACzC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMC,aAAa,GAAG,SAAhBA,aAAaA,CAAIC,WAA4B,EAAEC,GAAa,EAAK;EAAA,IAAAC,gBAAA,EAAAC,IAAA;EAC5E,IAAQC,WAAW,GAAsEJ,WAAW,CAA5FI,WAAW;IAAEC,WAAW,GAAyDL,WAAW,CAA/EK,WAAW;IAAAC,mBAAA,GAAyDN,WAAW,CAAlEH,MAAM;IAANA,MAAM,GAAAS,mBAAA,cAAGb,cAAc,CAACc,OAAO,GAAAD,mBAAA;IAAEE,EAAE,GAAoBR,WAAW,CAAjCQ,EAAE;IAAAC,mBAAA,GAAoBT,WAAW,CAA7BU,MAAM;IAANA,MAAM,GAAAD,mBAAA,cAAG,IAAI,GAAAA,mBAAA;EAEpF,IAAME,GAAG,GAAGpB,MAAM,CAAC,CAAC;EACpB,IAAMqB,WAAW,GAAGhB,cAAc,CAACC,MAAM,CAAC;EAE1C,IAAMgB,QAAQ,GAAG;IACfL,EAAE,EAAEA,EAAE,aAAFA,EAAE,cAAFA,EAAE,GAAIG,GAAG;IACbG,IAAI,EAAET,WAAW;IACjBU,IAAI,EAAElB,MAAM;IACZ;IACAmB,GAAG,GAAAd,gBAAA,GAAED,GAAG,aAAHA,GAAG,uBAAHA,GAAG,CAAEgB,WAAW,cAAAf,gBAAA,cAAAA,gBAAA,GAAIU,WAAW;IACpCM,MAAM,EAAAC,aAAA,MAAAhB,IAAA,GACAF,GAAG,cAAAE,IAAA,cAAAA,IAAA,GAAW,CAAC,CAAC;EAExB,CAAC;EAED,IAAIC,WAAW,KAAKT,WAAW,CAACyB,GAAG,EACjC5B,KAAK,CAAC6B,OAAO,CAACC,IAAI,CAAC,SAAS,EAAET,QAAQ,CAAC,MACpC,IAAIT,WAAW,KAAKT,WAAW,CAAC4B,KAAK,EACxC/B,KAAK,CAAC6B,OAAO,CAACC,IAAI,CAAC,OAAO,EAAAH,aAAA,CAAAA,aAAA,KAAON,QAAQ;IAAEC,IAAI,KAAAU,MAAA,CAAKX,QAAQ,CAACC,IAAI,CAAE;IAAEJ,MAAM,EAANA;EAAM,EAAE,CAAC;AAClF,CAAC"}
1
+ {"version":3,"names":["v4","uuidv4","utils","EMessageStatus","codeMessageMap","MessageType","getResponseMsg","status","_codeMessageMap$statu","sendToMessage","messageBody","res","_res$failMessage","_ref","messageType","messageName","Success","id","global","uid","responseMsg","response","name","code","msg","failMessage","result","_objectSpread","Api","emitter","emit","Event"],"sources":["../../src/utils/messageFn.ts"],"sourcesContent":["import { v4 as uuidv4 } from 'uuid'\nimport { utils } from '@anov/3d-core'\nimport { EMessageStatus, codeMessageMap } from '../messageStatus'\n\nexport enum MessageType {\n Event,\n Api,\n}\n\ntype MessageDataType = {\n messageType: MessageType\n messageName: string\n status?: number\n id?: string\n global?: boolean // is global event, default is true, only for event\n}\n\nconst getResponseMsg = (status: number) => {\n // @ts-ignore\n return codeMessageMap[status] ?? '未知错误'\n}\n\n/**\n * sendToMessage\n * @param messageName\n * @param status\n * @param res\n * @returns\n */\nexport const sendToMessage = (messageBody: MessageDataType, res?: unknown) => {\n const { messageType, messageName, status = EMessageStatus.Success, id, global = true } = messageBody\n\n const uid = uuidv4()\n const responseMsg = getResponseMsg(status)\n\n const response = {\n id: id ?? uid,\n name: messageName,\n code: status,\n // @ts-ignore\n msg: res?.failMessage ?? responseMsg,\n result: {\n ...(res as any ?? {}),\n },\n }\n\n if (messageType === MessageType.Api)\n utils.emitter.emit('message', response)\n else if (messageType === MessageType.Event)\n utils.emitter.emit('event', { ...response, name: `${response.name}`, global })\n}"],"mappings":";;;;;AAAA,SAASA,EAAE,IAAIC,MAAM,QAAQ,MAAM;AACnC,SAASC,KAAK,QAAQ,eAAe;AACrC,SAASC,cAAc,EAAEC,cAAc;AAEvC,WAAYC,WAAW,0BAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AAavB,MAAMC,cAAc,GAAIC,MAAc,IAAK;EAAA,IAAAC,qBAAA;EACzC;EACA,QAAAA,qBAAA,GAAOJ,cAAc,CAACG,MAAM,CAAC,cAAAC,qBAAA,cAAAA,qBAAA,GAAI,MAAM;AACzC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,aAAa,GAAGA,CAACC,WAA4B,EAAEC,GAAa,KAAK;EAAA,IAAAC,gBAAA,EAAAC,IAAA;EAC5E,MAAM;IAAEC,WAAW;IAAEC,WAAW;IAAER,MAAM,GAAGJ,cAAc,CAACa,OAAO;IAAEC,EAAE;IAAEC,MAAM,GAAG;EAAK,CAAC,GAAGR,WAAW;EAEpG,MAAMS,GAAG,GAAGlB,MAAM,CAAC,CAAC;EACpB,MAAMmB,WAAW,GAAGd,cAAc,CAACC,MAAM,CAAC;EAE1C,MAAMc,QAAQ,GAAG;IACfJ,EAAE,EAAEA,EAAE,aAAFA,EAAE,cAAFA,EAAE,GAAIE,GAAG;IACbG,IAAI,EAAEP,WAAW;IACjBQ,IAAI,EAAEhB,MAAM;IACZ;IACAiB,GAAG,GAAAZ,gBAAA,GAAED,GAAG,aAAHA,GAAG,uBAAHA,GAAG,CAAEc,WAAW,cAAAb,gBAAA,cAAAA,gBAAA,GAAIQ,WAAW;IACpCM,MAAM,EAAAC,aAAA,MAAAd,IAAA,GACAF,GAAG,cAAAE,IAAA,cAAAA,IAAA,GAAW,CAAC,CAAC;EAExB,CAAC;EAED,IAAIC,WAAW,KAAKT,WAAW,CAACuB,GAAG,EACjC1B,KAAK,CAAC2B,OAAO,CAACC,IAAI,CAAC,SAAS,EAAET,QAAQ,CAAC,MACpC,IAAIP,WAAW,KAAKT,WAAW,CAAC0B,KAAK,EACxC7B,KAAK,CAAC2B,OAAO,CAACC,IAAI,CAAC,OAAO,EAAAH,aAAA,CAAAA,aAAA,KAAON,QAAQ;IAAEC,IAAI,EAAG,GAAED,QAAQ,CAACC,IAAK,EAAC;IAAEJ;EAAM,EAAE,CAAC;AAClF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anov/3d",
3
- "version": "0.0.287",
3
+ "version": "0.0.289",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "MIT",
@@ -29,8 +29,8 @@
29
29
  "rxjs": "7.8.1",
30
30
  "three-mesh-bvh": "^0.9.0",
31
31
  "uuid": "^9.0.1",
32
- "@anov/3d-ability": "^0.0.140",
33
- "@anov/3d-core": "^0.0.83"
32
+ "@anov/3d-ability": "^0.0.142",
33
+ "@anov/3d-core": "^0.0.84"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/uuid": "^9.0.7",