@sepveneto/dnde-core 0.3.1 → 0.4.1

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.
@@ -1,8 +1,7 @@
1
1
  import {
2
2
  __async,
3
- __spreadProps,
4
3
  __spreadValues
5
- } from "./chunk-6FNC3XMI.js";
4
+ } from "./chunk-HJO26HIQ.js";
6
5
 
7
6
  // src/class/Node.ts
8
7
  import { v4 } from "uuid";
@@ -86,16 +85,16 @@ var Node = class _Node {
86
85
  }
87
86
  parse() {
88
87
  var _a;
89
- const res = __spreadProps(__spreadValues({
88
+ const res = {
90
89
  _uuid: this.wid,
91
90
  _name: this.name,
92
91
  _view: this.type,
93
92
  // TODO
94
- isShow: true
95
- }, this.data), {
93
+ isShow: true,
94
+ data: this.data,
96
95
  style: this.style,
97
96
  list: (_a = this.list) == null ? void 0 : _a.map((item) => item.parse())
98
- });
97
+ };
99
98
  return res;
100
99
  }
101
100
  };
@@ -1,6 +1,4 @@
1
1
  var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
2
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
3
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
4
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
@@ -16,7 +14,6 @@ var __spreadValues = (a, b) => {
16
14
  }
17
15
  return a;
18
16
  };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
17
  var __async = (__this, __arguments, generator) => {
21
18
  return new Promise((resolve, reject) => {
22
19
  var fulfilled = (value) => {
@@ -40,6 +37,5 @@ var __async = (__this, __arguments, generator) => {
40
37
 
41
38
  export {
42
39
  __spreadValues,
43
- __spreadProps,
44
40
  __async
45
41
  };
@@ -60,6 +60,15 @@ var schema = {
60
60
  rules: normalizeRules(config)
61
61
  };
62
62
  },
63
+ color(config) {
64
+ return {
65
+ label: config.label,
66
+ key: config.key,
67
+ type: "colorPicker",
68
+ attrs: config.attrs,
69
+ rules: normalizeRules(config)
70
+ };
71
+ },
63
72
  custom(config) {
64
73
  return {
65
74
  label: config.label,
@@ -40,6 +40,24 @@ var widget = {
40
40
  name,
41
41
  list
42
42
  };
43
+ },
44
+ widget(name, list) {
45
+ return {
46
+ type: 0 /* WIDGET */,
47
+ name,
48
+ list
49
+ };
50
+ },
51
+ root(config) {
52
+ return this.create({
53
+ name: config.name || "\u9875\u9762",
54
+ type: "page",
55
+ config: { visible: false },
56
+ defaultData: config.defaultData,
57
+ defaultStyle: config.defaultStyle,
58
+ attributes: config.attributes,
59
+ stylesheet: config.stylesheet
60
+ });
43
61
  }
44
62
  };
45
63
 
@@ -2,7 +2,7 @@ import {
2
2
  Container
3
3
  } from "../chunk-ZNYRMDSU.js";
4
4
  import "../chunk-KHPFRVKB.js";
5
- import "../chunk-6FNC3XMI.js";
5
+ import "../chunk-HJO26HIQ.js";
6
6
  export {
7
7
  Container
8
8
  };
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
  var __defProp = Object.defineProperty;
3
- var __defProps = Object.defineProperties;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
5
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
@@ -19,7 +17,6 @@ var __spreadValues = (a, b) => {
19
17
  }
20
18
  return a;
21
19
  };
22
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
23
20
  var __export = (target, all) => {
24
21
  for (var name in all)
25
22
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -142,16 +139,16 @@ var Node = class _Node {
142
139
  }
143
140
  parse() {
144
141
  var _a;
145
- const res = __spreadProps(__spreadValues({
142
+ const res = {
146
143
  _uuid: this.wid,
147
144
  _name: this.name,
148
145
  _view: this.type,
149
146
  // TODO
150
- isShow: true
151
- }, this.data), {
147
+ isShow: true,
148
+ data: this.data,
152
149
  style: this.style,
153
150
  list: (_a = this.list) == null ? void 0 : _a.map((item) => item.parse())
154
- });
151
+ };
155
152
  return res;
156
153
  }
157
154
  };
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  Node,
3
3
  RootNode
4
- } from "../chunk-N5D6Y2DY.js";
5
- import "../chunk-6FNC3XMI.js";
4
+ } from "../chunk-6MWWYHG2.js";
5
+ import "../chunk-HJO26HIQ.js";
6
6
  export {
7
7
  Node,
8
8
  RootNode
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Widget
3
3
  } from "../chunk-KHPFRVKB.js";
4
- import "../chunk-6FNC3XMI.js";
4
+ import "../chunk-HJO26HIQ.js";
5
5
  export {
6
6
  Widget
7
7
  };
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
- var __defProps = Object.defineProperties;
5
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
7
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
8
6
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
7
  var __getProtoOf = Object.getPrototypeOf;
@@ -21,7 +19,6 @@ var __spreadValues = (a, b) => {
21
19
  }
22
20
  return a;
23
21
  };
24
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
25
22
  var __export = (target, all) => {
26
23
  for (var name in all)
27
24
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -225,16 +222,16 @@ var Node = class _Node {
225
222
  }
226
223
  parse() {
227
224
  var _a;
228
- const res = __spreadProps(__spreadValues({
225
+ const res = {
229
226
  _uuid: this.wid,
230
227
  _name: this.name,
231
228
  _view: this.type,
232
229
  // TODO
233
- isShow: true
234
- }, this.data), {
230
+ isShow: true,
231
+ data: this.data,
235
232
  style: this.style,
236
233
  list: (_a = this.list) == null ? void 0 : _a.map((item) => item.parse())
237
- });
234
+ };
238
235
  return res;
239
236
  }
240
237
  };
@@ -4,11 +4,11 @@ import {
4
4
  import {
5
5
  Node,
6
6
  RootNode
7
- } from "../chunk-N5D6Y2DY.js";
7
+ } from "../chunk-6MWWYHG2.js";
8
8
  import {
9
9
  Widget
10
10
  } from "../chunk-KHPFRVKB.js";
11
- import "../chunk-6FNC3XMI.js";
11
+ import "../chunk-HJO26HIQ.js";
12
12
  export {
13
13
  Container,
14
14
  Node,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  EventEmitter
3
3
  } from "../chunk-W776G2UQ.js";
4
- import "../chunk-6FNC3XMI.js";
4
+ import "../chunk-HJO26HIQ.js";
5
5
  export {
6
6
  EventEmitter
7
7
  };
@@ -123,6 +123,15 @@ var schema = {
123
123
  rules: normalizeRules(config)
124
124
  };
125
125
  },
126
+ color(config) {
127
+ return {
128
+ label: config.label,
129
+ key: config.key,
130
+ type: "colorPicker",
131
+ attrs: config.attrs,
132
+ rules: normalizeRules(config)
133
+ };
134
+ },
126
135
  custom(config) {
127
136
  return {
128
137
  label: config.label,
@@ -201,6 +210,24 @@ var widget = {
201
210
  name,
202
211
  list
203
212
  };
213
+ },
214
+ widget(name, list) {
215
+ return {
216
+ type: 0 /* WIDGET */,
217
+ name,
218
+ list
219
+ };
220
+ },
221
+ root(config) {
222
+ return this.create({
223
+ name: config.name || "\u9875\u9762",
224
+ type: "page",
225
+ config: { visible: false },
226
+ defaultData: config.defaultData,
227
+ defaultStyle: config.defaultStyle,
228
+ attributes: config.attributes,
229
+ stylesheet: config.stylesheet
230
+ });
204
231
  }
205
232
  };
206
233
  // Annotate the CommonJS export names for ESM import in node:
@@ -4,13 +4,13 @@ import {
4
4
  } from "../chunk-W776G2UQ.js";
5
5
  import {
6
6
  schema
7
- } from "../chunk-KTDOAEEU.js";
7
+ } from "../chunk-SIPKDBVZ.js";
8
8
  import {
9
9
  widget,
10
10
  widgetType
11
- } from "../chunk-VY2Z4X4S.js";
11
+ } from "../chunk-VRAKS4JU.js";
12
12
  import "../chunk-XJ2IJHKH.js";
13
- import "../chunk-6FNC3XMI.js";
13
+ import "../chunk-HJO26HIQ.js";
14
14
  export {
15
15
  EventEmitter,
16
16
  schema,
@@ -87,6 +87,15 @@ var schema = {
87
87
  rules: normalizeRules(config)
88
88
  };
89
89
  },
90
+ color(config) {
91
+ return {
92
+ label: config.label,
93
+ key: config.key,
94
+ type: "colorPicker",
95
+ attrs: config.attrs,
96
+ rules: normalizeRules(config)
97
+ };
98
+ },
90
99
  custom(config) {
91
100
  return {
92
101
  label: config.label,
@@ -1,4 +1,4 @@
1
- import { InputInstance, InputNumberInstance, SelectInstance, ElOption, SwitchInstance, ImageInstance, DatePickerInstance } from 'element-plus';
1
+ import { InputInstance, InputNumberInstance, SelectInstance, ElOption, SwitchInstance, ImageInstance, DatePickerInstance, ColorPickerInstance } from 'element-plus';
2
2
  import { j as SchemaItem } from '../Widget-BXpoxMwR.cjs';
3
3
  import 'vue';
4
4
  import 'async-validator';
@@ -31,6 +31,9 @@ declare const schema: {
31
31
  time(config: BaseConfig & {
32
32
  attrs?: Partial<DatePickerInstance["$props"]>;
33
33
  }): SchemaItem;
34
+ color(config: BaseConfig & {
35
+ attrs?: ColorPickerInstance["$props"];
36
+ }): SchemaItem;
34
37
  custom(config: BaseConfig & {
35
38
  attrs?: Record<string, any>;
36
39
  type: string;
@@ -1,4 +1,4 @@
1
- import { InputInstance, InputNumberInstance, SelectInstance, ElOption, SwitchInstance, ImageInstance, DatePickerInstance } from 'element-plus';
1
+ import { InputInstance, InputNumberInstance, SelectInstance, ElOption, SwitchInstance, ImageInstance, DatePickerInstance, ColorPickerInstance } from 'element-plus';
2
2
  import { j as SchemaItem } from '../Widget-BXpoxMwR.js';
3
3
  import 'vue';
4
4
  import 'async-validator';
@@ -31,6 +31,9 @@ declare const schema: {
31
31
  time(config: BaseConfig & {
32
32
  attrs?: Partial<DatePickerInstance["$props"]>;
33
33
  }): SchemaItem;
34
+ color(config: BaseConfig & {
35
+ attrs?: ColorPickerInstance["$props"];
36
+ }): SchemaItem;
34
37
  custom(config: BaseConfig & {
35
38
  attrs?: Record<string, any>;
36
39
  type: string;
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  schema
3
- } from "../chunk-KTDOAEEU.js";
3
+ } from "../chunk-SIPKDBVZ.js";
4
4
  import "../chunk-XJ2IJHKH.js";
5
- import "../chunk-6FNC3XMI.js";
5
+ import "../chunk-HJO26HIQ.js";
6
6
  export {
7
7
  schema
8
8
  };
@@ -65,6 +65,24 @@ var widget = {
65
65
  name,
66
66
  list
67
67
  };
68
+ },
69
+ widget(name, list) {
70
+ return {
71
+ type: 0 /* WIDGET */,
72
+ name,
73
+ list
74
+ };
75
+ },
76
+ root(config) {
77
+ return this.create({
78
+ name: config.name || "\u9875\u9762",
79
+ type: "page",
80
+ config: { visible: false },
81
+ defaultData: config.defaultData,
82
+ defaultStyle: config.defaultStyle,
83
+ attributes: config.attributes,
84
+ stylesheet: config.stylesheet
85
+ });
68
86
  }
69
87
  };
70
88
  // Annotate the CommonJS export names for ESM import in node:
@@ -18,6 +18,13 @@ interface CWidget {
18
18
  attributes?: SchemaItem[];
19
19
  stylesheet?: SchemaItem[];
20
20
  }
21
+ interface RootWidget {
22
+ name?: IWidget['_name'];
23
+ defaultData?: IWidget['data'];
24
+ defaultStyle?: IWidget['style'];
25
+ attributes?: SchemaItem[];
26
+ stylesheet?: SchemaItem[];
27
+ }
21
28
  interface ColumnContainerWidget {
22
29
  name?: IWidget['_name'];
23
30
  icon?: IWidget['_icon'];
@@ -50,6 +57,28 @@ declare const widget: {
50
57
  name: string;
51
58
  list: Base[];
52
59
  };
60
+ widget(name: string, list: IWidget[]): {
61
+ type: widgetType;
62
+ name: string;
63
+ list: Base[];
64
+ };
65
+ root(config: RootWidget): {
66
+ _name: string;
67
+ _view: string;
68
+ _icon: string | undefined;
69
+ container: boolean | undefined;
70
+ meta: {
71
+ draggable?: boolean;
72
+ visible?: boolean;
73
+ fixed?: boolean;
74
+ } | undefined;
75
+ schema: {
76
+ props: SchemaItem[] | undefined;
77
+ style: SchemaItem[] | undefined;
78
+ };
79
+ style: (vue.CSSProperties & WidgetPos) | undefined;
80
+ data: Record<string, any> | undefined;
81
+ };
53
82
  };
54
83
 
55
84
  export { widget, widgetType };
@@ -18,6 +18,13 @@ interface CWidget {
18
18
  attributes?: SchemaItem[];
19
19
  stylesheet?: SchemaItem[];
20
20
  }
21
+ interface RootWidget {
22
+ name?: IWidget['_name'];
23
+ defaultData?: IWidget['data'];
24
+ defaultStyle?: IWidget['style'];
25
+ attributes?: SchemaItem[];
26
+ stylesheet?: SchemaItem[];
27
+ }
21
28
  interface ColumnContainerWidget {
22
29
  name?: IWidget['_name'];
23
30
  icon?: IWidget['_icon'];
@@ -50,6 +57,28 @@ declare const widget: {
50
57
  name: string;
51
58
  list: Base[];
52
59
  };
60
+ widget(name: string, list: IWidget[]): {
61
+ type: widgetType;
62
+ name: string;
63
+ list: Base[];
64
+ };
65
+ root(config: RootWidget): {
66
+ _name: string;
67
+ _view: string;
68
+ _icon: string | undefined;
69
+ container: boolean | undefined;
70
+ meta: {
71
+ draggable?: boolean;
72
+ visible?: boolean;
73
+ fixed?: boolean;
74
+ } | undefined;
75
+ schema: {
76
+ props: SchemaItem[] | undefined;
77
+ style: SchemaItem[] | undefined;
78
+ };
79
+ style: (vue.CSSProperties & WidgetPos) | undefined;
80
+ data: Record<string, any> | undefined;
81
+ };
53
82
  };
54
83
 
55
84
  export { widget, widgetType };
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  widget,
3
3
  widgetType
4
- } from "../chunk-VY2Z4X4S.js";
5
- import "../chunk-6FNC3XMI.js";
4
+ } from "../chunk-VRAKS4JU.js";
5
+ import "../chunk-HJO26HIQ.js";
6
6
  export {
7
7
  widget,
8
8
  widgetType
package/dist/index.cjs CHANGED
@@ -127,6 +127,15 @@ var schema = {
127
127
  rules: normalizeRules(config)
128
128
  };
129
129
  },
130
+ color(config) {
131
+ return {
132
+ label: config.label,
133
+ key: config.key,
134
+ type: "colorPicker",
135
+ attrs: config.attrs,
136
+ rules: normalizeRules(config)
137
+ };
138
+ },
130
139
  custom(config) {
131
140
  return {
132
141
  label: config.label,
@@ -205,6 +214,24 @@ var widget = {
205
214
  name,
206
215
  list
207
216
  };
217
+ },
218
+ widget(name, list) {
219
+ return {
220
+ type: 0 /* WIDGET */,
221
+ name,
222
+ list
223
+ };
224
+ },
225
+ root(config) {
226
+ return this.create({
227
+ name: config.name || "\u9875\u9762",
228
+ type: "page",
229
+ config: { visible: false },
230
+ defaultData: config.defaultData,
231
+ defaultStyle: config.defaultStyle,
232
+ attributes: config.attributes,
233
+ stylesheet: config.stylesheet
234
+ });
208
235
  }
209
236
  };
210
237
 
package/dist/index.js CHANGED
@@ -4,11 +4,11 @@ import {
4
4
  } from "./chunk-W776G2UQ.js";
5
5
  import {
6
6
  schema
7
- } from "./chunk-KTDOAEEU.js";
7
+ } from "./chunk-SIPKDBVZ.js";
8
8
  import {
9
9
  widget,
10
10
  widgetType
11
- } from "./chunk-VY2Z4X4S.js";
11
+ } from "./chunk-VRAKS4JU.js";
12
12
  import {
13
13
  createCopy,
14
14
  createDelete
@@ -20,7 +20,7 @@ import {
20
20
  isBox
21
21
  } from "./chunk-4QIIKQ6B.js";
22
22
  import "./chunk-XJ2IJHKH.js";
23
- import "./chunk-6FNC3XMI.js";
23
+ import "./chunk-HJO26HIQ.js";
24
24
  export {
25
25
  EventEmitter,
26
26
  createCopy,
package/dist/internal.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  createCopy,
3
3
  createDelete
4
4
  } from "./chunk-TM53N6AZ.js";
5
- import "./chunk-6FNC3XMI.js";
5
+ import "./chunk-HJO26HIQ.js";
6
6
  export {
7
7
  createCopy,
8
8
  createDelete
package/dist/tokens.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  editorContextKey
3
3
  } from "./chunk-D2MSIUE2.js";
4
- import "./chunk-6FNC3XMI.js";
4
+ import "./chunk-HJO26HIQ.js";
5
5
  export {
6
6
  editorContextKey
7
7
  };
package/dist/types.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  isBox
3
3
  } from "./chunk-4QIIKQ6B.js";
4
- import "./chunk-6FNC3XMI.js";
4
+ import "./chunk-HJO26HIQ.js";
5
5
  export {
6
6
  isBox
7
7
  };
package/dist/utils.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  likeArray
3
3
  } from "./chunk-XJ2IJHKH.js";
4
- import "./chunk-6FNC3XMI.js";
4
+ import "./chunk-HJO26HIQ.js";
5
5
  export {
6
6
  likeArray
7
7
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sepveneto/dnde-core",
3
3
  "type": "module",
4
- "version": "0.3.1",
4
+ "version": "0.4.1",
5
5
  "description": "",
6
6
  "author": "sepveneto",
7
7
  "license": "MIT",