@tmagic/editor 1.3.0-alpha.2 → 1.3.0-alpha.3
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 +797 -514
- package/dist/tmagic-editor.js.map +1 -1
- package/dist/tmagic-editor.umd.cjs +798 -514
- package/dist/tmagic-editor.umd.cjs.map +1 -1
- package/package.json +17 -18
- package/src/Editor.vue +1 -1
- package/src/components/CodeDraftEditor.vue +5 -1
- package/src/components/ContentMenu.vue +5 -1
- package/src/components/FunctionEditor.vue +6 -1
- package/src/components/Icon.vue +5 -1
- package/src/components/Layout.vue +5 -1
- package/src/components/ScrollBar.vue +5 -1
- package/src/components/ScrollViewer.vue +5 -1
- package/src/components/SearchInput.vue +4 -0
- package/src/components/ToolButton.vue +5 -1
- package/src/fields/Code.vue +5 -1
- package/src/fields/CodeLink.vue +5 -1
- package/src/fields/CodeSelect.vue +6 -2
- package/src/fields/CodeSelectCol.vue +6 -2
- package/src/fields/DataSourceFields.vue +4 -0
- package/src/fields/DataSourceInput.vue +357 -0
- package/src/fields/EventSelect.vue +8 -3
- package/src/fields/KeyValue.vue +4 -0
- package/src/fields/UISelect.vue +5 -1
- package/src/icons/AppManageIcon.vue +5 -1
- package/src/icons/CodeIcon.vue +5 -1
- package/src/index.ts +3 -0
- package/src/layouts/AddPageBox.vue +5 -1
- package/src/layouts/CodeEditor.vue +5 -1
- package/src/layouts/Framework.vue +5 -1
- package/src/layouts/NavMenu.vue +5 -1
- package/src/layouts/PropsPanel.vue +5 -1
- package/src/layouts/Resizer.vue +5 -1
- package/src/layouts/sidebar/ComponentListPanel.vue +5 -1
- package/src/layouts/sidebar/LayerMenu.vue +5 -1
- package/src/layouts/sidebar/LayerPanel.vue +5 -1
- package/src/layouts/sidebar/Sidebar.vue +11 -7
- package/src/layouts/sidebar/code-block/CodeBlockEditor.vue +5 -1
- package/src/layouts/sidebar/code-block/CodeBlockList.vue +5 -1
- package/src/layouts/sidebar/data-source/DataSourceConfigPanel.vue +4 -0
- package/src/layouts/sidebar/data-source/DataSourceListPanel.vue +4 -0
- package/src/layouts/workspace/Breadcrumb.vue +5 -1
- package/src/layouts/workspace/PageBar.vue +5 -1
- package/src/layouts/workspace/PageBarScrollContainer.vue +5 -1
- package/src/layouts/workspace/Stage.vue +5 -1
- package/src/layouts/workspace/ViewerMenu.vue +5 -1
- package/src/layouts/workspace/Workspace.vue +5 -1
- package/types/Editor.vue.d.ts +1 -1
- package/types/components/CodeDraftEditor.vue.d.ts +6 -3
- package/types/components/ContentMenu.vue.d.ts +8 -5
- package/types/components/FunctionEditor.vue.d.ts +66 -45
- package/types/components/Icon.vue.d.ts +2 -2
- package/types/components/Layout.vue.d.ts +9 -6
- package/types/components/ScrollBar.vue.d.ts +1 -1
- package/types/components/ScrollViewer.vue.d.ts +8 -5
- package/types/components/SearchInput.vue.d.ts +1 -1
- package/types/components/ToolButton.vue.d.ts +8 -5
- package/types/fields/Code.vue.d.ts +1 -1
- package/types/fields/CodeLink.vue.d.ts +9 -9
- package/types/fields/CodeSelect.vue.d.ts +10 -7
- package/types/fields/CodeSelectCol.vue.d.ts +8 -5
- package/types/fields/DataSourceFields.vue.d.ts +8 -5
- package/types/fields/DataSourceInput.vue.d.ts +54 -0
- package/types/fields/EventSelect.vue.d.ts +3 -3
- package/types/fields/KeyValue.vue.d.ts +8 -5
- package/types/fields/UISelect.vue.d.ts +1 -1
- package/types/icons/AppManageIcon.vue.d.ts +1 -1
- package/types/icons/CodeIcon.vue.d.ts +1 -1
- package/types/index.d.ts +1 -0
- package/types/layouts/AddPageBox.vue.d.ts +1 -1
- package/types/layouts/CodeEditor.vue.d.ts +7 -4
- package/types/layouts/Framework.vue.d.ts +13 -10
- package/types/layouts/NavMenu.vue.d.ts +7 -4
- package/types/layouts/PropsPanel.vue.d.ts +2 -2
- package/types/layouts/Resizer.vue.d.ts +2 -2
- package/types/layouts/sidebar/ComponentListPanel.vue.d.ts +4 -4
- package/types/layouts/sidebar/LayerMenu.vue.d.ts +2 -2
- package/types/layouts/sidebar/LayerPanel.vue.d.ts +5 -5
- package/types/layouts/sidebar/Sidebar.vue.d.ts +18 -15
- package/types/layouts/sidebar/code-block/CodeBlockEditor.vue.d.ts +4 -4
- package/types/layouts/sidebar/code-block/CodeBlockList.vue.d.ts +7 -7
- package/types/layouts/sidebar/data-source/DataSourceConfigPanel.vue.d.ts +1 -1
- package/types/layouts/sidebar/data-source/DataSourceListPanel.vue.d.ts +3 -3
- package/types/layouts/workspace/Breadcrumb.vue.d.ts +1 -1
- package/types/layouts/workspace/PageBar.vue.d.ts +5 -5
- package/types/layouts/workspace/PageBarScrollContainer.vue.d.ts +2 -2
- package/types/layouts/workspace/Stage.vue.d.ts +2 -2
- package/types/layouts/workspace/ViewerMenu.vue.d.ts +7 -4
- package/types/layouts/workspace/Workspace.vue.d.ts +8 -8
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
</div>
|
|
34
34
|
</template>
|
|
35
35
|
|
|
36
|
-
<script lang="ts" setup
|
|
37
|
-
import { computed,
|
|
36
|
+
<script lang="ts" setup>
|
|
37
|
+
import { computed, inject } from 'vue';
|
|
38
38
|
import { Delete } from '@element-plus/icons-vue';
|
|
39
39
|
import { has } from 'lodash-es';
|
|
40
40
|
|
|
@@ -44,7 +44,9 @@ import { ActionType } from '@tmagic/schema';
|
|
|
44
44
|
|
|
45
45
|
import type { EventSelectConfig, Services } from '@editor/type';
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
defineOptions({
|
|
48
|
+
name: 'MEditorEventSelect',
|
|
49
|
+
});
|
|
48
50
|
|
|
49
51
|
const props = defineProps<{
|
|
50
52
|
config: EventSelectConfig;
|
|
@@ -53,8 +55,11 @@ const props = defineProps<{
|
|
|
53
55
|
name: string;
|
|
54
56
|
size: 'small' | 'default' | 'large';
|
|
55
57
|
}>();
|
|
58
|
+
|
|
56
59
|
const emit = defineEmits(['change']);
|
|
57
60
|
|
|
61
|
+
const services = inject<Services>('services');
|
|
62
|
+
|
|
58
63
|
// 事件名称下拉框表单配置
|
|
59
64
|
const eventNameConfig = computed(() => {
|
|
60
65
|
const defaultEventNameConfig = {
|
package/src/fields/KeyValue.vue
CHANGED
package/src/fields/UISelect.vue
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
</div>
|
|
13
13
|
</template>
|
|
14
14
|
|
|
15
|
-
<script lang="ts" setup
|
|
15
|
+
<script lang="ts" setup>
|
|
16
16
|
import { computed, inject, ref } from 'vue';
|
|
17
17
|
import { Close, Delete } from '@element-plus/icons-vue';
|
|
18
18
|
|
|
@@ -21,6 +21,10 @@ import { FormState } from '@tmagic/form';
|
|
|
21
21
|
|
|
22
22
|
import type { Services } from '@editor/type';
|
|
23
23
|
|
|
24
|
+
defineOptions({
|
|
25
|
+
name: 'MEditorUISelect',
|
|
26
|
+
});
|
|
27
|
+
|
|
24
28
|
const props = defineProps<{
|
|
25
29
|
config: any;
|
|
26
30
|
model: any;
|
package/src/icons/CodeIcon.vue
CHANGED
package/src/index.ts
CHANGED
|
@@ -22,6 +22,7 @@ import CodeLink from './fields/CodeLink.vue';
|
|
|
22
22
|
import CodeSelect from './fields/CodeSelect.vue';
|
|
23
23
|
import CodeSelectCol from './fields/CodeSelectCol.vue';
|
|
24
24
|
import DataSourceFields from './fields/DataSourceFields.vue';
|
|
25
|
+
import DataSourceInput from './fields/DataSourceInput.vue';
|
|
25
26
|
import EventSelect from './fields/EventSelect.vue';
|
|
26
27
|
import KeyValue from './fields/KeyValue.vue';
|
|
27
28
|
import uiSelect from './fields/UISelect.vue';
|
|
@@ -51,6 +52,7 @@ export { default as LayerPanel } from './layouts/sidebar/LayerPanel.vue';
|
|
|
51
52
|
export { default as CodeSelect } from './fields/CodeSelect.vue';
|
|
52
53
|
export { default as CodeSelectCol } from './fields/CodeSelectCol.vue';
|
|
53
54
|
export { default as DataSourceFields } from './fields/DataSourceFields.vue';
|
|
55
|
+
export { default as DataSourceInput } from './fields/DataSourceInput.vue';
|
|
54
56
|
export { default as EventSelect } from './fields/EventSelect.vue';
|
|
55
57
|
export { default as KeyValue } from './fields/KeyValue.vue';
|
|
56
58
|
export { default as CodeBlockList } from './layouts/sidebar/code-block/CodeBlockList.vue';
|
|
@@ -81,5 +83,6 @@ export default {
|
|
|
81
83
|
app.component('m-fields-event-select', EventSelect);
|
|
82
84
|
app.component('m-fields-data-source-fields', DataSourceFields);
|
|
83
85
|
app.component('m-fields-key-value', KeyValue);
|
|
86
|
+
app.component('m-fields-data-source-input', DataSourceInput);
|
|
84
87
|
},
|
|
85
88
|
};
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
</div>
|
|
12
12
|
</template>
|
|
13
13
|
|
|
14
|
-
<script lang="ts" setup
|
|
14
|
+
<script lang="ts" setup>
|
|
15
15
|
import { inject, toRaw } from 'vue';
|
|
16
16
|
import { Plus } from '@element-plus/icons-vue';
|
|
17
17
|
|
|
@@ -21,6 +21,10 @@ import MIcon from '@editor/components/Icon.vue';
|
|
|
21
21
|
import type { Services } from '@editor/type';
|
|
22
22
|
import { generatePageNameByApp } from '@editor/utils';
|
|
23
23
|
|
|
24
|
+
defineOptions({
|
|
25
|
+
name: 'MEditorAddPageBox',
|
|
26
|
+
});
|
|
27
|
+
|
|
24
28
|
const services = inject<Services>('services');
|
|
25
29
|
|
|
26
30
|
const clickHandler = () => {
|
|
@@ -2,12 +2,16 @@
|
|
|
2
2
|
<div ref="codeEditor" class="magic-code-editor"></div>
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
|
-
<script lang="ts" setup
|
|
5
|
+
<script lang="ts" setup>
|
|
6
6
|
import { onMounted, onUnmounted, ref, watch } from 'vue';
|
|
7
7
|
import { throttle } from 'lodash-es';
|
|
8
8
|
import * as monaco from 'monaco-editor';
|
|
9
9
|
import serialize from 'serialize-javascript';
|
|
10
10
|
|
|
11
|
+
defineOptions({
|
|
12
|
+
name: 'MEditorCodeEditor',
|
|
13
|
+
});
|
|
14
|
+
|
|
11
15
|
const props = withDefaults(
|
|
12
16
|
defineProps<{
|
|
13
17
|
initValues?: string | Object;
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
</div>
|
|
43
43
|
</template>
|
|
44
44
|
|
|
45
|
-
<script lang="ts" setup
|
|
45
|
+
<script lang="ts" setup>
|
|
46
46
|
import { computed, inject, ref, watch } from 'vue';
|
|
47
47
|
|
|
48
48
|
import { TMagicScrollbar } from '@tmagic/design';
|
|
@@ -52,6 +52,10 @@ import type { GetColumnWidth, Services } from '@editor/type';
|
|
|
52
52
|
|
|
53
53
|
import AddPageBox from './AddPageBox.vue';
|
|
54
54
|
|
|
55
|
+
defineOptions({
|
|
56
|
+
name: 'MEditorFramework',
|
|
57
|
+
});
|
|
58
|
+
|
|
55
59
|
const DEFAULT_LEFT_COLUMN_WIDTH = 310;
|
|
56
60
|
const DEFAULT_RIGHT_COLUMN_WIDTH = 480;
|
|
57
61
|
|
package/src/layouts/NavMenu.vue
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
</div>
|
|
7
7
|
</template>
|
|
8
8
|
|
|
9
|
-
<script lang="ts" setup
|
|
9
|
+
<script lang="ts" setup>
|
|
10
10
|
import { computed, inject, markRaw } from 'vue';
|
|
11
11
|
import { Back, Delete, FullScreen, Grid, Memo, Right, ScaleToOriginal, ZoomIn, ZoomOut } from '@element-plus/icons-vue';
|
|
12
12
|
|
|
@@ -15,6 +15,10 @@ import { NodeType } from '@tmagic/schema';
|
|
|
15
15
|
import ToolButton from '@editor/components/ToolButton.vue';
|
|
16
16
|
import { ColumnLayout, MenuBarData, MenuButton, MenuComponent, MenuItem, Services } from '@editor/type';
|
|
17
17
|
|
|
18
|
+
defineOptions({
|
|
19
|
+
name: 'MEditorNavMenu',
|
|
20
|
+
});
|
|
21
|
+
|
|
18
22
|
const props = withDefaults(
|
|
19
23
|
defineProps<{
|
|
20
24
|
data?: MenuBarData;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
</div>
|
|
14
14
|
</template>
|
|
15
15
|
|
|
16
|
-
<script lang="ts" setup
|
|
16
|
+
<script lang="ts" setup>
|
|
17
17
|
import { computed, getCurrentInstance, inject, onMounted, onUnmounted, ref, watchEffect } from 'vue';
|
|
18
18
|
|
|
19
19
|
import { tMagicMessage } from '@tmagic/design';
|
|
@@ -22,6 +22,10 @@ import { MForm } from '@tmagic/form';
|
|
|
22
22
|
|
|
23
23
|
import type { Services } from '@editor/type';
|
|
24
24
|
|
|
25
|
+
defineOptions({
|
|
26
|
+
name: 'MEditorPropsPanel',
|
|
27
|
+
});
|
|
28
|
+
|
|
25
29
|
const emit = defineEmits(['mounted']);
|
|
26
30
|
|
|
27
31
|
const internalInstance = getCurrentInstance();
|
package/src/layouts/Resizer.vue
CHANGED
|
@@ -4,10 +4,14 @@
|
|
|
4
4
|
</span>
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
|
-
<script lang="ts" setup
|
|
7
|
+
<script lang="ts" setup>
|
|
8
8
|
import { onMounted, onUnmounted, ref } from 'vue';
|
|
9
9
|
import Gesto from 'gesto';
|
|
10
10
|
|
|
11
|
+
defineOptions({
|
|
12
|
+
name: 'MEditorResizer',
|
|
13
|
+
});
|
|
14
|
+
|
|
11
15
|
const emit = defineEmits(['change']);
|
|
12
16
|
|
|
13
17
|
const target = ref<HTMLSpanElement>();
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
</TMagicScrollbar>
|
|
32
32
|
</template>
|
|
33
33
|
|
|
34
|
-
<script lang="ts" setup
|
|
34
|
+
<script lang="ts" setup>
|
|
35
35
|
import { computed, inject, ref } from 'vue';
|
|
36
36
|
import { Grid } from '@element-plus/icons-vue';
|
|
37
37
|
import serialize from 'serialize-javascript';
|
|
@@ -43,6 +43,10 @@ import MIcon from '@editor/components/Icon.vue';
|
|
|
43
43
|
import SearchInput from '@editor/components/SearchInput.vue';
|
|
44
44
|
import type { ComponentGroup, ComponentItem, Services, StageOptions } from '@editor/type';
|
|
45
45
|
|
|
46
|
+
defineOptions({
|
|
47
|
+
name: 'MEditorComponentListPanel',
|
|
48
|
+
});
|
|
49
|
+
|
|
46
50
|
const searchText = ref('');
|
|
47
51
|
|
|
48
52
|
const filterTextChangeHandler = (v: string) => {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<ContentMenu :menu-data="menuData" ref="menu" style="overflow: initial"></ContentMenu>
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
|
-
<script lang="ts" setup
|
|
5
|
+
<script lang="ts" setup>
|
|
6
6
|
import { computed, inject, markRaw, ref } from 'vue';
|
|
7
7
|
import { CopyDocument, Delete, Files, Plus } from '@element-plus/icons-vue';
|
|
8
8
|
|
|
@@ -11,6 +11,10 @@ import { NodeType } from '@tmagic/schema';
|
|
|
11
11
|
import ContentMenu from '@editor/components/ContentMenu.vue';
|
|
12
12
|
import type { ComponentGroup, MenuButton, MenuComponent, Services } from '@editor/type';
|
|
13
13
|
|
|
14
|
+
defineOptions({
|
|
15
|
+
name: 'MEditorLayerMenu',
|
|
16
|
+
});
|
|
17
|
+
|
|
14
18
|
const props = defineProps<{
|
|
15
19
|
layerContentMenu: (MenuButton | MenuComponent)[];
|
|
16
20
|
}>();
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
</TMagicScrollbar>
|
|
49
49
|
</template>
|
|
50
50
|
|
|
51
|
-
<script lang="ts" setup
|
|
51
|
+
<script lang="ts" setup>
|
|
52
52
|
import { computed, inject, onMounted, onUnmounted, ref, watch } from 'vue';
|
|
53
53
|
import KeyController from 'keycon';
|
|
54
54
|
import { difference, throttle, union } from 'lodash-es';
|
|
@@ -64,6 +64,10 @@ import { Layout } from '@editor/type';
|
|
|
64
64
|
|
|
65
65
|
import LayerMenu from './LayerMenu.vue';
|
|
66
66
|
|
|
67
|
+
defineOptions({
|
|
68
|
+
name: 'MEditorLayerPanel',
|
|
69
|
+
});
|
|
70
|
+
|
|
67
71
|
defineProps<{
|
|
68
72
|
layerContentMenu: (MenuButton | MenuComponent)[];
|
|
69
73
|
}>();
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
v-if="data.type === 'tabs' && data.items.length"
|
|
4
4
|
v-model="activeTabName"
|
|
5
5
|
class="m-editor-sidebar tmagic-design-tabs"
|
|
6
|
-
v-bind="tabsComponent
|
|
7
|
-
:is="tabsComponent
|
|
6
|
+
v-bind="tabsComponent?.props({ type: 'card', tabPosition: 'left' }) || {}"
|
|
7
|
+
:is="tabsComponent?.component || 'el-tabs'"
|
|
8
8
|
>
|
|
9
9
|
<component
|
|
10
10
|
v-for="(config, index) in sideBarItems"
|
|
11
|
-
v-bind="tabPaneComponent
|
|
12
|
-
:is="tabPaneComponent
|
|
11
|
+
v-bind="tabPaneComponent?.props({ name: config.text, lazy: config.lazy }) || {}"
|
|
12
|
+
:is="tabPaneComponent?.component || 'el-tab-pane'"
|
|
13
13
|
:key="config.$key || index"
|
|
14
14
|
>
|
|
15
15
|
<template #label>
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
</component>
|
|
84
84
|
</template>
|
|
85
85
|
|
|
86
|
-
<script lang="ts" setup
|
|
86
|
+
<script lang="ts" setup>
|
|
87
87
|
import { computed, ref, watch } from 'vue';
|
|
88
88
|
import { Coin, EditPen, Goods, List } from '@element-plus/icons-vue';
|
|
89
89
|
|
|
@@ -98,6 +98,10 @@ import DataSourceListPanel from './data-source/DataSourceListPanel.vue';
|
|
|
98
98
|
import ComponentListPanel from './ComponentListPanel.vue';
|
|
99
99
|
import LayerPanel from './LayerPanel.vue';
|
|
100
100
|
|
|
101
|
+
defineOptions({
|
|
102
|
+
name: 'MEditorSidebar',
|
|
103
|
+
});
|
|
104
|
+
|
|
101
105
|
const props = withDefaults(
|
|
102
106
|
defineProps<{
|
|
103
107
|
data: SideBarData;
|
|
@@ -108,8 +112,8 @@ const props = withDefaults(
|
|
|
108
112
|
},
|
|
109
113
|
);
|
|
110
114
|
|
|
111
|
-
const tabPaneComponent = getConfig('components')
|
|
112
|
-
const tabsComponent = getConfig('components')
|
|
115
|
+
const tabPaneComponent = getConfig('components')?.tabPane;
|
|
116
|
+
const tabsComponent = getConfig('components')?.tabs;
|
|
113
117
|
|
|
114
118
|
const activeTabName = ref(props.data?.status);
|
|
115
119
|
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
</TMagicDrawer>
|
|
33
33
|
</template>
|
|
34
34
|
|
|
35
|
-
<script lang="ts" setup
|
|
35
|
+
<script lang="ts" setup>
|
|
36
36
|
import { computed, inject, reactive, ref, watchEffect } from 'vue';
|
|
37
37
|
import { cloneDeep, forIn, isEmpty } from 'lodash-es';
|
|
38
38
|
|
|
@@ -45,6 +45,10 @@ import Layout from '@editor/components/Layout.vue';
|
|
|
45
45
|
import type { ListState, Services } from '@editor/type';
|
|
46
46
|
import { serializeConfig } from '@editor/utils/editor';
|
|
47
47
|
|
|
48
|
+
defineOptions({
|
|
49
|
+
name: 'MEditorCodeBlockEditor',
|
|
50
|
+
});
|
|
51
|
+
|
|
48
52
|
const services = inject<Services>('services');
|
|
49
53
|
const codeOptions = inject('codeOptions', {});
|
|
50
54
|
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
</TMagicScrollbar>
|
|
56
56
|
</template>
|
|
57
57
|
|
|
58
|
-
<script setup lang="ts"
|
|
58
|
+
<script setup lang="ts">
|
|
59
59
|
import { computed, inject, ref } from 'vue';
|
|
60
60
|
import { Close, Edit, View } from '@element-plus/icons-vue';
|
|
61
61
|
|
|
@@ -71,6 +71,10 @@ import { CodeDeleteErrorType, CodeDslItem, Services } from '@editor/type';
|
|
|
71
71
|
|
|
72
72
|
import CodeBlockEditor from './CodeBlockEditor.vue';
|
|
73
73
|
|
|
74
|
+
defineOptions({
|
|
75
|
+
name: 'MEditorCodeBlockList',
|
|
76
|
+
});
|
|
77
|
+
|
|
74
78
|
const props = defineProps<{
|
|
75
79
|
customError?: (id: Id, errorType: CodeDeleteErrorType) => any;
|
|
76
80
|
paramsColConfig?: ColumnConfig;
|
|
@@ -61,6 +61,10 @@ import type { Services } from '@editor/type';
|
|
|
61
61
|
|
|
62
62
|
import DataSourceConfigPanel from './DataSourceConfigPanel.vue';
|
|
63
63
|
|
|
64
|
+
defineOptions({
|
|
65
|
+
name: 'MEditorDataSourceListPanel',
|
|
66
|
+
});
|
|
67
|
+
|
|
64
68
|
const services = inject<Partial<Services>>('services', {});
|
|
65
69
|
const { dataSourceService, depService } = inject<Services>('services') || {};
|
|
66
70
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
</div>
|
|
8
8
|
</template>
|
|
9
9
|
|
|
10
|
-
<script setup lang="ts"
|
|
10
|
+
<script setup lang="ts">
|
|
11
11
|
import { computed, inject } from 'vue';
|
|
12
12
|
|
|
13
13
|
import { TMagicButton } from '@tmagic/design';
|
|
@@ -16,6 +16,10 @@ import { getNodePath } from '@tmagic/utils';
|
|
|
16
16
|
|
|
17
17
|
import type { Services } from '@editor/type';
|
|
18
18
|
|
|
19
|
+
defineOptions({
|
|
20
|
+
name: 'MEditorBreadcrumb',
|
|
21
|
+
});
|
|
22
|
+
|
|
19
23
|
const services = inject<Services>('services');
|
|
20
24
|
const editorService = services?.editorService;
|
|
21
25
|
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
</PageBarScrollContainer>
|
|
47
47
|
</template>
|
|
48
48
|
|
|
49
|
-
<script lang="ts" setup
|
|
49
|
+
<script lang="ts" setup>
|
|
50
50
|
import { computed, inject } from 'vue';
|
|
51
51
|
import { CaretBottom, Delete, DocumentCopy } from '@element-plus/icons-vue';
|
|
52
52
|
|
|
@@ -58,6 +58,10 @@ import type { Services } from '@editor/type';
|
|
|
58
58
|
|
|
59
59
|
import PageBarScrollContainer from './PageBarScrollContainer.vue';
|
|
60
60
|
|
|
61
|
+
defineOptions({
|
|
62
|
+
name: 'MEditorPageBar',
|
|
63
|
+
});
|
|
64
|
+
|
|
61
65
|
const services = inject<Services>('services');
|
|
62
66
|
const editorService = services?.editorService;
|
|
63
67
|
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
</div>
|
|
27
27
|
</template>
|
|
28
28
|
|
|
29
|
-
<script setup lang="ts"
|
|
29
|
+
<script setup lang="ts">
|
|
30
30
|
import { computed, inject, nextTick, onMounted, onUnmounted, ref, toRaw, watch } from 'vue';
|
|
31
31
|
import { ArrowLeftBold, ArrowRightBold, Plus } from '@element-plus/icons-vue';
|
|
32
32
|
|
|
@@ -36,6 +36,10 @@ import Icon from '@editor/components/Icon.vue';
|
|
|
36
36
|
import type { Services } from '@editor/type';
|
|
37
37
|
import { generatePageNameByApp } from '@editor/utils/editor';
|
|
38
38
|
|
|
39
|
+
defineOptions({
|
|
40
|
+
name: 'MEditorPageBarScrollContainer',
|
|
41
|
+
});
|
|
42
|
+
|
|
39
43
|
const services = inject<Services>('services');
|
|
40
44
|
const editorService = services?.editorService;
|
|
41
45
|
const uiService = services?.uiService;
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
</ScrollViewer>
|
|
27
27
|
</template>
|
|
28
28
|
|
|
29
|
-
<script lang="ts" setup
|
|
29
|
+
<script lang="ts" setup>
|
|
30
30
|
import { computed, inject, markRaw, nextTick, onMounted, onUnmounted, ref, toRaw, watch, watchEffect } from 'vue';
|
|
31
31
|
import { cloneDeep } from 'lodash-es';
|
|
32
32
|
|
|
@@ -39,6 +39,10 @@ import { useStage } from '@editor/utils/stage';
|
|
|
39
39
|
|
|
40
40
|
import ViewerMenu from './ViewerMenu.vue';
|
|
41
41
|
|
|
42
|
+
defineOptions({
|
|
43
|
+
name: 'MEditorStage',
|
|
44
|
+
});
|
|
45
|
+
|
|
42
46
|
defineProps<{
|
|
43
47
|
stageContentMenu: (MenuButton | MenuComponent)[];
|
|
44
48
|
}>();
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<content-menu :menu-data="menuData" ref="menu"></content-menu>
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
|
-
<script lang="ts" setup
|
|
5
|
+
<script lang="ts" setup>
|
|
6
6
|
import { computed, inject, markRaw, ref, watch } from 'vue';
|
|
7
7
|
import { Bottom, CopyDocument, Delete, DocumentCopy, Top } from '@element-plus/icons-vue';
|
|
8
8
|
|
|
@@ -14,6 +14,10 @@ import storageService from '@editor/services/storage';
|
|
|
14
14
|
import { LayerOffset, Layout, MenuButton, MenuComponent, Services } from '@editor/type';
|
|
15
15
|
import { COPY_STORAGE_KEY } from '@editor/utils/editor';
|
|
16
16
|
|
|
17
|
+
defineOptions({
|
|
18
|
+
name: 'MEditorViewerMenu',
|
|
19
|
+
});
|
|
20
|
+
|
|
17
21
|
const props = withDefaults(
|
|
18
22
|
defineProps<{ isMultiSelect?: boolean; stageContentMenu: (MenuButton | MenuComponent)[] }>(),
|
|
19
23
|
{ isMultiSelect: false },
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
</div>
|
|
16
16
|
</template>
|
|
17
17
|
|
|
18
|
-
<script lang="ts" setup
|
|
18
|
+
<script lang="ts" setup>
|
|
19
19
|
import { computed, inject, onMounted, onUnmounted, ref } from 'vue';
|
|
20
20
|
import KeyController from 'keycon';
|
|
21
21
|
|
|
@@ -27,6 +27,10 @@ import Breadcrumb from './Breadcrumb.vue';
|
|
|
27
27
|
import PageBar from './PageBar.vue';
|
|
28
28
|
import MagicStage from './Stage.vue';
|
|
29
29
|
|
|
30
|
+
defineOptions({
|
|
31
|
+
name: 'MEditorWorkspace',
|
|
32
|
+
});
|
|
33
|
+
|
|
30
34
|
defineProps<{
|
|
31
35
|
stageContentMenu: (MenuButton | MenuComponent)[];
|
|
32
36
|
}>();
|
package/types/Editor.vue.d.ts
CHANGED
|
@@ -40,7 +40,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
40
40
|
}, {
|
|
41
41
|
editable: boolean;
|
|
42
42
|
autoSaveDraft: boolean;
|
|
43
|
-
}>;
|
|
43
|
+
}, {}>;
|
|
44
44
|
export default _default;
|
|
45
45
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
46
46
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -52,7 +52,10 @@ type __VLS_TypePropsToRuntimeProps<T> = {
|
|
|
52
52
|
};
|
|
53
53
|
};
|
|
54
54
|
type __VLS_WithDefaults<P, D> = {
|
|
55
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? P[K] & {
|
|
55
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
56
56
|
default: D[K];
|
|
57
|
-
} : P[K];
|
|
57
|
+
}> : P[K];
|
|
58
58
|
};
|
|
59
|
+
type __VLS_Prettify<T> = {
|
|
60
|
+
[K in keyof T]: T[K];
|
|
61
|
+
} & {};
|
|
@@ -8,19 +8,19 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
8
8
|
}>, {
|
|
9
9
|
hide: () => void;
|
|
10
10
|
show: (e: MouseEvent) => void;
|
|
11
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("
|
|
11
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("hide" | "show")[], "hide" | "show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
12
12
|
menuData?: (MenuButton | MenuComponent)[] | undefined;
|
|
13
13
|
isSubMenu?: boolean | undefined;
|
|
14
14
|
}>, {
|
|
15
15
|
menuData: () => never[];
|
|
16
16
|
isSubMenu: boolean;
|
|
17
17
|
}>>> & {
|
|
18
|
-
onShow?: ((...args: any[]) => any) | undefined;
|
|
19
18
|
onHide?: ((...args: any[]) => any) | undefined;
|
|
19
|
+
onShow?: ((...args: any[]) => any) | undefined;
|
|
20
20
|
}, {
|
|
21
21
|
menuData: (MenuButton | MenuComponent)[];
|
|
22
22
|
isSubMenu: boolean;
|
|
23
|
-
}>;
|
|
23
|
+
}, {}>;
|
|
24
24
|
export default _default;
|
|
25
25
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
26
26
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -32,7 +32,10 @@ type __VLS_TypePropsToRuntimeProps<T> = {
|
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
34
|
type __VLS_WithDefaults<P, D> = {
|
|
35
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? P[K] & {
|
|
35
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
36
36
|
default: D[K];
|
|
37
|
-
} : P[K];
|
|
37
|
+
}> : P[K];
|
|
38
38
|
};
|
|
39
|
+
type __VLS_Prettify<T> = {
|
|
40
|
+
[K in keyof T]: T[K];
|
|
41
|
+
} & {};
|