@tmagic/editor 1.2.0-beta.11 → 1.2.0-beta.13

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.
@@ -0,0 +1,148 @@
1
+ import { Id } from '@tmagic/schema';
2
+ declare const _default: {
3
+ new (...args: any[]): {
4
+ $: import("vue").ComponentInternalInstance;
5
+ $data: {};
6
+ $props: Partial<{
7
+ editable: boolean;
8
+ autoSaveDraft: boolean;
9
+ }> & Omit<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
10
+ /** 代码id */
11
+ id: Id;
12
+ /** 代码内容 */
13
+ content: string;
14
+ /** 是否可编辑 */
15
+ editable?: boolean | undefined;
16
+ /** 是否自动保存草稿 */
17
+ autoSaveDraft?: boolean | undefined;
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<{
111
+ /** 代码id */
112
+ id: Id;
113
+ /** 代码内容 */
114
+ content: string;
115
+ /** 是否可编辑 */
116
+ editable?: boolean | undefined;
117
+ /** 是否自动保存草稿 */
118
+ autoSaveDraft?: boolean | undefined;
119
+ /** 编辑器参数 */
120
+ codeOptions?: Object | undefined;
121
+ /** 编辑器语言 */
122
+ language?: string | undefined;
123
+ }>, {
124
+ editable: boolean;
125
+ autoSaveDraft: boolean;
126
+ }>>> & {
127
+ onSave?: ((...args: any[]) => any) | undefined;
128
+ onClose?: ((...args: any[]) => any) | undefined;
129
+ onSaveAndClose?: ((...args: any[]) => any) | undefined;
130
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("save" | "close" | "saveAndClose")[], "save" | "close" | "saveAndClose", {
131
+ editable: boolean;
132
+ autoSaveDraft: boolean;
133
+ }> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
134
+ export default _default;
135
+ declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
136
+ declare type __VLS_TypePropsToRuntimeProps<T> = {
137
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
138
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
139
+ } : {
140
+ type: import('vue').PropType<T[K]>;
141
+ required: true;
142
+ };
143
+ };
144
+ declare type __VLS_WithDefaults<P, D> = {
145
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? P[K] & {
146
+ default: D[K];
147
+ } : P[K];
148
+ };
@@ -0,0 +1,120 @@
1
+ import { Id } from '@tmagic/schema';
2
+ declare const _default: {
3
+ new (...args: any[]): {
4
+ $: import("vue").ComponentInternalInstance;
5
+ $data: {};
6
+ $props: Partial<{
7
+ editable: boolean;
8
+ autoSaveDraft: boolean;
9
+ }> & Omit<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
10
+ id: Id;
11
+ name: string;
12
+ content: string;
13
+ editable?: boolean | undefined;
14
+ autoSaveDraft?: boolean | undefined;
15
+ codeOptions?: object | undefined;
16
+ }>, {
17
+ editable: boolean;
18
+ autoSaveDraft: boolean;
19
+ }>>> & {
20
+ onChange?: ((...args: any[]) => any) | undefined;
21
+ "onField-input"?: ((...args: any[]) => any) | undefined;
22
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "editable" | "autoSaveDraft">;
23
+ $attrs: {
24
+ [x: string]: unknown;
25
+ };
26
+ $refs: {
27
+ [x: string]: unknown;
28
+ };
29
+ $slots: Readonly<{
30
+ [name: string]: import("vue").Slot | undefined;
31
+ }>;
32
+ $root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
33
+ $parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
34
+ $emit: (event: "change" | "field-input", ...args: any[]) => void;
35
+ $el: any;
36
+ $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
37
+ id: Id;
38
+ name: string;
39
+ content: string;
40
+ editable?: boolean | undefined;
41
+ autoSaveDraft?: boolean | undefined;
42
+ codeOptions?: object | undefined;
43
+ }>, {
44
+ editable: boolean;
45
+ autoSaveDraft: boolean;
46
+ }>>> & {
47
+ onChange?: ((...args: any[]) => any) | undefined;
48
+ "onField-input"?: ((...args: any[]) => any) | undefined;
49
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "field-input")[], string, {
50
+ editable: boolean;
51
+ autoSaveDraft: boolean;
52
+ }> & {
53
+ beforeCreate?: ((() => void) | (() => void)[]) | undefined;
54
+ created?: ((() => void) | (() => void)[]) | undefined;
55
+ beforeMount?: ((() => void) | (() => void)[]) | undefined;
56
+ mounted?: ((() => void) | (() => void)[]) | undefined;
57
+ beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
58
+ updated?: ((() => void) | (() => void)[]) | undefined;
59
+ activated?: ((() => void) | (() => void)[]) | undefined;
60
+ deactivated?: ((() => void) | (() => void)[]) | undefined;
61
+ beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
62
+ beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
63
+ destroyed?: ((() => void) | (() => void)[]) | undefined;
64
+ unmounted?: ((() => void) | (() => void)[]) | undefined;
65
+ renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
66
+ renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
67
+ 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;
68
+ };
69
+ $forceUpdate: () => void;
70
+ $nextTick: typeof import("vue").nextTick;
71
+ $watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
72
+ } & Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
73
+ id: Id;
74
+ name: string;
75
+ content: string;
76
+ editable?: boolean | undefined;
77
+ autoSaveDraft?: boolean | undefined;
78
+ codeOptions?: object | undefined;
79
+ }>, {
80
+ editable: boolean;
81
+ autoSaveDraft: boolean;
82
+ }>>> & {
83
+ onChange?: ((...args: any[]) => any) | undefined;
84
+ "onField-input"?: ((...args: any[]) => any) | undefined;
85
+ } & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties;
86
+ __isFragment?: undefined;
87
+ __isTeleport?: undefined;
88
+ __isSuspense?: undefined;
89
+ } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
90
+ id: Id;
91
+ name: string;
92
+ content: string;
93
+ editable?: boolean | undefined;
94
+ autoSaveDraft?: boolean | undefined;
95
+ codeOptions?: object | undefined;
96
+ }>, {
97
+ editable: boolean;
98
+ autoSaveDraft: boolean;
99
+ }>>> & {
100
+ onChange?: ((...args: any[]) => any) | undefined;
101
+ "onField-input"?: ((...args: any[]) => any) | undefined;
102
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "field-input")[], "change" | "field-input", {
103
+ editable: boolean;
104
+ autoSaveDraft: boolean;
105
+ }> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
106
+ export default _default;
107
+ declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
108
+ declare type __VLS_TypePropsToRuntimeProps<T> = {
109
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
110
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
111
+ } : {
112
+ type: import('vue').PropType<T[K]>;
113
+ required: true;
114
+ };
115
+ };
116
+ declare type __VLS_WithDefaults<P, D> = {
117
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? P[K] & {
118
+ default: D[K];
119
+ } : P[K];
120
+ };
@@ -1,16 +1,16 @@
1
- import { SelectConfig } from '@tmagic/form';
1
+ import { TableConfig } from '@tmagic/form';
2
2
  declare const _default: {
3
3
  new (...args: any[]): {
4
4
  $: import("vue").ComponentInternalInstance;
5
5
  $data: {};
6
6
  $props: Partial<{}> & Omit<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
7
7
  config: {
8
- selectConfig?: SelectConfig | undefined;
8
+ tableConfig?: TableConfig | undefined;
9
9
  };
10
10
  model: any;
11
11
  prop: string;
12
12
  name: string;
13
- size: string;
13
+ size: 'mini' | 'small' | 'medium';
14
14
  }>>> & {
15
15
  onChange?: ((...args: any[]) => any) | undefined;
16
16
  } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>;
@@ -29,12 +29,12 @@ declare const _default: {
29
29
  $el: any;
30
30
  $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
31
31
  config: {
32
- selectConfig?: SelectConfig | undefined;
32
+ tableConfig?: TableConfig | undefined;
33
33
  };
34
34
  model: any;
35
35
  prop: string;
36
36
  name: string;
37
- size: string;
37
+ size: 'mini' | 'small' | 'medium';
38
38
  }>>> & {
39
39
  onChange?: ((...args: any[]) => any) | undefined;
40
40
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "change"[], string, {}> & {
@@ -59,12 +59,12 @@ declare const _default: {
59
59
  $watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
60
60
  } & Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
61
61
  config: {
62
- selectConfig?: SelectConfig | undefined;
62
+ tableConfig?: TableConfig | undefined;
63
63
  };
64
64
  model: any;
65
65
  prop: string;
66
66
  name: string;
67
- size: string;
67
+ size: 'mini' | 'small' | 'medium';
68
68
  }>>> & {
69
69
  onChange?: ((...args: any[]) => any) | undefined;
70
70
  } & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties;
@@ -73,12 +73,12 @@ declare const _default: {
73
73
  __isSuspense?: undefined;
74
74
  } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
75
75
  config: {
76
- selectConfig?: SelectConfig | undefined;
76
+ tableConfig?: TableConfig | undefined;
77
77
  };
78
78
  model: any;
79
79
  prop: string;
80
80
  name: string;
81
- size: string;
81
+ size: 'mini' | 'small' | 'medium';
82
82
  }>>> & {
83
83
  onChange?: ((...args: any[]) => any) | undefined;
84
84
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "change"[], "change", {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
@@ -4,7 +4,6 @@ declare const _default: {
4
4
  $: import("vue").ComponentInternalInstance;
5
5
  $data: {};
6
6
  $props: Partial<{
7
- type: string;
8
7
  options: {
9
8
  [key: string]: any;
10
9
  };
@@ -13,14 +12,13 @@ declare const _default: {
13
12
  }> & Omit<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
14
13
  initValues?: string | Object | undefined;
15
14
  modifiedValues?: string | Object | undefined;
16
- type?: string | undefined;
15
+ type?: "diff" | undefined;
17
16
  language?: string | undefined;
18
17
  options?: {
19
18
  [key: string]: any;
20
19
  } | undefined;
21
20
  autoSave?: boolean | undefined;
22
21
  }>, {
23
- type: string;
24
22
  autoSave: boolean;
25
23
  language: string;
26
24
  options: () => {
@@ -29,7 +27,7 @@ declare const _default: {
29
27
  }>>> & {
30
28
  onSave?: ((...args: any[]) => any) | undefined;
31
29
  onInitd?: ((...args: any[]) => any) | undefined;
32
- } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "type" | "options" | "language" | "autoSave">;
30
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "options" | "language" | "autoSave">;
33
31
  $attrs: {
34
32
  [x: string]: unknown;
35
33
  };
@@ -46,14 +44,13 @@ declare const _default: {
46
44
  $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
47
45
  initValues?: string | Object | undefined;
48
46
  modifiedValues?: string | Object | undefined;
49
- type?: string | undefined;
47
+ type?: "diff" | undefined;
50
48
  language?: string | undefined;
51
49
  options?: {
52
50
  [key: string]: any;
53
51
  } | undefined;
54
52
  autoSave?: boolean | undefined;
55
53
  }>, {
56
- type: string;
57
54
  autoSave: boolean;
58
55
  language: string;
59
56
  options: () => {
@@ -67,7 +64,6 @@ declare const _default: {
67
64
  setEditorValue: (v: string | any, m: string | any) => void | undefined;
68
65
  focus(): void;
69
66
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("save" | "initd")[], string, {
70
- type: string;
71
67
  options: {
72
68
  [key: string]: any;
73
69
  };
@@ -96,14 +92,13 @@ declare const _default: {
96
92
  } & Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
97
93
  initValues?: string | Object | undefined;
98
94
  modifiedValues?: string | Object | undefined;
99
- type?: string | undefined;
95
+ type?: "diff" | undefined;
100
96
  language?: string | undefined;
101
97
  options?: {
102
98
  [key: string]: any;
103
99
  } | undefined;
104
100
  autoSave?: boolean | undefined;
105
101
  }>, {
106
- type: string;
107
102
  autoSave: boolean;
108
103
  language: string;
109
104
  options: () => {
@@ -123,14 +118,13 @@ declare const _default: {
123
118
  } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
124
119
  initValues?: string | Object | undefined;
125
120
  modifiedValues?: string | Object | undefined;
126
- type?: string | undefined;
121
+ type?: "diff" | undefined;
127
122
  language?: string | undefined;
128
123
  options?: {
129
124
  [key: string]: any;
130
125
  } | undefined;
131
126
  autoSave?: boolean | undefined;
132
127
  }>, {
133
- type: string;
134
128
  autoSave: boolean;
135
129
  language: string;
136
130
  options: () => {
@@ -144,7 +138,6 @@ declare const _default: {
144
138
  setEditorValue: (v: string | any, m: string | any) => void | undefined;
145
139
  focus(): void;
146
140
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("save" | "initd")[], "save" | "initd", {
147
- type: string;
148
141
  options: {
149
142
  [key: string]: any;
150
143
  };
@@ -43,7 +43,7 @@ declare const _default: {
43
43
  } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
44
44
  $slots: {
45
45
  'code-block-edit-panel-header': (_: {
46
- id: string;
46
+ id: import("@tmagic/schema").Id;
47
47
  }) => any;
48
48
  };
49
49
  });
@@ -1,10 +1,11 @@
1
+ import { Id } from '@tmagic/schema';
1
2
  import { CodeDeleteErrorType } from '../../../type';
2
3
  declare const _default: {
3
4
  new (...args: any[]): {
4
5
  $: import("vue").ComponentInternalInstance;
5
6
  $data: {};
6
7
  $props: Partial<{}> & Omit<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
7
- customError?: ((id: string, errorType: CodeDeleteErrorType) => any) | undefined;
8
+ customError?: ((id: Id, errorType: CodeDeleteErrorType) => any) | undefined;
8
9
  }>>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>;
9
10
  $attrs: {
10
11
  [x: string]: unknown;
@@ -20,7 +21,7 @@ declare const _default: {
20
21
  $emit: (event: string, ...args: any[]) => void;
21
22
  $el: any;
22
23
  $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
23
- customError?: ((id: string, errorType: CodeDeleteErrorType) => any) | undefined;
24
+ customError?: ((id: Id, errorType: CodeDeleteErrorType) => any) | undefined;
24
25
  }>>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {}> & {
25
26
  beforeCreate?: ((() => void) | (() => void)[]) | undefined;
26
27
  created?: ((() => void) | (() => void)[]) | undefined;
@@ -42,13 +43,13 @@ declare const _default: {
42
43
  $nextTick: typeof import("vue").nextTick;
43
44
  $watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
44
45
  } & Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
45
- customError?: ((id: string, errorType: CodeDeleteErrorType) => any) | undefined;
46
+ customError?: ((id: Id, errorType: CodeDeleteErrorType) => any) | undefined;
46
47
  }>>> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties;
47
48
  __isFragment?: undefined;
48
49
  __isTeleport?: undefined;
49
50
  __isSuspense?: undefined;
50
51
  } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
51
- customError?: ((id: string, errorType: CodeDeleteErrorType) => any) | undefined;
52
+ customError?: ((id: Id, errorType: CodeDeleteErrorType) => any) | undefined;
52
53
  }>>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
53
54
  $slots: {
54
55
  'code-block-panel-header': (_: {}) => any;
@@ -57,7 +58,7 @@ declare const _default: {
57
58
  data: any;
58
59
  }) => any;
59
60
  'code-block-edit-panel-header': (_: {
60
- id: string;
61
+ id: Id;
61
62
  }) => any;
62
63
  };
63
64
  });
@@ -1,6 +1,6 @@
1
- import { Id, MNode } from '@tmagic/schema';
2
- import type { CodeBlockContent, CodeBlockDSL } from '../type';
3
- import { CodeEditorMode, CodeSelectOp } from '../type';
1
+ import { CodeBlockContent, CodeBlockDSL, Id, MNode } from '@tmagic/schema';
2
+ import type { CodeRelation } from '../type';
3
+ import { CodeEditorMode } from '../type';
4
4
  import BaseService from './BaseService';
5
5
  declare class CodeBlock extends BaseService {
6
6
  private state;
@@ -13,23 +13,25 @@ declare class CodeBlock extends BaseService {
13
13
  setCodeDsl(codeDsl: CodeBlockDSL): Promise<void>;
14
14
  /**
15
15
  * 获取活动的代码块dsl数据源(默认从dsl中的codeBlocks字段读取)
16
+ * 方法要支持钩子添加扩展,会被重写为异步方法,因此这里显示写为异步以提醒调用者需以异步形式调用
16
17
  * @param {boolean} forceRefresh 是否强制从活动dsl拉取刷新
17
18
  * @returns {CodeBlockDSL | null}
18
19
  */
19
20
  getCodeDsl(forceRefresh?: boolean): Promise<CodeBlockDSL | null>;
21
+ getCodeDslSync(forceRefresh?: boolean): CodeBlockDSL | null;
20
22
  /**
21
23
  * 根据代码块id获取代码块内容
22
- * @param {string} id 代码块id
24
+ * @param {Id} id 代码块id
23
25
  * @returns {CodeBlockContent | null}
24
26
  */
25
- getCodeContentById(id: string): Promise<CodeBlockContent | null>;
27
+ getCodeContentById(id: Id): Promise<CodeBlockContent | null>;
26
28
  /**
27
29
  * 设置代码块ID和代码内容到源dsl
28
- * @param {string} id 代码块id
30
+ * @param {Id} id 代码块id
29
31
  * @param {CodeBlockContent} codeConfig 代码块内容配置信息
30
32
  * @returns {void}
31
33
  */
32
- setCodeDslById(id: string, codeConfig: CodeBlockContent): Promise<void>;
34
+ setCodeDslById(id: Id, codeConfig: CodeBlockContent): Promise<void>;
33
35
  /**
34
36
  * 根据代码块id数组获取代码dsl
35
37
  * @param {string[]} ids 代码块id数组
@@ -50,10 +52,10 @@ declare class CodeBlock extends BaseService {
50
52
  /**
51
53
  * 设置代码编辑面板展示状态及展示内容
52
54
  * @param {boolean} status 是否展示代码编辑面板
53
- * @param {string} id 代码块id
55
+ * @param {Id} id 代码块id
54
56
  * @returns {void}
55
57
  */
56
- setCodeEditorContent(status: boolean, id: string): void;
58
+ setCodeEditorContent(status: boolean, id: Id): void;
57
59
  /**
58
60
  * 获取当前选中的代码块内容
59
61
  * @returns {CodeBlockContent | null}
@@ -72,15 +74,15 @@ declare class CodeBlock extends BaseService {
72
74
  setEditStatus(status: boolean): Promise<void>;
73
75
  /**
74
76
  * 设置当前选中的代码块ID
75
- * @param {string} id 代码块id
77
+ * @param {Id} id 代码块id
76
78
  * @returns {void}
77
79
  */
78
- setId(id: string): void;
80
+ setId(id: Id): void;
79
81
  /**
80
82
  * 获取当前选中的代码块ID
81
- * @returns {string} id 代码块id
83
+ * @returns {Id} id 代码块id
82
84
  */
83
- getId(): string;
85
+ getId(): Id;
84
86
  /**
85
87
  * 获取当前模式
86
88
  * @returns {CodeEditorMode}
@@ -104,43 +106,49 @@ declare class CodeBlock extends BaseService {
104
106
  */
105
107
  getCombineIds(): string[];
106
108
  /**
107
- * 设置绑定关系
108
- * @param {Id} 组件id
109
- * @param {string[]} diffCodeIds 代码块id数组
110
- * @param {CodeSelectOp} opFlag 操作类型
111
- * @param {string} hook 代码块挂载hook名称
109
+ * 刷新绑定关系
112
110
  * @returns {void}
113
111
  */
114
- setCombineRelation(compId: Id, diffCodeIds: string[], opFlag: CodeSelectOp, hook: string): Promise<void>;
112
+ refreshCombineInfo(): CodeRelation | null;
113
+ /**
114
+ * 获取绑定关系
115
+ * @returns {CodeRelation}
116
+ */
117
+ getCombineInfo(): CodeRelation;
115
118
  /**
116
119
  * 获取不可删除列表
117
- * @returns {string[]}
120
+ * @returns {Id[]}
118
121
  */
119
- getUndeletableList(): string[];
122
+ getUndeletableList(): Id[];
120
123
  /**
121
124
  * 设置不可删除列表:为业务逻辑预留的不可删除的代码块列表,由业务逻辑维护(如代码块上线后不可删除)
122
- * @param {string[]} codeIds 代码块id数组
125
+ * @param {Id[]} codeIds 代码块id数组
123
126
  * @returns {void}
124
127
  */
125
- setUndeleteableList(codeIds: string[]): Promise<void>;
128
+ setUndeleteableList(codeIds: Id[]): Promise<void>;
129
+ /**
130
+ * 设置代码草稿
131
+ */
132
+ setCodeDraft(codeId: Id, content: string): void;
133
+ /**
134
+ * 获取代码草稿
135
+ */
136
+ getCodeDraft(codeId: Id): string | null;
137
+ /**
138
+ * 删除代码草稿
139
+ */
140
+ removeCodeDraft(codeId: Id): void;
126
141
  /**
127
142
  * 在dsl数据源中删除指定id的代码块
128
- * @param {string[]} codeIds 需要删除的代码块id数组
143
+ * @param {Id[]} codeIds 需要删除的代码块id数组
129
144
  * @returns {CodeBlockDSL} 删除后的code dsl
130
145
  */
131
- deleteCodeDslByIds(codeIds: string[]): Promise<CodeBlockDSL>;
146
+ deleteCodeDslByIds(codeIds: Id[]): Promise<CodeBlockDSL>;
132
147
  /**
133
148
  * 生成代码块唯一id
134
- * @returns {string} 代码块唯一id
135
- */
136
- getUniqueId(): Promise<string>;
137
- /**
138
- * 一对一解除绑定关系 功能隐藏,暂时注释
139
- * @param {string} compId 组件id
140
- * @param {string} codeId 代码块id
141
- * @param {string[]} codeHooks 代码块挂载hook名称
142
- * @returns {boolean} 结果
149
+ * @returns {Id} 代码块唯一id
143
150
  */
151
+ getUniqueId(): Promise<Id>;
144
152
  /**
145
153
  * 通过组件id解除绑定关系(删除组件)
146
154
  * @param {MNode} compId 组件节点
@@ -148,7 +156,19 @@ declare class CodeBlock extends BaseService {
148
156
  */
149
157
  deleteCompsInRelation(node: MNode): Promise<void>;
150
158
  destroy(): void;
151
- private recurseNodes;
159
+ /**
160
+ * 删除组件时 如果是容器 需要遍历删除其包含节点的绑定信息
161
+ * @param {MNode} node 节点信息
162
+ * @param {CodeBlockDSL} codeDsl 代码块
163
+ * @returns void
164
+ */
165
+ private refreshRelationDeep;
166
+ /**
167
+ * 递归遍历dsl中挂载了代码块的节点,并更新绑定关系数据
168
+ * @param {MContainer} node 节点信息
169
+ * @returns void
170
+ */
171
+ private recurseMNode;
152
172
  }
153
173
  export declare type CodeBlockService = CodeBlock;
154
174
  declare const _default: CodeBlock;
@@ -143,6 +143,7 @@ declare class Editor extends BaseService {
143
143
  * @returns {CodeBlockDSL | null}
144
144
  */
145
145
  getCodeDsl(): Promise<CodeBlockDSL | null>;
146
+ getCodeDslSync(): CodeBlockDSL | null;
146
147
  /**
147
148
  * 设置代码块到dsl的codeBlocks字段
148
149
  * @param {CodeBlockDSL} codeDsl 代码DSL