@tmagic/editor 1.5.0-beta.9 → 1.5.1

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 (99) hide show
  1. package/dist/{style.css → tmagic-editor.css} +228 -22
  2. package/dist/tmagic-editor.js +1670 -1012
  3. package/dist/tmagic-editor.umd.cjs +1705 -1048
  4. package/package.json +14 -12
  5. package/src/Editor.vue +24 -6
  6. package/src/components/CodeBlockEditor.vue +14 -8
  7. package/src/components/CodeParams.vue +5 -5
  8. package/src/components/ContentMenu.vue +18 -18
  9. package/src/components/FloatingBox.vue +3 -3
  10. package/src/components/Resizer.vue +4 -4
  11. package/src/components/ScrollBar.vue +3 -3
  12. package/src/components/ScrollViewer.vue +3 -3
  13. package/src/components/SplitView.vue +2 -2
  14. package/src/components/ToolButton.vue +2 -1
  15. package/src/editorProps.ts +6 -2
  16. package/src/fields/Code.vue +1 -2
  17. package/src/fields/CodeSelect.vue +13 -11
  18. package/src/fields/CodeSelectCol.vue +32 -5
  19. package/src/fields/CondOpSelect.vue +5 -2
  20. package/src/fields/DataSourceFields.vue +31 -12
  21. package/src/fields/DataSourceInput.vue +2 -2
  22. package/src/fields/DataSourceMethods.vue +72 -14
  23. package/src/fields/DataSourceMocks.vue +0 -1
  24. package/src/fields/DisplayConds.vue +8 -3
  25. package/src/fields/EventSelect.vue +28 -12
  26. package/src/fields/KeyValue.vue +17 -12
  27. package/src/fields/UISelect.vue +6 -3
  28. package/src/hooks/index.ts +0 -1
  29. package/src/hooks/use-code-block-edit.ts +3 -3
  30. package/src/hooks/use-data-source-edit.ts +3 -2
  31. package/src/hooks/use-filter.ts +1 -1
  32. package/src/hooks/use-getso.ts +7 -7
  33. package/src/hooks/use-node-status.ts +2 -2
  34. package/src/index.ts +2 -1
  35. package/src/initService.ts +177 -74
  36. package/src/layouts/CodeEditor.vue +2 -2
  37. package/src/layouts/Framework.vue +13 -12
  38. package/src/layouts/NavMenu.vue +2 -2
  39. package/src/layouts/page-bar/AddButton.vue +29 -9
  40. package/src/layouts/page-bar/PageBar.vue +79 -66
  41. package/src/layouts/page-bar/PageBarScrollContainer.vue +84 -98
  42. package/src/layouts/page-bar/PageList.vue +5 -3
  43. package/src/layouts/page-bar/Search.vue +67 -0
  44. package/src/layouts/props-panel/FormPanel.vue +123 -0
  45. package/src/layouts/props-panel/PropsPanel.vue +146 -0
  46. package/src/layouts/props-panel/use-style-panel.ts +29 -0
  47. package/src/layouts/sidebar/Sidebar.vue +7 -1
  48. package/src/layouts/sidebar/code-block/CodeBlockList.vue +18 -2
  49. package/src/layouts/sidebar/code-block/CodeBlockListPanel.vue +35 -4
  50. package/src/layouts/sidebar/code-block/useContentMenu.ts +83 -0
  51. package/src/layouts/sidebar/data-source/DataSourceConfigPanel.vue +7 -5
  52. package/src/layouts/sidebar/data-source/DataSourceList.vue +13 -8
  53. package/src/layouts/sidebar/data-source/DataSourceListPanel.vue +40 -4
  54. package/src/layouts/sidebar/data-source/useContentMenu.ts +81 -0
  55. package/src/layouts/sidebar/layer/LayerMenu.vue +7 -13
  56. package/src/layouts/sidebar/layer/LayerPanel.vue +11 -4
  57. package/src/layouts/sidebar/layer/use-click.ts +2 -2
  58. package/src/layouts/sidebar/layer/use-keybinding.ts +2 -2
  59. package/src/layouts/sidebar/layer/use-node-status.ts +2 -3
  60. package/src/layouts/workspace/Workspace.vue +13 -3
  61. package/src/layouts/workspace/viewer/NodeListMenu.vue +3 -3
  62. package/src/layouts/workspace/viewer/Stage.vue +41 -11
  63. package/src/layouts/workspace/viewer/StageOverlay.vue +2 -2
  64. package/src/layouts/workspace/viewer/ViewerMenu.vue +4 -6
  65. package/src/services/dataSource.ts +12 -5
  66. package/src/services/dep.ts +61 -13
  67. package/src/services/editor.ts +46 -51
  68. package/src/services/storage.ts +2 -1
  69. package/src/services/ui.ts +1 -0
  70. package/src/theme/common/var.scss +12 -10
  71. package/src/theme/component-list-panel.scss +9 -7
  72. package/src/theme/content-menu.scss +7 -5
  73. package/src/theme/data-source.scss +3 -1
  74. package/src/theme/floating-box.scss +4 -2
  75. package/src/theme/framework.scss +7 -5
  76. package/src/theme/index.scss +4 -5
  77. package/src/theme/key-value.scss +2 -2
  78. package/src/theme/layer-panel.scss +3 -1
  79. package/src/theme/layout.scss +1 -1
  80. package/src/theme/nav-menu.scss +7 -5
  81. package/src/theme/page-bar.scss +51 -27
  82. package/src/theme/props-panel.scss +81 -1
  83. package/src/theme/resizer.scss +1 -1
  84. package/src/theme/search-input.scss +1 -0
  85. package/src/theme/sidebar.scss +4 -2
  86. package/src/theme/stage.scss +3 -1
  87. package/src/theme/theme.scss +28 -28
  88. package/src/theme/tree.scss +14 -12
  89. package/src/type.ts +10 -1
  90. package/src/utils/content-menu.ts +2 -2
  91. package/src/utils/data-source/formConfigs/http.ts +2 -0
  92. package/src/utils/data-source/index.ts +2 -2
  93. package/src/utils/editor.ts +78 -22
  94. package/src/utils/idle-task.ts +36 -4
  95. package/src/utils/props.ts +48 -6
  96. package/types/index.d.ts +2312 -2080
  97. package/src/hooks/use-data-source-method.ts +0 -100
  98. package/src/layouts/PropsPanel.vue +0 -131
  99. package/src/layouts/page-bar/SwitchTypeButton.vue +0 -45
@@ -20,10 +20,20 @@ import { reactive, toRaw } from 'vue';
20
20
  import { cloneDeep, get, isObject, mergeWith, uniq } from 'lodash-es';
21
21
  import type { Writable } from 'type-fest';
22
22
 
23
- import type { Id, MApp, MComponent, MContainer, MNode, MPage, MPageFragment, TargetOptions } from '@tmagic/core';
23
+ import type { Id, MApp, MContainer, MNode, MPage, MPageFragment, TargetOptions } from '@tmagic/core';
24
24
  import { NodeType, Target, Watcher } from '@tmagic/core';
25
+ import type { ChangeRecord } from '@tmagic/form';
25
26
  import { isFixed } from '@tmagic/stage';
26
- import { calcValueByFontsize, getElById, getNodePath, isNumber, isPage, isPageFragment, isPop } from '@tmagic/utils';
27
+ import {
28
+ calcValueByFontsize,
29
+ getElById,
30
+ getNodeInfo,
31
+ getNodePath,
32
+ isNumber,
33
+ isPage,
34
+ isPageFragment,
35
+ isPop,
36
+ } from '@tmagic/utils';
27
37
 
28
38
  import BaseService from '@editor/services//BaseService';
29
39
  import propsService from '@editor/services//props';
@@ -59,7 +69,7 @@ export interface EditorEvents {
59
69
  select: [node: MNode | null];
60
70
  add: [nodes: MNode[]];
61
71
  remove: [nodes: MNode[]];
62
- update: [nodes: MNode[]];
72
+ update: [nodes: { newNode: MNode; oldNode: MNode; changeRecords?: ChangeRecord[] }[]];
63
73
  'move-layer': [offset: number | LayerOffset];
64
74
  'drag-to': [data: { targetIndex: number; configs: MNode | MNode[]; targetParent: MContainer }];
65
75
  'history-change': [data: MPage | MPageFragment];
@@ -175,36 +185,7 @@ class Editor extends BaseService {
175
185
  root = toRaw(root);
176
186
  }
177
187
 
178
- const info: EditorNodeInfo = {
179
- node: null,
180
- parent: null,
181
- page: null,
182
- };
183
-
184
- if (!root) return info;
185
-
186
- if (id === root.id) {
187
- info.node = root;
188
- return info;
189
- }
190
-
191
- const path = getNodePath(id, root.items);
192
-
193
- if (!path.length) return info;
194
-
195
- path.unshift(root);
196
-
197
- info.node = path[path.length - 1] as MComponent;
198
- info.parent = path[path.length - 2] as MContainer;
199
-
200
- path.forEach((item) => {
201
- if (isPage(item) || isPageFragment(item)) {
202
- info.page = item as MPage | MPageFragment;
203
- return;
204
- }
205
- });
206
-
207
- return info;
188
+ return getNodeInfo(id, root);
208
189
  }
209
190
 
210
191
  /**
@@ -494,11 +475,11 @@ class Editor extends BaseService {
494
475
  if (isPage(node)) {
495
476
  this.state.pageLength -= 1;
496
477
 
497
- await selectDefault(getPageList(root));
478
+ await selectDefault(rootItems);
498
479
  } else if (isPageFragment(node)) {
499
480
  this.state.pageFragmentLength -= 1;
500
481
 
501
- await selectDefault(getPageFragmentList(root));
482
+ await selectDefault(rootItems);
502
483
  } else {
503
484
  await this.select(parent);
504
485
  stage?.select(parent.id);
@@ -529,7 +510,10 @@ class Editor extends BaseService {
529
510
  this.emit('remove', nodes);
530
511
  }
531
512
 
532
- public async doUpdate(config: MNode) {
513
+ public async doUpdate(
514
+ config: MNode,
515
+ { changeRecords = [] }: { changeRecords?: ChangeRecord[] } = {},
516
+ ): Promise<{ newNode: MNode; oldNode: MNode; changeRecords?: ChangeRecord[] }> {
533
517
  const root = this.get('root');
534
518
  if (!root) throw new Error('root为空');
535
519
 
@@ -539,7 +523,7 @@ class Editor extends BaseService {
539
523
 
540
524
  if (!info.node) throw new Error(`获取不到id为${config.id}的节点`);
541
525
 
542
- const node = cloneDeep(toRaw(info.node));
526
+ const node = toRaw(info.node);
543
527
 
544
528
  let newConfig = await this.toggleFixedPosition(toRaw(config), node, root);
545
529
 
@@ -561,7 +545,11 @@ class Editor extends BaseService {
561
545
 
562
546
  if (newConfig.type === NodeType.ROOT) {
563
547
  this.set('root', newConfig as MApp);
564
- return newConfig;
548
+ return {
549
+ oldNode: node,
550
+ newNode: newConfig,
551
+ changeRecords,
552
+ };
565
553
  }
566
554
 
567
555
  const { parent } = info;
@@ -586,11 +574,7 @@ class Editor extends BaseService {
586
574
  nodes.splice(targetIndex, 1, newConfig);
587
575
  this.set('nodes', [...nodes]);
588
576
 
589
- this.get('stage')?.update({
590
- config: cloneDeep(newConfig),
591
- parentId: parent.id,
592
- root: cloneDeep(root),
593
- });
577
+ // update后会触发依赖收集,收集完后会掉stage.update方法
594
578
 
595
579
  if (isPage(newConfig) || isPageFragment(newConfig)) {
596
580
  this.set('page', newConfig as MPage | MPageFragment);
@@ -598,7 +582,11 @@ class Editor extends BaseService {
598
582
 
599
583
  this.addModifiedNodeId(newConfig.id);
600
584
 
601
- return newConfig;
585
+ return {
586
+ oldNode: node,
587
+ newNode: newConfig,
588
+ changeRecords,
589
+ };
602
590
  }
603
591
 
604
592
  /**
@@ -606,17 +594,20 @@ class Editor extends BaseService {
606
594
  * @param config 新的节点配置,配置中需要有id信息
607
595
  * @returns 更新后的节点配置
608
596
  */
609
- public async update(config: MNode | MNode[]): Promise<MNode | MNode[]> {
597
+ public async update(
598
+ config: MNode | MNode[],
599
+ data: { changeRecords?: ChangeRecord[] } = {},
600
+ ): Promise<MNode | MNode[]> {
610
601
  const nodes = Array.isArray(config) ? config : [config];
611
602
 
612
- const newNodes = await Promise.all(nodes.map((node) => this.doUpdate(node)));
603
+ const updateData = await Promise.all(nodes.map((node) => this.doUpdate(node, data)));
613
604
 
614
- if (newNodes[0]?.type !== NodeType.ROOT) {
605
+ if (updateData[0].oldNode?.type !== NodeType.ROOT) {
615
606
  this.pushHistoryState();
616
607
  }
617
608
 
618
- this.emit('update', newNodes);
619
- return Array.isArray(config) ? newNodes : newNodes[0];
609
+ this.emit('update', updateData);
610
+ return Array.isArray(config) ? updateData.map((item) => item.newNode) : updateData[0].newNode;
620
611
  }
621
612
 
622
613
  /**
@@ -863,7 +854,7 @@ class Editor extends BaseService {
863
854
 
864
855
  const layout = await this.getLayout(target);
865
856
 
866
- const newConfig = mergeWith(cloneDeep(node), config, (objValue, srcValue) => {
857
+ const newConfig = mergeWith(cloneDeep(node), config, (_objValue, srcValue) => {
867
858
  if (Array.isArray(srcValue)) {
868
859
  return srcValue;
869
860
  }
@@ -875,7 +866,11 @@ class Editor extends BaseService {
875
866
  await stage.select(targetId);
876
867
 
877
868
  const targetParent = this.getParentById(target.id);
878
- await stage.update({ config: cloneDeep(target), parentId: targetParent?.id, root: cloneDeep(root) });
869
+ await stage.update({
870
+ config: cloneDeep(target),
871
+ parentId: targetParent?.id,
872
+ root: cloneDeep(root),
873
+ });
879
874
 
880
875
  await this.select(newConfig);
881
876
  stage.select(newConfig.id);
@@ -82,7 +82,8 @@ export class WebStorage extends BaseService {
82
82
  case Protocol.NUMBER:
83
83
  return Number(item);
84
84
  case Protocol.BOOLEAN:
85
- return Boolean(item);
85
+ if (item === 'true') return true;
86
+ if (item === 'false') return false;
86
87
  default:
87
88
  return item;
88
89
  }
@@ -29,6 +29,7 @@ import BaseService from './BaseService';
29
29
  const state = reactive<UiState>({
30
30
  uiSelectMode: false,
31
31
  showSrc: false,
32
+ showStylePanel: true,
32
33
  zoom: 1,
33
34
  stageContainerRect: {
34
35
  width: 0,
@@ -1,14 +1,16 @@
1
- $--theme-color: #2882e0;
1
+ $theme-color: #2882e0;
2
2
 
3
- $--font-color: #313a40;
4
- $--border-color: #d9dbdd;
5
- $--hover-color: #f3f5f9;
3
+ $font-color: #313a40;
4
+ $border-color: #d9dbdd;
5
+ $hover-color: #f3f5f9;
6
6
 
7
- $--nav-height: 35px;
8
- $--nav-color: #313a40;
9
- $--nav--background-color: #ffffff;
7
+ $nav-height: 35px;
8
+ $nav-color: #313a40;
9
+ $nav--background-color: #ffffff;
10
10
 
11
- $--sidebar-heder-background-color: $--theme-color;
12
- $--sidebar-content-background-color: #ffffff;
11
+ $sidebar-heder-background-color: $theme-color;
12
+ $sidebar-content-background-color: #ffffff;
13
13
 
14
- $--page-bar-height: 32px;
14
+ $page-bar-height: 32px;
15
+
16
+ $props-style-panel-width: 300px;
@@ -1,20 +1,22 @@
1
+ @use "common/var" as *;
2
+
1
3
  .ui-component-panel {
2
4
  &.tmagic-design-collapse {
3
5
  border-top: 0 !important;
4
6
  margin-top: 48px;
5
- background-color: $--sidebar-content-background-color;
7
+ background-color: $sidebar-content-background-color;
6
8
 
7
9
  .tmagic-design-collapse-item {
8
10
  > div:first-of-type {
9
- border-bottom: 1px solid $--border-color;
11
+ border-bottom: 1px solid $border-color;
10
12
  margin-bottom: 10px;
11
13
  }
12
14
  }
13
15
 
14
16
  .el-collapse-item__header,
15
17
  .t-collapse-panel__header {
16
- background: $--sidebar-content-background-color;
17
- color: $--font-color;
18
+ background: $sidebar-content-background-color;
19
+ color: $font-color;
18
20
  height: 25px;
19
21
  line-height: 25px;
20
22
  padding-left: 10px;
@@ -28,7 +30,7 @@
28
30
 
29
31
  .el-collapse-item__wrap,
30
32
  .t-collapse-panel__body {
31
- background: $--sidebar-content-background-color;
33
+ background: $sidebar-content-background-color;
32
34
  border-bottom: 0;
33
35
 
34
36
  .el-collapse-item__content,
@@ -44,7 +46,7 @@
44
46
  text-overflow: ellipsis;
45
47
  margin: 5px 10px;
46
48
  box-sizing: border-box;
47
- color: $--font-color;
49
+ color: $font-color;
48
50
  flex-direction: column;
49
51
  width: 42px;
50
52
  cursor: pointer;
@@ -57,7 +59,7 @@
57
59
  line-height: 40px;
58
60
  border-radius: 5px;
59
61
  color: #909090;
60
- border: 1px solid $--border-color;
62
+ border: 1px solid $border-color;
61
63
  display: flex;
62
64
  justify-content: space-evenly;
63
65
  align-items: center;
@@ -1,3 +1,5 @@
1
+ @use "common/var" as *;
2
+
1
3
  .magic-editor-content-menu {
2
4
  position: fixed;
3
5
  font-size: 12px;
@@ -29,7 +31,7 @@
29
31
 
30
32
  .el-button--text,
31
33
  i {
32
- color: $--font-color;
34
+ color: $font-color;
33
35
  }
34
36
 
35
37
  .magic-editor-icon {
@@ -46,20 +48,20 @@
46
48
 
47
49
  &.button {
48
50
  &:hover {
49
- background-color: $--hover-color;
51
+ background-color: $hover-color;
50
52
  .tmagic-design-button,
51
53
  .tmagic-design-button:active,
52
54
  .tmagic-design-button:focus {
53
- color: $--font-color;
55
+ color: $font-color;
54
56
  }
55
57
 
56
58
  &.menu-item i {
57
- color: $--font-color;
59
+ color: $font-color;
58
60
  }
59
61
  }
60
62
 
61
63
  &.active {
62
- background-color: $--theme-color;
64
+ background-color: $theme-color;
63
65
  .tmagic-design-button,
64
66
  .tmagic-design-button:active,
65
67
  .tmagic-design-button:focus {
@@ -1,3 +1,5 @@
1
+ @use "common/var" as *;
2
+
1
3
  .data-source-list-panel {
2
4
  .list-container {
3
5
  .list-item {
@@ -25,7 +27,7 @@
25
27
  padding: 5px 14px;
26
28
 
27
29
  &:hover {
28
- background-color: $--hover-color;
30
+ background-color: $hover-color;
29
31
  }
30
32
  }
31
33
  }
@@ -1,8 +1,10 @@
1
+ @use "common/var" as *;
2
+
1
3
  .m-editor-float-box {
2
4
  position: absolute;
3
5
  background-color: #fff;
4
6
  z-index: 100;
5
- border: 1px solid $--border-color;
7
+ border: 1px solid $border-color;
6
8
  display: flex;
7
9
  flex-direction: column;
8
10
  max-height: 100%;
@@ -17,7 +19,7 @@
17
19
  display: flex;
18
20
  justify-content: space-between;
19
21
  align-items: center;
20
- border-bottom: 1px solid $--border-color;
22
+ border-bottom: 1px solid $border-color;
21
23
  }
22
24
 
23
25
  .m-editor-float-box-body {
@@ -1,10 +1,12 @@
1
+ @use "common/var" as *;
2
+
1
3
  .m-editor {
2
4
  display: flex;
3
5
  flex-direction: column;
4
6
  width: 100%;
5
7
 
6
8
  &-content {
7
- height: calc(100% - #{$--nav-height});
9
+ height: calc(100% - #{$nav-height});
8
10
  }
9
11
 
10
12
  &-framework-center {
@@ -14,7 +16,7 @@
14
16
  }
15
17
 
16
18
  &-framework-left {
17
- background-color: $--sidebar-content-background-color;
19
+ background-color: $sidebar-content-background-color;
18
20
  }
19
21
 
20
22
  &-framework-center .el-scrollbar__view {
@@ -32,7 +34,7 @@
32
34
  justify-content: center;
33
35
  align-items: center;
34
36
  flex-direction: column;
35
- height: calc(100% - #{$--page-bar-height});
37
+ height: calc(100% - #{$page-bar-height});
36
38
  }
37
39
 
38
40
  &-content {
@@ -61,8 +63,8 @@
61
63
  }
62
64
 
63
65
  &:hover {
64
- border-color: $--theme-color;
65
- color: $--theme-color;
66
+ border-color: $theme-color;
67
+ color: $theme-color;
66
68
  }
67
69
  }
68
70
  }
@@ -1,8 +1,7 @@
1
- @import "@tmagic/design/src/theme/index.scss";
2
- @import "@tmagic/table/src/theme/index.scss";
3
- @import "@tmagic/form/src/theme/index.scss";
4
- @import "./common/var.scss";
5
- @import "./theme.scss";
1
+ @use "@tmagic/design/src/theme/index.scss" as tMagicDesign;
2
+ @use "@tmagic/table/src/theme/index.scss" as tMagicTable;
3
+ @use "@tmagic/form/src/theme/index.scss" as tMagicForm;
4
+ @use "./theme.scss";
6
5
 
7
6
  .fade-enter-active,
8
7
  .fade-leave-active {
@@ -11,10 +11,10 @@
11
11
  align-items: center;
12
12
  }
13
13
 
14
- .m-fileds-key-value-delimiter {
14
+ .m-fields-key-value-delimiter {
15
15
  margin: 0 10px;
16
16
  }
17
17
 
18
- .m-fileds-key-value-delete {
18
+ .m-fields-key-value-delete {
19
19
  margin-left: 10px;
20
20
  }
@@ -1,5 +1,7 @@
1
+ @use "common/var" as *;
2
+
1
3
  .m-editor-layer-panel {
2
- background: $--sidebar-content-background-color;
4
+ background: $sidebar-content-background-color;
3
5
 
4
6
  .m-editor-tree {
5
7
  padding-top: 48px;
@@ -3,7 +3,7 @@
3
3
  display: flex;
4
4
  justify-self: space-between;
5
5
 
6
- &:has(.m-editor-resizer-draging) {
6
+ &:has(.m-editor-resizer-dragging) {
7
7
  overflow: hidden;
8
8
  }
9
9
  }
@@ -1,3 +1,5 @@
1
+ @use "common/var" as *;
2
+
1
3
  .m-editor-nav-menu {
2
4
  display: flex;
3
5
  z-index: 5;
@@ -5,13 +7,13 @@
5
7
  justify-content: space-between;
6
8
  -webkit-box-align: center;
7
9
  align-items: center;
8
- background-color: $--nav--background-color;
10
+ background-color: $nav--background-color;
9
11
  font-size: 19.2px;
10
- color: $--nav-color;
12
+ color: $nav-color;
11
13
  font-weight: 400;
12
14
  box-sizing: border-box;
13
15
  margin: 0px;
14
- flex: 0 0 $--nav-height;
16
+ flex: 0 0 $nav-height;
15
17
  border-bottom: 1px solid #d8dee8;
16
18
 
17
19
  > div {
@@ -54,7 +56,7 @@
54
56
  }
55
57
 
56
58
  .is-text > i {
57
- color: $--font-color;
59
+ color: $font-color;
58
60
  }
59
61
 
60
62
  .icon {
@@ -66,7 +68,7 @@
66
68
  }
67
69
 
68
70
  .menu-item-text {
69
- color: $--nav-color;
71
+ color: $nav-color;
70
72
  }
71
73
 
72
74
  &.rule {
@@ -1,45 +1,34 @@
1
+ @use "common/var" as *;
2
+
1
3
  .m-editor-page-bar-tabs {
2
4
  position: fixed;
3
5
  bottom: 0;
4
6
  left: 0;
5
7
  width: 100%;
6
-
7
- .tmagic-design-button.m-editor-page-bar-switch-type-button {
8
- margin-left: 10px;
9
- position: relative;
10
- top: 1px;
11
- border-radius: 3px 3px 0 0;
12
- border: 1px solid $--border-color;
13
- border-bottom: 1px solid transparent;
14
- padding: 5px 10px;
15
-
16
- &.active {
17
- background-color: #f3f3f3;
18
- }
19
- }
8
+ user-select: none;
20
9
  }
21
10
 
22
11
  .m-editor-page-list-item {
23
12
  display: flex;
24
13
  width: 100%;
25
- height: $--page-bar-height;
26
- line-height: $--page-bar-height;
27
- color: $--font-color;
14
+ height: $page-bar-height;
15
+ line-height: $page-bar-height;
16
+ color: $font-color;
28
17
  z-index: 2;
29
18
  overflow: hidden;
30
19
  &:hover {
31
- background-color: $--hover-color;
20
+ background-color: $hover-color;
32
21
  }
33
22
  }
34
23
 
35
24
  .m-editor-page-bar {
36
25
  display: flex;
37
26
  width: 100%;
38
- height: $--page-bar-height;
39
- line-height: $--page-bar-height;
40
- color: $--font-color;
27
+ height: $page-bar-height;
28
+ line-height: $page-bar-height;
29
+ color: $font-color;
41
30
  background-color: #f3f3f3;
42
- border-top: 1px solid $--border-color;
31
+ border-top: 1px solid $border-color;
43
32
  z-index: 2;
44
33
  overflow: hidden;
45
34
 
@@ -51,7 +40,7 @@
51
40
  &-item {
52
41
  padding: 0 10px;
53
42
  cursor: pointer;
54
- border-right: 1px solid $--border-color;
43
+ border-right: 1px solid $border-color;
55
44
  display: flex;
56
45
  justify-items: center;
57
46
  align-items: center;
@@ -70,6 +59,11 @@
70
59
  &-icon {
71
60
  position: relative;
72
61
  z-index: 1;
62
+
63
+ .icon-active {
64
+ font-weight: bold;
65
+ color: $theme-color;
66
+ }
73
67
  }
74
68
 
75
69
  &-title {
@@ -78,6 +72,18 @@
78
72
  white-space: nowrap;
79
73
  overflow: hidden;
80
74
  }
75
+
76
+ &-left-icon,
77
+ &-right-icon {
78
+ position: absolute;
79
+ right: 0;
80
+ top: 0;
81
+ height: 100%;
82
+ }
83
+
84
+ &-left-icon {
85
+ right: 34px;
86
+ }
81
87
  }
82
88
  }
83
89
 
@@ -91,13 +97,31 @@
91
97
  transition: all 0.2s ease 0s;
92
98
  padding: 5px 14px;
93
99
 
94
- .el-button--text,
95
- i {
96
- color: $--font-color;
100
+ .tmagic-design-button {
101
+ color: $font-color;
97
102
  }
98
103
 
99
104
  &:hover {
100
- background-color: $--hover-color;
105
+ background-color: $hover-color;
106
+ }
107
+
108
+ &.active {
109
+ .tmagic-design-button {
110
+ color: $theme-color;
111
+ }
101
112
  }
102
113
  }
103
114
  }
115
+
116
+ .m-editor-page-bar-search-panel {
117
+ position: absolute;
118
+ bottom: $page-bar-height;
119
+ border: 1px solid $border-color;
120
+ padding: 6px 10px;
121
+ width: 100%;
122
+ box-sizing: border-box;
123
+
124
+ .tmagic-design-form-item {
125
+ margin-bottom: 0;
126
+ }
127
+ }