@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.
- package/dist/style.css +24 -10
- package/dist/tmagic-editor.es.js +158 -76
- package/dist/tmagic-editor.es.js.map +1 -1
- package/dist/tmagic-editor.umd.js +160 -79
- package/dist/tmagic-editor.umd.js.map +1 -1
- package/dist/types/src/layouts/sidebar/LayerPanel.vue.d.ts +8 -2
- package/dist/types/src/layouts/workspace/Stage.vue.d.ts +2 -1
- package/dist/types/src/layouts/workspace/Workspace.vue.d.ts +1 -0
- package/dist/types/src/services/editor.d.ts +11 -4
- package/dist/types/src/type.d.ts +1 -0
- package/dist/types/src/utils/editor.d.ts +1 -1
- package/package.json +5 -5
- package/src/components/ToolButton.vue +3 -1
- package/src/layouts/AddPageBox.vue +3 -1
- package/src/layouts/sidebar/LayerPanel.vue +55 -11
- package/src/layouts/workspace/PageBar.vue +9 -4
- package/src/layouts/workspace/Stage.vue +18 -2
- package/src/layouts/workspace/ViewerMenu.vue +5 -3
- package/src/layouts/workspace/Workspace.vue +5 -0
- package/src/services/editor.ts +53 -29
- package/src/theme/common/var.scss +2 -2
- package/src/theme/layer-panel.scss +9 -0
- package/src/theme/page-bar.scss +8 -0
- package/src/type.ts +1 -0
- package/src/utils/editor.ts +4 -3
package/src/theme/page-bar.scss
CHANGED
|
@@ -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
package/src/utils/editor.ts
CHANGED
|
@@ -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 ===
|
|
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 ===
|
|
112
|
+
if (isPop(config) && parent?.type === NodeType.PAGE) {
|
|
112
113
|
updatePopId(oldId, config.id, parent);
|
|
113
114
|
}
|
|
114
115
|
|