@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/dist/style.css +3 -4
- package/dist/tmagic-editor.mjs +8 -5
- package/dist/tmagic-editor.mjs.map +1 -1
- package/dist/tmagic-editor.umd.js +8 -5
- package/dist/tmagic-editor.umd.js.map +1 -1
- package/package.json +9 -9
- package/src/layouts/sidebar/LayerPanel.vue +1 -0
- package/src/layouts/sidebar/code-block/CodeBlockList.vue +1 -1
- package/src/services/codeBlock.ts +8 -6
- package/src/theme/code-block.scss +3 -4
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.2.0-beta.
|
|
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.
|
|
49
|
-
"@tmagic/design": "1.2.0-beta.
|
|
50
|
-
"@tmagic/form": "1.2.0-beta.
|
|
51
|
-
"@tmagic/schema": "1.2.0-beta.
|
|
52
|
-
"@tmagic/stage": "1.2.0-beta.
|
|
53
|
-
"@tmagic/utils": "1.2.0-beta.
|
|
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.
|
|
66
|
-
"@tmagic/form": "1.2.0-beta.
|
|
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
|
},
|
|
@@ -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
|
-
...
|
|
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
|
-
...
|
|
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
|
-
|
|
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
|
-
|
|
51
|
+
width: 0 !important;
|
|
52
|
+
flex: 1;
|
|
54
53
|
}
|
|
55
54
|
}
|
|
56
55
|
.code-comp-map-wrapper {
|