@tmagic/editor 1.0.3 → 1.0.6
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.es.js +76 -32
- package/dist/tmagic-editor.es.js.map +1 -1
- package/dist/tmagic-editor.umd.js +76 -32
- package/dist/tmagic-editor.umd.js.map +1 -1
- package/package.json +7 -7
- package/src/Editor.vue +16 -4
- package/src/layouts/Framework.vue +1 -1
- package/src/layouts/PropsPanel.vue +12 -9
- package/src/layouts/sidebar/ComponentListPanel.vue +2 -0
- package/src/layouts/sidebar/LayerPanel.vue +2 -0
- package/src/layouts/sidebar/Sidebar.vue +9 -1
- package/src/layouts/sidebar/TabPane.vue +10 -0
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.0.
|
|
2
|
+
"version": "1.0.6",
|
|
3
3
|
"name": "@tmagic/editor",
|
|
4
4
|
"sideEffects": [
|
|
5
5
|
"dist/*",
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@babel/core": "^7.18.0",
|
|
45
45
|
"@element-plus/icons": "0.0.11",
|
|
46
|
-
"@tmagic/core": "1.0.
|
|
47
|
-
"@tmagic/form": "1.0.
|
|
48
|
-
"@tmagic/schema": "1.0.
|
|
49
|
-
"@tmagic/stage": "1.0.
|
|
50
|
-
"@tmagic/utils": "1.0.
|
|
46
|
+
"@tmagic/core": "1.0.6",
|
|
47
|
+
"@tmagic/form": "1.0.6",
|
|
48
|
+
"@tmagic/schema": "1.0.6",
|
|
49
|
+
"@tmagic/stage": "1.0.6",
|
|
50
|
+
"@tmagic/utils": "1.0.6",
|
|
51
51
|
"buffer": "^6.0.3",
|
|
52
52
|
"color": "^3.1.3",
|
|
53
53
|
"element-plus": "^2.2.6",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"vue": "^3.2.0"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"@tmagic/form": "1.0.
|
|
63
|
+
"@tmagic/form": "1.0.6",
|
|
64
64
|
"element-plus": "^2.2.6",
|
|
65
65
|
"monaco-editor": "^0.32.1",
|
|
66
66
|
"vue": "^3.2.0"
|
package/src/Editor.vue
CHANGED
|
@@ -6,7 +6,15 @@
|
|
|
6
6
|
|
|
7
7
|
<template #sidebar>
|
|
8
8
|
<slot name="sidebar" :editorService="editorService">
|
|
9
|
-
<sidebar :data="sidebar"
|
|
9
|
+
<sidebar :data="sidebar">
|
|
10
|
+
<template #layer-panel-header>
|
|
11
|
+
<slot name="layer-panel-header"></slot>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<template #component-list-panel-header>
|
|
15
|
+
<slot name="component-list-panel-header"></slot>
|
|
16
|
+
</template>
|
|
17
|
+
</sidebar>
|
|
10
18
|
</slot>
|
|
11
19
|
</template>
|
|
12
20
|
|
|
@@ -20,9 +28,13 @@
|
|
|
20
28
|
</slot>
|
|
21
29
|
</template>
|
|
22
30
|
|
|
23
|
-
<template #
|
|
24
|
-
<slot name="
|
|
25
|
-
<props-panel ref="propsPanel" @mounted="(instance) => $emit('props-panel-mounted', instance)"
|
|
31
|
+
<template #props-panel>
|
|
32
|
+
<slot name="props-panel">
|
|
33
|
+
<props-panel ref="propsPanel" @mounted="(instance) => $emit('props-panel-mounted', instance)">
|
|
34
|
+
<template #props-panel-header>
|
|
35
|
+
<slot name="props-panel-header"></slot>
|
|
36
|
+
</template>
|
|
37
|
+
</props-panel>
|
|
26
38
|
</slot>
|
|
27
39
|
</template>
|
|
28
40
|
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<m-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
<div class="`m-editor-props-panel">
|
|
3
|
+
<slot name="props-panel-header"></slot>
|
|
4
|
+
<m-form
|
|
5
|
+
:class="`m-editor-props-panel ${propsPanelSize}`"
|
|
6
|
+
:popper-class="`m-editor-props-panel-popper ${propsPanelSize}`"
|
|
7
|
+
ref="configForm"
|
|
8
|
+
:size="propsPanelSize"
|
|
9
|
+
:init-values="values"
|
|
10
|
+
:config="curFormConfig"
|
|
11
|
+
@change="submit"
|
|
12
|
+
></m-form>
|
|
13
|
+
</div>
|
|
11
14
|
</template>
|
|
12
15
|
|
|
13
16
|
<script lang="ts">
|
|
@@ -6,7 +6,15 @@
|
|
|
6
6
|
type="card"
|
|
7
7
|
tab-position="left"
|
|
8
8
|
>
|
|
9
|
-
<tab-pane v-for="(item, index) in data.items" :key="index" :data="item"
|
|
9
|
+
<tab-pane v-for="(item, index) in data.items" :key="index" :data="item">
|
|
10
|
+
<template #layer-panel-header v-if="item === 'layer'">
|
|
11
|
+
<slot name="layer-panel-header"></slot>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<template #component-list-panel-header v-if="item === 'component-list'">
|
|
15
|
+
<slot name="component-list-panel-header"></slot>
|
|
16
|
+
</template>
|
|
17
|
+
</tab-pane>
|
|
10
18
|
</el-tabs>
|
|
11
19
|
</template>
|
|
12
20
|
|
|
@@ -8,6 +8,16 @@
|
|
|
8
8
|
</template>
|
|
9
9
|
|
|
10
10
|
<component :is="config.component" v-bind="config.props || {}" v-on="config?.listeners || {}">
|
|
11
|
+
<template #component-list-panel-header v-if="data === 'component-list' || config.slots?.componentListPanelHeader">
|
|
12
|
+
<slot v-if="data === 'component-list'" name="component-list-panel-header"></slot>
|
|
13
|
+
<component v-else-if="config.slots?.componentListPanelHeader" :is="config.slots.componentListPanelHeader" />
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<template #layer-panel-header v-if="data === 'layer' || config.slots?.layerPanelHeader">
|
|
17
|
+
<slot v-if="data === 'layer'" name="layer-panel-header"></slot>
|
|
18
|
+
<component v-else-if="config.slots?.layerPanelHeader" :is="config.slots.layerPanelHeader" />
|
|
19
|
+
</template>
|
|
20
|
+
|
|
11
21
|
<template #layer-node-content="{ data, node }" v-if="config.slots?.layerNodeContent">
|
|
12
22
|
<component :is="config.slots?.layerNodeContent" :data="data" :node="node" />
|
|
13
23
|
</template>
|