@zhubangyun/lowcode-core 1.1.11 → 1.1.13

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.
@@ -23,7 +23,7 @@ function _loadPlugins() {
23
23
  _context.next = 5;
24
24
  return loadStyle(plugin);
25
25
  case 5:
26
- console.debug("loadStyle", plugin);
26
+ console.debug("loadStyle", plugin, Date.now().toString(36));
27
27
  case 6:
28
28
  _context.next = 1;
29
29
  break;
@@ -38,7 +38,7 @@ function _loadPlugins() {
38
38
  _context.next = 13;
39
39
  return loadScript(_plugin);
40
40
  case 13:
41
- console.debug("loadScript", _plugin);
41
+ console.debug("loadScript", _plugin, Date.now().toString(36));
42
42
  case 14:
43
43
  _context.next = 9;
44
44
  break;
@@ -66,10 +66,15 @@ function _loadStyle() {
66
66
  case 2:
67
67
  return _context3.abrupt("return", new Promise( /*#__PURE__*/function () {
68
68
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(resolve) {
69
- var target;
69
+ var callback, target;
70
70
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
71
71
  while (1) switch (_context2.prev = _context2.next) {
72
72
  case 0:
73
+ callback = function _callback(status) {
74
+ setTimeout(function () {
75
+ resolve(status);
76
+ }, 10);
77
+ };
73
78
  //加载式样
74
79
  target = doc.querySelector("link[href='" + src + "']");
75
80
  if (!target) {
@@ -77,18 +82,16 @@ function _loadStyle() {
77
82
  target.href = src;
78
83
  target.rel = "stylesheet";
79
84
  target.onload = function () {
80
- return setTimeout(function () {
81
- resolve(true);
82
- }, 1);
85
+ return callback(true);
83
86
  };
84
87
  target.onerror = function () {
85
- return resolve(false);
88
+ return callback(false);
86
89
  };
87
90
  doc.head.appendChild(target);
88
91
  } else {
89
- resolve(true);
92
+ callback(true);
90
93
  }
91
- case 2:
94
+ case 3:
92
95
  case "end":
93
96
  return _context2.stop();
94
97
  }
@@ -122,10 +125,15 @@ function _loadScript() {
122
125
  case 2:
123
126
  return _context5.abrupt("return", new Promise( /*#__PURE__*/function () {
124
127
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(resolve, reject) {
125
- var target;
128
+ var callback, target;
126
129
  return _regeneratorRuntime.wrap(function _callee4$(_context4) {
127
130
  while (1) switch (_context4.prev = _context4.next) {
128
131
  case 0:
132
+ callback = function _callback2(status) {
133
+ setTimeout(function () {
134
+ resolve(status);
135
+ }, 10);
136
+ };
129
137
  //加载脚本
130
138
  target = doc.querySelector("script[src='" + src + "']");
131
139
  if (!target) {
@@ -135,18 +143,16 @@ function _loadScript() {
135
143
  }
136
144
  target.src = src;
137
145
  target.onload = function () {
138
- return setTimeout(function () {
139
- resolve(true);
140
- }, 1);
146
+ return callback(true);
141
147
  };
142
148
  target.onerror = function () {
143
- return resolve(false);
149
+ return callback(false);
144
150
  };
145
151
  doc.body.appendChild(target);
146
152
  } else {
147
- resolve(true);
153
+ callback(true);
148
154
  }
149
- case 2:
155
+ case 3:
150
156
  case "end":
151
157
  return _context4.stop();
152
158
  }
@@ -1,5 +1,7 @@
1
- import { IPublicTypeProjectSchema } from "@alilc/lowcode-types/lib/shell/type/project-schema";
1
+ import { IPublicTypeUtilsMap } from "@alilc/lowcode-types/lib/shell/type/project-schema";
2
2
  import { IPublicTypeConfigure, IPublicTypeNpmInfo } from "@alilc/lowcode-types";
3
+ import { IPublicTypeI18nMap, IPublicTypeJSONObject, IPublicTypeNodeSchema, IPublicTypeRootSchema } from "@alilc/lowcode-types/lib/shell/type";
4
+ import { InterpretDataSource as DataSource } from "@alilc/lowcode-datasource-types/es/data-source-interpret";
3
5
  /**
4
6
  * 资产包协议
5
7
  */
@@ -57,6 +59,7 @@ export interface Package {
57
59
  * 唯一标识
58
60
  */
59
61
  id?: string;
62
+ componentId?: string;
60
63
  /**
61
64
  * 包名
62
65
  */
@@ -88,7 +91,7 @@ export interface Package {
88
91
  /**
89
92
  * 低代码组件的 schema 内容
90
93
  */
91
- schema?: IPublicTypeProjectSchema;
94
+ schema?: IPublicTypePackageSchema;
92
95
  /**
93
96
  * 当前资源所依赖的其他资源包的 id 列表
94
97
  */
@@ -248,25 +251,26 @@ export interface Snippet {
248
251
  * 组件低代码描述
249
252
  */
250
253
  export interface ComponentDescription {
254
+ componentId?: string;
251
255
  componentName: string;
252
256
  title: string;
253
257
  description?: string;
254
- docUrl: string;
255
- screenshot: string;
258
+ docUrl?: string;
259
+ screenshot?: string;
256
260
  icon?: string;
257
261
  tags?: string[];
258
262
  keywords?: string[];
259
263
  devMode?: 'proCode' | 'lowCode';
260
- npm: IPublicTypeNpmInfo;
261
- configure: IPublicTypeConfigure;
262
- snippets: Snippet[];
263
- group: string;
264
- category: string;
265
- priority: number;
264
+ npm?: IPublicTypeNpmInfo;
265
+ configure?: IPublicTypeConfigure;
266
+ snippets?: Snippet[];
267
+ group?: string;
268
+ category?: string;
269
+ priority?: number;
266
270
  /**
267
271
  * 组件引用的资源信息
268
272
  */
269
- reference: Reference;
273
+ reference?: Reference;
270
274
  }
271
275
  /**
272
276
  * 远程物料描述
@@ -296,3 +300,30 @@ export interface MultiModeUrl {
296
300
  default: string;
297
301
  [index: string]: string;
298
302
  }
303
+ interface IPublicTypePackageSchema<T = IPublicTypeRootSchema> extends IPublicTypeNodeSchema {
304
+ /**
305
+ * 当前应用协议版本号
306
+ */
307
+ version: string;
308
+ /**
309
+ * 国际化语料
310
+ */
311
+ i18n?: IPublicTypeI18nMap;
312
+ /**
313
+ * 应用范围内的全局自定义函数或第三方工具类扩展
314
+ */
315
+ utils?: IPublicTypeUtilsMap;
316
+ /**
317
+ * 应用范围内的全局常量
318
+ */
319
+ constants?: IPublicTypeJSONObject;
320
+ /**
321
+ * 应用范围内的全局样式
322
+ */
323
+ css?: string;
324
+ /**
325
+ * 当前应用的公共数据源
326
+ */
327
+ dataSource?: DataSource;
328
+ }
329
+ export {};
@@ -28,7 +28,7 @@ function _loadPlugins() {
28
28
  _context.next = 5;
29
29
  return loadStyle(plugin);
30
30
  case 5:
31
- console.debug("loadStyle", plugin);
31
+ console.debug("loadStyle", plugin, Date.now().toString(36));
32
32
  case 6:
33
33
  _context.next = 1;
34
34
  break;
@@ -43,7 +43,7 @@ function _loadPlugins() {
43
43
  _context.next = 13;
44
44
  return loadScript(_plugin);
45
45
  case 13:
46
- console.debug("loadScript", _plugin);
46
+ console.debug("loadScript", _plugin, Date.now().toString(36));
47
47
  case 14:
48
48
  _context.next = 9;
49
49
  break;
@@ -71,10 +71,15 @@ function _loadStyle() {
71
71
  case 2:
72
72
  return _context3.abrupt("return", new Promise( /*#__PURE__*/function () {
73
73
  var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(resolve) {
74
- var target;
74
+ var callback, target;
75
75
  return _regenerator["default"].wrap(function _callee2$(_context2) {
76
76
  while (1) switch (_context2.prev = _context2.next) {
77
77
  case 0:
78
+ callback = function _callback(status) {
79
+ setTimeout(function () {
80
+ resolve(status);
81
+ }, 10);
82
+ };
78
83
  //加载式样
79
84
  target = doc.querySelector("link[href='" + src + "']");
80
85
  if (!target) {
@@ -82,18 +87,16 @@ function _loadStyle() {
82
87
  target.href = src;
83
88
  target.rel = "stylesheet";
84
89
  target.onload = function () {
85
- return setTimeout(function () {
86
- resolve(true);
87
- }, 1);
90
+ return callback(true);
88
91
  };
89
92
  target.onerror = function () {
90
- return resolve(false);
93
+ return callback(false);
91
94
  };
92
95
  doc.head.appendChild(target);
93
96
  } else {
94
- resolve(true);
97
+ callback(true);
95
98
  }
96
- case 2:
99
+ case 3:
97
100
  case "end":
98
101
  return _context2.stop();
99
102
  }
@@ -127,10 +130,15 @@ function _loadScript() {
127
130
  case 2:
128
131
  return _context5.abrupt("return", new Promise( /*#__PURE__*/function () {
129
132
  var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(resolve, reject) {
130
- var target;
133
+ var callback, target;
131
134
  return _regenerator["default"].wrap(function _callee4$(_context4) {
132
135
  while (1) switch (_context4.prev = _context4.next) {
133
136
  case 0:
137
+ callback = function _callback2(status) {
138
+ setTimeout(function () {
139
+ resolve(status);
140
+ }, 10);
141
+ };
134
142
  //加载脚本
135
143
  target = doc.querySelector("script[src='" + src + "']");
136
144
  if (!target) {
@@ -140,18 +148,16 @@ function _loadScript() {
140
148
  }
141
149
  target.src = src;
142
150
  target.onload = function () {
143
- return setTimeout(function () {
144
- resolve(true);
145
- }, 1);
151
+ return callback(true);
146
152
  };
147
153
  target.onerror = function () {
148
- return resolve(false);
154
+ return callback(false);
149
155
  };
150
156
  doc.body.appendChild(target);
151
157
  } else {
152
- resolve(true);
158
+ callback(true);
153
159
  }
154
- case 2:
160
+ case 3:
155
161
  case "end":
156
162
  return _context4.stop();
157
163
  }
@@ -1,5 +1,7 @@
1
- import { IPublicTypeProjectSchema } from "@alilc/lowcode-types/lib/shell/type/project-schema";
1
+ import { IPublicTypeUtilsMap } from "@alilc/lowcode-types/lib/shell/type/project-schema";
2
2
  import { IPublicTypeConfigure, IPublicTypeNpmInfo } from "@alilc/lowcode-types";
3
+ import { IPublicTypeI18nMap, IPublicTypeJSONObject, IPublicTypeNodeSchema, IPublicTypeRootSchema } from "@alilc/lowcode-types/lib/shell/type";
4
+ import { InterpretDataSource as DataSource } from "@alilc/lowcode-datasource-types/es/data-source-interpret";
3
5
  /**
4
6
  * 资产包协议
5
7
  */
@@ -57,6 +59,7 @@ export interface Package {
57
59
  * 唯一标识
58
60
  */
59
61
  id?: string;
62
+ componentId?: string;
60
63
  /**
61
64
  * 包名
62
65
  */
@@ -88,7 +91,7 @@ export interface Package {
88
91
  /**
89
92
  * 低代码组件的 schema 内容
90
93
  */
91
- schema?: IPublicTypeProjectSchema;
94
+ schema?: IPublicTypePackageSchema;
92
95
  /**
93
96
  * 当前资源所依赖的其他资源包的 id 列表
94
97
  */
@@ -248,25 +251,26 @@ export interface Snippet {
248
251
  * 组件低代码描述
249
252
  */
250
253
  export interface ComponentDescription {
254
+ componentId?: string;
251
255
  componentName: string;
252
256
  title: string;
253
257
  description?: string;
254
- docUrl: string;
255
- screenshot: string;
258
+ docUrl?: string;
259
+ screenshot?: string;
256
260
  icon?: string;
257
261
  tags?: string[];
258
262
  keywords?: string[];
259
263
  devMode?: 'proCode' | 'lowCode';
260
- npm: IPublicTypeNpmInfo;
261
- configure: IPublicTypeConfigure;
262
- snippets: Snippet[];
263
- group: string;
264
- category: string;
265
- priority: number;
264
+ npm?: IPublicTypeNpmInfo;
265
+ configure?: IPublicTypeConfigure;
266
+ snippets?: Snippet[];
267
+ group?: string;
268
+ category?: string;
269
+ priority?: number;
266
270
  /**
267
271
  * 组件引用的资源信息
268
272
  */
269
- reference: Reference;
273
+ reference?: Reference;
270
274
  }
271
275
  /**
272
276
  * 远程物料描述
@@ -296,3 +300,30 @@ export interface MultiModeUrl {
296
300
  default: string;
297
301
  [index: string]: string;
298
302
  }
303
+ interface IPublicTypePackageSchema<T = IPublicTypeRootSchema> extends IPublicTypeNodeSchema {
304
+ /**
305
+ * 当前应用协议版本号
306
+ */
307
+ version: string;
308
+ /**
309
+ * 国际化语料
310
+ */
311
+ i18n?: IPublicTypeI18nMap;
312
+ /**
313
+ * 应用范围内的全局自定义函数或第三方工具类扩展
314
+ */
315
+ utils?: IPublicTypeUtilsMap;
316
+ /**
317
+ * 应用范围内的全局常量
318
+ */
319
+ constants?: IPublicTypeJSONObject;
320
+ /**
321
+ * 应用范围内的全局样式
322
+ */
323
+ css?: string;
324
+ /**
325
+ * 当前应用的公共数据源
326
+ */
327
+ dataSource?: DataSource;
328
+ }
329
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhubangyun/lowcode-core",
3
- "version": "1.1.11",
3
+ "version": "1.1.13",
4
4
  "description": "低代码核心",
5
5
  "files": [
6
6
  "lib",