@zhubangyun/lowcode-core 5.12.92 → 5.12.161

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 (60) hide show
  1. package/es/components/load-materials/index.js +12 -12
  2. package/es/demo/index.js +8 -8
  3. package/es/utils/api/file-api.js +21 -21
  4. package/es/utils/api/form-api.d.ts +1 -1
  5. package/es/utils/api/form-api.js +35 -35
  6. package/es/utils/api/form-api.utils.js +5 -4
  7. package/es/utils/api/index.d.ts +1 -1
  8. package/es/utils/api/rest-api.js +116 -116
  9. package/es/utils/api/schema-api.js +5 -5
  10. package/es/utils/api/script-api.js +12 -12
  11. package/es/utils/api/user-info.js +7 -7
  12. package/es/utils/cache/index.js +14 -14
  13. package/es/utils/common/LoadPlugins.js +33 -33
  14. package/es/utils/common/SingletonInstanceMap.js +21 -21
  15. package/es/utils/designer/assets/assets.parse.js +15 -15
  16. package/es/utils/designer/assets/assets.typing.js +6 -0
  17. package/es/utils/designer/engine/index.js +23 -23
  18. package/es/utils/designer/index.js +7 -7
  19. package/es/utils/page/index.js +18 -18
  20. package/es/utils/page/page-form-data-manager-group.js +7 -4
  21. package/es/utils/page/page-form-data-manager.js +7 -4
  22. package/es/utils/page/page-form-group.js +6 -5
  23. package/es/utils/page/page-form.js +12 -11
  24. package/es/utils/page/page-layout.d.ts +2 -0
  25. package/es/utils/page/page-layout.js +14 -7
  26. package/es/utils/page/page-render.js +4 -4
  27. package/es/utils/page/page-show.js +3 -3
  28. package/es/utils/page/print-form.js +36 -36
  29. package/lib/components/load-materials/index.js +13 -14
  30. package/lib/demo/index.js +9 -10
  31. package/lib/index.js +1 -2
  32. package/lib/utils/api/file-api.js +21 -21
  33. package/lib/utils/api/form-api.d.ts +1 -1
  34. package/lib/utils/api/form-api.js +35 -35
  35. package/lib/utils/api/form-api.utils.js +5 -4
  36. package/lib/utils/api/index.d.ts +1 -1
  37. package/lib/utils/api/index.js +1 -2
  38. package/lib/utils/api/rest-api.js +116 -116
  39. package/lib/utils/api/schema-api.js +5 -5
  40. package/lib/utils/api/script-api.js +12 -12
  41. package/lib/utils/api/user-info.js +7 -7
  42. package/lib/utils/cache/index.js +14 -14
  43. package/lib/utils/common/LoadPlugins.js +33 -33
  44. package/lib/utils/common/SingletonInstanceMap.js +21 -21
  45. package/lib/utils/designer/assets/assets.parse.js +16 -17
  46. package/lib/utils/designer/assets/assets.typing.js +6 -0
  47. package/lib/utils/designer/engine/index.js +23 -23
  48. package/lib/utils/designer/index.js +7 -7
  49. package/lib/utils/index.js +1 -2
  50. package/lib/utils/page/index.js +18 -18
  51. package/lib/utils/page/page-form-data-manager-group.js +8 -6
  52. package/lib/utils/page/page-form-data-manager.js +8 -6
  53. package/lib/utils/page/page-form-group.js +7 -7
  54. package/lib/utils/page/page-form.js +13 -13
  55. package/lib/utils/page/page-layout.d.ts +2 -0
  56. package/lib/utils/page/page-layout.js +15 -9
  57. package/lib/utils/page/page-render.js +4 -4
  58. package/lib/utils/page/page-show.js +4 -5
  59. package/lib/utils/page/print-form.js +36 -36
  60. package/package.json +1 -1
@@ -5,45 +5,45 @@ exports.__esModule = true;
5
5
  exports.loadPlugins = loadPlugins;
6
6
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
7
7
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
8
- function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
- 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); }
10
- 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; }
8
+ function _createForOfIteratorHelperLoose(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (t) return (t = t.call(r)).next.bind(t); if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var o = 0; return function () { return o >= r.length ? { done: !0 } : { done: !1, value: r[o++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
10
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
11
11
  var doc = document;
12
12
  function loadPlugins(_x) {
13
13
  return _loadPlugins.apply(this, arguments);
14
14
  }
15
15
  function _loadPlugins() {
16
- _loadPlugins = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(plugins) {
16
+ _loadPlugins = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(plugins) {
17
17
  var _iterator, _step, plugin, _iterator2, _step2, _plugin;
18
- return _regenerator["default"].wrap(function _callee$(_context) {
18
+ return _regenerator["default"].wrap(function (_context) {
19
19
  while (1) switch (_context.prev = _context.next) {
20
20
  case 0:
21
21
  _iterator = _createForOfIteratorHelperLoose(plugins);
22
22
  case 1:
23
23
  if ((_step = _iterator()).done) {
24
- _context.next = 7;
24
+ _context.next = 3;
25
25
  break;
26
26
  }
27
27
  plugin = _step.value;
28
- _context.next = 5;
28
+ _context.next = 2;
29
29
  return loadStyle(plugin);
30
- case 5:
30
+ case 2:
31
31
  _context.next = 1;
32
32
  break;
33
- case 7:
33
+ case 3:
34
34
  _iterator2 = _createForOfIteratorHelperLoose(plugins);
35
- case 8:
35
+ case 4:
36
36
  if ((_step2 = _iterator2()).done) {
37
- _context.next = 14;
37
+ _context.next = 6;
38
38
  break;
39
39
  }
40
40
  _plugin = _step2.value;
41
- _context.next = 12;
41
+ _context.next = 5;
42
42
  return loadScript(_plugin);
43
- case 12:
44
- _context.next = 8;
43
+ case 5:
44
+ _context.next = 4;
45
45
  break;
46
- case 14:
46
+ case 6:
47
47
  case "end":
48
48
  return _context.stop();
49
49
  }
@@ -55,20 +55,20 @@ function loadStyle(_x2) {
55
55
  return _loadStyle.apply(this, arguments);
56
56
  }
57
57
  function _loadStyle() {
58
- _loadStyle = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(src) {
59
- return _regenerator["default"].wrap(function _callee3$(_context3) {
58
+ _loadStyle = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3(src) {
59
+ return _regenerator["default"].wrap(function (_context3) {
60
60
  while (1) switch (_context3.prev = _context3.next) {
61
61
  case 0:
62
62
  if (src.endsWith("css")) {
63
- _context3.next = 2;
63
+ _context3.next = 1;
64
64
  break;
65
65
  }
66
66
  return _context3.abrupt("return", true);
67
- case 2:
68
- return _context3.abrupt("return", new Promise( /*#__PURE__*/function () {
69
- var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(resolve) {
67
+ case 1:
68
+ return _context3.abrupt("return", new Promise(/*#__PURE__*/function () {
69
+ var _ref = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(resolve) {
70
70
  var callback, target;
71
- return _regenerator["default"].wrap(function _callee2$(_context2) {
71
+ return _regenerator["default"].wrap(function (_context2) {
72
72
  while (1) switch (_context2.prev = _context2.next) {
73
73
  case 0:
74
74
  callback = function _callback(status) {
@@ -92,7 +92,7 @@ function _loadStyle() {
92
92
  } else {
93
93
  callback(true);
94
94
  }
95
- case 3:
95
+ case 1:
96
96
  case "end":
97
97
  return _context2.stop();
98
98
  }
@@ -102,7 +102,7 @@ function _loadStyle() {
102
102
  return _ref.apply(this, arguments);
103
103
  };
104
104
  }()));
105
- case 3:
105
+ case 2:
106
106
  case "end":
107
107
  return _context3.stop();
108
108
  }
@@ -114,20 +114,20 @@ function loadScript(_x3) {
114
114
  return _loadScript.apply(this, arguments);
115
115
  }
116
116
  function _loadScript() {
117
- _loadScript = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(src) {
118
- return _regenerator["default"].wrap(function _callee5$(_context5) {
117
+ _loadScript = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee5(src) {
118
+ return _regenerator["default"].wrap(function (_context5) {
119
119
  while (1) switch (_context5.prev = _context5.next) {
120
120
  case 0:
121
121
  if (src.endsWith("js")) {
122
- _context5.next = 2;
122
+ _context5.next = 1;
123
123
  break;
124
124
  }
125
125
  return _context5.abrupt("return", true);
126
- case 2:
127
- return _context5.abrupt("return", new Promise( /*#__PURE__*/function () {
128
- var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(resolve, reject) {
126
+ case 1:
127
+ return _context5.abrupt("return", new Promise(/*#__PURE__*/function () {
128
+ var _ref2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee4(resolve, reject) {
129
129
  var callback, target;
130
- return _regenerator["default"].wrap(function _callee4$(_context4) {
130
+ return _regenerator["default"].wrap(function (_context4) {
131
131
  while (1) switch (_context4.prev = _context4.next) {
132
132
  case 0:
133
133
  callback = function _callback2(status) {
@@ -153,7 +153,7 @@ function _loadScript() {
153
153
  } else {
154
154
  callback(true);
155
155
  }
156
- case 3:
156
+ case 1:
157
157
  case "end":
158
158
  return _context4.stop();
159
159
  }
@@ -163,7 +163,7 @@ function _loadScript() {
163
163
  return _ref2.apply(this, arguments);
164
164
  };
165
165
  }()));
166
- case 3:
166
+ case 2:
167
167
  case "end":
168
168
  return _context5.stop();
169
169
  }
@@ -12,25 +12,25 @@ var SingletonInstanceMap = exports.SingletonInstanceMap = /*#__PURE__*/function
12
12
  }
13
13
  var _proto = SingletonInstanceMap.prototype;
14
14
  _proto.getInstance = /*#__PURE__*/function () {
15
- var _getInstance = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(key, options) {
16
- var self, value;
17
- return _regenerator["default"].wrap(function _callee2$(_context2) {
15
+ var _getInstance = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(key, options) {
16
+ var self, value, _t;
17
+ return _regenerator["default"].wrap(function (_context2) {
18
18
  while (1) switch (_context2.prev = _context2.next) {
19
19
  case 0:
20
20
  self = this;
21
21
  if (!this.valueMap.has(key)) {
22
- _context2.next = 5;
22
+ _context2.next = 1;
23
23
  break;
24
24
  }
25
25
  return _context2.abrupt("return", Promise.resolve(this.valueMap.get(key)));
26
- case 5:
26
+ case 1:
27
27
  if (!this.lockMap.get(key)) {
28
- _context2.next = 9;
28
+ _context2.next = 2;
29
29
  break;
30
30
  }
31
31
  return _context2.abrupt("return", new Promise(function (resolve, reject) {
32
- setTimeout( /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
33
- return _regenerator["default"].wrap(function _callee$(_context) {
32
+ setTimeout(/*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
33
+ return _regenerator["default"].wrap(function (_context) {
34
34
  while (1) switch (_context.prev = _context.next) {
35
35
  case 0:
36
36
  resolve(self.getInstance(key, options));
@@ -41,29 +41,29 @@ var SingletonInstanceMap = exports.SingletonInstanceMap = /*#__PURE__*/function
41
41
  }, _callee);
42
42
  })), 500);
43
43
  }));
44
- case 9:
45
- _context2.prev = 9;
44
+ case 2:
45
+ _context2.prev = 2;
46
46
  this.lockMap.set(key, true);
47
- _context2.next = 13;
47
+ _context2.next = 3;
48
48
  return this.createInstance(key, options);
49
- case 13:
49
+ case 3:
50
50
  value = _context2.sent;
51
51
  this.valueMap.set(key, value);
52
52
  this.lockMap.set(key, false);
53
53
  return _context2.abrupt("return", Promise.resolve(value));
54
- case 19:
55
- _context2.prev = 19;
56
- _context2.t0 = _context2["catch"](9);
57
- throw _context2.t0;
58
- case 22:
59
- _context2.prev = 22;
54
+ case 4:
55
+ _context2.prev = 4;
56
+ _t = _context2["catch"](2);
57
+ throw _t;
58
+ case 5:
59
+ _context2.prev = 5;
60
60
  this.lockMap.set(key, false);
61
- return _context2.finish(22);
62
- case 25:
61
+ return _context2.finish(5);
62
+ case 6:
63
63
  case "end":
64
64
  return _context2.stop();
65
65
  }
66
- }, _callee2, this, [[9, 19, 22, 25]]);
66
+ }, _callee2, this, [[2, 4, 5, 6]]);
67
67
  }));
68
68
  function getInstance(_x, _x2) {
69
69
  return _getInstance.apply(this, arguments);
@@ -10,8 +10,7 @@ var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inh
10
10
  var _lowcodeUtils = require("@zhubangyun/lowcode-utils");
11
11
  var _lowcodeRenderCore = _interopRequireDefault(require("@zhubangyun/lowcode-render-core"));
12
12
  var _react = _interopRequireWildcard(require("react"));
13
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
14
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
13
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
15
14
  function genLowcodeComp(schema, components) {
16
15
  return /*#__PURE__*/function (_React$Component) {
17
16
  function LowcodeComp() {
@@ -33,9 +32,9 @@ function assetsParse(_x) {
33
32
  return _assetsParse.apply(this, arguments);
34
33
  }
35
34
  function _assetsParse() {
36
- _assetsParse = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(assets) {
35
+ _assetsParse = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(assets) {
37
36
  var rawComponents, packages, libraryAsset, libraryMap, packagesMap, assetLoader, newComponents, componentDescriptions, remoteComponentDescriptions, lowcodeComponentsArray, proCodeComponentsMap, genLowCodeComponentsMap, components, lowCodeComponents;
38
- return _regenerator["default"].wrap(function _callee2$(_context2) {
37
+ return _regenerator["default"].wrap(function (_context2) {
39
38
  while (1) switch (_context2.prev = _context2.next) {
40
39
  case 0:
41
40
  genLowCodeComponentsMap = function _genLowCodeComponents(components) {
@@ -69,12 +68,12 @@ function _assetsParse() {
69
68
  }
70
69
  });
71
70
  assetLoader = new _lowcodeUtils.AssetLoader();
72
- _context2.next = 9;
71
+ _context2.next = 1;
73
72
  return assetLoader.load(libraryAsset);
74
- case 9:
73
+ case 1:
75
74
  newComponents = rawComponents;
76
75
  if (!(rawComponents && rawComponents.length)) {
77
- _context2.next = 18;
76
+ _context2.next = 2;
78
77
  break;
79
78
  }
80
79
  componentDescriptions = [];
@@ -92,14 +91,14 @@ function _assetsParse() {
92
91
  newComponents = [].concat(componentDescriptions);
93
92
  // 如果有远程组件描述协议,则自动加载并补充到资产包中,同时出发 designer.incrementalAssetsReady 通知组件面板更新数据
94
93
  if (!(remoteComponentDescriptions && remoteComponentDescriptions.length)) {
95
- _context2.next = 18;
94
+ _context2.next = 2;
96
95
  break;
97
96
  }
98
- _context2.next = 18;
99
- return Promise.all(remoteComponentDescriptions.map( /*#__PURE__*/function () {
100
- var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(component) {
97
+ _context2.next = 2;
98
+ return Promise.all(remoteComponentDescriptions.map(/*#__PURE__*/function () {
99
+ var _ref = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(component) {
101
100
  var exportName, url, npm, setAssetsComponent, setArrayAssets;
102
- return _regenerator["default"].wrap(function _callee$(_context) {
101
+ return _regenerator["default"].wrap(function (_context) {
103
102
  while (1) switch (_context.prev = _context.next) {
104
103
  case 0:
105
104
  setArrayAssets = function _setArrayAssets(value, preExportName, preSubName) {
@@ -141,9 +140,9 @@ function _assetsParse() {
141
140
  // assets.componentList = assets.componentList.concat(component.componentList || []);
142
141
  };
143
142
  exportName = component.exportName, url = component.url, npm = component.npm;
144
- _context.next = 5;
143
+ _context.next = 1;
145
144
  return new _lowcodeUtils.AssetLoader().load(url);
146
- case 5:
145
+ case 1:
147
146
  if (window[exportName]) {
148
147
  if (Array.isArray(window[exportName])) {
149
148
  setArrayAssets(window[exportName]);
@@ -152,7 +151,7 @@ function _assetsParse() {
152
151
  }
153
152
  }
154
153
  return _context.abrupt("return", window[exportName]);
155
- case 7:
154
+ case 2:
156
155
  case "end":
157
156
  return _context.stop();
158
157
  }
@@ -162,7 +161,7 @@ function _assetsParse() {
162
161
  return _ref.apply(this, arguments);
163
162
  };
164
163
  }()));
165
- case 18:
164
+ case 2:
166
165
  lowcodeComponentsArray = [];
167
166
  proCodeComponentsMap = newComponents.reduce(function (acc, cur) {
168
167
  if ((cur.devMode || '').toLowerCase() === 'lowcode') {
@@ -181,7 +180,7 @@ function _assetsParse() {
181
180
  return _context2.abrupt("return", {
182
181
  components: (0, _extends2["default"])({}, components, lowCodeComponents)
183
182
  });
184
- case 23:
183
+ case 3:
185
184
  case "end":
186
185
  return _context2.stop();
187
186
  }
@@ -21,7 +21,13 @@ exports.LoadEnv = void 0;
21
21
  * 资源加载环境种类
22
22
  */
23
23
  var LoadEnv = exports.LoadEnv = /*#__PURE__*/function (LoadEnv) {
24
+ /**
25
+ * 设计态
26
+ */
24
27
  LoadEnv["design"] = "design";
28
+ /**
29
+ * 运行态
30
+ */
25
31
  LoadEnv["runtime"] = "runtime";
26
32
  return LoadEnv;
27
33
  }({});
@@ -20,28 +20,28 @@ var Engine = exports.Engine = function Engine() {
20
20
  * 注入资产
21
21
  */
22
22
  this.injectAssets = /*#__PURE__*/function () {
23
- var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(types) {
23
+ var _ref = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(types) {
24
24
  var assetsData, asserts, _yield$assetsParse, components;
25
- return _regenerator["default"].wrap(function _callee$(_context) {
25
+ return _regenerator["default"].wrap(function (_context) {
26
26
  while (1) switch (_context.prev = _context.next) {
27
27
  case 0:
28
28
  _this.assets.addDefaultAssets(types);
29
29
  assetsData = _this.assets.data; // @ts-ignore
30
- _context.next = 4;
30
+ _context.next = 1;
31
31
  return _this._engine.injectAssets(assetsData);
32
- case 4:
32
+ case 1:
33
33
  asserts = _context.sent;
34
- _context.next = 7;
34
+ _context.next = 2;
35
35
  return _this._engine.material.setAssets(asserts);
36
- case 7:
37
- _context.next = 9;
36
+ case 2:
37
+ _context.next = 3;
38
38
  return (0, _assets2.assetsParse)(assetsData);
39
- case 9:
39
+ case 3:
40
40
  _yield$assetsParse = _context.sent;
41
41
  components = _yield$assetsParse.components;
42
42
  // @ts-ignore
43
43
  window.components = components;
44
- case 12:
44
+ case 4:
45
45
  case "end":
46
46
  return _context.stop();
47
47
  }
@@ -52,8 +52,8 @@ var Engine = exports.Engine = function Engine() {
52
52
  };
53
53
  }();
54
54
  this.loadIncrementalAssets = /*#__PURE__*/function () {
55
- var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(incrementalAssets) {
56
- return _regenerator["default"].wrap(function _callee2$(_context2) {
55
+ var _ref2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(incrementalAssets) {
56
+ return _regenerator["default"].wrap(function (_context2) {
57
57
  while (1) switch (_context2.prev = _context2.next) {
58
58
  case 0:
59
59
  return _context2.abrupt("return", _this.material.loadIncrementalAssets(incrementalAssets));
@@ -68,8 +68,8 @@ var Engine = exports.Engine = function Engine() {
68
68
  };
69
69
  }();
70
70
  this.registerPlugin = /*#__PURE__*/function () {
71
- var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(pluginModel, options, registerOptions) {
72
- return _regenerator["default"].wrap(function _callee3$(_context3) {
71
+ var _ref3 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3(pluginModel, options, registerOptions) {
72
+ return _regenerator["default"].wrap(function (_context3) {
73
73
  while (1) switch (_context3.prev = _context3.next) {
74
74
  case 0:
75
75
  return _context3.abrupt("return", _this.plugins.register(pluginModel, options, registerOptions));
@@ -89,11 +89,11 @@ var Engine = exports.Engine = function Engine() {
89
89
  * @param schema
90
90
  */
91
91
  this.init = /*#__PURE__*/function () {
92
- var _ref4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(container, schema) {
93
- return _regenerator["default"].wrap(function _callee4$(_context4) {
92
+ var _ref4 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee4(container, schema) {
93
+ return _regenerator["default"].wrap(function (_context4) {
94
94
  while (1) switch (_context4.prev = _context4.next) {
95
95
  case 0:
96
- _context4.next = 2;
96
+ _context4.next = 1;
97
97
  return _this._engine.init(container, {
98
98
  designMode: "design",
99
99
  enableCondition: true,
@@ -103,14 +103,14 @@ var Engine = exports.Engine = function Engine() {
103
103
  fetch: (0, _lowcodeDatasourceFetchHandler.createFetchHandler)()
104
104
  }
105
105
  });
106
- case 2:
106
+ case 1:
107
107
  if (!schema) {
108
- _context4.next = 5;
108
+ _context4.next = 2;
109
109
  break;
110
110
  }
111
- _context4.next = 5;
111
+ _context4.next = 2;
112
112
  return _this.openDocument(schema);
113
- case 5:
113
+ case 2:
114
114
  case "end":
115
115
  return _context4.stop();
116
116
  }
@@ -121,15 +121,15 @@ var Engine = exports.Engine = function Engine() {
121
121
  };
122
122
  }();
123
123
  this.openDocument = /*#__PURE__*/function () {
124
- var _ref5 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(schema) {
125
- return _regenerator["default"].wrap(function _callee5$(_context5) {
124
+ var _ref5 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee5(schema) {
125
+ return _regenerator["default"].wrap(function (_context5) {
126
126
  while (1) switch (_context5.prev = _context5.next) {
127
127
  case 0:
128
128
  if (schema === void 0) {
129
129
  schema = {};
130
130
  }
131
131
  _this._engine.project.openDocument(schema);
132
- case 2:
132
+ case 1:
133
133
  case "end":
134
134
  return _context5.stop();
135
135
  }
@@ -14,26 +14,26 @@ function initEngine() {
14
14
  return _initEngine.apply(this, arguments);
15
15
  }
16
16
  function _initEngine() {
17
- _initEngine = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
17
+ _initEngine = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
18
18
  var _window$AntdProMateri, _window$AntdProMateri2;
19
- return _regenerator["default"].wrap(function _callee$(_context) {
19
+ return _regenerator["default"].wrap(function (_context) {
20
20
  while (1) switch (_context.prev = _context.next) {
21
21
  case 0:
22
- _context.next = 2;
22
+ _context.next = 1;
23
23
  return (0, _common.loadPlugins)(["next.min.js", "variables.css", "next.var.min.css",
24
24
  /* "react.production.min.js",
25
25
  "react-dom.production.min.js",*/
26
26
  "prop-types.js", "react15-polyfill.js", "lodash.min.js", "moment.min.js", "engine-core.css", "engine-core.js", "engine-ext.js", "engine-ext.css", "index.css", "index.js"].map(function (uri) {
27
27
  return "https://cdn.zhiyunhe.com/lowcode/designer/" + uri;
28
28
  }));
29
- case 2:
30
- _context.next = 4;
29
+ case 1:
30
+ _context.next = 2;
31
31
  return (0, _common.loadPlugins)(["https://cdn.zhiyunhe.com/plugin/dayjs/dayjs.min.js", "https://cdn.zhiyunhe.com/plugin/antd/latest/reset.css", "https://cdn.zhiyunhe.com/plugin/antd/latest/antd.min.js", "https://cdn.zhiyunhe.com/plugin/lowcode/materials/antd-pro/view.css", "https://cdn.zhiyunhe.com/plugin/lowcode/materials/antd-pro/view.js"]);
32
- case 4:
32
+ case 2:
33
33
  //注册setter
34
34
  (_window$AntdProMateri = window.AntdProMaterial) === null || _window$AntdProMateri === void 0 ? void 0 : (_window$AntdProMateri2 = _window$AntdProMateri.registerSetters) === null || _window$AntdProMateri2 === void 0 ? void 0 : _window$AntdProMateri2.call(_window$AntdProMateri);
35
35
  return _context.abrupt("return", new _engine.Engine());
36
- case 6:
36
+ case 3:
37
37
  case "end":
38
38
  return _context.stop();
39
39
  }
@@ -7,8 +7,7 @@ var api = _interopRequireWildcard(require("./api"));
7
7
  var designer = _interopRequireWildcard(require("./designer"));
8
8
  var page = _interopRequireWildcard(require("./page"));
9
9
  var cache = _interopRequireWildcard(require("./cache"));
10
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
11
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
10
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
12
11
  var _default = exports["default"] = {
13
12
  api: api,
14
13
  page: page,
@@ -39,9 +39,9 @@ function showLoading() {
39
39
  return _showLoading.apply(this, arguments);
40
40
  }
41
41
  function _showLoading() {
42
- _showLoading = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
42
+ _showLoading = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
43
43
  var loading, div;
44
- return _regenerator["default"].wrap(function _callee$(_context) {
44
+ return _regenerator["default"].wrap(function (_context) {
45
45
  while (1) switch (_context.prev = _context.next) {
46
46
  case 0:
47
47
  loading = document.getElementById("fullscreen-loading");
@@ -53,7 +53,7 @@ function _showLoading() {
53
53
  div.innerHTML = "\n <div class=\"atom-spinner\">\n <div class=\"spinner-inner\">\n <div class=\"spinner-line\"></div>\n <div class=\"spinner-line\"></div>\n <div class=\"spinner-line\"></div>\n <div class=\"spinner-circle\"></div>\n </div>\n </div>\n ";
54
54
  document.body.appendChild(div);
55
55
  }
56
- case 2:
56
+ case 1:
57
57
  case "end":
58
58
  return _context.stop();
59
59
  }
@@ -65,16 +65,16 @@ function hideLoading() {
65
65
  return _hideLoading.apply(this, arguments);
66
66
  }
67
67
  function _hideLoading() {
68
- _hideLoading = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
68
+ _hideLoading = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2() {
69
69
  var loading;
70
- return _regenerator["default"].wrap(function _callee2$(_context2) {
70
+ return _regenerator["default"].wrap(function (_context2) {
71
71
  while (1) switch (_context2.prev = _context2.next) {
72
72
  case 0:
73
73
  loading = document.getElementById("fullscreen-loading");
74
74
  if (loading) {
75
75
  loading.style.display = "none";
76
76
  }
77
- case 2:
77
+ case 1:
78
78
  case "end":
79
79
  return _context2.stop();
80
80
  }
@@ -86,33 +86,33 @@ function openPage(_x, _x2) {
86
86
  return _openPage.apply(this, arguments);
87
87
  }
88
88
  function _openPage() {
89
- _openPage = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(url, target) {
89
+ _openPage = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3(url, target) {
90
90
  var _window$parent;
91
91
  var page, func;
92
- return _regenerator["default"].wrap(function _callee3$(_context3) {
92
+ return _regenerator["default"].wrap(function (_context3) {
93
93
  while (1) switch (_context3.prev = _context3.next) {
94
94
  case 0:
95
95
  // @ts-ignore
96
96
  func = (_window$parent = window.parent) === null || _window$parent === void 0 ? void 0 : _window$parent.openWorkPlatformTab;
97
97
  if (!func) {
98
- _context3.next = 7;
98
+ _context3.next = 2;
99
99
  break;
100
100
  }
101
- _context3.next = 4;
101
+ _context3.next = 1;
102
102
  return func({
103
103
  value: target,
104
104
  url: url
105
105
  });
106
- case 4:
106
+ case 1:
107
107
  page = _context3.sent;
108
- _context3.next = 8;
108
+ _context3.next = 3;
109
109
  break;
110
- case 7:
110
+ case 2:
111
111
  page = window.open(url, target);
112
- case 8:
112
+ case 3:
113
113
  console.debug("openPage", page, target);
114
114
  return _context3.abrupt("return", page);
115
- case 10:
115
+ case 4:
116
116
  case "end":
117
117
  return _context3.stop();
118
118
  }
@@ -124,10 +124,10 @@ function closePage(_x3, _x4) {
124
124
  return _closePage.apply(this, arguments);
125
125
  }
126
126
  function _closePage() {
127
- _closePage = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(url, target) {
127
+ _closePage = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee4(url, target) {
128
128
  var _window$parent2;
129
129
  var func;
130
- return _regenerator["default"].wrap(function _callee4$(_context4) {
130
+ return _regenerator["default"].wrap(function (_context4) {
131
131
  while (1) switch (_context4.prev = _context4.next) {
132
132
  case 0:
133
133
  // @ts-ignore
@@ -140,7 +140,7 @@ function _closePage() {
140
140
  } else {
141
141
  window.close();
142
142
  }
143
- case 2:
143
+ case 1:
144
144
  case "end":
145
145
  return _context4.stop();
146
146
  }