@tmagic/editor 1.0.0-beta.8 → 1.0.0-beta.9

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.
@@ -10,6 +10,7 @@
10
10
  color: $--font-color;
11
11
  border-top: 1px solid $--border-color;
12
12
  z-index: 2;
13
+ overflow: hidden;
13
14
 
14
15
  .m-editor-page-bar-item {
15
16
  padding: 0 10px;
@@ -27,5 +28,12 @@
27
28
  cursor: pointer;
28
29
  }
29
30
  }
31
+
32
+ .m-editor-page-bar-title {
33
+ max-width: 150px;
34
+ text-overflow: ellipsis;
35
+ white-space: nowrap;
36
+ overflow: hidden;
37
+ }
30
38
  }
31
39
  }
package/src/type.ts CHANGED
@@ -50,6 +50,7 @@ export interface StoreState {
50
50
  page: MPage | null;
51
51
  parent: MContainer | null;
52
52
  node: MNode | null;
53
+ highlightNode: MNode | null;
53
54
  stage: StageCore | null;
54
55
  modifiedNodeIds: Map<Id, Id>;
55
56
  }
@@ -18,7 +18,8 @@
18
18
 
19
19
  import { random } from 'lodash-es';
20
20
 
21
- import { Id, MApp, MContainer, MNode, MPage } from '@tmagic/schema';
21
+ import type { Id, MApp, MContainer, MNode, MPage } from '@tmagic/schema';
22
+ import { NodeType } from '@tmagic/schema';
22
23
  import { getNodePath, isPop } from '@tmagic/utils';
23
24
 
24
25
  import { Layout } from '@editor/type';
@@ -34,7 +35,7 @@ export const generateId = (type: string | number): string => `${type}_${random(1
34
35
  */
35
36
  export const getPageList = (app: MApp): MPage[] => {
36
37
  if (app.items && Array.isArray(app.items)) {
37
- return app.items.filter((item: MPage) => item.type === 'page');
38
+ return app.items.filter((item: MPage) => item.type === NodeType.PAGE);
38
39
  }
39
40
  return [];
40
41
  };
@@ -108,7 +109,7 @@ export const setNewItemId = (config: MNode, parent?: MPage) => {
108
109
  config.name = `${config.name?.replace(/_(\d+)$/, '')}_${config.id}`;
109
110
 
110
111
  // 只有弹窗在页面下的一级子元素才有效
111
- if (isPop(config) && parent?.type === 'page') {
112
+ if (isPop(config) && parent?.type === NodeType.PAGE) {
112
113
  updatePopId(oldId, config.id, parent);
113
114
  }
114
115