@sepveneto/dnde 0.5.8 → 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.
@@ -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
@@ -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", () => {
@@ -106904,7 +106903,6 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
106904
106903
  createVNode(_component_ElScrollbar, {
106905
106904
  height: "714px",
106906
106905
  class: "phone-body mpd-scale-100",
106907
- style: normalizeStyle$1(unref(normalizeStyle)(unref(editor).rootNode.style)),
106908
106906
  noresize: ""
106909
106907
  }, {
106910
106908
  default: withCtx(() => [
@@ -106913,7 +106911,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
106913
106911
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(editor).rootNode.list = $event),
106914
106912
  group: { name: "editor", pull: true, put: true },
106915
106913
  class: "mpd-relative mpd-bg-gray-100 mpd-flex mpd-flex-col mpd-items-center",
106916
- style: { "width": "375px", "min-height": "714px" },
106914
+ style: normalizeStyle$1([{ "width": "375px", "min-height": "714px" }, unref(normalizeStyle)(unref(editor).rootNode.style)]),
106917
106915
  "component-data": { type: "transition-group", name: "flip-list" },
106918
106916
  animation: 200,
106919
106917
  "ghost-class": "dragging-ghost",
@@ -106936,10 +106934,10 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
106936
106934
  }, 1032, ["node"])
106937
106935
  ]),
106938
106936
  _: 1
106939
- }, 8, ["modelValue"])
106937
+ }, 8, ["modelValue", "style"])
106940
106938
  ]),
106941
106939
  _: 1
106942
- }, 8, ["style"])
106940
+ })
106943
106941
  ]),
106944
106942
  createBaseVNode("aside", _hoisted_3, [
106945
106943
  createVNode(_component_ElScrollbar, {
@@ -107036,8 +107034,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
107036
107034
  pluginConstructor.init();
107037
107035
  },
107038
107036
  async validate() {
107039
- const validConfig = await editor.plugins.config.validate(editor.rootNode.data);
107040
- if (!validConfig) {
107037
+ const isValid = await editor.plugins.config.validate(editor.rootNode.data);
107038
+ if (!isValid) {
107041
107039
  editor.selectNode();
107042
107040
  await nextTick();
107043
107041
  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.9",
5
5
  "description": "",
6
6
  "author": "",
7
7
  "license": "GPL",