@zhubangyun/lowcode-core 1.1.9 → 1.1.11

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.
@@ -77,7 +77,9 @@ function _loadStyle() {
77
77
  target.href = src;
78
78
  target.rel = "stylesheet";
79
79
  target.onload = function () {
80
- return resolve(true);
80
+ return setTimeout(function () {
81
+ resolve(true);
82
+ }, 1);
81
83
  };
82
84
  target.onerror = function () {
83
85
  return resolve(false);
@@ -133,7 +135,9 @@ function _loadScript() {
133
135
  }
134
136
  target.src = src;
135
137
  target.onload = function () {
136
- return resolve(true);
138
+ return setTimeout(function () {
139
+ resolve(true);
140
+ }, 1);
137
141
  };
138
142
  target.onerror = function () {
139
143
  return resolve(false);
@@ -1,5 +1,5 @@
1
1
  import { IPublicTypeProjectSchema } from "@alilc/lowcode-types/lib/shell/type/project-schema";
2
- import { IPublicTypeFieldConfig, IPublicTypeNpmInfo } from "@alilc/lowcode-types";
2
+ import { IPublicTypeConfigure, IPublicTypeNpmInfo } from "@alilc/lowcode-types";
3
3
  /**
4
4
  * 资产包协议
5
5
  */
@@ -258,7 +258,7 @@ export interface ComponentDescription {
258
258
  keywords?: string[];
259
259
  devMode?: 'proCode' | 'lowCode';
260
260
  npm: IPublicTypeNpmInfo;
261
- configure: IPublicTypeFieldConfig;
261
+ configure: IPublicTypeConfigure;
262
262
  snippets: Snippet[];
263
263
  group: string;
264
264
  category: string;
@@ -1,14 +1,20 @@
1
- import { Project } from "@alilc/lowcode-shell";
1
+ import { Project, Material, Plugins } from "@alilc/lowcode-shell";
2
2
  import { DefaultAssertsType, DesignerAssets } from "../assets";
3
+ import { IPublicTypeAssetsJson } from "@alilc/lowcode-utils";
4
+ import { IPublicTypePlugin, IPublicTypePluginRegisterOptions } from "@alilc/lowcode-types";
3
5
  export declare class Engine {
4
6
  project: Project;
7
+ plugins: Plugins;
5
8
  assets: DesignerAssets;
9
+ material: Material;
6
10
  _engine: any;
7
11
  constructor();
8
12
  /**
9
13
  * 注入资产
10
14
  */
11
15
  injectAssets: (types?: DefaultAssertsType[]) => Promise<void>;
16
+ loadIncrementalAssets: (incrementalAssets: IPublicTypeAssetsJson) => Promise<void>;
17
+ registerPlugin: (pluginModel: IPublicTypePlugin, options?: any, registerOptions?: IPublicTypePluginRegisterOptions) => Promise<void>;
12
18
  /**
13
19
  * 初始化
14
20
  * @param container
@@ -6,7 +6,9 @@ import { createFetchHandler } from "@alilc/lowcode-datasource-fetch-handler";
6
6
  export var Engine = function Engine() {
7
7
  var _this = this;
8
8
  this.project = void 0;
9
+ this.plugins = void 0;
9
10
  this.assets = void 0;
11
+ this.material = void 0;
10
12
  this._engine = void 0;
11
13
  /**
12
14
  * 注入资产
@@ -43,17 +45,49 @@ export var Engine = function Engine() {
43
45
  return _ref.apply(this, arguments);
44
46
  };
45
47
  }();
48
+ this.loadIncrementalAssets = /*#__PURE__*/function () {
49
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(incrementalAssets) {
50
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
51
+ while (1) switch (_context2.prev = _context2.next) {
52
+ case 0:
53
+ return _context2.abrupt("return", _this.material.loadIncrementalAssets(incrementalAssets));
54
+ case 1:
55
+ case "end":
56
+ return _context2.stop();
57
+ }
58
+ }, _callee2);
59
+ }));
60
+ return function (_x2) {
61
+ return _ref2.apply(this, arguments);
62
+ };
63
+ }();
64
+ this.registerPlugin = /*#__PURE__*/function () {
65
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(pluginModel, options, registerOptions) {
66
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
67
+ while (1) switch (_context3.prev = _context3.next) {
68
+ case 0:
69
+ return _context3.abrupt("return", _this.plugins.register(pluginModel, options, registerOptions));
70
+ case 1:
71
+ case "end":
72
+ return _context3.stop();
73
+ }
74
+ }, _callee3);
75
+ }));
76
+ return function (_x3, _x4, _x5) {
77
+ return _ref3.apply(this, arguments);
78
+ };
79
+ }();
46
80
  /**
47
81
  * 初始化
48
82
  * @param container
49
83
  * @param schema
50
84
  */
51
85
  this.init = /*#__PURE__*/function () {
52
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(container, schema) {
53
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
54
- while (1) switch (_context2.prev = _context2.next) {
86
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(container, schema) {
87
+ return _regeneratorRuntime.wrap(function _callee4$(_context4) {
88
+ while (1) switch (_context4.prev = _context4.next) {
55
89
  case 0:
56
- _context2.next = 2;
90
+ _context4.next = 2;
57
91
  return _this._engine.init(container, {
58
92
  designMode: "design",
59
93
  enableCondition: true,
@@ -64,22 +98,22 @@ export var Engine = function Engine() {
64
98
  }
65
99
  });
66
100
  case 2:
67
- _context2.next = 4;
101
+ _context4.next = 4;
68
102
  return _this.openDocument(schema);
69
103
  case 4:
70
104
  case "end":
71
- return _context2.stop();
105
+ return _context4.stop();
72
106
  }
73
- }, _callee2);
107
+ }, _callee4);
74
108
  }));
75
- return function (_x2, _x3) {
76
- return _ref2.apply(this, arguments);
109
+ return function (_x6, _x7) {
110
+ return _ref4.apply(this, arguments);
77
111
  };
78
112
  }();
79
113
  this.openDocument = /*#__PURE__*/function () {
80
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(schema) {
81
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
82
- while (1) switch (_context3.prev = _context3.next) {
114
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(schema) {
115
+ return _regeneratorRuntime.wrap(function _callee5$(_context5) {
116
+ while (1) switch (_context5.prev = _context5.next) {
83
117
  case 0:
84
118
  if (schema === void 0) {
85
119
  schema = {};
@@ -87,16 +121,18 @@ export var Engine = function Engine() {
87
121
  _this._engine.project.openDocument(schema);
88
122
  case 2:
89
123
  case "end":
90
- return _context3.stop();
124
+ return _context5.stop();
91
125
  }
92
- }, _callee3);
126
+ }, _callee5);
93
127
  }));
94
- return function (_x4) {
95
- return _ref3.apply(this, arguments);
128
+ return function (_x8) {
129
+ return _ref5.apply(this, arguments);
96
130
  };
97
131
  }();
98
132
  // @ts-ignore
99
133
  this._engine = window.AliLowCodeEngine;
100
134
  this.project = this._engine.project;
135
+ this.material = this._engine.material;
136
+ this.plugins = this._engine.plugins;
101
137
  this.assets = new DesignerAssets();
102
138
  };
@@ -82,7 +82,9 @@ function _loadStyle() {
82
82
  target.href = src;
83
83
  target.rel = "stylesheet";
84
84
  target.onload = function () {
85
- return resolve(true);
85
+ return setTimeout(function () {
86
+ resolve(true);
87
+ }, 1);
86
88
  };
87
89
  target.onerror = function () {
88
90
  return resolve(false);
@@ -138,7 +140,9 @@ function _loadScript() {
138
140
  }
139
141
  target.src = src;
140
142
  target.onload = function () {
141
- return resolve(true);
143
+ return setTimeout(function () {
144
+ resolve(true);
145
+ }, 1);
142
146
  };
143
147
  target.onerror = function () {
144
148
  return resolve(false);
@@ -1,5 +1,5 @@
1
1
  import { IPublicTypeProjectSchema } from "@alilc/lowcode-types/lib/shell/type/project-schema";
2
- import { IPublicTypeFieldConfig, IPublicTypeNpmInfo } from "@alilc/lowcode-types";
2
+ import { IPublicTypeConfigure, IPublicTypeNpmInfo } from "@alilc/lowcode-types";
3
3
  /**
4
4
  * 资产包协议
5
5
  */
@@ -258,7 +258,7 @@ export interface ComponentDescription {
258
258
  keywords?: string[];
259
259
  devMode?: 'proCode' | 'lowCode';
260
260
  npm: IPublicTypeNpmInfo;
261
- configure: IPublicTypeFieldConfig;
261
+ configure: IPublicTypeConfigure;
262
262
  snippets: Snippet[];
263
263
  group: string;
264
264
  category: string;
@@ -1,14 +1,20 @@
1
- import { Project } from "@alilc/lowcode-shell";
1
+ import { Project, Material, Plugins } from "@alilc/lowcode-shell";
2
2
  import { DefaultAssertsType, DesignerAssets } from "../assets";
3
+ import { IPublicTypeAssetsJson } from "@alilc/lowcode-utils";
4
+ import { IPublicTypePlugin, IPublicTypePluginRegisterOptions } from "@alilc/lowcode-types";
3
5
  export declare class Engine {
4
6
  project: Project;
7
+ plugins: Plugins;
5
8
  assets: DesignerAssets;
9
+ material: Material;
6
10
  _engine: any;
7
11
  constructor();
8
12
  /**
9
13
  * 注入资产
10
14
  */
11
15
  injectAssets: (types?: DefaultAssertsType[]) => Promise<void>;
16
+ loadIncrementalAssets: (incrementalAssets: IPublicTypeAssetsJson) => Promise<void>;
17
+ registerPlugin: (pluginModel: IPublicTypePlugin, options?: any, registerOptions?: IPublicTypePluginRegisterOptions) => Promise<void>;
12
18
  /**
13
19
  * 初始化
14
20
  * @param container
@@ -11,7 +11,9 @@ var _lowcodeDatasourceFetchHandler = require("@alilc/lowcode-datasource-fetch-ha
11
11
  var Engine = exports.Engine = function Engine() {
12
12
  var _this = this;
13
13
  this.project = void 0;
14
+ this.plugins = void 0;
14
15
  this.assets = void 0;
16
+ this.material = void 0;
15
17
  this._engine = void 0;
16
18
  /**
17
19
  * 注入资产
@@ -48,17 +50,49 @@ var Engine = exports.Engine = function Engine() {
48
50
  return _ref.apply(this, arguments);
49
51
  };
50
52
  }();
53
+ this.loadIncrementalAssets = /*#__PURE__*/function () {
54
+ var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(incrementalAssets) {
55
+ return _regenerator["default"].wrap(function _callee2$(_context2) {
56
+ while (1) switch (_context2.prev = _context2.next) {
57
+ case 0:
58
+ return _context2.abrupt("return", _this.material.loadIncrementalAssets(incrementalAssets));
59
+ case 1:
60
+ case "end":
61
+ return _context2.stop();
62
+ }
63
+ }, _callee2);
64
+ }));
65
+ return function (_x2) {
66
+ return _ref2.apply(this, arguments);
67
+ };
68
+ }();
69
+ this.registerPlugin = /*#__PURE__*/function () {
70
+ var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(pluginModel, options, registerOptions) {
71
+ return _regenerator["default"].wrap(function _callee3$(_context3) {
72
+ while (1) switch (_context3.prev = _context3.next) {
73
+ case 0:
74
+ return _context3.abrupt("return", _this.plugins.register(pluginModel, options, registerOptions));
75
+ case 1:
76
+ case "end":
77
+ return _context3.stop();
78
+ }
79
+ }, _callee3);
80
+ }));
81
+ return function (_x3, _x4, _x5) {
82
+ return _ref3.apply(this, arguments);
83
+ };
84
+ }();
51
85
  /**
52
86
  * 初始化
53
87
  * @param container
54
88
  * @param schema
55
89
  */
56
90
  this.init = /*#__PURE__*/function () {
57
- var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(container, schema) {
58
- return _regenerator["default"].wrap(function _callee2$(_context2) {
59
- while (1) switch (_context2.prev = _context2.next) {
91
+ var _ref4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(container, schema) {
92
+ return _regenerator["default"].wrap(function _callee4$(_context4) {
93
+ while (1) switch (_context4.prev = _context4.next) {
60
94
  case 0:
61
- _context2.next = 2;
95
+ _context4.next = 2;
62
96
  return _this._engine.init(container, {
63
97
  designMode: "design",
64
98
  enableCondition: true,
@@ -69,22 +103,22 @@ var Engine = exports.Engine = function Engine() {
69
103
  }
70
104
  });
71
105
  case 2:
72
- _context2.next = 4;
106
+ _context4.next = 4;
73
107
  return _this.openDocument(schema);
74
108
  case 4:
75
109
  case "end":
76
- return _context2.stop();
110
+ return _context4.stop();
77
111
  }
78
- }, _callee2);
112
+ }, _callee4);
79
113
  }));
80
- return function (_x2, _x3) {
81
- return _ref2.apply(this, arguments);
114
+ return function (_x6, _x7) {
115
+ return _ref4.apply(this, arguments);
82
116
  };
83
117
  }();
84
118
  this.openDocument = /*#__PURE__*/function () {
85
- var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(schema) {
86
- return _regenerator["default"].wrap(function _callee3$(_context3) {
87
- while (1) switch (_context3.prev = _context3.next) {
119
+ var _ref5 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(schema) {
120
+ return _regenerator["default"].wrap(function _callee5$(_context5) {
121
+ while (1) switch (_context5.prev = _context5.next) {
88
122
  case 0:
89
123
  if (schema === void 0) {
90
124
  schema = {};
@@ -92,16 +126,18 @@ var Engine = exports.Engine = function Engine() {
92
126
  _this._engine.project.openDocument(schema);
93
127
  case 2:
94
128
  case "end":
95
- return _context3.stop();
129
+ return _context5.stop();
96
130
  }
97
- }, _callee3);
131
+ }, _callee5);
98
132
  }));
99
- return function (_x4) {
100
- return _ref3.apply(this, arguments);
133
+ return function (_x8) {
134
+ return _ref5.apply(this, arguments);
101
135
  };
102
136
  }();
103
137
  // @ts-ignore
104
138
  this._engine = window.AliLowCodeEngine;
105
139
  this.project = this._engine.project;
140
+ this.material = this._engine.material;
141
+ this.plugins = this._engine.plugins;
106
142
  this.assets = new _assets.DesignerAssets();
107
143
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhubangyun/lowcode-core",
3
- "version": "1.1.9",
3
+ "version": "1.1.11",
4
4
  "description": "低代码核心",
5
5
  "files": [
6
6
  "lib",