@zhubangyun/lowcode-core 1.1.6 → 1.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,12 +8,12 @@ export declare class Engine {
8
8
  /**
9
9
  * 注入资产
10
10
  */
11
- injectAssets(types?: DefaultAssertsType[]): Promise<void>;
11
+ injectAssets: (types?: DefaultAssertsType[]) => Promise<void>;
12
12
  /**
13
13
  * 初始化
14
14
  * @param container
15
15
  * @param schema
16
16
  */
17
- init(container: HTMLElement, schema: any): Promise<void>;
18
- openDocument(schema?: any): Promise<void>;
17
+ init: (container: HTMLElement, schema: any) => Promise<void>;
18
+ openDocument: (schema?: any) => Promise<void>;
19
19
  }
@@ -3,73 +3,58 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
3
3
  import { DesignerAssets } from "../assets";
4
4
  import { assetsParse } from "../assets/assets.parse";
5
5
  import { createFetchHandler } from "@alilc/lowcode-datasource-fetch-handler";
6
- export var Engine = /*#__PURE__*/function () {
7
- function Engine() {
8
- this.project = void 0;
9
- this.assets = void 0;
10
- this._engine = void 0;
11
- // @ts-ignore
12
- this._engine = window.AliLowCodeEngine;
13
- this.project = this._engine.project;
14
- this.assets = new DesignerAssets();
15
- }
16
-
6
+ export var Engine = function Engine() {
7
+ var _this = this;
8
+ this.project = void 0;
9
+ this.assets = void 0;
10
+ this._engine = void 0;
17
11
  /**
18
12
  * 注入资产
19
13
  */
20
- var _proto = Engine.prototype;
21
- _proto.injectAssets =
22
- /*#__PURE__*/
23
- function () {
24
- var _injectAssets = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(types) {
25
- var engine, assetsData, asserts, _yield$assetsParse, components;
14
+ this.injectAssets = /*#__PURE__*/function () {
15
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(types) {
16
+ var assetsData, asserts, _yield$assetsParse, components;
26
17
  return _regeneratorRuntime.wrap(function _callee$(_context) {
27
18
  while (1) switch (_context.prev = _context.next) {
28
19
  case 0:
29
- // @ts-ignore
30
- engine = window.AliLowCodeEngine;
31
- this.assets.addDefaultAssets(types);
32
- assetsData = this.assets.data; // @ts-ignore
33
- _context.next = 5;
34
- return engine.injectAssets(assetsData);
35
- case 5:
20
+ _this.assets.addDefaultAssets(types);
21
+ assetsData = _this.assets.data; // @ts-ignore
22
+ _context.next = 4;
23
+ return _this._engine.injectAssets(assetsData);
24
+ case 4:
36
25
  asserts = _context.sent;
37
- _context.next = 8;
38
- return engine.material.setAssets(asserts);
39
- case 8:
40
- _context.next = 10;
26
+ _context.next = 7;
27
+ return _this._engine.material.setAssets(asserts);
28
+ case 7:
29
+ _context.next = 9;
41
30
  return assetsParse(assetsData);
42
- case 10:
31
+ case 9:
43
32
  _yield$assetsParse = _context.sent;
44
33
  components = _yield$assetsParse.components;
45
34
  // @ts-ignore
46
35
  window.components = components;
47
- case 13:
36
+ case 12:
48
37
  case "end":
49
38
  return _context.stop();
50
39
  }
51
- }, _callee, this);
40
+ }, _callee);
52
41
  }));
53
- function injectAssets(_x) {
54
- return _injectAssets.apply(this, arguments);
55
- }
56
- return injectAssets;
57
- }()
42
+ return function (_x) {
43
+ return _ref.apply(this, arguments);
44
+ };
45
+ }();
58
46
  /**
59
47
  * 初始化
60
48
  * @param container
61
49
  * @param schema
62
50
  */
63
- ;
64
- _proto.init =
65
- /*#__PURE__*/
66
- function () {
67
- var _init = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(container, schema) {
51
+ this.init = /*#__PURE__*/function () {
52
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(container, schema) {
68
53
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
69
54
  while (1) switch (_context2.prev = _context2.next) {
70
55
  case 0:
71
56
  _context2.next = 2;
72
- return this._engine.init(container, {
57
+ return _this._engine.init(container, {
73
58
  designMode: "design",
74
59
  enableCondition: true,
75
60
  enableCanvasLock: true,
@@ -80,37 +65,38 @@ export var Engine = /*#__PURE__*/function () {
80
65
  });
81
66
  case 2:
82
67
  _context2.next = 4;
83
- return this.openDocument(schema);
68
+ return _this.openDocument(schema);
84
69
  case 4:
85
70
  case "end":
86
71
  return _context2.stop();
87
72
  }
88
- }, _callee2, this);
73
+ }, _callee2);
89
74
  }));
90
- function init(_x2, _x3) {
91
- return _init.apply(this, arguments);
92
- }
93
- return init;
75
+ return function (_x2, _x3) {
76
+ return _ref2.apply(this, arguments);
77
+ };
94
78
  }();
95
- _proto.openDocument = /*#__PURE__*/function () {
96
- var _openDocument = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(schema) {
79
+ this.openDocument = /*#__PURE__*/function () {
80
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(schema) {
97
81
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
98
82
  while (1) switch (_context3.prev = _context3.next) {
99
83
  case 0:
100
84
  if (schema === void 0) {
101
85
  schema = {};
102
86
  }
103
- this._engine.project.openDocument(schema);
87
+ _this._engine.project.openDocument(schema);
104
88
  case 2:
105
89
  case "end":
106
90
  return _context3.stop();
107
91
  }
108
- }, _callee3, this);
92
+ }, _callee3);
109
93
  }));
110
- function openDocument(_x4) {
111
- return _openDocument.apply(this, arguments);
112
- }
113
- return openDocument;
94
+ return function (_x4) {
95
+ return _ref3.apply(this, arguments);
96
+ };
114
97
  }();
115
- return Engine;
116
- }();
98
+ // @ts-ignore
99
+ this._engine = window.AliLowCodeEngine;
100
+ this.project = this._engine.project;
101
+ this.assets = new DesignerAssets();
102
+ };
@@ -8,12 +8,12 @@ export declare class Engine {
8
8
  /**
9
9
  * 注入资产
10
10
  */
11
- injectAssets(types?: DefaultAssertsType[]): Promise<void>;
11
+ injectAssets: (types?: DefaultAssertsType[]) => Promise<void>;
12
12
  /**
13
13
  * 初始化
14
14
  * @param container
15
15
  * @param schema
16
16
  */
17
- init(container: HTMLElement, schema: any): Promise<void>;
18
- openDocument(schema?: any): Promise<void>;
17
+ init: (container: HTMLElement, schema: any) => Promise<void>;
18
+ openDocument: (schema?: any) => Promise<void>;
19
19
  }
@@ -8,73 +8,58 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
8
8
  var _assets = require("../assets");
9
9
  var _assets2 = require("../assets/assets.parse");
10
10
  var _lowcodeDatasourceFetchHandler = require("@alilc/lowcode-datasource-fetch-handler");
11
- var Engine = exports.Engine = /*#__PURE__*/function () {
12
- function Engine() {
13
- this.project = void 0;
14
- this.assets = void 0;
15
- this._engine = void 0;
16
- // @ts-ignore
17
- this._engine = window.AliLowCodeEngine;
18
- this.project = this._engine.project;
19
- this.assets = new _assets.DesignerAssets();
20
- }
21
-
11
+ var Engine = exports.Engine = function Engine() {
12
+ var _this = this;
13
+ this.project = void 0;
14
+ this.assets = void 0;
15
+ this._engine = void 0;
22
16
  /**
23
17
  * 注入资产
24
18
  */
25
- var _proto = Engine.prototype;
26
- _proto.injectAssets =
27
- /*#__PURE__*/
28
- function () {
29
- var _injectAssets = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(types) {
30
- var engine, assetsData, asserts, _yield$assetsParse, components;
19
+ this.injectAssets = /*#__PURE__*/function () {
20
+ var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(types) {
21
+ var assetsData, asserts, _yield$assetsParse, components;
31
22
  return _regenerator["default"].wrap(function _callee$(_context) {
32
23
  while (1) switch (_context.prev = _context.next) {
33
24
  case 0:
34
- // @ts-ignore
35
- engine = window.AliLowCodeEngine;
36
- this.assets.addDefaultAssets(types);
37
- assetsData = this.assets.data; // @ts-ignore
38
- _context.next = 5;
39
- return engine.injectAssets(assetsData);
40
- case 5:
25
+ _this.assets.addDefaultAssets(types);
26
+ assetsData = _this.assets.data; // @ts-ignore
27
+ _context.next = 4;
28
+ return _this._engine.injectAssets(assetsData);
29
+ case 4:
41
30
  asserts = _context.sent;
42
- _context.next = 8;
43
- return engine.material.setAssets(asserts);
44
- case 8:
45
- _context.next = 10;
31
+ _context.next = 7;
32
+ return _this._engine.material.setAssets(asserts);
33
+ case 7:
34
+ _context.next = 9;
46
35
  return (0, _assets2.assetsParse)(assetsData);
47
- case 10:
36
+ case 9:
48
37
  _yield$assetsParse = _context.sent;
49
38
  components = _yield$assetsParse.components;
50
39
  // @ts-ignore
51
40
  window.components = components;
52
- case 13:
41
+ case 12:
53
42
  case "end":
54
43
  return _context.stop();
55
44
  }
56
- }, _callee, this);
45
+ }, _callee);
57
46
  }));
58
- function injectAssets(_x) {
59
- return _injectAssets.apply(this, arguments);
60
- }
61
- return injectAssets;
62
- }()
47
+ return function (_x) {
48
+ return _ref.apply(this, arguments);
49
+ };
50
+ }();
63
51
  /**
64
52
  * 初始化
65
53
  * @param container
66
54
  * @param schema
67
55
  */
68
- ;
69
- _proto.init =
70
- /*#__PURE__*/
71
- function () {
72
- var _init = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(container, schema) {
56
+ this.init = /*#__PURE__*/function () {
57
+ var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(container, schema) {
73
58
  return _regenerator["default"].wrap(function _callee2$(_context2) {
74
59
  while (1) switch (_context2.prev = _context2.next) {
75
60
  case 0:
76
61
  _context2.next = 2;
77
- return this._engine.init(container, {
62
+ return _this._engine.init(container, {
78
63
  designMode: "design",
79
64
  enableCondition: true,
80
65
  enableCanvasLock: true,
@@ -85,37 +70,38 @@ var Engine = exports.Engine = /*#__PURE__*/function () {
85
70
  });
86
71
  case 2:
87
72
  _context2.next = 4;
88
- return this.openDocument(schema);
73
+ return _this.openDocument(schema);
89
74
  case 4:
90
75
  case "end":
91
76
  return _context2.stop();
92
77
  }
93
- }, _callee2, this);
78
+ }, _callee2);
94
79
  }));
95
- function init(_x2, _x3) {
96
- return _init.apply(this, arguments);
97
- }
98
- return init;
80
+ return function (_x2, _x3) {
81
+ return _ref2.apply(this, arguments);
82
+ };
99
83
  }();
100
- _proto.openDocument = /*#__PURE__*/function () {
101
- var _openDocument = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(schema) {
84
+ this.openDocument = /*#__PURE__*/function () {
85
+ var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(schema) {
102
86
  return _regenerator["default"].wrap(function _callee3$(_context3) {
103
87
  while (1) switch (_context3.prev = _context3.next) {
104
88
  case 0:
105
89
  if (schema === void 0) {
106
90
  schema = {};
107
91
  }
108
- this._engine.project.openDocument(schema);
92
+ _this._engine.project.openDocument(schema);
109
93
  case 2:
110
94
  case "end":
111
95
  return _context3.stop();
112
96
  }
113
- }, _callee3, this);
97
+ }, _callee3);
114
98
  }));
115
- function openDocument(_x4) {
116
- return _openDocument.apply(this, arguments);
117
- }
118
- return openDocument;
99
+ return function (_x4) {
100
+ return _ref3.apply(this, arguments);
101
+ };
119
102
  }();
120
- return Engine;
121
- }();
103
+ // @ts-ignore
104
+ this._engine = window.AliLowCodeEngine;
105
+ this.project = this._engine.project;
106
+ this.assets = new _assets.DesignerAssets();
107
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhubangyun/lowcode-core",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "description": "低代码核心",
5
5
  "files": [
6
6
  "lib",
@@ -11,11 +11,9 @@
11
11
  "scripts": {
12
12
  "bundle:types": "node bundle-dts.js",
13
13
  "dev": "build-scripts start --config build.dev.json",
14
-
15
14
  "build:npm": "build-scripts build",
16
15
  "build:umd": "build-scripts build --config build.umd.json",
17
-
18
- "publish:npm": "build-scripts build && npm publish",
16
+ "publish:npm": "npm run build:npm && npm publish",
19
17
  "publish:umd": "npm run build:umd && node scripts/publishToCdn.ts"
20
18
  },
21
19
  "dependencies": {