mxdraw 0.1.19 → 0.1.21

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.
@@ -2,7 +2,6 @@
2
2
  /** @module McEdGetPointWorldDrawObject*/
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  var store_1 = require("../store/store");
5
- //let _McEdGetPointWorldDraw: McEdGetPointWorldDrawObjectClass
6
5
  /**
7
6
  * McEdGetPointWorldDrawObject 用于构建一个动态绘制回调对象
8
7
  * @example ```typescript
@@ -12,7 +11,8 @@ var store_1 = require("../store/store");
12
11
  var McEdGetPointWorldDrawObject = /** @class */ (function () {
13
12
  function McEdGetPointWorldDrawObject() {
14
13
  var _this = this;
15
- this._McEdGetPointWorldDraw = new (store_1.default.state.MxFun.getMxJigCmdManager().McEdGetPointWorldDrawObjectClass())();
14
+ var _a;
15
+ this._McEdGetPointWorldDraw = new ((_a = store_1.default.state.MxFun) === null || _a === void 0 ? void 0 : _a.getMxJigCmdManager().McEdGetPointWorldDrawObjectClass())();
16
16
  /** @internal */
17
17
  this._get = function () {
18
18
  return _this._McEdGetPointWorldDraw;
@@ -1,2 +1,3 @@
1
1
  "use strict";
2
+ /** @module McGiWorldDraw*/
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -12,7 +12,8 @@ var _MrxDbgUiPrPoint;
12
12
  */
13
13
  var MrxDbgUiPrPoint = /** @class */ (function () {
14
14
  function MrxDbgUiPrPoint() {
15
- _MrxDbgUiPrPoint = new (store_1.default.state.MxFun.getMxJigCmdManager().getMrxDbgUiPrPointClass())();
15
+ var _a;
16
+ _MrxDbgUiPrPoint = new ((_a = store_1.default.state.MxFun) === null || _a === void 0 ? void 0 : _a.getMxJigCmdManager().getMrxDbgUiPrPointClass())();
16
17
  }
17
18
  /**
18
19
  * 返回关键字列表
@@ -1,4 +1,10 @@
1
1
  "use strict";
2
+ ///////////////////////////////////////////////////////////////////////////////
3
+ //版权所有(C)2002-2022,成都梦想凯德科技有限公司。
4
+ //本软件代码及其文档和相关资料归成都梦想凯德科技有限公司,应用包含本软件的程序必须包括以下版权声明
5
+ //此应用程序与成都梦想凯德科技有限公司成协议。通过使用本软件、其文档或相关材料
6
+ ///////////////////////////////////////////////////////////////////////////////
7
+ /** @module MxDbSVG*/
2
8
  var __extends = (this && this.__extends) || (function () {
3
9
  var extendStatics = function (d, b) {
4
10
  extendStatics = Object.setPrototypeOf ||
@@ -1,4 +1,10 @@
1
1
  "use strict";
2
+ ///////////////////////////////////////////////////////////////////////////////
3
+ //版权所有(C)2002-2022,成都梦想凯德科技有限公司。
4
+ //本软件代码及其文档和相关资料归成都梦想凯德科技有限公司,应用包含本软件的程序必须包括以下版权声明
5
+ //此应用程序与成都梦想凯德科技有限公司成协议。通过使用本软件、其文档或相关材料
6
+ ///////////////////////////////////////////////////////////////////////////////
7
+ /** @module MxDbSVG*/
2
8
  Object.defineProperty(exports, "__esModule", { value: true });
3
9
  var THREE = require("three");
4
10
  var MxDbSVGText = /** @class */ (function () {
@@ -1,9 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var MxFun_1 = require("./MxFun");
4
- // import store from '../store/_index'
5
- // import loadCoreCode from '../loadCoreCode'
6
- // if (!store.state.MxFUn) {
7
- // loadCoreCode()
8
- // }
9
4
  exports.default = new MxFun_1.default();
@@ -1,4 +1,9 @@
1
1
  "use strict";
2
+ ///////////////////////////////////////////////////////////////////////////////
3
+ //版权所有(C)2002-2022,成都梦想凯德科技有限公司。
4
+ //本软件代码及其文档和相关资料归成都梦想凯德科技有限公司,应用包含本软件的程序必须包括以下版权声明
5
+ //此应用程序与成都梦想凯德科技有限公司成协议。通过使用本软件、其文档或相关材料
6
+ ///////////////////////////////////////////////////////////////////////////////
2
7
  Object.defineProperty(exports, "__esModule", { value: true });
3
8
  var three_1 = require("three");
4
9
  var math_1 = require("../../tools/algorithm/math");
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ /** @module Mxassembly */
3
4
  var store_1 = require("../store/store");
4
5
  /**
5
6
  * Mxassembly 模块
@@ -11,7 +12,8 @@ var Mxassembly = /** @class */ (function () {
11
12
  function Mxassembly() {
12
13
  }
13
14
  Mxassembly.prototype.NewMcGeVector3d = function () {
14
- return new store_1.default.state.Mxassembly.McGeVector3d();
15
+ var _a;
16
+ return (_a = new store_1.default.state.Mxassembly) === null || _a === void 0 ? void 0 : _a.McGeVector3d();
15
17
  };
16
18
  return Mxassembly;
17
19
  }());
@@ -38,10 +38,11 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  /** @module loadCoreCode */
40
40
  var dynamicImport_1 = require("../../tools/dynamicImport");
41
- var store_1 = require("../store/store");
41
+ var store_1 = require("../store");
42
42
  var mxfun_es5_js_1 = require("./mxfun.es5.js");
43
43
  var mxcadassembly_es5_js_1 = require("./mxcadassembly_es5.js");
44
44
  function rxInitMxEntity() {
45
+ var _a;
45
46
  /*
46
47
  new MxDbImage().rxInit()
47
48
  new MxDbSVG().rxInit()
@@ -49,8 +50,7 @@ function rxInitMxEntity() {
49
50
  new MxDbLine().rxInit()
50
51
  new MxDbRect().rxInit()
51
52
  */
52
- ;
53
- store_1.default.state.MxFun.initDynamicCreate(dynamicImport_1.dynamicCreateMxObject);
53
+ (_a = store_1.default.state.MxFun) === null || _a === void 0 ? void 0 : _a.initDynamicCreate(dynamicImport_1.dynamicCreateMxObject);
54
54
  }
55
55
  /**
56
56
  * 加载MxDraw库的核心代码 才能使用Mx的其他模块
@@ -6,7 +6,7 @@ var Store = /** @class */ (function () {
6
6
  var self = this;
7
7
  self.actions = {};
8
8
  self.mutations = {};
9
- self.state = {};
9
+ self.state = params.state;
10
10
  self.status = 'resting';
11
11
  // 初始化事件机制
12
12
  self.events = new PubsubClass_1.default();
@@ -20,20 +20,20 @@ var Store = /** @class */ (function () {
20
20
  }
21
21
  // state对象代理
22
22
  /* istanbul ignore next */
23
- self.state = new Proxy(params.state || {}, {
24
- set: function (state, key, value) {
25
- state[key] = value;
26
- console.log("stateChange: ".concat(String(key), ": ").concat(value));
27
- /* istanbul ignore next */
28
- self.events.emit('stateChange', self.state);
29
- /* istanbul ignore next */
30
- if (self.status !== 'mutation') {
31
- console.warn("You should use a mutation to set ".concat(String(key)));
32
- }
33
- self.status = 'resting';
34
- return true;
35
- }
36
- });
23
+ // self.state = new Proxy(params.state, {
24
+ // set: function(state, key, value) {
25
+ // state[key] = value
26
+ // console.log(`stateChange: ${String(key)}: ${value}`)
27
+ // /* istanbul ignore next */
28
+ // self.events.emit('stateChange', self.state)
29
+ // /* istanbul ignore next */
30
+ // if (self.status !== 'mutation') {
31
+ // console.warn(`You should use a mutation to set ${String(key)}`)
32
+ // }
33
+ // self.status = 'resting'
34
+ // return true
35
+ // }
36
+ // })
37
37
  }
38
38
  /**
39
39
  * 调用active方法 触发修改状态前的异步行为
@@ -1,5 +1,5 @@
1
1
  /** @module McEdGetPointWorldDrawObject*/
2
- import { ColorType } from '@/types';
2
+ import { ColorType } from '../MxType/MxType';
3
3
  /**
4
4
  * McEdGetPointWorldDrawObject 用于构建一个动态绘制回调对象
5
5
  * @example ```typescript
@@ -1,7 +1,7 @@
1
1
  /** @module McGiWorldDraw*/
2
- import { ColorType } from '@/types';
3
2
  import McGiWorldDrawType from '../McGiWorldDrawType';
4
3
  import MxDrawObject from '../MxDrawObject';
4
+ import { ColorType } from '../MxType/MxType';
5
5
  /**
6
6
  * McGiWorldDraw 用于构建一个动态绘制回调对象的规范接口
7
7
  * @abstract 是 {@link MxDbEntity.worldDraw }必须实现的抽象回调方法中的回调对象 通过回调对象完成一些动态绘制任务
@@ -1,7 +1,7 @@
1
1
  /** @module MxDbEntity*/
2
- import { ColorType } from '@/types';
3
2
  import McGiWorldDraw from '../McGiWorldDraw';
4
3
  import MxDrawObject from '../MxDrawObject';
4
+ import { ColorType } from '../MxType/MxType';
5
5
  /**
6
6
  * MxDbEntity 用于构建一个自定义对象的抽象类(该类无法实例化 请通过继承的方式对其抽象方法进行实现)
7
7
  * @description MxDbEntity 属于 abstract class(抽象类) 主要用途是通过继承这个类实现一个用于动态绘制的回调对象
@@ -1,9 +1,9 @@
1
1
  /** @module MxDbSVG*/
2
- import { ColorType } from '@/types';
3
2
  import * as THREE from 'three';
4
3
  import McGiWorldDraw from '../McGiWorldDraw';
5
4
  import MxDbEntity from '../MxDbEntity';
6
5
  import MxDbSVGText from '../MxDbSVGText';
6
+ import { ColorType } from '../MxType/MxType';
7
7
  /**
8
8
  * MxDbSVG SVG对象.
9
9
  */
@@ -1,6 +1,6 @@
1
1
  /** @module MxDbSVG*/
2
- import { ColorType } from '@/types';
3
2
  import * as THREE from 'three';
3
+ import { ColorType } from '../MxType/MxType';
4
4
  export default class MxDbSVGText {
5
5
  txtPos: THREE.Vector3;
6
6
  txt: string;
@@ -1,5 +1,5 @@
1
- import { ColorType } from '@/types';
2
1
  import { Vector3, Line, Object3D, Points, Sprite, Mesh, MeshBasicMaterial } from 'three';
2
+ declare type ColorType = number | string | THREE.Color;
3
3
  /**
4
4
  * MxThreeJS 模块
5
5
  * ##### 使用说明:
@@ -166,3 +166,4 @@ export default class MxThreeJS {
166
166
  */
167
167
  loadSVG(url: string, color?: ColorType, callResult?: (threeobj: Object3D, aryMeterial: Array<MeshBasicMaterial>) => void): Promise<THREE.Object3D | null>;
168
168
  }
169
+ export {};
@@ -17,6 +17,7 @@ declare enum MxCloneType2 {
17
17
  /** 动态拖动Clone */
18
18
  kDragClone = 2
19
19
  }
20
+ export declare type ColorType = number | string | THREE.Color;
20
21
  declare const _default: {
21
22
  MxCloneType: typeof MxCloneType;
22
23
  MxCloneType2: typeof MxCloneType2;
@@ -6,12 +6,18 @@ export default class Store<T> {
6
6
  mutations: {
7
7
  [x: string | number]: Function;
8
8
  };
9
- state: {
10
- [x: string | number]: any;
11
- };
9
+ state: T;
12
10
  status: string;
13
11
  events: PubSub;
14
- constructor(params: T | any);
12
+ constructor(params: {
13
+ state: T;
14
+ mutations: {
15
+ [x: string | number]: Function;
16
+ };
17
+ actions: {
18
+ [x: string | number]: Function;
19
+ };
20
+ });
15
21
  /**
16
22
  * 调用active方法 触发修改状态前的异步行为
17
23
  * @param actionKey 方法名称
@@ -1,11 +1,11 @@
1
1
  import { MxFunType } from '../../types/MxFun';
2
2
  import { MxassemblyType } from '../../types/Mxassembly';
3
3
  import Store from './StoreClass';
4
- export declare type stateType = {
4
+ declare type stateType = {
5
5
  [x: string]: any;
6
6
  MxFun: MxFunType | null;
7
7
  Mxassembly: MxassemblyType | null;
8
8
  isCreateDrawObj: boolean;
9
9
  };
10
- declare const _default: Store<unknown>;
10
+ declare const _default: Store<stateType>;
11
11
  export default _default;
@@ -38,7 +38,12 @@ declare const _default: {
38
38
  MxDbAlignedDimension: typeof MxDbAlignedDimension;
39
39
  useCanvasResizeListener: typeof useCanvasResizeListener;
40
40
  loadCoreCode: typeof loadCoreCode;
41
- store: import("./MxModule/store/StoreClass").default<unknown>;
41
+ store: import("./MxModule/store/StoreClass").default<{
42
+ [x: string]: any;
43
+ MxFun: import("./types/MxFun").MxFunType | null;
44
+ Mxassembly: import("./types/Mxassembly").MxassemblyType | null;
45
+ isCreateDrawObj: boolean;
46
+ }>;
42
47
  MrxDbgUiPrBaseReturn: typeof MrxDbgUiPrBaseReturn;
43
48
  McGiWorldDrawType: typeof McGiWorldDrawType;
44
49
  };
@@ -1,6 +1,10 @@
1
1
  import { MxDrawObjectType } from './MxDrawObject';
2
2
  import { MeshLambertMaterial } from 'three';
3
3
  import { MxCADObject } from './MxCADObject';
4
+ interface CmdMangerType {
5
+ McEdGetPointWorldDrawObjectClass(): any;
6
+ getMrxDbgUiPrPointClass(): any;
7
+ }
4
8
  export interface MxFunType {
5
9
  createMxObject(canvasId: string, arg1: string, arg2: (mxDraw: MxDrawObjectType) => void, is2d: boolean | undefined, isNewCreate?: boolean, isStaticLoad?: boolean): void;
6
10
  setMxServer(MXSERVER: string): void;
@@ -38,4 +42,6 @@ export interface MxFunType {
38
42
  initMxDbEntityType(userObject: any): void;
39
43
  initDynamicCreate(dynCreate: any): void;
40
44
  openFile(sFile: string, useWebsocket: boolean): boolean;
45
+ getMxJigCmdManager(): CmdMangerType;
41
46
  }
47
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mxdraw",
3
- "version": "0.1.19",
3
+ "version": "0.1.21",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "main": "dist/mxdraw.umd.js",
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +0,0 @@
1
- export declare type ColorType = number | string | THREE.Color;