@tmagic/editor 1.2.0-beta.25 → 1.2.0-beta.27
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/style.css +32 -16
- package/dist/tmagic-editor.js +38 -14
- package/dist/tmagic-editor.js.map +1 -1
- package/dist/tmagic-editor.umd.cjs +38 -14
- package/dist/tmagic-editor.umd.cjs.map +1 -1
- package/package.json +10 -10
- package/src/Editor.vue +13 -4
- package/src/layouts/NavMenu.vue +1 -1
- package/src/layouts/PropsPanel.vue +5 -1
- package/src/layouts/sidebar/LayerPanel.vue +10 -6
- package/src/services/BaseService.ts +6 -2
- package/src/services/editor.ts +12 -1
- package/src/theme/code-block.scss +11 -3
- package/src/theme/component-list-panel.scss +8 -5
- package/src/type.ts +1 -0
- package/src/utils/stage.ts +1 -0
- package/types/Editor.vue.d.ts +7 -0
- package/types/components/CodeDraftEditor.vue.d.ts +19 -111
- package/types/components/ContentMenu.vue.d.ts +11 -87
- package/types/components/FunctionEditor.vue.d.ts +13 -90
- package/types/components/Icon.vue.d.ts +4 -50
- package/types/components/ScrollBar.vue.d.ts +7 -65
- package/types/components/ToolButton.vue.d.ts +12 -78
- package/types/fields/Code.vue.d.ts +11 -77
- package/types/fields/CodeLink.vue.d.ts +12 -82
- package/types/fields/CodeSelect.vue.d.ts +10 -74
- package/types/fields/UISelect.vue.d.ts +7 -65
- package/types/layouts/AddPageBox.vue.d.ts +1 -43
- package/types/layouts/CodeEditor.vue.d.ts +21 -122
- package/types/layouts/NavMenu.vue.d.ts +9 -69
- package/types/layouts/sidebar/LayerMenu.vue.d.ts +5 -55
- package/types/layouts/workspace/Breadcrumb.vue.d.ts +1 -43
- package/types/layouts/workspace/Stage.vue.d.ts +4 -51
- package/types/layouts/workspace/ViewerMenu.vue.d.ts +9 -69
- package/types/type.d.ts +1 -0
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.2.0-beta.
|
|
2
|
+
"version": "1.2.0-beta.27",
|
|
3
3
|
"name": "@tmagic/editor",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": [
|
|
@@ -46,12 +46,12 @@
|
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@babel/core": "^7.18.0",
|
|
48
48
|
"@element-plus/icons-vue": "^2.0.9",
|
|
49
|
-
"@tmagic/core": "1.2.0-beta.
|
|
50
|
-
"@tmagic/design": "1.2.0-beta.
|
|
51
|
-
"@tmagic/form": "1.2.0-beta.
|
|
52
|
-
"@tmagic/schema": "1.2.0-beta.
|
|
53
|
-
"@tmagic/stage": "1.2.0-beta.
|
|
54
|
-
"@tmagic/utils": "1.2.0-beta.
|
|
49
|
+
"@tmagic/core": "1.2.0-beta.27",
|
|
50
|
+
"@tmagic/design": "1.2.0-beta.27",
|
|
51
|
+
"@tmagic/form": "1.2.0-beta.27",
|
|
52
|
+
"@tmagic/schema": "1.2.0-beta.27",
|
|
53
|
+
"@tmagic/stage": "1.2.0-beta.27",
|
|
54
|
+
"@tmagic/utils": "1.2.0-beta.27",
|
|
55
55
|
"buffer": "^6.0.3",
|
|
56
56
|
"color": "^3.1.3",
|
|
57
57
|
"events": "^3.3.0",
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
"vue": "^3.2.37"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
|
-
"@tmagic/design": "1.2.0-beta.
|
|
67
|
-
"@tmagic/form": "1.2.0-beta.
|
|
66
|
+
"@tmagic/design": "1.2.0-beta.27",
|
|
67
|
+
"@tmagic/form": "1.2.0-beta.27",
|
|
68
68
|
"monaco-editor": "^0.34.0",
|
|
69
69
|
"vue": "^3.2.37"
|
|
70
70
|
},
|
|
@@ -81,6 +81,6 @@
|
|
|
81
81
|
"typescript": "^4.7.4",
|
|
82
82
|
"vite": "^3.1.3",
|
|
83
83
|
"vite-plugin-vue-setup-extend": "^0.4.0",
|
|
84
|
-
"vue-tsc": "^1.0.
|
|
84
|
+
"vue-tsc": "^1.0.11"
|
|
85
85
|
}
|
|
86
86
|
}
|
package/src/Editor.vue
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Framework :code-options="codeOptions">
|
|
3
3
|
<template #nav>
|
|
4
|
-
<slot name="nav" :editorService="editorService"><
|
|
4
|
+
<slot name="nav" :editorService="editorService"><TMagicNavMenu :data="menu"></TMagicNavMenu></slot>
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
7
|
<template #sidebar>
|
|
@@ -96,7 +96,7 @@ export default defineComponent({
|
|
|
96
96
|
name: 'm-editor',
|
|
97
97
|
|
|
98
98
|
components: {
|
|
99
|
-
NavMenu,
|
|
99
|
+
TMagicNavMenu: NavMenu,
|
|
100
100
|
Sidebar,
|
|
101
101
|
Workspace,
|
|
102
102
|
PropsPanel,
|
|
@@ -218,12 +218,16 @@ export default defineComponent({
|
|
|
218
218
|
updateDragEl: {
|
|
219
219
|
type: Function as PropType<UpdateDragEl>,
|
|
220
220
|
},
|
|
221
|
+
|
|
222
|
+
disabledDragStart: {
|
|
223
|
+
type: Boolean,
|
|
224
|
+
},
|
|
221
225
|
},
|
|
222
226
|
|
|
223
227
|
emits: ['props-panel-mounted', 'update:modelValue'],
|
|
224
228
|
|
|
225
229
|
setup(props, { emit }) {
|
|
226
|
-
|
|
230
|
+
const rootChangeHandler = (value: MApp, preValue?: MApp | null) => {
|
|
227
231
|
const nodeId = editorService.get<MNode | null>('node')?.id || props.defaultSelected;
|
|
228
232
|
let node;
|
|
229
233
|
if (nodeId) {
|
|
@@ -243,7 +247,9 @@ export default defineComponent({
|
|
|
243
247
|
if (toRaw(value) !== toRaw(preValue)) {
|
|
244
248
|
emit('update:modelValue', value);
|
|
245
249
|
}
|
|
246
|
-
}
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
editorService.on('root-change', rootChangeHandler);
|
|
247
253
|
|
|
248
254
|
// 初始值变化,重新设置节点信息
|
|
249
255
|
watch(
|
|
@@ -322,6 +328,8 @@ export default defineComponent({
|
|
|
322
328
|
uiService.resetState();
|
|
323
329
|
componentListService.resetState();
|
|
324
330
|
codeBlockService.resetState();
|
|
331
|
+
|
|
332
|
+
editorService.off('root-change', rootChangeHandler);
|
|
325
333
|
});
|
|
326
334
|
|
|
327
335
|
const services: Services = {
|
|
@@ -351,6 +359,7 @@ export default defineComponent({
|
|
|
351
359
|
containerHighlightClassName: props.containerHighlightClassName,
|
|
352
360
|
containerHighlightDuration: props.containerHighlightDuration,
|
|
353
361
|
containerHighlightType: props.containerHighlightType,
|
|
362
|
+
disabledDragStart: props.disabledDragStart,
|
|
354
363
|
}),
|
|
355
364
|
);
|
|
356
365
|
|
package/src/layouts/NavMenu.vue
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="m-editor-nav-menu" :style="{ height: `${height}px` }">
|
|
3
3
|
<div v-for="key in keys" :class="`menu-${key}`" :key="key" :style="`width: ${columnWidth?.[key]}px`">
|
|
4
|
-
<
|
|
4
|
+
<ToolButton :data="item" v-for="(item, index) in buttons[key]" :key="index"></ToolButton>
|
|
5
5
|
</div>
|
|
6
6
|
</div>
|
|
7
7
|
</template>
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
</template>
|
|
15
15
|
|
|
16
16
|
<script lang="ts" setup name="MEditorPropsPanel">
|
|
17
|
-
import { computed, getCurrentInstance, inject, onMounted, ref, watchEffect } from 'vue';
|
|
17
|
+
import { computed, getCurrentInstance, inject, onMounted, onUnmounted, ref, watchEffect } from 'vue';
|
|
18
18
|
|
|
19
19
|
import { tMagicMessage } from '@tmagic/design';
|
|
20
20
|
import type { FormValue } from '@tmagic/form';
|
|
@@ -56,6 +56,10 @@ onMounted(() => {
|
|
|
56
56
|
emit('mounted', internalInstance);
|
|
57
57
|
});
|
|
58
58
|
|
|
59
|
+
onUnmounted(() => {
|
|
60
|
+
services?.propsService.off('props-configs-change', init);
|
|
61
|
+
});
|
|
62
|
+
|
|
59
63
|
watchEffect(() => {
|
|
60
64
|
if (configForm.value && stage.value) {
|
|
61
65
|
configForm.value.formState.stage = stage.value;
|
|
@@ -104,12 +104,6 @@ const filterText = ref('');
|
|
|
104
104
|
// 默认展开节点
|
|
105
105
|
const defaultExpandedKeys = computed(() => (selectedIds.value.length > 0 ? selectedIds.value : []));
|
|
106
106
|
|
|
107
|
-
editorService?.on('remove', () => {
|
|
108
|
-
setTimeout(() => {
|
|
109
|
-
tree.value?.getNode(editorService.get('node').id)?.updateChildren();
|
|
110
|
-
}, 0);
|
|
111
|
-
});
|
|
112
|
-
|
|
113
107
|
// 触发画布单选
|
|
114
108
|
const select = async (data: MNode) => {
|
|
115
109
|
if (!data.id) {
|
|
@@ -273,9 +267,17 @@ const mouseleaveHandler = () => {
|
|
|
273
267
|
isMultiSelectStatus.value = false;
|
|
274
268
|
};
|
|
275
269
|
|
|
270
|
+
const editorServiceRemoveHandler = () => {
|
|
271
|
+
setTimeout(() => {
|
|
272
|
+
tree.value?.getNode(editorService?.get('node').id)?.updateChildren();
|
|
273
|
+
}, 0);
|
|
274
|
+
};
|
|
275
|
+
|
|
276
276
|
let keycon: KeyController;
|
|
277
277
|
|
|
278
278
|
onMounted(() => {
|
|
279
|
+
editorService?.on('remove', editorServiceRemoveHandler);
|
|
280
|
+
|
|
279
281
|
keycon = new KeyController(tree.value?.$el);
|
|
280
282
|
const isMac = /mac os x/.test(navigator.userAgent.toLowerCase());
|
|
281
283
|
const ctrl = isMac ? 'meta' : 'ctrl';
|
|
@@ -293,6 +295,8 @@ onMounted(() => {
|
|
|
293
295
|
|
|
294
296
|
onUnmounted(() => {
|
|
295
297
|
keycon.destroy();
|
|
298
|
+
|
|
299
|
+
editorService?.off('remove', editorServiceRemoveHandler);
|
|
296
300
|
});
|
|
297
301
|
|
|
298
302
|
// 鼠标是否按下标志,用于高亮状态互斥
|
|
@@ -170,8 +170,12 @@ export default class extends EventEmitter {
|
|
|
170
170
|
}
|
|
171
171
|
|
|
172
172
|
public removeAllPlugins() {
|
|
173
|
-
this.pluginOptionsList
|
|
174
|
-
|
|
173
|
+
Object.keys(this.pluginOptionsList).forEach((key) => {
|
|
174
|
+
this.pluginOptionsList[key] = [];
|
|
175
|
+
});
|
|
176
|
+
Object.keys(this.middleware).forEach((key) => {
|
|
177
|
+
this.middleware[key] = [];
|
|
178
|
+
});
|
|
175
179
|
}
|
|
176
180
|
|
|
177
181
|
private async doTask() {
|
package/src/services/editor.ts
CHANGED
|
@@ -581,9 +581,20 @@ class Editor extends BaseService {
|
|
|
581
581
|
|
|
582
582
|
if (!Array.isArray(config)) return;
|
|
583
583
|
|
|
584
|
+
const node = this.get<MNode>('node');
|
|
585
|
+
|
|
586
|
+
let parent: MContainer | undefined = undefined;
|
|
587
|
+
// 粘贴的组件为当前选中组件的副本时,则添加到当前选中组件的父组件中
|
|
588
|
+
if (config.length === 1 && config[0].id === node.id) {
|
|
589
|
+
parent = this.get<MContainer>('parent');
|
|
590
|
+
if (parent.type === NodeType.ROOT) {
|
|
591
|
+
parent = this.get<MPage>('page');
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
|
|
584
595
|
const pasteConfigs = await this.doPaste(config, position);
|
|
585
596
|
|
|
586
|
-
return this.add(pasteConfigs,
|
|
597
|
+
return this.add(pasteConfigs, parent);
|
|
587
598
|
}
|
|
588
599
|
|
|
589
600
|
public async doPaste(config: MNode[], position: PastePosition = {}): Promise<MNode[]> {
|
|
@@ -83,14 +83,22 @@
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
.code-editor-dialog {
|
|
86
|
-
.
|
|
86
|
+
.tmagic-design-card {
|
|
87
|
+
.t-card__header {
|
|
88
|
+
display: block;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.el-dialog__body,
|
|
93
|
+
.t-dialog__body {
|
|
87
94
|
height: 90%;
|
|
88
95
|
padding-top: 10px;
|
|
89
96
|
}
|
|
90
|
-
.
|
|
97
|
+
.tmagic-design-card {
|
|
91
98
|
height: 100%;
|
|
92
99
|
background: #fff;
|
|
93
|
-
.el-card__body
|
|
100
|
+
.el-card__body,
|
|
101
|
+
.t-card__body {
|
|
94
102
|
height: 100%;
|
|
95
103
|
background: #fff;
|
|
96
104
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.ui-component-panel {
|
|
1
|
+
.ui-component-panel.tmagic-design-collapse {
|
|
2
2
|
height: 100%;
|
|
3
3
|
border-top: 0 !important;
|
|
4
4
|
margin-top: 48px;
|
|
@@ -19,14 +19,15 @@
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
.
|
|
22
|
+
.tmagic-design-collapse-item {
|
|
23
23
|
> div:first-of-type {
|
|
24
24
|
border-bottom: 1px solid $--border-color;
|
|
25
25
|
margin-bottom: 10px;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
.el-collapse-item__header
|
|
29
|
+
.el-collapse-item__header,
|
|
30
|
+
.t-collapse-panel__header {
|
|
30
31
|
background: $--sidebar-content-background-color;
|
|
31
32
|
color: $--font-color;
|
|
32
33
|
height: 25px;
|
|
@@ -40,11 +41,13 @@
|
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
|
|
43
|
-
.el-collapse-item__wrap
|
|
44
|
+
.el-collapse-item__wrap,
|
|
45
|
+
.t-collapse-panel__body {
|
|
44
46
|
background: $--sidebar-content-background-color;
|
|
45
47
|
border-bottom: 0;
|
|
46
48
|
|
|
47
|
-
.el-collapse-item__content
|
|
49
|
+
.el-collapse-item__content,
|
|
50
|
+
.t-collapse-panel__content {
|
|
48
51
|
padding: 10px;
|
|
49
52
|
display: flex;
|
|
50
53
|
flex-wrap: wrap;
|
package/src/type.ts
CHANGED
|
@@ -62,6 +62,7 @@ export interface StageOptions {
|
|
|
62
62
|
containerHighlightClassName: string;
|
|
63
63
|
containerHighlightDuration: number;
|
|
64
64
|
containerHighlightType: ContainerHighlightType;
|
|
65
|
+
disabledDragStart?: boolean;
|
|
65
66
|
render: (stage: StageCore) => HTMLDivElement | Promise<HTMLDivElement>;
|
|
66
67
|
moveableOptions: MoveableOptions | ((config?: CustomizeMoveableOptionsCallbackConfig) => MoveableOptions);
|
|
67
68
|
canSelect: (el: HTMLElement) => boolean | Promise<boolean>;
|
package/src/utils/stage.ts
CHANGED
|
@@ -26,6 +26,7 @@ export const useStage = (stageOptions: StageOptions) => {
|
|
|
26
26
|
containerHighlightClassName: stageOptions.containerHighlightClassName,
|
|
27
27
|
containerHighlightDuration: stageOptions.containerHighlightDuration,
|
|
28
28
|
containerHighlightType: stageOptions.containerHighlightType,
|
|
29
|
+
disabledDragStart: stageOptions.disabledDragStart,
|
|
29
30
|
canSelect: (el, event, stop) => {
|
|
30
31
|
const elCanSelect = stageOptions.canSelect(el);
|
|
31
32
|
// 在组件联动过程中不能再往下选择,返回并触发 ui-select
|
package/types/Editor.vue.d.ts
CHANGED
|
@@ -102,6 +102,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
102
102
|
updateDragEl: {
|
|
103
103
|
type: PropType<UpdateDragEl>;
|
|
104
104
|
};
|
|
105
|
+
disabledDragStart: {
|
|
106
|
+
type: BooleanConstructor;
|
|
107
|
+
};
|
|
105
108
|
}, Services, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "props-panel-mounted")[], "update:modelValue" | "props-panel-mounted", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
106
109
|
/** 页面初始值 */
|
|
107
110
|
modelValue: {
|
|
@@ -200,6 +203,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
200
203
|
updateDragEl: {
|
|
201
204
|
type: PropType<UpdateDragEl>;
|
|
202
205
|
};
|
|
206
|
+
disabledDragStart: {
|
|
207
|
+
type: BooleanConstructor;
|
|
208
|
+
};
|
|
203
209
|
}>> & {
|
|
204
210
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
205
211
|
"onProps-panel-mounted"?: ((...args: any[]) => any) | undefined;
|
|
@@ -222,5 +228,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
222
228
|
containerHighlightClassName: string;
|
|
223
229
|
containerHighlightDuration: number;
|
|
224
230
|
containerHighlightType: ContainerHighlightType;
|
|
231
|
+
disabledDragStart: boolean;
|
|
225
232
|
}>;
|
|
226
233
|
export default _default;
|
|
@@ -1,113 +1,21 @@
|
|
|
1
1
|
import { Id } from '@tmagic/schema';
|
|
2
|
-
declare const _default: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
codeOptions?: Object | undefined;
|
|
20
|
-
/** 编辑器语言 */
|
|
21
|
-
language?: string | undefined;
|
|
22
|
-
}>, {
|
|
23
|
-
editable: boolean;
|
|
24
|
-
autoSaveDraft: boolean;
|
|
25
|
-
}>>> & {
|
|
26
|
-
onSave?: ((...args: any[]) => any) | undefined;
|
|
27
|
-
onClose?: ((...args: any[]) => any) | undefined;
|
|
28
|
-
onSaveAndClose?: ((...args: any[]) => any) | undefined;
|
|
29
|
-
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "editable" | "autoSaveDraft">;
|
|
30
|
-
$attrs: {
|
|
31
|
-
[x: string]: unknown;
|
|
32
|
-
};
|
|
33
|
-
$refs: {
|
|
34
|
-
[x: string]: unknown;
|
|
35
|
-
};
|
|
36
|
-
$slots: Readonly<{
|
|
37
|
-
[name: string]: import("vue").Slot | undefined;
|
|
38
|
-
}>;
|
|
39
|
-
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
40
|
-
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
41
|
-
$emit: (event: "save" | "close" | "saveAndClose", ...args: any[]) => void;
|
|
42
|
-
$el: any;
|
|
43
|
-
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
44
|
-
/** 代码id */
|
|
45
|
-
id: Id;
|
|
46
|
-
/** 代码内容 */
|
|
47
|
-
content: string;
|
|
48
|
-
/** 是否可编辑 */
|
|
49
|
-
editable?: boolean | undefined;
|
|
50
|
-
/** 是否自动保存草稿 */
|
|
51
|
-
autoSaveDraft?: boolean | undefined;
|
|
52
|
-
/** 编辑器参数 */
|
|
53
|
-
codeOptions?: Object | undefined;
|
|
54
|
-
/** 编辑器语言 */
|
|
55
|
-
language?: string | undefined;
|
|
56
|
-
}>, {
|
|
57
|
-
editable: boolean;
|
|
58
|
-
autoSaveDraft: boolean;
|
|
59
|
-
}>>> & {
|
|
60
|
-
onSave?: ((...args: any[]) => any) | undefined;
|
|
61
|
-
onClose?: ((...args: any[]) => any) | undefined;
|
|
62
|
-
onSaveAndClose?: ((...args: any[]) => any) | undefined;
|
|
63
|
-
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("save" | "close" | "saveAndClose")[], string, {
|
|
64
|
-
editable: boolean;
|
|
65
|
-
autoSaveDraft: boolean;
|
|
66
|
-
}> & {
|
|
67
|
-
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
68
|
-
created?: ((() => void) | (() => void)[]) | undefined;
|
|
69
|
-
beforeMount?: ((() => void) | (() => void)[]) | undefined;
|
|
70
|
-
mounted?: ((() => void) | (() => void)[]) | undefined;
|
|
71
|
-
beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
|
|
72
|
-
updated?: ((() => void) | (() => void)[]) | undefined;
|
|
73
|
-
activated?: ((() => void) | (() => void)[]) | undefined;
|
|
74
|
-
deactivated?: ((() => void) | (() => void)[]) | undefined;
|
|
75
|
-
beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
|
|
76
|
-
beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
|
|
77
|
-
destroyed?: ((() => void) | (() => void)[]) | undefined;
|
|
78
|
-
unmounted?: ((() => void) | (() => void)[]) | undefined;
|
|
79
|
-
renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
|
80
|
-
renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
|
81
|
-
errorCaptured?: (((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void)[]) | undefined;
|
|
82
|
-
};
|
|
83
|
-
$forceUpdate: () => void;
|
|
84
|
-
$nextTick: typeof import("vue").nextTick;
|
|
85
|
-
$watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
|
|
86
|
-
} & Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
87
|
-
/** 代码id */
|
|
88
|
-
id: Id;
|
|
89
|
-
/** 代码内容 */
|
|
90
|
-
content: string;
|
|
91
|
-
/** 是否可编辑 */
|
|
92
|
-
editable?: boolean | undefined;
|
|
93
|
-
/** 是否自动保存草稿 */
|
|
94
|
-
autoSaveDraft?: boolean | undefined;
|
|
95
|
-
/** 编辑器参数 */
|
|
96
|
-
codeOptions?: Object | undefined;
|
|
97
|
-
/** 编辑器语言 */
|
|
98
|
-
language?: string | undefined;
|
|
99
|
-
}>, {
|
|
100
|
-
editable: boolean;
|
|
101
|
-
autoSaveDraft: boolean;
|
|
102
|
-
}>>> & {
|
|
103
|
-
onSave?: ((...args: any[]) => any) | undefined;
|
|
104
|
-
onClose?: ((...args: any[]) => any) | undefined;
|
|
105
|
-
onSaveAndClose?: ((...args: any[]) => any) | undefined;
|
|
106
|
-
} & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties;
|
|
107
|
-
__isFragment?: undefined;
|
|
108
|
-
__isTeleport?: undefined;
|
|
109
|
-
__isSuspense?: undefined;
|
|
110
|
-
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
2
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
3
|
+
/** 代码id */
|
|
4
|
+
id: Id;
|
|
5
|
+
/** 代码内容 */
|
|
6
|
+
content: string;
|
|
7
|
+
/** 是否可编辑 */
|
|
8
|
+
editable?: boolean | undefined;
|
|
9
|
+
/** 是否自动保存草稿 */
|
|
10
|
+
autoSaveDraft?: boolean | undefined;
|
|
11
|
+
/** 编辑器参数 */
|
|
12
|
+
codeOptions?: Object | undefined;
|
|
13
|
+
/** 编辑器语言 */
|
|
14
|
+
language?: string | undefined;
|
|
15
|
+
}>, {
|
|
16
|
+
editable: boolean;
|
|
17
|
+
autoSaveDraft: boolean;
|
|
18
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("save" | "close" | "saveAndClose")[], "save" | "close" | "saveAndClose", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
111
19
|
/** 代码id */
|
|
112
20
|
id: Id;
|
|
113
21
|
/** 代码内容 */
|
|
@@ -127,10 +35,10 @@ declare const _default: {
|
|
|
127
35
|
onSave?: ((...args: any[]) => any) | undefined;
|
|
128
36
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
129
37
|
onSaveAndClose?: ((...args: any[]) => any) | undefined;
|
|
130
|
-
}, {
|
|
38
|
+
}, {
|
|
131
39
|
editable: boolean;
|
|
132
40
|
autoSaveDraft: boolean;
|
|
133
|
-
}
|
|
41
|
+
}>;
|
|
134
42
|
export default _default;
|
|
135
43
|
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
136
44
|
declare type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -1,87 +1,14 @@
|
|
|
1
|
-
import { nextTick } from 'vue';
|
|
2
1
|
import { MenuButton, MenuComponent } from '../type';
|
|
3
|
-
declare const _default: {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}>, {
|
|
14
|
-
menuData: () => never[];
|
|
15
|
-
isSubMenu: boolean;
|
|
16
|
-
}>>> & {
|
|
17
|
-
onHide?: ((...args: any[]) => any) | undefined;
|
|
18
|
-
onShow?: ((...args: any[]) => any) | undefined;
|
|
19
|
-
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "menuData" | "isSubMenu">;
|
|
20
|
-
$attrs: {
|
|
21
|
-
[x: string]: unknown;
|
|
22
|
-
};
|
|
23
|
-
$refs: {
|
|
24
|
-
[x: string]: unknown;
|
|
25
|
-
};
|
|
26
|
-
$slots: Readonly<{
|
|
27
|
-
[name: string]: import("vue").Slot | undefined;
|
|
28
|
-
}>;
|
|
29
|
-
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
30
|
-
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
31
|
-
$emit: (event: "hide" | "show", ...args: any[]) => void;
|
|
32
|
-
$el: any;
|
|
33
|
-
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
34
|
-
menuData?: (MenuButton | MenuComponent)[] | undefined;
|
|
35
|
-
isSubMenu?: boolean | undefined;
|
|
36
|
-
}>, {
|
|
37
|
-
menuData: () => never[];
|
|
38
|
-
isSubMenu: boolean;
|
|
39
|
-
}>>> & {
|
|
40
|
-
onHide?: ((...args: any[]) => any) | undefined;
|
|
41
|
-
onShow?: ((...args: any[]) => any) | undefined;
|
|
42
|
-
}, {
|
|
43
|
-
hide: () => void;
|
|
44
|
-
show: (e: MouseEvent) => void;
|
|
45
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("hide" | "show")[], string, {
|
|
46
|
-
menuData: (MenuButton | MenuComponent)[];
|
|
47
|
-
isSubMenu: boolean;
|
|
48
|
-
}> & {
|
|
49
|
-
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
50
|
-
created?: ((() => void) | (() => void)[]) | undefined;
|
|
51
|
-
beforeMount?: ((() => void) | (() => void)[]) | undefined;
|
|
52
|
-
mounted?: ((() => void) | (() => void)[]) | undefined;
|
|
53
|
-
beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
|
|
54
|
-
updated?: ((() => void) | (() => void)[]) | undefined;
|
|
55
|
-
activated?: ((() => void) | (() => void)[]) | undefined;
|
|
56
|
-
deactivated?: ((() => void) | (() => void)[]) | undefined;
|
|
57
|
-
beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
|
|
58
|
-
beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
|
|
59
|
-
destroyed?: ((() => void) | (() => void)[]) | undefined;
|
|
60
|
-
unmounted?: ((() => void) | (() => void)[]) | undefined;
|
|
61
|
-
renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
|
62
|
-
renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
|
63
|
-
errorCaptured?: (((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void)[]) | undefined;
|
|
64
|
-
};
|
|
65
|
-
$forceUpdate: () => void;
|
|
66
|
-
$nextTick: typeof nextTick;
|
|
67
|
-
$watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
|
|
68
|
-
} & Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
69
|
-
menuData?: (MenuButton | MenuComponent)[] | undefined;
|
|
70
|
-
isSubMenu?: boolean | undefined;
|
|
71
|
-
}>, {
|
|
72
|
-
menuData: () => never[];
|
|
73
|
-
isSubMenu: boolean;
|
|
74
|
-
}>>> & {
|
|
75
|
-
onHide?: ((...args: any[]) => any) | undefined;
|
|
76
|
-
onShow?: ((...args: any[]) => any) | undefined;
|
|
77
|
-
} & import("vue").ShallowUnwrapRef<{
|
|
78
|
-
hide: () => void;
|
|
79
|
-
show: (e: MouseEvent) => void;
|
|
80
|
-
}> & {} & import("vue").ComponentCustomProperties;
|
|
81
|
-
__isFragment?: undefined;
|
|
82
|
-
__isTeleport?: undefined;
|
|
83
|
-
__isSuspense?: undefined;
|
|
84
|
-
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
2
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
3
|
+
menuData?: (MenuButton | MenuComponent)[] | undefined;
|
|
4
|
+
isSubMenu?: boolean | undefined;
|
|
5
|
+
}>, {
|
|
6
|
+
menuData: () => never[];
|
|
7
|
+
isSubMenu: boolean;
|
|
8
|
+
}>, {
|
|
9
|
+
hide: () => void;
|
|
10
|
+
show: (e: MouseEvent) => void;
|
|
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<{
|
|
85
12
|
menuData?: (MenuButton | MenuComponent)[] | undefined;
|
|
86
13
|
isSubMenu?: boolean | undefined;
|
|
87
14
|
}>, {
|
|
@@ -91,12 +18,9 @@ declare const _default: {
|
|
|
91
18
|
onHide?: ((...args: any[]) => any) | undefined;
|
|
92
19
|
onShow?: ((...args: any[]) => any) | undefined;
|
|
93
20
|
}, {
|
|
94
|
-
hide: () => void;
|
|
95
|
-
show: (e: MouseEvent) => void;
|
|
96
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("hide" | "show")[], "hide" | "show", {
|
|
97
21
|
menuData: (MenuButton | MenuComponent)[];
|
|
98
22
|
isSubMenu: boolean;
|
|
99
|
-
}
|
|
23
|
+
}>;
|
|
100
24
|
export default _default;
|
|
101
25
|
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
102
26
|
declare type __VLS_TypePropsToRuntimeProps<T> = {
|