@tmagic/editor 1.2.0-beta.14 → 1.2.0-beta.15

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.
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.2.0-beta.14",
2
+ "version": "1.2.0-beta.15",
3
3
  "name": "@tmagic/editor",
4
4
  "sideEffects": [
5
5
  "dist/*",
@@ -45,12 +45,12 @@
45
45
  "dependencies": {
46
46
  "@babel/core": "^7.18.0",
47
47
  "@element-plus/icons-vue": "^2.0.9",
48
- "@tmagic/core": "1.2.0-beta.14",
49
- "@tmagic/design": "1.2.0-beta.14",
50
- "@tmagic/form": "1.2.0-beta.14",
51
- "@tmagic/schema": "1.2.0-beta.14",
52
- "@tmagic/stage": "1.2.0-beta.14",
53
- "@tmagic/utils": "1.2.0-beta.14",
48
+ "@tmagic/core": "1.2.0-beta.15",
49
+ "@tmagic/design": "1.2.0-beta.15",
50
+ "@tmagic/form": "1.2.0-beta.15",
51
+ "@tmagic/schema": "1.2.0-beta.15",
52
+ "@tmagic/stage": "1.2.0-beta.15",
53
+ "@tmagic/utils": "1.2.0-beta.15",
54
54
  "buffer": "^6.0.3",
55
55
  "color": "^3.1.3",
56
56
  "events": "^3.3.0",
@@ -62,8 +62,8 @@
62
62
  "vue": "^3.2.37"
63
63
  },
64
64
  "peerDependencies": {
65
- "@tmagic/design": "1.2.0-beta.14",
66
- "@tmagic/form": "1.2.0-beta.14",
65
+ "@tmagic/design": "1.2.0-beta.15",
66
+ "@tmagic/form": "1.2.0-beta.15",
67
67
  "monaco-editor": "^0.34.0",
68
68
  "vue": "^3.2.37"
69
69
  },
@@ -23,6 +23,7 @@
23
23
  :default-expanded-keys="defaultExpandedKeys"
24
24
  :load="loadItems"
25
25
  :data="values"
26
+ :default-expand-all="true"
26
27
  :expand-on-click-node="false"
27
28
  :highlight-current="true"
28
29
  :props="{
@@ -164,7 +164,7 @@ const createCodeBlock = async () => {
164
164
  }
165
165
  const codeConfig: CodeBlockContent = {
166
166
  name: '代码块',
167
- content: `() => {\n // place your code here\n}`,
167
+ content: `({app, params}) => {\n // place your code here\n}`,
168
168
  params: [],
169
169
  };
170
170
  await codeBlockService.setMode(CodeEditorMode.EDITOR);
@@ -106,13 +106,17 @@ class CodeBlock extends BaseService {
106
106
  */
107
107
  public async setCodeDslById(id: Id, codeConfig: CodeBlockContent): Promise<void> {
108
108
  let codeDsl = await this.getCodeDsl();
109
+ const codeConfigProcessed = codeConfig;
110
+ if (codeConfig.content) {
111
+ // 在保存的时候转换代码内容
112
+ // eslint-disable-next-line no-eval
113
+ codeConfigProcessed.content = eval(codeConfig.content);
114
+ }
109
115
  if (!codeDsl) {
110
116
  // dsl中无代码块字段
111
117
  codeDsl = {
112
118
  [id]: {
113
- ...codeConfig,
114
- // eslint-disable-next-line no-eval
115
- content: eval(codeConfig.content),
119
+ ...codeConfigProcessed,
116
120
  },
117
121
  };
118
122
  } else {
@@ -121,9 +125,7 @@ class CodeBlock extends BaseService {
121
125
  ...codeDsl,
122
126
  [id]: {
123
127
  ...existContent,
124
- ...codeConfig,
125
- // eslint-disable-next-line no-eval
126
- content: eval(codeConfig.content),
128
+ ...codeConfigProcessed,
127
129
  },
128
130
  };
129
131
  }
@@ -35,9 +35,7 @@
35
35
  display: flex;
36
36
  align-items: center;
37
37
  .right-tool {
38
- position: absolute;
39
- right: 15px;
40
- padding-left: 5px;
38
+ width: fit-content !important;
41
39
  display: flex;
42
40
  align-items: center;
43
41
  .edit-icon {
@@ -50,7 +48,8 @@
50
48
  white-space: nowrap;
51
49
  text-overflow: ellipsis;
52
50
  padding: 10px 15px;
53
- margin-right: 60px;
51
+ width: 0 !important;
52
+ flex: 1;
54
53
  }
55
54
  }
56
55
  .code-comp-map-wrapper {