@tmagic/editor 1.2.0-beta.25 → 1.2.0-beta.26
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/style.css +32 -16
- package/dist/tmagic-editor.js +18 -5
- package/dist/tmagic-editor.js.map +1 -1
- package/dist/tmagic-editor.umd.cjs +18 -5
- package/dist/tmagic-editor.umd.cjs.map +1 -1
- package/package.json +10 -10
- package/src/Editor.vue +7 -2
- package/src/layouts/NavMenu.vue +1 -1
- package/src/services/editor.ts +12 -1
- package/src/theme/code-block.scss +11 -3
- package/src/theme/component-list-panel.scss +8 -5
- package/src/type.ts +1 -0
- package/src/utils/stage.ts +1 -0
- package/types/Editor.vue.d.ts +7 -0
- package/types/components/CodeDraftEditor.vue.d.ts +19 -111
- package/types/components/ContentMenu.vue.d.ts +11 -87
- package/types/components/FunctionEditor.vue.d.ts +13 -90
- package/types/components/Icon.vue.d.ts +4 -50
- package/types/components/ScrollBar.vue.d.ts +7 -65
- package/types/components/ToolButton.vue.d.ts +12 -78
- package/types/fields/Code.vue.d.ts +11 -77
- package/types/fields/CodeLink.vue.d.ts +12 -82
- package/types/fields/CodeSelect.vue.d.ts +10 -74
- package/types/fields/UISelect.vue.d.ts +7 -65
- package/types/layouts/AddPageBox.vue.d.ts +1 -43
- package/types/layouts/CodeEditor.vue.d.ts +21 -122
- package/types/layouts/NavMenu.vue.d.ts +9 -69
- package/types/layouts/sidebar/LayerMenu.vue.d.ts +5 -55
- package/types/layouts/workspace/Breadcrumb.vue.d.ts +1 -43
- package/types/layouts/workspace/Stage.vue.d.ts +4 -51
- package/types/layouts/workspace/ViewerMenu.vue.d.ts +9 -69
- package/types/type.d.ts +1 -0
|
@@ -2026,8 +2026,16 @@
|
|
|
2026
2026
|
const config = await storageService.getItem(COPY_STORAGE_KEY);
|
|
2027
2027
|
if (!Array.isArray(config))
|
|
2028
2028
|
return;
|
|
2029
|
+
const node = this.get("node");
|
|
2030
|
+
let parent = void 0;
|
|
2031
|
+
if (config.length === 1 && config[0].id === node.id) {
|
|
2032
|
+
parent = this.get("parent");
|
|
2033
|
+
if (parent.type === schema.NodeType.ROOT) {
|
|
2034
|
+
parent = this.get("page");
|
|
2035
|
+
}
|
|
2036
|
+
}
|
|
2029
2037
|
const pasteConfigs = await this.doPaste(config, position);
|
|
2030
|
-
return this.add(pasteConfigs,
|
|
2038
|
+
return this.add(pasteConfigs, parent);
|
|
2031
2039
|
}
|
|
2032
2040
|
async doPaste(config, position = {}) {
|
|
2033
2041
|
const pasteConfigs = await beforePaste(position, lodashEs.cloneDeep(config));
|
|
@@ -2615,6 +2623,7 @@
|
|
|
2615
2623
|
containerHighlightClassName: stageOptions.containerHighlightClassName,
|
|
2616
2624
|
containerHighlightDuration: stageOptions.containerHighlightDuration,
|
|
2617
2625
|
containerHighlightType: stageOptions.containerHighlightType,
|
|
2626
|
+
disabledDragStart: stageOptions.disabledDragStart,
|
|
2618
2627
|
canSelect: (el, event, stop) => {
|
|
2619
2628
|
const elCanSelect = stageOptions.canSelect(el);
|
|
2620
2629
|
if (uiSelectMode.value && elCanSelect && event.type === "mousedown") {
|
|
@@ -5811,7 +5820,7 @@
|
|
|
5811
5820
|
const _sfc_main = vue.defineComponent({
|
|
5812
5821
|
name: "m-editor",
|
|
5813
5822
|
components: {
|
|
5814
|
-
|
|
5823
|
+
TMagicNavMenu: _sfc_main$j,
|
|
5815
5824
|
Sidebar: _sfc_main$9,
|
|
5816
5825
|
Workspace: _sfc_main$1,
|
|
5817
5826
|
PropsPanel: _sfc_main$i,
|
|
@@ -5894,6 +5903,9 @@
|
|
|
5894
5903
|
},
|
|
5895
5904
|
updateDragEl: {
|
|
5896
5905
|
type: Function
|
|
5906
|
+
},
|
|
5907
|
+
disabledDragStart: {
|
|
5908
|
+
type: Boolean
|
|
5897
5909
|
}
|
|
5898
5910
|
},
|
|
5899
5911
|
emits: ["props-panel-mounted", "update:modelValue"],
|
|
@@ -6009,7 +6021,8 @@
|
|
|
6009
6021
|
isContainer: props.isContainer,
|
|
6010
6022
|
containerHighlightClassName: props.containerHighlightClassName,
|
|
6011
6023
|
containerHighlightDuration: props.containerHighlightDuration,
|
|
6012
|
-
containerHighlightType: props.containerHighlightType
|
|
6024
|
+
containerHighlightType: props.containerHighlightType,
|
|
6025
|
+
disabledDragStart: props.disabledDragStart
|
|
6013
6026
|
})
|
|
6014
6027
|
);
|
|
6015
6028
|
return services;
|
|
@@ -6025,7 +6038,7 @@
|
|
|
6025
6038
|
};
|
|
6026
6039
|
|
|
6027
6040
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
6028
|
-
const
|
|
6041
|
+
const _component_TMagicNavMenu = vue.resolveComponent("TMagicNavMenu");
|
|
6029
6042
|
const _component_Sidebar = vue.resolveComponent("Sidebar");
|
|
6030
6043
|
const _component_Workspace = vue.resolveComponent("Workspace");
|
|
6031
6044
|
const _component_PropsPanel = vue.resolveComponent("PropsPanel");
|
|
@@ -6033,7 +6046,7 @@
|
|
|
6033
6046
|
return vue.openBlock(), vue.createBlock(_component_Framework, { "code-options": _ctx.codeOptions }, {
|
|
6034
6047
|
nav: vue.withCtx(() => [
|
|
6035
6048
|
vue.renderSlot(_ctx.$slots, "nav", { editorService: _ctx.editorService }, () => [
|
|
6036
|
-
vue.createVNode(
|
|
6049
|
+
vue.createVNode(_component_TMagicNavMenu, { data: _ctx.menu }, null, 8, ["data"])
|
|
6037
6050
|
])
|
|
6038
6051
|
]),
|
|
6039
6052
|
sidebar: vue.withCtx(() => [
|