@tmagic/editor 1.2.0-beta.24 → 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
package/dist/style.css
CHANGED
|
@@ -325,13 +325,13 @@
|
|
|
325
325
|
left: 0;
|
|
326
326
|
z-index: 1;
|
|
327
327
|
}
|
|
328
|
-
.ui-component-panel {
|
|
328
|
+
.ui-component-panel.tmagic-design-collapse {
|
|
329
329
|
height: 100%;
|
|
330
330
|
border-top: 0 !important;
|
|
331
331
|
margin-top: 48px;
|
|
332
332
|
background-color: #ffffff;
|
|
333
333
|
}
|
|
334
|
-
.ui-component-panel .search-input {
|
|
334
|
+
.ui-component-panel.tmagic-design-collapse .search-input {
|
|
335
335
|
background: #fff;
|
|
336
336
|
color: #bbbbbb;
|
|
337
337
|
padding: 10px;
|
|
@@ -341,14 +341,15 @@
|
|
|
341
341
|
box-sizing: border-box;
|
|
342
342
|
z-index: 1;
|
|
343
343
|
}
|
|
344
|
-
.ui-component-panel .search-input .el-input__prefix {
|
|
344
|
+
.ui-component-panel.tmagic-design-collapse .search-input .el-input__prefix {
|
|
345
345
|
padding: 7px;
|
|
346
346
|
}
|
|
347
|
-
.ui-component-panel .
|
|
347
|
+
.ui-component-panel.tmagic-design-collapse .tmagic-design-collapse-item > div:first-of-type {
|
|
348
348
|
border-bottom: 1px solid #d9dbdd;
|
|
349
349
|
margin-bottom: 10px;
|
|
350
350
|
}
|
|
351
|
-
.ui-component-panel .el-collapse-item__header
|
|
351
|
+
.ui-component-panel.tmagic-design-collapse .el-collapse-item__header,
|
|
352
|
+
.ui-component-panel.tmagic-design-collapse .t-collapse-panel__header {
|
|
352
353
|
background: #ffffff;
|
|
353
354
|
color: #070303;
|
|
354
355
|
height: 25px;
|
|
@@ -356,20 +357,26 @@
|
|
|
356
357
|
padding-left: 10px;
|
|
357
358
|
font-size: 12px;
|
|
358
359
|
}
|
|
359
|
-
.ui-component-panel .el-collapse-item__header i
|
|
360
|
+
.ui-component-panel.tmagic-design-collapse .el-collapse-item__header i,
|
|
361
|
+
.ui-component-panel.tmagic-design-collapse .t-collapse-panel__header i {
|
|
360
362
|
margin-right: 5px;
|
|
361
363
|
font-size: 14px;
|
|
362
364
|
}
|
|
363
|
-
.ui-component-panel .el-collapse-item__wrap
|
|
365
|
+
.ui-component-panel.tmagic-design-collapse .el-collapse-item__wrap,
|
|
366
|
+
.ui-component-panel.tmagic-design-collapse .t-collapse-panel__body {
|
|
364
367
|
background: #ffffff;
|
|
365
368
|
border-bottom: 0;
|
|
366
369
|
}
|
|
367
|
-
.ui-component-panel .el-collapse-item__wrap .el-collapse-item__content
|
|
370
|
+
.ui-component-panel.tmagic-design-collapse .el-collapse-item__wrap .el-collapse-item__content,
|
|
371
|
+
.ui-component-panel.tmagic-design-collapse .el-collapse-item__wrap .t-collapse-panel__content,
|
|
372
|
+
.ui-component-panel.tmagic-design-collapse .t-collapse-panel__body .el-collapse-item__content,
|
|
373
|
+
.ui-component-panel.tmagic-design-collapse .t-collapse-panel__body .t-collapse-panel__content {
|
|
368
374
|
padding: 10px;
|
|
369
375
|
display: flex;
|
|
370
376
|
flex-wrap: wrap;
|
|
371
377
|
}
|
|
372
|
-
.ui-component-panel .el-collapse-item__wrap .component-item
|
|
378
|
+
.ui-component-panel.tmagic-design-collapse .el-collapse-item__wrap .component-item,
|
|
379
|
+
.ui-component-panel.tmagic-design-collapse .t-collapse-panel__body .component-item {
|
|
373
380
|
display: flex;
|
|
374
381
|
overflow: hidden;
|
|
375
382
|
text-overflow: ellipsis;
|
|
@@ -380,7 +387,8 @@
|
|
|
380
387
|
width: 42px;
|
|
381
388
|
cursor: pointer;
|
|
382
389
|
}
|
|
383
|
-
.ui-component-panel .el-collapse-item__wrap .component-item i
|
|
390
|
+
.ui-component-panel.tmagic-design-collapse .el-collapse-item__wrap .component-item i,
|
|
391
|
+
.ui-component-panel.tmagic-design-collapse .t-collapse-panel__body .component-item i {
|
|
384
392
|
font-size: 20px;
|
|
385
393
|
background: #fff;
|
|
386
394
|
height: 40px;
|
|
@@ -394,16 +402,19 @@
|
|
|
394
402
|
align-items: center;
|
|
395
403
|
margin-bottom: 5px;
|
|
396
404
|
}
|
|
397
|
-
.ui-component-panel .el-collapse-item__wrap .component-item i:hover
|
|
405
|
+
.ui-component-panel.tmagic-design-collapse .el-collapse-item__wrap .component-item i:hover,
|
|
406
|
+
.ui-component-panel.tmagic-design-collapse .t-collapse-panel__body .component-item i:hover {
|
|
398
407
|
background: #2882e0;
|
|
399
408
|
color: #fff;
|
|
400
409
|
border-color: #4e8be1;
|
|
401
410
|
}
|
|
402
|
-
.ui-component-panel .el-collapse-item__wrap .component-item span
|
|
411
|
+
.ui-component-panel.tmagic-design-collapse .el-collapse-item__wrap .component-item span,
|
|
412
|
+
.ui-component-panel.tmagic-design-collapse .t-collapse-panel__body .component-item span {
|
|
403
413
|
font-size: 12px;
|
|
404
414
|
text-align: center;
|
|
405
415
|
}
|
|
406
|
-
.ui-component-panel .el-collapse-item__wrap .component-item .el-tooltip
|
|
416
|
+
.ui-component-panel.tmagic-design-collapse .el-collapse-item__wrap .component-item .el-tooltip,
|
|
417
|
+
.ui-component-panel.tmagic-design-collapse .t-collapse-panel__body .component-item .el-tooltip {
|
|
407
418
|
width: 50px;
|
|
408
419
|
height: 30px;
|
|
409
420
|
line-height: 15px;
|
|
@@ -696,15 +707,20 @@
|
|
|
696
707
|
.el-dialog.is-fullscreen.code-editor-dialog {
|
|
697
708
|
overflow: hidden;
|
|
698
709
|
}
|
|
699
|
-
.code-editor-dialog .
|
|
710
|
+
.code-editor-dialog .tmagic-design-card .t-card__header {
|
|
711
|
+
display: block;
|
|
712
|
+
}
|
|
713
|
+
.code-editor-dialog .el-dialog__body,
|
|
714
|
+
.code-editor-dialog .t-dialog__body {
|
|
700
715
|
height: 90%;
|
|
701
716
|
padding-top: 10px;
|
|
702
717
|
}
|
|
703
|
-
.code-editor-dialog .
|
|
718
|
+
.code-editor-dialog .tmagic-design-card {
|
|
704
719
|
height: 100%;
|
|
705
720
|
background: #fff;
|
|
706
721
|
}
|
|
707
|
-
.code-editor-dialog .
|
|
722
|
+
.code-editor-dialog .tmagic-design-card .el-card__body,
|
|
723
|
+
.code-editor-dialog .tmagic-design-card .t-card__body {
|
|
708
724
|
height: 100%;
|
|
709
725
|
background: #fff;
|
|
710
726
|
}
|
package/dist/tmagic-editor.js
CHANGED
|
@@ -2009,8 +2009,16 @@ class Editor$1 extends BaseService {
|
|
|
2009
2009
|
const config = await storageService.getItem(COPY_STORAGE_KEY);
|
|
2010
2010
|
if (!Array.isArray(config))
|
|
2011
2011
|
return;
|
|
2012
|
+
const node = this.get("node");
|
|
2013
|
+
let parent = void 0;
|
|
2014
|
+
if (config.length === 1 && config[0].id === node.id) {
|
|
2015
|
+
parent = this.get("parent");
|
|
2016
|
+
if (parent.type === NodeType.ROOT) {
|
|
2017
|
+
parent = this.get("page");
|
|
2018
|
+
}
|
|
2019
|
+
}
|
|
2012
2020
|
const pasteConfigs = await this.doPaste(config, position);
|
|
2013
|
-
return this.add(pasteConfigs,
|
|
2021
|
+
return this.add(pasteConfigs, parent);
|
|
2014
2022
|
}
|
|
2015
2023
|
async doPaste(config, position = {}) {
|
|
2016
2024
|
const pasteConfigs = await beforePaste(position, cloneDeep(config));
|
|
@@ -2598,6 +2606,7 @@ const useStage = (stageOptions) => {
|
|
|
2598
2606
|
containerHighlightClassName: stageOptions.containerHighlightClassName,
|
|
2599
2607
|
containerHighlightDuration: stageOptions.containerHighlightDuration,
|
|
2600
2608
|
containerHighlightType: stageOptions.containerHighlightType,
|
|
2609
|
+
disabledDragStart: stageOptions.disabledDragStart,
|
|
2601
2610
|
canSelect: (el, event, stop) => {
|
|
2602
2611
|
const elCanSelect = stageOptions.canSelect(el);
|
|
2603
2612
|
if (uiSelectMode.value && elCanSelect && event.type === "mousedown") {
|
|
@@ -5794,7 +5803,7 @@ const componentListService = new ComponentList();
|
|
|
5794
5803
|
const _sfc_main = defineComponent({
|
|
5795
5804
|
name: "m-editor",
|
|
5796
5805
|
components: {
|
|
5797
|
-
|
|
5806
|
+
TMagicNavMenu: _sfc_main$j,
|
|
5798
5807
|
Sidebar: _sfc_main$9,
|
|
5799
5808
|
Workspace: _sfc_main$1,
|
|
5800
5809
|
PropsPanel: _sfc_main$i,
|
|
@@ -5877,6 +5886,9 @@ const _sfc_main = defineComponent({
|
|
|
5877
5886
|
},
|
|
5878
5887
|
updateDragEl: {
|
|
5879
5888
|
type: Function
|
|
5889
|
+
},
|
|
5890
|
+
disabledDragStart: {
|
|
5891
|
+
type: Boolean
|
|
5880
5892
|
}
|
|
5881
5893
|
},
|
|
5882
5894
|
emits: ["props-panel-mounted", "update:modelValue"],
|
|
@@ -5992,7 +6004,8 @@ const _sfc_main = defineComponent({
|
|
|
5992
6004
|
isContainer: props.isContainer,
|
|
5993
6005
|
containerHighlightClassName: props.containerHighlightClassName,
|
|
5994
6006
|
containerHighlightDuration: props.containerHighlightDuration,
|
|
5995
|
-
containerHighlightType: props.containerHighlightType
|
|
6007
|
+
containerHighlightType: props.containerHighlightType,
|
|
6008
|
+
disabledDragStart: props.disabledDragStart
|
|
5996
6009
|
})
|
|
5997
6010
|
);
|
|
5998
6011
|
return services;
|
|
@@ -6008,7 +6021,7 @@ const _export_sfc = (sfc, props) => {
|
|
|
6008
6021
|
};
|
|
6009
6022
|
|
|
6010
6023
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
6011
|
-
const
|
|
6024
|
+
const _component_TMagicNavMenu = resolveComponent("TMagicNavMenu");
|
|
6012
6025
|
const _component_Sidebar = resolveComponent("Sidebar");
|
|
6013
6026
|
const _component_Workspace = resolveComponent("Workspace");
|
|
6014
6027
|
const _component_PropsPanel = resolveComponent("PropsPanel");
|
|
@@ -6016,7 +6029,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
6016
6029
|
return openBlock(), createBlock(_component_Framework, { "code-options": _ctx.codeOptions }, {
|
|
6017
6030
|
nav: withCtx(() => [
|
|
6018
6031
|
renderSlot(_ctx.$slots, "nav", { editorService: _ctx.editorService }, () => [
|
|
6019
|
-
createVNode(
|
|
6032
|
+
createVNode(_component_TMagicNavMenu, { data: _ctx.menu }, null, 8, ["data"])
|
|
6020
6033
|
])
|
|
6021
6034
|
]),
|
|
6022
6035
|
sidebar: withCtx(() => [
|