@tmagic/editor 1.3.6 → 1.3.7
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/LICENSE +5432 -0
- package/dist/style.css +15 -11
- package/dist/tmagic-editor.js +1312 -949
- package/dist/tmagic-editor.js.map +1 -1
- package/dist/tmagic-editor.umd.cjs +1334 -969
- package/dist/tmagic-editor.umd.cjs.map +1 -1
- package/package.json +17 -17
- package/src/Editor.vue +10 -7
- package/src/components/CodeBlockEditor.vue +2 -2
- package/src/components/ContentMenu.vue +5 -5
- package/src/components/ScrollBar.vue +2 -2
- package/src/components/ScrollViewer.vue +2 -2
- package/src/components/SplitView.vue +2 -2
- package/src/components/TreeNode.vue +3 -3
- package/src/editorProps.ts +14 -4
- package/src/fields/PageFragmentSelect.vue +55 -0
- package/src/hooks/use-getso.ts +2 -2
- package/src/hooks/use-stage.ts +18 -1
- package/src/index.ts +3 -0
- package/src/initService.ts +15 -5
- package/src/layouts/AddPageBox.vue +16 -4
- package/src/layouts/CodeEditor.vue +2 -2
- package/src/layouts/Framework.vue +17 -3
- package/src/layouts/PropsPanel.vue +2 -2
- package/src/layouts/page-bar/AddButton.vue +48 -0
- package/src/layouts/page-bar/PageBar.vue +158 -0
- package/src/layouts/{workspace → page-bar}/PageBarScrollContainer.vue +61 -35
- package/src/layouts/page-bar/SwitchTypeButton.vue +45 -0
- package/src/layouts/sidebar/Sidebar.vue +2 -0
- package/src/layouts/sidebar/layer/LayerMenu.vue +39 -27
- package/src/layouts/sidebar/layer/LayerPanel.vue +7 -1
- package/src/layouts/sidebar/layer/use-click.ts +5 -3
- package/src/layouts/sidebar/layer/use-keybinding.ts +8 -8
- package/src/layouts/sidebar/layer/use-node-status.ts +3 -3
- package/src/layouts/workspace/Workspace.vue +6 -7
- package/src/layouts/workspace/viewer/NodeListMenu.vue +2 -2
- package/src/layouts/workspace/viewer/Stage.vue +12 -5
- package/src/layouts/workspace/viewer/ViewerMenu.vue +93 -80
- package/src/services/editor.ts +65 -34
- package/src/services/history.ts +6 -2
- package/src/services/keybinding.ts +48 -13
- package/src/theme/code-block.scss +0 -16
- package/src/theme/page-bar.scss +18 -1
- package/src/type.ts +22 -7
- package/src/utils/content-menu.ts +2 -2
- package/src/utils/editor.ts +22 -15
- package/src/utils/operator.ts +4 -4
- package/types/components/ToolButton.vue.d.ts +2 -2
- package/types/editorProps.d.ts +11 -2
- package/types/fields/PageFragmentSelect.vue.d.ts +31 -0
- package/types/index.d.ts +1 -0
- package/types/layouts/AddPageBox.vue.d.ts +14 -1
- package/types/layouts/Framework.vue.d.ts +14 -1
- package/types/layouts/PropsPanel.vue.d.ts +9 -9
- package/types/layouts/page-bar/AddButton.vue.d.ts +16 -0
- package/types/layouts/page-bar/PageBar.vue.d.ts +28 -0
- package/types/layouts/page-bar/PageBarScrollContainer.vue.d.ts +24 -0
- package/types/layouts/page-bar/SwitchTypeButton.vue.d.ts +20 -0
- package/types/layouts/sidebar/Sidebar.vue.d.ts +2 -0
- package/types/layouts/sidebar/layer/LayerMenu.vue.d.ts +22 -3
- package/types/layouts/sidebar/layer/LayerPanel.vue.d.ts +2 -0
- package/types/layouts/sidebar/layer/use-click.d.ts +25 -3
- package/types/layouts/sidebar/layer/use-keybinding.d.ts +1 -1
- package/types/layouts/workspace/Workspace.vue.d.ts +2 -0
- package/types/layouts/workspace/viewer/Stage.vue.d.ts +2 -0
- package/types/layouts/workspace/viewer/ViewerMenu.vue.d.ts +8 -0
- package/types/services/dataSource.d.ts +1 -0
- package/types/services/editor.d.ts +3 -2
- package/types/services/history.d.ts +3 -2
- package/types/services/keybinding.d.ts +21 -1
- package/types/type.d.ts +25 -12
- package/types/utils/editor.d.ts +9 -7
- package/src/layouts/workspace/PageBar.vue +0 -87
- package/types/layouts/workspace/PageBar.vue.d.ts +0 -15
- package/types/layouts/workspace/PageBarScrollContainer.vue.d.ts +0 -9
package/src/theme/page-bar.scss
CHANGED
|
@@ -1,7 +1,24 @@
|
|
|
1
|
-
.m-editor-page-bar {
|
|
1
|
+
.m-editor-page-bar-tabs {
|
|
2
2
|
position: fixed;
|
|
3
3
|
bottom: 0;
|
|
4
4
|
left: 0;
|
|
5
|
+
width: 100%;
|
|
6
|
+
|
|
7
|
+
.tmagic-design-button.m-editor-page-bar-switch-type-button {
|
|
8
|
+
margin-left: 7px;
|
|
9
|
+
position: relative;
|
|
10
|
+
top: 1px;
|
|
11
|
+
border-radius: 3px 3px 0 0;
|
|
12
|
+
border: 1px solid $--border-color;
|
|
13
|
+
border-bottom: 1px solid transparent;
|
|
14
|
+
|
|
15
|
+
&.active {
|
|
16
|
+
background-color: #f3f3f3;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.m-editor-page-bar {
|
|
5
22
|
display: flex;
|
|
6
23
|
width: 100%;
|
|
7
24
|
height: $--page-bar-height;
|
package/src/type.ts
CHANGED
|
@@ -19,11 +19,12 @@
|
|
|
19
19
|
import type { Component } from 'vue';
|
|
20
20
|
|
|
21
21
|
import type { ColumnConfig, FilterFunction, FormConfig, FormItem } from '@tmagic/form';
|
|
22
|
-
import type { CodeBlockContent, CodeBlockDSL, Id, MApp, MContainer, MNode, MPage } from '@tmagic/schema';
|
|
22
|
+
import type { CodeBlockContent, CodeBlockDSL, Id, MApp, MContainer, MNode, MPage, MPageFragment } from '@tmagic/schema';
|
|
23
23
|
import type StageCore from '@tmagic/stage';
|
|
24
24
|
import type {
|
|
25
25
|
ContainerHighlightType,
|
|
26
26
|
CustomizeMoveableOptionsCallbackConfig,
|
|
27
|
+
GuidesOptions,
|
|
27
28
|
MoveableOptions,
|
|
28
29
|
RenderType,
|
|
29
30
|
UpdateDragEl,
|
|
@@ -53,13 +54,13 @@ export interface FrameworkSlots {
|
|
|
53
54
|
workspace(props: {}): any;
|
|
54
55
|
'props-panel'(props: {}): any;
|
|
55
56
|
'footer'(props: {}): any;
|
|
57
|
+
'page-bar-title'(props: { page: MPage | MPageFragment }): any;
|
|
58
|
+
'page-bar-popover'(props: { page: MPage | MPageFragment }): any;
|
|
56
59
|
}
|
|
57
60
|
|
|
58
61
|
export interface WorkspaceSlots {
|
|
59
62
|
stage(props: {}): any;
|
|
60
63
|
'workspace-content'(props: {}): any;
|
|
61
|
-
'page-bar-title'(props: { page: MPage }): any;
|
|
62
|
-
'page-bar-popover'(props: { page: MPage }): any;
|
|
63
64
|
}
|
|
64
65
|
|
|
65
66
|
export interface ComponentListPanelSlots {
|
|
@@ -131,18 +132,23 @@ export interface StageOptions {
|
|
|
131
132
|
isContainer: (el: HTMLElement) => boolean | Promise<boolean>;
|
|
132
133
|
updateDragEl: UpdateDragEl;
|
|
133
134
|
renderType: RenderType;
|
|
135
|
+
guidesOptions: Partial<GuidesOptions>;
|
|
136
|
+
disabledMultiSelect?: boolean;
|
|
134
137
|
}
|
|
135
138
|
|
|
136
139
|
export interface StoreState {
|
|
137
140
|
root: MApp | null;
|
|
138
|
-
page: MPage | null;
|
|
141
|
+
page: MPage | MPageFragment | null;
|
|
139
142
|
parent: MContainer | null;
|
|
140
143
|
node: MNode | null;
|
|
141
144
|
highlightNode: MNode | null;
|
|
142
145
|
nodes: MNode[];
|
|
143
146
|
stage: StageCore | null;
|
|
147
|
+
stageLoading: boolean;
|
|
144
148
|
modifiedNodeIds: Map<Id, Id>;
|
|
145
149
|
pageLength: number;
|
|
150
|
+
pageFragmentLength: number;
|
|
151
|
+
disabledMultiSelect: boolean;
|
|
146
152
|
}
|
|
147
153
|
|
|
148
154
|
export type StoreStateKey = keyof StoreState;
|
|
@@ -223,7 +229,7 @@ export interface UiState {
|
|
|
223
229
|
export interface EditorNodeInfo {
|
|
224
230
|
node: MNode | null;
|
|
225
231
|
parent: MContainer | null;
|
|
226
|
-
page: MPage | null;
|
|
232
|
+
page: MPage | MPageFragment | null;
|
|
227
233
|
}
|
|
228
234
|
|
|
229
235
|
export interface AddMNode {
|
|
@@ -488,7 +494,7 @@ export interface CodeParamStatement {
|
|
|
488
494
|
}
|
|
489
495
|
|
|
490
496
|
export interface StepValue {
|
|
491
|
-
data: MPage;
|
|
497
|
+
data: MPage | MPageFragment;
|
|
492
498
|
modifiedNodeIds: Map<Id, Id>;
|
|
493
499
|
nodeId: Id;
|
|
494
500
|
}
|
|
@@ -571,7 +577,7 @@ export interface KeyBindingCacheItem {
|
|
|
571
577
|
command: KeyBindingCommand | string;
|
|
572
578
|
keybinding?: string | string[];
|
|
573
579
|
eventType: 'keyup' | 'keydown';
|
|
574
|
-
|
|
580
|
+
bound: boolean;
|
|
575
581
|
}
|
|
576
582
|
|
|
577
583
|
export interface CodeSelectColConfig {
|
|
@@ -583,6 +589,15 @@ export interface CodeSelectColConfig {
|
|
|
583
589
|
display?: boolean | FilterFunction;
|
|
584
590
|
}
|
|
585
591
|
|
|
592
|
+
export interface PageFragmentSelectConfig {
|
|
593
|
+
type: 'page-fragment-select';
|
|
594
|
+
name: string;
|
|
595
|
+
text: string;
|
|
596
|
+
labelWidth?: number | string;
|
|
597
|
+
disabled?: boolean | FilterFunction;
|
|
598
|
+
display?: boolean | FilterFunction;
|
|
599
|
+
}
|
|
600
|
+
|
|
586
601
|
export interface DataSourceMethodSelectConfig {
|
|
587
602
|
type: 'data-source-method-select';
|
|
588
603
|
name: string;
|
|
@@ -2,7 +2,7 @@ import { computed, markRaw, Ref } from 'vue';
|
|
|
2
2
|
import { CopyDocument, Delete, DocumentCopy } from '@element-plus/icons-vue';
|
|
3
3
|
|
|
4
4
|
import { Id, MContainer, NodeType } from '@tmagic/schema';
|
|
5
|
-
import { isPage } from '@tmagic/utils';
|
|
5
|
+
import { isPage, isPageFragment } from '@tmagic/utils';
|
|
6
6
|
|
|
7
7
|
import ContentMenu from '@editor/components/ContentMenu.vue';
|
|
8
8
|
import type { MenuButton, Services } from '@editor/type';
|
|
@@ -15,7 +15,7 @@ export const useDeleteMenu = (): MenuButton => ({
|
|
|
15
15
|
icon: Delete,
|
|
16
16
|
display: (services) => {
|
|
17
17
|
const node = services?.editorService?.get('node');
|
|
18
|
-
return node?.type !== NodeType.ROOT && !isPage(node);
|
|
18
|
+
return node?.type !== NodeType.ROOT && !isPage(node) && !isPageFragment(node);
|
|
19
19
|
},
|
|
20
20
|
handler: (services) => {
|
|
21
21
|
const nodes = services?.editorService?.get('nodes');
|
package/src/utils/editor.ts
CHANGED
|
@@ -18,24 +18,29 @@
|
|
|
18
18
|
|
|
19
19
|
import serialize from 'serialize-javascript';
|
|
20
20
|
|
|
21
|
-
import type { Id, MApp, MContainer, MNode, MPage } from '@tmagic/schema';
|
|
21
|
+
import type { Id, MApp, MContainer, MNode, MPage, MPageFragment } from '@tmagic/schema';
|
|
22
22
|
import { NodeType } from '@tmagic/schema';
|
|
23
23
|
import type StageCore from '@tmagic/stage';
|
|
24
|
-
import { getNodePath, isNumber, isPage, isPop } from '@tmagic/utils';
|
|
24
|
+
import { getNodePath, isNumber, isPage, isPageFragment, isPop } from '@tmagic/utils';
|
|
25
25
|
|
|
26
26
|
import { Layout } from '@editor/type';
|
|
27
27
|
export const COPY_STORAGE_KEY = '$MagicEditorCopyData';
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
* 获取所有页面配置
|
|
31
|
-
* @param
|
|
31
|
+
* @param root DSL跟节点
|
|
32
32
|
* @returns 所有页面配置
|
|
33
33
|
*/
|
|
34
|
-
export const getPageList = (
|
|
35
|
-
if (
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
export const getPageList = (root?: MApp | null): MPage[] => {
|
|
35
|
+
if (!root) return [];
|
|
36
|
+
if (!Array.isArray(root.items)) return [];
|
|
37
|
+
return root.items.filter((item) => isPage(item)) as MPage[];
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const getPageFragmentList = (root?: MApp | null): MPageFragment[] => {
|
|
41
|
+
if (!root) return [];
|
|
42
|
+
if (!Array.isArray(root.items)) return [];
|
|
43
|
+
return root.items.filter((item) => isPageFragment(item)) as MPageFragment[];
|
|
39
44
|
};
|
|
40
45
|
|
|
41
46
|
/**
|
|
@@ -43,22 +48,23 @@ export const getPageList = (app: MApp): MPage[] => {
|
|
|
43
48
|
* @param pages 所有页面配置
|
|
44
49
|
* @returns 所有页面名称
|
|
45
50
|
*/
|
|
46
|
-
export const getPageNameList = (pages: MPage[]): string[] =>
|
|
51
|
+
export const getPageNameList = (pages: (MPage | MPageFragment)[]): string[] =>
|
|
52
|
+
pages.map((page) => page.name || 'index');
|
|
47
53
|
|
|
48
54
|
/**
|
|
49
55
|
* 新增页面时,生成页面名称
|
|
50
56
|
* @param {Object} pageNameList 所有页面名称
|
|
51
57
|
* @returns {string}
|
|
52
58
|
*/
|
|
53
|
-
export const generatePageName = (pageNameList: string[]): string => {
|
|
59
|
+
export const generatePageName = (pageNameList: string[], type: NodeType.PAGE | NodeType.PAGE_FRAGMENT): string => {
|
|
54
60
|
let pageLength = pageNameList.length;
|
|
55
61
|
|
|
56
|
-
if (!pageLength) return
|
|
62
|
+
if (!pageLength) return `${type}_index`;
|
|
57
63
|
|
|
58
|
-
let pageName =
|
|
64
|
+
let pageName = `${type}_${pageLength}`;
|
|
59
65
|
while (pageNameList.includes(pageName)) {
|
|
60
66
|
pageLength += 1;
|
|
61
|
-
pageName =
|
|
67
|
+
pageName = `${type}_${pageLength}`;
|
|
62
68
|
}
|
|
63
69
|
|
|
64
70
|
return pageName;
|
|
@@ -69,7 +75,8 @@ export const generatePageName = (pageNameList: string[]): string => {
|
|
|
69
75
|
* @param {Object} app 所有页面配置
|
|
70
76
|
* @returns {string}
|
|
71
77
|
*/
|
|
72
|
-
export const generatePageNameByApp = (app: MApp): string =>
|
|
78
|
+
export const generatePageNameByApp = (app: MApp, type: NodeType.PAGE | NodeType.PAGE_FRAGMENT): string =>
|
|
79
|
+
generatePageName(getPageNameList(type === 'page' ? getPageList(app) : getPageFragmentList(app)), type);
|
|
73
80
|
|
|
74
81
|
/**
|
|
75
82
|
* @param {Object} node
|
|
@@ -129,7 +136,7 @@ export const getInitPositionStyle = (style: Record<string, any> = {}, layout: La
|
|
|
129
136
|
return style;
|
|
130
137
|
};
|
|
131
138
|
|
|
132
|
-
export const
|
|
139
|
+
export const setChildrenLayout = (node: MContainer, layout: Layout) => {
|
|
133
140
|
node.items?.forEach((child: MNode) => {
|
|
134
141
|
setLayout(child, layout);
|
|
135
142
|
});
|
package/src/utils/operator.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { toRaw } from 'vue';
|
|
2
2
|
import { isEmpty } from 'lodash-es';
|
|
3
3
|
|
|
4
|
-
import { Id, MContainer, MNode } from '@tmagic/schema';
|
|
5
|
-
import { isPage } from '@tmagic/utils';
|
|
4
|
+
import { Id, MContainer, MNode, NodeType } from '@tmagic/schema';
|
|
5
|
+
import { isPage, isPageFragment } from '@tmagic/utils';
|
|
6
6
|
|
|
7
7
|
import editorService from '@editor/services/editor';
|
|
8
8
|
import propsService from '@editor/services/props';
|
|
@@ -58,8 +58,8 @@ export const beforePaste = async (position: PastePosition, config: MNode[]): Pro
|
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
60
|
const root = editorService.get('root');
|
|
61
|
-
if (isPage(pasteConfig) && root) {
|
|
62
|
-
pasteConfig.name = generatePageNameByApp(root);
|
|
61
|
+
if ((isPage(pasteConfig) || isPageFragment(pasteConfig)) && root) {
|
|
62
|
+
pasteConfig.name = generatePageNameByApp(root, isPage(pasteConfig) ? NodeType.PAGE : NodeType.PAGE_FRAGMENT);
|
|
63
63
|
}
|
|
64
64
|
return pasteConfig as MNode;
|
|
65
65
|
}),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { MenuButton, MenuComponent } from '../type';
|
|
2
2
|
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
3
3
|
data?: MenuButton | MenuComponent | undefined;
|
|
4
|
-
eventType?: "
|
|
4
|
+
eventType?: "mousedown" | "mouseup" | "click" | undefined;
|
|
5
5
|
}>, {
|
|
6
6
|
data: () => {
|
|
7
7
|
type: string;
|
|
@@ -10,7 +10,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
10
10
|
eventType: string;
|
|
11
11
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
12
12
|
data?: MenuButton | MenuComponent | undefined;
|
|
13
|
-
eventType?: "
|
|
13
|
+
eventType?: "mousedown" | "mouseup" | "click" | undefined;
|
|
14
14
|
}>, {
|
|
15
15
|
data: () => {
|
|
16
16
|
type: string;
|
package/types/editorProps.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { EventOption } from '@tmagic/core';
|
|
2
|
-
import { CustomTargetOptions } from '@tmagic/dep';
|
|
2
|
+
import type { CustomTargetOptions } from '@tmagic/dep';
|
|
3
3
|
import type { FormConfig, FormState } from '@tmagic/form';
|
|
4
4
|
import type { DataSourceSchema, Id, MApp, MNode } from '@tmagic/schema';
|
|
5
|
-
import StageCore, { ContainerHighlightType, CustomizeMoveableOptionsCallbackConfig, MoveableOptions, RenderType, UpdateDragEl } from '@tmagic/stage';
|
|
5
|
+
import StageCore, { ContainerHighlightType, type CustomizeMoveableOptionsCallbackConfig, type GuidesOptions, type MoveableOptions, RenderType, type UpdateDragEl } from '@tmagic/stage';
|
|
6
6
|
import type { ComponentGroup, DatasourceTypeOption, MenuBarData, MenuButton, MenuComponent, SideBarData, StageRect } from './type';
|
|
7
7
|
export interface EditorProps {
|
|
8
8
|
/** 页面初始值 */
|
|
@@ -62,6 +62,13 @@ export interface EditorProps {
|
|
|
62
62
|
extendFormState?: (state: FormState) => Record<string, any> | Promise<Record<string, any>>;
|
|
63
63
|
/** 自定义依赖收集器,复制组件时会将关联依赖一并复制 */
|
|
64
64
|
collectorOptions?: CustomTargetOptions;
|
|
65
|
+
/** 标尺配置 */
|
|
66
|
+
guidesOptions?: Partial<GuidesOptions>;
|
|
67
|
+
/** 禁止多选 */
|
|
68
|
+
disabledMultiSelect?: boolean;
|
|
69
|
+
/** 禁用页面片 */
|
|
70
|
+
disabledPageFragment?: boolean;
|
|
71
|
+
customContentMenu?: (menus: (MenuButton | MenuComponent)[], type: string) => (MenuButton | MenuComponent)[];
|
|
65
72
|
}
|
|
66
73
|
export declare const defaultEditorProps: {
|
|
67
74
|
componentGroupList: () => never[];
|
|
@@ -84,4 +91,6 @@ export declare const defaultEditorProps: {
|
|
|
84
91
|
containerHighlightType: ContainerHighlightType;
|
|
85
92
|
codeOptions: () => {};
|
|
86
93
|
renderType: RenderType;
|
|
94
|
+
disabledMultiSelect: boolean;
|
|
95
|
+
disabledPageFragment: boolean;
|
|
87
96
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { FieldProps } from '@tmagic/form';
|
|
2
|
+
import type { PageFragmentSelectConfig } from '../type';
|
|
3
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<FieldProps<PageFragmentSelectConfig>>, {
|
|
4
|
+
disabled: boolean;
|
|
5
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
|
+
change: (...args: any[]) => void;
|
|
7
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<FieldProps<PageFragmentSelectConfig>>, {
|
|
8
|
+
disabled: boolean;
|
|
9
|
+
}>>> & {
|
|
10
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
11
|
+
}, {
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
}, {}>;
|
|
14
|
+
export default _default;
|
|
15
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
16
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
17
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
18
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
19
|
+
} : {
|
|
20
|
+
type: import('vue').PropType<T[K]>;
|
|
21
|
+
required: true;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
type __VLS_WithDefaults<P, D> = {
|
|
25
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
26
|
+
default: D[K];
|
|
27
|
+
}> : P[K];
|
|
28
|
+
};
|
|
29
|
+
type __VLS_Prettify<T> = {
|
|
30
|
+
[K in keyof T]: T[K];
|
|
31
|
+
} & {};
|
package/types/index.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ export { default as LayoutContainer } from './components/SplitView.vue';
|
|
|
41
41
|
export { default as SplitView } from './components/SplitView.vue';
|
|
42
42
|
export { default as Resizer } from './components/Resizer.vue';
|
|
43
43
|
export { default as CodeBlockEditor } from './components/CodeBlockEditor.vue';
|
|
44
|
+
export { default as PageFragmentSelect } from './fields/PageFragmentSelect.vue';
|
|
44
45
|
declare const _default: {
|
|
45
46
|
install: (app: App, opt?: Partial<InstallOptions>) => void;
|
|
46
47
|
};
|
|
@@ -1,2 +1,15 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<
|
|
1
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
|
|
2
|
+
disabledPageFragment: boolean;
|
|
3
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
4
|
+
disabledPageFragment: boolean;
|
|
5
|
+
}>>>, {}, {}>;
|
|
2
6
|
export default _default;
|
|
7
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
8
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
9
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
10
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
11
|
+
} : {
|
|
12
|
+
type: import('vue').PropType<T[K]>;
|
|
13
|
+
required: true;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
import type { FrameworkSlots } from '../type';
|
|
2
|
-
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<
|
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
|
|
3
|
+
disabledPageFragment: boolean;
|
|
4
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
5
|
+
disabledPageFragment: boolean;
|
|
6
|
+
}>>>, {}, {}>, Readonly<FrameworkSlots>>;
|
|
3
7
|
export default _default;
|
|
8
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
9
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
10
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
11
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
12
|
+
} : {
|
|
13
|
+
type: import('vue').PropType<T[K]>;
|
|
14
|
+
required: true;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
4
17
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
5
18
|
new (): {
|
|
6
19
|
$slots: S;
|
|
@@ -59,14 +59,14 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
59
59
|
size: {
|
|
60
60
|
type: import("vue").PropType<"default" | "small" | "large">;
|
|
61
61
|
};
|
|
62
|
+
popperClass: {
|
|
63
|
+
type: import("vue").PropType<string>;
|
|
64
|
+
};
|
|
62
65
|
initValues: {
|
|
63
66
|
type: import("vue").PropType<Record<string, any>>;
|
|
64
67
|
required: true;
|
|
65
68
|
default: () => {};
|
|
66
69
|
};
|
|
67
|
-
popperClass: {
|
|
68
|
-
type: import("vue").PropType<string>;
|
|
69
|
-
};
|
|
70
70
|
extendState: {
|
|
71
71
|
type: import("vue").PropType<(state: FormState) => Record<string, any> | Promise<Record<string, any>>>;
|
|
72
72
|
};
|
|
@@ -137,14 +137,14 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
137
137
|
size: {
|
|
138
138
|
type: import("vue").PropType<"default" | "small" | "large">;
|
|
139
139
|
};
|
|
140
|
+
popperClass: {
|
|
141
|
+
type: import("vue").PropType<string>;
|
|
142
|
+
};
|
|
140
143
|
initValues: {
|
|
141
144
|
type: import("vue").PropType<Record<string, any>>;
|
|
142
145
|
required: true;
|
|
143
146
|
default: () => {};
|
|
144
147
|
};
|
|
145
|
-
popperClass: {
|
|
146
|
-
type: import("vue").PropType<string>;
|
|
147
|
-
};
|
|
148
148
|
extendState: {
|
|
149
149
|
type: import("vue").PropType<(state: FormState) => Record<string, any> | Promise<Record<string, any>>>;
|
|
150
150
|
};
|
|
@@ -246,14 +246,14 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
246
246
|
size: {
|
|
247
247
|
type: import("vue").PropType<"default" | "small" | "large">;
|
|
248
248
|
};
|
|
249
|
+
popperClass: {
|
|
250
|
+
type: import("vue").PropType<string>;
|
|
251
|
+
};
|
|
249
252
|
initValues: {
|
|
250
253
|
type: import("vue").PropType<Record<string, any>>;
|
|
251
254
|
required: true;
|
|
252
255
|
default: () => {};
|
|
253
256
|
};
|
|
254
|
-
popperClass: {
|
|
255
|
-
type: import("vue").PropType<string>;
|
|
256
|
-
};
|
|
257
257
|
extendState: {
|
|
258
258
|
type: import("vue").PropType<(state: FormState) => Record<string, any> | Promise<Record<string, any>>>;
|
|
259
259
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { NodeType } from '@tmagic/schema';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
|
|
3
|
+
type: NodeType.PAGE | NodeType.PAGE_FRAGMENT;
|
|
4
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
5
|
+
type: NodeType.PAGE | NodeType.PAGE_FRAGMENT;
|
|
6
|
+
}>>>, {}, {}>;
|
|
7
|
+
export default _default;
|
|
8
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
9
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
10
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
11
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
12
|
+
} : {
|
|
13
|
+
type: import('vue').PropType<T[K]>;
|
|
14
|
+
required: true;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type MPage, type MPageFragment } from '@tmagic/schema';
|
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
|
|
3
|
+
disabledPageFragment: boolean;
|
|
4
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
5
|
+
disabledPageFragment: boolean;
|
|
6
|
+
}>>>, {}, {}>, {
|
|
7
|
+
"page-bar-title"?(_: {
|
|
8
|
+
page: MPage | MPageFragment;
|
|
9
|
+
}): any;
|
|
10
|
+
"page-bar-popover"?(_: {
|
|
11
|
+
page: MPage | MPageFragment;
|
|
12
|
+
}): any;
|
|
13
|
+
}>;
|
|
14
|
+
export default _default;
|
|
15
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
16
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
17
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
18
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
19
|
+
} : {
|
|
20
|
+
type: import('vue').PropType<T[K]>;
|
|
21
|
+
required: true;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
25
|
+
new (): {
|
|
26
|
+
$slots: S;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { NodeType } from '@tmagic/schema';
|
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
|
|
3
|
+
type: NodeType.PAGE | NodeType.PAGE_FRAGMENT;
|
|
4
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
5
|
+
type: NodeType.PAGE | NodeType.PAGE_FRAGMENT;
|
|
6
|
+
}>>>, {}, {}>, {
|
|
7
|
+
prepend?(_: {}): any;
|
|
8
|
+
default?(_: {}): any;
|
|
9
|
+
}>;
|
|
10
|
+
export default _default;
|
|
11
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
12
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
13
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
14
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
15
|
+
} : {
|
|
16
|
+
type: import('vue').PropType<T[K]>;
|
|
17
|
+
required: true;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
21
|
+
new (): {
|
|
22
|
+
$slots: S;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { NodeType } from '@tmagic/schema';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
|
|
3
|
+
modelValue: NodeType.PAGE | NodeType.PAGE_FRAGMENT;
|
|
4
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
5
|
+
"update:modelValue": (value: NodeType.PAGE | NodeType.PAGE_FRAGMENT) => void;
|
|
6
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
7
|
+
modelValue: NodeType.PAGE | NodeType.PAGE_FRAGMENT;
|
|
8
|
+
}>>> & {
|
|
9
|
+
"onUpdate:modelValue"?: ((value: NodeType.PAGE | NodeType.PAGE_FRAGMENT) => any) | undefined;
|
|
10
|
+
}, {}, {}>;
|
|
11
|
+
export default _default;
|
|
12
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
13
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
14
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
15
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
16
|
+
} : {
|
|
17
|
+
type: import('vue').PropType<T[K]>;
|
|
18
|
+
required: true;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -2,6 +2,7 @@ import type { MenuButton, MenuComponent, SideBarData } from '../../type';
|
|
|
2
2
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
3
3
|
data: SideBarData;
|
|
4
4
|
layerContentMenu: (MenuButton | MenuComponent)[];
|
|
5
|
+
customContentMenu?: ((menus: (MenuButton | MenuComponent)[], type: string) => (MenuButton | MenuComponent)[]) | undefined;
|
|
5
6
|
}>, {
|
|
6
7
|
data: () => {
|
|
7
8
|
type: string;
|
|
@@ -13,6 +14,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
13
14
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
14
15
|
data: SideBarData;
|
|
15
16
|
layerContentMenu: (MenuButton | MenuComponent)[];
|
|
17
|
+
customContentMenu?: ((menus: (MenuButton | MenuComponent)[], type: string) => (MenuButton | MenuComponent)[]) | undefined;
|
|
16
18
|
}>, {
|
|
17
19
|
data: () => {
|
|
18
20
|
type: string;
|
|
@@ -1,15 +1,26 @@
|
|
|
1
1
|
import type { MenuButton, MenuComponent } from '../../../type';
|
|
2
|
-
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
|
|
2
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
3
3
|
layerContentMenu: (MenuButton | MenuComponent)[];
|
|
4
|
+
customContentMenu?: ((menus: (MenuButton | MenuComponent)[], type: string) => (MenuButton | MenuComponent)[]) | undefined;
|
|
5
|
+
}>, {
|
|
6
|
+
layerContentMenu: () => never[];
|
|
7
|
+
customContentMenu: (menus: (MenuButton | MenuComponent)[]) => (MenuButton | MenuComponent)[];
|
|
4
8
|
}>, {
|
|
5
9
|
show: (e: MouseEvent) => void;
|
|
6
10
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
11
|
"collapse-all": () => void;
|
|
8
|
-
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
12
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
9
13
|
layerContentMenu: (MenuButton | MenuComponent)[];
|
|
14
|
+
customContentMenu?: ((menus: (MenuButton | MenuComponent)[], type: string) => (MenuButton | MenuComponent)[]) | undefined;
|
|
15
|
+
}>, {
|
|
16
|
+
layerContentMenu: () => never[];
|
|
17
|
+
customContentMenu: (menus: (MenuButton | MenuComponent)[]) => (MenuButton | MenuComponent)[];
|
|
10
18
|
}>>> & {
|
|
11
19
|
"onCollapse-all"?: (() => any) | undefined;
|
|
12
|
-
}, {
|
|
20
|
+
}, {
|
|
21
|
+
layerContentMenu: (MenuButton | MenuComponent)[];
|
|
22
|
+
customContentMenu: (menus: (MenuButton | MenuComponent)[], type: string) => (MenuButton | MenuComponent)[];
|
|
23
|
+
}, {}>;
|
|
13
24
|
export default _default;
|
|
14
25
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
15
26
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -20,3 +31,11 @@ type __VLS_TypePropsToRuntimeProps<T> = {
|
|
|
20
31
|
required: true;
|
|
21
32
|
};
|
|
22
33
|
};
|
|
34
|
+
type __VLS_WithDefaults<P, D> = {
|
|
35
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
36
|
+
default: D[K];
|
|
37
|
+
}> : P[K];
|
|
38
|
+
};
|
|
39
|
+
type __VLS_Prettify<T> = {
|
|
40
|
+
[K in keyof T]: T[K];
|
|
41
|
+
} & {};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { LayerPanelSlots, MenuButton, MenuComponent } from '../../../type';
|
|
2
2
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
|
|
3
3
|
layerContentMenu: (MenuButton | MenuComponent)[];
|
|
4
|
+
customContentMenu?: ((menus: (MenuButton | MenuComponent)[], type: string) => (MenuButton | MenuComponent)[]) | undefined;
|
|
4
5
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
5
6
|
layerContentMenu: (MenuButton | MenuComponent)[];
|
|
7
|
+
customContentMenu?: ((menus: (MenuButton | MenuComponent)[], type: string) => (MenuButton | MenuComponent)[]) | undefined;
|
|
6
8
|
}>>>, {}, {}>, Readonly<LayerPanelSlots>>;
|
|
7
9
|
export default _default;
|
|
8
10
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|