@tmagic/editor 1.8.0-beta.1 → 1.8.0-beta.10
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/es/Editor.vue_vue_type_script_setup_true_lang.js +31 -5
- package/dist/es/components/CodeBlockEditor.vue_vue_type_script_setup_true_lang.js +21 -113
- package/dist/es/components/CodeParams.vue_vue_type_script_setup_true_lang.js +7 -1
- package/dist/es/components/CompareForm.js +5 -0
- package/dist/es/components/CompareForm.vue_vue_type_script_setup_true_lang.js +196 -0
- package/dist/es/components/ContentMenu.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/components/FloatingBox.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/es/components/Icon.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/components/Resizer.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/components/ScrollBar.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/components/ScrollViewer.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/components/SearchInput.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/components/SplitView.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/components/ToolButton.vue_vue_type_script_setup_true_lang.js +7 -7
- package/dist/es/components/Tree.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/components/TreeNode.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/editorProps.js +2 -0
- package/dist/es/fields/Code.vue_vue_type_script_setup_true_lang.js +20 -4
- package/dist/es/fields/CodeLink.vue_vue_type_script_setup_true_lang.js +3 -6
- package/dist/es/fields/CodeSelect.vue_vue_type_script_setup_true_lang.js +19 -3
- package/dist/es/fields/CodeSelectCol.vue_vue_type_script_setup_true_lang.js +42 -8
- package/dist/es/fields/CondOpSelect.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/DataSourceFieldSelect/FieldSelect.vue_vue_type_script_setup_true_lang.js +14 -6
- package/dist/es/fields/DataSourceFieldSelect/Index.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/es/fields/DataSourceFields.vue_vue_type_script_setup_true_lang.js +41 -16
- package/dist/es/fields/DataSourceInput.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/es/fields/DataSourceMethodSelect.vue_vue_type_script_setup_true_name_true_lang.js +9 -5
- package/dist/es/fields/DataSourceMethods.vue_vue_type_script_setup_true_lang.js +40 -19
- package/dist/es/fields/DataSourceMocks.vue_vue_type_script_setup_true_lang.js +17 -9
- package/dist/es/fields/DataSourceSelect.vue_vue_type_script_setup_true_lang.js +4 -2
- package/dist/es/fields/DisplayConds.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/EventSelect.vue_vue_type_script_setup_true_lang.js +59 -12
- package/dist/es/fields/KeyValue.vue_vue_type_script_setup_true_lang.js +12 -7
- package/dist/es/fields/PageFragmentSelect.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/StyleSetter/Index.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/StyleSetter/components/BackgroundPosition.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/StyleSetter/components/Border.vue_vue_type_script_setup_true_lang.js +28 -6
- package/dist/es/fields/StyleSetter/components/Box.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/StyleSetter/icons/background-repeat/NoRepeat.js +1 -1
- package/dist/es/fields/StyleSetter/icons/background-repeat/Repeat.js +1 -1
- package/dist/es/fields/StyleSetter/icons/background-repeat/RepeatX.js +1 -1
- package/dist/es/fields/StyleSetter/icons/background-repeat/RepeatY.js +1 -1
- package/dist/es/fields/StyleSetter/icons/display/Block.js +1 -1
- package/dist/es/fields/StyleSetter/icons/display/Flex.js +1 -1
- package/dist/es/fields/StyleSetter/icons/display/Inline.js +1 -1
- package/dist/es/fields/StyleSetter/icons/display/InlineBlock.js +1 -1
- package/dist/es/fields/StyleSetter/icons/display/None.js +1 -1
- package/dist/es/fields/StyleSetter/icons/flex-direction/Column.js +1 -1
- package/dist/es/fields/StyleSetter/icons/flex-direction/ColumnReverse.js +1 -1
- package/dist/es/fields/StyleSetter/icons/flex-direction/Row.js +1 -1
- package/dist/es/fields/StyleSetter/icons/flex-direction/RowReverse.js +1 -1
- package/dist/es/fields/StyleSetter/icons/justify-content/Center.js +1 -1
- package/dist/es/fields/StyleSetter/icons/justify-content/FlexEnd.js +1 -1
- package/dist/es/fields/StyleSetter/icons/justify-content/FlexStart.js +1 -1
- package/dist/es/fields/StyleSetter/icons/justify-content/SpaceAround.js +1 -1
- package/dist/es/fields/StyleSetter/icons/justify-content/SpaceBetween.js +1 -1
- package/dist/es/fields/StyleSetter/icons/text-align/Center.js +1 -1
- package/dist/es/fields/StyleSetter/icons/text-align/Left.js +1 -1
- package/dist/es/fields/StyleSetter/icons/text-align/Right.js +1 -1
- package/dist/es/fields/StyleSetter/pro/Background.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/StyleSetter/pro/Border.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/StyleSetter/pro/Font.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/StyleSetter/pro/Layout.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/StyleSetter/pro/Position.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/StyleSetter/pro/Transform.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/UISelect.vue_vue_type_script_setup_true_lang.js +9 -6
- package/dist/es/hooks/use-code-block-edit.js +7 -4
- package/dist/es/hooks/use-data-source-edit.js +5 -2
- package/dist/es/hooks/use-stage.js +22 -10
- package/dist/es/icons/CenterIcon.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/icons/CodeIcon.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/icons/FolderMinusIcon.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/index.js +14 -3
- package/dist/es/initService.js +7 -7
- package/dist/es/layouts/AddPageBox.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/CodeEditor.vue_vue_type_script_setup_true_lang.js +7 -6
- package/dist/es/layouts/Framework.vue_vue_type_script_setup_true_lang.js +14 -9
- package/dist/es/layouts/NavMenu.vue_vue_type_script_setup_true_lang.js +12 -4
- package/dist/es/layouts/NavMenuColumn.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/history-list/Bucket.js +5 -0
- package/dist/es/layouts/history-list/Bucket.vue_vue_type_script_setup_true_lang.js +71 -0
- package/dist/es/layouts/history-list/BucketTab.js +5 -0
- package/dist/es/layouts/history-list/BucketTab.vue_vue_type_script_setup_true_lang.js +62 -0
- package/dist/es/layouts/history-list/GroupRow.js +5 -0
- package/dist/es/layouts/history-list/GroupRow.vue_vue_type_script_setup_true_lang.js +269 -0
- package/dist/es/layouts/history-list/HistoryDiffDialog.js +5 -0
- package/dist/es/layouts/history-list/HistoryDiffDialog.vue_vue_type_script_setup_true_lang.js +287 -0
- package/dist/es/layouts/history-list/HistoryListPanel.js +5 -0
- package/dist/es/layouts/history-list/HistoryListPanel.vue_vue_type_script_setup_true_lang.js +327 -0
- package/dist/es/layouts/history-list/InitialRow.js +5 -0
- package/dist/es/layouts/history-list/InitialRow.vue_vue_type_script_setup_true_lang.js +83 -0
- package/dist/es/layouts/history-list/PageTab.js +5 -0
- package/dist/es/layouts/history-list/PageTab.vue_vue_type_script_setup_true_lang.js +95 -0
- package/dist/es/layouts/history-list/composables.js +184 -0
- package/dist/es/layouts/history-list/useHistoryList.js +56 -0
- package/dist/es/layouts/history-list/useHistoryRevert.js +306 -0
- package/dist/es/layouts/page-bar/AddButton.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/page-bar/PageBar.vue_vue_type_script_setup_true_lang.js +5 -3
- package/dist/es/layouts/page-bar/PageBarScrollContainer.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/page-bar/PageList.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/page-bar/Search.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/es/layouts/props-panel/FormPanel.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/props-panel/PropsPanel.vue_vue_type_script_setup_true_lang.js +6 -2
- package/dist/es/layouts/sidebar/ComponentListPanel.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/es/layouts/sidebar/Sidebar.vue_vue_type_script_setup_true_lang.js +8 -4
- package/dist/es/layouts/sidebar/code-block/CodeBlockList.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/es/layouts/sidebar/code-block/CodeBlockListPanel.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/es/layouts/sidebar/code-block/useContentMenu.js +1 -1
- package/dist/es/layouts/sidebar/data-source/DataSourceAddButton.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/sidebar/data-source/DataSourceConfigPanel.vue_vue_type_script_setup_true_lang.js +19 -6
- package/dist/es/layouts/sidebar/data-source/DataSourceList.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/sidebar/data-source/DataSourceListPanel.vue_vue_type_script_setup_true_lang.js +25 -3
- package/dist/es/layouts/sidebar/data-source/useContentMenu.js +1 -1
- package/dist/es/layouts/sidebar/layer/LayerMenu.vue_vue_type_script_setup_true_lang.js +6 -6
- package/dist/es/layouts/sidebar/layer/LayerNodeTool.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/es/layouts/sidebar/layer/LayerPanel.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/sidebar/layer/use-node-status.js +1 -1
- package/dist/es/layouts/workspace/Breadcrumb.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/workspace/Workspace.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/workspace/viewer/NodeListMenu.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/workspace/viewer/Stage.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/es/layouts/workspace/viewer/StageOverlay.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/workspace/viewer/ViewerMenu.vue_vue_type_script_setup_true_lang.js +9 -9
- package/dist/es/services/BaseService.js +31 -68
- package/dist/es/services/codeBlock.js +286 -8
- package/dist/es/services/componentList.js +2 -2
- package/dist/es/services/dataSource.js +287 -8
- package/dist/es/services/dep.js +21 -9
- package/dist/es/services/editor.js +655 -194
- package/dist/es/services/events.js +2 -2
- package/dist/es/services/history.js +390 -47
- package/dist/es/services/keybinding.js +5 -5
- package/dist/es/services/props.js +8 -8
- package/dist/es/services/stageOverlay.js +2 -2
- package/dist/es/services/storage.js +2 -2
- package/dist/es/services/ui.js +5 -2
- package/dist/es/style.css +456 -8
- package/dist/es/utils/code-block.js +122 -0
- package/dist/es/utils/content-menu.js +19 -12
- package/dist/es/utils/data-source/index.js +2 -0
- package/dist/es/utils/dep/worker.js +1 -1
- package/dist/es/utils/editor.js +105 -51
- package/dist/es/utils/history.js +220 -0
- package/dist/es/utils/indexed-db.js +86 -0
- package/dist/es/utils/undo-redo.js +80 -1
- package/dist/style.css +456 -8
- package/dist/tmagic-editor.umd.cjs +10135 -5646
- package/package.json +8 -8
- package/src/Editor.vue +25 -1
- package/src/components/CodeBlockEditor.vue +20 -109
- package/src/components/CodeParams.vue +6 -0
- package/src/components/CompareForm.vue +277 -0
- package/src/components/ToolButton.vue +2 -2
- package/src/editorProps.ts +9 -0
- package/src/fields/Code.vue +19 -3
- package/src/fields/CodeLink.vue +2 -5
- package/src/fields/CodeSelect.vue +17 -1
- package/src/fields/CodeSelectCol.vue +37 -3
- package/src/fields/DataSourceFieldSelect/FieldSelect.vue +23 -3
- package/src/fields/DataSourceFieldSelect/Index.vue +2 -2
- package/src/fields/DataSourceFields.vue +48 -10
- package/src/fields/DataSourceInput.vue +3 -3
- package/src/fields/DataSourceMethodSelect.vue +12 -4
- package/src/fields/DataSourceMethods.vue +55 -24
- package/src/fields/DataSourceMocks.vue +13 -3
- package/src/fields/DataSourceSelect.vue +4 -1
- package/src/fields/EventSelect.vue +57 -8
- package/src/fields/KeyValue.vue +17 -4
- package/src/fields/StyleSetter/components/Border.vue +15 -6
- package/src/fields/UISelect.vue +5 -2
- package/src/hooks/use-code-block-edit.ts +9 -5
- package/src/hooks/use-data-source-edit.ts +2 -2
- package/src/hooks/use-stage.ts +26 -9
- package/src/index.ts +8 -0
- package/src/initService.ts +1 -1
- package/src/layouts/CodeEditor.vue +17 -5
- package/src/layouts/Framework.vue +11 -6
- package/src/layouts/NavMenu.vue +12 -3
- package/src/layouts/history-list/Bucket.vue +91 -0
- package/src/layouts/history-list/BucketTab.vue +72 -0
- package/src/layouts/history-list/GroupRow.vue +304 -0
- package/src/layouts/history-list/HistoryDiffDialog.vue +273 -0
- package/src/layouts/history-list/HistoryListPanel.vue +367 -0
- package/src/layouts/history-list/InitialRow.vue +71 -0
- package/src/layouts/history-list/PageTab.vue +118 -0
- package/src/layouts/history-list/composables.ts +309 -0
- package/src/layouts/history-list/useHistoryList.ts +60 -0
- package/src/layouts/history-list/useHistoryRevert.ts +405 -0
- package/src/layouts/page-bar/PageBar.vue +4 -2
- package/src/layouts/props-panel/PropsPanel.vue +5 -1
- package/src/layouts/sidebar/ComponentListPanel.vue +9 -5
- package/src/layouts/sidebar/Sidebar.vue +8 -3
- package/src/layouts/sidebar/code-block/CodeBlockList.vue +5 -5
- package/src/layouts/sidebar/code-block/CodeBlockListPanel.vue +1 -1
- package/src/layouts/sidebar/code-block/useContentMenu.ts +1 -1
- package/src/layouts/sidebar/data-source/DataSourceConfigPanel.vue +31 -2
- package/src/layouts/sidebar/data-source/DataSourceListPanel.vue +27 -2
- package/src/layouts/sidebar/data-source/useContentMenu.ts +1 -1
- package/src/layouts/sidebar/layer/LayerMenu.vue +19 -11
- package/src/layouts/sidebar/layer/LayerNodeTool.vue +7 -4
- package/src/layouts/sidebar/layer/use-node-status.ts +9 -6
- package/src/layouts/workspace/viewer/Stage.vue +1 -1
- package/src/layouts/workspace/viewer/ViewerMenu.vue +8 -8
- package/src/services/BaseService.ts +35 -86
- package/src/services/codeBlock.ts +361 -5
- package/src/services/dataSource.ts +336 -6
- package/src/services/dep.ts +32 -9
- package/src/services/editor.ts +834 -194
- package/src/services/history.ts +509 -49
- package/src/services/keybinding.ts +3 -3
- package/src/services/props.ts +2 -2
- package/src/services/ui.ts +7 -0
- package/src/theme/history-list-panel.scss +557 -0
- package/src/theme/page-bar.scss +0 -4
- package/src/theme/props-panel.scss +3 -3
- package/src/theme/style-setter/border.scss +4 -1
- package/src/theme/theme.scss +1 -0
- package/src/type.ts +594 -31
- package/src/utils/code-block.ts +150 -0
- package/src/utils/content-menu.ts +25 -13
- package/src/utils/data-source/index.ts +2 -0
- package/src/utils/dep/worker.ts +5 -3
- package/src/utils/editor.ts +166 -60
- package/src/utils/history.ts +286 -0
- package/src/utils/index.ts +3 -0
- package/src/utils/indexed-db.ts +122 -0
- package/src/utils/undo-redo.ts +111 -0
- package/types/index.d.ts +3171 -889
- package/dist/es/utils/compose.js +0 -44
- package/dist/es/utils/editor-history.js +0 -100
- package/src/utils/compose.ts +0 -52
- package/src/utils/editor-history.ts +0 -138
package/dist/es/style.css
CHANGED
|
@@ -126,7 +126,10 @@
|
|
|
126
126
|
.m-form-container.has-tip .tmagic-design-form-item {
|
|
127
127
|
flex: 1;
|
|
128
128
|
}
|
|
129
|
-
.m-form-container .tmagic-design-form-item.show-diff {
|
|
129
|
+
.m-form-container .tmagic-design-form-item.show-after-diff {
|
|
130
|
+
background: rgb(225, 243, 216);
|
|
131
|
+
}
|
|
132
|
+
.m-form-container .tmagic-design-form-item.show-before-diff {
|
|
130
133
|
background: #f7dadd;
|
|
131
134
|
}
|
|
132
135
|
|
|
@@ -578,6 +581,451 @@ fieldset.m-fieldset .m-form-tip {
|
|
|
578
581
|
background-color: transparent;
|
|
579
582
|
}
|
|
580
583
|
|
|
584
|
+
.m-editor-history-list-popover {
|
|
585
|
+
padding: 0 !important;
|
|
586
|
+
}
|
|
587
|
+
.m-editor-history-list-popover .m-editor-history-list {
|
|
588
|
+
position: relative;
|
|
589
|
+
padding: 4px 8px 8px;
|
|
590
|
+
}
|
|
591
|
+
.m-editor-history-list-popover .m-editor-history-list-close {
|
|
592
|
+
position: absolute;
|
|
593
|
+
top: 4px;
|
|
594
|
+
right: 4px;
|
|
595
|
+
z-index: 2;
|
|
596
|
+
display: flex;
|
|
597
|
+
align-items: center;
|
|
598
|
+
height: 40px;
|
|
599
|
+
margin: 0;
|
|
600
|
+
color: #909399;
|
|
601
|
+
}
|
|
602
|
+
.m-editor-history-list-popover .m-editor-history-list-close:hover {
|
|
603
|
+
color: #409eff;
|
|
604
|
+
}
|
|
605
|
+
.m-editor-history-list-popover .m-editor-history-list-tabs .el-tabs__header,
|
|
606
|
+
.m-editor-history-list-popover .m-editor-history-list-tabs .t-tabs__header {
|
|
607
|
+
margin-bottom: 4px;
|
|
608
|
+
}
|
|
609
|
+
.m-editor-history-list-popover .m-editor-history-list-empty {
|
|
610
|
+
padding: 24px 0;
|
|
611
|
+
text-align: center;
|
|
612
|
+
color: #909399;
|
|
613
|
+
font-size: 12px;
|
|
614
|
+
}
|
|
615
|
+
.m-editor-history-list-popover .m-editor-history-list-ul {
|
|
616
|
+
margin: 0;
|
|
617
|
+
padding: 0;
|
|
618
|
+
list-style: none;
|
|
619
|
+
}
|
|
620
|
+
.m-editor-history-list-popover .m-editor-history-list-toolbar {
|
|
621
|
+
display: flex;
|
|
622
|
+
align-items: center;
|
|
623
|
+
justify-content: flex-end;
|
|
624
|
+
padding: 0 4px 4px;
|
|
625
|
+
}
|
|
626
|
+
.m-editor-history-list-popover .m-editor-history-list-clear {
|
|
627
|
+
padding: 2px 8px;
|
|
628
|
+
border-radius: 4px;
|
|
629
|
+
font-size: 12px;
|
|
630
|
+
color: #f56c6c;
|
|
631
|
+
cursor: pointer;
|
|
632
|
+
user-select: none;
|
|
633
|
+
}
|
|
634
|
+
.m-editor-history-list-popover .m-editor-history-list-clear:hover {
|
|
635
|
+
background-color: rgba(245, 108, 108, 0.12);
|
|
636
|
+
}
|
|
637
|
+
.m-editor-history-list-popover .m-editor-history-list-item {
|
|
638
|
+
display: flex;
|
|
639
|
+
align-items: center;
|
|
640
|
+
gap: 6px;
|
|
641
|
+
padding: 6px 8px;
|
|
642
|
+
border-radius: 4px;
|
|
643
|
+
font-size: 12px;
|
|
644
|
+
line-height: 1.4;
|
|
645
|
+
color: #303133;
|
|
646
|
+
cursor: default;
|
|
647
|
+
}
|
|
648
|
+
.m-editor-history-list-popover .m-editor-history-list-item:not(.m-editor-history-list-group.is-merged):hover {
|
|
649
|
+
background-color: rgba(0, 0, 0, 0.04);
|
|
650
|
+
}
|
|
651
|
+
.m-editor-history-list-popover .m-editor-history-list-item.is-undone {
|
|
652
|
+
color: #c0c4cc;
|
|
653
|
+
}
|
|
654
|
+
.m-editor-history-list-popover .m-editor-history-list-item.is-undone .m-editor-history-list-item-op {
|
|
655
|
+
opacity: 0.5;
|
|
656
|
+
}
|
|
657
|
+
.m-editor-history-list-popover .m-editor-history-list-item.is-current:not(.m-editor-history-list-group.is-merged) {
|
|
658
|
+
background-color: rgba(64, 158, 255, 0.1);
|
|
659
|
+
box-shadow: inset 2px 0 0 #409eff;
|
|
660
|
+
}
|
|
661
|
+
.m-editor-history-list-popover .m-editor-history-list-item.is-current:not(.m-editor-history-list-group.is-merged):hover {
|
|
662
|
+
background-color: rgba(64, 158, 255, 0.16);
|
|
663
|
+
}
|
|
664
|
+
.m-editor-history-list-popover .m-editor-history-list-item.is-current:not(.m-editor-history-list-group.is-merged) .m-editor-history-list-item-desc {
|
|
665
|
+
font-weight: 600;
|
|
666
|
+
color: #409eff;
|
|
667
|
+
}
|
|
668
|
+
.m-editor-history-list-popover .m-editor-history-list-group {
|
|
669
|
+
flex-direction: column;
|
|
670
|
+
align-items: stretch;
|
|
671
|
+
gap: 0;
|
|
672
|
+
}
|
|
673
|
+
.m-editor-history-list-popover .m-editor-history-list-group .m-editor-history-list-group-head {
|
|
674
|
+
display: flex;
|
|
675
|
+
align-items: center;
|
|
676
|
+
gap: 6px;
|
|
677
|
+
cursor: default;
|
|
678
|
+
}
|
|
679
|
+
.m-editor-history-list-popover .m-editor-history-list-group .m-editor-history-list-group-head.is-clickable {
|
|
680
|
+
cursor: pointer;
|
|
681
|
+
}
|
|
682
|
+
.m-editor-history-list-popover .m-editor-history-list-group .m-editor-history-list-group-toggle {
|
|
683
|
+
flex: 0 0 auto;
|
|
684
|
+
width: 16px;
|
|
685
|
+
text-align: center;
|
|
686
|
+
color: #909399;
|
|
687
|
+
font-size: 12px;
|
|
688
|
+
user-select: none;
|
|
689
|
+
transition: transform 0.15s ease;
|
|
690
|
+
pointer-events: none;
|
|
691
|
+
}
|
|
692
|
+
.m-editor-history-list-popover .m-editor-history-list-group .m-editor-history-list-group-toggle.is-expanded {
|
|
693
|
+
transform: rotate(180deg);
|
|
694
|
+
}
|
|
695
|
+
.m-editor-history-list-popover .m-editor-history-list-group.is-merged {
|
|
696
|
+
margin: 4px 0;
|
|
697
|
+
padding: 4px 8px 6px;
|
|
698
|
+
background-color: rgba(47, 84, 235, 0.06);
|
|
699
|
+
border: 1px solid rgba(47, 84, 235, 0.18);
|
|
700
|
+
border-left: 3px solid #2f54eb;
|
|
701
|
+
border-radius: 4px;
|
|
702
|
+
}
|
|
703
|
+
.m-editor-history-list-popover .m-editor-history-list-group.is-merged:hover {
|
|
704
|
+
background-color: rgba(47, 84, 235, 0.1);
|
|
705
|
+
}
|
|
706
|
+
.m-editor-history-list-popover .m-editor-history-list-group.is-merged .m-editor-history-list-group-head {
|
|
707
|
+
font-weight: 600;
|
|
708
|
+
color: #1d39c4;
|
|
709
|
+
}
|
|
710
|
+
.m-editor-history-list-popover .m-editor-history-list-group.is-merged.is-undone {
|
|
711
|
+
background-color: rgba(192, 196, 204, 0.08);
|
|
712
|
+
border-color: rgba(192, 196, 204, 0.4);
|
|
713
|
+
border-left-color: #c0c4cc;
|
|
714
|
+
}
|
|
715
|
+
.m-editor-history-list-popover .m-editor-history-list-group.is-merged.is-undone .m-editor-history-list-group-head {
|
|
716
|
+
color: #c0c4cc;
|
|
717
|
+
}
|
|
718
|
+
.m-editor-history-list-popover .m-editor-history-list-group.is-merged.is-current {
|
|
719
|
+
background-color: rgba(64, 158, 255, 0.08);
|
|
720
|
+
border-color: rgba(64, 158, 255, 0.3);
|
|
721
|
+
border-left-color: #409eff;
|
|
722
|
+
box-shadow: none;
|
|
723
|
+
}
|
|
724
|
+
.m-editor-history-list-popover .m-editor-history-list-group.is-merged.is-current .m-editor-history-list-group-head {
|
|
725
|
+
color: #409eff;
|
|
726
|
+
}
|
|
727
|
+
.m-editor-history-list-popover .m-editor-history-list-substeps {
|
|
728
|
+
margin: 6px 0 0 6px;
|
|
729
|
+
padding: 0;
|
|
730
|
+
list-style: none;
|
|
731
|
+
border-left: 1px dashed rgba(47, 84, 235, 0.45);
|
|
732
|
+
}
|
|
733
|
+
.m-editor-history-list-popover .m-editor-history-list-substeps li {
|
|
734
|
+
display: flex;
|
|
735
|
+
align-items: center;
|
|
736
|
+
gap: 6px;
|
|
737
|
+
padding: 3px 8px;
|
|
738
|
+
font-size: 11px;
|
|
739
|
+
color: #606266;
|
|
740
|
+
cursor: default;
|
|
741
|
+
border-radius: 3px;
|
|
742
|
+
}
|
|
743
|
+
.m-editor-history-list-popover .m-editor-history-list-substeps li.is-clickable {
|
|
744
|
+
cursor: pointer;
|
|
745
|
+
}
|
|
746
|
+
.m-editor-history-list-popover .m-editor-history-list-substeps li.is-clickable:hover {
|
|
747
|
+
background-color: rgba(47, 84, 235, 0.1);
|
|
748
|
+
}
|
|
749
|
+
.m-editor-history-list-popover .m-editor-history-list-substeps li.is-undone {
|
|
750
|
+
color: #c0c4cc;
|
|
751
|
+
}
|
|
752
|
+
.m-editor-history-list-popover .m-editor-history-list-substeps li.is-current {
|
|
753
|
+
color: #409eff;
|
|
754
|
+
font-weight: 600;
|
|
755
|
+
background-color: rgba(64, 158, 255, 0.08);
|
|
756
|
+
border-radius: 3px;
|
|
757
|
+
}
|
|
758
|
+
.m-editor-history-list-popover .m-editor-history-list-item-current {
|
|
759
|
+
flex: 0 0 auto;
|
|
760
|
+
padding: 0 6px;
|
|
761
|
+
border-radius: 2px;
|
|
762
|
+
font-size: 10px;
|
|
763
|
+
line-height: 16px;
|
|
764
|
+
color: #fff;
|
|
765
|
+
background-color: #409eff;
|
|
766
|
+
font-weight: 500;
|
|
767
|
+
}
|
|
768
|
+
.m-editor-history-list-popover .m-editor-history-list-item-index {
|
|
769
|
+
flex: 0 0 auto;
|
|
770
|
+
min-width: 30px;
|
|
771
|
+
text-align: right;
|
|
772
|
+
color: #909399;
|
|
773
|
+
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
|
|
774
|
+
font-size: 11px;
|
|
775
|
+
font-weight: 400;
|
|
776
|
+
white-space: nowrap;
|
|
777
|
+
}
|
|
778
|
+
.m-editor-history-list-popover .m-editor-history-list-group.is-merged > .m-editor-history-list-group-head > .m-editor-history-list-item-index {
|
|
779
|
+
min-width: 0;
|
|
780
|
+
text-align: left;
|
|
781
|
+
}
|
|
782
|
+
.m-editor-history-list-popover .m-editor-history-list-item-time {
|
|
783
|
+
flex: 0 0 auto;
|
|
784
|
+
color: #a8abb2;
|
|
785
|
+
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
|
|
786
|
+
font-size: 11px;
|
|
787
|
+
font-weight: 400;
|
|
788
|
+
white-space: nowrap;
|
|
789
|
+
}
|
|
790
|
+
.m-editor-history-list-popover .m-editor-history-list-item-op {
|
|
791
|
+
flex: 0 0 auto;
|
|
792
|
+
padding: 0 6px;
|
|
793
|
+
border-radius: 2px;
|
|
794
|
+
font-size: 11px;
|
|
795
|
+
line-height: 18px;
|
|
796
|
+
color: #fff;
|
|
797
|
+
background-color: #909399;
|
|
798
|
+
}
|
|
799
|
+
.m-editor-history-list-popover .m-editor-history-list-item-op.op-add {
|
|
800
|
+
background-color: #67c23a;
|
|
801
|
+
}
|
|
802
|
+
.m-editor-history-list-popover .m-editor-history-list-item-op.op-remove {
|
|
803
|
+
background-color: #f56c6c;
|
|
804
|
+
}
|
|
805
|
+
.m-editor-history-list-popover .m-editor-history-list-item-op.op-update {
|
|
806
|
+
background-color: #e6a23c;
|
|
807
|
+
}
|
|
808
|
+
.m-editor-history-list-popover .m-editor-history-list-item-op.op-initial {
|
|
809
|
+
background-color: #909399;
|
|
810
|
+
}
|
|
811
|
+
.m-editor-history-list-popover .m-editor-history-list-initial {
|
|
812
|
+
cursor: default;
|
|
813
|
+
color: #606266;
|
|
814
|
+
border-top: 1px dashed #dcdfe6;
|
|
815
|
+
margin-top: 4px;
|
|
816
|
+
padding-top: 8px;
|
|
817
|
+
}
|
|
818
|
+
.m-editor-history-list-popover .m-editor-history-list-initial.is-clickable {
|
|
819
|
+
cursor: pointer;
|
|
820
|
+
}
|
|
821
|
+
.m-editor-history-list-popover .m-editor-history-list-initial .m-editor-history-list-item-desc {
|
|
822
|
+
font-style: italic;
|
|
823
|
+
}
|
|
824
|
+
.m-editor-history-list-popover .m-editor-history-list-item-desc {
|
|
825
|
+
flex: 1 1 auto;
|
|
826
|
+
overflow: hidden;
|
|
827
|
+
text-overflow: ellipsis;
|
|
828
|
+
white-space: nowrap;
|
|
829
|
+
}
|
|
830
|
+
.m-editor-history-list-popover .m-editor-history-list-item-source {
|
|
831
|
+
flex: 0 0 auto;
|
|
832
|
+
padding: 0 6px;
|
|
833
|
+
border: 1px solid #dcdfe6;
|
|
834
|
+
border-radius: 8px;
|
|
835
|
+
font-size: 10px;
|
|
836
|
+
line-height: 14px;
|
|
837
|
+
color: #909399;
|
|
838
|
+
background-color: #f4f4f5;
|
|
839
|
+
white-space: nowrap;
|
|
840
|
+
font-weight: 400;
|
|
841
|
+
}
|
|
842
|
+
.m-editor-history-list-popover .m-editor-history-list-item-operator {
|
|
843
|
+
flex: 0 0 auto;
|
|
844
|
+
padding: 0 6px;
|
|
845
|
+
border: 1px solid #c6e2ff;
|
|
846
|
+
border-radius: 8px;
|
|
847
|
+
font-size: 10px;
|
|
848
|
+
line-height: 14px;
|
|
849
|
+
color: #409eff;
|
|
850
|
+
background-color: #ecf5ff;
|
|
851
|
+
white-space: nowrap;
|
|
852
|
+
font-weight: 400;
|
|
853
|
+
}
|
|
854
|
+
.m-editor-history-list-popover .m-editor-history-list-item-saved {
|
|
855
|
+
flex: 0 0 auto;
|
|
856
|
+
padding: 0 6px;
|
|
857
|
+
border-radius: 8px;
|
|
858
|
+
font-size: 10px;
|
|
859
|
+
line-height: 16px;
|
|
860
|
+
color: #fff;
|
|
861
|
+
background-color: #67c23a;
|
|
862
|
+
white-space: nowrap;
|
|
863
|
+
font-weight: 500;
|
|
864
|
+
letter-spacing: 0.2px;
|
|
865
|
+
}
|
|
866
|
+
.m-editor-history-list-popover .m-editor-history-list-item-merge {
|
|
867
|
+
flex: 0 0 auto;
|
|
868
|
+
padding: 0 8px;
|
|
869
|
+
border-radius: 8px;
|
|
870
|
+
font-size: 10px;
|
|
871
|
+
line-height: 16px;
|
|
872
|
+
color: #fff;
|
|
873
|
+
background-color: #2f54eb;
|
|
874
|
+
font-weight: 500;
|
|
875
|
+
letter-spacing: 0.2px;
|
|
876
|
+
}
|
|
877
|
+
.m-editor-history-list-popover .m-editor-history-list-item-actions {
|
|
878
|
+
display: none;
|
|
879
|
+
flex: 0 0 auto;
|
|
880
|
+
align-items: center;
|
|
881
|
+
gap: 6px;
|
|
882
|
+
}
|
|
883
|
+
.m-editor-history-list-popover .m-editor-history-list-group-head:hover > .m-editor-history-list-item-actions,
|
|
884
|
+
.m-editor-history-list-popover .m-editor-history-list-substeps > li:hover > .m-editor-history-list-item-actions,
|
|
885
|
+
.m-editor-history-list-popover .m-editor-history-list-initial:hover > .m-editor-history-list-item-actions {
|
|
886
|
+
display: flex;
|
|
887
|
+
}
|
|
888
|
+
.m-editor-history-list-popover .m-editor-history-list-item-diff {
|
|
889
|
+
flex: 0 0 auto;
|
|
890
|
+
padding: 0 6px;
|
|
891
|
+
border-radius: 2px;
|
|
892
|
+
font-size: 10px;
|
|
893
|
+
line-height: 16px;
|
|
894
|
+
color: #409eff;
|
|
895
|
+
background-color: rgba(64, 158, 255, 0.1);
|
|
896
|
+
cursor: pointer;
|
|
897
|
+
user-select: none;
|
|
898
|
+
}
|
|
899
|
+
.m-editor-history-list-popover .m-editor-history-list-item-diff:hover {
|
|
900
|
+
background-color: rgba(64, 158, 255, 0.2);
|
|
901
|
+
}
|
|
902
|
+
.m-editor-history-list-popover .m-editor-history-list-item-goto {
|
|
903
|
+
flex: 0 0 auto;
|
|
904
|
+
padding: 0 6px;
|
|
905
|
+
border-radius: 2px;
|
|
906
|
+
font-size: 10px;
|
|
907
|
+
line-height: 16px;
|
|
908
|
+
color: #529b2e;
|
|
909
|
+
background-color: rgba(103, 194, 58, 0.12);
|
|
910
|
+
cursor: pointer;
|
|
911
|
+
user-select: none;
|
|
912
|
+
}
|
|
913
|
+
.m-editor-history-list-popover .m-editor-history-list-item-goto:hover {
|
|
914
|
+
background-color: rgba(103, 194, 58, 0.24);
|
|
915
|
+
}
|
|
916
|
+
.m-editor-history-list-popover .m-editor-history-list-item-revert {
|
|
917
|
+
flex: 0 0 auto;
|
|
918
|
+
padding: 0 6px;
|
|
919
|
+
border-radius: 2px;
|
|
920
|
+
font-size: 10px;
|
|
921
|
+
line-height: 16px;
|
|
922
|
+
color: #f56c6c;
|
|
923
|
+
background-color: rgba(245, 108, 108, 0.12);
|
|
924
|
+
cursor: pointer;
|
|
925
|
+
user-select: none;
|
|
926
|
+
}
|
|
927
|
+
.m-editor-history-list-popover .m-editor-history-list-item-revert:hover {
|
|
928
|
+
background-color: rgba(245, 108, 108, 0.25);
|
|
929
|
+
}
|
|
930
|
+
.m-editor-history-list-popover .m-editor-history-list-substep-desc {
|
|
931
|
+
flex: 1 1 auto;
|
|
932
|
+
overflow: hidden;
|
|
933
|
+
text-overflow: ellipsis;
|
|
934
|
+
white-space: nowrap;
|
|
935
|
+
}
|
|
936
|
+
.m-editor-history-list-popover .m-editor-history-list-bucket {
|
|
937
|
+
margin-bottom: 8px;
|
|
938
|
+
}
|
|
939
|
+
.m-editor-history-list-popover .m-editor-history-list-bucket:last-child {
|
|
940
|
+
margin-bottom: 0;
|
|
941
|
+
}
|
|
942
|
+
.m-editor-history-list-popover .m-editor-history-list-bucket-title {
|
|
943
|
+
display: flex;
|
|
944
|
+
align-items: center;
|
|
945
|
+
gap: 6px;
|
|
946
|
+
padding: 4px 8px;
|
|
947
|
+
font-size: 12px;
|
|
948
|
+
font-weight: 500;
|
|
949
|
+
color: #606266;
|
|
950
|
+
background-color: #f5f7fa;
|
|
951
|
+
border-radius: 4px;
|
|
952
|
+
}
|
|
953
|
+
.m-editor-history-list-popover .m-editor-history-list-bucket-title code {
|
|
954
|
+
flex: 1 1 auto;
|
|
955
|
+
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
|
|
956
|
+
font-size: 11px;
|
|
957
|
+
color: #409eff;
|
|
958
|
+
overflow: hidden;
|
|
959
|
+
text-overflow: ellipsis;
|
|
960
|
+
white-space: nowrap;
|
|
961
|
+
}
|
|
962
|
+
.m-editor-history-list-popover .m-editor-history-list-bucket-count {
|
|
963
|
+
flex: 0 0 auto;
|
|
964
|
+
color: #909399;
|
|
965
|
+
font-weight: 400;
|
|
966
|
+
font-size: 11px;
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
.m-editor-history-diff-dialog .m-editor-history-diff-dialog-body {
|
|
970
|
+
display: flex;
|
|
971
|
+
flex-direction: column;
|
|
972
|
+
}
|
|
973
|
+
.m-editor-history-diff-dialog .m-editor-history-diff-dialog-notice {
|
|
974
|
+
margin-bottom: 8px;
|
|
975
|
+
padding: 8px 12px;
|
|
976
|
+
background-color: #fdf6ec;
|
|
977
|
+
border: 1px solid #faecd8;
|
|
978
|
+
border-radius: 4px;
|
|
979
|
+
color: #e6a23c;
|
|
980
|
+
font-size: 13px;
|
|
981
|
+
line-height: 1.5;
|
|
982
|
+
}
|
|
983
|
+
.m-editor-history-diff-dialog .m-editor-history-diff-dialog-header {
|
|
984
|
+
display: flex;
|
|
985
|
+
align-items: center;
|
|
986
|
+
justify-content: space-between;
|
|
987
|
+
margin-bottom: 8px;
|
|
988
|
+
padding: 8px 12px;
|
|
989
|
+
background-color: #f5f7fa;
|
|
990
|
+
border-radius: 4px;
|
|
991
|
+
gap: 12px;
|
|
992
|
+
}
|
|
993
|
+
.m-editor-history-diff-dialog .m-editor-history-diff-dialog-controls {
|
|
994
|
+
display: flex;
|
|
995
|
+
align-items: center;
|
|
996
|
+
flex: 0 0 auto;
|
|
997
|
+
gap: 8px;
|
|
998
|
+
}
|
|
999
|
+
.m-editor-history-diff-dialog .m-editor-history-diff-dialog-view,
|
|
1000
|
+
.m-editor-history-diff-dialog .m-editor-history-diff-dialog-mode {
|
|
1001
|
+
flex: 0 0 auto;
|
|
1002
|
+
}
|
|
1003
|
+
.m-editor-history-diff-dialog .m-editor-history-diff-dialog-target {
|
|
1004
|
+
flex: 1 1 auto;
|
|
1005
|
+
font-size: 13px;
|
|
1006
|
+
font-weight: 500;
|
|
1007
|
+
color: #303133;
|
|
1008
|
+
overflow: hidden;
|
|
1009
|
+
text-overflow: ellipsis;
|
|
1010
|
+
white-space: nowrap;
|
|
1011
|
+
}
|
|
1012
|
+
.m-editor-history-diff-dialog .m-editor-history-diff-dialog-legend {
|
|
1013
|
+
display: flex;
|
|
1014
|
+
align-items: center;
|
|
1015
|
+
gap: 6px;
|
|
1016
|
+
margin-bottom: 12px;
|
|
1017
|
+
padding: 0 4px;
|
|
1018
|
+
}
|
|
1019
|
+
.m-editor-history-diff-dialog .m-editor-history-diff-dialog-arrow {
|
|
1020
|
+
color: #909399;
|
|
1021
|
+
font-size: 12px;
|
|
1022
|
+
}
|
|
1023
|
+
.m-editor-history-diff-dialog .m-editor-history-diff-dialog-tip {
|
|
1024
|
+
margin-left: 8px;
|
|
1025
|
+
color: #e6a23c;
|
|
1026
|
+
font-size: 12px;
|
|
1027
|
+
}
|
|
1028
|
+
|
|
581
1029
|
.m-editor {
|
|
582
1030
|
display: flex;
|
|
583
1031
|
flex-direction: column;
|
|
@@ -1006,9 +1454,6 @@ fieldset.m-fieldset .m-form-tip {
|
|
|
1006
1454
|
transition: all 0.2s ease 0s;
|
|
1007
1455
|
padding: 5px 14px;
|
|
1008
1456
|
}
|
|
1009
|
-
.page-bar-popover .menu-item .tmagic-design-button {
|
|
1010
|
-
color: #313a40;
|
|
1011
|
-
}
|
|
1012
1457
|
.page-bar-popover .menu-item:hover {
|
|
1013
1458
|
background-color: #f3f5f9;
|
|
1014
1459
|
}
|
|
@@ -1074,7 +1519,7 @@ fieldset.m-fieldset .m-form-tip {
|
|
|
1074
1519
|
position: absolute;
|
|
1075
1520
|
right: 15px;
|
|
1076
1521
|
bottom: 15px;
|
|
1077
|
-
z-index:
|
|
1522
|
+
z-index: 32;
|
|
1078
1523
|
opacity: 0.5;
|
|
1079
1524
|
}
|
|
1080
1525
|
.m-editor-props-panel .m-editor-props-panel-src-icon:hover {
|
|
@@ -1084,7 +1529,7 @@ fieldset.m-fieldset .m-form-tip {
|
|
|
1084
1529
|
position: absolute;
|
|
1085
1530
|
right: 15px;
|
|
1086
1531
|
bottom: 60px;
|
|
1087
|
-
z-index:
|
|
1532
|
+
z-index: 31;
|
|
1088
1533
|
opacity: 0.5;
|
|
1089
1534
|
}
|
|
1090
1535
|
.m-editor-props-panel .m-editor-props-panel-style-icon:hover {
|
|
@@ -1094,7 +1539,7 @@ fieldset.m-fieldset .m-form-tip {
|
|
|
1094
1539
|
position: absolute;
|
|
1095
1540
|
left: 0;
|
|
1096
1541
|
top: 0;
|
|
1097
|
-
z-index:
|
|
1542
|
+
z-index: 31;
|
|
1098
1543
|
}
|
|
1099
1544
|
.m-editor-props-panel .m-editor-resizer {
|
|
1100
1545
|
position: absolute;
|
|
@@ -1660,9 +2105,12 @@ fieldset.m-fieldset .m-form-tip {
|
|
|
1660
2105
|
.border-box-container .border-icon-container .border-icon + .border-icon {
|
|
1661
2106
|
margin-left: 8px;
|
|
1662
2107
|
}
|
|
2108
|
+
.border-box-container .border-icon-container .border-icon.configured {
|
|
2109
|
+
border-color: var(--el-color-success, var(--td-success-color, #2ba471));
|
|
2110
|
+
}
|
|
1663
2111
|
.border-box-container .border-icon-container .border-icon.active {
|
|
1664
2112
|
border-width: 1px;
|
|
1665
|
-
border-color: var(--el-color-primary);
|
|
2113
|
+
border-color: var(--el-color-primary, var(--td-brand-color, #0052d9));
|
|
1666
2114
|
}
|
|
1667
2115
|
.border-box-container .border-icon-container .border-icon.border-icon-top {
|
|
1668
2116
|
border-top-width: 2px;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { getEditorConfig } from "./config.js";
|
|
2
|
+
import { defineFormConfig, defineFormItem } from "@tmagic/form";
|
|
3
|
+
import { tMagicMessage } from "@tmagic/design";
|
|
4
|
+
//#region packages/editor/src/utils/code-block.ts
|
|
5
|
+
/** 默认的"参数类型"列配置:数字 / 字符串 / 组件 三选一。 */
|
|
6
|
+
var defaultParamColConfig = () => defineFormItem({
|
|
7
|
+
type: "row",
|
|
8
|
+
label: "参数类型",
|
|
9
|
+
items: [{
|
|
10
|
+
text: "参数类型",
|
|
11
|
+
labelWidth: "70px",
|
|
12
|
+
type: "select",
|
|
13
|
+
name: "type",
|
|
14
|
+
options: [
|
|
15
|
+
{
|
|
16
|
+
text: "数字",
|
|
17
|
+
label: "数字",
|
|
18
|
+
value: "number"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
text: "字符串",
|
|
22
|
+
label: "字符串",
|
|
23
|
+
value: "text"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
text: "组件",
|
|
27
|
+
label: "组件",
|
|
28
|
+
value: "ui-select"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}]
|
|
32
|
+
});
|
|
33
|
+
/**
|
|
34
|
+
* 生成代码块表单配置。返回的是普通对象数组,可直接传给 `<MForm :config>`;
|
|
35
|
+
* 如需响应式的 props 变化(如切换 dataSourceType),调用方在 `computed` 中再次调用本函数即可。
|
|
36
|
+
*/
|
|
37
|
+
var getCodeBlockFormConfig = (options = {}) => {
|
|
38
|
+
const { paramColConfig, isDataSource, dataSourceType, codeOptions = {}, editable = true } = options;
|
|
39
|
+
return defineFormConfig([
|
|
40
|
+
{
|
|
41
|
+
text: "名称",
|
|
42
|
+
name: "name",
|
|
43
|
+
...editable ? { rules: [{
|
|
44
|
+
required: true,
|
|
45
|
+
message: "请输入名称",
|
|
46
|
+
trigger: "blur"
|
|
47
|
+
}] } : {}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
text: "描述",
|
|
51
|
+
name: "desc"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
text: "执行时机",
|
|
55
|
+
name: "timing",
|
|
56
|
+
type: "select",
|
|
57
|
+
options: () => {
|
|
58
|
+
const list = [{
|
|
59
|
+
text: "初始化前",
|
|
60
|
+
value: "beforeInit"
|
|
61
|
+
}, {
|
|
62
|
+
text: "初始化后",
|
|
63
|
+
value: "afterInit"
|
|
64
|
+
}];
|
|
65
|
+
if (dataSourceType?.() !== "base") {
|
|
66
|
+
list.push({
|
|
67
|
+
text: "请求前",
|
|
68
|
+
value: "beforeRequest"
|
|
69
|
+
});
|
|
70
|
+
list.push({
|
|
71
|
+
text: "请求后",
|
|
72
|
+
value: "afterRequest"
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
return list;
|
|
76
|
+
},
|
|
77
|
+
display: () => Boolean(isDataSource?.())
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
type: "table",
|
|
81
|
+
border: true,
|
|
82
|
+
text: "参数",
|
|
83
|
+
enableFullscreen: false,
|
|
84
|
+
enableToggleMode: false,
|
|
85
|
+
name: "params",
|
|
86
|
+
dropSort: false,
|
|
87
|
+
items: [
|
|
88
|
+
{
|
|
89
|
+
type: "text",
|
|
90
|
+
label: "参数名",
|
|
91
|
+
name: "name"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
type: "text",
|
|
95
|
+
label: "描述",
|
|
96
|
+
name: "extra"
|
|
97
|
+
},
|
|
98
|
+
paramColConfig || defaultParamColConfig()
|
|
99
|
+
]
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: "content",
|
|
103
|
+
type: "vs-code",
|
|
104
|
+
options: codeOptions,
|
|
105
|
+
autosize: {
|
|
106
|
+
minRows: 10,
|
|
107
|
+
maxRows: 30
|
|
108
|
+
},
|
|
109
|
+
...editable ? { onChange: (_formState, code) => {
|
|
110
|
+
try {
|
|
111
|
+
getEditorConfig("parseDSL")(code);
|
|
112
|
+
return code;
|
|
113
|
+
} catch (error) {
|
|
114
|
+
tMagicMessage.error(error.message);
|
|
115
|
+
throw error;
|
|
116
|
+
}
|
|
117
|
+
} } : {}
|
|
118
|
+
}
|
|
119
|
+
]);
|
|
120
|
+
};
|
|
121
|
+
//#endregion
|
|
122
|
+
export { getCodeBlockFormConfig };
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { COPY_STORAGE_KEY } from "./editor.js";
|
|
2
2
|
import { calcValueByFontsize, isPage, isPageFragment } from "@tmagic/utils";
|
|
3
|
-
import { NodeType } from "@tmagic/core";
|
|
3
|
+
import { NodeType, cloneDeep } from "@tmagic/core";
|
|
4
4
|
import { computed, markRaw } from "vue";
|
|
5
5
|
import { CopyDocument, Delete, DocumentCopy } from "@element-plus/icons-vue";
|
|
6
6
|
//#region packages/editor/src/utils/content-menu.ts
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* 共享的右键菜单项构造器(画布 ViewerMenu 与图层树 LayerMenu 共用)。
|
|
9
|
+
* `historySource` 用于标记本次操作的途径,调用方按所在面板传入:
|
|
10
|
+
* 画布传 `'stage-contextmenu'`,树形面板传 `'tree-contextmenu'`。
|
|
11
|
+
*/
|
|
12
|
+
var useDeleteMenu = (historySource) => ({
|
|
8
13
|
type: "button",
|
|
9
14
|
text: "删除",
|
|
10
15
|
icon: Delete,
|
|
@@ -14,7 +19,7 @@ var useDeleteMenu = () => ({
|
|
|
14
19
|
},
|
|
15
20
|
handler: ({ editorService }) => {
|
|
16
21
|
const nodes = editorService.get("nodes");
|
|
17
|
-
nodes && editorService.remove(nodes);
|
|
22
|
+
nodes && editorService.remove(nodes, { historySource });
|
|
18
23
|
}
|
|
19
24
|
});
|
|
20
25
|
var useCopyMenu = () => ({
|
|
@@ -26,7 +31,7 @@ var useCopyMenu = () => ({
|
|
|
26
31
|
nodes && editorService?.copy(nodes);
|
|
27
32
|
}
|
|
28
33
|
});
|
|
29
|
-
var usePasteMenu = (menu) => ({
|
|
34
|
+
var usePasteMenu = (historySource, menu) => ({
|
|
30
35
|
type: "button",
|
|
31
36
|
text: "粘贴",
|
|
32
37
|
icon: markRaw(DocumentCopy),
|
|
@@ -43,18 +48,20 @@ var usePasteMenu = (menu) => ({
|
|
|
43
48
|
editorService.paste({
|
|
44
49
|
left: initialLeft,
|
|
45
50
|
top: initialTop
|
|
46
|
-
});
|
|
47
|
-
} else editorService.paste();
|
|
51
|
+
}, void 0, { historySource });
|
|
52
|
+
} else editorService.paste(void 0, void 0, { historySource });
|
|
48
53
|
}
|
|
49
54
|
});
|
|
50
|
-
var moveTo = (id, { editorService }) => {
|
|
55
|
+
var moveTo = async (id, { editorService }, historySource) => {
|
|
51
56
|
const nodes = editorService.get("nodes") || [];
|
|
52
57
|
const parent = editorService.getNodeById(id);
|
|
53
|
-
if (!parent) return;
|
|
54
|
-
editorService.
|
|
55
|
-
|
|
58
|
+
if (!parent || nodes.length === 0) return;
|
|
59
|
+
await editorService.moveToContainer(cloneDeep(nodes), parent.id, {
|
|
60
|
+
doNotSwitchPage: true,
|
|
61
|
+
historySource
|
|
62
|
+
});
|
|
56
63
|
};
|
|
57
|
-
var useMoveToMenu = ({ editorService }) => {
|
|
64
|
+
var useMoveToMenu = ({ editorService }, historySource) => {
|
|
58
65
|
return {
|
|
59
66
|
type: "button",
|
|
60
67
|
text: "移动至",
|
|
@@ -67,7 +74,7 @@ var useMoveToMenu = ({ editorService }) => {
|
|
|
67
74
|
text: `${page.name}(${page.id})`,
|
|
68
75
|
type: "button",
|
|
69
76
|
handler: (services) => {
|
|
70
|
-
moveTo(page.id, services);
|
|
77
|
+
moveTo(page.id, services, historySource);
|
|
71
78
|
}
|
|
72
79
|
}))
|
|
73
80
|
};
|
|
@@ -7,6 +7,7 @@ var dataSourceFormConfig = {
|
|
|
7
7
|
items: [
|
|
8
8
|
{
|
|
9
9
|
title: "数据定义",
|
|
10
|
+
status: "fields",
|
|
10
11
|
items: [{
|
|
11
12
|
name: "fields",
|
|
12
13
|
type: "data-source-fields",
|
|
@@ -15,6 +16,7 @@ var dataSourceFormConfig = {
|
|
|
15
16
|
},
|
|
16
17
|
{
|
|
17
18
|
title: "方法定义",
|
|
19
|
+
status: "methods",
|
|
18
20
|
items: [{
|
|
19
21
|
name: "methods",
|
|
20
22
|
type: "data-source-methods",
|