@tmagic/editor 1.8.5 → 1.8.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.
- package/dist/es/{Editor.vue_vue_type_script_setup_true_lang.js → Editor.vue.js} +9 -9
- package/dist/es/{Editor.js → Editor2.vue.js} +1 -1
- package/dist/es/components/{CodeBlockEditor.vue_vue_type_script_setup_true_lang.js → CodeBlockEditor.vue.js} +5 -5
- package/dist/es/components/{CodeBlockEditor.js → CodeBlockEditor2.vue.js} +1 -1
- package/dist/es/components/{CodeParams.js → CodeParams2.vue.js} +1 -1
- package/dist/es/components/{CompareForm.js → CompareForm2.vue.js} +1 -1
- package/dist/es/components/{ContentMenu.vue_vue_type_script_setup_true_lang.js → ContentMenu.vue.js} +2 -2
- package/dist/es/components/{ContentMenu.js → ContentMenu2.vue.js} +1 -1
- package/dist/es/components/{FloatingBox.vue_vue_type_script_setup_true_lang.js → FloatingBox.vue.js} +2 -2
- package/dist/es/components/{FloatingBox.js → FloatingBox2.vue.js} +1 -1
- package/dist/es/components/{Icon.js → Icon2.vue.js} +1 -1
- package/dist/es/components/{Resizer.js → Resizer2.vue.js} +1 -1
- package/dist/es/components/{ScrollBar.js → ScrollBar2.vue.js} +1 -1
- package/dist/es/components/{ScrollViewer.vue_vue_type_script_setup_true_lang.js → ScrollViewer.vue.js} +3 -3
- package/dist/es/components/{ScrollViewer.js → ScrollViewer2.vue.js} +1 -1
- package/dist/es/components/{SearchInput.js → SearchInput2.vue.js} +1 -1
- package/dist/es/components/{SplitView.vue_vue_type_script_setup_true_lang.js → SplitView.vue.js} +1 -1
- package/dist/es/components/{SplitView.js → SplitView2.vue.js} +1 -1
- package/dist/es/components/{ToolButton.vue_vue_type_script_setup_true_lang.js → ToolButton.vue.js} +3 -3
- package/dist/es/components/{ToolButton.js → ToolButton2.vue.js} +1 -1
- package/dist/es/components/{Tree.vue_vue_type_script_setup_true_lang.js → Tree.vue.js} +1 -1
- package/dist/es/components/{Tree.js → Tree2.vue.js} +1 -1
- package/dist/es/components/{TreeNode.vue_vue_type_script_setup_true_lang.js → TreeNode.vue.js} +2 -2
- package/dist/es/components/{TreeNode.js → TreeNode2.vue.js} +1 -1
- package/dist/es/components/{ViewForm.js → ViewForm2.vue.js} +1 -1
- package/dist/es/fields/{Code.vue_vue_type_script_setup_true_lang.js → Code.vue.js} +1 -1
- package/dist/es/fields/{Code.js → Code2.vue.js} +1 -1
- package/dist/es/fields/{CodeLink.js → CodeLink2.vue.js} +1 -1
- package/dist/es/fields/{CodeSelect.js → CodeSelect2.vue.js} +1 -1
- package/dist/es/fields/{CodeSelectCol.vue_vue_type_script_setup_true_lang.js → CodeSelectCol.vue.js} +7 -7
- package/dist/es/fields/{CodeSelectCol.js → CodeSelectCol2.vue.js} +1 -1
- package/dist/es/fields/{CondOpSelect.js → CondOpSelect2.vue.js} +1 -1
- package/dist/es/fields/DataSourceFieldSelect/{FieldSelect.vue_vue_type_script_setup_true_lang.js → FieldSelect.vue.js} +55 -14
- package/dist/es/fields/DataSourceFieldSelect/{FieldSelect.js → FieldSelect2.vue.js} +1 -1
- package/dist/es/fields/DataSourceFieldSelect/{Index.vue_vue_type_script_setup_true_lang.js → Index.vue.js} +7 -7
- package/dist/es/fields/DataSourceFieldSelect/{Index.js → Index2.vue.js} +1 -1
- package/dist/es/fields/{DataSourceFields.vue_vue_type_script_setup_true_lang.js → DataSourceFields.vue.js} +50 -17
- package/dist/es/fields/{DataSourceFields.js → DataSourceFields2.vue.js} +1 -1
- package/dist/es/fields/{DataSourceInput.vue_vue_type_script_setup_true_lang.js → DataSourceInput.vue.js} +5 -5
- package/dist/es/fields/{DataSourceInput.js → DataSourceInput2.vue.js} +1 -1
- package/dist/es/fields/{DataSourceMethodSelect.vue_vue_type_script_setup_true_name_true_lang.js → DataSourceMethodSelect.vue.js} +7 -7
- package/dist/es/fields/{DataSourceMethodSelect.js → DataSourceMethodSelect2.vue.js} +1 -1
- package/dist/es/fields/{DataSourceMethods.vue_vue_type_script_setup_true_lang.js → DataSourceMethods.vue.js} +3 -3
- package/dist/es/fields/{DataSourceMethods.js → DataSourceMethods2.vue.js} +1 -1
- package/dist/es/fields/{DataSourceMocks.vue_vue_type_script_setup_true_lang.js → DataSourceMocks.vue.js} +8 -8
- package/dist/es/fields/{DataSourceMocks.js → DataSourceMocks2.vue.js} +1 -1
- package/dist/es/fields/{DataSourceSelect.vue_vue_type_script_setup_true_lang.js → DataSourceSelect.vue.js} +5 -5
- package/dist/es/fields/{DataSourceSelect.js → DataSourceSelect2.vue.js} +1 -1
- package/dist/es/fields/{DisplayConds.js → DisplayConds2.vue.js} +1 -1
- package/dist/es/fields/{EventSelect.js → EventSelect2.vue.js} +1 -1
- package/dist/es/fields/{KeyValue.vue_vue_type_script_setup_true_lang.js → KeyValue.vue.js} +3 -3
- package/dist/es/fields/{KeyValue.js → KeyValue2.vue.js} +1 -1
- package/dist/es/fields/{PageFragmentSelect.vue_vue_type_script_setup_true_lang.js → PageFragmentSelect.vue.js} +4 -4
- package/dist/es/fields/{PageFragmentSelect.js → PageFragmentSelect2.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/{Index.vue_vue_type_script_setup_true_lang.js → Index.vue.js} +7 -7
- package/dist/es/fields/StyleSetter/{Index.js → Index2.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/components/{BackgroundPosition.js → BackgroundPosition2.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/components/{Border.js → Border2.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/components/{Box.js → Box2.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/configs.js +43 -43
- package/dist/es/fields/StyleSetter/pro/{Background.js → Background2.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/pro/{Border.vue_vue_type_script_setup_true_lang.js → Border.vue.js} +3 -3
- package/dist/es/fields/StyleSetter/pro/{Border.js → Border2.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/pro/{Font.js → Font2.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/pro/{Layout.vue_vue_type_script_setup_true_lang.js → Layout.vue.js} +4 -4
- package/dist/es/fields/StyleSetter/pro/{Layout.js → Layout2.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/pro/{Position.js → Position2.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/pro/{Transform.js → Transform2.vue.js} +1 -1
- package/dist/es/fields/{UISelect.js → UISelect2.vue.js} +1 -1
- package/dist/es/fields/configs/codeSelect.js +2 -2
- package/dist/es/fields/configs/displayConds.js +1 -1
- package/dist/es/fields/configs/eventSelect.js +3 -3
- package/dist/es/fields/headless-validation.js +1 -1
- package/dist/es/hooks/use-code-block-edit.js +1 -1
- package/dist/es/hooks/use-compare-form.js +1 -1
- package/dist/es/hooks/use-editor-content-height.js +1 -1
- package/dist/es/hooks/use-filter.js +2 -2
- package/dist/es/hooks/use-float-box.js +1 -1
- package/dist/es/hooks/use-form-context.js +1 -1
- package/dist/es/hooks/use-node-status.js +1 -1
- package/dist/es/hooks/use-stage.js +28 -3
- package/dist/es/icons/{CenterIcon.js → CenterIcon2.vue.js} +1 -1
- package/dist/es/icons/{CodeIcon.js → CodeIcon2.vue.js} +1 -1
- package/dist/es/icons/{FolderMinusIcon.js → FolderMinusIcon2.vue.js} +1 -1
- package/dist/es/index.js +47 -47
- package/dist/es/initService.js +9 -9
- package/dist/es/layouts/{AddPageBox.vue_vue_type_script_setup_true_lang.js → AddPageBox.vue.js} +4 -4
- package/dist/es/layouts/{AddPageBox.js → AddPageBox2.vue.js} +1 -1
- package/dist/es/layouts/{CodeEditor.vue_vue_type_script_setup_true_lang.js → CodeEditor.vue.js} +5 -5
- package/dist/es/layouts/{CodeEditor.js → CodeEditor2.vue.js} +1 -1
- package/dist/es/layouts/{Framework.vue_vue_type_script_setup_true_lang.js → Framework.vue.js} +5 -5
- package/dist/es/layouts/{Framework.js → Framework2.vue.js} +1 -1
- package/dist/es/layouts/{NavMenu.vue_vue_type_script_setup_true_lang.js → NavMenu.vue.js} +5 -5
- package/dist/es/layouts/{NavMenu.js → NavMenu2.vue.js} +1 -1
- package/dist/es/layouts/{NavMenuColumn.vue_vue_type_script_setup_true_lang.js → NavMenuColumn.vue.js} +14 -6
- package/dist/es/layouts/{NavMenuColumn.js → NavMenuColumn2.vue.js} +1 -1
- package/dist/es/layouts/history-list/{Bucket.vue_vue_type_script_setup_true_lang.js → Bucket.vue.js} +23 -7
- package/dist/es/layouts/history-list/{Bucket.js → Bucket2.vue.js} +1 -1
- package/dist/es/layouts/history-list/{BucketTab.vue_vue_type_script_setup_true_lang.js → BucketTab.vue.js} +9 -4
- package/dist/es/layouts/history-list/{BucketTab.js → BucketTab2.vue.js} +1 -1
- package/dist/es/layouts/history-list/{GroupRow.js → GroupRow2.vue.js} +1 -1
- package/dist/es/layouts/history-list/{HistoryDiffDialog.vue_vue_type_script_setup_true_lang.js → HistoryDiffDialog.vue.js} +3 -3
- package/dist/es/layouts/history-list/{HistoryDiffDialog.js → HistoryDiffDialog2.vue.js} +1 -1
- package/dist/es/layouts/history-list/{HistoryListPanel.vue_vue_type_script_setup_true_lang.js → HistoryListPanel.vue.js} +24 -6
- package/dist/es/layouts/history-list/{HistoryListPanel.js → HistoryListPanel2.vue.js} +1 -1
- package/dist/es/layouts/history-list/{InitialRow.vue_vue_type_script_setup_true_lang.js → InitialRow.vue.js} +16 -5
- package/dist/es/layouts/history-list/{InitialRow.js → InitialRow2.vue.js} +1 -1
- package/dist/es/layouts/history-list/{PageTab.vue_vue_type_script_setup_true_lang.js → PageTab.vue.js} +20 -8
- package/dist/es/layouts/history-list/{PageTab.js → PageTab2.vue.js} +1 -1
- package/dist/es/layouts/history-list/composables.js +1 -1
- package/dist/es/layouts/history-list/useHistoryList.js +1 -1
- package/dist/es/layouts/history-list/useHistoryRevert.js +3 -3
- package/dist/es/layouts/page-bar/{AddButton.vue_vue_type_script_setup_true_lang.js → AddButton.vue.js} +6 -6
- package/dist/es/layouts/page-bar/{AddButton.js → AddButton2.vue.js} +1 -1
- package/dist/es/layouts/page-bar/{PageBar.vue_vue_type_script_setup_true_lang.js → PageBar.vue.js} +8 -8
- package/dist/es/layouts/page-bar/{PageBar.js → PageBar2.vue.js} +1 -1
- package/dist/es/layouts/page-bar/{PageBarScrollContainer.vue_vue_type_script_setup_true_lang.js → PageBarScrollContainer.vue.js} +2 -2
- package/dist/es/layouts/page-bar/{PageBarScrollContainer.js → PageBarScrollContainer2.vue.js} +1 -1
- package/dist/es/layouts/page-bar/{PageList.vue_vue_type_script_setup_true_lang.js → PageList.vue.js} +3 -3
- package/dist/es/layouts/page-bar/{PageList.js → PageList2.vue.js} +1 -1
- package/dist/es/layouts/page-bar/{Search.vue_vue_type_script_setup_true_lang.js → Search.vue.js} +3 -3
- package/dist/es/layouts/page-bar/{Search.js → Search2.vue.js} +1 -1
- package/dist/es/layouts/props-panel/{FormPanel.vue_vue_type_script_setup_true_lang.js → FormPanel.vue.js} +7 -7
- package/dist/es/layouts/props-panel/{FormPanel.js → FormPanel2.vue.js} +1 -1
- package/dist/es/layouts/props-panel/{PropsPanel.vue_vue_type_script_setup_true_lang.js → PropsPanel.vue.js} +7 -7
- package/dist/es/layouts/props-panel/{PropsPanel.js → PropsPanel2.vue.js} +1 -1
- package/dist/es/layouts/props-panel/use-style-panel.js +1 -1
- package/dist/es/layouts/sidebar/{ComponentListPanel.vue_vue_type_script_setup_true_lang.js → ComponentListPanel.vue.js} +7 -7
- package/dist/es/layouts/sidebar/{ComponentListPanel.js → ComponentListPanel2.vue.js} +1 -1
- package/dist/es/layouts/sidebar/{Sidebar.vue_vue_type_script_setup_true_lang.js → Sidebar.vue.js} +8 -8
- package/dist/es/layouts/sidebar/{Sidebar.js → Sidebar2.vue.js} +1 -1
- package/dist/es/layouts/sidebar/code-block/{CodeBlockList.vue_vue_type_script_setup_true_lang.js → CodeBlockList.vue.js} +5 -5
- package/dist/es/layouts/sidebar/code-block/{CodeBlockList.js → CodeBlockList2.vue.js} +1 -1
- package/dist/es/layouts/sidebar/code-block/{CodeBlockListPanel.vue_vue_type_script_setup_true_lang.js → CodeBlockListPanel.vue.js} +6 -6
- package/dist/es/layouts/sidebar/code-block/{CodeBlockListPanel.js → CodeBlockListPanel2.vue.js} +1 -1
- 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 → DataSourceAddButton.vue.js} +2 -2
- package/dist/es/layouts/sidebar/data-source/{DataSourceAddButton.js → DataSourceAddButton2.vue.js} +1 -1
- package/dist/es/layouts/sidebar/data-source/{DataSourceConfigPanel.vue_vue_type_script_setup_true_lang.js → DataSourceConfigPanel.vue.js} +4 -4
- package/dist/es/layouts/sidebar/data-source/{DataSourceConfigPanel.js → DataSourceConfigPanel2.vue.js} +1 -1
- package/dist/es/layouts/sidebar/data-source/{DataSourceList.vue_vue_type_script_setup_true_lang.js → DataSourceList.vue.js} +5 -5
- package/dist/es/layouts/sidebar/data-source/{DataSourceList.js → DataSourceList2.vue.js} +1 -1
- package/dist/es/layouts/sidebar/data-source/{DataSourceListPanel.vue_vue_type_script_setup_true_lang.js → DataSourceListPanel.vue.js} +8 -8
- package/dist/es/layouts/sidebar/data-source/{DataSourceListPanel.js → DataSourceListPanel2.vue.js} +1 -1
- 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 → LayerMenu.vue.js} +5 -5
- package/dist/es/layouts/sidebar/layer/{LayerMenu.js → LayerMenu2.vue.js} +1 -1
- package/dist/es/layouts/sidebar/layer/{LayerNodeContent.vue_vue_type_script_setup_true_lang.js → LayerNodeContent.vue.js} +3 -3
- package/dist/es/layouts/sidebar/layer/{LayerNodeContent.js → LayerNodeContent2.vue.js} +1 -1
- package/dist/es/layouts/sidebar/layer/{LayerNodeTool.js → LayerNodeTool2.vue.js} +1 -1
- package/dist/es/layouts/sidebar/layer/{LayerPanel.vue_vue_type_script_setup_true_lang.js → LayerPanel.vue.js} +7 -7
- package/dist/es/layouts/sidebar/layer/{LayerPanel.js → LayerPanel2.vue.js} +1 -1
- package/dist/es/layouts/sidebar/layer/use-click.js +3 -3
- package/dist/es/layouts/sidebar/layer/use-drag.js +1 -1
- package/dist/es/layouts/sidebar/layer/use-keybinding.js +1 -1
- package/dist/es/layouts/sidebar/layer/use-node-status.js +2 -2
- package/dist/es/layouts/workspace/{Breadcrumb.js → Breadcrumb2.vue.js} +1 -1
- package/dist/es/layouts/workspace/{Workspace.vue_vue_type_script_setup_true_lang.js → Workspace.vue.js} +3 -3
- package/dist/es/layouts/workspace/{Workspace.js → Workspace2.vue.js} +1 -1
- package/dist/es/layouts/workspace/viewer/{NodeListMenu.vue_vue_type_script_setup_true_lang.js → NodeListMenu.vue.js} +5 -5
- package/dist/es/layouts/workspace/viewer/{NodeListMenu.js → NodeListMenu2.vue.js} +1 -1
- package/dist/es/layouts/workspace/viewer/{Stage.vue_vue_type_script_setup_true_lang.js → Stage.vue.js} +70 -55
- package/dist/es/layouts/workspace/viewer/{Stage.js → Stage2.vue.js} +1 -1
- package/dist/es/layouts/workspace/viewer/{StageOverlay.vue_vue_type_script_setup_true_lang.js → StageOverlay.vue.js} +3 -3
- package/dist/es/layouts/workspace/viewer/{StageOverlay.js → StageOverlay2.vue.js} +1 -1
- package/dist/es/layouts/workspace/viewer/{ViewerMenu.vue_vue_type_script_setup_true_lang.js → ViewerMenu.vue.js} +6 -6
- package/dist/es/layouts/workspace/viewer/{ViewerMenu.js → ViewerMenu2.vue.js} +1 -1
- package/dist/es/plugin.js +24 -24
- package/dist/es/sdk/index.js +2 -2
- package/dist/es/sdk/services/CodeBlock.js +18 -18
- package/dist/es/sdk/services/DataSource.js +17 -17
- package/dist/es/sdk/services/Dep.js +3 -3
- package/dist/es/sdk/services/Editor.js +116 -81
- package/dist/es/sdk/services/Events.js +2 -2
- package/dist/es/sdk/services/History.js +45 -7
- package/dist/es/sdk/services/Props.js +6 -6
- package/dist/es/sdk/services/WebStorage.js +1 -1
- package/dist/es/sdk/utils/dep.js +2 -2
- package/dist/es/sdk/utils/operator.js +3 -3
- package/dist/es/sdk/validate/index.js +4 -4
- package/dist/es/sdk/wiring.js +2 -2
- package/dist/es/services/keybinding.js +2 -2
- package/dist/es/services/stageOverlay.js +2 -2
- package/dist/es/services/ui.js +2 -2
- package/dist/es/utils/code-block.js +2 -2
- package/dist/es/utils/content-menu.js +3 -3
- package/dist/es/utils/data-source/index.js +88 -5
- package/dist/es/utils/dep/collect-worker-client.js +1 -1
- package/dist/es/utils/dep/idle-task.js +1 -1
- package/dist/es/utils/editor.js +7 -6
- package/dist/es/utils/event.js +1 -1
- package/dist/es/utils/history.js +29 -10
- package/dist/es/utils/operator.js +1 -1
- package/dist/es/utils/page.js +21 -0
- package/dist/es/utils/props.js +1 -1
- package/dist/es/utils/type-match-rules.js +4 -4
- package/dist/es/utils/undo-redo.js +57 -9
- package/dist/tmagic-editor-headless.umd.cjs +257 -87
- package/dist/tmagic-editor-sdk.umd.cjs +225 -84
- package/dist/tmagic-editor.umd.cjs +814 -241
- package/package.json +8 -8
- package/src/fields/DataSourceFieldSelect/FieldSelect.vue +68 -9
- package/src/fields/DataSourceFields.vue +53 -10
- package/src/fields/DataSourceMocks.vue +2 -2
- package/src/hooks/use-stage.ts +26 -1
- package/src/layouts/NavMenuColumn.vue +8 -1
- package/src/layouts/history-list/Bucket.vue +30 -16
- package/src/layouts/history-list/BucketTab.vue +8 -1
- package/src/layouts/history-list/HistoryListPanel.vue +27 -0
- package/src/layouts/history-list/InitialRow.vue +17 -5
- package/src/layouts/history-list/PageTab.vue +32 -18
- package/src/layouts/workspace/viewer/Stage.vue +77 -57
- package/src/sdk/services/Editor.ts +56 -26
- package/src/sdk/services/History.ts +58 -11
- package/src/type.ts +19 -3
- package/src/utils/data-source/index.ts +151 -6
- package/src/utils/editor.ts +4 -0
- package/src/utils/history.ts +35 -10
- package/src/utils/page.ts +32 -0
- package/src/utils/undo-redo.ts +76 -12
- package/types/headless.d.ts +14 -3
- package/types/index.d.ts +234 -314
- package/types/sdk.d.ts +79 -59
- package/dist/es/components/{CodeParams.vue_vue_type_script_setup_true_lang.js → CodeParams.vue.js} +2 -2
- package/dist/es/components/{CompareForm.vue_vue_type_script_setup_true_lang.js → CompareForm.vue.js} +3 -3
- package/dist/es/components/{Icon.vue_vue_type_script_setup_true_lang.js → Icon.vue.js} +1 -1
- package/dist/es/components/{Resizer.vue_vue_type_script_setup_true_lang.js → Resizer.vue.js} +1 -1
- package/dist/es/components/{ScrollBar.vue_vue_type_script_setup_true_lang.js → ScrollBar.vue.js} +0 -0
- package/dist/es/components/{SearchInput.vue_vue_type_script_setup_true_lang.js → SearchInput.vue.js} +1 -1
- package/dist/es/components/{ViewForm.vue_vue_type_script_setup_true_lang.js → ViewForm.vue.js} +2 -2
- package/dist/es/fields/{CodeLink.vue_vue_type_script_setup_true_lang.js → CodeLink.vue.js} +1 -1
- package/dist/es/fields/{CodeSelect.vue_vue_type_script_setup_true_lang.js → CodeSelect.vue.js} +2 -2
- package/dist/es/fields/{CondOpSelect.vue_vue_type_script_setup_true_lang.js → CondOpSelect.vue.js} +3 -3
- package/dist/es/fields/{DisplayConds.vue_vue_type_script_setup_true_lang.js → DisplayConds.vue.js} +2 -2
- package/dist/es/fields/{EventSelect.vue_vue_type_script_setup_true_lang.js → EventSelect.vue.js} +2 -2
- package/dist/es/fields/StyleSetter/components/{BackgroundPosition.vue_vue_type_script_setup_true_lang.js → BackgroundPosition.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/components/{Border.vue_vue_type_script_setup_true_lang.js → Border.vue.js} +2 -2
- package/dist/es/fields/StyleSetter/components/{Box.vue_vue_type_script_setup_true_lang.js → Box.vue.js} +0 -0
- package/dist/es/fields/StyleSetter/icons/align-items/{Baseline.js → Baseline.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/align-items/{Center.js → Center.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/align-items/{End.js → End.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/align-items/{FlexEnd.js → FlexEnd.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/align-items/{FlexStart.js → FlexStart.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/align-items/{Normal.js → Normal.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/align-items/{SpaceAround.js → SpaceAround.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/align-items/{SpaceBetween.js → SpaceBetween.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/align-items/{Start.js → Start.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/align-items/{Stretch.js → Stretch.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/background-repeat/{NoRepeat.js → NoRepeat.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/background-repeat/{Repeat.js → Repeat.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/background-repeat/{RepeatX.js → RepeatX.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/background-repeat/{RepeatY.js → RepeatY.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/background-repeat/{Round.js → Round.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/background-repeat/{Space.js → Space.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/display/{Block.js → Block.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/display/{Flex.js → Flex.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/display/{Grid.js → Grid.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/display/{Inline.js → Inline.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/display/{InlineBlock.js → InlineBlock.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/display/{InlineFlex.js → InlineFlex.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/display/{InlineGrid.js → InlineGrid.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/display/{None.js → None.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/flex-direction/{Column.js → Column.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/flex-direction/{ColumnReverse.js → ColumnReverse.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/flex-direction/{Row.js → Row.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/flex-direction/{RowReverse.js → RowReverse.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/justify-content/{Center.js → Center.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/justify-content/{FlexEnd.js → FlexEnd.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/justify-content/{FlexStart.js → FlexStart.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/justify-content/{SpaceAround.js → SpaceAround.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/justify-content/{SpaceBetween.js → SpaceBetween.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/justify-content/{SpaceEvenly.js → SpaceEvenly.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/text-align/{Center.js → Center.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/text-align/{End.js → End.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/text-align/{Justify.js → Justify.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/text-align/{Left.js → Left.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/text-align/{MatchParent.js → MatchParent.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/text-align/{Right.js → Right.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/text-align/{Start.js → Start.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/pro/{Background.vue_vue_type_script_setup_true_lang.js → Background.vue.js} +2 -2
- package/dist/es/fields/StyleSetter/pro/{Font.vue_vue_type_script_setup_true_lang.js → Font.vue.js} +2 -2
- package/dist/es/fields/StyleSetter/pro/{Position.vue_vue_type_script_setup_true_lang.js → Position.vue.js} +2 -2
- package/dist/es/fields/StyleSetter/pro/{Transform.vue_vue_type_script_setup_true_lang.js → Transform.vue.js} +2 -2
- package/dist/es/fields/{UISelect.vue_vue_type_script_setup_true_lang.js → UISelect.vue.js} +5 -5
- package/dist/es/icons/{CenterIcon.vue_vue_type_script_setup_true_lang.js → CenterIcon.vue.js} +0 -0
- package/dist/es/icons/{CodeIcon.vue_vue_type_script_setup_true_lang.js → CodeIcon.vue.js} +0 -0
- package/dist/es/icons/{DatasourceIcon.js → DatasourceIcon.vue.js} +1 -1
- package/dist/es/icons/{FolderMinusIcon.vue_vue_type_script_setup_true_lang.js → FolderMinusIcon.vue.js} +0 -0
- package/dist/es/layouts/history-list/{GroupRow.vue_vue_type_script_setup_true_lang.js → GroupRow.vue.js} +1 -1
- package/dist/es/layouts/sidebar/layer/{LayerNodeTool.vue_vue_type_script_setup_true_lang.js → LayerNodeTool.vue.js} +2 -2
- package/dist/es/layouts/workspace/{Breadcrumb.vue_vue_type_script_setup_true_lang.js → Breadcrumb.vue.js} +2 -2
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { cloneDeep, get } from "lodash-es";
|
|
2
|
+
import { Target, Watcher } from "@tmagic/core";
|
|
3
|
+
import { getValueByKeyPath, guid, setValueByKeyPath, toLine } from "@tmagic/utils";
|
|
1
4
|
import { getFormConfig, getFormValue } from "../../utils/data-source/index.js";
|
|
2
5
|
import { COPY_DS_STORAGE_KEY } from "../../utils/editor.js";
|
|
3
6
|
import { createStackStep, describeRevertStep, getLastPushedHistoryIds } from "../../utils/history.js";
|
|
4
7
|
import BaseService from "./BaseService.js";
|
|
5
8
|
import { Protocol } from "./WebStorage.js";
|
|
6
|
-
import { getValueByKeyPath, guid, setValueByKeyPath, toLine } from "@tmagic/utils";
|
|
7
|
-
import { Target, Watcher } from "@tmagic/core";
|
|
8
|
-
import { cloneDeep as cloneDeep$1, get } from "lodash-es";
|
|
9
9
|
// packages/editor/src/sdk/services/DataSource.ts
|
|
10
10
|
var canUsePluginMethods = {
|
|
11
11
|
async: [],
|
|
@@ -119,11 +119,11 @@ var DataSource = class extends BaseService {
|
|
|
119
119
|
const dataSources = this.get("dataSources");
|
|
120
120
|
const index = dataSources.findIndex((ds) => ds.id === config.id);
|
|
121
121
|
const oldConfig = dataSources[index];
|
|
122
|
-
const newConfig = cloneDeep
|
|
122
|
+
const newConfig = cloneDeep(config);
|
|
123
123
|
dataSources[index] = newConfig;
|
|
124
124
|
if (!doNotPushHistory) {
|
|
125
125
|
const step = createStackStep(newConfig.id, {
|
|
126
|
-
oldValue: oldConfig ? cloneDeep
|
|
126
|
+
oldValue: oldConfig ? cloneDeep(oldConfig) : null,
|
|
127
127
|
newValue: newConfig,
|
|
128
128
|
changeRecords,
|
|
129
129
|
historyDescription,
|
|
@@ -152,7 +152,7 @@ var DataSource = class extends BaseService {
|
|
|
152
152
|
dataSources.splice(index, 1);
|
|
153
153
|
if (oldConfig && !doNotPushHistory) {
|
|
154
154
|
const step = createStackStep(id, {
|
|
155
|
-
oldValue: cloneDeep
|
|
155
|
+
oldValue: cloneDeep(oldConfig),
|
|
156
156
|
newValue: null,
|
|
157
157
|
historyDescription,
|
|
158
158
|
source: historySource
|
|
@@ -349,7 +349,7 @@ var DataSource = class extends BaseService {
|
|
|
349
349
|
return this.ctx.history.getStepList("dataSource", id).slice(-1)[0]?.step ?? null;
|
|
350
350
|
}
|
|
351
351
|
if (oldSchema && !newSchema) {
|
|
352
|
-
this.add(cloneDeep
|
|
352
|
+
this.add(cloneDeep(oldSchema), {
|
|
353
353
|
historyDescription,
|
|
354
354
|
historySource: "rollback"
|
|
355
355
|
});
|
|
@@ -359,24 +359,24 @@ var DataSource = class extends BaseService {
|
|
|
359
359
|
if (changeRecords?.length) {
|
|
360
360
|
const current = this.getDataSourceById(`${id}`);
|
|
361
361
|
if (!current) return null;
|
|
362
|
-
const patched = cloneDeep
|
|
362
|
+
const patched = cloneDeep(current);
|
|
363
363
|
let fallbackToFullReplace = false;
|
|
364
364
|
for (const record of changeRecords) {
|
|
365
365
|
if (!record.propPath) {
|
|
366
366
|
fallbackToFullReplace = true;
|
|
367
367
|
break;
|
|
368
368
|
}
|
|
369
|
-
const value = cloneDeep
|
|
369
|
+
const value = cloneDeep(getValueByKeyPath(record.propPath, oldSchema));
|
|
370
370
|
setValueByKeyPath(record.propPath, value, patched);
|
|
371
371
|
}
|
|
372
|
-
this.update(fallbackToFullReplace ? cloneDeep
|
|
372
|
+
this.update(fallbackToFullReplace ? cloneDeep(oldSchema) : patched, {
|
|
373
373
|
changeRecords,
|
|
374
374
|
historyDescription,
|
|
375
375
|
historySource: "rollback"
|
|
376
376
|
});
|
|
377
377
|
return this.ctx.history.getStepList("dataSource", id).slice(-1)[0]?.step ?? null;
|
|
378
378
|
}
|
|
379
|
-
this.update(cloneDeep
|
|
379
|
+
this.update(cloneDeep(oldSchema), {
|
|
380
380
|
historyDescription,
|
|
381
381
|
historySource: "rollback"
|
|
382
382
|
});
|
|
@@ -401,11 +401,11 @@ var DataSource = class extends BaseService {
|
|
|
401
401
|
const { oldSchema, newSchema, changeRecords } = step.diff?.[0] ?? {};
|
|
402
402
|
if (!oldSchema && newSchema) {
|
|
403
403
|
if (reverse) this.remove(`${id}`, { doNotPushHistory: true });
|
|
404
|
-
else this.add(cloneDeep
|
|
404
|
+
else this.add(cloneDeep(newSchema), { doNotPushHistory: true });
|
|
405
405
|
return;
|
|
406
406
|
}
|
|
407
407
|
if (oldSchema && !newSchema) {
|
|
408
|
-
if (reverse) this.add(cloneDeep
|
|
408
|
+
if (reverse) this.add(cloneDeep(oldSchema), { doNotPushHistory: true });
|
|
409
409
|
else this.remove(`${id}`, { doNotPushHistory: true });
|
|
410
410
|
return;
|
|
411
411
|
}
|
|
@@ -414,23 +414,23 @@ var DataSource = class extends BaseService {
|
|
|
414
414
|
if (changeRecords?.length) {
|
|
415
415
|
const current = this.getDataSourceById(`${id}`);
|
|
416
416
|
if (!current) return;
|
|
417
|
-
const patched = cloneDeep
|
|
417
|
+
const patched = cloneDeep(current);
|
|
418
418
|
let fallbackToFullReplace = false;
|
|
419
419
|
for (const record of changeRecords) {
|
|
420
420
|
if (!record.propPath) {
|
|
421
421
|
fallbackToFullReplace = true;
|
|
422
422
|
break;
|
|
423
423
|
}
|
|
424
|
-
const value = cloneDeep
|
|
424
|
+
const value = cloneDeep(getValueByKeyPath(record.propPath, sourceForValues));
|
|
425
425
|
setValueByKeyPath(record.propPath, value, patched);
|
|
426
426
|
}
|
|
427
|
-
this.update(fallbackToFullReplace ? cloneDeep
|
|
427
|
+
this.update(fallbackToFullReplace ? cloneDeep(sourceForValues) : patched, {
|
|
428
428
|
changeRecords,
|
|
429
429
|
doNotPushHistory: true
|
|
430
430
|
});
|
|
431
431
|
return;
|
|
432
432
|
}
|
|
433
|
-
this.update(cloneDeep
|
|
433
|
+
this.update(cloneDeep(sourceForValues), { doNotPushHistory: true });
|
|
434
434
|
}
|
|
435
435
|
};
|
|
436
436
|
export { DataSource as default };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { throttle } from "lodash-es";
|
|
2
|
+
import { DepTargetType, Watcher, traverseTarget } from "@tmagic/core";
|
|
3
|
+
import { isPage } from "@tmagic/utils";
|
|
1
4
|
import { IdleTask } from "../../utils/dep/idle-task.js";
|
|
2
5
|
import BaseService from "./BaseService.js";
|
|
3
|
-
import { isPage } from "@tmagic/utils";
|
|
4
|
-
import { DepTargetType, Watcher, traverseTarget } from "@tmagic/core";
|
|
5
|
-
import { throttle } from "lodash-es";
|
|
6
6
|
// packages/editor/src/sdk/services/Dep.ts
|
|
7
7
|
/** Node 下没有 worker 时使用:始终不可用,依赖收集退回主线程空闲队列 */
|
|
8
8
|
var noopCollectWorker = {
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { cloneDeep, isEmpty, isEqual, isObject, mergeWith, uniq } from "lodash-es";
|
|
2
|
+
import { NodeType } from "@tmagic/core";
|
|
3
|
+
import { getNodeInfo, getNodePath, getValueByKeyPath, guid, isPage, isPageFragment, isPageOrFragment, setValueByKeyPath, traverseNode } from "@tmagic/utils";
|
|
1
4
|
import { Layout, canUsePluginMethods } from "../../type.js";
|
|
2
5
|
import { COPY_STORAGE_KEY, calcAlignCenterStyle, calcLayerTargetIndex, calcMoveStyle, classifyDragSources, collectRelatedNodes, describeStepForRevert, editorNodeMergeCustomizer, fixNodePosition, getInitPositionStyle, getNodeIndex, getPageFragmentList, getPageList, moveItemsInContainer, resolveSelectedNode, setChildrenLayout, setLayout, toggleFixedPosition } from "../../utils/editor.js";
|
|
3
6
|
import { getLastPushedHistoryIds } from "../../utils/history.js";
|
|
@@ -5,10 +8,15 @@ import { beforePaste, getAddParent } from "../utils/operator.js";
|
|
|
5
8
|
import { isFixed } from "../utils/position.js";
|
|
6
9
|
import BaseService from "./BaseService.js";
|
|
7
10
|
import { Protocol } from "./WebStorage.js";
|
|
8
|
-
import { getNodeInfo, getNodePath, getValueByKeyPath, guid, isPage, isPageFragment, isPageOrFragment, setValueByKeyPath, traverseNode } from "@tmagic/utils";
|
|
9
|
-
import { NodeType } from "@tmagic/core";
|
|
10
|
-
import { cloneDeep as cloneDeep$1, isEmpty, isEqual, isObject, mergeWith, uniq } from "lodash-es";
|
|
11
11
|
// packages/editor/src/sdk/services/Editor.ts
|
|
12
|
+
/**
|
|
13
|
+
* 撤销 / 重做回放的内部标记键:不导出,也不出现在公开的 {@link HistoryOpOptions} 里。
|
|
14
|
+
* 回放链路用它把 `isHistoryOp` 带进 `change` 事件;外部调用方即使传同名字符串字段也不会被读取,
|
|
15
|
+
* 避免一次真实编辑被误标成历史回放,从而绕过业务侧的加锁 / 埋点 / 自动保存。
|
|
16
|
+
*/
|
|
17
|
+
var HISTORY_OP = Symbol("isHistoryOp");
|
|
18
|
+
/** 读取仅供编辑器内部使用的回放标记。 */
|
|
19
|
+
var isReplay = (options) => options[HISTORY_OP] === true;
|
|
12
20
|
/** 把插入下标收敛到 [0, length]:非整数取整,非法 / 越界(含未记录)一律追加到末尾 */
|
|
13
21
|
var clampIndex = (index, length) => {
|
|
14
22
|
const normalized = typeof index === "number" ? Math.trunc(index) : length;
|
|
@@ -293,20 +301,22 @@ var Editor = class extends BaseService {
|
|
|
293
301
|
const layout = await this.getLayout(this.toRaw(parent), node);
|
|
294
302
|
node.style = getInitPositionStyle(node.style, layout);
|
|
295
303
|
await stage?.add({
|
|
296
|
-
config: cloneDeep
|
|
297
|
-
parent: cloneDeep
|
|
304
|
+
config: cloneDeep(node),
|
|
305
|
+
parent: cloneDeep(parent),
|
|
298
306
|
parentId: parent.id,
|
|
299
|
-
root: cloneDeep
|
|
307
|
+
root: cloneDeep(root),
|
|
300
308
|
index: insertIndex
|
|
301
309
|
});
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
node.style
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
+
if (!options.doNotFixPosition) {
|
|
311
|
+
const newStyle = fixNodePosition(node, parent, stage);
|
|
312
|
+
if (newStyle && (newStyle.top !== node.style.top || newStyle.left !== node.style.left)) {
|
|
313
|
+
node.style = newStyle;
|
|
314
|
+
await stage?.update({
|
|
315
|
+
config: cloneDeep(node),
|
|
316
|
+
parentId: parent.id,
|
|
317
|
+
root: cloneDeep(root)
|
|
318
|
+
});
|
|
319
|
+
}
|
|
310
320
|
}
|
|
311
321
|
this.addModifiedNodeId(node.id);
|
|
312
322
|
return node;
|
|
@@ -321,6 +331,7 @@ var Editor = class extends BaseService {
|
|
|
321
331
|
async add(addNode, parent, options = {}) {
|
|
322
332
|
this.captureSelectionBeforeOp();
|
|
323
333
|
const { doNotSelect = false, doNotSwitchPage = false, doNotPushHistory = false, historyDescription, historySource } = options;
|
|
334
|
+
const isHistoryOp = isReplay(options);
|
|
324
335
|
const stage = this.get("stage");
|
|
325
336
|
const addNodes = [];
|
|
326
337
|
if (!Array.isArray(addNode)) {
|
|
@@ -376,7 +387,7 @@ var Editor = class extends BaseService {
|
|
|
376
387
|
const p = this.getParentById(n.id, false);
|
|
377
388
|
const idx = p ? getNodeIndex(n.id, p) : -1;
|
|
378
389
|
return {
|
|
379
|
-
newSchema: cloneDeep
|
|
390
|
+
newSchema: cloneDeep(this.toRaw(n)),
|
|
380
391
|
parentId,
|
|
381
392
|
index: typeof idx === "number" ? idx : -1
|
|
382
393
|
};
|
|
@@ -398,7 +409,8 @@ var Editor = class extends BaseService {
|
|
|
398
409
|
page: this.getPageOfNode(node.id)
|
|
399
410
|
})),
|
|
400
411
|
historySource,
|
|
401
|
-
doNotPushHistory
|
|
412
|
+
doNotPushHistory,
|
|
413
|
+
isHistoryOp
|
|
402
414
|
});
|
|
403
415
|
const addedPages = newNodes.filter((node) => isPageOrFragment(node));
|
|
404
416
|
if (addedPages.length) this.ctx.history.notifyPageStructureChange({
|
|
@@ -428,7 +440,7 @@ var Editor = class extends BaseService {
|
|
|
428
440
|
const removeData = {
|
|
429
441
|
id: node.id,
|
|
430
442
|
parentId: parent.id,
|
|
431
|
-
root: cloneDeep
|
|
443
|
+
root: cloneDeep(root)
|
|
432
444
|
};
|
|
433
445
|
const rootItems = root.items || [];
|
|
434
446
|
const shouldReselect = isDeletingCurrentPage && !doNotSelect && !doNotSwitchPage;
|
|
@@ -469,6 +481,7 @@ var Editor = class extends BaseService {
|
|
|
469
481
|
*/
|
|
470
482
|
async remove(nodeOrNodeList, options = {}) {
|
|
471
483
|
const { doNotPushHistory = false, historyDescription, historySource } = options;
|
|
484
|
+
const isHistoryOp = isReplay(options);
|
|
472
485
|
this.captureSelectionBeforeOp();
|
|
473
486
|
const nodes = Array.isArray(nodeOrNodeList) ? nodeOrNodeList : [nodeOrNodeList];
|
|
474
487
|
const changeItems = nodes.map((node) => ({
|
|
@@ -486,7 +499,7 @@ var Editor = class extends BaseService {
|
|
|
486
499
|
};
|
|
487
500
|
const idx = getNodeIndex(curNode.id, parent);
|
|
488
501
|
removedItems.push({
|
|
489
|
-
oldSchema: cloneDeep
|
|
502
|
+
oldSchema: cloneDeep(this.toRaw(curNode)),
|
|
490
503
|
parentId: parent.id,
|
|
491
504
|
index: typeof idx === "number" ? idx : -1
|
|
492
505
|
});
|
|
@@ -508,7 +521,8 @@ var Editor = class extends BaseService {
|
|
|
508
521
|
type: "remove",
|
|
509
522
|
data: changeItems,
|
|
510
523
|
historySource,
|
|
511
|
-
doNotPushHistory
|
|
524
|
+
doNotPushHistory,
|
|
525
|
+
isHistoryOp
|
|
512
526
|
});
|
|
513
527
|
const removedPages = nodes.filter((node) => isPageOrFragment(node));
|
|
514
528
|
if (removedPages.length) this.ctx.history.notifyPageStructureChange({
|
|
@@ -523,8 +537,8 @@ var Editor = class extends BaseService {
|
|
|
523
537
|
const info = this.getNodeInfo(config.id, false);
|
|
524
538
|
if (!info.node) throw new Error(`获取不到id为${config.id}的节点`);
|
|
525
539
|
const node = this.toRaw(info.node);
|
|
526
|
-
let newConfig = replace ? cloneDeep
|
|
527
|
-
if (!replace) newConfig = mergeWith(cloneDeep
|
|
540
|
+
let newConfig = replace ? cloneDeep(this.toRaw(config)) : await toggleFixedPosition(this.toRaw(config), node, info.path, this.getLayout);
|
|
541
|
+
if (!replace) newConfig = mergeWith(cloneDeep(node), newConfig, editorNodeMergeCustomizer);
|
|
528
542
|
if (!newConfig.type) throw new Error("配置缺少type值");
|
|
529
543
|
if (newConfig.type === NodeType.ROOT) {
|
|
530
544
|
this.set("root", newConfig, { historySource });
|
|
@@ -572,6 +586,7 @@ var Editor = class extends BaseService {
|
|
|
572
586
|
async update(config, data = {}) {
|
|
573
587
|
this.captureSelectionBeforeOp();
|
|
574
588
|
const { doNotPushHistory = false, changeRecordList, changeRecords, historyDescription, historySource, invalidInfo } = data;
|
|
589
|
+
const isHistoryOp = isReplay(data);
|
|
575
590
|
const nodes = Array.isArray(config) ? config : [config];
|
|
576
591
|
const commitInvalid = await this.runGuard(() => this.ctx.validator.guardUpdate(nodes, { replace: data.replace }));
|
|
577
592
|
const updateData = await Promise.all(nodes.map((node, index) => {
|
|
@@ -589,9 +604,9 @@ var Editor = class extends BaseService {
|
|
|
589
604
|
const pageForOp = this.getNodeInfo(nodes[0].id, false).page;
|
|
590
605
|
this.pushOpHistory("update", {
|
|
591
606
|
diff: buildUpdateDiff(updateData.map((d) => ({
|
|
592
|
-
oldNode: cloneDeep
|
|
593
|
-
newNode: cloneDeep
|
|
594
|
-
changeRecords: d.changeRecords?.length ? cloneDeep
|
|
607
|
+
oldNode: cloneDeep(d.oldNode),
|
|
608
|
+
newNode: cloneDeep(d.newNode),
|
|
609
|
+
changeRecords: d.changeRecords?.length ? cloneDeep(d.changeRecords) : void 0
|
|
595
610
|
}))),
|
|
596
611
|
pageData: {
|
|
597
612
|
name: pageForOp?.name || "",
|
|
@@ -611,7 +626,8 @@ var Editor = class extends BaseService {
|
|
|
611
626
|
page: this.getPageOfNode(node.newNode.id)
|
|
612
627
|
})),
|
|
613
628
|
historySource,
|
|
614
|
-
doNotPushHistory
|
|
629
|
+
doNotPushHistory,
|
|
630
|
+
isHistoryOp
|
|
615
631
|
});
|
|
616
632
|
return Array.isArray(config) ? updateData.map((item) => item.newNode) : updateData[0].newNode;
|
|
617
633
|
}
|
|
@@ -631,7 +647,7 @@ var Editor = class extends BaseService {
|
|
|
631
647
|
if (!root) throw new Error("root为空");
|
|
632
648
|
const node = this.get("node");
|
|
633
649
|
if (!node) throw new Error("当前节点为空");
|
|
634
|
-
const parent = cloneDeep
|
|
650
|
+
const parent = cloneDeep(this.toRaw(this.get("parent")));
|
|
635
651
|
if (!parent) throw new Error("父节点为空");
|
|
636
652
|
const index2 = parent.items.findIndex((node) => `${node.id}` === `${id2}`);
|
|
637
653
|
if (index2 < 0) return;
|
|
@@ -643,9 +659,9 @@ var Editor = class extends BaseService {
|
|
|
643
659
|
});
|
|
644
660
|
if (!doNotSelect) await this.select(node);
|
|
645
661
|
this.get("stage")?.update({
|
|
646
|
-
config: cloneDeep
|
|
662
|
+
config: cloneDeep(node),
|
|
647
663
|
parentId: parent.id,
|
|
648
|
-
root: cloneDeep
|
|
664
|
+
root: cloneDeep(root)
|
|
649
665
|
});
|
|
650
666
|
}
|
|
651
667
|
/**
|
|
@@ -698,12 +714,12 @@ var Editor = class extends BaseService {
|
|
|
698
714
|
async doPaste(config, position = {}) {
|
|
699
715
|
this.ctx.props.clearRelateId();
|
|
700
716
|
const doc = this.get("stage")?.renderer?.contentWindow?.document;
|
|
701
|
-
return beforePaste(this.ctx, position, cloneDeep
|
|
717
|
+
return beforePaste(this.ctx, position, cloneDeep(config), doc);
|
|
702
718
|
}
|
|
703
719
|
async doAlignCenter(config) {
|
|
704
720
|
const parent = this.getParentById(config.id);
|
|
705
721
|
if (!parent) throw new Error("找不到父节点");
|
|
706
|
-
const node = cloneDeep
|
|
722
|
+
const node = cloneDeep(this.toRaw(config));
|
|
707
723
|
const layout = await this.getLayout(parent, node);
|
|
708
724
|
const doc = this.get("stage")?.renderer?.contentWindow?.document;
|
|
709
725
|
const newStyle = calcAlignCenterStyle(node, parent, layout, doc);
|
|
@@ -741,7 +757,9 @@ var Editor = class extends BaseService {
|
|
|
741
757
|
* @param options 可选配置
|
|
742
758
|
* @param options.doNotPushHistory 是否不写入历史记录(默认 false)
|
|
743
759
|
*/
|
|
744
|
-
async moveLayer(offset,
|
|
760
|
+
async moveLayer(offset, options = {}) {
|
|
761
|
+
const { doNotPushHistory = false, historyDescription, historySource } = options;
|
|
762
|
+
const isHistoryOp = isReplay(options);
|
|
745
763
|
this.captureSelectionBeforeOp();
|
|
746
764
|
const root = this.get("root");
|
|
747
765
|
if (!root) throw new Error("root为空");
|
|
@@ -754,14 +772,14 @@ var Editor = class extends BaseService {
|
|
|
754
772
|
const isRelative = await this.getLayout(parent, node) === Layout.RELATIVE;
|
|
755
773
|
const offsetIndex = calcLayerTargetIndex(index, offset, brothers.length, isRelative);
|
|
756
774
|
if (offsetIndex > 0 && offsetIndex > brothers.length || offsetIndex < 0) return;
|
|
757
|
-
const oldParent = cloneDeep
|
|
775
|
+
const oldParent = cloneDeep(this.toRaw(parent));
|
|
758
776
|
brothers.splice(index, 1);
|
|
759
777
|
brothers.splice(offsetIndex, 0, node);
|
|
760
778
|
const grandparent = this.getParentById(parent.id);
|
|
761
779
|
this.get("stage")?.update({
|
|
762
|
-
config: cloneDeep
|
|
780
|
+
config: cloneDeep(this.toRaw(parent)),
|
|
763
781
|
parentId: grandparent?.id,
|
|
764
|
-
root: cloneDeep
|
|
782
|
+
root: cloneDeep(root)
|
|
765
783
|
});
|
|
766
784
|
this.addModifiedNodeId(parent.id);
|
|
767
785
|
if (!doNotPushHistory) {
|
|
@@ -769,7 +787,7 @@ var Editor = class extends BaseService {
|
|
|
769
787
|
this.pushOpHistory("update", {
|
|
770
788
|
diff: buildUpdateDiff([{
|
|
771
789
|
oldNode: oldParent,
|
|
772
|
-
newNode: cloneDeep
|
|
790
|
+
newNode: cloneDeep(this.toRaw(parent))
|
|
773
791
|
}]),
|
|
774
792
|
pageData: {
|
|
775
793
|
name: pageForOp?.name || "",
|
|
@@ -788,7 +806,8 @@ var Editor = class extends BaseService {
|
|
|
788
806
|
}],
|
|
789
807
|
offset,
|
|
790
808
|
historySource,
|
|
791
|
-
doNotPushHistory
|
|
809
|
+
doNotPushHistory,
|
|
810
|
+
isHistoryOp
|
|
792
811
|
});
|
|
793
812
|
}
|
|
794
813
|
/**
|
|
@@ -829,8 +848,8 @@ var Editor = class extends BaseService {
|
|
|
829
848
|
}
|
|
830
849
|
if (moves.length === 0) throw new Error("没有可移动的节点");
|
|
831
850
|
const beforeSnapshots = /* @__PURE__ */ new Map();
|
|
832
|
-
beforeSnapshots.set(target.id, cloneDeep
|
|
833
|
-
for (const { parent } of moves) if (!beforeSnapshots.has(parent.id)) beforeSnapshots.set(parent.id, cloneDeep
|
|
851
|
+
beforeSnapshots.set(target.id, cloneDeep(this.toRaw(target)));
|
|
852
|
+
for (const { parent } of moves) if (!beforeSnapshots.has(parent.id)) beforeSnapshots.set(parent.id, cloneDeep(this.toRaw(parent)));
|
|
834
853
|
let newConfigs = [];
|
|
835
854
|
const moveNodes = moves.map(({ node }) => node);
|
|
836
855
|
await this.remove(moveNodes, {
|
|
@@ -846,7 +865,7 @@ var Editor = class extends BaseService {
|
|
|
846
865
|
if (!doNotPushHistory) {
|
|
847
866
|
const updatedItems = Array.from(beforeSnapshots.entries()).map(([id, oldNode]) => ({
|
|
848
867
|
oldNode,
|
|
849
|
-
newNode: cloneDeep
|
|
868
|
+
newNode: cloneDeep(this.toRaw(this.getNodeById(id, false)))
|
|
850
869
|
}));
|
|
851
870
|
const historyPage = moves[0].pageForOp ?? {
|
|
852
871
|
name: "",
|
|
@@ -861,7 +880,9 @@ var Editor = class extends BaseService {
|
|
|
861
880
|
} else this.selectionBeforeOp = null;
|
|
862
881
|
return isBatch ? newConfigs : newConfigs[0];
|
|
863
882
|
}
|
|
864
|
-
async dragTo(config, targetParent, targetIndex,
|
|
883
|
+
async dragTo(config, targetParent, targetIndex, options = {}) {
|
|
884
|
+
const { doNotPushHistory = false, historyDescription, historySource } = options;
|
|
885
|
+
const isHistoryOp = isReplay(options);
|
|
865
886
|
this.captureSelectionBeforeOp();
|
|
866
887
|
if (!targetParent || !Array.isArray(targetParent.items)) return;
|
|
867
888
|
const configs = Array.isArray(config) ? config : [config];
|
|
@@ -869,9 +890,9 @@ var Editor = class extends BaseService {
|
|
|
869
890
|
const beforeSnapshots = /* @__PURE__ */ new Map();
|
|
870
891
|
for (const cfg of configs) {
|
|
871
892
|
const { parent } = this.getNodeInfo(cfg.id, false);
|
|
872
|
-
if (parent && !beforeSnapshots.has(`${parent.id}`)) beforeSnapshots.set(`${parent.id}`, cloneDeep
|
|
893
|
+
if (parent && !beforeSnapshots.has(`${parent.id}`)) beforeSnapshots.set(`${parent.id}`, cloneDeep(this.toRaw(parent)));
|
|
873
894
|
}
|
|
874
|
-
if (!beforeSnapshots.has(`${targetParent.id}`)) beforeSnapshots.set(`${targetParent.id}`, cloneDeep
|
|
895
|
+
if (!beforeSnapshots.has(`${targetParent.id}`)) beforeSnapshots.set(`${targetParent.id}`, cloneDeep(this.toRaw(targetParent)));
|
|
875
896
|
const newLayout = await this.getLayout(targetParent);
|
|
876
897
|
const { sameParentIndices, crossParentConfigs, aborted } = classifyDragSources(configs, targetParent, (id, raw) => this.getNodeInfo(id, raw));
|
|
877
898
|
if (aborted) return;
|
|
@@ -890,16 +911,16 @@ var Editor = class extends BaseService {
|
|
|
890
911
|
const root = this.get("root");
|
|
891
912
|
const stage = this.get("stage");
|
|
892
913
|
if (stage && page && root) stage.update({
|
|
893
|
-
config: cloneDeep
|
|
914
|
+
config: cloneDeep(page),
|
|
894
915
|
parentId: root.id,
|
|
895
|
-
root: cloneDeep
|
|
916
|
+
root: cloneDeep(root)
|
|
896
917
|
});
|
|
897
918
|
const updatedItems = [];
|
|
898
919
|
for (const oldNode of beforeSnapshots.values()) {
|
|
899
920
|
const newNode = this.getNodeById(oldNode.id, false);
|
|
900
921
|
if (newNode) updatedItems.push({
|
|
901
922
|
oldNode,
|
|
902
|
-
newNode: cloneDeep
|
|
923
|
+
newNode: cloneDeep(this.toRaw(newNode))
|
|
903
924
|
});
|
|
904
925
|
}
|
|
905
926
|
if (!doNotPushHistory) {
|
|
@@ -928,7 +949,8 @@ var Editor = class extends BaseService {
|
|
|
928
949
|
targetIndex,
|
|
929
950
|
targetParent,
|
|
930
951
|
historySource,
|
|
931
|
-
doNotPushHistory
|
|
952
|
+
doNotPushHistory,
|
|
953
|
+
isHistoryOp
|
|
932
954
|
});
|
|
933
955
|
}
|
|
934
956
|
/**
|
|
@@ -1028,7 +1050,8 @@ var Editor = class extends BaseService {
|
|
|
1028
1050
|
* @returns 反向后产生的新 step;目标不存在 / 未应用 / 反向失败时返回 null
|
|
1029
1051
|
*/
|
|
1030
1052
|
async revertPageStep(index) {
|
|
1031
|
-
const
|
|
1053
|
+
const pageId = this.get("page")?.id;
|
|
1054
|
+
const entry = this.ctx.history.getStepList("page", pageId)[index];
|
|
1032
1055
|
if (!entry?.applied) return null;
|
|
1033
1056
|
const { step } = entry;
|
|
1034
1057
|
if (step.opType === "initial") return null;
|
|
@@ -1038,10 +1061,10 @@ var Editor = class extends BaseService {
|
|
|
1038
1061
|
if (!items.length || !items.every((item) => item.changeRecords?.length)) return null;
|
|
1039
1062
|
}
|
|
1040
1063
|
let revertedStep = null;
|
|
1041
|
-
const captureRevert = (
|
|
1042
|
-
revertedStep = s;
|
|
1064
|
+
const captureRevert = (s, type, id) => {
|
|
1065
|
+
if (type === "page" && id === pageId && !revertedStep) revertedStep = s;
|
|
1043
1066
|
};
|
|
1044
|
-
this.ctx.history.
|
|
1067
|
+
this.ctx.history.on("change", captureRevert);
|
|
1045
1068
|
const historyDescription = `回滚 #${index + 1}: ${describeStepForRevert(step)}`;
|
|
1046
1069
|
const opts = {
|
|
1047
1070
|
doNotSelect: true,
|
|
@@ -1063,7 +1086,7 @@ var Editor = class extends BaseService {
|
|
|
1063
1086
|
for (const { oldSchema, parentId } of sorted) {
|
|
1064
1087
|
if (!oldSchema || parentId === void 0) continue;
|
|
1065
1088
|
const parent = this.getNodeById(parentId, false);
|
|
1066
|
-
if (parent) await this.add([cloneDeep
|
|
1089
|
+
if (parent) await this.add([cloneDeep(oldSchema)], parent, opts);
|
|
1067
1090
|
}
|
|
1068
1091
|
break;
|
|
1069
1092
|
}
|
|
@@ -1077,13 +1100,13 @@ var Editor = class extends BaseService {
|
|
|
1077
1100
|
type: newNode.type
|
|
1078
1101
|
};
|
|
1079
1102
|
for (const record of changeRecords) {
|
|
1080
|
-
if (!record.propPath) return cloneDeep
|
|
1081
|
-
const value = cloneDeep
|
|
1103
|
+
if (!record.propPath) return cloneDeep(oldNode);
|
|
1104
|
+
const value = cloneDeep(getValueByKeyPath(record.propPath, oldNode));
|
|
1082
1105
|
setValueByKeyPath(record.propPath, value, patch);
|
|
1083
1106
|
}
|
|
1084
1107
|
return patch;
|
|
1085
1108
|
}
|
|
1086
|
-
return cloneDeep
|
|
1109
|
+
return cloneDeep(oldNode);
|
|
1087
1110
|
});
|
|
1088
1111
|
if (configs.length) await this.update(configs, {
|
|
1089
1112
|
historyDescription,
|
|
@@ -1323,20 +1346,20 @@ var Editor = class extends BaseService {
|
|
|
1323
1346
|
const prevPage = prevMap.get(`${nextPage.id}`);
|
|
1324
1347
|
if (!prevPage) {
|
|
1325
1348
|
this.pushPageDiffStep("add", nextPage, {
|
|
1326
|
-
newSchema: cloneDeep
|
|
1349
|
+
newSchema: cloneDeep(this.toRaw(nextPage)),
|
|
1327
1350
|
parentId: nextRoot.id,
|
|
1328
1351
|
index: indexInItems(nextRoot, nextPage.id)
|
|
1329
1352
|
}, source);
|
|
1330
1353
|
addedPages.push(nextPage);
|
|
1331
1354
|
} else if (!isEqual(this.toRaw(prevPage), this.toRaw(nextPage))) this.pushPageDiffStep("update", nextPage, {
|
|
1332
|
-
oldSchema: cloneDeep
|
|
1333
|
-
newSchema: cloneDeep
|
|
1355
|
+
oldSchema: cloneDeep(this.toRaw(prevPage)),
|
|
1356
|
+
newSchema: cloneDeep(this.toRaw(nextPage))
|
|
1334
1357
|
}, source);
|
|
1335
1358
|
});
|
|
1336
1359
|
prevPages.forEach((prevPage) => {
|
|
1337
1360
|
if (!nextMap.has(`${prevPage.id}`)) {
|
|
1338
1361
|
this.pushPageDiffStep("remove", prevPage, {
|
|
1339
|
-
oldSchema: cloneDeep
|
|
1362
|
+
oldSchema: cloneDeep(this.toRaw(prevPage)),
|
|
1340
1363
|
parentId: preRoot.id,
|
|
1341
1364
|
index: indexInItems(preRoot, prevPage.id)
|
|
1342
1365
|
}, source);
|
|
@@ -1351,9 +1374,11 @@ var Editor = class extends BaseService {
|
|
|
1351
1374
|
/**
|
|
1352
1375
|
* 构造一条页面级「set root」历史记录(不携带选区 / modifiedNodeIds 上下文)并落到该页面自己的栈。
|
|
1353
1376
|
*
|
|
1354
|
-
* 连续 set root
|
|
1355
|
-
*
|
|
1356
|
-
*
|
|
1377
|
+
* 连续 set root 替换:若该页栈最新一条已是**同来源、同为整页 update**的 set root 记录
|
|
1378
|
+
* ({@link StepValue.rootStep} 且 `source` 相同),则用本次记录**替换**它而非新增,避免源码反复保存时堆积记录。
|
|
1379
|
+
* 替换时必须把 `oldSchema` 追溯到最早那一跳,并沿用原 uuid:否则只剩「上一版 → 本版」,
|
|
1380
|
+
* 撤销到基线时 DSL 会停在中途版本且无法继续回退,已发出的 historyId 也会失效。
|
|
1381
|
+
* 其余情况(来源不同 / 页面增删)照常新增,保留完整变更链条。
|
|
1357
1382
|
*/
|
|
1358
1383
|
pushPageDiffStep(opType, page, diffItem, source) {
|
|
1359
1384
|
const step = {
|
|
@@ -1373,8 +1398,19 @@ var Editor = class extends BaseService {
|
|
|
1373
1398
|
};
|
|
1374
1399
|
if (source) step.source = source;
|
|
1375
1400
|
const top = this.ctx.history.getCurrentPageStep(page.id);
|
|
1376
|
-
|
|
1377
|
-
|
|
1401
|
+
const earliestOldSchema = top?.diff?.[0]?.oldSchema;
|
|
1402
|
+
if (top?.rootStep && top.source === source && opType === "update" && top.opType === "update" && earliestOldSchema) {
|
|
1403
|
+
this.ctx.history.replaceCurrentStep("page", {
|
|
1404
|
+
...step,
|
|
1405
|
+
uuid: top.uuid,
|
|
1406
|
+
diff: [{
|
|
1407
|
+
...diffItem,
|
|
1408
|
+
oldSchema: earliestOldSchema
|
|
1409
|
+
}]
|
|
1410
|
+
}, page.id);
|
|
1411
|
+
return;
|
|
1412
|
+
}
|
|
1413
|
+
this.ctx.history.push("page", step, page.id);
|
|
1378
1414
|
}
|
|
1379
1415
|
pushOpHistory(opType, { diff, pageData, historyDescription, source }) {
|
|
1380
1416
|
const step = {
|
|
@@ -1406,8 +1442,8 @@ var Editor = class extends BaseService {
|
|
|
1406
1442
|
* 「重新插回节点」(撤销 remove / 重做 add)需按 step 记录的 parentId / index 精确还原,
|
|
1407
1443
|
* 不走 this.add,由手工 splice + stage.add 完成后补发等价的 add / change 事件(见 emitHistoryInsertEvents)。
|
|
1408
1444
|
*
|
|
1409
|
-
* 注意:这些路径都会发出 add / remove / update / change
|
|
1410
|
-
*
|
|
1445
|
+
* 注意:这些路径都会发出 add / remove / update / change 事件,且 `change` 事件带 `isHistoryOp: true`,
|
|
1446
|
+
* 业务侧可据此跳过仅针对「用户主动编辑」的副作用(加锁 / 埋点 / 自动保存等)。
|
|
1411
1447
|
*
|
|
1412
1448
|
* @param step 操作记录
|
|
1413
1449
|
* @param reverse true = 撤销,false = 重做
|
|
@@ -1421,6 +1457,7 @@ var Editor = class extends BaseService {
|
|
|
1421
1457
|
doNotSelect: true,
|
|
1422
1458
|
doNotSwitchPage: true,
|
|
1423
1459
|
doNotPushHistory: true,
|
|
1460
|
+
[HISTORY_OP]: true,
|
|
1424
1461
|
historySource: step.source
|
|
1425
1462
|
};
|
|
1426
1463
|
switch (step.opType) {
|
|
@@ -1438,15 +1475,15 @@ var Editor = class extends BaseService {
|
|
|
1438
1475
|
if (!newSchema || parentId === void 0) continue;
|
|
1439
1476
|
const parent = this.getNodeById(parentId, false);
|
|
1440
1477
|
if (parent?.items) {
|
|
1441
|
-
const addedNode = cloneDeep
|
|
1478
|
+
const addedNode = cloneDeep(newSchema);
|
|
1442
1479
|
const insertIndex = clampIndex(index, parent.items.length);
|
|
1443
1480
|
parent.items.splice(insertIndex, 0, addedNode);
|
|
1444
1481
|
addedNodes.push(addedNode);
|
|
1445
1482
|
await stage?.add({
|
|
1446
|
-
config: cloneDeep
|
|
1447
|
-
parent: cloneDeep
|
|
1483
|
+
config: cloneDeep(newSchema),
|
|
1484
|
+
parent: cloneDeep(parent),
|
|
1448
1485
|
parentId: parent.id,
|
|
1449
|
-
root: cloneDeep
|
|
1486
|
+
root: cloneDeep(root),
|
|
1450
1487
|
index: insertIndex
|
|
1451
1488
|
});
|
|
1452
1489
|
}
|
|
@@ -1464,15 +1501,15 @@ var Editor = class extends BaseService {
|
|
|
1464
1501
|
if (!oldSchema || parentId === void 0) continue;
|
|
1465
1502
|
const parent = this.getNodeById(parentId, false);
|
|
1466
1503
|
if (parent?.items) {
|
|
1467
|
-
const addedNode = cloneDeep
|
|
1504
|
+
const addedNode = cloneDeep(oldSchema);
|
|
1468
1505
|
const insertIndex = clampIndex(index, parent.items.length);
|
|
1469
1506
|
parent.items.splice(insertIndex, 0, addedNode);
|
|
1470
1507
|
addedNodes.push(addedNode);
|
|
1471
1508
|
await stage?.add({
|
|
1472
|
-
config: cloneDeep
|
|
1473
|
-
parent: cloneDeep
|
|
1509
|
+
config: cloneDeep(oldSchema),
|
|
1510
|
+
parent: cloneDeep(parent),
|
|
1474
1511
|
parentId,
|
|
1475
|
-
root: cloneDeep
|
|
1512
|
+
root: cloneDeep(root),
|
|
1476
1513
|
index: insertIndex
|
|
1477
1514
|
});
|
|
1478
1515
|
}
|
|
@@ -1496,18 +1533,15 @@ var Editor = class extends BaseService {
|
|
|
1496
1533
|
type: newNode.type
|
|
1497
1534
|
};
|
|
1498
1535
|
for (const record of changeRecords) {
|
|
1499
|
-
if (!record.propPath) return cloneDeep
|
|
1500
|
-
const value = cloneDeep
|
|
1536
|
+
if (!record.propPath) return cloneDeep(sourceForValues);
|
|
1537
|
+
const value = cloneDeep(getValueByKeyPath(record.propPath, sourceForValues));
|
|
1501
1538
|
setValueByKeyPath(record.propPath, value, patch);
|
|
1502
1539
|
}
|
|
1503
1540
|
return patch;
|
|
1504
1541
|
}
|
|
1505
|
-
return cloneDeep
|
|
1506
|
-
});
|
|
1507
|
-
if (configs.length) await this.update(configs, {
|
|
1508
|
-
doNotPushHistory: true,
|
|
1509
|
-
historySource: step.source
|
|
1542
|
+
return cloneDeep(reverse ? oldNode : newNode);
|
|
1510
1543
|
});
|
|
1544
|
+
if (configs.length) await this.update(configs, commonOpts);
|
|
1511
1545
|
break;
|
|
1512
1546
|
}
|
|
1513
1547
|
}
|
|
@@ -1545,7 +1579,8 @@ var Editor = class extends BaseService {
|
|
|
1545
1579
|
page: this.getPageOfNode(node.id)
|
|
1546
1580
|
})),
|
|
1547
1581
|
historySource: source,
|
|
1548
|
-
doNotPushHistory: true
|
|
1582
|
+
doNotPushHistory: true,
|
|
1583
|
+
isHistoryOp: true
|
|
1549
1584
|
});
|
|
1550
1585
|
}
|
|
1551
1586
|
/** 经由 reactivity 注入的 toRaw(默认是 Vue 的 toRaw) */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import BaseService from "./BaseService.js";
|
|
2
|
-
import { toLine } from "@tmagic/utils";
|
|
3
1
|
import { cloneDeep } from "lodash-es";
|
|
2
|
+
import { toLine } from "@tmagic/utils";
|
|
3
|
+
import BaseService from "./BaseService.js";
|
|
4
4
|
// packages/editor/src/sdk/services/Events.ts
|
|
5
5
|
var canUsePluginMethods = {
|
|
6
6
|
async: [],
|