@tmagic/editor 1.3.4 → 1.3.6

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 (103) hide show
  1. package/dist/style.css +73 -51
  2. package/dist/tmagic-editor.js +1171 -1102
  3. package/dist/tmagic-editor.js.map +1 -1
  4. package/dist/tmagic-editor.umd.cjs +1188 -1119
  5. package/dist/tmagic-editor.umd.cjs.map +1 -1
  6. package/package.json +17 -17
  7. package/src/Editor.vue +5 -0
  8. package/src/components/FloatingBox.vue +117 -0
  9. package/src/components/Tree.vue +5 -0
  10. package/src/components/TreeNode.vue +8 -2
  11. package/src/editorProps.ts +7 -0
  12. package/src/hooks/use-filter.ts +55 -0
  13. package/src/hooks/use-node-status.ts +48 -0
  14. package/src/hooks/use-stage.ts +1 -0
  15. package/src/initService.ts +28 -12
  16. package/src/layouts/sidebar/Sidebar.vue +7 -2
  17. package/src/layouts/sidebar/code-block/CodeBlockList.vue +55 -65
  18. package/src/layouts/sidebar/code-block/CodeBlockListPanel.vue +2 -1
  19. package/src/layouts/sidebar/data-source/DataSourceList.vue +63 -59
  20. package/src/layouts/sidebar/data-source/DataSourceListPanel.vue +1 -1
  21. package/src/layouts/sidebar/layer/LayerPanel.vue +24 -7
  22. package/src/layouts/sidebar/layer/use-node-status.ts +8 -11
  23. package/src/layouts/workspace/viewer/NodeListMenu.vue +67 -128
  24. package/src/layouts/workspace/viewer/Stage.vue +2 -1
  25. package/src/layouts/workspace/viewer/ViewerMenu.vue +1 -6
  26. package/src/services/BaseService.ts +63 -26
  27. package/src/services/codeBlock.ts +7 -1
  28. package/src/services/dep.ts +12 -8
  29. package/src/services/editor.ts +66 -30
  30. package/src/services/props.ts +70 -12
  31. package/src/services/storage.ts +23 -13
  32. package/src/services/ui.ts +4 -1
  33. package/src/theme/floating-box.scss +30 -0
  34. package/src/theme/layer-panel.scss +19 -0
  35. package/src/theme/stage.scss +24 -0
  36. package/src/theme/theme.scss +1 -1
  37. package/src/theme/tree.scss +12 -1
  38. package/src/type.ts +6 -3
  39. package/src/utils/compose.ts +25 -6
  40. package/src/utils/content-menu.ts +4 -5
  41. package/src/utils/editor.ts +12 -3
  42. package/src/utils/operator.ts +1 -2
  43. package/types/components/CodeBlockEditor.vue.d.ts +6 -2
  44. package/types/components/CodeParams.vue.d.ts +3 -1
  45. package/types/components/ContentMenu.vue.d.ts +13 -5
  46. package/types/components/FloatingBox.vue.d.ts +78 -0
  47. package/types/components/Resizer.vue.d.ts +6 -1
  48. package/types/components/ScrollBar.vue.d.ts +3 -1
  49. package/types/components/ScrollViewer.vue.d.ts +3 -3
  50. package/types/components/SearchInput.vue.d.ts +3 -1
  51. package/types/components/SplitView.vue.d.ts +8 -4
  52. package/types/components/ToolButton.vue.d.ts +1 -1
  53. package/types/components/Tree.vue.d.ts +27 -8
  54. package/types/components/TreeNode.vue.d.ts +24 -7
  55. package/types/editorProps.d.ts +7 -1
  56. package/types/fields/Code.vue.d.ts +6 -2
  57. package/types/fields/CodeLink.vue.d.ts +5 -3
  58. package/types/fields/CodeSelect.vue.d.ts +3 -1
  59. package/types/fields/CodeSelectCol.vue.d.ts +3 -1
  60. package/types/fields/DataSourceFieldSelect.vue.d.ts +3 -1
  61. package/types/fields/DataSourceFields.vue.d.ts +5 -3
  62. package/types/fields/DataSourceInput.vue.d.ts +8 -4
  63. package/types/fields/DataSourceMethodSelect.vue.d.ts +3 -1
  64. package/types/fields/DataSourceMethods.vue.d.ts +5 -3
  65. package/types/fields/DataSourceMocks.vue.d.ts +5 -3
  66. package/types/fields/DataSourceSelect.vue.d.ts +5 -3
  67. package/types/fields/EventSelect.vue.d.ts +3 -1
  68. package/types/fields/KeyValue.vue.d.ts +2 -2
  69. package/types/fields/UISelect.vue.d.ts +3 -1
  70. package/types/hooks/use-code-block-edit.d.ts +14 -5
  71. package/types/hooks/use-data-source-method.d.ts +14 -5
  72. package/types/hooks/use-filter.d.ts +7 -0
  73. package/types/hooks/use-node-status.d.ts +6 -0
  74. package/types/layouts/CodeEditor.vue.d.ts +4 -1
  75. package/types/layouts/Framework.vue.d.ts +1 -1
  76. package/types/layouts/PropsPanel.vue.d.ts +10 -4
  77. package/types/layouts/sidebar/ComponentListPanel.vue.d.ts +1 -1
  78. package/types/layouts/sidebar/Sidebar.vue.d.ts +5 -5
  79. package/types/layouts/sidebar/code-block/CodeBlockList.vue.d.ts +9 -3
  80. package/types/layouts/sidebar/code-block/CodeBlockListPanel.vue.d.ts +1 -1
  81. package/types/layouts/sidebar/data-source/DataSourceConfigPanel.vue.d.ts +3 -1
  82. package/types/layouts/sidebar/data-source/DataSourceList.vue.d.ts +8 -2
  83. package/types/layouts/sidebar/data-source/DataSourceListPanel.vue.d.ts +1 -1
  84. package/types/layouts/sidebar/layer/LayerMenu.vue.d.ts +6 -2
  85. package/types/layouts/sidebar/layer/LayerPanel.vue.d.ts +1 -1
  86. package/types/layouts/sidebar/layer/use-click.d.ts +14 -5
  87. package/types/layouts/sidebar/layer/use-node-status.d.ts +3 -4
  88. package/types/layouts/workspace/Workspace.vue.d.ts +1 -1
  89. package/types/layouts/workspace/viewer/NodeListMenu.vue.d.ts +1 -14
  90. package/types/layouts/workspace/viewer/ViewerMenu.vue.d.ts +1 -1
  91. package/types/services/BaseService.d.ts +4 -1
  92. package/types/services/dep.d.ts +6 -5
  93. package/types/services/editor.d.ts +9 -3
  94. package/types/services/props.d.ts +25 -1
  95. package/types/services/storage.d.ts +7 -7
  96. package/types/type.d.ts +8 -6
  97. package/types/utils/compose.d.ts +1 -1
  98. package/types/utils/editor.d.ts +5 -1
  99. package/src/layouts/sidebar/layer/use-filter.ts +0 -59
  100. package/src/layouts/workspace/viewer/NodeListMenuTitle.vue +0 -68
  101. package/src/theme/dep-list.scss +0 -59
  102. package/types/layouts/sidebar/layer/use-filter.d.ts +0 -7
  103. package/types/layouts/workspace/viewer/NodeListMenuTitle.vue.d.ts +0 -15
@@ -1,68 +0,0 @@
1
- <template>
2
- <div
3
- style="
4
- text-align: center;
5
- padding: 5px 0;
6
- font-size: 14px;
7
- cursor: move;
8
- display: flex;
9
- justify-content: space-between;
10
- align-items: center;
11
- "
12
- ref="target"
13
- >
14
- <TMagicTooltip placement="top" :content="pinned ? '取消置于顶层自动隐藏' : '置于顶层不消失'">
15
- <MIcon
16
- style="margin-left: 10px; cursor: pointer"
17
- :icon="pinned ? PinnedIcon : PinIcon"
18
- @click="pinHandler"
19
- ></MIcon>
20
- </TMagicTooltip>
21
-
22
- <span>可选组件</span>
23
-
24
- <div style="margin-right: 10px">
25
- <TMagicButton text size="small" @click="closeHandler">
26
- <MIcon :icon="Close"></MIcon>
27
- </TMagicButton>
28
- </div>
29
- </div>
30
- </template>
31
-
32
- <script lang="ts" setup>
33
- import { ref } from 'vue';
34
- import { Close } from '@element-plus/icons-vue';
35
- import type { OnDrag } from 'gesto';
36
-
37
- import { TMagicButton, TMagicTooltip } from '@tmagic/design';
38
-
39
- import MIcon from '@editor/components/Icon.vue';
40
- import { useGetSo } from '@editor/hooks/use-getso';
41
- import PinIcon from '@editor/icons/PinIcon.vue';
42
- import PinnedIcon from '@editor/icons/PinnedIcon.vue';
43
-
44
- defineOptions({
45
- name: 'MEditorNodeListMenuTitle',
46
- });
47
-
48
- const props = defineProps<{
49
- pinned: boolean;
50
- }>();
51
-
52
- const emit = defineEmits<{
53
- close: [];
54
- 'update:pinned': [pinned: boolean];
55
- change: [e: OnDrag];
56
- }>();
57
-
58
- const pinHandler = () => {
59
- emit('update:pinned', !props.pinned);
60
- };
61
-
62
- const closeHandler = () => {
63
- emit('close');
64
- };
65
-
66
- const target = ref<HTMLDivElement>();
67
- useGetSo(target, emit);
68
- </script>
@@ -1,59 +0,0 @@
1
- .m-editor-dep-list-panel {
2
- .magic-editor-layer-tree {
3
- padding-top: 48px;
4
- }
5
-
6
- .search-wrapper {
7
- display: flex;
8
- align-items: center;
9
- justify-content: center;
10
- position: absolute;
11
- top: 0;
12
- width: 100%;
13
- z-index: 1;
14
-
15
- .search-input {
16
- flex: 1;
17
- position: relative;
18
- }
19
-
20
- .tmagic-design-button {
21
- margin-right: 10px;
22
- }
23
- }
24
-
25
- .list-container {
26
- width: 100%;
27
- overflow: hidden;
28
- .list-item {
29
- display: flex;
30
- width: 100%;
31
- align-items: center;
32
-
33
- .right-tool {
34
- display: flex;
35
- width: fit-content !important;
36
- align-items: center;
37
- .edit-icon {
38
- margin: 0 5px;
39
- }
40
- }
41
- .name {
42
- white-space: nowrap;
43
- overflow: hidden;
44
- text-overflow: ellipsis;
45
- width: 0 !important;
46
- flex: 1;
47
- line-height: 22px;
48
-
49
- &.code {
50
- color: #000;
51
- }
52
-
53
- &.hook {
54
- color: #909399;
55
- }
56
- }
57
- }
58
- }
59
- }
@@ -1,7 +0,0 @@
1
- import { type ComputedRef } from 'vue';
2
- import { Id, MPage } from '@tmagic/schema';
3
- import { LayerNodeStatus } from '../../../type';
4
- export declare const useFilter: (nodeStatusMap: ComputedRef<Map<Id, LayerNodeStatus> | undefined>, page: ComputedRef<MPage | null | undefined>) => {
5
- filterText: import("vue").Ref<string>;
6
- filterTextChangeHandler(text: string): void;
7
- };
@@ -1,15 +0,0 @@
1
- declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
2
- pinned: boolean;
3
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
4
- pinned: boolean;
5
- }>>>, {}, {}>;
6
- export default _default;
7
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
8
- type __VLS_TypePropsToRuntimeProps<T> = {
9
- [K in keyof T]-?: {} extends Pick<T, K> ? {
10
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
11
- } : {
12
- type: import('vue').PropType<T[K]>;
13
- required: true;
14
- };
15
- };