@tmagic/editor 1.3.5 → 1.3.7

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 (142) hide show
  1. package/LICENSE +5432 -0
  2. package/dist/style.css +88 -62
  3. package/dist/tmagic-editor.js +2448 -2016
  4. package/dist/tmagic-editor.js.map +1 -1
  5. package/dist/tmagic-editor.umd.cjs +2453 -2019
  6. package/dist/tmagic-editor.umd.cjs.map +1 -1
  7. package/package.json +23 -23
  8. package/src/Editor.vue +15 -7
  9. package/src/components/CodeBlockEditor.vue +2 -2
  10. package/src/components/ContentMenu.vue +5 -5
  11. package/src/components/FloatingBox.vue +117 -0
  12. package/src/components/ScrollBar.vue +2 -2
  13. package/src/components/ScrollViewer.vue +2 -2
  14. package/src/components/SplitView.vue +2 -2
  15. package/src/components/Tree.vue +5 -0
  16. package/src/components/TreeNode.vue +10 -4
  17. package/src/editorProps.ts +20 -3
  18. package/src/fields/PageFragmentSelect.vue +55 -0
  19. package/src/hooks/use-filter.ts +55 -0
  20. package/src/hooks/use-getso.ts +2 -2
  21. package/src/hooks/use-node-status.ts +48 -0
  22. package/src/hooks/use-stage.ts +19 -1
  23. package/src/index.ts +3 -0
  24. package/src/initService.ts +43 -17
  25. package/src/layouts/AddPageBox.vue +16 -4
  26. package/src/layouts/CodeEditor.vue +2 -2
  27. package/src/layouts/Framework.vue +17 -3
  28. package/src/layouts/PropsPanel.vue +2 -2
  29. package/src/layouts/page-bar/AddButton.vue +48 -0
  30. package/src/layouts/page-bar/PageBar.vue +158 -0
  31. package/src/layouts/{workspace → page-bar}/PageBarScrollContainer.vue +61 -35
  32. package/src/layouts/page-bar/SwitchTypeButton.vue +45 -0
  33. package/src/layouts/sidebar/Sidebar.vue +9 -2
  34. package/src/layouts/sidebar/code-block/CodeBlockList.vue +55 -65
  35. package/src/layouts/sidebar/code-block/CodeBlockListPanel.vue +2 -1
  36. package/src/layouts/sidebar/data-source/DataSourceList.vue +63 -59
  37. package/src/layouts/sidebar/data-source/DataSourceListPanel.vue +1 -1
  38. package/src/layouts/sidebar/layer/LayerMenu.vue +39 -27
  39. package/src/layouts/sidebar/layer/LayerPanel.vue +31 -8
  40. package/src/layouts/sidebar/layer/use-click.ts +5 -3
  41. package/src/layouts/sidebar/layer/use-keybinding.ts +8 -8
  42. package/src/layouts/sidebar/layer/use-node-status.ts +10 -13
  43. package/src/layouts/workspace/Workspace.vue +6 -7
  44. package/src/layouts/workspace/viewer/NodeListMenu.vue +68 -129
  45. package/src/layouts/workspace/viewer/Stage.vue +14 -6
  46. package/src/layouts/workspace/viewer/ViewerMenu.vue +94 -86
  47. package/src/services/BaseService.ts +63 -26
  48. package/src/services/codeBlock.ts +7 -1
  49. package/src/services/dep.ts +12 -8
  50. package/src/services/editor.ts +131 -64
  51. package/src/services/history.ts +6 -2
  52. package/src/services/keybinding.ts +48 -13
  53. package/src/services/props.ts +70 -12
  54. package/src/services/storage.ts +23 -13
  55. package/src/services/ui.ts +4 -1
  56. package/src/theme/code-block.scss +0 -16
  57. package/src/theme/floating-box.scss +30 -0
  58. package/src/theme/layer-panel.scss +19 -0
  59. package/src/theme/page-bar.scss +18 -1
  60. package/src/theme/stage.scss +24 -0
  61. package/src/theme/theme.scss +1 -1
  62. package/src/theme/tree.scss +12 -1
  63. package/src/type.ts +28 -10
  64. package/src/utils/compose.ts +25 -6
  65. package/src/utils/content-menu.ts +6 -7
  66. package/src/utils/editor.ts +34 -18
  67. package/src/utils/operator.ts +5 -6
  68. package/types/components/CodeBlockEditor.vue.d.ts +6 -2
  69. package/types/components/CodeParams.vue.d.ts +3 -1
  70. package/types/components/ContentMenu.vue.d.ts +13 -5
  71. package/types/components/FloatingBox.vue.d.ts +78 -0
  72. package/types/components/Resizer.vue.d.ts +6 -1
  73. package/types/components/ScrollBar.vue.d.ts +3 -1
  74. package/types/components/ScrollViewer.vue.d.ts +3 -3
  75. package/types/components/SearchInput.vue.d.ts +3 -1
  76. package/types/components/SplitView.vue.d.ts +8 -4
  77. package/types/components/ToolButton.vue.d.ts +3 -3
  78. package/types/components/Tree.vue.d.ts +27 -8
  79. package/types/components/TreeNode.vue.d.ts +24 -7
  80. package/types/editorProps.d.ts +16 -1
  81. package/types/fields/Code.vue.d.ts +6 -2
  82. package/types/fields/CodeLink.vue.d.ts +5 -3
  83. package/types/fields/CodeSelect.vue.d.ts +3 -1
  84. package/types/fields/CodeSelectCol.vue.d.ts +3 -1
  85. package/types/fields/DataSourceFieldSelect.vue.d.ts +3 -1
  86. package/types/fields/DataSourceFields.vue.d.ts +5 -3
  87. package/types/fields/DataSourceInput.vue.d.ts +8 -4
  88. package/types/fields/DataSourceMethodSelect.vue.d.ts +3 -1
  89. package/types/fields/DataSourceMethods.vue.d.ts +5 -3
  90. package/types/fields/DataSourceMocks.vue.d.ts +5 -3
  91. package/types/fields/DataSourceSelect.vue.d.ts +5 -3
  92. package/types/fields/EventSelect.vue.d.ts +3 -1
  93. package/types/fields/KeyValue.vue.d.ts +2 -2
  94. package/types/fields/PageFragmentSelect.vue.d.ts +31 -0
  95. package/types/fields/UISelect.vue.d.ts +3 -1
  96. package/types/hooks/use-code-block-edit.d.ts +14 -5
  97. package/types/hooks/use-data-source-method.d.ts +14 -5
  98. package/types/hooks/use-filter.d.ts +7 -0
  99. package/types/hooks/use-node-status.d.ts +6 -0
  100. package/types/index.d.ts +1 -0
  101. package/types/layouts/AddPageBox.vue.d.ts +14 -1
  102. package/types/layouts/CodeEditor.vue.d.ts +4 -1
  103. package/types/layouts/Framework.vue.d.ts +14 -1
  104. package/types/layouts/PropsPanel.vue.d.ts +19 -13
  105. package/types/layouts/{workspace/viewer/NodeListMenuTitle.vue.d.ts → page-bar/AddButton.vue.d.ts} +3 -2
  106. package/types/layouts/page-bar/PageBar.vue.d.ts +28 -0
  107. package/types/layouts/page-bar/PageBarScrollContainer.vue.d.ts +24 -0
  108. package/types/layouts/page-bar/SwitchTypeButton.vue.d.ts +20 -0
  109. package/types/layouts/sidebar/ComponentListPanel.vue.d.ts +1 -1
  110. package/types/layouts/sidebar/Sidebar.vue.d.ts +7 -5
  111. package/types/layouts/sidebar/code-block/CodeBlockList.vue.d.ts +9 -3
  112. package/types/layouts/sidebar/code-block/CodeBlockListPanel.vue.d.ts +1 -1
  113. package/types/layouts/sidebar/data-source/DataSourceConfigPanel.vue.d.ts +3 -1
  114. package/types/layouts/sidebar/data-source/DataSourceList.vue.d.ts +8 -2
  115. package/types/layouts/sidebar/data-source/DataSourceListPanel.vue.d.ts +1 -1
  116. package/types/layouts/sidebar/layer/LayerMenu.vue.d.ts +26 -3
  117. package/types/layouts/sidebar/layer/LayerPanel.vue.d.ts +3 -1
  118. package/types/layouts/sidebar/layer/use-click.d.ts +37 -6
  119. package/types/layouts/sidebar/layer/use-keybinding.d.ts +1 -1
  120. package/types/layouts/sidebar/layer/use-node-status.d.ts +3 -4
  121. package/types/layouts/workspace/Workspace.vue.d.ts +3 -1
  122. package/types/layouts/workspace/viewer/NodeListMenu.vue.d.ts +1 -14
  123. package/types/layouts/workspace/viewer/Stage.vue.d.ts +2 -0
  124. package/types/layouts/workspace/viewer/ViewerMenu.vue.d.ts +9 -1
  125. package/types/services/BaseService.d.ts +4 -1
  126. package/types/services/dataSource.d.ts +1 -0
  127. package/types/services/dep.d.ts +6 -5
  128. package/types/services/editor.d.ts +12 -5
  129. package/types/services/history.d.ts +3 -2
  130. package/types/services/keybinding.d.ts +21 -1
  131. package/types/services/props.d.ts +25 -1
  132. package/types/services/storage.d.ts +7 -7
  133. package/types/type.d.ts +32 -17
  134. package/types/utils/compose.d.ts +1 -1
  135. package/types/utils/editor.d.ts +14 -8
  136. package/src/layouts/sidebar/layer/use-filter.ts +0 -59
  137. package/src/layouts/workspace/PageBar.vue +0 -87
  138. package/src/layouts/workspace/viewer/NodeListMenuTitle.vue +0 -68
  139. package/src/theme/dep-list.scss +0 -59
  140. package/types/layouts/sidebar/layer/use-filter.d.ts +0 -7
  141. package/types/layouts/workspace/PageBar.vue.d.ts +0 -15
  142. package/types/layouts/workspace/PageBarScrollContainer.vue.d.ts +0 -9
package/dist/style.css CHANGED
@@ -251,6 +251,22 @@
251
251
  .m-editor-layer-panel .m-editor-tree {
252
252
  padding-top: 48px;
253
253
  }
254
+ .m-editor-layer-panel .search-wrapper {
255
+ display: flex;
256
+ align-items: center;
257
+ justify-content: center;
258
+ position: absolute;
259
+ top: 0;
260
+ width: 100%;
261
+ z-index: 1;
262
+ }
263
+ .m-editor-layer-panel .search-wrapper .search-input {
264
+ flex: 1;
265
+ position: relative;
266
+ }
267
+ .m-editor-layer-panel .search-wrapper .tmagic-design-button {
268
+ margin-right: 10px;
269
+ }
254
270
  .ui-component-panel.tmagic-design-collapse {
255
271
  height: 100%;
256
272
  border-top: 0 !important;
@@ -402,10 +418,24 @@
402
418
  .m-editor-workspace:focus-visible {
403
419
  outline: 0;
404
420
  }
405
- .m-editor-page-bar {
421
+ .m-editor-page-bar-tabs {
406
422
  position: fixed;
407
423
  bottom: 0;
408
424
  left: 0;
425
+ width: 100%;
426
+ }
427
+ .m-editor-page-bar-tabs .tmagic-design-button.m-editor-page-bar-switch-type-button {
428
+ margin-left: 7px;
429
+ position: relative;
430
+ top: 1px;
431
+ border-radius: 3px 3px 0 0;
432
+ border: 1px solid #d9dbdd;
433
+ border-bottom: 1px solid transparent;
434
+ }
435
+ .m-editor-page-bar-tabs .tmagic-design-button.m-editor-page-bar-switch-type-button.active {
436
+ background-color: #f3f3f3;
437
+ }
438
+ .m-editor-page-bar {
409
439
  display: flex;
410
440
  width: 100%;
411
441
  height: 32px;
@@ -573,6 +603,27 @@
573
603
  .m-editor-stage-container::-webkit-scrollbar {
574
604
  width: 0 !important;
575
605
  }
606
+ .m-editor-stage-float-button {
607
+ cursor: pointer;
608
+ transform: translateY(-50%);
609
+ width: 12px;
610
+ font-size: 12px;
611
+ line-height: 1.2;
612
+ position: absolute;
613
+ left: 100%;
614
+ top: 50%;
615
+ padding: 5px;
616
+ background-color: #ffffff;
617
+ transition: background-color 0.2s;
618
+ color: rgba(0, 0, 0, 0.88);
619
+ box-shadow: 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
620
+ }
621
+ .m-editor-node-list-menu {
622
+ height: 100%;
623
+ width: 100%;
624
+ min-width: 300px;
625
+ max-height: 500px;
626
+ }
576
627
  .magic-code-editor {
577
628
  width: 100%;
578
629
  }
@@ -607,16 +658,6 @@
607
658
  .m-editor-code-block-list {
608
659
  height: 100%;
609
660
  }
610
- .m-editor-code-block-list .list-container .list-item .codeIcon {
611
- width: 22px;
612
- height: 22px;
613
- margin-right: 5px;
614
- }
615
- .m-editor-code-block-list .list-container .list-item .compIcon {
616
- width: 22px;
617
- height: 22px;
618
- margin-right: 5px;
619
- }
620
661
  .m-fields-code-select {
621
662
  width: 100%;
622
663
  }
@@ -682,56 +723,6 @@
682
723
  top: 5px;
683
724
  z-index: 10;
684
725
  }
685
- .m-editor-dep-list-panel .magic-editor-layer-tree {
686
- padding-top: 48px;
687
- }
688
- .m-editor-dep-list-panel .search-wrapper {
689
- display: flex;
690
- align-items: center;
691
- justify-content: center;
692
- position: absolute;
693
- top: 0;
694
- width: 100%;
695
- z-index: 1;
696
- }
697
- .m-editor-dep-list-panel .search-wrapper .search-input {
698
- flex: 1;
699
- position: relative;
700
- }
701
- .m-editor-dep-list-panel .search-wrapper .tmagic-design-button {
702
- margin-right: 10px;
703
- }
704
- .m-editor-dep-list-panel .list-container {
705
- width: 100%;
706
- overflow: hidden;
707
- }
708
- .m-editor-dep-list-panel .list-container .list-item {
709
- display: flex;
710
- width: 100%;
711
- align-items: center;
712
- }
713
- .m-editor-dep-list-panel .list-container .list-item .right-tool {
714
- display: flex;
715
- width: fit-content !important;
716
- align-items: center;
717
- }
718
- .m-editor-dep-list-panel .list-container .list-item .right-tool .edit-icon {
719
- margin: 0 5px;
720
- }
721
- .m-editor-dep-list-panel .list-container .list-item .name {
722
- white-space: nowrap;
723
- overflow: hidden;
724
- text-overflow: ellipsis;
725
- width: 0 !important;
726
- flex: 1;
727
- line-height: 22px;
728
- }
729
- .m-editor-dep-list-panel .list-container .list-item .name.code {
730
- color: #000;
731
- }
732
- .m-editor-dep-list-panel .list-container .list-item .name.hook {
733
- color: #909399;
734
- }
735
726
  .data-source-list-panel .list-container .list-item .codeIcon {
736
727
  width: 22px;
737
728
  height: 22px;
@@ -897,11 +888,46 @@
897
888
  overflow: hidden;
898
889
  text-overflow: ellipsis;
899
890
  }
891
+ .m-editor-tree .m-editor-tree-node .tree-node .tree-node-content .tree-node-label .disabled {
892
+ cursor: default;
893
+ }
894
+ .m-editor-tree .m-editor-tree-node .tree-node .tree-node-content .tree-node-label .hook {
895
+ color: #999;
896
+ }
900
897
  .m-editor-tree .m-editor-tree-node .tree-node .tree-node-tool {
901
- margin-right: 15px;
902
898
  display: flex;
903
899
  align-items: center;
904
900
  }
901
+ .m-editor-tree .m-editor-tree-node .tree-node .tree-node-tool .tmagic-design-icon {
902
+ margin-right: 10px;
903
+ }
904
+ .m-editor-float-box {
905
+ position: absolute;
906
+ background-color: #fff;
907
+ z-index: 100;
908
+ border: 1px solid #d9dbdd;
909
+ display: flex;
910
+ flex-direction: column;
911
+ }
912
+ .m-editor-float-box .m-editor-float-box-title {
913
+ text-align: center;
914
+ font-size: 14px;
915
+ font-weight: 600;
916
+ padding: 5px;
917
+ cursor: move;
918
+ display: flex;
919
+ justify-content: space-between;
920
+ align-items: center;
921
+ border-bottom: 1px solid #d9dbdd;
922
+ }
923
+ .m-editor-float-box .m-editor-float-box-body {
924
+ padding: 5px;
925
+ flex: 1;
926
+ overflow: auto;
927
+ }
928
+ .m-editor-floating-box-moveable {
929
+ opacity: 0;
930
+ }
905
931
  .fade-enter-active,
906
932
  .fade-leave-active {
907
933
  transition: opacity 0.5s;