@tmagic/editor 1.8.4-beta.1 → 1.8.5
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.js +1 -2
- package/dist/es/Editor.vue_vue_type_script_setup_true_lang.js +5 -6
- package/dist/es/_virtual/_plugin-vue_export-helper.js +1 -2
- package/dist/es/components/CodeBlockEditor.js +1 -2
- package/dist/es/components/CodeBlockEditor.vue_vue_type_script_setup_true_lang.js +6 -7
- package/dist/es/components/CodeParams.js +1 -2
- package/dist/es/components/CodeParams.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/es/components/CompareForm.js +1 -2
- package/dist/es/components/CompareForm.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/es/components/ContentMenu.js +1 -2
- package/dist/es/components/ContentMenu.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/es/components/FloatingBox.js +1 -2
- package/dist/es/components/FloatingBox.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/es/components/Icon.js +1 -2
- package/dist/es/components/Icon.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/es/components/Resizer.js +1 -2
- package/dist/es/components/Resizer.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/es/components/ScrollBar.js +1 -2
- package/dist/es/components/ScrollBar.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/es/components/ScrollViewer.js +1 -2
- package/dist/es/components/ScrollViewer.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/es/components/SearchInput.js +1 -2
- package/dist/es/components/SearchInput.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/es/components/SplitView.js +1 -2
- package/dist/es/components/SplitView.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/es/components/ToolButton.js +1 -2
- package/dist/es/components/ToolButton.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/es/components/Tree.js +1 -2
- package/dist/es/components/Tree.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/es/components/TreeNode.js +1 -2
- package/dist/es/components/TreeNode.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/es/components/ViewForm.js +1 -2
- package/dist/es/components/ViewForm.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/es/editorProps.js +1 -2
- package/dist/es/fields/Code.js +1 -2
- package/dist/es/fields/Code.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/es/fields/CodeLink.js +1 -2
- package/dist/es/fields/CodeLink.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/es/fields/CodeSelect.js +1 -2
- package/dist/es/fields/CodeSelect.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/es/fields/CodeSelectCol.js +1 -2
- package/dist/es/fields/CodeSelectCol.vue_vue_type_script_setup_true_lang.js +14 -12
- package/dist/es/fields/CondOpSelect.js +1 -2
- package/dist/es/fields/CondOpSelect.vue_vue_type_script_setup_true_lang.js +3 -4
- package/dist/es/fields/DataSourceFieldSelect/FieldSelect.js +1 -2
- package/dist/es/fields/DataSourceFieldSelect/FieldSelect.vue_vue_type_script_setup_true_lang.js +3 -4
- package/dist/es/fields/DataSourceFieldSelect/Index.js +1 -2
- package/dist/es/fields/DataSourceFieldSelect/Index.vue_vue_type_script_setup_true_lang.js +3 -4
- package/dist/es/fields/DataSourceFields.js +1 -2
- package/dist/es/fields/DataSourceFields.vue_vue_type_script_setup_true_lang.js +4 -5
- package/dist/es/fields/DataSourceInput.js +1 -2
- package/dist/es/fields/DataSourceInput.vue_vue_type_script_setup_true_lang.js +3 -4
- package/dist/es/fields/DataSourceMethodSelect.js +1 -2
- package/dist/es/fields/DataSourceMethodSelect.vue_vue_type_script_setup_true_name_true_lang.js +17 -10
- package/dist/es/fields/DataSourceMethods.js +1 -2
- package/dist/es/fields/DataSourceMethods.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/es/fields/DataSourceMocks.js +1 -2
- package/dist/es/fields/DataSourceMocks.vue_vue_type_script_setup_true_lang.js +4 -5
- package/dist/es/fields/DataSourceSelect.js +1 -2
- package/dist/es/fields/DataSourceSelect.vue_vue_type_script_setup_true_lang.js +3 -4
- package/dist/es/fields/DisplayConds.js +1 -2
- package/dist/es/fields/DisplayConds.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/es/fields/EventSelect.js +1 -2
- package/dist/es/fields/EventSelect.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/es/fields/KeyValue.js +1 -2
- package/dist/es/fields/KeyValue.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/es/fields/PageFragmentSelect.js +1 -2
- package/dist/es/fields/PageFragmentSelect.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/es/fields/StyleSetter/Index.js +1 -2
- package/dist/es/fields/StyleSetter/Index.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/es/fields/StyleSetter/components/BackgroundPosition.js +1 -2
- package/dist/es/fields/StyleSetter/components/BackgroundPosition.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/es/fields/StyleSetter/components/Border.js +1 -2
- package/dist/es/fields/StyleSetter/components/Border.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/es/fields/StyleSetter/components/Box.js +1 -2
- package/dist/es/fields/StyleSetter/components/Box.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/es/fields/StyleSetter/configs.js +113 -15
- package/dist/es/fields/StyleSetter/icons/align-items/Baseline.js +45 -0
- package/dist/es/fields/StyleSetter/icons/align-items/Center.js +1 -2
- package/dist/es/fields/StyleSetter/icons/align-items/End.js +42 -0
- package/dist/es/fields/StyleSetter/icons/align-items/FlexEnd.js +1 -2
- package/dist/es/fields/StyleSetter/icons/align-items/FlexStart.js +1 -2
- package/dist/es/fields/StyleSetter/icons/align-items/Normal.js +33 -0
- package/dist/es/fields/StyleSetter/icons/align-items/SpaceAround.js +1 -2
- package/dist/es/fields/StyleSetter/icons/align-items/SpaceBetween.js +1 -2
- package/dist/es/fields/StyleSetter/icons/align-items/Start.js +42 -0
- package/dist/es/fields/StyleSetter/icons/align-items/Stretch.js +37 -0
- package/dist/es/fields/StyleSetter/icons/background-repeat/NoRepeat.js +1 -2
- package/dist/es/fields/StyleSetter/icons/background-repeat/Repeat.js +1 -2
- package/dist/es/fields/StyleSetter/icons/background-repeat/RepeatX.js +1 -2
- package/dist/es/fields/StyleSetter/icons/background-repeat/RepeatY.js +1 -2
- package/dist/es/fields/StyleSetter/icons/background-repeat/Round.js +45 -0
- package/dist/es/fields/StyleSetter/icons/background-repeat/Space.js +16 -0
- package/dist/es/fields/StyleSetter/icons/display/Block.js +1 -2
- package/dist/es/fields/StyleSetter/icons/display/Flex.js +1 -2
- package/dist/es/fields/StyleSetter/icons/display/Grid.js +13 -0
- package/dist/es/fields/StyleSetter/icons/display/Inline.js +1 -2
- package/dist/es/fields/StyleSetter/icons/display/InlineBlock.js +1 -2
- package/dist/es/fields/StyleSetter/icons/display/InlineFlex.js +13 -0
- package/dist/es/fields/StyleSetter/icons/display/InlineGrid.js +13 -0
- package/dist/es/fields/StyleSetter/icons/display/None.js +1 -2
- package/dist/es/fields/StyleSetter/icons/flex-direction/Column.js +1 -2
- package/dist/es/fields/StyleSetter/icons/flex-direction/ColumnReverse.js +1 -2
- package/dist/es/fields/StyleSetter/icons/flex-direction/Row.js +1 -2
- package/dist/es/fields/StyleSetter/icons/flex-direction/RowReverse.js +1 -2
- package/dist/es/fields/StyleSetter/icons/justify-content/Center.js +1 -2
- package/dist/es/fields/StyleSetter/icons/justify-content/FlexEnd.js +1 -2
- package/dist/es/fields/StyleSetter/icons/justify-content/FlexStart.js +1 -2
- package/dist/es/fields/StyleSetter/icons/justify-content/SpaceAround.js +1 -2
- package/dist/es/fields/StyleSetter/icons/justify-content/SpaceBetween.js +1 -2
- package/dist/es/fields/StyleSetter/icons/justify-content/SpaceEvenly.js +16 -0
- package/dist/es/fields/StyleSetter/icons/text-align/Center.js +1 -2
- package/dist/es/fields/StyleSetter/icons/text-align/End.js +13 -0
- package/dist/es/fields/StyleSetter/icons/text-align/Justify.js +13 -0
- package/dist/es/fields/StyleSetter/icons/text-align/Left.js +1 -2
- package/dist/es/fields/StyleSetter/icons/text-align/MatchParent.js +13 -0
- package/dist/es/fields/StyleSetter/icons/text-align/Right.js +1 -2
- package/dist/es/fields/StyleSetter/icons/text-align/Start.js +13 -0
- package/dist/es/fields/StyleSetter/pro/Background.js +1 -2
- package/dist/es/fields/StyleSetter/pro/Background.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/es/fields/StyleSetter/pro/Border.js +1 -2
- package/dist/es/fields/StyleSetter/pro/Border.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/es/fields/StyleSetter/pro/Font.js +1 -2
- package/dist/es/fields/StyleSetter/pro/Font.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/es/fields/StyleSetter/pro/Layout.js +1 -2
- package/dist/es/fields/StyleSetter/pro/Layout.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/es/fields/StyleSetter/pro/Position.js +1 -2
- package/dist/es/fields/StyleSetter/pro/Position.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/es/fields/StyleSetter/pro/Transform.js +1 -2
- package/dist/es/fields/StyleSetter/pro/Transform.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/es/fields/UISelect.js +1 -2
- package/dist/es/fields/UISelect.vue_vue_type_script_setup_true_lang.js +7 -5
- package/dist/es/fields/configs/codeSelect.js +1 -2
- package/dist/es/fields/configs/displayConds.js +1 -2
- package/dist/es/fields/configs/eventSelect.js +2 -3
- package/dist/es/fields/configs/stickyAddButton.js +1 -2
- package/dist/es/fields/headless-validation.js +2 -3
- package/dist/es/hooks/use-code-block-edit.js +1 -2
- package/dist/es/hooks/use-compare-form.js +1 -2
- package/dist/es/hooks/use-data-source-edit.js +1 -2
- package/dist/es/hooks/use-editor-content-height.js +1 -2
- package/dist/es/hooks/use-filter.js +1 -2
- package/dist/es/hooks/use-float-box.js +1 -2
- package/dist/es/hooks/use-form-context.js +1 -2
- package/dist/es/hooks/use-getso.js +1 -2
- package/dist/es/hooks/use-next-float-box-position.js +1 -2
- package/dist/es/hooks/use-node-status.js +1 -2
- package/dist/es/hooks/use-services.js +1 -2
- package/dist/es/hooks/use-stage.js +3 -4
- package/dist/es/hooks/use-window-rect.js +1 -2
- package/dist/es/icons/CenterIcon.js +1 -2
- package/dist/es/icons/CenterIcon.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/es/icons/CodeIcon.js +1 -2
- package/dist/es/icons/CodeIcon.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/es/icons/DatasourceIcon.js +1 -2
- package/dist/es/icons/FolderMinusIcon.js +1 -2
- package/dist/es/icons/FolderMinusIcon.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/es/index.js +27 -27
- package/dist/es/initService.js +2 -3
- package/dist/es/layouts/AddPageBox.js +1 -2
- package/dist/es/layouts/AddPageBox.vue_vue_type_script_setup_true_lang.js +3 -4
- package/dist/es/layouts/CodeEditor.js +1 -2
- package/dist/es/layouts/CodeEditor.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/es/layouts/Framework.js +1 -2
- package/dist/es/layouts/Framework.vue_vue_type_script_setup_true_lang.js +4 -5
- package/dist/es/layouts/NavMenu.js +1 -2
- package/dist/es/layouts/NavMenu.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/es/layouts/NavMenuColumn.js +1 -2
- package/dist/es/layouts/NavMenuColumn.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/es/layouts/history-list/Bucket.js +1 -2
- package/dist/es/layouts/history-list/Bucket.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/es/layouts/history-list/BucketTab.js +1 -2
- package/dist/es/layouts/history-list/BucketTab.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/es/layouts/history-list/GroupRow.js +1 -2
- package/dist/es/layouts/history-list/GroupRow.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/es/layouts/history-list/HistoryDiffDialog.js +1 -2
- package/dist/es/layouts/history-list/HistoryDiffDialog.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/es/layouts/history-list/HistoryListPanel.js +1 -2
- package/dist/es/layouts/history-list/HistoryListPanel.vue_vue_type_script_setup_true_lang.js +3 -4
- package/dist/es/layouts/history-list/InitialRow.js +1 -2
- package/dist/es/layouts/history-list/InitialRow.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/es/layouts/history-list/PageTab.js +1 -2
- package/dist/es/layouts/history-list/PageTab.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/es/layouts/history-list/composables.js +1 -2
- package/dist/es/layouts/history-list/useHistoryList.js +1 -2
- package/dist/es/layouts/history-list/useHistoryRevert.js +1 -2
- package/dist/es/layouts/page-bar/AddButton.js +1 -2
- package/dist/es/layouts/page-bar/AddButton.vue_vue_type_script_setup_true_lang.js +3 -4
- package/dist/es/layouts/page-bar/PageBar.js +1 -2
- package/dist/es/layouts/page-bar/PageBar.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/es/layouts/page-bar/PageBarScrollContainer.js +1 -2
- package/dist/es/layouts/page-bar/PageBarScrollContainer.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/es/layouts/page-bar/PageList.js +1 -2
- package/dist/es/layouts/page-bar/PageList.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/es/layouts/page-bar/Search.js +1 -2
- package/dist/es/layouts/page-bar/Search.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/es/layouts/props-panel/FormPanel.js +1 -2
- package/dist/es/layouts/props-panel/FormPanel.vue_vue_type_script_setup_true_lang.js +7 -5
- package/dist/es/layouts/props-panel/PropsPanel.js +1 -2
- package/dist/es/layouts/props-panel/PropsPanel.vue_vue_type_script_setup_true_lang.js +14 -7
- package/dist/es/layouts/props-panel/use-style-panel.js +1 -2
- package/dist/es/layouts/sidebar/ComponentListPanel.js +1 -2
- package/dist/es/layouts/sidebar/ComponentListPanel.vue_vue_type_script_setup_true_lang.js +3 -4
- package/dist/es/layouts/sidebar/Sidebar.js +1 -2
- package/dist/es/layouts/sidebar/Sidebar.vue_vue_type_script_setup_true_lang.js +6 -7
- package/dist/es/layouts/sidebar/code-block/CodeBlockList.js +1 -2
- package/dist/es/layouts/sidebar/code-block/CodeBlockList.vue_vue_type_script_setup_true_lang.js +49 -33
- package/dist/es/layouts/sidebar/code-block/CodeBlockListPanel.js +1 -2
- package/dist/es/layouts/sidebar/code-block/CodeBlockListPanel.vue_vue_type_script_setup_true_lang.js +3 -4
- package/dist/es/layouts/sidebar/code-block/useContentMenu.js +1 -2
- package/dist/es/layouts/sidebar/data-source/DataSourceAddButton.js +1 -2
- package/dist/es/layouts/sidebar/data-source/DataSourceAddButton.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/es/layouts/sidebar/data-source/DataSourceConfigPanel.js +1 -2
- package/dist/es/layouts/sidebar/data-source/DataSourceConfigPanel.vue_vue_type_script_setup_true_lang.js +3 -4
- package/dist/es/layouts/sidebar/data-source/DataSourceList.js +1 -2
- package/dist/es/layouts/sidebar/data-source/DataSourceList.vue_vue_type_script_setup_true_lang.js +30 -20
- package/dist/es/layouts/sidebar/data-source/DataSourceListPanel.js +1 -2
- package/dist/es/layouts/sidebar/data-source/DataSourceListPanel.vue_vue_type_script_setup_true_lang.js +5 -10
- package/dist/es/layouts/sidebar/data-source/useContentMenu.js +1 -2
- package/dist/es/layouts/sidebar/layer/LayerMenu.js +1 -2
- package/dist/es/layouts/sidebar/layer/LayerMenu.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/es/layouts/sidebar/layer/LayerNodeContent.js +1 -2
- package/dist/es/layouts/sidebar/layer/LayerNodeContent.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/es/layouts/sidebar/layer/LayerNodeTool.js +1 -2
- package/dist/es/layouts/sidebar/layer/LayerNodeTool.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/es/layouts/sidebar/layer/LayerPanel.js +1 -2
- package/dist/es/layouts/sidebar/layer/LayerPanel.vue_vue_type_script_setup_true_lang.js +3 -4
- package/dist/es/layouts/sidebar/layer/use-click.js +1 -2
- package/dist/es/layouts/sidebar/layer/use-drag.js +1 -2
- package/dist/es/layouts/sidebar/layer/use-keybinding.js +1 -2
- package/dist/es/layouts/sidebar/layer/use-node-status.js +1 -2
- package/dist/es/layouts/workspace/Breadcrumb.js +1 -2
- package/dist/es/layouts/workspace/Breadcrumb.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/es/layouts/workspace/Workspace.js +1 -2
- package/dist/es/layouts/workspace/Workspace.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/es/layouts/workspace/viewer/NodeListMenu.js +1 -2
- package/dist/es/layouts/workspace/viewer/NodeListMenu.vue_vue_type_script_setup_true_lang.js +3 -4
- package/dist/es/layouts/workspace/viewer/Stage.js +1 -2
- package/dist/es/layouts/workspace/viewer/Stage.vue_vue_type_script_setup_true_lang.js +4 -5
- package/dist/es/layouts/workspace/viewer/StageOverlay.js +1 -2
- package/dist/es/layouts/workspace/viewer/StageOverlay.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/es/layouts/workspace/viewer/ViewerMenu.js +1 -2
- package/dist/es/layouts/workspace/viewer/ViewerMenu.vue_vue_type_script_setup_true_lang.js +4 -5
- package/dist/es/plugin.js +13 -14
- package/dist/es/sdk/index.js +2 -3
- package/dist/es/sdk/services/BaseService.js +1 -2
- package/dist/es/sdk/services/CodeBlock.js +1 -2
- package/dist/es/sdk/services/ComponentList.js +1 -2
- package/dist/es/sdk/services/DataSource.js +2 -3
- package/dist/es/sdk/services/Dep.js +2 -3
- package/dist/es/sdk/services/Editor.js +32 -13
- package/dist/es/sdk/services/Events.js +1 -2
- package/dist/es/sdk/services/History.js +2 -3
- package/dist/es/sdk/services/Props.js +2 -3
- package/dist/es/sdk/services/WebStorage.js +1 -2
- package/dist/es/sdk/utils/dep.js +1 -2
- package/dist/es/sdk/utils/operator.js +1 -2
- package/dist/es/sdk/utils/position.js +1 -2
- package/dist/es/sdk/utils/props.js +4 -5
- package/dist/es/sdk/validate/index.js +1 -2
- package/dist/es/sdk/wiring.js +1 -2
- package/dist/es/services/keybinding.js +2 -3
- package/dist/es/services/sdk-instance.js +3 -4
- package/dist/es/services/stageOverlay.js +2 -3
- package/dist/es/services/ui.js +1 -2
- package/dist/es/style.css +36 -0
- package/dist/es/type.js +1 -2
- package/dist/es/utils/code-block.js +1 -2
- package/dist/es/utils/config.js +1 -2
- package/dist/es/utils/const.js +1 -2
- package/dist/es/utils/content-menu.js +1 -2
- package/dist/es/utils/data-source/formConfigs/base.js +1 -2
- package/dist/es/utils/data-source/formConfigs/http.js +1 -2
- package/dist/es/utils/data-source/index.js +1 -2
- package/dist/es/utils/dep/collect-worker-client.js +1 -2
- package/dist/es/utils/dep/idle-task.js +1 -2
- package/dist/es/utils/dep/worker.js +2 -3
- package/dist/es/utils/editor.js +1 -2
- package/dist/es/utils/event.js +2 -3
- package/dist/es/utils/history.js +1 -2
- package/dist/es/utils/indexed-db.js +1 -2
- package/dist/es/utils/keybinding-config.js +1 -2
- package/dist/es/utils/logger.js +1 -2
- package/dist/es/utils/monaco-editor.js +1 -2
- package/dist/es/utils/operator.js +2 -3
- package/dist/es/utils/props.js +1 -2
- package/dist/es/utils/scroll-viewer.js +1 -2
- package/dist/es/utils/tree.js +1 -2
- package/dist/es/utils/type-match-rules.js +2 -3
- package/dist/es/utils/undo-redo.js +1 -2
- package/dist/style.css +36 -0
- package/dist/themes/magic-admin.css +36 -0
- package/dist/tmagic-editor-headless.umd.cjs +817 -650
- package/dist/tmagic-editor-sdk.umd.cjs +239 -426
- package/dist/tmagic-editor.umd.cjs +1313 -1312
- package/package.json +9 -9
- package/src/fields/CodeSelectCol.vue +12 -14
- package/src/fields/DataSourceMethodSelect.vue +17 -6
- package/src/fields/StyleSetter/configs.ts +63 -14
- package/src/fields/StyleSetter/icons/align-items/Baseline.vue +8 -0
- package/src/fields/StyleSetter/icons/align-items/End.vue +8 -0
- package/src/fields/StyleSetter/icons/align-items/Normal.vue +6 -0
- package/src/fields/StyleSetter/icons/align-items/Start.vue +8 -0
- package/src/fields/StyleSetter/icons/align-items/Stretch.vue +7 -0
- package/src/fields/StyleSetter/icons/align-items/index.ts +5 -0
- package/src/fields/StyleSetter/icons/background-repeat/Round.vue +8 -0
- package/src/fields/StyleSetter/icons/background-repeat/Space.vue +9 -0
- package/src/fields/StyleSetter/icons/background-repeat/index.ts +2 -0
- package/src/fields/StyleSetter/icons/display/Grid.vue +7 -0
- package/src/fields/StyleSetter/icons/display/InlineFlex.vue +7 -0
- package/src/fields/StyleSetter/icons/display/InlineGrid.vue +7 -0
- package/src/fields/StyleSetter/icons/display/index.ts +3 -0
- package/src/fields/StyleSetter/icons/justify-content/SpaceEvenly.vue +11 -0
- package/src/fields/StyleSetter/icons/justify-content/index.ts +1 -0
- package/src/fields/StyleSetter/icons/text-align/End.vue +7 -0
- package/src/fields/StyleSetter/icons/text-align/Justify.vue +7 -0
- package/src/fields/StyleSetter/icons/text-align/MatchParent.vue +7 -0
- package/src/fields/StyleSetter/icons/text-align/Start.vue +7 -0
- package/src/fields/StyleSetter/icons/text-align/index.ts +4 -0
- package/src/fields/UISelect.vue +3 -1
- package/src/fields/configs/eventSelect.ts +1 -1
- package/src/layouts/props-panel/FormPanel.vue +3 -0
- package/src/layouts/props-panel/PropsPanel.vue +7 -0
- package/src/layouts/sidebar/code-block/CodeBlockList.vue +51 -26
- package/src/layouts/sidebar/data-source/DataSourceList.vue +24 -8
- package/src/layouts/sidebar/data-source/DataSourceListPanel.vue +3 -8
- package/src/sdk/services/Editor.ts +40 -16
- package/src/sdk/utils/props.ts +3 -3
- package/src/theme/tree.scss +12 -0
- package/src/theme/ui-select.scss +31 -0
- package/src/type.ts +13 -0
- package/types/index.d.ts +55 -4
- package/types/sdk.d.ts +13 -3
package/dist/es/layouts/workspace/viewer/NodeListMenu.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { useServices } from "../../../hooks/use-services.js";
|
|
2
|
-
import { useFilter } from "../../../hooks/use-filter.js";
|
|
3
1
|
import FloatingBox_default from "../../../components/FloatingBox.js";
|
|
4
2
|
import Tree_default from "../../../components/Tree.js";
|
|
3
|
+
import { useFilter } from "../../../hooks/use-filter.js";
|
|
4
|
+
import { useServices } from "../../../hooks/use-services.js";
|
|
5
5
|
import { useNodeStatus } from "../../sidebar/layer/use-node-status.js";
|
|
6
6
|
import { TMagicTooltip } from "@tmagic/design";
|
|
7
7
|
import { getIdFromEl } from "@tmagic/utils";
|
|
8
8
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, nextTick, openBlock, ref, unref, useTemplateRef, watch, withCtx } from "vue";
|
|
9
|
-
|
|
9
|
+
// packages/editor/src/layouts/workspace/viewer/NodeListMenu.vue?vue&type=script&setup=true&lang.ts
|
|
10
10
|
var NodeListMenu_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
11
11
|
__name: "NodeListMenu",
|
|
12
12
|
setup(__props) {
|
|
@@ -90,5 +90,4 @@ var NodeListMenu_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ def
|
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
92
|
});
|
|
93
|
-
//#endregion
|
|
94
93
|
export { NodeListMenu_vue_vue_type_script_setup_true_lang_default as default };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import Stage_vue_vue_type_script_setup_true_lang_default from "./Stage.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
-
|
|
2
|
+
// packages/editor/src/layouts/workspace/viewer/Stage.vue
|
|
3
3
|
var Stage_default = Stage_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
-
//#endregion
|
|
5
4
|
export { Stage_default as default };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
+
import ScrollViewer_default from "../../../components/ScrollViewer.js";
|
|
2
|
+
import { useServices } from "../../../hooks/use-services.js";
|
|
3
|
+
import { useStage } from "../../../hooks/use-stage.js";
|
|
1
4
|
import { DragType, Layout } from "../../../type.js";
|
|
2
5
|
import { getEditorConfig } from "../../../utils/config.js";
|
|
3
|
-
import { useStage } from "../../../hooks/use-stage.js";
|
|
4
|
-
import { useServices } from "../../../hooks/use-services.js";
|
|
5
6
|
import { KeyBindingContainerKey } from "../../../utils/keybinding-config.js";
|
|
6
|
-
import ScrollViewer_default from "../../../components/ScrollViewer.js";
|
|
7
7
|
import NodeListMenu_default from "./NodeListMenu.js";
|
|
8
8
|
import StageOverlay_default from "./StageOverlay.js";
|
|
9
9
|
import ViewerMenu_default from "./ViewerMenu.js";
|
|
10
10
|
import { getOffset } from "@tmagic/stage";
|
|
11
11
|
import { calcValueByFontsize, getIdFromEl } from "@tmagic/utils";
|
|
12
12
|
import { Teleport, computed, createBlock, createCommentVNode, createElementVNode, createVNode, defineComponent, markRaw, nextTick, normalizeStyle, onBeforeUnmount, onMounted, openBlock, renderSlot, resolveDirective, useTemplateRef, watch, watchEffect, withCtx, withDirectives } from "vue";
|
|
13
|
-
|
|
13
|
+
// packages/editor/src/layouts/workspace/viewer/Stage.vue?vue&type=script&setup=true&lang.ts
|
|
14
14
|
var Stage_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
15
15
|
name: "MEditorStage",
|
|
16
16
|
__name: "Stage",
|
|
@@ -326,5 +326,4 @@ var Stage_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComp
|
|
|
326
326
|
};
|
|
327
327
|
}
|
|
328
328
|
});
|
|
329
|
-
//#endregion
|
|
330
329
|
export { Stage_vue_vue_type_script_setup_true_lang_default as default };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import StageOverlay_vue_vue_type_script_setup_true_lang_default from "./StageOverlay.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
-
|
|
2
|
+
// packages/editor/src/layouts/workspace/viewer/StageOverlay.vue
|
|
3
3
|
var StageOverlay_default = StageOverlay_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
-
//#endregion
|
|
5
4
|
export { StageOverlay_default as default };
|
package/dist/es/layouts/workspace/viewer/StageOverlay.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { useServices } from "../../../hooks/use-services.js";
|
|
2
1
|
import ScrollViewer_default from "../../../components/ScrollViewer.js";
|
|
2
|
+
import { useServices } from "../../../hooks/use-services.js";
|
|
3
3
|
import { TMagicIcon } from "@tmagic/design";
|
|
4
4
|
import { computed, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, inject, normalizeStyle, onBeforeUnmount, openBlock, unref, useTemplateRef, watch, withCtx } from "vue";
|
|
5
5
|
import { CloseBold } from "@element-plus/icons-vue";
|
|
6
|
-
|
|
6
|
+
// packages/editor/src/layouts/workspace/viewer/StageOverlay.vue?vue&type=script&setup=true&lang.ts
|
|
7
7
|
var _hoisted_1 = {
|
|
8
8
|
key: 0,
|
|
9
9
|
class: "m-editor-stage-overlay"
|
|
@@ -81,5 +81,4 @@ var StageOverlay_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ def
|
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
83
|
});
|
|
84
|
-
//#endregion
|
|
85
84
|
export { StageOverlay_vue_vue_type_script_setup_true_lang_default as default };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import ViewerMenu_vue_vue_type_script_setup_true_lang_default from "./ViewerMenu.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
-
|
|
2
|
+
// packages/editor/src/layouts/workspace/viewer/ViewerMenu.vue
|
|
3
3
|
var ViewerMenu_default = ViewerMenu_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
-
//#endregion
|
|
5
4
|
export { ViewerMenu_default as default };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { LayerOffset, Layout } from "../../../type.js";
|
|
2
|
-
import { useServices } from "../../../hooks/use-services.js";
|
|
3
1
|
import ContentMenu_default from "../../../components/ContentMenu.js";
|
|
4
|
-
import {
|
|
2
|
+
import { useServices } from "../../../hooks/use-services.js";
|
|
5
3
|
import CenterIcon_default from "../../../icons/CenterIcon.js";
|
|
4
|
+
import { LayerOffset, Layout } from "../../../type.js";
|
|
5
|
+
import { useCopyMenu, useDeleteMenu, useMoveToMenu, usePasteMenu } from "../../../utils/content-menu.js";
|
|
6
6
|
import { isPageOrFragment } from "@tmagic/utils";
|
|
7
7
|
import { NodeType } from "@tmagic/core";
|
|
8
8
|
import { computed, createBlock, defineComponent, markRaw, openBlock, ref, useTemplateRef, watch } from "vue";
|
|
9
9
|
import { Bottom, Top } from "@element-plus/icons-vue";
|
|
10
|
-
|
|
10
|
+
// packages/editor/src/layouts/workspace/viewer/ViewerMenu.vue?vue&type=script&setup=true&lang.ts
|
|
11
11
|
var ViewerMenu_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
12
12
|
name: "MEditorViewerMenu",
|
|
13
13
|
__name: "ViewerMenu",
|
|
@@ -128,5 +128,4 @@ var ViewerMenu_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
|
|
|
128
128
|
};
|
|
129
129
|
}
|
|
130
130
|
});
|
|
131
|
-
//#endregion
|
|
132
131
|
export { ViewerMenu_vue_vue_type_script_setup_true_lang_default as default };
|
package/dist/es/plugin.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import Editor_default from "./Editor.js";
|
|
1
|
+
import Code_default from "./fields/Code.js";
|
|
2
|
+
import CodeLink_default from "./fields/CodeLink.js";
|
|
4
3
|
import CodeSelect_default from "./fields/CodeSelect.js";
|
|
5
4
|
import CodeSelectCol_default from "./fields/CodeSelectCol.js";
|
|
5
|
+
import CondOpSelect_default from "./fields/CondOpSelect.js";
|
|
6
6
|
import DataSourceFields_default from "./fields/DataSourceFields.js";
|
|
7
|
-
import
|
|
8
|
-
import DataSourceMethods_default from "./fields/DataSourceMethods.js";
|
|
7
|
+
import Index_default from "./fields/DataSourceFieldSelect/Index.js";
|
|
9
8
|
import DataSourceInput_default from "./fields/DataSourceInput.js";
|
|
10
|
-
import
|
|
9
|
+
import DataSourceMethods_default from "./fields/DataSourceMethods.js";
|
|
11
10
|
import DataSourceMethodSelect_default from "./fields/DataSourceMethodSelect.js";
|
|
12
|
-
import
|
|
11
|
+
import DataSourceMocks_default from "./fields/DataSourceMocks.js";
|
|
12
|
+
import DataSourceSelect_default from "./fields/DataSourceSelect.js";
|
|
13
|
+
import DisplayConds_default from "./fields/DisplayConds.js";
|
|
13
14
|
import EventSelect_default from "./fields/EventSelect.js";
|
|
15
|
+
import { editorFields } from "./fields/headless-validation.js";
|
|
14
16
|
import KeyValue_default from "./fields/KeyValue.js";
|
|
15
17
|
import PageFragmentSelect_default from "./fields/PageFragmentSelect.js";
|
|
16
|
-
import DisplayConds_default from "./fields/DisplayConds.js";
|
|
17
|
-
import CondOpSelect_default from "./fields/CondOpSelect.js";
|
|
18
18
|
import Index_default$1 from "./fields/StyleSetter/Index.js";
|
|
19
|
-
import { editorFields } from "./fields/headless-validation.js";
|
|
20
|
-
import Code_default from "./fields/Code.js";
|
|
21
|
-
import CodeLink_default from "./fields/CodeLink.js";
|
|
22
19
|
import UISelect_default from "./fields/UISelect.js";
|
|
20
|
+
import CodeEditor_default from "./layouts/CodeEditor.js";
|
|
21
|
+
import { setEditorConfig } from "./utils/config.js";
|
|
22
|
+
import Editor_default from "./Editor.js";
|
|
23
23
|
/* empty css */
|
|
24
24
|
import formPlugin, { mergeFieldOptions } from "@tmagic/form";
|
|
25
25
|
import tablePlugin from "@tmagic/table";
|
|
26
26
|
import designPlugin from "@tmagic/design";
|
|
27
|
-
|
|
27
|
+
// packages/editor/src/plugin.ts
|
|
28
28
|
var defaultInstallOpt = {
|
|
29
29
|
parseDSL: (dsl) => eval(dsl),
|
|
30
30
|
customCreateMonacoEditor: (monaco, codeEditorEl, options) => monaco.editor.create(codeEditorEl, options),
|
|
@@ -69,5 +69,4 @@ var plugin_default = { install: (app, opt) => {
|
|
|
69
69
|
app.component(`${Editor_default.name || "MEditor"}`, Editor_default);
|
|
70
70
|
app.component("magic-code-editor", CodeEditor_default);
|
|
71
71
|
} };
|
|
72
|
-
//#endregion
|
|
73
72
|
export { plugin_default as default };
|
package/dist/es/sdk/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import BaseService from "./services/BaseService.js";
|
|
2
|
-
import { MemoryStorage, Protocol, WebStorage } from "./services/WebStorage.js";
|
|
3
2
|
import CodeBlock from "./services/CodeBlock.js";
|
|
4
3
|
import ComponentList from "./services/ComponentList.js";
|
|
5
4
|
import DataSource from "./services/DataSource.js";
|
|
@@ -8,12 +7,13 @@ import Editor from "./services/Editor.js";
|
|
|
8
7
|
import Events from "./services/Events.js";
|
|
9
8
|
import History from "./services/History.js";
|
|
10
9
|
import Props from "./services/Props.js";
|
|
10
|
+
import { MemoryStorage, Protocol, WebStorage } from "./services/WebStorage.js";
|
|
11
11
|
import { DslValidationError, createValidator } from "./validate/index.js";
|
|
12
12
|
import { classifyUpdatedNodes } from "./utils/dep.js";
|
|
13
13
|
import { bindWiring, whenWiringSettled } from "./wiring.js";
|
|
14
14
|
import { nextTick, reactive, shallowReactive, toRaw } from "vue";
|
|
15
15
|
import { cloneDeep, isEmpty } from "lodash-es";
|
|
16
|
-
|
|
16
|
+
// packages/editor/src/sdk/index.ts
|
|
17
17
|
/**
|
|
18
18
|
* @fileoverview `@tmagic/editor/sdk`:不依赖 DOM 的 DSL 操作 SDK。
|
|
19
19
|
*
|
|
@@ -147,5 +147,4 @@ var createDslSdk = (options = {}) => {
|
|
|
147
147
|
}
|
|
148
148
|
};
|
|
149
149
|
};
|
|
150
|
-
//#endregion
|
|
151
150
|
export { BaseService, CodeBlock as CodeBlockService, ComponentList as ComponentListService, DataSource as DataSourceService, Dep as DepService, DslValidationError, Editor as EditorService, Events as EventsService, History as HistoryService, MemoryStorage, Props as PropsService, Protocol, WebStorage as StorageService, bindWiring, classifyUpdatedNodes, createDslSdk, createValidator, defaultParseDSL, whenWiringSettled };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from "events";
|
|
2
|
-
|
|
2
|
+
// packages/editor/src/sdk/services/BaseService.ts
|
|
3
3
|
var methodName = (prefix, name) => `${prefix}${name[0].toUpperCase()}${name.substring(1)}`;
|
|
4
4
|
var isError = (error) => Object.prototype.toString.call(error) === "[object Error]";
|
|
5
5
|
var doAction = (args, scope, sourceMethod, beforeMethodName, afterMethodName) => {
|
|
@@ -107,5 +107,4 @@ var BaseService = class extends EventEmitter {
|
|
|
107
107
|
this.doingTask = false;
|
|
108
108
|
}
|
|
109
109
|
};
|
|
110
|
-
//#endregion
|
|
111
110
|
export { BaseService as default };
|
|
@@ -6,7 +6,7 @@ import { Protocol } from "./WebStorage.js";
|
|
|
6
6
|
import { getValueByKeyPath, setValueByKeyPath } from "@tmagic/utils";
|
|
7
7
|
import { Target, Watcher } from "@tmagic/core";
|
|
8
8
|
import { cloneDeep as cloneDeep$1, get, keys, pick } from "lodash-es";
|
|
9
|
-
|
|
9
|
+
// packages/editor/src/sdk/services/CodeBlock.ts
|
|
10
10
|
var canUsePluginMethods = {
|
|
11
11
|
async: [
|
|
12
12
|
"setCodeDslById",
|
|
@@ -524,5 +524,4 @@ var CodeBlock = class extends BaseService {
|
|
|
524
524
|
this.setCodeDslByIdSync(id, cloneDeep$1(sourceForValues), true, { doNotPushHistory: true });
|
|
525
525
|
}
|
|
526
526
|
};
|
|
527
|
-
//#endregion
|
|
528
527
|
export { CodeBlock as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import BaseService from "./BaseService.js";
|
|
2
|
-
|
|
2
|
+
// packages/editor/src/sdk/services/ComponentList.ts
|
|
3
3
|
var ComponentList = class extends BaseService {
|
|
4
4
|
state;
|
|
5
5
|
constructor(ctx) {
|
|
@@ -24,5 +24,4 @@ var ComponentList = class extends BaseService {
|
|
|
24
24
|
this.removeAllPlugins();
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
|
-
//#endregion
|
|
28
27
|
export { ComponentList as default };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import { getFormConfig, getFormValue } from "../../utils/data-source/index.js";
|
|
1
2
|
import { COPY_DS_STORAGE_KEY } from "../../utils/editor.js";
|
|
2
3
|
import { createStackStep, describeRevertStep, getLastPushedHistoryIds } from "../../utils/history.js";
|
|
3
4
|
import BaseService from "./BaseService.js";
|
|
4
5
|
import { Protocol } from "./WebStorage.js";
|
|
5
|
-
import { getFormConfig, getFormValue } from "../../utils/data-source/index.js";
|
|
6
6
|
import { getValueByKeyPath, guid, setValueByKeyPath, toLine } from "@tmagic/utils";
|
|
7
7
|
import { Target, Watcher } from "@tmagic/core";
|
|
8
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: [],
|
|
12
12
|
sync: [
|
|
@@ -433,5 +433,4 @@ var DataSource = class extends BaseService {
|
|
|
433
433
|
this.update(cloneDeep$1(sourceForValues), { doNotPushHistory: true });
|
|
434
434
|
}
|
|
435
435
|
};
|
|
436
|
-
//#endregion
|
|
437
436
|
export { DataSource as default };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import BaseService from "./BaseService.js";
|
|
2
1
|
import { IdleTask } from "../../utils/dep/idle-task.js";
|
|
2
|
+
import BaseService from "./BaseService.js";
|
|
3
3
|
import { isPage } from "@tmagic/utils";
|
|
4
4
|
import { DepTargetType, Watcher, traverseTarget } from "@tmagic/core";
|
|
5
5
|
import { throttle } from "lodash-es";
|
|
6
|
-
|
|
6
|
+
// packages/editor/src/sdk/services/Dep.ts
|
|
7
7
|
/** Node 下没有 worker 时使用:始终不可用,依赖收集退回主线程空闲队列 */
|
|
8
8
|
var noopCollectWorker = {
|
|
9
9
|
isSupported: false,
|
|
@@ -312,5 +312,4 @@ var Dep = class extends BaseService {
|
|
|
312
312
|
this.set("collecting", this.activeBatches.size > 0);
|
|
313
313
|
}
|
|
314
314
|
};
|
|
315
|
-
//#endregion
|
|
316
315
|
export { Dep as default };
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { Layout, canUsePluginMethods } from "../../type.js";
|
|
2
|
-
import { isFixed } from "../utils/position.js";
|
|
3
2
|
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";
|
|
4
3
|
import { getLastPushedHistoryIds } from "../../utils/history.js";
|
|
4
|
+
import { beforePaste, getAddParent } from "../utils/operator.js";
|
|
5
|
+
import { isFixed } from "../utils/position.js";
|
|
5
6
|
import BaseService from "./BaseService.js";
|
|
6
7
|
import { Protocol } from "./WebStorage.js";
|
|
7
|
-
import { beforePaste, getAddParent } from "../utils/operator.js";
|
|
8
8
|
import { getNodeInfo, getNodePath, getValueByKeyPath, guid, isPage, isPageFragment, isPageOrFragment, setValueByKeyPath, traverseNode } from "@tmagic/utils";
|
|
9
9
|
import { NodeType } from "@tmagic/core";
|
|
10
10
|
import { cloneDeep as cloneDeep$1, isEmpty, isEqual, isObject, mergeWith, uniq } from "lodash-es";
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
var clampIndex = (index, length) =>
|
|
11
|
+
// packages/editor/src/sdk/services/Editor.ts
|
|
12
|
+
/** 把插入下标收敛到 [0, length]:非整数取整,非法 / 越界(含未记录)一律追加到末尾 */
|
|
13
|
+
var clampIndex = (index, length) => {
|
|
14
|
+
const normalized = typeof index === "number" ? Math.trunc(index) : length;
|
|
15
|
+
return Number.isFinite(normalized) && normalized >= 0 && normalized <= length ? normalized : length;
|
|
16
|
+
};
|
|
14
17
|
/**
|
|
15
18
|
* 把「变更前后节点快照」列表归一成 update 类型的 {@link StepDiffItem} 列表,供 {@link StepValue.diff} 使用。
|
|
16
19
|
* `changeRecords` 来自 form 端的 propPath/value 列表,撤销/重做时只对这些 propPath 做局部更新;
|
|
@@ -265,18 +268,25 @@ var Editor = class extends BaseService {
|
|
|
265
268
|
getConfig() {
|
|
266
269
|
return this.config;
|
|
267
270
|
}
|
|
268
|
-
async doAdd(node, parent,
|
|
271
|
+
async doAdd(node, parent, options = {}) {
|
|
269
272
|
const root = this.get("root");
|
|
270
273
|
if (!root) throw new Error("root为空");
|
|
271
274
|
const curNode = this.get("node");
|
|
272
275
|
const stage = this.get("stage");
|
|
273
|
-
|
|
276
|
+
const explicitIndex = options.insertIndex;
|
|
277
|
+
if (!curNode && explicitIndex === void 0) throw new Error("当前选中节点为空");
|
|
274
278
|
if ((parent.type === NodeType.ROOT || curNode?.type === NodeType.ROOT) && !isPageOrFragment(node)) throw new Error("app下不能添加组件");
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
279
|
+
let insertIndex;
|
|
280
|
+
if (explicitIndex === "end") insertIndex = parent.items.length;
|
|
281
|
+
else if (typeof explicitIndex === "number") insertIndex = clampIndex(explicitIndex, parent.items.length);
|
|
282
|
+
else {
|
|
283
|
+
const selectedId = curNode.id;
|
|
284
|
+
const anchorId = this.lastAdded?.selectedId === selectedId ? this.lastAdded.nodeId : selectedId;
|
|
285
|
+
const anchorIndex = isPageOrFragment(node) ? -1 : Math.max(getNodeIndex(anchorId, parent), getNodeIndex(selectedId, parent));
|
|
286
|
+
insertIndex = anchorIndex < 0 ? parent.items.length : anchorIndex + 1;
|
|
287
|
+
}
|
|
278
288
|
parent.items.splice(insertIndex, 0, node);
|
|
279
|
-
this.lastAdded = {
|
|
289
|
+
if (curNode) this.lastAdded = {
|
|
280
290
|
selectedId: curNode.id,
|
|
281
291
|
nodeId: node.id
|
|
282
292
|
};
|
|
@@ -330,7 +340,17 @@ var Editor = class extends BaseService {
|
|
|
330
340
|
});
|
|
331
341
|
}
|
|
332
342
|
const commitInvalid = await this.runGuard(() => this.ctx.validator.guardAdd(targets));
|
|
333
|
-
|
|
343
|
+
const explicitIndex = options.insertIndex;
|
|
344
|
+
const offsets = /* @__PURE__ */ new Map();
|
|
345
|
+
for (const { node, parentNode } of targets) {
|
|
346
|
+
const offset = offsets.get(parentNode.id) ?? 0;
|
|
347
|
+
offsets.set(parentNode.id, offset + 1);
|
|
348
|
+
const nodeOptions = typeof explicitIndex === "number" ? {
|
|
349
|
+
...options,
|
|
350
|
+
insertIndex: Math.trunc(explicitIndex) + offset
|
|
351
|
+
} : options;
|
|
352
|
+
newNodes.push(await this.doAdd(node, parentNode, nodeOptions));
|
|
353
|
+
}
|
|
334
354
|
commitInvalid?.();
|
|
335
355
|
if (newNodes.length > 1) {
|
|
336
356
|
const wouldSwitchPage = newNodes.some((n) => this.isOnDifferentPage(n));
|
|
@@ -1533,5 +1553,4 @@ var Editor = class extends BaseService {
|
|
|
1533
1553
|
return this.ctx.reactivity.toRaw(value);
|
|
1534
1554
|
}
|
|
1535
1555
|
};
|
|
1536
|
-
//#endregion
|
|
1537
1556
|
export { Editor as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import BaseService from "./BaseService.js";
|
|
2
2
|
import { toLine } from "@tmagic/utils";
|
|
3
3
|
import { cloneDeep } from "lodash-es";
|
|
4
|
-
|
|
4
|
+
// packages/editor/src/sdk/services/Events.ts
|
|
5
5
|
var canUsePluginMethods = {
|
|
6
6
|
async: [],
|
|
7
7
|
sync: [
|
|
@@ -60,5 +60,4 @@ var Events = class extends BaseService {
|
|
|
60
60
|
super.usePlugin(options);
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
|
-
//#endregion
|
|
64
63
|
export { Events as default };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { UndoRedo } from "../../utils/undo-redo.js";
|
|
2
1
|
import { deserializeStacks, getOrCreateStack, markStackSaved, mergeSteps, serializeStacks, undoFloor } from "../../utils/history.js";
|
|
2
|
+
import { UndoRedo } from "../../utils/undo-redo.js";
|
|
3
3
|
import BaseService from "./BaseService.js";
|
|
4
4
|
import { guid } from "@tmagic/utils";
|
|
5
|
-
|
|
5
|
+
// packages/editor/src/sdk/services/History.ts
|
|
6
6
|
var canUsePluginMethods = { sync: [
|
|
7
7
|
"push",
|
|
8
8
|
"undo",
|
|
@@ -484,5 +484,4 @@ var History = class extends BaseService {
|
|
|
484
484
|
return resolvedAppId ? `${dbName}-${resolvedAppId}` : dbName;
|
|
485
485
|
}
|
|
486
486
|
};
|
|
487
|
-
//#endregion
|
|
488
487
|
export { History as default };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import BaseService from "./BaseService.js";
|
|
2
1
|
import { fillConfig } from "../utils/props.js";
|
|
2
|
+
import BaseService from "./BaseService.js";
|
|
3
3
|
import { getNodePath, getValueByKeyPath, guid, setValueByKeyPath, toLine } from "@tmagic/utils";
|
|
4
4
|
import { Target, Watcher } from "@tmagic/core";
|
|
5
5
|
import { cloneDeep as cloneDeep$1, mergeWith } from "lodash-es";
|
|
6
|
-
|
|
6
|
+
// packages/editor/src/sdk/services/Props.ts
|
|
7
7
|
var canUsePluginMethods = {
|
|
8
8
|
async: [
|
|
9
9
|
"setPropsConfig",
|
|
@@ -226,5 +226,4 @@ var Props = class extends BaseService {
|
|
|
226
226
|
this.state.relateIdMap[oldId] = newId;
|
|
227
227
|
}
|
|
228
228
|
};
|
|
229
|
-
//#endregion
|
|
230
229
|
export { Props as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import BaseService from "./BaseService.js";
|
|
2
2
|
import serialize from "serialize-javascript";
|
|
3
|
-
|
|
3
|
+
// packages/editor/src/sdk/services/WebStorage.ts
|
|
4
4
|
var Protocol = /* @__PURE__ */ function(Protocol) {
|
|
5
5
|
Protocol["OBJECT"] = "object";
|
|
6
6
|
Protocol["JSON"] = "json";
|
|
@@ -146,5 +146,4 @@ var WebStorage = class extends BaseService {
|
|
|
146
146
|
};
|
|
147
147
|
}
|
|
148
148
|
};
|
|
149
|
-
//#endregion
|
|
150
149
|
export { MemoryStorage, Protocol, WebStorage, WebStorage as default };
|
package/dist/es/sdk/utils/dep.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isIncludeDataSource } from "../../utils/editor.js";
|
|
2
2
|
import { isValueIncludeDataSource } from "@tmagic/utils";
|
|
3
3
|
import { DepTargetType, NODE_CONDS_KEY, NodeType, createCodeBlockTarget, createDataSourceCondTarget, createDataSourceMethodTarget, createDataSourceTarget } from "@tmagic/core";
|
|
4
|
-
|
|
4
|
+
// packages/editor/src/sdk/utils/dep.ts
|
|
5
5
|
/** 数据源依赖类型 -> 写回 root 的字段 */
|
|
6
6
|
var DEPS_KEY = {
|
|
7
7
|
[DepTargetType.DATA_SOURCE]: "dataSourceDeps",
|
|
@@ -96,5 +96,4 @@ var removeTargetDeps = (root, id, type) => {
|
|
|
96
96
|
if (!root || !isDataSourceDepType(type)) return;
|
|
97
97
|
delete root[DEPS_KEY[type]]?.[id];
|
|
98
98
|
};
|
|
99
|
-
//#endregion
|
|
100
99
|
export { addDataSourceTargets, classifyUpdatedNodes, getDataSourceRecollectTypes, removeDataSourceTargets, removeTargetDeps, resetDepTargets, writeTargetDeps };
|
|
@@ -2,7 +2,7 @@ import { generatePageNameByApp, getInitPositionStyle } from "../../utils/editor.
|
|
|
2
2
|
import { calcValueByFontsize, getElById, isPage, isPageOrFragment } from "@tmagic/utils";
|
|
3
3
|
import { NodeType } from "@tmagic/core";
|
|
4
4
|
import { isEmpty } from "lodash-es";
|
|
5
|
-
|
|
5
|
+
// packages/editor/src/sdk/utils/operator.ts
|
|
6
6
|
/**
|
|
7
7
|
* 粘贴前置操作:返回分配了新id以及校准了坐标的配置
|
|
8
8
|
* @param position 粘贴的坐标
|
|
@@ -66,5 +66,4 @@ var getDefaultConfig = async (ctx, addNode, parentNode) => {
|
|
|
66
66
|
newNode.style = getInitPositionStyle(newNode.style, layout);
|
|
67
67
|
return newNode;
|
|
68
68
|
};
|
|
69
|
-
//#endregion
|
|
70
69
|
export { beforePaste, getAddParent, getDefaultConfig, getPositionInContainer };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
// packages/editor/src/sdk/utils/position.ts
|
|
2
2
|
/**
|
|
3
3
|
* 是否是 fixed 定位。与 `@tmagic/stage` 的同名函数等价,在这里单独实现,
|
|
4
4
|
* 避免 SDK 在 Node 下为了这一行逻辑引入整个画布依赖。
|
|
5
5
|
*/
|
|
6
6
|
var isFixed = (style) => style.position === "fixed";
|
|
7
|
-
//#endregion
|
|
8
7
|
export { isFixed };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HookType, NODE_CONDS_KEY, NODE_CONDS_RESULT_KEY, NODE_DISABLE_CODE_BLOCK_KEY, NODE_DISABLE_DATA_SOURCE_KEY } from "@tmagic/core";
|
|
2
|
-
|
|
2
|
+
// packages/editor/src/sdk/utils/props.ts
|
|
3
3
|
var arrayOptions = [{
|
|
4
4
|
text: "包含",
|
|
5
5
|
value: "include"
|
|
@@ -154,9 +154,9 @@ var advancedTabConfig = {
|
|
|
154
154
|
{
|
|
155
155
|
name: "created",
|
|
156
156
|
text: "Created",
|
|
157
|
-
labelPosition: "top",
|
|
158
157
|
type: "code-select",
|
|
159
158
|
titleExtra: "组件初始化时执行",
|
|
159
|
+
labelWidth: "90px",
|
|
160
160
|
rules: [{
|
|
161
161
|
typeMatch: true,
|
|
162
162
|
trigger: "change"
|
|
@@ -168,8 +168,8 @@ var advancedTabConfig = {
|
|
|
168
168
|
{
|
|
169
169
|
name: "mounted",
|
|
170
170
|
text: "Mounted",
|
|
171
|
-
labelPosition: "top",
|
|
172
171
|
type: "code-select",
|
|
172
|
+
labelWidth: "90px",
|
|
173
173
|
titleExtra: "组件挂载到dom时执行",
|
|
174
174
|
rules: [{
|
|
175
175
|
typeMatch: true,
|
|
@@ -183,7 +183,7 @@ var advancedTabConfig = {
|
|
|
183
183
|
name: "display",
|
|
184
184
|
text: "Display",
|
|
185
185
|
titleExtra: "控制组件是否渲染,关系的代码块返回值为false时不渲染",
|
|
186
|
-
|
|
186
|
+
labelWidth: "90px",
|
|
187
187
|
type: "code-select",
|
|
188
188
|
rules: [{
|
|
189
189
|
typeMatch: true,
|
|
@@ -277,5 +277,4 @@ var fillConfig = (config = [], { labelWidth = "80px", disabledDataSource = false
|
|
|
277
277
|
if (!disabledDataSource) tabConfig.items.push({ ...displayTabConfig });
|
|
278
278
|
return [tabConfig];
|
|
279
279
|
};
|
|
280
|
-
//#endregion
|
|
281
280
|
export { advancedTabConfig, arrayOptions, booleanOptions, displayTabConfig, eqOptions, eventTabConfig, fillConfig, getCondOpOptionsByFieldType, numberOptions, styleTabConfig };
|
|
@@ -3,7 +3,7 @@ import { isPage, isPageFragment, isPageOrFragment, toLine, traverseNode } from "
|
|
|
3
3
|
import { NodeType } from "@tmagic/core";
|
|
4
4
|
import { cloneDeep as cloneDeep$1, mergeWith } from "lodash-es";
|
|
5
5
|
import { builtInFields, registerBuiltInFields, validateForm } from "@tmagic/form/headless";
|
|
6
|
-
|
|
6
|
+
// packages/editor/src/sdk/validate/index.ts
|
|
7
7
|
/**
|
|
8
8
|
* @fileoverview DSL 校验:
|
|
9
9
|
*
|
|
@@ -282,5 +282,4 @@ var createValidator = (ctx) => {
|
|
|
282
282
|
}
|
|
283
283
|
};
|
|
284
284
|
};
|
|
285
|
-
//#endregion
|
|
286
285
|
export { DslValidationError, createValidator };
|
package/dist/es/sdk/wiring.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { addDataSourceTargets, classifyUpdatedNodes, getDataSourceRecollectTypes, removeDataSourceTargets, removeTargetDeps, resetDepTargets, writeTargetDeps } from "./utils/dep.js";
|
|
2
2
|
import { getNodes, isPage } from "@tmagic/utils";
|
|
3
3
|
import { DepTargetType, NodeType, createCodeBlockTarget } from "@tmagic/core";
|
|
4
|
-
|
|
4
|
+
// packages/editor/src/sdk/wiring.ts
|
|
5
5
|
var pendingSelects = /* @__PURE__ */ new WeakMap();
|
|
6
6
|
/** root 变化后自动选中节点是异步的,需要时可以等它完成 */
|
|
7
7
|
var whenWiringSettled = (ctx) => pendingSelects.get(ctx) ?? Promise.resolve();
|
|
@@ -159,5 +159,4 @@ var bindWiring = (ctx) => {
|
|
|
159
159
|
for (const [service, event, handler] of listeners) service.off(event, handler);
|
|
160
160
|
} };
|
|
161
161
|
};
|
|
162
|
-
//#endregion
|
|
163
162
|
export { bindWiring, classifyUpdatedNodes, whenWiringSettled };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { KeyBindingCommand } from "../type.js";
|
|
2
1
|
import BaseService from "../sdk/services/BaseService.js";
|
|
2
|
+
import { KeyBindingCommand } from "../type.js";
|
|
3
3
|
import { editorService } from "./sdk-instance.js";
|
|
4
4
|
import ui_default from "./ui.js";
|
|
5
5
|
import { isPageOrFragment } from "@tmagic/utils";
|
|
6
6
|
import KeyController from "keycon";
|
|
7
|
-
|
|
7
|
+
// packages/editor/src/services/keybinding.ts
|
|
8
8
|
var Keybinding = class extends BaseService {
|
|
9
9
|
ctrlKey = /mac os x/.test(navigator.userAgent.toLowerCase()) ? "meta" : "ctrl";
|
|
10
10
|
controllers = /* @__PURE__ */ new Map();
|
|
@@ -178,5 +178,4 @@ var Keybinding = class extends BaseService {
|
|
|
178
178
|
}
|
|
179
179
|
};
|
|
180
180
|
var keybinding_default = new Keybinding();
|
|
181
|
-
//#endregion
|
|
182
181
|
export { keybinding_default as default };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { getEditorConfig } from "../utils/config.js";
|
|
2
|
-
import { Protocol } from "../sdk/services/WebStorage.js";
|
|
3
1
|
import { createDslSdk } from "../sdk/index.js";
|
|
2
|
+
import { Protocol } from "../sdk/services/WebStorage.js";
|
|
3
|
+
import { getEditorConfig } from "../utils/config.js";
|
|
4
4
|
import { CollectWorkerClient } from "../utils/dep/collect-worker-client.js";
|
|
5
5
|
import { idbGet, idbSet } from "../utils/indexed-db.js";
|
|
6
6
|
import { copyTextToClipboard, notifyByDesign } from "../utils/props.js";
|
|
7
|
-
|
|
7
|
+
// packages/editor/src/services/sdk-instance.ts
|
|
8
8
|
/**
|
|
9
9
|
* 浏览器端默认的 SDK 实例:`editorService` 等单例都从这里取。
|
|
10
10
|
*
|
|
@@ -33,5 +33,4 @@ var depService = sdk.dep;
|
|
|
33
33
|
var eventsService = sdk.events;
|
|
34
34
|
var storageService = sdk.storage;
|
|
35
35
|
var componentListService = sdk.componentList;
|
|
36
|
-
//#endregion
|
|
37
36
|
export { Protocol, codeBlockService, componentListService, dataSourceService, sdk as default, depService, editorService, eventsService, historyService, propsService, storageService };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { useStage } from "../hooks/use-stage.js";
|
|
1
2
|
import BaseService from "../sdk/services/BaseService.js";
|
|
2
3
|
import { editorService } from "./sdk-instance.js";
|
|
3
|
-
import { useStage } from "../hooks/use-stage.js";
|
|
4
4
|
import { getIdFromEl } from "@tmagic/utils";
|
|
5
5
|
import { shallowReactive } from "vue";
|
|
6
|
-
|
|
6
|
+
// packages/editor/src/services/stageOverlay.ts
|
|
7
7
|
var canUsePluginMethods = {
|
|
8
8
|
async: [],
|
|
9
9
|
sync: [
|
|
@@ -157,5 +157,4 @@ var StageOverlay = class extends BaseService {
|
|
|
157
157
|
}
|
|
158
158
|
};
|
|
159
159
|
var stageOverlay_default = new StageOverlay();
|
|
160
|
-
//#endregion
|
|
161
160
|
export { stageOverlay_default as default };
|
package/dist/es/services/ui.js
CHANGED
|
@@ -4,7 +4,7 @@ import { editorService, storageService } from "./sdk-instance.js";
|
|
|
4
4
|
import "../utils/const.js";
|
|
5
5
|
import { convertToNumber } from "@tmagic/utils";
|
|
6
6
|
import { shallowReactive } from "vue";
|
|
7
|
-
|
|
7
|
+
// packages/editor/src/services/ui.ts
|
|
8
8
|
var state = shallowReactive({
|
|
9
9
|
uiSelectMode: false,
|
|
10
10
|
showSrc: false,
|
|
@@ -117,5 +117,4 @@ var Ui = class extends BaseService {
|
|
|
117
117
|
}
|
|
118
118
|
};
|
|
119
119
|
var ui_default = new Ui();
|
|
120
|
-
//#endregion
|
|
121
120
|
export { ui_default as default };
|