@sepveneto/dnde 0.5.7 → 0.5.9
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/Editor.vue.d.ts +3 -3
- package/dist/components/NodePlugin.vue.d.ts +3 -3
- package/dist/editor.js +24 -27
- package/dist/store/editor.d.ts +1 -1
- package/package.json +1 -1
package/dist/Editor.vue.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ declare const editor: import("pinia").Store<"editor", Pick<{
|
|
|
27
27
|
list: import("./store").ConfigPanel[];
|
|
28
28
|
readonly defaultPane: string;
|
|
29
29
|
addPanel(panel: import("./store").ConfigPanel): void;
|
|
30
|
-
validate(data: any): Promise<
|
|
30
|
+
validate(data: any): Promise<boolean>;
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
33
|
getData: () => Record<string, any>;
|
|
@@ -61,7 +61,7 @@ declare const editor: import("pinia").Store<"editor", Pick<{
|
|
|
61
61
|
list: import("./store").ConfigPanel[];
|
|
62
62
|
readonly defaultPane: string;
|
|
63
63
|
addPanel(panel: import("./store").ConfigPanel): void;
|
|
64
|
-
validate(data: any): Promise<
|
|
64
|
+
validate(data: any): Promise<boolean>;
|
|
65
65
|
};
|
|
66
66
|
};
|
|
67
67
|
getData: () => Record<string, any>;
|
|
@@ -95,7 +95,7 @@ declare const editor: import("pinia").Store<"editor", Pick<{
|
|
|
95
95
|
list: import("./store").ConfigPanel[];
|
|
96
96
|
readonly defaultPane: string;
|
|
97
97
|
addPanel(panel: import("./store").ConfigPanel): void;
|
|
98
|
-
validate(data: any): Promise<
|
|
98
|
+
validate(data: any): Promise<boolean>;
|
|
99
99
|
};
|
|
100
100
|
};
|
|
101
101
|
getData: () => Record<string, any>;
|
|
@@ -28,7 +28,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
28
28
|
list: import("@/store").ConfigPanel[];
|
|
29
29
|
readonly defaultPane: string;
|
|
30
30
|
addPanel(panel: import("@/store").ConfigPanel): void;
|
|
31
|
-
validate(data: any): Promise<
|
|
31
|
+
validate(data: any): Promise<boolean>;
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
34
|
getData: () => Record<string, any>;
|
|
@@ -62,7 +62,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
62
62
|
list: import("@/store").ConfigPanel[];
|
|
63
63
|
readonly defaultPane: string;
|
|
64
64
|
addPanel(panel: import("@/store").ConfigPanel): void;
|
|
65
|
-
validate(data: any): Promise<
|
|
65
|
+
validate(data: any): Promise<boolean>;
|
|
66
66
|
};
|
|
67
67
|
};
|
|
68
68
|
getData: () => Record<string, any>;
|
|
@@ -96,7 +96,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
96
96
|
list: import("@/store").ConfigPanel[];
|
|
97
97
|
readonly defaultPane: string;
|
|
98
98
|
addPanel(panel: import("@/store").ConfigPanel): void;
|
|
99
|
-
validate(data: any): Promise<
|
|
99
|
+
validate(data: any): Promise<boolean>;
|
|
100
100
|
};
|
|
101
101
|
};
|
|
102
102
|
getData: () => Record<string, any>;
|
package/dist/editor.js
CHANGED
|
@@ -80552,7 +80552,7 @@ const _hoisted_2$6 = /* @__PURE__ */ createBaseVNode(
|
|
|
80552
80552
|
-1
|
|
80553
80553
|
/* HOISTED */
|
|
80554
80554
|
);
|
|
80555
|
-
const _hoisted_3$
|
|
80555
|
+
const _hoisted_3$3 = /* @__PURE__ */ createBaseVNode(
|
|
80556
80556
|
"br",
|
|
80557
80557
|
null,
|
|
80558
80558
|
null,
|
|
@@ -80607,7 +80607,7 @@ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
80607
80607
|
default: withCtx(() => [
|
|
80608
80608
|
createBaseVNode("div", _hoisted_1$d, [
|
|
80609
80609
|
_hoisted_2$6,
|
|
80610
|
-
_hoisted_3$
|
|
80610
|
+
_hoisted_3$3,
|
|
80611
80611
|
createVNode(_component_el_link, {
|
|
80612
80612
|
type: "primary",
|
|
80613
80613
|
onClick: _ctx.handleDownloadTemplate
|
|
@@ -81196,7 +81196,7 @@ const _hoisted_2$5 = {
|
|
|
81196
81196
|
key: 2,
|
|
81197
81197
|
class: "placeholder"
|
|
81198
81198
|
};
|
|
81199
|
-
const _hoisted_3$
|
|
81199
|
+
const _hoisted_3$2 = {
|
|
81200
81200
|
key: 3,
|
|
81201
81201
|
class: "svg-badge"
|
|
81202
81202
|
};
|
|
@@ -81238,7 +81238,7 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
81238
81238
|
!_ctx.icon ? (openBlock(), createElementBlock("span", _hoisted_2$5)) : createCommentVNode("v-if", true),
|
|
81239
81239
|
_ctx.badge ? (openBlock(), createElementBlock(
|
|
81240
81240
|
"div",
|
|
81241
|
-
_hoisted_3$
|
|
81241
|
+
_hoisted_3$2,
|
|
81242
81242
|
toDisplayString(_ctx.badge),
|
|
81243
81243
|
1
|
|
81244
81244
|
/* TEXT */
|
|
@@ -105429,13 +105429,11 @@ class ConfigPlugin {
|
|
|
105429
105429
|
}
|
|
105430
105430
|
async validate(data) {
|
|
105431
105431
|
for (const pane of this.list) {
|
|
105432
|
-
if (!data[pane.name])
|
|
105433
|
-
continue;
|
|
105434
105432
|
const _rules = pane.attributes.reduce((all, curr) => {
|
|
105435
105433
|
all[curr.key] = curr.rules || [];
|
|
105436
105434
|
return all;
|
|
105437
105435
|
}, {}) || {};
|
|
105438
|
-
const valid = await new Schema(_rules).validate(data[pane.name]).catch(() => {
|
|
105436
|
+
const valid = await new Schema(_rules).validate(data[pane.name] || {}).catch(() => {
|
|
105439
105437
|
return false;
|
|
105440
105438
|
});
|
|
105441
105439
|
if (valid) {
|
|
@@ -105443,6 +105441,7 @@ class ConfigPlugin {
|
|
|
105443
105441
|
}
|
|
105444
105442
|
return false;
|
|
105445
105443
|
}
|
|
105444
|
+
return true;
|
|
105446
105445
|
}
|
|
105447
105446
|
}
|
|
105448
105447
|
const useEditor = defineStore("editor", () => {
|
|
@@ -105815,7 +105814,7 @@ const _hoisted_2$4 = {
|
|
|
105815
105814
|
class: "mpd-flex mpd-items-center",
|
|
105816
105815
|
style: { "color": "#fff" }
|
|
105817
105816
|
};
|
|
105818
|
-
const _hoisted_3$
|
|
105817
|
+
const _hoisted_3$1 = { class: "icon-wrap" };
|
|
105819
105818
|
const _hoisted_4 = { class: "icon-wrap" };
|
|
105820
105819
|
const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
105821
105820
|
__name: "NodeOperate",
|
|
@@ -105865,7 +105864,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
105865
105864
|
]),
|
|
105866
105865
|
default: withCtx(() => [
|
|
105867
105866
|
createBaseVNode("div", _hoisted_2$4, [
|
|
105868
|
-
createBaseVNode("i", _hoisted_3$
|
|
105867
|
+
createBaseVNode("i", _hoisted_3$1, [
|
|
105869
105868
|
_ctx.node.isContainer ? (openBlock(), createBlock(IconContainer, { key: 0 })) : (openBlock(), createBlock(IconItem, { key: 1 }))
|
|
105870
105869
|
]),
|
|
105871
105870
|
createBaseVNode("span", null, toDisplayString(_ctx.node.name), 1)
|
|
@@ -105884,9 +105883,8 @@ const _style_0$5 = ".node-operate[data-v-d8fd7781] {\n display: flex;\n -moz-c
|
|
|
105884
105883
|
|
|
105885
105884
|
const NodeOperate = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["styles", [_style_0$5]], ["__scopeId", "data-v-d8fd7781"]]);
|
|
105886
105885
|
|
|
105887
|
-
const _hoisted_1$6 = ["data-id"];
|
|
105888
|
-
const _hoisted_2$3 =
|
|
105889
|
-
const _hoisted_3$1 = {
|
|
105886
|
+
const _hoisted_1$6 = ["data-id", "data-name"];
|
|
105887
|
+
const _hoisted_2$3 = {
|
|
105890
105888
|
key: 1,
|
|
105891
105889
|
class: "hidden-mask mpd-absolute mpd-left-0 mpd-top-0 mpd-right-0 mpd-bottom-0 mpd-pointer-events-none mpd-flex mpd-justify-center mpd-items-center",
|
|
105892
105890
|
style: { "background": "#33333333" }
|
|
@@ -105909,13 +105907,13 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
105909
105907
|
return (_ctx, _cache) => {
|
|
105910
105908
|
const _component_ElIcon = resolveComponent("ElIcon");
|
|
105911
105909
|
return openBlock(), createElementBlock("div", {
|
|
105912
|
-
class: "mpd-node mpd-relative",
|
|
105910
|
+
class: normalizeClass(["mpd-node mpd-relative", [isActive.value && "selected", isDraggable.value && "draggable", isHover.value && "hover"]]),
|
|
105913
105911
|
"data-id": _ctx.node.wid,
|
|
105914
|
-
style: normalizeStyle$1(unref(normalizeStyle)(_ctx.node.style))
|
|
105912
|
+
style: normalizeStyle$1(unref(normalizeStyle)(_ctx.node.style)),
|
|
105913
|
+
"data-name": _ctx.node.name
|
|
105915
105914
|
}, [
|
|
105916
105915
|
createBaseVNode("div", {
|
|
105917
|
-
class:
|
|
105918
|
-
"data-name": _ctx.node.name,
|
|
105916
|
+
class: "node-wrap",
|
|
105919
105917
|
onMouseenter: _cache[0] || (_cache[0] = withModifiers(($event) => unref(editor).hovering = _ctx.node.wid, ["stop"])),
|
|
105920
105918
|
onMouseleave: _cache[1] || (_cache[1] = withModifiers(($event) => unref(editor).hovering = void 0, ["stop"])),
|
|
105921
105919
|
onClick: _cache[2] || (_cache[2] = withModifiers(($event) => unref(editor).selected = _ctx.node.wid, ["stop"]))
|
|
@@ -105927,12 +105925,12 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
105927
105925
|
}, null, 8, ["data-id", "node"])) : renderSlot(_ctx.$slots, "default", { key: 1 }, () => [
|
|
105928
105926
|
_cache[3] || (_cache[3] = createBaseVNode("div", null, "拖曳组件", -1))
|
|
105929
105927
|
], true)
|
|
105930
|
-
],
|
|
105928
|
+
], 32),
|
|
105931
105929
|
isActive.value ? (openBlock(), createBlock(NodeOperate, {
|
|
105932
105930
|
key: 0,
|
|
105933
105931
|
node: _ctx.node
|
|
105934
105932
|
}, null, 8, ["node"])) : createCommentVNode("", true),
|
|
105935
|
-
_ctx.node.visible === false ? (openBlock(), createElementBlock("div",
|
|
105933
|
+
_ctx.node.visible === false ? (openBlock(), createElementBlock("div", _hoisted_2$3, [
|
|
105936
105934
|
createVNode(_component_ElIcon, { size: 48 }, {
|
|
105937
105935
|
default: withCtx(() => [
|
|
105938
105936
|
createVNode(unref(hide_default))
|
|
@@ -105940,14 +105938,14 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
105940
105938
|
_: 1
|
|
105941
105939
|
})
|
|
105942
105940
|
])) : createCommentVNode("", true)
|
|
105943
|
-
],
|
|
105941
|
+
], 14, _hoisted_1$6);
|
|
105944
105942
|
};
|
|
105945
105943
|
}
|
|
105946
105944
|
});
|
|
105947
105945
|
|
|
105948
|
-
const _style_0$4 = ".
|
|
105946
|
+
const _style_0$4 = ".mpd-node.draggable[data-v-d5036eca] {\n cursor: grab;\n}\n.mpd-node.draggable[data-v-d5036eca]:active {\n cursor: grabbing;\n}\n.mpd-node.selected[data-v-d5036eca]::after {\n border: 1px solid #4089Ef;\n}\n.mpd-node.hover[data-v-d5036eca]::after {\n border: 1px dashed #4089Ef;\n}\n.mpd-node.hover[data-v-d5036eca]::before {\n content: attr(data-name);\n position: absolute;\n top: 0;\n font-size: 14px;\n color: #fff;\n background: #4089Ef;\n padding: 4px;\n z-index: 1;\n}\n.mpd-node[data-v-d5036eca]::after {\n content: \"\";\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n pointer-events: none;\n z-index: 1;\n}\n.node-wrap[data-v-d5036eca] {\n position: relative;\n width: 100%;\n height: 100%;\n min-height: inherit;\n cursor: default;\n}";
|
|
105949
105947
|
|
|
105950
|
-
const NodeWrap = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["styles", [_style_0$4]], ["__scopeId", "data-v-
|
|
105948
|
+
const NodeWrap = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["styles", [_style_0$4]], ["__scopeId", "data-v-d5036eca"]]);
|
|
105951
105949
|
|
|
105952
105950
|
const _hoisted_1$5 = {
|
|
105953
105951
|
class: "mpd-color-picker",
|
|
@@ -106905,7 +106903,6 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
106905
106903
|
createVNode(_component_ElScrollbar, {
|
|
106906
106904
|
height: "714px",
|
|
106907
106905
|
class: "phone-body mpd-scale-100",
|
|
106908
|
-
style: normalizeStyle$1(unref(normalizeStyle)(unref(editor).rootNode.style)),
|
|
106909
106906
|
noresize: ""
|
|
106910
106907
|
}, {
|
|
106911
106908
|
default: withCtx(() => [
|
|
@@ -106914,7 +106911,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
106914
106911
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(editor).rootNode.list = $event),
|
|
106915
106912
|
group: { name: "editor", pull: true, put: true },
|
|
106916
106913
|
class: "mpd-relative mpd-bg-gray-100 mpd-flex mpd-flex-col mpd-items-center",
|
|
106917
|
-
style: { "width": "375px", "min-height": "714px" },
|
|
106914
|
+
style: normalizeStyle$1([{ "width": "375px", "min-height": "714px" }, unref(normalizeStyle)(unref(editor).rootNode.style)]),
|
|
106918
106915
|
"component-data": { type: "transition-group", name: "flip-list" },
|
|
106919
106916
|
animation: 200,
|
|
106920
106917
|
"ghost-class": "dragging-ghost",
|
|
@@ -106937,10 +106934,10 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
106937
106934
|
}, 1032, ["node"])
|
|
106938
106935
|
]),
|
|
106939
106936
|
_: 1
|
|
106940
|
-
}, 8, ["modelValue"])
|
|
106937
|
+
}, 8, ["modelValue", "style"])
|
|
106941
106938
|
]),
|
|
106942
106939
|
_: 1
|
|
106943
|
-
}
|
|
106940
|
+
})
|
|
106944
106941
|
]),
|
|
106945
106942
|
createBaseVNode("aside", _hoisted_3, [
|
|
106946
106943
|
createVNode(_component_ElScrollbar, {
|
|
@@ -107037,8 +107034,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
107037
107034
|
pluginConstructor.init();
|
|
107038
107035
|
},
|
|
107039
107036
|
async validate() {
|
|
107040
|
-
const
|
|
107041
|
-
if (!
|
|
107037
|
+
const isValid = await editor.plugins.config.validate(editor.rootNode.data);
|
|
107038
|
+
if (!isValid) {
|
|
107042
107039
|
editor.selectNode();
|
|
107043
107040
|
await nextTick();
|
|
107044
107041
|
refApp.value?.validate();
|
package/dist/store/editor.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ declare class ConfigPlugin {
|
|
|
27
27
|
constructor(_ctx?: any);
|
|
28
28
|
get defaultPane(): string;
|
|
29
29
|
addPanel(panel: ConfigPanel): void;
|
|
30
|
-
validate(data: any): Promise<
|
|
30
|
+
validate(data: any): Promise<boolean>;
|
|
31
31
|
}
|
|
32
32
|
export declare const useEditor: import("pinia").StoreDefinition<"editor", Pick<{
|
|
33
33
|
rootNode: import("vue").Ref<Raw<Node>, Raw<Node>>;
|