@tmagic/editor 1.3.0-alpha.14 → 1.3.0-alpha.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/tmagic-editor.js +10 -2
- package/dist/tmagic-editor.js.map +1 -1
- package/dist/tmagic-editor.umd.cjs +10 -2
- package/dist/tmagic-editor.umd.cjs.map +1 -1
- package/package.json +10 -10
- package/src/layouts/sidebar/LayerPanel.vue +1 -1
- package/src/layouts/sidebar/code-block/CodeBlockListPanel.vue +5 -6
- package/src/services/editor.ts +1 -1
- package/types/layouts/sidebar/code-block/CodeBlockListPanel.vue.d.ts +4 -0
- package/types/services/editor.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.3.0-alpha.
|
|
2
|
+
"version": "1.3.0-alpha.15",
|
|
3
3
|
"name": "@tmagic/editor",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": [
|
|
@@ -46,13 +46,13 @@
|
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@babel/core": "^7.18.0",
|
|
48
48
|
"@element-plus/icons-vue": "^2.0.9",
|
|
49
|
-
"@tmagic/core": "1.3.0-alpha.
|
|
50
|
-
"@tmagic/design": "1.3.0-alpha.
|
|
51
|
-
"@tmagic/form": "1.3.0-alpha.
|
|
52
|
-
"@tmagic/schema": "1.3.0-alpha.
|
|
53
|
-
"@tmagic/stage": "1.3.0-alpha.
|
|
54
|
-
"@tmagic/table": "1.3.0-alpha.
|
|
55
|
-
"@tmagic/utils": "1.3.0-alpha.
|
|
49
|
+
"@tmagic/core": "1.3.0-alpha.15",
|
|
50
|
+
"@tmagic/design": "1.3.0-alpha.15",
|
|
51
|
+
"@tmagic/form": "1.3.0-alpha.15",
|
|
52
|
+
"@tmagic/schema": "1.3.0-alpha.15",
|
|
53
|
+
"@tmagic/stage": "1.3.0-alpha.15",
|
|
54
|
+
"@tmagic/table": "1.3.0-alpha.15",
|
|
55
|
+
"@tmagic/utils": "1.3.0-alpha.15",
|
|
56
56
|
"buffer": "^6.0.3",
|
|
57
57
|
"color": "^3.1.3",
|
|
58
58
|
"events": "^3.3.0",
|
|
@@ -64,8 +64,8 @@
|
|
|
64
64
|
"vue": "^3.3.4"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
|
-
"@tmagic/design": "1.3.0-alpha.
|
|
68
|
-
"@tmagic/form": "1.3.0-alpha.
|
|
67
|
+
"@tmagic/design": "1.3.0-alpha.15",
|
|
68
|
+
"@tmagic/form": "1.3.0-alpha.15",
|
|
69
69
|
"monaco-editor": "^0.39.0",
|
|
70
70
|
"vue": "^3.3.4"
|
|
71
71
|
},
|
|
@@ -156,7 +156,7 @@ const handleDragEnd = async (e: any) => {
|
|
|
156
156
|
if (!tree.value) return;
|
|
157
157
|
const { data: node } = e;
|
|
158
158
|
const parent = editorService?.getParentById(node.id, false) as MContainer;
|
|
159
|
-
const layout = await editorService?.getLayout(parent);
|
|
159
|
+
const layout = await editorService?.getLayout(parent, node);
|
|
160
160
|
node.style.position = layout;
|
|
161
161
|
if (layout === Layout.RELATIVE) {
|
|
162
162
|
node.style.top = 0;
|
|
@@ -10,12 +10,11 @@
|
|
|
10
10
|
</slot>
|
|
11
11
|
|
|
12
12
|
<!-- 代码块列表 -->
|
|
13
|
-
<CodeBlockList
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
></CodeBlockList>
|
|
13
|
+
<CodeBlockList ref="codeBlockList" :custom-error="customError" @edit="editCode" @remove="deleteCode">
|
|
14
|
+
<template #code-block-panel-tool="{ id, data }">
|
|
15
|
+
<slot name="code-block-panel-tool" :id="id" :data="data"></slot>
|
|
16
|
+
</template>
|
|
17
|
+
</CodeBlockList>
|
|
19
18
|
|
|
20
19
|
<!-- 代码块编辑区 -->
|
|
21
20
|
<CodeBlockEditor
|
package/src/services/editor.ts
CHANGED
|
@@ -193,7 +193,7 @@ class Editor extends BaseService {
|
|
|
193
193
|
/**
|
|
194
194
|
* 只有容器拥有布局
|
|
195
195
|
*/
|
|
196
|
-
public async getLayout(parent: MNode, node?: MNode): Promise<Layout> {
|
|
196
|
+
public async getLayout(parent: MNode, node?: MNode | null): Promise<Layout> {
|
|
197
197
|
if (node && typeof node !== 'function' && isFixed(node)) return Layout.FIXED;
|
|
198
198
|
|
|
199
199
|
if (parent.layout) {
|
|
@@ -6,6 +6,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
6
6
|
customError?: ((id: Id, errorType: CodeDeleteErrorType) => any) | undefined;
|
|
7
7
|
}>>>, {}, {}>, {
|
|
8
8
|
"code-block-panel-header"?(_: {}): any;
|
|
9
|
+
"code-block-panel-tool"?(_: {
|
|
10
|
+
id: any;
|
|
11
|
+
data: any;
|
|
12
|
+
}): any;
|
|
9
13
|
}>;
|
|
10
14
|
export default _default;
|
|
11
15
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
@@ -42,7 +42,7 @@ declare class Editor extends BaseService {
|
|
|
42
42
|
/**
|
|
43
43
|
* 只有容器拥有布局
|
|
44
44
|
*/
|
|
45
|
-
getLayout(parent: MNode, node?: MNode): Promise<Layout>;
|
|
45
|
+
getLayout(parent: MNode, node?: MNode | null): Promise<Layout>;
|
|
46
46
|
/**
|
|
47
47
|
* 选中指定节点(将指定节点设置成当前选中状态)
|
|
48
48
|
* @param config 指定节点配置或者ID
|