@tmagic/editor 1.1.0 → 1.1.3

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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.1.0",
2
+ "version": "1.1.3",
3
3
  "name": "@tmagic/editor",
4
4
  "sideEffects": [
5
5
  "dist/*",
@@ -45,11 +45,11 @@
45
45
  "dependencies": {
46
46
  "@babel/core": "^7.18.0",
47
47
  "@element-plus/icons-vue": "^2.0.9",
48
- "@tmagic/core": "1.1.0",
49
- "@tmagic/form": "1.1.0",
50
- "@tmagic/schema": "1.1.0",
51
- "@tmagic/stage": "1.1.0",
52
- "@tmagic/utils": "1.1.0",
48
+ "@tmagic/core": "1.1.3",
49
+ "@tmagic/form": "1.1.3",
50
+ "@tmagic/schema": "1.1.3",
51
+ "@tmagic/stage": "1.1.3",
52
+ "@tmagic/utils": "1.1.3",
53
53
  "buffer": "^6.0.3",
54
54
  "color": "^3.1.3",
55
55
  "element-plus": "^2.2.6",
@@ -62,7 +62,7 @@
62
62
  "vue": "^3.2.37"
63
63
  },
64
64
  "peerDependencies": {
65
- "@tmagic/form": "1.1.0",
65
+ "@tmagic/form": "1.1.3",
66
66
  "element-plus": "^2.2.6",
67
67
  "monaco-editor": "^0.34.0",
68
68
  "vue": "^3.2.37"
package/src/Editor.vue CHANGED
@@ -14,6 +14,10 @@
14
14
  <template #component-list-panel-header>
15
15
  <slot name="component-list-panel-header"></slot>
16
16
  </template>
17
+
18
+ <template #component-list-item="{ component }">
19
+ <slot name="component-list-item" :component="component"></slot>
20
+ </template>
17
21
  </sidebar>
18
22
  </slot>
19
23
  </template>
@@ -193,9 +197,15 @@ export default defineComponent({
193
197
  emits: ['props-panel-mounted', 'update:modelValue'],
194
198
 
195
199
  setup(props, { emit }) {
196
- editorService.on('root-change', () => {
197
- const node = editorService.get<MNode | null>('node') || props.defaultSelected;
198
- node && editorService.select(node);
200
+ editorService.on('root-change', (value) => {
201
+ const node = editorService.get<MNode | null>('node');
202
+ const nodeId = node?.id || props.defaultSelected;
203
+ if (nodeId && node !== value) {
204
+ editorService.select(nodeId);
205
+ } else {
206
+ editorService.set('nodes', [value]);
207
+ }
208
+
199
209
  emit('update:modelValue', toRaw(editorService.get('root')));
200
210
  });
201
211
 
@@ -1,8 +1,10 @@
1
1
  <template>
2
- <el-icon v-if="!icon"><Edit></Edit></el-icon>
3
- <el-icon v-else-if="typeof icon === 'string' && icon.startsWith('http')"><img :src="icon" /></el-icon>
4
- <i v-else-if="typeof icon === 'string'" :class="icon"></i>
5
- <el-icon v-else><component :is="toRaw(icon)"></component></el-icon>
2
+ <el-icon v-if="!icon" class="magic-editor-icon"><Edit></Edit></el-icon>
3
+ <el-icon v-else-if="typeof icon === 'string' && icon.startsWith('http')" class="magic-editor-icon"
4
+ ><img :src="icon"
5
+ /></el-icon>
6
+ <i v-else-if="typeof icon === 'string'" class="magic-editor-icon" :class="icon"></i>
7
+ <el-icon v-else class="magic-editor-icon"><component :is="toRaw(icon)"></component></el-icon>
6
8
  </template>
7
9
 
8
10
  <script lang="ts" setup>
package/src/index.ts CHANGED
@@ -15,8 +15,6 @@
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
17
  */
18
- import './utils/polyfills';
19
-
20
18
  import { App } from 'vue';
21
19
 
22
20
  import Code from './fields/Code.vue';
@@ -24,11 +24,13 @@
24
24
  @dragend="dragendHandler"
25
25
  @drag="dragHandler"
26
26
  >
27
- <m-icon :icon="item.icon"></m-icon>
27
+ <slot name="component-list-item" :component="item">
28
+ <MIcon :icon="item.icon"></MIcon>
28
29
 
29
- <el-tooltip effect="dark" placement="bottom" :content="item.text">
30
- <span>{{ item.text }}</span>
31
- </el-tooltip>
30
+ <el-tooltip effect="dark" placement="bottom" :content="item.text">
31
+ <span>{{ item.text }}</span>
32
+ </el-tooltip>
33
+ </slot>
32
34
  </div>
33
35
  </el-collapse-item>
34
36
  </template>
@@ -36,8 +38,8 @@
36
38
  </el-scrollbar>
37
39
  </template>
38
40
 
39
- <script lang="ts">
40
- import { computed, defineComponent, inject, ref } from 'vue';
41
+ <script lang="ts" setup>
42
+ import { computed, inject, ref } from 'vue';
41
43
  import serialize from 'serialize-javascript';
42
44
 
43
45
  import type StageCore from '@tmagic/stage';
@@ -46,89 +48,75 @@ import { removeClassNameByClassName } from '@tmagic/utils';
46
48
  import MIcon from '../../components/Icon.vue';
47
49
  import type { ComponentGroup, ComponentItem, Services, StageOptions } from '../../type';
48
50
 
49
- export default defineComponent({
50
- name: 'ui-component-panel',
51
-
52
- components: { MIcon },
53
-
54
- setup() {
55
- const searchText = ref('');
56
- const services = inject<Services>('services');
57
- const stageOptions = inject<StageOptions>('stageOptions');
58
-
59
- const stage = computed(() => services?.editorService.get<StageCore>('stage'));
60
- const list = computed(() =>
61
- services?.componentListService.getList().map((group: ComponentGroup) => ({
62
- ...group,
63
- items: group.items.filter((item: ComponentItem) => item.text.includes(searchText.value)),
64
- })),
51
+ const searchText = ref('');
52
+ const services = inject<Services>('services');
53
+ const stageOptions = inject<StageOptions>('stageOptions');
54
+
55
+ const stage = computed(() => services?.editorService.get<StageCore>('stage'));
56
+ const list = computed(() =>
57
+ services?.componentListService.getList().map((group: ComponentGroup) => ({
58
+ ...group,
59
+ items: group.items.filter((item: ComponentItem) => item.text.includes(searchText.value)),
60
+ })),
61
+ );
62
+ const collapseValue = computed(() =>
63
+ Array(list.value?.length)
64
+ .fill(1)
65
+ .map((x, i) => i),
66
+ );
67
+
68
+ let timeout: NodeJS.Timeout | undefined;
69
+ let clientX: number;
70
+ let clientY: number;
71
+
72
+ const appendComponent = ({ text, type, data = {} }: ComponentItem): void => {
73
+ services?.editorService.add({
74
+ name: text,
75
+ type,
76
+ ...data,
77
+ });
78
+ };
79
+
80
+ const dragstartHandler = ({ text, type, data = {} }: ComponentItem, e: DragEvent) => {
81
+ if (e.dataTransfer) {
82
+ e.dataTransfer.effectAllowed = 'move';
83
+ e.dataTransfer.setData(
84
+ 'data',
85
+ serialize({
86
+ name: text,
87
+ type,
88
+ ...data,
89
+ }).replace(/"(\w+)":\s/g, '$1: '),
65
90
  );
66
- const collapseValue = computed(() =>
67
- Array(list.value?.length)
68
- .fill(1)
69
- .map((x, i) => i),
70
- );
71
-
72
- let timeout: NodeJS.Timeout | undefined;
73
- let clientX: number;
74
- let clientY: number;
75
-
76
- return {
77
- searchText,
78
- collapseValue,
79
- list,
80
-
81
- appendComponent({ text, type, data = {} }: ComponentItem): void {
82
- services?.editorService.add({
83
- name: text,
84
- type,
85
- ...data,
86
- });
87
- },
88
-
89
- dragstartHandler({ text, type, data = {} }: ComponentItem, e: DragEvent) {
90
- if (e.dataTransfer) {
91
- e.dataTransfer.effectAllowed = 'move';
92
- e.dataTransfer.setData(
93
- 'data',
94
- serialize({
95
- name: text,
96
- type,
97
- ...data,
98
- }).replace(/"(\w+)":\s/g, '$1: '),
99
- );
100
- }
101
- },
102
-
103
- dragendHandler() {
104
- if (timeout) {
105
- globalThis.clearTimeout(timeout);
106
- timeout = undefined;
107
- }
108
- const doc = stage.value?.renderer.contentWindow?.document;
109
- if (doc && stageOptions) {
110
- removeClassNameByClassName(doc, stageOptions.containerHighlightClassName);
111
- }
112
- clientX = 0;
113
- clientY = 0;
114
- },
115
-
116
- dragHandler(e: DragEvent) {
117
- if (e.clientX !== clientX || e.clientY !== clientY) {
118
- clientX = e.clientX;
119
- clientY = e.clientY;
120
- if (timeout) {
121
- globalThis.clearTimeout(timeout);
122
- timeout = undefined;
123
- }
124
- return;
125
- }
126
-
127
- if (timeout || !stage.value) return;
128
-
129
- timeout = stage.value.getAddContainerHighlightClassNameTimeout(e);
130
- },
131
- };
132
- },
133
- });
91
+ }
92
+ };
93
+
94
+ const dragendHandler = () => {
95
+ if (timeout) {
96
+ globalThis.clearTimeout(timeout);
97
+ timeout = undefined;
98
+ }
99
+ const doc = stage.value?.renderer.contentWindow?.document;
100
+ if (doc && stageOptions) {
101
+ removeClassNameByClassName(doc, stageOptions.containerHighlightClassName);
102
+ }
103
+ clientX = 0;
104
+ clientY = 0;
105
+ };
106
+
107
+ const dragHandler = (e: DragEvent) => {
108
+ if (e.clientX !== clientX || e.clientY !== clientY) {
109
+ clientX = e.clientX;
110
+ clientY = e.clientY;
111
+ if (timeout) {
112
+ globalThis.clearTimeout(timeout);
113
+ timeout = undefined;
114
+ }
115
+ return;
116
+ }
117
+
118
+ if (timeout || !stage.value) return;
119
+
120
+ timeout = stage.value.getAddContainerHighlightClassNameTimeout(e);
121
+ };
134
122
  </script>
@@ -14,6 +14,10 @@
14
14
  <template #component-list-panel-header v-if="item === 'component-list'">
15
15
  <slot name="component-list-panel-header"></slot>
16
16
  </template>
17
+
18
+ <template #component-list-item="{ component }" v-if="item === 'component-list'">
19
+ <slot name="component-list-item" :component="component"></slot>
20
+ </template>
17
21
  </tab-pane>
18
22
  </el-tabs>
19
23
  </template>
@@ -13,6 +13,18 @@
13
13
  <component v-else-if="config.slots?.componentListPanelHeader" :is="config.slots.componentListPanelHeader" />
14
14
  </template>
15
15
 
16
+ <template
17
+ #component-list-item="{ component }"
18
+ v-if="data === 'component-list' || config.slots?.componentListItem"
19
+ >
20
+ <slot v-if="data === 'component-list'" name="component-list-item" :component="component"></slot>
21
+ <component
22
+ v-else-if="config.slots?.componentListItem"
23
+ :is="config.slots.componentListItem"
24
+ :component="component"
25
+ />
26
+ </template>
27
+
16
28
  <template #layer-panel-header v-if="data === 'layer' || config.slots?.layerPanelHeader">
17
29
  <slot v-if="data === 'layer'" name="layer-panel-header"></slot>
18
30
  <component v-else-if="config.slots?.layerPanelHeader" :is="config.slots.layerPanelHeader" />
@@ -38,7 +38,7 @@
38
38
  </div>
39
39
  <template #reference>
40
40
  <el-icon class="m-editor-page-bar-menu-icon">
41
- <caret-bottom></caret-bottom>
41
+ <CaretBottom></CaretBottom>
42
42
  </el-icon>
43
43
  </template>
44
44
  </el-popover>
@@ -1,8 +1,14 @@
1
1
  <template>
2
2
  <div class="m-editor-page-bar" ref="pageBar">
3
- <div id="m-editor-page-bar-add-icon" class="m-editor-page-bar-item m-editor-page-bar-item-icon" @click="addPage">
3
+ <div
4
+ v-if="showAddPageButton"
5
+ id="m-editor-page-bar-add-icon"
6
+ class="m-editor-page-bar-item m-editor-page-bar-item-icon"
7
+ @click="addPage"
8
+ >
4
9
  <el-icon><plus></plus></el-icon>
5
10
  </div>
11
+ <div v-else style="width: 21px"></div>
6
12
  <div v-if="canScroll" class="m-editor-page-bar-item m-editor-page-bar-item-icon" @click="scroll('left')">
7
13
  <el-icon><arrow-left-bold></arrow-left-bold></el-icon>
8
14
  </div>
@@ -26,13 +32,17 @@ import { generatePageNameByApp } from '../../utils/editor';
26
32
 
27
33
  const services = inject<Services>('services');
28
34
  const editorService = services?.editorService;
35
+ const uiService = services?.uiService;
29
36
 
30
37
  const pageBar = ref<HTMLDivElement>();
31
38
  const itemsContainer = ref<HTMLDivElement>();
32
39
  const pageBarWidth = ref(0);
33
40
  const canScroll = ref(false);
34
41
 
35
- const itemsContainerWidth = computed(() => pageBarWidth.value - 105);
42
+ const showAddPageButton = computed(() => uiService?.get('showAddPageButton'));
43
+
44
+ // 减去新增、左移、右移三个按钮的宽度
45
+ const itemsContainerWidth = computed(() => pageBarWidth.value - 35 * 2 - (showAddPageButton.value ? 35 : 21));
36
46
 
37
47
  let translateLeft = 0;
38
48
  const resizeObserver = new ResizeObserver((entries) => {
@@ -46,7 +56,7 @@ const resizeObserver = new ResizeObserver((entries) => {
46
56
 
47
57
  const setCanScroll = () => {
48
58
  if (itemsContainer.value) {
49
- canScroll.value = itemsContainer.value.scrollWidth > pageBarWidth.value - 105;
59
+ canScroll.value = itemsContainer.value.scrollWidth > itemsContainerWidth.value;
50
60
  }
51
61
  };
52
62
 
@@ -158,8 +158,8 @@ const dropHandler = async (e: DragEvent) => {
158
158
  config.style = {
159
159
  ...style,
160
160
  position,
161
- top,
162
- left,
161
+ top: top / zoom.value,
162
+ left: left / zoom.value,
163
163
  };
164
164
 
165
165
  config.inputEvent = e;
@@ -400,7 +400,7 @@ class Editor extends BaseService {
400
400
  await this.select(root.items[0]);
401
401
  stage?.select(root.items[0].id);
402
402
  } else {
403
- this.set('node', null);
403
+ this.set('nodes', [root]);
404
404
  this.set('parent', null);
405
405
  this.set('page', null);
406
406
  this.set('stage', null);
@@ -629,12 +629,18 @@ class Editor extends BaseService {
629
629
  const brothers: MNode[] = parent?.items || [];
630
630
  const index = brothers.findIndex((item) => `${item.id}` === `${node?.id}`);
631
631
 
632
+ // 流式布局与绝对定位布局操作的相反的
633
+ const layout = await this.getLayout(parent, node);
634
+ const isRelative = layout === Layout.RELATIVE;
635
+
636
+ brothers.splice(index, 1);
637
+
632
638
  if (offset === LayerOffset.TOP) {
633
- brothers.splice(brothers.length - 1, 0, brothers.splice(index, 1)[0]);
639
+ brothers.splice(isRelative ? 0 : brothers.length - 1, 0, node);
634
640
  } else if (offset === LayerOffset.BOTTOM) {
635
- brothers.splice(0, 0, brothers.splice(index, 1)[0]);
641
+ brothers.splice(isRelative ? brothers.length - 1 : 0, 0, node);
636
642
  } else {
637
- brothers.splice(index + parseInt(`${offset}`, 10), 0, brothers.splice(index, 1)[0]);
643
+ brothers.splice(index + (isRelative ? -offset : offset), 0, node);
638
644
  }
639
645
 
640
646
  const grandparent = this.getParentById(parent.id);
@@ -54,6 +54,7 @@ const state = reactive<UiState>({
54
54
  showGuides: true,
55
55
  showRule: true,
56
56
  propsPanelSize: 'small',
57
+ showAddPageButton: true,
57
58
  });
58
59
 
59
60
  class Ui extends BaseService {
@@ -86,11 +86,6 @@
86
86
  }
87
87
  }
88
88
 
89
- img {
90
- max-width: 100%;
91
- max-height: 100%;
92
- }
93
-
94
89
  span {
95
90
  font-size: 12px;
96
91
  text-align: center;
@@ -31,6 +31,10 @@
31
31
  color: $--font-color;
32
32
  }
33
33
 
34
+ .magic-editor-icon {
35
+ margin-right: 5px;
36
+ }
37
+
34
38
  &.divider {
35
39
  padding: 0 14px;
36
40
 
@@ -0,0 +1,6 @@
1
+ .magic-editor-icon {
2
+ img {
3
+ max-width: 100%;
4
+ max-height: 100%;
5
+ }
6
+ }
@@ -11,3 +11,4 @@
11
11
  @import "./content-menu.scss";
12
12
  @import "./stage.scss";
13
13
  @import "./code-editor.scss";
14
+ @import "./icon.scss";
package/src/type.ts CHANGED
@@ -124,6 +124,8 @@ export interface UiState {
124
124
  showRule: boolean;
125
125
  /** 用于控制该属性配置表单内组件的尺寸 */
126
126
  propsPanelSize: 'large' | 'default' | 'small';
127
+ /** 是否显示新增页面按钮 */
128
+ showAddPageButton: boolean;
127
129
  }
128
130
 
129
131
  export interface EditorNodeInfo {
@@ -196,9 +196,9 @@ declare const _default: import("vue").DefineComponent<{
196
196
  }, {
197
197
  menu: MenuBarData;
198
198
  codeOptions: Record<string, any>;
199
+ modelValue: MApp;
199
200
  layerContentMenu: (MenuButton | MenuComponent)[];
200
201
  stageContentMenu: (MenuButton | MenuComponent)[];
201
- modelValue: MApp;
202
202
  componentGroupList: ComponentGroup[];
203
203
  autoScrollIntoView: boolean;
204
204
  propsConfigs: Record<string, FormConfig>;
package/types/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import './utils/polyfills';
2
1
  import { App } from 'vue';
3
2
  import type { InstallOptions } from './type';
4
3
  import './theme/index.scss';
@@ -1,14 +1,52 @@
1
1
  import type { ComponentItem } from '../../type';
2
- declare const _default: import("vue").DefineComponent<{}, {
3
- searchText: import("vue").Ref<string>;
4
- collapseValue: import("vue").ComputedRef<number[]>;
5
- list: import("vue").ComputedRef<{
6
- items: ComponentItem[];
7
- title: string;
8
- }[] | undefined>;
9
- appendComponent({ text, type, data }: ComponentItem): void;
10
- dragstartHandler({ text, type, data }: ComponentItem, e: DragEvent): void;
11
- dragendHandler(): void;
12
- dragHandler(e: DragEvent): void;
13
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
+ declare const _default: {
3
+ new (...args: any[]): {
4
+ $: import("vue").ComponentInternalInstance;
5
+ $data: {};
6
+ $props: Partial<{}> & Omit<Readonly<import("vue").ExtractPropTypes<{}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>;
7
+ $attrs: {
8
+ [x: string]: unknown;
9
+ };
10
+ $refs: {
11
+ [x: string]: unknown;
12
+ };
13
+ $slots: Readonly<{
14
+ [name: string]: import("vue").Slot | undefined;
15
+ }>;
16
+ $root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
17
+ $parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
18
+ $emit: ((event: string, ...args: any[]) => void) | ((event: string, ...args: any[]) => void);
19
+ $el: any;
20
+ $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, {}> & {
21
+ beforeCreate?: ((() => void) | (() => void)[]) | undefined;
22
+ created?: ((() => void) | (() => void)[]) | undefined;
23
+ beforeMount?: ((() => void) | (() => void)[]) | undefined;
24
+ mounted?: ((() => void) | (() => void)[]) | undefined;
25
+ beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
26
+ updated?: ((() => void) | (() => void)[]) | undefined;
27
+ activated?: ((() => void) | (() => void)[]) | undefined;
28
+ deactivated?: ((() => void) | (() => void)[]) | undefined;
29
+ beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
30
+ beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
31
+ destroyed?: ((() => void) | (() => void)[]) | undefined;
32
+ unmounted?: ((() => void) | (() => void)[]) | undefined;
33
+ renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
34
+ renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
35
+ 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;
36
+ };
37
+ $forceUpdate: () => void;
38
+ $nextTick: typeof import("vue").nextTick;
39
+ $watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
40
+ } & Readonly<import("vue").ExtractPropTypes<{}>> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties;
41
+ __isFragment?: undefined;
42
+ __isTeleport?: undefined;
43
+ __isSuspense?: undefined;
44
+ } & 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 () => {
45
+ $slots: {
46
+ 'component-list-panel-header': (_: {}) => any;
47
+ 'component-list-item': (_: {
48
+ component: ComponentItem;
49
+ }) => any;
50
+ };
51
+ });
14
52
  export default _default;
@@ -20,6 +20,7 @@ declare const state: {
20
20
  showGuides: boolean;
21
21
  showRule: boolean;
22
22
  propsPanelSize: "small" | "large" | "default";
23
+ showAddPageButton: boolean;
23
24
  };
24
25
  declare class Ui extends BaseService {
25
26
  constructor();
package/types/type.d.ts CHANGED
@@ -92,6 +92,8 @@ export interface UiState {
92
92
  showRule: boolean;
93
93
  /** 用于控制该属性配置表单内组件的尺寸 */
94
94
  propsPanelSize: 'large' | 'default' | 'small';
95
+ /** 是否显示新增页面按钮 */
96
+ showAddPageButton: boolean;
95
97
  }
96
98
  export interface EditorNodeInfo {
97
99
  node?: MNode;
@@ -1,8 +0,0 @@
1
- // serialize-javascript 依赖的 randombytes 依赖全局的 global 对象,因此此处需添加 global polyfill
2
- if (typeof global === 'undefined') {
3
- (window as any).global = window;
4
- }
5
-
6
- if (typeof globalThis === 'undefined') {
7
- (window as any).globalThis = window;
8
- }
File without changes