@tmagic/editor 1.0.2 → 1.0.5
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/dist/types/src/Editor.vue.d.ts +2 -1
- package/dist/types/src/components/Icon.vue.d.ts +2 -1
- package/dist/types/src/components/ScrollViewer.vue.d.ts +2 -1
- package/dist/types/src/fields/Code.vue.d.ts +2 -1
- package/dist/types/src/fields/CodeLink.vue.d.ts +3 -1
- package/dist/types/src/layouts/AddPageBox.vue.d.ts +1 -1
- package/dist/types/src/layouts/CodeEditor.vue.d.ts +2 -1
- package/dist/types/src/layouts/Framework.vue.d.ts +2 -1
- package/dist/types/src/layouts/NavMenu.vue.d.ts +3 -1
- package/dist/types/src/layouts/PropsPanel.vue.d.ts +2 -1
- package/dist/types/src/layouts/Resizer.vue.d.ts +2 -1
- package/dist/types/src/layouts/sidebar/ComponentListPanel.vue.d.ts +2 -1
- package/dist/types/src/layouts/sidebar/Sidebar.vue.d.ts +3 -1
- package/dist/types/src/layouts/sidebar/TabPane.vue.d.ts +3 -1
- package/dist/types/src/layouts/workspace/Workspace.vue.d.ts +2 -1
- package/dist/types/src/services/history.d.ts +1 -1
- package/package.json +13 -14
- package/src/Editor.vue +16 -4
- package/src/layouts/AddPageBox.vue +1 -1
- 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/src/services/history.ts +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes
|
|
1
|
+
import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
|
|
2
|
+
import { PropType } from 'vue';
|
|
2
3
|
import type { FormConfig } from '@tmagic/form';
|
|
3
4
|
import type { MApp, MNode } from '@tmagic/schema';
|
|
4
5
|
import type StageCore from '@tmagic/stage';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { DefineComponent, ComputedOptions, MethodOptions, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes
|
|
1
|
+
import type { DefineComponent, ComputedOptions, MethodOptions, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
|
|
2
|
+
import { Component, PropType, toRaw } from 'vue';
|
|
2
3
|
declare const _default: DefineComponent<{
|
|
3
4
|
icon: {
|
|
4
5
|
type: PropType<string | Component<any, any, any, ComputedOptions, MethodOptions>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Ref, ComputedRef } from '@vue/reactivity';
|
|
2
|
+
import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
|
|
2
3
|
declare const _default: DefineComponent<{
|
|
3
4
|
width: NumberConstructor;
|
|
4
5
|
height: NumberConstructor;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComputedRef } from '@vue/reactivity';
|
|
2
|
+
import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
|
|
2
3
|
declare const _default: DefineComponent<Readonly<{
|
|
3
4
|
name?: any;
|
|
4
5
|
config?: any;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Ref, ComputedRef } from '@vue/reactivity';
|
|
2
|
+
import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
|
|
3
|
+
import { PropType } from 'vue';
|
|
2
4
|
interface CodeLinkConfig {
|
|
3
5
|
type: 'code-link';
|
|
4
6
|
name: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DefineComponent, ComponentOptionsMixin, EmitsOptions, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from 'vue';
|
|
1
|
+
import type { DefineComponent, ComponentOptionsMixin, EmitsOptions, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
|
|
2
2
|
declare const _default: DefineComponent<{}, {
|
|
3
3
|
clickHandler(): void;
|
|
4
4
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, EmitsOptions, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<{}>>, {}>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Ref } from '@vue/reactivity';
|
|
2
|
+
import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
|
|
2
3
|
import * as monaco from 'monaco-editor';
|
|
3
4
|
declare const _default: DefineComponent<{
|
|
4
5
|
initValues: {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComputedRef } from '@vue/reactivity';
|
|
2
|
+
import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
|
|
2
3
|
import type { MApp } from '@tmagic/schema';
|
|
3
4
|
import { GetColumnWidth } from '../type';
|
|
4
5
|
declare const _default: DefineComponent<{
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComputedRef } from '@vue/reactivity';
|
|
2
|
+
import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
|
|
3
|
+
import { PropType } from 'vue';
|
|
2
4
|
import { GetColumnWidth, MenuBarData } from '../type';
|
|
3
5
|
declare const _default: DefineComponent<{
|
|
4
6
|
data: {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Ref, ComputedRef } from '@vue/reactivity';
|
|
2
|
+
import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
|
|
2
3
|
import type { FormValue } from '@tmagic/form';
|
|
3
4
|
declare const _default: DefineComponent<{}, {
|
|
4
5
|
values: Ref<FormValue>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Ref } from '@vue/reactivity';
|
|
2
|
+
import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
|
|
2
3
|
declare const _default: DefineComponent<{
|
|
3
4
|
type: {
|
|
4
5
|
type: StringConstructor;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Ref, ComputedRef } from '@vue/reactivity';
|
|
2
|
+
import type { DefineComponent, ComponentOptionsMixin, EmitsOptions, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
|
|
2
3
|
import type { ComponentItem } from '../../type';
|
|
3
4
|
declare const _default: DefineComponent<{}, {
|
|
4
5
|
searchText: Ref<string>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Ref } from '@vue/reactivity';
|
|
2
|
+
import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
|
|
3
|
+
import { PropType } from 'vue';
|
|
2
4
|
import { SideBarData } from '../../type';
|
|
3
5
|
declare const _default: DefineComponent<{
|
|
4
6
|
data: {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComputedRef } from '@vue/reactivity';
|
|
2
|
+
import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
|
|
3
|
+
import { PropType } from 'vue';
|
|
2
4
|
import { SideComponent, SideItem } from '../../type';
|
|
3
5
|
declare const _default: DefineComponent<{
|
|
4
6
|
data: {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Ref, ComputedRef } from '@vue/reactivity';
|
|
2
|
+
import type { DefineComponent, ComponentOptionsMixin, EmitsOptions, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
|
|
2
3
|
import type { MPage } from '@tmagic/schema';
|
|
3
4
|
declare const _default: DefineComponent<{}, {
|
|
4
5
|
workspace: Ref<HTMLDivElement | undefined>;
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.0.
|
|
2
|
+
"version": "1.0.5",
|
|
3
3
|
"name": "@tmagic/editor",
|
|
4
4
|
"sideEffects": [
|
|
5
5
|
"dist/*",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"license": "Apache-2.0",
|
|
24
24
|
"scripts": {
|
|
25
|
-
"build": "vite build"
|
|
25
|
+
"build": "vue-tsc --noEmit && vite build"
|
|
26
26
|
},
|
|
27
27
|
"engines": {
|
|
28
28
|
"node": ">=14"
|
|
@@ -43,14 +43,14 @@
|
|
|
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.5",
|
|
47
|
+
"@tmagic/form": "1.0.5",
|
|
48
|
+
"@tmagic/schema": "1.0.5",
|
|
49
|
+
"@tmagic/stage": "1.0.5",
|
|
50
|
+
"@tmagic/utils": "1.0.5",
|
|
51
51
|
"buffer": "^6.0.3",
|
|
52
52
|
"color": "^3.1.3",
|
|
53
|
-
"element-plus": "^2.2.
|
|
53
|
+
"element-plus": "^2.2.6",
|
|
54
54
|
"events": "^3.3.0",
|
|
55
55
|
"gesto": "^1.7.0",
|
|
56
56
|
"keycon": "^1.1.2",
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"vue": "^3.2.0"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"@tmagic/form": "1.0.
|
|
64
|
-
"element-plus": "^2.2.
|
|
63
|
+
"@tmagic/form": "1.0.5",
|
|
64
|
+
"element-plus": "^2.2.6",
|
|
65
65
|
"monaco-editor": "^0.32.1",
|
|
66
66
|
"vue": "^3.2.0"
|
|
67
67
|
},
|
|
@@ -70,14 +70,13 @@
|
|
|
70
70
|
"@types/lodash-es": "^4.17.4",
|
|
71
71
|
"@types/node": "^15.12.4",
|
|
72
72
|
"@types/serialize-javascript": "^5.0.1",
|
|
73
|
-
"@vitejs/plugin-vue": "^
|
|
74
|
-
"@vitejs/plugin-vue-jsx": "^1.1.6",
|
|
73
|
+
"@vitejs/plugin-vue": "^2.3.3",
|
|
75
74
|
"@vue/compiler-sfc": "^3.2.0",
|
|
76
75
|
"@vue/test-utils": "^2.0.0",
|
|
77
76
|
"sass": "^1.35.1",
|
|
78
77
|
"typescript": "^4.3.4",
|
|
79
|
-
"vite": "^2.
|
|
78
|
+
"vite": "^2.9.13",
|
|
80
79
|
"vite-plugin-dts": "^0.9.6",
|
|
81
|
-
"vue-tsc": "^0.
|
|
80
|
+
"vue-tsc": "^0.38.2"
|
|
82
81
|
}
|
|
83
82
|
}
|
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
|
|
|
@@ -17,7 +17,7 @@ import { Plus } from '@element-plus/icons';
|
|
|
17
17
|
|
|
18
18
|
import { NodeType } from '@tmagic/schema';
|
|
19
19
|
|
|
20
|
-
import { Services } from '@editor/type';
|
|
20
|
+
import type { Services } from '@editor/type';
|
|
21
21
|
import { generatePageNameByApp } from '@editor/utils';
|
|
22
22
|
|
|
23
23
|
export default defineComponent({
|
|
@@ -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>
|