@sepveneto/dnde 0.5.8 → 0.5.10

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.
@@ -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<false | undefined>;
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<false | undefined>;
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<false | undefined>;
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<false | undefined>;
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<false | undefined>;
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<false | undefined>;
99
+ validate(data: any): Promise<boolean>;
100
100
  };
101
101
  };
102
102
  getData: () => Record<string, any>;
package/dist/editor.js CHANGED
@@ -104450,7 +104450,7 @@ var Node$1 = class _Node {
104450
104450
  this.hovering = false;
104451
104451
  this.dragging = false;
104452
104452
  this.widget = widget;
104453
- this.wid = v4();
104453
+ this.wid = (info == null ? void 0 : info.uuid) || v4();
104454
104454
  this.list = (info == null ? void 0 : info.list) || [];
104455
104455
  this.data = (info == null ? void 0 : info.props) || {};
104456
104456
  this.style = (info == null ? void 0 : info.style) || {};
@@ -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", () => {
@@ -105541,8 +105540,9 @@ const useEditor = defineStore("editor", () => {
105541
105540
  const widget2 = app.widgetMap.get(item._view);
105542
105541
  if (!widget2)
105543
105542
  return;
105544
- const { style, list, data: data2 } = item;
105543
+ const { _uuid, style, list, data: data2 } = item;
105545
105544
  const info = {
105545
+ uuid: _uuid,
105546
105546
  props: data2,
105547
105547
  style,
105548
105548
  list: []
@@ -105556,8 +105556,9 @@ const useEditor = defineStore("editor", () => {
105556
105556
  }
105557
105557
  function setData(data) {
105558
105558
  const widget2 = app.widgetMap.get(data._view) || defaultPage;
105559
- const { style, list = [], data: props } = data;
105559
+ const { _uuid, style, list = [], data: props } = data;
105560
105560
  const info = {
105561
+ uuid: _uuid,
105561
105562
  props,
105562
105563
  style,
105563
105564
  list: []
@@ -106904,7 +106905,6 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
106904
106905
  createVNode(_component_ElScrollbar, {
106905
106906
  height: "714px",
106906
106907
  class: "phone-body mpd-scale-100",
106907
- style: normalizeStyle$1(unref(normalizeStyle)(unref(editor).rootNode.style)),
106908
106908
  noresize: ""
106909
106909
  }, {
106910
106910
  default: withCtx(() => [
@@ -106913,7 +106913,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
106913
106913
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(editor).rootNode.list = $event),
106914
106914
  group: { name: "editor", pull: true, put: true },
106915
106915
  class: "mpd-relative mpd-bg-gray-100 mpd-flex mpd-flex-col mpd-items-center",
106916
- style: { "width": "375px", "min-height": "714px" },
106916
+ style: normalizeStyle$1([{ "width": "375px", "min-height": "714px" }, unref(normalizeStyle)(unref(editor).rootNode.style)]),
106917
106917
  "component-data": { type: "transition-group", name: "flip-list" },
106918
106918
  animation: 200,
106919
106919
  "ghost-class": "dragging-ghost",
@@ -106936,10 +106936,10 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
106936
106936
  }, 1032, ["node"])
106937
106937
  ]),
106938
106938
  _: 1
106939
- }, 8, ["modelValue"])
106939
+ }, 8, ["modelValue", "style"])
106940
106940
  ]),
106941
106941
  _: 1
106942
- }, 8, ["style"])
106942
+ })
106943
106943
  ]),
106944
106944
  createBaseVNode("aside", _hoisted_3, [
106945
106945
  createVNode(_component_ElScrollbar, {
@@ -107036,8 +107036,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
107036
107036
  pluginConstructor.init();
107037
107037
  },
107038
107038
  async validate() {
107039
- const validConfig = await editor.plugins.config.validate(editor.rootNode.data);
107040
- if (!validConfig) {
107039
+ const isValid = await editor.plugins.config.validate(editor.rootNode.data);
107040
+ if (!isValid) {
107041
107041
  editor.selectNode();
107042
107042
  await nextTick();
107043
107043
  refApp.value?.validate();
@@ -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<false | undefined>;
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>>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sepveneto/dnde",
3
3
  "type": "module",
4
- "version": "0.5.8",
4
+ "version": "0.5.10",
5
5
  "description": "",
6
6
  "author": "",
7
7
  "license": "GPL",
@@ -46,7 +46,7 @@
46
46
  "vue": "^3.5.15",
47
47
  "vue-router": "^4.5.1",
48
48
  "vuedraggable": "^4.1.0",
49
- "@sepveneto/dnde-core": "0.4.3"
49
+ "@sepveneto/dnde-core": "0.4.4"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@types/node": "^22.15.23",