@tmagic/editor 1.0.1 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
- import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes, PropType } from 'vue';
1
+ import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
2
+ import { PropType } from 'vue';
2
3
  import type { FormConfig } from '@tmagic/form';
3
4
  import type { MApp, MNode } from '@tmagic/schema';
4
5
  import type StageCore from '@tmagic/stage';
@@ -1,4 +1,5 @@
1
- import type { DefineComponent, ComputedOptions, MethodOptions, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes, Component, PropType, toRaw } from 'vue';
1
+ import type { DefineComponent, ComputedOptions, MethodOptions, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
2
+ import { Component, PropType, toRaw } from 'vue';
2
3
  declare const _default: DefineComponent<{
3
4
  icon: {
4
5
  type: PropType<string | Component<any, any, any, ComputedOptions, MethodOptions>>;
@@ -1,4 +1,5 @@
1
- import type { DefineComponent, Ref, ComputedRef, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from 'vue';
1
+ import type { Ref, ComputedRef } from '@vue/reactivity';
2
+ import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
2
3
  declare const _default: DefineComponent<{
3
4
  width: NumberConstructor;
4
5
  height: NumberConstructor;
@@ -1,4 +1,5 @@
1
- import type { DefineComponent, ComputedRef, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from 'vue';
1
+ import type { ComputedRef } from '@vue/reactivity';
2
+ import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
2
3
  declare const _default: DefineComponent<Readonly<{
3
4
  name?: any;
4
5
  config?: any;
@@ -1,4 +1,6 @@
1
- import type { DefineComponent, Ref, ComputedRef, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes, PropType } from 'vue';
1
+ import type { Ref, ComputedRef } from '@vue/reactivity';
2
+ import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
3
+ import { PropType } from 'vue';
2
4
  interface CodeLinkConfig {
3
5
  type: 'code-link';
4
6
  name: string;
@@ -1,4 +1,4 @@
1
- import type { DefineComponent, ComponentOptionsMixin, EmitsOptions, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from 'vue';
1
+ import type { DefineComponent, ComponentOptionsMixin, EmitsOptions, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
2
2
  declare const _default: DefineComponent<{}, {
3
3
  clickHandler(): void;
4
4
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, EmitsOptions, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<{}>>, {}>;
@@ -1,4 +1,5 @@
1
- import type { DefineComponent, Ref, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from 'vue';
1
+ import type { Ref } from '@vue/reactivity';
2
+ import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
2
3
  import * as monaco from 'monaco-editor';
3
4
  declare const _default: DefineComponent<{
4
5
  initValues: {
@@ -1,4 +1,5 @@
1
- import type { DefineComponent, ComputedRef, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from 'vue';
1
+ import type { ComputedRef } from '@vue/reactivity';
2
+ import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
2
3
  import type { MApp } from '@tmagic/schema';
3
4
  import { GetColumnWidth } from '../type';
4
5
  declare const _default: DefineComponent<{
@@ -1,4 +1,6 @@
1
- import type { DefineComponent, ComputedRef, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes, PropType } from 'vue';
1
+ import type { ComputedRef } from '@vue/reactivity';
2
+ import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
3
+ import { PropType } from 'vue';
2
4
  import { GetColumnWidth, MenuBarData } from '../type';
3
5
  declare const _default: DefineComponent<{
4
6
  data: {
@@ -1,4 +1,5 @@
1
- import type { DefineComponent, Ref, ComputedRef, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from 'vue';
1
+ import type { Ref, ComputedRef } from '@vue/reactivity';
2
+ import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
2
3
  import type { FormValue } from '@tmagic/form';
3
4
  declare const _default: DefineComponent<{}, {
4
5
  values: Ref<FormValue>;
@@ -1,4 +1,5 @@
1
- import type { DefineComponent, Ref, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from 'vue';
1
+ import type { Ref } from '@vue/reactivity';
2
+ import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
2
3
  declare const _default: DefineComponent<{
3
4
  type: {
4
5
  type: StringConstructor;
@@ -1,4 +1,5 @@
1
- import type { DefineComponent, Ref, ComputedRef, ComponentOptionsMixin, EmitsOptions, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from 'vue';
1
+ import type { Ref, ComputedRef } from '@vue/reactivity';
2
+ import type { DefineComponent, ComponentOptionsMixin, EmitsOptions, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
2
3
  import type { ComponentItem } from '../../type';
3
4
  declare const _default: DefineComponent<{}, {
4
5
  searchText: Ref<string>;
@@ -1,4 +1,6 @@
1
- import type { DefineComponent, Ref, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes, PropType } from 'vue';
1
+ import type { Ref } from '@vue/reactivity';
2
+ import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
3
+ import { PropType } from 'vue';
2
4
  import { SideBarData } from '../../type';
3
5
  declare const _default: DefineComponent<{
4
6
  data: {
@@ -1,4 +1,6 @@
1
- import type { DefineComponent, ComputedRef, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes, PropType } from 'vue';
1
+ import type { ComputedRef } from '@vue/reactivity';
2
+ import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
3
+ import { PropType } from 'vue';
2
4
  import { SideComponent, SideItem } from '../../type';
3
5
  declare const _default: DefineComponent<{
4
6
  data: {
@@ -1,4 +1,5 @@
1
- import type { DefineComponent, Ref, ComputedRef, ComponentOptionsMixin, EmitsOptions, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from 'vue';
1
+ import type { Ref, ComputedRef } from '@vue/reactivity';
2
+ import type { DefineComponent, ComponentOptionsMixin, EmitsOptions, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from '@vue/runtime-core';
2
3
  import type { MPage } from '@tmagic/schema';
3
4
  declare const _default: DefineComponent<{}, {
4
5
  workspace: Ref<HTMLDivElement | undefined>;
@@ -1,4 +1,4 @@
1
- import { Id, MPage } from '@tmagic/schema';
1
+ import type { Id, MPage } from '@tmagic/schema';
2
2
  import { UndoRedo } from '../utils/undo-redo';
3
3
  import BaseService from './BaseService';
4
4
  export interface StepValue {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.1",
2
+ "version": "1.0.4",
3
3
  "name": "@tmagic/editor",
4
4
  "sideEffects": [
5
5
  "dist/*",
@@ -22,7 +22,7 @@
22
22
  },
23
23
  "license": "Apache-2.0",
24
24
  "scripts": {
25
- "build": "vite build"
25
+ "build": "vue-tsc --noEmit && vite build"
26
26
  },
27
27
  "engines": {
28
28
  "node": ">=14"
@@ -43,14 +43,14 @@
43
43
  "dependencies": {
44
44
  "@babel/core": "^7.18.0",
45
45
  "@element-plus/icons": "0.0.11",
46
- "@tmagic/core": "1.0.1",
47
- "@tmagic/form": "1.0.1",
48
- "@tmagic/schema": "1.0.1",
49
- "@tmagic/stage": "1.0.1",
50
- "@tmagic/utils": "1.0.1",
46
+ "@tmagic/core": "1.0.4",
47
+ "@tmagic/form": "1.0.4",
48
+ "@tmagic/schema": "1.0.4",
49
+ "@tmagic/stage": "1.0.4",
50
+ "@tmagic/utils": "1.0.4",
51
51
  "buffer": "^6.0.3",
52
52
  "color": "^3.1.3",
53
- "element-plus": "^2.2.0",
53
+ "element-plus": "^2.2.6",
54
54
  "events": "^3.3.0",
55
55
  "gesto": "^1.7.0",
56
56
  "keycon": "^1.1.2",
@@ -60,8 +60,8 @@
60
60
  "vue": "^3.2.0"
61
61
  },
62
62
  "peerDependencies": {
63
- "@tmagic/form": "1.0.1",
64
- "element-plus": "^2.2.0",
63
+ "@tmagic/form": "1.0.4",
64
+ "element-plus": "^2.2.6",
65
65
  "monaco-editor": "^0.32.1",
66
66
  "vue": "^3.2.0"
67
67
  },
@@ -70,14 +70,13 @@
70
70
  "@types/lodash-es": "^4.17.4",
71
71
  "@types/node": "^15.12.4",
72
72
  "@types/serialize-javascript": "^5.0.1",
73
- "@vitejs/plugin-vue": "^1.2.3",
74
- "@vitejs/plugin-vue-jsx": "^1.1.6",
73
+ "@vitejs/plugin-vue": "^2.3.3",
75
74
  "@vue/compiler-sfc": "^3.2.0",
76
75
  "@vue/test-utils": "^2.0.0",
77
76
  "sass": "^1.35.1",
78
77
  "typescript": "^4.3.4",
79
- "vite": "^2.3.7",
78
+ "vite": "^2.9.13",
80
79
  "vite-plugin-dts": "^0.9.6",
81
- "vue-tsc": "^0.0.24"
80
+ "vue-tsc": "^0.38.2"
82
81
  }
83
82
  }
package/src/Editor.vue CHANGED
@@ -6,7 +6,15 @@
6
6
 
7
7
  <template #sidebar>
8
8
  <slot name="sidebar" :editorService="editorService">
9
- <sidebar :data="sidebar"></sidebar>
9
+ <sidebar :data="sidebar">
10
+ <template #layer-panel>
11
+ <slot name="layer-panel"></slot>
12
+ </template>
13
+
14
+ <template #component-list-panel>
15
+ <slot name="component-list-panel"></slot>
16
+ </template>
17
+ </sidebar>
10
18
  </slot>
11
19
  </template>
12
20
 
@@ -20,8 +28,8 @@
20
28
  </slot>
21
29
  </template>
22
30
 
23
- <template #propsPanel>
24
- <slot name="propsPanel">
31
+ <template #props-panel>
32
+ <slot name="props-panel">
25
33
  <props-panel ref="propsPanel" @mounted="(instance) => $emit('props-panel-mounted', instance)"></props-panel>
26
34
  </slot>
27
35
  </template>
@@ -17,7 +17,7 @@ import { Plus } from '@element-plus/icons';
17
17
 
18
18
  import { NodeType } from '@tmagic/schema';
19
19
 
20
- import { Services } from '@editor/type';
20
+ import type { Services } from '@editor/type';
21
21
  import { generatePageNameByApp } from '@editor/utils';
22
22
 
23
23
  export default defineComponent({
@@ -26,7 +26,7 @@
26
26
 
27
27
  <div class="m-editor-framework-right" :style="`width: ${columnWidth?.right}px`">
28
28
  <el-scrollbar>
29
- <slot name="propsPanel"></slot>
29
+ <slot name="props-panel"></slot>
30
30
  </el-scrollbar>
31
31
  </div>
32
32
  </template>
@@ -1,5 +1,6 @@
1
1
  <template>
2
2
  <el-scrollbar>
3
+ <slot name="component-list-panel"></slot>
3
4
  <el-collapse class="ui-component-panel" :model-value="collapseValue">
4
5
  <el-input
5
6
  prefix-icon="el-icon-search"
@@ -1,5 +1,7 @@
1
1
  <template>
2
2
  <el-scrollbar class="magic-editor-layer-panel">
3
+ <slot name="layer-panel"></slot>
4
+
3
5
  <el-input
4
6
  class="filterInput"
5
7
  size="small"
@@ -6,7 +6,15 @@
6
6
  type="card"
7
7
  tab-position="left"
8
8
  >
9
- <tab-pane v-for="(item, index) in data.items" :key="index" :data="item"></tab-pane>
9
+ <tab-pane v-for="(item, index) in data.items" :key="index" :data="item">
10
+ <template #layer-panel v-if="item === 'layer'">
11
+ <slot name="layer-panel"></slot>
12
+ </template>
13
+
14
+ <template #component-list-panel v-if="item === 'component-list'">
15
+ <slot name="component-list-panel"></slot>
16
+ </template>
17
+ </tab-pane>
10
18
  </el-tabs>
11
19
  </template>
12
20
 
@@ -8,6 +8,14 @@
8
8
  </template>
9
9
 
10
10
  <component :is="config.component" v-bind="config.props || {}" v-on="config?.listeners || {}">
11
+ <template #layer-panel v-if="data === 'layer'">
12
+ <slot name="layer-panel"></slot>
13
+ </template>
14
+
15
+ <template #component-list-panel v-if="data === 'component-list'">
16
+ <slot name="component-list-panel"></slot>
17
+ </template>
18
+
11
19
  <template #layer-node-content="{ data, node }" v-if="config.slots?.layerNodeContent">
12
20
  <component :is="config.slots?.layerNodeContent" :data="data" :node="node" />
13
21
  </template>
@@ -18,7 +18,7 @@
18
18
 
19
19
  import { reactive } from 'vue';
20
20
 
21
- import { Id, MPage } from '@tmagic/schema';
21
+ import type { Id, MPage } from '@tmagic/schema';
22
22
 
23
23
  import { UndoRedo } from '@editor/utils/undo-redo';
24
24