@tmagic/editor 1.3.0-alpha.2 → 1.3.0-alpha.4
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 +800 -514
- package/dist/tmagic-editor.js.map +1 -1
- package/dist/tmagic-editor.umd.cjs +801 -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 +8 -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 +9 -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
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.3.0-alpha.
|
|
2
|
+
"version": "1.3.0-alpha.4",
|
|
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.4",
|
|
50
|
+
"@tmagic/design": "1.3.0-alpha.4",
|
|
51
|
+
"@tmagic/form": "1.3.0-alpha.4",
|
|
52
|
+
"@tmagic/schema": "1.3.0-alpha.4",
|
|
53
|
+
"@tmagic/stage": "1.3.0-alpha.4",
|
|
54
|
+
"@tmagic/table": "1.3.0-alpha.4",
|
|
55
|
+
"@tmagic/utils": "1.3.0-alpha.4",
|
|
56
56
|
"buffer": "^6.0.3",
|
|
57
57
|
"color": "^3.1.3",
|
|
58
58
|
"events": "^3.3.0",
|
|
@@ -61,28 +61,27 @@
|
|
|
61
61
|
"lodash-es": "^4.17.21",
|
|
62
62
|
"monaco-editor": "^0.34.0",
|
|
63
63
|
"serialize-javascript": "^6.0.0",
|
|
64
|
-
"vue": "^3.
|
|
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.4",
|
|
68
|
+
"@tmagic/form": "1.3.0-alpha.4",
|
|
69
69
|
"monaco-editor": "^0.34.0",
|
|
70
|
-
"vue": "^3.
|
|
70
|
+
"vue": "^3.3.4"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@types/events": "^3.0.0",
|
|
74
74
|
"@types/lodash-es": "^4.17.4",
|
|
75
75
|
"@types/node": "^15.12.4",
|
|
76
76
|
"@types/serialize-javascript": "^5.0.1",
|
|
77
|
-
"@vitejs/plugin-vue": "^4.
|
|
78
|
-
"@vue/compiler-sfc": "^3.
|
|
79
|
-
"@vue/test-utils": "^2.
|
|
77
|
+
"@vitejs/plugin-vue": "^4.2.3",
|
|
78
|
+
"@vue/compiler-sfc": "^3.3.4",
|
|
79
|
+
"@vue/test-utils": "^2.3.2",
|
|
80
80
|
"rimraf": "^3.0.2",
|
|
81
81
|
"sass": "^1.35.1",
|
|
82
82
|
"tsc-alias": "^1.8.5",
|
|
83
83
|
"typescript": "^5.0.4",
|
|
84
|
-
"vite": "^4.
|
|
85
|
-
"
|
|
86
|
-
"vue-tsc": "^1.0.11"
|
|
84
|
+
"vite": "^4.3.8",
|
|
85
|
+
"vue-tsc": "^1.6.5"
|
|
87
86
|
}
|
|
88
87
|
}
|
package/src/Editor.vue
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
</div>
|
|
24
24
|
</div>
|
|
25
25
|
</template>
|
|
26
|
-
<script lang="ts" setup
|
|
26
|
+
<script lang="ts" setup>
|
|
27
27
|
import { computed, inject, ref, watchEffect } from 'vue';
|
|
28
28
|
import type * as monaco from 'monaco-editor';
|
|
29
29
|
|
|
@@ -34,6 +34,10 @@ import { datetimeFormatter } from '@tmagic/utils';
|
|
|
34
34
|
import MagicCodeEditor from '@editor/layouts/CodeEditor.vue';
|
|
35
35
|
import type { Services } from '@editor/type';
|
|
36
36
|
|
|
37
|
+
defineOptions({
|
|
38
|
+
name: 'MEditorCodeDraftEditor',
|
|
39
|
+
});
|
|
40
|
+
|
|
37
41
|
const props = withDefaults(
|
|
38
42
|
defineProps<{
|
|
39
43
|
/** 代码id */
|
|
@@ -22,13 +22,17 @@
|
|
|
22
22
|
</div>
|
|
23
23
|
</template>
|
|
24
24
|
|
|
25
|
-
<script lang="ts" setup
|
|
25
|
+
<script lang="ts" setup>
|
|
26
26
|
import { nextTick, onMounted, onUnmounted, ref } from 'vue';
|
|
27
27
|
|
|
28
28
|
import { MenuButton, MenuComponent } from '@editor/type';
|
|
29
29
|
|
|
30
30
|
import ToolButton from './ToolButton.vue';
|
|
31
31
|
|
|
32
|
+
defineOptions({
|
|
33
|
+
name: 'MEditorContentMenu',
|
|
34
|
+
});
|
|
35
|
+
|
|
32
36
|
const props = withDefaults(
|
|
33
37
|
defineProps<{
|
|
34
38
|
menuData?: (MenuButton | MenuComponent)[];
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
></CodeDraftEditor>
|
|
33
33
|
</TMagicCard>
|
|
34
34
|
</template>
|
|
35
|
-
<script lang="ts" setup
|
|
35
|
+
<script lang="ts" setup>
|
|
36
36
|
import { inject, ref, watchEffect } from 'vue';
|
|
37
37
|
import { cloneDeep } from 'lodash-es';
|
|
38
38
|
|
|
@@ -43,6 +43,11 @@ import { CodeParam, Id } from '@tmagic/schema';
|
|
|
43
43
|
import type { Services } from '@editor/type';
|
|
44
44
|
|
|
45
45
|
import CodeDraftEditor from './CodeDraftEditor.vue';
|
|
46
|
+
|
|
47
|
+
defineOptions({
|
|
48
|
+
name: 'MEditorFunctionEditor',
|
|
49
|
+
});
|
|
50
|
+
|
|
46
51
|
const defaultParamColConfig: ColumnConfig = {
|
|
47
52
|
type: 'row',
|
|
48
53
|
label: '参数类型',
|
package/src/components/Icon.vue
CHANGED
|
@@ -7,12 +7,16 @@
|
|
|
7
7
|
<TMagicIcon v-else class="magic-editor-icon"><component :is="toRaw(icon)"></component></TMagicIcon>
|
|
8
8
|
</template>
|
|
9
9
|
|
|
10
|
-
<script lang="ts" setup
|
|
10
|
+
<script lang="ts" setup>
|
|
11
11
|
import { toRaw } from 'vue';
|
|
12
12
|
import { Edit } from '@element-plus/icons-vue';
|
|
13
13
|
|
|
14
14
|
import { TMagicIcon } from '@tmagic/design';
|
|
15
15
|
|
|
16
|
+
defineOptions({
|
|
17
|
+
name: 'MEditorIcon',
|
|
18
|
+
});
|
|
19
|
+
|
|
16
20
|
defineProps<{
|
|
17
21
|
icon?: any;
|
|
18
22
|
}>();
|
|
@@ -20,11 +20,15 @@
|
|
|
20
20
|
</div>
|
|
21
21
|
</template>
|
|
22
22
|
|
|
23
|
-
<script lang="ts" setup
|
|
23
|
+
<script lang="ts" setup>
|
|
24
24
|
import { computed, onMounted, onUnmounted, ref } from 'vue';
|
|
25
25
|
|
|
26
26
|
import Resizer from '@editor/layouts/Resizer.vue';
|
|
27
27
|
|
|
28
|
+
defineOptions({
|
|
29
|
+
name: 'MEditorLayout',
|
|
30
|
+
});
|
|
31
|
+
|
|
28
32
|
const emit = defineEmits(['update:left', 'change', 'update:right']);
|
|
29
33
|
|
|
30
34
|
const props = withDefaults(
|
|
@@ -4,10 +4,14 @@
|
|
|
4
4
|
</div>
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
|
-
<script lang="ts" setup
|
|
7
|
+
<script lang="ts" setup>
|
|
8
8
|
import { computed, onMounted, onUnmounted, ref } from 'vue';
|
|
9
9
|
import Gesto from 'gesto';
|
|
10
10
|
|
|
11
|
+
defineOptions({
|
|
12
|
+
name: 'MEditorScrollBar',
|
|
13
|
+
});
|
|
14
|
+
|
|
11
15
|
const props = defineProps<{
|
|
12
16
|
size: number;
|
|
13
17
|
scrollSize: number;
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
</div>
|
|
23
23
|
</template>
|
|
24
24
|
|
|
25
|
-
<script lang="ts" setup
|
|
25
|
+
<script lang="ts" setup>
|
|
26
26
|
import { computed, onMounted, onUnmounted, ref, watch } from 'vue';
|
|
27
27
|
|
|
28
28
|
import type { ScrollViewerEvent } from '@editor/type';
|
|
@@ -30,6 +30,10 @@ import { ScrollViewer } from '@editor/utils/scroll-viewer';
|
|
|
30
30
|
|
|
31
31
|
import ScrollBar from './ScrollBar.vue';
|
|
32
32
|
|
|
33
|
+
defineOptions({
|
|
34
|
+
name: 'MEditorScrollViewer',
|
|
35
|
+
});
|
|
36
|
+
|
|
33
37
|
const props = withDefaults(
|
|
34
38
|
defineProps<{
|
|
35
39
|
width?: number;
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
</div>
|
|
44
44
|
</template>
|
|
45
45
|
|
|
46
|
-
<script lang="ts" setup
|
|
46
|
+
<script lang="ts" setup>
|
|
47
47
|
import { computed, inject } from 'vue';
|
|
48
48
|
import { ArrowDown } from '@element-plus/icons-vue';
|
|
49
49
|
|
|
@@ -60,6 +60,10 @@ import {
|
|
|
60
60
|
import MIcon from '../components/Icon.vue';
|
|
61
61
|
import type { MenuButton, MenuComponent, Services } from '../type';
|
|
62
62
|
|
|
63
|
+
defineOptions({
|
|
64
|
+
name: 'MEditorToolButton',
|
|
65
|
+
});
|
|
66
|
+
|
|
63
67
|
const props = withDefaults(
|
|
64
68
|
defineProps<{
|
|
65
69
|
data?: MenuButton | MenuComponent;
|
package/src/fields/Code.vue
CHANGED
|
@@ -8,9 +8,13 @@
|
|
|
8
8
|
></magic-code-editor>
|
|
9
9
|
</template>
|
|
10
10
|
|
|
11
|
-
<script lang="ts" setup
|
|
11
|
+
<script lang="ts" setup>
|
|
12
12
|
import { computed } from 'vue';
|
|
13
13
|
|
|
14
|
+
defineOptions({
|
|
15
|
+
name: 'MEditorCode',
|
|
16
|
+
});
|
|
17
|
+
|
|
14
18
|
const emit = defineEmits(['change']);
|
|
15
19
|
|
|
16
20
|
const props = defineProps<{
|
package/src/fields/CodeLink.vue
CHANGED
|
@@ -2,10 +2,14 @@
|
|
|
2
2
|
<m-fields-link :config="formConfig" :model="modelValue" name="form" @change="changeHandler"></m-fields-link>
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
|
-
<script lang="ts" setup
|
|
5
|
+
<script lang="ts" setup>
|
|
6
6
|
import { computed, reactive, watch } from 'vue';
|
|
7
7
|
import serialize from 'serialize-javascript';
|
|
8
8
|
|
|
9
|
+
defineOptions({
|
|
10
|
+
name: 'MEditorCodeLink',
|
|
11
|
+
});
|
|
12
|
+
|
|
9
13
|
const props = defineProps<{
|
|
10
14
|
config: {
|
|
11
15
|
type: 'code-link';
|
|
@@ -6,13 +6,17 @@
|
|
|
6
6
|
</div>
|
|
7
7
|
</template>
|
|
8
8
|
|
|
9
|
-
<script lang="ts" setup
|
|
10
|
-
import { computed,
|
|
9
|
+
<script lang="ts" setup>
|
|
10
|
+
import { computed, watch } from 'vue';
|
|
11
11
|
import { isEmpty } from 'lodash-es';
|
|
12
12
|
|
|
13
13
|
import { TMagicCard } from '@tmagic/design';
|
|
14
14
|
import { HookType } from '@tmagic/schema';
|
|
15
15
|
|
|
16
|
+
defineOptions({
|
|
17
|
+
name: 'MEditorCodeSelect',
|
|
18
|
+
});
|
|
19
|
+
|
|
16
20
|
const emit = defineEmits(['change']);
|
|
17
21
|
|
|
18
22
|
const props = withDefaults(
|
|
@@ -32,6 +36,8 @@ const codeConfig = computed(() => ({
|
|
|
32
36
|
type: 'group-list',
|
|
33
37
|
name: 'hookData',
|
|
34
38
|
enableToggleMode: false,
|
|
39
|
+
expandAll: true,
|
|
40
|
+
titleKey: 'codeId',
|
|
35
41
|
items: [
|
|
36
42
|
{
|
|
37
43
|
type: 'code-select-col',
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
</div>
|
|
17
17
|
</template>
|
|
18
18
|
|
|
19
|
-
<script lang="ts" setup name="
|
|
20
|
-
import { computed,
|
|
19
|
+
<script lang="ts" setup name="">
|
|
20
|
+
import { computed, inject, ref, watch } from 'vue';
|
|
21
21
|
import { Edit, View } from '@element-plus/icons-vue';
|
|
22
22
|
import { isEmpty, map } from 'lodash-es';
|
|
23
23
|
|
|
@@ -27,6 +27,10 @@ import { Id } from '@tmagic/schema';
|
|
|
27
27
|
import Icon from '@editor/components/Icon.vue';
|
|
28
28
|
import type { CodeParamStatement, Services } from '@editor/type';
|
|
29
29
|
|
|
30
|
+
defineOptions({
|
|
31
|
+
name: 'MEditorCodeSelectCol',
|
|
32
|
+
});
|
|
33
|
+
|
|
30
34
|
const services = inject<Services>('services');
|
|
31
35
|
const mForm = inject<FormState>('mForm');
|
|
32
36
|
const emit = defineEmits(['change']);
|
|
@@ -24,6 +24,10 @@ import { TMagicButton, tMagicMessageBox } from '@tmagic/design';
|
|
|
24
24
|
import { FormConfig, FormState, MFormDialog } from '@tmagic/form';
|
|
25
25
|
import { MagicTable } from '@tmagic/table';
|
|
26
26
|
|
|
27
|
+
defineOptions({
|
|
28
|
+
name: 'MEditorDataSourceFields',
|
|
29
|
+
});
|
|
30
|
+
|
|
27
31
|
const props = withDefaults(
|
|
28
32
|
defineProps<{
|
|
29
33
|
config: {
|