@tmagic/editor 1.1.6 → 1.2.0-beta.2

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.
Files changed (45) hide show
  1. package/dist/style.css +177 -0
  2. package/dist/tmagic-editor.mjs +1456 -524
  3. package/dist/tmagic-editor.mjs.map +1 -1
  4. package/dist/tmagic-editor.umd.js +1448 -510
  5. package/dist/tmagic-editor.umd.js.map +1 -1
  6. package/package.json +7 -7
  7. package/src/Editor.vue +18 -1
  8. package/src/fields/Code.vue +4 -1
  9. package/src/fields/CodeLink.vue +19 -11
  10. package/src/fields/CodeSelect.vue +139 -0
  11. package/src/index.ts +6 -2
  12. package/src/layouts/AddPageBox.vue +11 -19
  13. package/src/layouts/CodeEditor.vue +106 -120
  14. package/src/layouts/Layout.vue +1 -1
  15. package/src/layouts/PropsPanel.vue +1 -1
  16. package/src/layouts/sidebar/LayerMenu.vue +86 -91
  17. package/src/layouts/sidebar/Sidebar.vue +30 -24
  18. package/src/layouts/sidebar/TabPane.vue +57 -40
  19. package/src/layouts/sidebar/code-block/CodeBlockEditor.vue +164 -0
  20. package/src/layouts/sidebar/code-block/CodeBlockList.vue +267 -0
  21. package/src/services/codeBlock.ts +415 -0
  22. package/src/services/editor.ts +27 -1
  23. package/src/theme/code-block.scss +184 -0
  24. package/src/theme/index.scss +1 -13
  25. package/src/theme/layout.scss +5 -0
  26. package/src/theme/theme.scss +15 -0
  27. package/src/type.ts +87 -1
  28. package/src/utils/props.ts +9 -3
  29. package/types/fields/Code.vue.d.ts +8 -0
  30. package/types/fields/CodeLink.vue.d.ts +4 -0
  31. package/types/fields/CodeSelect.vue.d.ts +96 -0
  32. package/types/index.d.ts +3 -0
  33. package/types/layouts/AddPageBox.vue.d.ts +45 -3
  34. package/types/layouts/CodeEditor.vue.d.ts +160 -45
  35. package/types/layouts/sidebar/LayerMenu.vue.d.ts +16 -64
  36. package/types/layouts/sidebar/LayerPanel.vue.d.ts +8 -196
  37. package/types/layouts/sidebar/Sidebar.vue.d.ts +114 -17
  38. package/types/layouts/sidebar/TabPane.vue.d.ts +80 -12
  39. package/types/layouts/sidebar/code-block/CodeBlockEditor.vue.d.ts +50 -0
  40. package/types/layouts/sidebar/code-block/CodeBlockList.vue.d.ts +73 -0
  41. package/types/services/codeBlock.d.ts +155 -0
  42. package/types/services/editor.d.ts +12 -1
  43. package/types/services/props.d.ts +12 -0
  44. package/types/type.d.ts +77 -1
  45. package/types/utils/props.d.ts +12 -0
@@ -19,11 +19,12 @@
19
19
  import { reactive, toRaw } from 'vue';
20
20
  import { cloneDeep, mergeWith, uniq } from 'lodash-es';
21
21
 
22
- import type { Id, MApp, MComponent, MContainer, MNode, MPage } from '@tmagic/schema';
22
+ import type { CodeBlockDSL, Id, MApp, MComponent, MContainer, MNode, MPage } from '@tmagic/schema';
23
23
  import { NodeType } from '@tmagic/schema';
24
24
  import StageCore from '@tmagic/stage';
25
25
  import { getNodePath, isNumber, isPage, isPop } from '@tmagic/utils';
26
26
 
27
+ import codeBlockService from '../services/codeBlock';
27
28
  import historyService, { StepValue } from '../services/history';
28
29
  import storageService, { Protocol } from '../services/storage';
29
30
  import type { AddMNode, EditorNodeInfo, PastePosition, StoreState } from '../type';
@@ -80,6 +81,8 @@ class Editor extends BaseService {
80
81
  'undo',
81
82
  'redo',
82
83
  'highlight',
84
+ 'getCodeDsl',
85
+ 'setCodeDsl',
83
86
  ],
84
87
  // 需要注意循环依赖问题,如果函数间有相互调用的话,不能设置为串行调用
85
88
  ['select', 'update', 'moveLayer'],
@@ -419,6 +422,9 @@ class Editor extends BaseService {
419
422
  }
420
423
 
421
424
  this.addModifiedNodeId(parent.id);
425
+
426
+ // 通知codeBlockService解除绑定关系
427
+ codeBlockService.deleteCompsInRelation(node);
422
428
  }
423
429
 
424
430
  /**
@@ -760,6 +766,26 @@ class Editor extends BaseService {
760
766
  this.get<Map<Id, Id>>('modifiedNodeIds').clear();
761
767
  }
762
768
 
769
+ /**
770
+ * 从dsl中的codeBlocks字段读取活动的代码块
771
+ * @returns {CodeBlockDSL | null}
772
+ */
773
+ public async getCodeDsl(): Promise<CodeBlockDSL | null> {
774
+ const root = this.get<MApp | null>('root');
775
+ if (!root) return null;
776
+ return root.codeBlocks || null;
777
+ }
778
+
779
+ /**
780
+ * 设置代码块到dsl的codeBlocks字段
781
+ * @param {CodeBlockDSL} codeDsl 代码DSL
782
+ * @returns {void}
783
+ */
784
+ public async setCodeDsl(codeDsl: CodeBlockDSL): Promise<void> {
785
+ if (!this.state.root) return;
786
+ this.state.root.codeBlocks = codeDsl;
787
+ }
788
+
763
789
  private addModifiedNodeId(id: Id) {
764
790
  if (!this.isHistoryStateChange) {
765
791
  this.get<Map<Id, Id>>('modifiedNodeIds').set(id, id);
@@ -0,0 +1,184 @@
1
+ .m-editor-code-block-list {
2
+ margin-top: 5px;
3
+ .el-tree-node__content {
4
+ height: auto;
5
+ }
6
+ .code-header-wrapper {
7
+ display: flex;
8
+ align-items: center;
9
+ justify-content: center;
10
+ .code-filter-input {
11
+ margin: 0 5px;
12
+ }
13
+ .code-filter-input-no-btn {
14
+ margin-left: 5px;
15
+ margin-right: 10px;
16
+ }
17
+ .create-code-button {
18
+ margin-left: 2px;
19
+ margin-right: 10px;
20
+ }
21
+ }
22
+
23
+ .divider {
24
+ margin: 10px 0 0 0;
25
+ }
26
+
27
+ .list-container {
28
+ width: 100%;
29
+ overflow: hidden;
30
+ margin-left: -25px;
31
+ .list-item {
32
+ display: flex;
33
+ align-items: center;
34
+ .right-tool {
35
+ position: absolute;
36
+ right: 15px;
37
+ padding-left: 5px;
38
+ display: flex;
39
+ align-items: center;
40
+ .edit-icon {
41
+ margin: 0 5px;
42
+ }
43
+ }
44
+ .code-name {
45
+ font-size: 14px;
46
+ overflow: hidden;
47
+ white-space: nowrap;
48
+ text-overflow: ellipsis;
49
+ padding: 10px 15px;
50
+ margin-right: 60px;
51
+ }
52
+ }
53
+ .code-comp-map-wrapper {
54
+ display: flex;
55
+ align-items: center;
56
+ flex-wrap: wrap;
57
+ margin-left: 20px;
58
+ margin-bottom: 5px;
59
+ .arrow-left {
60
+ transform: rotate(-45deg);
61
+ width: 20px;
62
+ height: 20px;
63
+ }
64
+ .code-comp {
65
+ margin-left: 5px;
66
+ padding: 5px;
67
+ .comp-delete-icon {
68
+ margin-left: 3px;
69
+ }
70
+ }
71
+ }
72
+ }
73
+ }
74
+
75
+ .m-fields-code-select {
76
+ width: 100%;
77
+ .el-card__body {
78
+ padding: 5px;
79
+ }
80
+ .tool-bar {
81
+ display: flex;
82
+ align-items: center;
83
+ justify-content: end;
84
+ height: 20px;
85
+ .tool-item {
86
+ display: flex;
87
+ align-items: center;
88
+ }
89
+ }
90
+ }
91
+ .code-editor-dialog {
92
+ .el-dialog__body {
93
+ height: 90%;
94
+ padding-top: 10px;
95
+ }
96
+ .el-card {
97
+ height: 100%;
98
+ background: #fff;
99
+ .el-card__body {
100
+ height: calc(100% - 80px);
101
+ background: #fff;
102
+ }
103
+ }
104
+
105
+ .code-editor-layout {
106
+ height: 100%;
107
+ border: 1px solid #e4e7ed;
108
+
109
+ .side-tree {
110
+ height: 100%;
111
+ overflow: auto;
112
+
113
+ .list-container {
114
+ width: 100%;
115
+ overflow: hidden;
116
+ margin-left: -10px;
117
+ .list-item {
118
+ width: 100%;
119
+ margin: 10px 0;
120
+ line-height: 30px;
121
+ .code-name {
122
+ width: 100%;
123
+ font-size: 14px;
124
+ overflow: hidden;
125
+ white-space: nowrap;
126
+ text-overflow: ellipsis;
127
+ }
128
+ }
129
+ }
130
+ }
131
+ }
132
+
133
+ .code-name-wrapper {
134
+ display: flex;
135
+ align-items: center;
136
+ font-size: 16px;
137
+ .code-name-label {
138
+ margin-right: 10px;
139
+ }
140
+ .code-name-input {
141
+ width: 300px;
142
+ }
143
+ }
144
+
145
+ .m-editor-code-block-editor-panel-list-mode {
146
+ height: 100%;
147
+ z-index: 10;
148
+ background: #fff;
149
+ .el-card {
150
+ border: 0;
151
+ }
152
+ }
153
+
154
+ .m-editor-code-block-editor-panel {
155
+ position: absolute;
156
+ top: 0;
157
+ left: 4px;
158
+ width: calc(100% - 9px);
159
+ height: 100%;
160
+ z-index: 10;
161
+ background: #fff;
162
+ .el-card {
163
+ border: 0;
164
+ }
165
+ }
166
+
167
+ .m-editor-wrapper {
168
+ height: 100%;
169
+ .m-editor-container {
170
+ height: calc(100% - 70px);
171
+ }
172
+ .m-editor-content-bottom {
173
+ height: 40px;
174
+ width: 100%;
175
+ display: flex;
176
+ justify-content: end;
177
+ background: #fff;
178
+ > button {
179
+ height: 30px;
180
+ margin-top: 15px;
181
+ }
182
+ }
183
+ }
184
+ }
@@ -1,14 +1,2 @@
1
1
  @import "./common/var.scss";
2
- @import "./nav-menu.scss";
3
- @import "./framework.scss";
4
- @import "./sidebar.scss";
5
- @import "./layer-panel.scss";
6
- @import "./component-list-panel.scss";
7
- @import "./resizer.scss";
8
- @import "./workspace.scss";
9
- @import "./page-bar.scss";
10
- @import "./props-panel.scss";
11
- @import "./content-menu.scss";
12
- @import "./stage.scss";
13
- @import "./code-editor.scss";
14
- @import "./icon.scss";
2
+ @import "./theme.scss";
@@ -0,0 +1,5 @@
1
+ .m-editor-layout {
2
+ width: 100%;
3
+ display: flex;
4
+ justify-self: space-between;
5
+ }
@@ -0,0 +1,15 @@
1
+ @import "./nav-menu.scss";
2
+ @import "./framework.scss";
3
+ @import "./sidebar.scss";
4
+ @import "./layer-panel.scss";
5
+ @import "./component-list-panel.scss";
6
+ @import "./resizer.scss";
7
+ @import "./workspace.scss";
8
+ @import "./page-bar.scss";
9
+ @import "./props-panel.scss";
10
+ @import "./content-menu.scss";
11
+ @import "./stage.scss";
12
+ @import "./code-editor.scss";
13
+ @import "./icon.scss";
14
+ @import "./code-block.scss";
15
+ @import "./layout.scss";
package/src/type.ts CHANGED
@@ -23,6 +23,7 @@ import type { Id, MApp, MContainer, MNode, MPage } from '@tmagic/schema';
23
23
  import type StageCore from '@tmagic/stage';
24
24
  import type { ContainerHighlightType, MoveableOptions } from '@tmagic/stage';
25
25
 
26
+ import type { CodeBlockService } from './services/codeBlock';
26
27
  import type { ComponentListService } from './services/componentList';
27
28
  import type { EditorService } from './services/editor';
28
29
  import type { EventsService } from './services/events';
@@ -46,6 +47,7 @@ export interface Services {
46
47
  propsService: PropsService;
47
48
  componentListService: ComponentListService;
48
49
  uiService: UiService;
50
+ codeBlockService: CodeBlockService;
49
51
  }
50
52
 
51
53
  export interface StageOptions {
@@ -243,7 +245,7 @@ export interface SideComponent extends MenuComponent {
243
245
  * component-list: 组件列表
244
246
  * layer: 已选组件树
245
247
  */
246
- export type SideItem = 'component-list' | 'layer' | SideComponent;
248
+ export type SideItem = 'component-list' | 'layer' | 'code-block' | SideComponent;
247
249
 
248
250
  /** 工具栏 */
249
251
  export interface SideBarData {
@@ -305,3 +307,87 @@ export interface ScrollViewerEvent {
305
307
  scrollHeight: number;
306
308
  scrollWidth: number;
307
309
  }
310
+
311
+ export interface CodeBlockDSL {
312
+ [id: string]: CodeBlockContent;
313
+ }
314
+
315
+ export interface CodeBlockContent {
316
+ /** 代码块名称 */
317
+ name: string;
318
+ /** 代码块内容 */
319
+ content: string;
320
+ /** 代码块与组件的绑定关系 */
321
+ comps?: CodeRelation;
322
+ /** 扩展字段 */
323
+ [propName: string]: any;
324
+ }
325
+
326
+ export type CodeState = {
327
+ /** 是否展示代码块编辑区 */
328
+ isShowCodeEditor: boolean;
329
+ /** 代码块DSL数据源 */
330
+ codeDsl: CodeBlockDSL | null;
331
+ /** 当前选中的代码块id */
332
+ id: string;
333
+ /** 代码块是否可编辑 */
334
+ editable: boolean;
335
+ /** 代码编辑面板的展示模式 */
336
+ mode: CodeEditorMode;
337
+ /** list模式下左侧展示的代码列表 */
338
+ combineIds: string[];
339
+ /** 为业务逻辑预留的不可删除的代码块列表,由业务逻辑维护(如代码块上线后不可删除) */
340
+ undeletableList: string[];
341
+ };
342
+
343
+ export type CodeRelation = {
344
+ /** 组件id:['created'] */
345
+ [compId: string | number]: string[];
346
+ };
347
+
348
+ export enum CodeEditorMode {
349
+ /** 左侧菜单,右侧代码 */
350
+ LIST = 'list',
351
+ /** 全屏代码 */
352
+ EDITOR = 'editor',
353
+ }
354
+
355
+ export interface CodeDslList {
356
+ /** 代码块id */
357
+ id: string;
358
+ /** 代码块名称 */
359
+ name: string;
360
+ /** 代码块函数内容 */
361
+ codeBlockContent?: CodeBlockContent;
362
+ /** 是否展示代码绑定关系 */
363
+ showRelation?: boolean;
364
+ }
365
+
366
+ export interface ListState {
367
+ /** 代码块列表 */
368
+ codeList: CodeDslList[];
369
+ }
370
+
371
+ export interface ListRelationState extends ListState {
372
+ /** 与代码块绑定的组件id信息 */
373
+ bindComps: {
374
+ /** 代码块id : 组件信息 */
375
+ [id: string]: MNode[];
376
+ };
377
+ }
378
+
379
+ export enum CodeDeleteErrorType {
380
+ /** 代码块存在于不可删除列表中 */
381
+ UNDELETEABLE = 'undeleteable',
382
+ /** 代码块存在绑定关系 */
383
+ BIND = 'bind',
384
+ }
385
+
386
+ export enum CodeSelectOp {
387
+ /** 增加 */
388
+ ADD = 'add',
389
+ /** 删除 */
390
+ DELETE = 'delete',
391
+ /** 单选修改 */
392
+ CHANGE = 'change',
393
+ }
@@ -221,13 +221,19 @@ export const fillConfig = (config: FormConfig = []) => [
221
221
  },
222
222
  {
223
223
  title: '高级',
224
- labelWidth: '80px',
224
+ lazy: true,
225
225
  items: [
226
226
  {
227
- type: 'code-link',
228
227
  name: 'created',
229
228
  text: 'created',
230
- formTitle: 'created',
229
+ type: 'code-select',
230
+ labelWidth: '100px',
231
+ },
232
+ {
233
+ name: 'mounted',
234
+ text: 'mounted',
235
+ type: 'code-select',
236
+ labelWidth: '100px',
231
237
  },
232
238
  ],
233
239
  },
@@ -7,6 +7,8 @@ declare const _default: {
7
7
  name: string;
8
8
  config: {
9
9
  language?: string | undefined;
10
+ options?: Object | undefined;
11
+ height?: string | undefined;
10
12
  };
11
13
  prop: string;
12
14
  }>>> & {
@@ -30,6 +32,8 @@ declare const _default: {
30
32
  name: string;
31
33
  config: {
32
34
  language?: string | undefined;
35
+ options?: Object | undefined;
36
+ height?: string | undefined;
33
37
  };
34
38
  prop: string;
35
39
  }>>> & {
@@ -59,6 +63,8 @@ declare const _default: {
59
63
  name: string;
60
64
  config: {
61
65
  language?: string | undefined;
66
+ options?: Object | undefined;
67
+ height?: string | undefined;
62
68
  };
63
69
  prop: string;
64
70
  }>>> & {
@@ -72,6 +78,8 @@ declare const _default: {
72
78
  name: string;
73
79
  config: {
74
80
  language?: string | undefined;
81
+ options?: Object | undefined;
82
+ height?: string | undefined;
75
83
  };
76
84
  prop: string;
77
85
  }>>> & {
@@ -8,6 +8,7 @@ declare const _default: {
8
8
  name: string;
9
9
  text?: string;
10
10
  formTitle?: string;
11
+ codeOptions?: Object;
11
12
  };
12
13
  model: any;
13
14
  name: string;
@@ -34,6 +35,7 @@ declare const _default: {
34
35
  name: string;
35
36
  text?: string;
36
37
  formTitle?: string;
38
+ codeOptions?: Object;
37
39
  };
38
40
  model: any;
39
41
  name: string;
@@ -66,6 +68,7 @@ declare const _default: {
66
68
  name: string;
67
69
  text?: string;
68
70
  formTitle?: string;
71
+ codeOptions?: Object;
69
72
  };
70
73
  model: any;
71
74
  name: string;
@@ -82,6 +85,7 @@ declare const _default: {
82
85
  name: string;
83
86
  text?: string;
84
87
  formTitle?: string;
88
+ codeOptions?: Object;
85
89
  };
86
90
  model: any;
87
91
  name: string;
@@ -0,0 +1,96 @@
1
+ import { SelectConfig } from '@tmagic/form';
2
+ declare const _default: {
3
+ new (...args: any[]): {
4
+ $: import("vue").ComponentInternalInstance;
5
+ $data: {};
6
+ $props: Partial<{}> & Omit<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
7
+ config: {
8
+ selectConfig?: SelectConfig | undefined;
9
+ };
10
+ model: any;
11
+ prop: string;
12
+ name: string;
13
+ size: string;
14
+ }>>> & {
15
+ onChange?: ((...args: any[]) => any) | undefined;
16
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>;
17
+ $attrs: {
18
+ [x: string]: unknown;
19
+ };
20
+ $refs: {
21
+ [x: string]: unknown;
22
+ };
23
+ $slots: Readonly<{
24
+ [name: string]: import("vue").Slot | undefined;
25
+ }>;
26
+ $root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
27
+ $parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
28
+ $emit: (event: "change", ...args: any[]) => void;
29
+ $el: any;
30
+ $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
31
+ config: {
32
+ selectConfig?: SelectConfig | undefined;
33
+ };
34
+ model: any;
35
+ prop: string;
36
+ name: string;
37
+ size: string;
38
+ }>>> & {
39
+ onChange?: ((...args: any[]) => any) | undefined;
40
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "change"[], string, {}> & {
41
+ beforeCreate?: ((() => void) | (() => void)[]) | undefined;
42
+ created?: ((() => void) | (() => void)[]) | undefined;
43
+ beforeMount?: ((() => void) | (() => void)[]) | undefined;
44
+ mounted?: ((() => void) | (() => void)[]) | undefined;
45
+ beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
46
+ updated?: ((() => void) | (() => void)[]) | undefined;
47
+ activated?: ((() => void) | (() => void)[]) | undefined;
48
+ deactivated?: ((() => void) | (() => void)[]) | undefined;
49
+ beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
50
+ beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
51
+ destroyed?: ((() => void) | (() => void)[]) | undefined;
52
+ unmounted?: ((() => void) | (() => void)[]) | undefined;
53
+ renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
54
+ renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
55
+ 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;
56
+ };
57
+ $forceUpdate: () => void;
58
+ $nextTick: typeof import("vue").nextTick;
59
+ $watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
60
+ } & Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
61
+ config: {
62
+ selectConfig?: SelectConfig | undefined;
63
+ };
64
+ model: any;
65
+ prop: string;
66
+ name: string;
67
+ size: string;
68
+ }>>> & {
69
+ onChange?: ((...args: any[]) => any) | undefined;
70
+ } & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties;
71
+ __isFragment?: undefined;
72
+ __isTeleport?: undefined;
73
+ __isSuspense?: undefined;
74
+ } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
75
+ config: {
76
+ selectConfig?: SelectConfig | undefined;
77
+ };
78
+ model: any;
79
+ prop: string;
80
+ name: string;
81
+ size: string;
82
+ }>>> & {
83
+ onChange?: ((...args: any[]) => any) | undefined;
84
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "change"[], "change", {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
85
+ $slots: {};
86
+ });
87
+ export default _default;
88
+ declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
89
+ declare type __VLS_TypePropsToRuntimeProps<T> = {
90
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
91
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
92
+ } : {
93
+ type: import('vue').PropType<T[K]>;
94
+ required: true;
95
+ };
96
+ };
package/types/index.d.ts CHANGED
@@ -12,8 +12,11 @@ export { default as historyService } from './services/history';
12
12
  export { default as storageService } from './services/storage';
13
13
  export { default as eventsService } from './services/events';
14
14
  export { default as uiService } from './services/ui';
15
+ export { default as codeBlockService } from './services/codeBlock';
15
16
  export { default as ComponentListPanel } from './layouts/sidebar/ComponentListPanel.vue';
16
17
  export { default as LayerPanel } from './layouts/sidebar/LayerPanel.vue';
18
+ export { default as CodeSelect } from './fields/CodeSelect.vue';
19
+ export { default as CodeBlockList } from './layouts/sidebar/code-block/CodeBlockList.vue';
17
20
  export { default as PropsPanel } from './layouts/PropsPanel.vue';
18
21
  export { default as ToolButton } from './components/ToolButton.vue';
19
22
  export { default as ContentMenu } from './components/ContentMenu.vue';
@@ -1,4 +1,46 @@
1
- declare const _default: import("vue").DefineComponent<{}, {
2
- clickHandler(): void;
3
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
1
+ declare const _default: {
2
+ new (...args: any[]): {
3
+ $: import("vue").ComponentInternalInstance;
4
+ $data: {};
5
+ $props: Partial<{}> & Omit<Readonly<import("vue").ExtractPropTypes<{}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>;
6
+ $attrs: {
7
+ [x: string]: unknown;
8
+ };
9
+ $refs: {
10
+ [x: string]: unknown;
11
+ };
12
+ $slots: Readonly<{
13
+ [name: string]: import("vue").Slot | undefined;
14
+ }>;
15
+ $root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
16
+ $parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
17
+ $emit: ((event: string, ...args: any[]) => void) | ((event: string, ...args: any[]) => void);
18
+ $el: any;
19
+ $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, {}> & {
20
+ beforeCreate?: ((() => void) | (() => void)[]) | undefined;
21
+ created?: ((() => void) | (() => void)[]) | undefined;
22
+ beforeMount?: ((() => void) | (() => void)[]) | undefined;
23
+ mounted?: ((() => void) | (() => void)[]) | undefined;
24
+ beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
25
+ updated?: ((() => void) | (() => void)[]) | undefined;
26
+ activated?: ((() => void) | (() => void)[]) | undefined;
27
+ deactivated?: ((() => void) | (() => void)[]) | undefined;
28
+ beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
29
+ beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
30
+ destroyed?: ((() => void) | (() => void)[]) | undefined;
31
+ unmounted?: ((() => void) | (() => void)[]) | undefined;
32
+ renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
33
+ renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
34
+ 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;
35
+ };
36
+ $forceUpdate: () => void;
37
+ $nextTick: typeof import("vue").nextTick;
38
+ $watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
39
+ } & Readonly<import("vue").ExtractPropTypes<{}>> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties;
40
+ __isFragment?: undefined;
41
+ __isTeleport?: undefined;
42
+ __isSuspense?: undefined;
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
+ $slots: {};
45
+ });
4
46
  export default _default;