@dckj-npm/lowcode-plugin-code-generator 1.3.1 → 1.3.3

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 (73) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +53 -52
  3. package/es/components/CodeGenActionBtn/CodeGenActionBtn.js +11 -14
  4. package/es/components/CodeGenActionBtn/CodeGenActionBtn.scss +13 -13
  5. package/es/components/CodeGenPreview/CodeGenPreview.scss +16 -16
  6. package/es/components/CodeGenPreview/useIsInIntranet.js +4 -4
  7. package/es/components/CodeGenResult/CodeGenResult.scss +7 -7
  8. package/es/components/CodeSandboxPreview/CodeSandboxPreview.scss +18 -18
  9. package/es/components/FileTypeIcon/FileTypeIcon.scss +36 -36
  10. package/es/components/SourcesView/SourcesView.scss +24 -24
  11. package/es/demo/index.scss +56 -56
  12. package/es/utils/utils.js +14 -17
  13. package/lib/components/CodeGenActionBtn/CodeGenActionBtn.js +11 -14
  14. package/lib/components/CodeGenActionBtn/CodeGenActionBtn.scss +13 -13
  15. package/lib/components/CodeGenPreview/CodeGenPreview.scss +16 -16
  16. package/lib/components/CodeGenPreview/useIsInIntranet.js +4 -4
  17. package/lib/components/CodeGenResult/CodeGenResult.scss +7 -7
  18. package/lib/components/CodeSandboxPreview/CodeSandboxPreview.scss +18 -18
  19. package/lib/components/FileTypeIcon/FileTypeIcon.scss +36 -36
  20. package/lib/components/SourcesView/SourcesView.scss +24 -24
  21. package/lib/demo/index.scss +56 -56
  22. package/lib/utils/utils.js +14 -17
  23. package/package.json +94 -94
  24. package/es/components/CodeGenActionBtn/CodeGenActionBtn.d.ts +0 -8
  25. package/es/components/CodeGenActionBtn/index.d.ts +0 -1
  26. package/es/components/CodeGenPreview/CodeGenPreview.d.ts +0 -8
  27. package/es/components/CodeGenPreview/fixPreviewCode.d.ts +0 -2
  28. package/es/components/CodeGenPreview/index.d.ts +0 -1
  29. package/es/components/CodeGenPreview/useIsInIntranet.d.ts +0 -4
  30. package/es/components/CodeGenResult/CodeGenResult.d.ts +0 -9
  31. package/es/components/CodeGenResult/index.d.ts +0 -1
  32. package/es/components/CodeSandboxPreview/CodeSandboxPreview.d.ts +0 -4
  33. package/es/components/CodeSandboxPreview/index.d.ts +0 -1
  34. package/es/components/FileTypeIcon/FileTypeIcon.d.ts +0 -6
  35. package/es/components/FileTypeIcon/index.d.ts +0 -1
  36. package/es/components/GravityCode/GravityCode.d.ts +0 -9
  37. package/es/components/GravityCode/index.d.ts +0 -1
  38. package/es/components/GravityPreview/ForceUpdate.d.ts +0 -6
  39. package/es/components/GravityPreview/GravityPreview.d.ts +0 -7
  40. package/es/components/GravityPreview/GravitySdk.d.ts +0 -10
  41. package/es/components/GravityPreview/index.d.ts +0 -1
  42. package/es/components/SourcesView/SourcesView.d.ts +0 -9
  43. package/es/components/SourcesView/index.d.ts +0 -1
  44. package/es/demo/index.d.ts +0 -1
  45. package/es/index.d.ts +0 -30
  46. package/es/types/SyncCodeGenResult.d.ts +0 -16
  47. package/es/types/index.d.ts +0 -1
  48. package/es/utils/utils.d.ts +0 -26
  49. package/lib/components/CodeGenActionBtn/CodeGenActionBtn.d.ts +0 -8
  50. package/lib/components/CodeGenActionBtn/index.d.ts +0 -1
  51. package/lib/components/CodeGenPreview/CodeGenPreview.d.ts +0 -8
  52. package/lib/components/CodeGenPreview/fixPreviewCode.d.ts +0 -2
  53. package/lib/components/CodeGenPreview/index.d.ts +0 -1
  54. package/lib/components/CodeGenPreview/useIsInIntranet.d.ts +0 -4
  55. package/lib/components/CodeGenResult/CodeGenResult.d.ts +0 -9
  56. package/lib/components/CodeGenResult/index.d.ts +0 -1
  57. package/lib/components/CodeSandboxPreview/CodeSandboxPreview.d.ts +0 -4
  58. package/lib/components/CodeSandboxPreview/index.d.ts +0 -1
  59. package/lib/components/FileTypeIcon/FileTypeIcon.d.ts +0 -6
  60. package/lib/components/FileTypeIcon/index.d.ts +0 -1
  61. package/lib/components/GravityCode/GravityCode.d.ts +0 -9
  62. package/lib/components/GravityCode/index.d.ts +0 -1
  63. package/lib/components/GravityPreview/ForceUpdate.d.ts +0 -6
  64. package/lib/components/GravityPreview/GravityPreview.d.ts +0 -7
  65. package/lib/components/GravityPreview/GravitySdk.d.ts +0 -10
  66. package/lib/components/GravityPreview/index.d.ts +0 -1
  67. package/lib/components/SourcesView/SourcesView.d.ts +0 -9
  68. package/lib/components/SourcesView/index.d.ts +0 -1
  69. package/lib/demo/index.d.ts +0 -1
  70. package/lib/index.d.ts +0 -30
  71. package/lib/types/SyncCodeGenResult.d.ts +0 -16
  72. package/lib/types/index.d.ts +0 -1
  73. package/lib/utils/utils.d.ts +0 -26
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2021 Alibaba
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Alibaba
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,52 +1,53 @@
1
- # 集团低代码引擎 - 出码插件(浏览器里进行出码)
2
-
3
- ## 简介
4
-
5
- 本项目是出码模块的对应的浏览器里进行出码的插件
6
-
7
- ## 使用方法
8
-
9
- 1. 安装依赖 `npm install --save @alilc/lowcode-plugin-code-generator`
10
- 2. 注册插件:
11
-
12
- ```ts
13
- import { plugins } from '@alilc/lowcode-engine';
14
- import CodeGenPlugin from '@alilc/lowcode-plugin-code-generator';
15
-
16
- // 在你的初始化函数中:
17
- await plugins.register(CodeGenPlugin);
18
-
19
- // 如果您不希望自动加上出码按钮,则可以这样注册
20
- await plugins.register(CodeGenPlugin, { disableCodeGenActionBtn: true });
21
-
22
- ```
23
-
24
- 然后运行你的低代码编辑器项目即可。
25
-
26
- 参考:低代码编辑器的 Demo: <https://github.com/alibaba/lowcode-demo>
27
-
28
- ## 插件 API
29
-
30
- 本插件提供了出码的 API,注册了插件后, 可以这么样来用:
31
-
32
- ```js
33
- import { plugins } from '@alilc/lowcode-engine';
34
-
35
- const codeGenResult = plugins.codeGenerator.generateCode({
36
- solution: 'icejs',
37
- schema: await ctx.project.exportSchema(),
38
- });
39
-
40
- console.log('出码结果:', codeGenResult); // 这里就是出码结果
41
-
42
- ```
43
-
44
- ## 本地开发
45
-
46
- 常规两步即可开发调试:`npm i && npm start`
47
-
48
- ## 共建
49
-
50
- 欢迎参与共建,欢迎直接 fork 一份改改,补充您所需要的特性或修复 bug,然后提 PR 过来:
51
-
52
- -- 代码仓库:<https://github.com/alibaba/lowcode-code-generator-demo>
1
+ # 集团低代码引擎 - 出码插件(浏览器里进行出码)
2
+
3
+ ## 简介
4
+
5
+ 本项目是出码模块的对应的浏览器里进行出码的插件
6
+
7
+ ## 使用方法
8
+
9
+ 1. 安装依赖 `npm install --save @alilc/lowcode-plugin-code-generator`
10
+ 2. 注册插件:
11
+
12
+ ```ts
13
+ import { plugins } from '@alilc/lowcode-engine';
14
+ import CodeGenPlugin from '@alilc/lowcode-plugin-code-generator';
15
+
16
+ // 在你的初始化函数中:
17
+ await plugins.register(CodeGenPlugin);
18
+
19
+ // 如果您不希望自动加上出码按钮,则可以这样注册
20
+ await plugins.register(CodeGenPlugin, { disableCodeGenActionBtn: true });
21
+
22
+ ```
23
+
24
+ 然后运行你的低代码编辑器项目即可。
25
+
26
+ 参考:低代码编辑器的 Demo: <https://github.com/alibaba/lowcode-demo>
27
+
28
+ ## 插件 API
29
+
30
+ 本插件提供了出码的 API,注册了插件后, 可以这么样来用:
31
+
32
+ ```js
33
+ import { plugins } from '@alilc/lowcode-engine';
34
+
35
+ const codeGenResult = plugins.codeGenerator.generateCode({
36
+ solution: 'icejs',
37
+ schema: await ctx.project.exportSchema(),
38
+ });
39
+
40
+ console.log('出码结果:', codeGenResult); // 这里就是出码结果
41
+
42
+ ```
43
+
44
+ ## 本地开发
45
+
46
+ 常规两步即可开发调试:`npm i && npm start`
47
+
48
+ ## 共建
49
+
50
+ 欢迎参与共建,欢迎直接 fork 一份改改,补充您所需要的特性或修复 bug,然后提 PR 过来:
51
+
52
+ -- 代码仓库:<https://github.com/alibaba/lowcode-code-generator-demo>
53
+
@@ -44,19 +44,16 @@ export function CodeGenActionBtn(_ref) {
44
44
  return getResourceListFromLocalStorage(name);
45
45
  case 5:
46
46
  resourceList = _context.sent;
47
- console.log('resourceList', resourceList);
48
- _context.next = 9;
47
+ _context.next = 8;
49
48
  return getAllSchemaByResourceList(name, resourceList);
50
- case 9:
49
+ case 8:
51
50
  allSchema = _context.sent;
52
- _context.next = 12;
51
+ _context.next = 11;
53
52
  return Promise.all(allSchema.map(function (item) {
54
53
  return fixSchema(item);
55
54
  }));
56
- case 12:
55
+ case 11:
57
56
  resultSchema = _context.sent;
58
- console.log('allSchema', allSchema);
59
- console.log('resultSchema', resultSchema);
60
57
  // console.log('ctx ', ctx)
61
58
  // console.log('isActive ', ctx.workspace.isActive)
62
59
  // console.log('window.exportSchema ', ctx.workspace.window.exportSchema())
@@ -72,14 +69,14 @@ export function CodeGenActionBtn(_ref) {
72
69
  });
73
70
 
74
71
  // 出码...
75
- _context.next = 18;
72
+ _context.next = 15;
76
73
  return CodeGenerator.generateCode({
77
74
  solution: 'vuejs3',
78
75
  schema: resultSchema,
79
76
  flattenResult: true,
80
77
  resourceList: resourceList
81
78
  });
82
- case 18:
79
+ case 15:
83
80
  result = _context.sent;
84
81
  console.log('generated: ', result);
85
82
  setState(function (prev) {
@@ -88,10 +85,10 @@ export function CodeGenActionBtn(_ref) {
88
85
  result: result
89
86
  });
90
87
  });
91
- _context.next = 27;
88
+ _context.next = 24;
92
89
  break;
93
- case 23:
94
- _context.prev = 23;
90
+ case 20:
91
+ _context.prev = 20;
95
92
  _context.t0 = _context["catch"](0);
96
93
  console.error('failed to run code generator: ', _context.t0);
97
94
  setState(function (prev) {
@@ -100,11 +97,11 @@ export function CodeGenActionBtn(_ref) {
100
97
  error: _context.t0 instanceof Error ? _context.t0 : new Error("" + ((_context.t0 === null || _context.t0 === void 0 ? void 0 : _context.t0.message) || _context.t0))
101
98
  });
102
99
  });
103
- case 27:
100
+ case 24:
104
101
  case "end":
105
102
  return _context.stop();
106
103
  }
107
- }, _callee, null, [[0, 23]]);
104
+ }, _callee, null, [[0, 20]]);
108
105
  }));
109
106
  return function handleClick() {
110
107
  return _ref2.apply(this, arguments);
@@ -1,13 +1,13 @@
1
- .code-gen-plugin-loading {
2
- width: 100%;
3
- margin: 2em auto;
4
- }
5
-
6
- .code-gen-plugin-result {
7
- width: 100%;
8
- .next-message-error {
9
- .next-message-content {
10
- white-space: pre-wrap;
11
- }
12
- }
13
- }
1
+ .code-gen-plugin-loading {
2
+ width: 100%;
3
+ margin: 2em auto;
4
+ }
5
+
6
+ .code-gen-plugin-result {
7
+ width: 100%;
8
+ .next-message-error {
9
+ .next-message-content {
10
+ white-space: pre-wrap;
11
+ }
12
+ }
13
+ }
@@ -1,16 +1,16 @@
1
- .code-gen-preview-tabs {
2
- display: flex;
3
- flex-direction: column;
4
- height: 100%;
5
-
6
- .next-tabs-bar {
7
- flex-shrink: 0;
8
- }
9
-
10
- .next-tabs-content {
11
- flex: 1;
12
- .next-tabs-tabpane {
13
- height: 100%;
14
- }
15
- }
16
- }
1
+ .code-gen-preview-tabs {
2
+ display: flex;
3
+ flex-direction: column;
4
+ height: 100%;
5
+
6
+ .next-tabs-bar {
7
+ flex-shrink: 0;
8
+ }
9
+
10
+ .next-tabs-content {
11
+ flex: 1;
12
+ .next-tabs-tabpane {
13
+ height: 100%;
14
+ }
15
+ }
16
+ }
@@ -5,8 +5,8 @@ import React, { useEffect } from 'react';
5
5
  // 预先检测下是否在内网环境中
6
6
  var isInIntranetPromise = detectIsInIntranet();
7
7
 
8
- /**
9
- * 判断是否在内网环境中中
8
+ /**
9
+ * 判断是否在内网环境中中
10
10
  */
11
11
  export function useIsInIntranet() {
12
12
  var _React$useState = React.useState({
@@ -28,8 +28,8 @@ export function useIsInIntranet() {
28
28
  return state.isInIntranet;
29
29
  }
30
30
 
31
- /**
32
- * 判断是否在内网环境中中
31
+ /**
32
+ * 判断是否在内网环境中中
33
33
  */
34
34
  function detectIsInIntranet() {
35
35
  return _detectIsInIntranet.apply(this, arguments);
@@ -1,7 +1,7 @@
1
- .code-gen-result {
2
- .code-gen-result-gravity-demo {
3
- iframe {
4
- height: 100%;
5
- }
6
- }
7
- }
1
+ .code-gen-result {
2
+ .code-gen-result-gravity-demo {
3
+ iframe {
4
+ height: 100%;
5
+ }
6
+ }
7
+ }
@@ -1,18 +1,18 @@
1
- .code-gen-plugin-code-sandbox-preview {
2
- display: flex;
3
- flex-direction: row;
4
- align-items: center;
5
- align-content: center;
6
- justify-content: center;
7
- justify-items: center;
8
- height: 100%;
9
-
10
- iframe {
11
- width: 100%;
12
- height: 100%;
13
- min-height: 300px;
14
- border: 0;
15
- border-radius: 0;
16
- overflow: hidden;
17
- }
18
- }
1
+ .code-gen-plugin-code-sandbox-preview {
2
+ display: flex;
3
+ flex-direction: row;
4
+ align-items: center;
5
+ align-content: center;
6
+ justify-content: center;
7
+ justify-items: center;
8
+ height: 100%;
9
+
10
+ iframe {
11
+ width: 100%;
12
+ height: 100%;
13
+ min-height: 300px;
14
+ border: 0;
15
+ border-radius: 0;
16
+ overflow: hidden;
17
+ }
18
+ }
@@ -1,36 +1,36 @@
1
- // source: https://at.alicdn.com/t/font_2997782_rtal7ux80t.css
2
-
3
- @font-face {
4
- font-family: "file-types-iconfont"; /* Project id 2997782 */
5
- src: url('//at.alicdn.com/t/font_2997782_rtal7ux80t.woff2?t=1638951976966') format('woff2'),
6
- url('//at.alicdn.com/t/font_2997782_rtal7ux80t.woff?t=1638951976966') format('woff'),
7
- url('//at.alicdn.com/t/font_2997782_rtal7ux80t.ttf?t=1638951976966') format('truetype');
8
- }
9
-
10
- .file-types-iconfont {
11
- font-family: "file-types-iconfont" !important;
12
- font-size: 16px;
13
- font-style: normal;
14
- -webkit-font-smoothing: antialiased;
15
- -moz-osx-font-smoothing: grayscale;
16
- }
17
-
18
- .file-types-icon-folder:before {
19
- content: "\e6e9";
20
- }
21
-
22
- .file-types-icon-text:before {
23
- content: "\e6a7";
24
- }
25
-
26
- .file-types-icon-jsx:before {
27
- content: "\e63b";
28
- }
29
-
30
- .file-types-icon-js:before {
31
- content: "\e618";
32
- }
33
-
34
- .file-types-icon-json:before {
35
- content: "\e642";
36
- }
1
+ // source: https://at.alicdn.com/t/font_2997782_rtal7ux80t.css
2
+
3
+ @font-face {
4
+ font-family: "file-types-iconfont"; /* Project id 2997782 */
5
+ src: url('//at.alicdn.com/t/font_2997782_rtal7ux80t.woff2?t=1638951976966') format('woff2'),
6
+ url('//at.alicdn.com/t/font_2997782_rtal7ux80t.woff?t=1638951976966') format('woff'),
7
+ url('//at.alicdn.com/t/font_2997782_rtal7ux80t.ttf?t=1638951976966') format('truetype');
8
+ }
9
+
10
+ .file-types-iconfont {
11
+ font-family: "file-types-iconfont" !important;
12
+ font-size: 16px;
13
+ font-style: normal;
14
+ -webkit-font-smoothing: antialiased;
15
+ -moz-osx-font-smoothing: grayscale;
16
+ }
17
+
18
+ .file-types-icon-folder:before {
19
+ content: "\e6e9";
20
+ }
21
+
22
+ .file-types-icon-text:before {
23
+ content: "\e6a7";
24
+ }
25
+
26
+ .file-types-icon-jsx:before {
27
+ content: "\e63b";
28
+ }
29
+
30
+ .file-types-icon-js:before {
31
+ content: "\e618";
32
+ }
33
+
34
+ .file-types-icon-json:before {
35
+ content: "\e642";
36
+ }
@@ -1,24 +1,24 @@
1
- .code-gen-sources-view {
2
- height: 100%;
3
- .sources-panes {
4
- display: flex;
5
- flex-direction: row;
6
- height: 100%;
7
- }
8
- .file-tree-pane {
9
- width: 230px;
10
- overflow-y: auto;
11
- height: 100%;
12
- border-right: 1px solid #e0e0e0;
13
- .file-types-iconfont {
14
- font-size: 12px;
15
- margin-right: 4px;
16
- margin-left: -10px;
17
- }
18
- }
19
- .source-code-pane {
20
- flex: 1;
21
- overflow-y: auto;
22
- height: 100%;
23
- }
24
- }
1
+ .code-gen-sources-view {
2
+ height: 100%;
3
+ .sources-panes {
4
+ display: flex;
5
+ flex-direction: row;
6
+ height: 100%;
7
+ }
8
+ .file-tree-pane {
9
+ width: 230px;
10
+ overflow-y: auto;
11
+ height: 100%;
12
+ border-right: 1px solid #e0e0e0;
13
+ .file-types-iconfont {
14
+ font-size: 12px;
15
+ margin-right: 4px;
16
+ margin-left: -10px;
17
+ }
18
+ }
19
+ .source-code-pane {
20
+ flex: 1;
21
+ overflow-y: auto;
22
+ height: 100%;
23
+ }
24
+ }
@@ -1,56 +1,56 @@
1
- body {
2
- font-family: PingFangSC-Regular, Roboto, Helvetica Neue, Helvetica, Tahoma, Arial, PingFang SC-Light, Microsoft YaHei;
3
- font-size: 12px;
4
- * {
5
- box-sizing: border-box;
6
- }
7
- }
8
-
9
- body,
10
- #lce-container {
11
- position: fixed;
12
- left: 0;
13
- right: 0;
14
- bottom: 0;
15
- top: 0;
16
- box-sizing: border-box;
17
- padding: 0;
18
- margin: 0;
19
- overflow: hidden;
20
- text-rendering: optimizeLegibility;
21
- -webkit-user-select: none;
22
- -webkit-user-drag: none;
23
- -webkit-text-size-adjust: none;
24
- -webkit-touch-callout: none;
25
- -webkit-font-smoothing: antialiased;
26
- #engine {
27
- width: 100%;
28
- height: 100%;
29
- }
30
- }
31
-
32
- html {
33
- min-width: 1024px;
34
- }
35
-
36
- .save-sample {
37
- width: 80px;
38
- height: 30px;
39
- background-color: #5584ff;
40
- border: none;
41
- outline: none;
42
- border-radius: 4px;
43
- color: white;
44
- cursor: pointer;
45
- }
46
-
47
- .load-assets {
48
- width: 100px;
49
- height: 30px;
50
- background-color: #5584ff;
51
- border: none;
52
- outline: none;
53
- border-radius: 4px;
54
- color: white;
55
- cursor: pointer;
56
- }
1
+ body {
2
+ font-family: PingFangSC-Regular, Roboto, Helvetica Neue, Helvetica, Tahoma, Arial, PingFang SC-Light, Microsoft YaHei;
3
+ font-size: 12px;
4
+ * {
5
+ box-sizing: border-box;
6
+ }
7
+ }
8
+
9
+ body,
10
+ #lce-container {
11
+ position: fixed;
12
+ left: 0;
13
+ right: 0;
14
+ bottom: 0;
15
+ top: 0;
16
+ box-sizing: border-box;
17
+ padding: 0;
18
+ margin: 0;
19
+ overflow: hidden;
20
+ text-rendering: optimizeLegibility;
21
+ -webkit-user-select: none;
22
+ -webkit-user-drag: none;
23
+ -webkit-text-size-adjust: none;
24
+ -webkit-touch-callout: none;
25
+ -webkit-font-smoothing: antialiased;
26
+ #engine {
27
+ width: 100%;
28
+ height: 100%;
29
+ }
30
+ }
31
+
32
+ html {
33
+ min-width: 1024px;
34
+ }
35
+
36
+ .save-sample {
37
+ width: 80px;
38
+ height: 30px;
39
+ background-color: #5584ff;
40
+ border: none;
41
+ outline: none;
42
+ border-radius: 4px;
43
+ color: white;
44
+ cursor: pointer;
45
+ }
46
+
47
+ .load-assets {
48
+ width: 100px;
49
+ height: 30px;
50
+ background-color: #5584ff;
51
+ border: none;
52
+ outline: none;
53
+ border-radius: 4px;
54
+ color: white;
55
+ cursor: pointer;
56
+ }
package/es/utils/utils.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
2
  import _regeneratorRuntime from "@babel/runtime/regenerator";
3
- /**
4
- * 从缓存获取ResourceList
5
- * @param scenarioName
3
+ /**
4
+ * 从缓存获取ResourceList
5
+ * @param scenarioName
6
6
  */
7
7
  export var getResourceListFromLocalStorage = /*#__PURE__*/function () {
8
8
  var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(scenarioName) {
@@ -28,10 +28,10 @@ export var getResourceListFromLocalStorage = /*#__PURE__*/function () {
28
28
  };
29
29
  }();
30
30
 
31
- /**
32
- * 根据ResourceList获取所有schema
33
- * @param scenarioName
34
- * @param ResourceList
31
+ /**
32
+ * 根据ResourceList获取所有schema
33
+ * @param scenarioName
34
+ * @param ResourceList
35
35
  */
36
36
  export var getAllSchemaByResourceList = /*#__PURE__*/function () {
37
37
  var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(scenarioName, ResourceList) {
@@ -46,10 +46,7 @@ export var getAllSchemaByResourceList = /*#__PURE__*/function () {
46
46
  return _context2.abrupt("return");
47
47
  case 3:
48
48
  return _context2.abrupt("return", ResourceList.map(function (item) {
49
- console.log('ResourceList.map', item);
50
- console.log('getLSName(scenarioName, item.id)', getLSName(scenarioName, item.id));
51
49
  var localSchema = window.localStorage.getItem(getLSName(scenarioName, item.id)) || '{}';
52
- console.log('localSchema', localSchema);
53
50
  return JSON.parse(localSchema);
54
51
  }));
55
52
  case 4:
@@ -69,18 +66,18 @@ export var getResourceName = function getResourceName(scenarioName, ns) {
69
66
  return scenarioName + ":" + ns;
70
67
  };
71
68
 
72
- /**
73
- * 获取项目id
69
+ /**
70
+ * 获取项目id
74
71
  */
75
72
  export function getProjectId() {
76
73
  return getValueFromQueryByName('projectId', 'general');
77
74
  }
78
75
 
79
- /**
80
- * 获取地址栏参数值
81
- * @param queryName
82
- * @param defaultValue
83
- * @returns {string}
76
+ /**
77
+ * 获取地址栏参数值
78
+ * @param queryName
79
+ * @param defaultValue
80
+ * @returns {string}
84
81
  */
85
82
  export function getValueFromQueryByName(queryName, defaultValue) {
86
83
  if (defaultValue === void 0) {