@tmagic/editor 1.5.0 → 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 (72) hide show
  1. package/dist/{style.css → tmagic-editor.css} +153 -6
  2. package/dist/tmagic-editor.js +906 -527
  3. package/dist/tmagic-editor.umd.cjs +931 -551
  4. package/package.json +10 -10
  5. package/src/Editor.vue +18 -5
  6. package/src/components/CodeBlockEditor.vue +3 -3
  7. package/src/components/CodeParams.vue +2 -2
  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 +3 -1
  16. package/src/fields/DataSourceInput.vue +2 -2
  17. package/src/fields/DataSourceMethods.vue +2 -2
  18. package/src/fields/DataSourceMocks.vue +0 -1
  19. package/src/fields/EventSelect.vue +0 -1
  20. package/src/fields/KeyValue.vue +2 -2
  21. package/src/hooks/use-code-block-edit.ts +2 -2
  22. package/src/hooks/use-getso.ts +7 -7
  23. package/src/index.ts +2 -1
  24. package/src/layouts/CodeEditor.vue +2 -2
  25. package/src/layouts/Framework.vue +5 -8
  26. package/src/layouts/NavMenu.vue +2 -2
  27. package/src/layouts/page-bar/PageBar.vue +3 -3
  28. package/src/layouts/page-bar/PageBarScrollContainer.vue +3 -3
  29. package/src/layouts/props-panel/FormPanel.vue +123 -0
  30. package/src/layouts/props-panel/PropsPanel.vue +146 -0
  31. package/src/layouts/props-panel/use-style-panel.ts +29 -0
  32. package/src/layouts/sidebar/Sidebar.vue +4 -1
  33. package/src/layouts/sidebar/code-block/CodeBlockList.vue +12 -1
  34. package/src/layouts/sidebar/code-block/CodeBlockListPanel.vue +35 -4
  35. package/src/layouts/sidebar/code-block/useContentMenu.ts +83 -0
  36. package/src/layouts/sidebar/data-source/DataSourceList.vue +8 -8
  37. package/src/layouts/sidebar/data-source/DataSourceListPanel.vue +40 -4
  38. package/src/layouts/sidebar/data-source/useContentMenu.ts +81 -0
  39. package/src/layouts/sidebar/layer/LayerMenu.vue +7 -13
  40. package/src/layouts/sidebar/layer/LayerPanel.vue +11 -4
  41. package/src/layouts/sidebar/layer/use-click.ts +2 -2
  42. package/src/layouts/sidebar/layer/use-keybinding.ts +2 -2
  43. package/src/layouts/workspace/Workspace.vue +9 -2
  44. package/src/layouts/workspace/viewer/NodeListMenu.vue +3 -3
  45. package/src/layouts/workspace/viewer/Stage.vue +18 -6
  46. package/src/layouts/workspace/viewer/StageOverlay.vue +2 -2
  47. package/src/layouts/workspace/viewer/ViewerMenu.vue +4 -6
  48. package/src/services/storage.ts +2 -1
  49. package/src/services/ui.ts +1 -0
  50. package/src/theme/common/var.scss +12 -10
  51. package/src/theme/component-list-panel.scss +9 -7
  52. package/src/theme/content-menu.scss +7 -5
  53. package/src/theme/data-source.scss +3 -1
  54. package/src/theme/floating-box.scss +4 -2
  55. package/src/theme/framework.scss +7 -5
  56. package/src/theme/index.scss +4 -5
  57. package/src/theme/key-value.scss +2 -2
  58. package/src/theme/layer-panel.scss +3 -1
  59. package/src/theme/layout.scss +1 -1
  60. package/src/theme/nav-menu.scss +7 -5
  61. package/src/theme/page-bar.scss +17 -15
  62. package/src/theme/props-panel.scss +81 -1
  63. package/src/theme/resizer.scss +1 -1
  64. package/src/theme/sidebar.scss +4 -2
  65. package/src/theme/stage.scss +3 -1
  66. package/src/theme/theme.scss +28 -28
  67. package/src/theme/tree.scss +14 -12
  68. package/src/type.ts +8 -0
  69. package/src/utils/content-menu.ts +2 -2
  70. package/src/utils/props.ts +45 -3
  71. package/types/index.d.ts +1796 -1230
  72. package/src/layouts/PropsPanel.vue +0 -131
@@ -0,0 +1,81 @@
1
+ import { inject, markRaw, useTemplateRef } from 'vue';
2
+ import { CopyDocument, Delete, Edit } from '@element-plus/icons-vue';
3
+ import { cloneDeep } from 'lodash-es';
4
+
5
+ import ContentMenu from '@editor/components/ContentMenu.vue';
6
+ import type { EventBus, MenuButton, MenuComponent, Services, TreeNodeData } from '@editor/type';
7
+
8
+ export const useContentMenu = () => {
9
+ const eventBus = inject<EventBus>('eventBus');
10
+ const menuRef = useTemplateRef<InstanceType<typeof ContentMenu>>('menu');
11
+
12
+ let selectId = '';
13
+
14
+ const menuData: (MenuButton | MenuComponent)[] = [
15
+ {
16
+ type: 'button',
17
+ text: '编辑',
18
+ icon: Edit,
19
+ display: (services) => services?.dataSourceService?.get('editable') ?? true,
20
+ handler: () => {
21
+ if (!selectId) {
22
+ return;
23
+ }
24
+
25
+ eventBus?.emit('edit-data-source', selectId);
26
+ },
27
+ },
28
+ {
29
+ type: 'button',
30
+ text: '复制并粘贴至当前',
31
+ icon: markRaw(CopyDocument),
32
+ handler: ({ dataSourceService }: Services) => {
33
+ if (!selectId) {
34
+ return;
35
+ }
36
+
37
+ const ds = dataSourceService.getDataSourceById(selectId);
38
+ if (!ds) {
39
+ return;
40
+ }
41
+
42
+ dataSourceService.add(cloneDeep(ds));
43
+ },
44
+ },
45
+ {
46
+ type: 'button',
47
+ text: '删除',
48
+ icon: Delete,
49
+ handler: () => {
50
+ if (!selectId) {
51
+ return;
52
+ }
53
+
54
+ eventBus?.emit('remove-data-source', selectId);
55
+ },
56
+ },
57
+ ];
58
+
59
+ const nodeContentMenuHandler = (event: MouseEvent, data: TreeNodeData) => {
60
+ event.preventDefault();
61
+
62
+ if (data.type === 'ds') {
63
+ menuRef.value?.show(event);
64
+ if (data.id) {
65
+ selectId = `${data.id}`;
66
+ } else {
67
+ selectId = '';
68
+ }
69
+ }
70
+ };
71
+
72
+ const contentMenuHideHandler = () => {
73
+ selectId = '';
74
+ };
75
+
76
+ return {
77
+ menuData,
78
+ nodeContentMenuHandler,
79
+ contentMenuHideHandler,
80
+ };
81
+ };
@@ -3,37 +3,31 @@
3
3
  </template>
4
4
 
5
5
  <script lang="ts" setup>
6
- import { computed, inject, markRaw, ref } from 'vue';
6
+ import { computed, inject, markRaw, useTemplateRef } from 'vue';
7
7
  import { Files, Plus } from '@element-plus/icons-vue';
8
8
 
9
9
  import { isPage, isPageFragment } from '@tmagic/utils';
10
10
 
11
11
  import ContentMenu from '@editor/components/ContentMenu.vue';
12
12
  import FolderMinusIcon from '@editor/icons/FolderMinusIcon.vue';
13
- import type { ComponentGroup, MenuButton, MenuComponent, Services } from '@editor/type';
13
+ import type { ComponentGroup, CustomContentMenuFunction, MenuButton, MenuComponent, Services } from '@editor/type';
14
14
  import { useCopyMenu, useDeleteMenu, useMoveToMenu, usePasteMenu } from '@editor/utils/content-menu';
15
15
 
16
16
  defineOptions({
17
17
  name: 'MEditorLayerMenu',
18
18
  });
19
19
 
20
- const props = withDefaults(
21
- defineProps<{
22
- layerContentMenu: (MenuButton | MenuComponent)[];
23
- customContentMenu?: (menus: (MenuButton | MenuComponent)[], type: string) => (MenuButton | MenuComponent)[];
24
- }>(),
25
- {
26
- layerContentMenu: () => [],
27
- customContentMenu: (menus: (MenuButton | MenuComponent)[]) => menus,
28
- },
29
- );
20
+ const props = defineProps<{
21
+ layerContentMenu: (MenuButton | MenuComponent)[];
22
+ customContentMenu: CustomContentMenuFunction;
23
+ }>();
30
24
 
31
25
  const emit = defineEmits<{
32
26
  'collapse-all': [];
33
27
  }>();
34
28
 
35
29
  const services = inject<Services>('services');
36
- const menu = ref<InstanceType<typeof ContentMenu>>();
30
+ const menu = useTemplateRef<InstanceType<typeof ContentMenu>>('menu');
37
31
  const node = computed(() => services?.editorService.get('node'));
38
32
  const nodes = computed(() => services?.editorService.get('nodes'));
39
33
  const componentList = computed(() => services?.componentListService.getList() || []);
@@ -47,7 +47,7 @@
47
47
  </template>
48
48
 
49
49
  <script setup lang="ts">
50
- import { computed, inject, ref } from 'vue';
50
+ import { computed, inject, useTemplateRef } from 'vue';
51
51
 
52
52
  import type { MNode } from '@tmagic/core';
53
53
  import { TMagicScrollbar } from '@tmagic/design';
@@ -55,7 +55,14 @@ import { TMagicScrollbar } from '@tmagic/design';
55
55
  import SearchInput from '@editor/components/SearchInput.vue';
56
56
  import Tree from '@editor/components/Tree.vue';
57
57
  import { useFilter } from '@editor/hooks/use-filter';
58
- import type { LayerPanelSlots, MenuButton, MenuComponent, Services, TreeNodeData } from '@editor/type';
58
+ import type {
59
+ CustomContentMenuFunction,
60
+ LayerPanelSlots,
61
+ MenuButton,
62
+ MenuComponent,
63
+ Services,
64
+ TreeNodeData,
65
+ } from '@editor/type';
59
66
 
60
67
  import LayerMenu from './LayerMenu.vue';
61
68
  import LayerNodeTool from './LayerNodeTool.vue';
@@ -74,13 +81,13 @@ defineProps<{
74
81
  layerContentMenu: (MenuButton | MenuComponent)[];
75
82
  indent?: number;
76
83
  nextLevelIndentIncrement?: number;
77
- customContentMenu?: (menus: (MenuButton | MenuComponent)[], type: string) => (MenuButton | MenuComponent)[];
84
+ customContentMenu: CustomContentMenuFunction;
78
85
  }>();
79
86
 
80
87
  const services = inject<Services>('services');
81
88
  const editorService = services?.editorService;
82
89
 
83
- const tree = ref<InstanceType<typeof Tree>>();
90
+ const tree = useTemplateRef<InstanceType<typeof Tree>>('tree');
84
91
 
85
92
  const page = computed(() => editorService?.get('page'));
86
93
  const nodeData = computed<TreeNodeData[]>(() => (!page.value ? [] : [page.value]));
@@ -1,4 +1,4 @@
1
- import { computed, type ComputedRef, nextTick, type Ref, ref } from 'vue';
1
+ import { computed, type ComputedRef, nextTick, type Ref, useTemplateRef } from 'vue';
2
2
  import { throttle } from 'lodash-es';
3
3
 
4
4
  import { Id, MNode } from '@tmagic/core';
@@ -99,7 +99,7 @@ export const useClick = (
99
99
  };
100
100
 
101
101
  // 右键菜单
102
- const menu = ref<InstanceType<typeof LayerMenu>>();
102
+ const menu = useTemplateRef<InstanceType<typeof LayerMenu>>('menu');
103
103
 
104
104
  return {
105
105
  menu,
@@ -1,4 +1,4 @@
1
- import { type Ref, ref, watchEffect } from 'vue';
1
+ import { ref, type ShallowRef, watchEffect } from 'vue';
2
2
 
3
3
  import Tree from '@editor/components/Tree.vue';
4
4
  import type { Services } from '@editor/type';
@@ -6,7 +6,7 @@ import { KeyBindingContainerKey } from '@editor/utils/keybinding-config';
6
6
 
7
7
  export const useKeybinding = (
8
8
  services: Services | undefined,
9
- container: Ref<InstanceType<typeof Tree> | undefined>,
9
+ container: ShallowRef<InstanceType<typeof Tree> | null>,
10
10
  ) => {
11
11
  const keybindingService = services?.keybindingService;
12
12
 
@@ -19,7 +19,14 @@
19
19
  <script lang="ts" setup>
20
20
  import { computed, inject } from 'vue';
21
21
 
22
- import type { MenuButton, MenuComponent, Services, StageOptions, WorkspaceSlots } from '@editor/type';
22
+ import type {
23
+ CustomContentMenuFunction,
24
+ MenuButton,
25
+ MenuComponent,
26
+ Services,
27
+ StageOptions,
28
+ WorkspaceSlots,
29
+ } from '@editor/type';
23
30
 
24
31
  import MagicStage from './viewer/Stage.vue';
25
32
  import Breadcrumb from './Breadcrumb.vue';
@@ -34,7 +41,7 @@ withDefaults(
34
41
  defineProps<{
35
42
  stageContentMenu: (MenuButton | MenuComponent)[];
36
43
  disabledStageOverlay?: boolean;
37
- customContentMenu?: (menus: (MenuButton | MenuComponent)[], type: string) => (MenuButton | MenuComponent)[];
44
+ customContentMenu: CustomContentMenuFunction;
38
45
  }>(),
39
46
  {
40
47
  disabledStageOverlay: false,
@@ -22,7 +22,7 @@
22
22
  </template>
23
23
 
24
24
  <script lang="ts" setup>
25
- import { computed, inject, nextTick, ref, watch } from 'vue';
25
+ import { computed, inject, nextTick, ref, useTemplateRef, watch } from 'vue';
26
26
 
27
27
  import type { MNode } from '@tmagic/core';
28
28
  import { TMagicTooltip } from '@tmagic/design';
@@ -39,8 +39,8 @@ const editorService = services?.editorService;
39
39
 
40
40
  const visible = ref(false);
41
41
  const buttonVisible = ref(false);
42
- const button = ref<HTMLDivElement>();
43
- const box = ref<InstanceType<typeof FloatingBox>>();
42
+ const button = useTemplateRef<HTMLDivElement>('button');
43
+ const box = useTemplateRef<InstanceType<typeof FloatingBox>>('box');
44
44
 
45
45
  const stage = computed(() => editorService?.get('stage'));
46
46
  const page = computed(() => editorService?.get('page'));
@@ -43,7 +43,18 @@
43
43
  </template>
44
44
 
45
45
  <script lang="ts" setup>
46
- import { computed, inject, markRaw, nextTick, onBeforeUnmount, onMounted, ref, toRaw, watch, watchEffect } from 'vue';
46
+ import {
47
+ computed,
48
+ inject,
49
+ markRaw,
50
+ nextTick,
51
+ onBeforeUnmount,
52
+ onMounted,
53
+ toRaw,
54
+ useTemplateRef,
55
+ watch,
56
+ watchEffect,
57
+ } from 'vue';
47
58
  import { cloneDeep } from 'lodash-es';
48
59
 
49
60
  import type { MApp, MContainer } from '@tmagic/core';
@@ -52,7 +63,8 @@ import { calcValueByFontsize, getIdFromEl } from '@tmagic/utils';
52
63
 
53
64
  import ScrollViewer from '@editor/components/ScrollViewer.vue';
54
65
  import { useStage } from '@editor/hooks/use-stage';
55
- import { DragType, Layout, type MenuButton, type MenuComponent, type Services, type StageOptions } from '@editor/type';
66
+ import type { CustomContentMenuFunction, MenuButton, MenuComponent, Services, StageOptions } from '@editor/type';
67
+ import { DragType, Layout } from '@editor/type';
56
68
  import { getEditorConfig } from '@editor/utils/config';
57
69
  import { KeyBindingContainerKey } from '@editor/utils/keybinding-config';
58
70
 
@@ -69,7 +81,7 @@ const props = withDefaults(
69
81
  stageOptions: StageOptions;
70
82
  stageContentMenu: (MenuButton | MenuComponent)[];
71
83
  disabledStageOverlay?: boolean;
72
- customContentMenu?: (menus: (MenuButton | MenuComponent)[], type: string) => (MenuButton | MenuComponent)[];
84
+ customContentMenu: CustomContentMenuFunction;
73
85
  }>(),
74
86
  {
75
87
  disabledStageOverlay: false,
@@ -83,9 +95,9 @@ const services = inject<Services>('services');
83
95
 
84
96
  const stageLoading = computed(() => services?.editorService.get('stageLoading') || false);
85
97
 
86
- const stageWrap = ref<InstanceType<typeof ScrollViewer>>();
87
- const stageContainer = ref<HTMLDivElement>();
88
- const menu = ref<InstanceType<typeof ViewerMenu>>();
98
+ const stageWrap = useTemplateRef<InstanceType<typeof ScrollViewer>>('stageWrap');
99
+ const stageContainer = useTemplateRef<HTMLDivElement>('stageContainer');
100
+ const menu = useTemplateRef<InstanceType<typeof ViewerMenu>>('menu');
89
101
 
90
102
  const nodes = computed(() => services?.editorService.get('nodes') || []);
91
103
  const isMultiSelect = computed(() => nodes.value.length > 1);
@@ -8,7 +8,7 @@
8
8
  </template>
9
9
 
10
10
  <script setup lang="ts">
11
- import { computed, inject, onBeforeUnmount, ref, watch } from 'vue';
11
+ import { computed, inject, onBeforeUnmount, useTemplateRef, watch } from 'vue';
12
12
  import { CloseBold } from '@element-plus/icons-vue';
13
13
 
14
14
  import { TMagicIcon } from '@tmagic/design';
@@ -19,7 +19,7 @@ const services = inject<Services>('services');
19
19
 
20
20
  const stageOptions = inject<StageOptions>('stageOptions');
21
21
 
22
- const stageOverlay = ref<HTMLDivElement>();
22
+ const stageOverlay = useTemplateRef<HTMLDivElement>('stageOverlay');
23
23
 
24
24
  const stageOverlayVisible = computed(() => services?.stageOverlayService.get('stageOverlayVisible'));
25
25
  const wrapWidth = computed(() => services?.stageOverlayService.get('wrapWidth') || 0);
@@ -3,7 +3,7 @@
3
3
  </template>
4
4
 
5
5
  <script lang="ts" setup>
6
- import { computed, inject, markRaw, ref, watch } from 'vue';
6
+ import { computed, inject, markRaw, ref, useTemplateRef, watch } from 'vue';
7
7
  import { Bottom, Top } from '@element-plus/icons-vue';
8
8
 
9
9
  import { NodeType } from '@tmagic/core';
@@ -11,7 +11,7 @@ import { isPage, isPageFragment } from '@tmagic/utils';
11
11
 
12
12
  import ContentMenu from '@editor/components/ContentMenu.vue';
13
13
  import CenterIcon from '@editor/icons/CenterIcon.vue';
14
- import { LayerOffset, Layout, MenuButton, MenuComponent, Services } from '@editor/type';
14
+ import { CustomContentMenuFunction, LayerOffset, Layout, MenuButton, MenuComponent, Services } from '@editor/type';
15
15
  import { useCopyMenu, useDeleteMenu, useMoveToMenu, usePasteMenu } from '@editor/utils/content-menu';
16
16
 
17
17
  defineOptions({
@@ -22,18 +22,16 @@ const props = withDefaults(
22
22
  defineProps<{
23
23
  isMultiSelect?: boolean;
24
24
  stageContentMenu: (MenuButton | MenuComponent)[];
25
- customContentMenu?: (menus: (MenuButton | MenuComponent)[], type: string) => (MenuButton | MenuComponent)[];
25
+ customContentMenu: CustomContentMenuFunction;
26
26
  }>(),
27
27
  {
28
28
  isMultiSelect: false,
29
- stageContentMenu: () => [],
30
- customContentMenu: (menus: (MenuButton | MenuComponent)[]) => menus,
31
29
  },
32
30
  );
33
31
 
34
32
  const services = inject<Services>('services');
35
33
  const editorService = services?.editorService;
36
- const menu = ref<InstanceType<typeof ContentMenu>>();
34
+ const menu = useTemplateRef<InstanceType<typeof ContentMenu>>('menu');
37
35
  const canCenter = ref(false);
38
36
 
39
37
  const node = computed(() => editorService?.get('node'));
@@ -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 {