x-runtime-lib 0.5.5 → 0.5.7

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,3 +1,23 @@
1
+ export type ZItem = {
2
+ title: string;
3
+ value: string;
4
+ };
5
+ type ZTypeBase = {
6
+ name: string;
7
+ validator: (v: string) => boolean;
8
+ default: string;
9
+ };
10
+ type ZTypeWord = {
11
+ ui: 'word';
12
+ } & ZTypeBase;
13
+ type ZTypeInput = {
14
+ ui: 'pixelInput' | 'percentInput';
15
+ precision: number;
16
+ min: number;
17
+ max: number;
18
+ step: number;
19
+ } & ZTypeBase;
20
+ export type ZType = ZTypeWord | ZTypeInput;
1
21
  export type ZEvent = {
2
22
  key: string;
3
23
  name: string;
@@ -20,47 +40,23 @@ export type ZMethod = {
20
40
  name: string;
21
41
  }[];
22
42
  };
23
- export type ZItem = {
24
- title: string;
25
- value: string;
26
- };
27
- type ZTypeBase = {
28
- name: string;
29
- validator: (v: string) => boolean;
30
- default: string;
31
- };
32
- type ZTypeWord = {
33
- ui: 'word';
34
- } & ZTypeBase;
35
- type ZTypeInput = {
36
- ui: 'pixelInput' | 'percentInput';
37
- precision: number;
38
- min: number;
39
- max: number;
40
- step: number;
41
- } & ZTypeBase;
42
- export type ZType = ZTypeWord | ZTypeInput;
43
43
  type ZPropBase = {
44
44
  key: string;
45
45
  name: string;
46
- array?: boolean;
47
46
  };
48
47
  type ZPropBranch = {
49
48
  ui?: undefined;
50
49
  children: ZProp[];
51
- default?: object[];
52
50
  } & ZPropBase;
53
51
  type ZPropDummy = {
54
52
  ui: 'dummy';
55
53
  readonly?: boolean;
56
- default: string | number | boolean | object;
57
54
  } & ZPropBase;
58
55
  type ZPropStrInput = {
59
56
  ui: 'strInput';
60
57
  readonly?: boolean;
61
58
  static?: boolean;
62
59
  value?: unknown;
63
- default: string;
64
60
  } & ZPropBase;
65
61
  type ZPropNumInput = {
66
62
  ui: 'numInput';
@@ -69,36 +65,84 @@ type ZPropNumInput = {
69
65
  max: number;
70
66
  step: number;
71
67
  readonly?: boolean;
72
- default: number;
73
68
  } & ZPropBase;
74
69
  type ZPropSwitch = {
75
70
  ui: 'switch';
76
71
  readonly?: boolean;
77
- default: boolean;
78
72
  } & ZPropBase;
79
73
  type ZPropSelect = {
80
74
  ui: 'select';
81
75
  items: ZItem[];
82
76
  readonly?: boolean;
83
- default: string;
84
77
  } & ZPropBase;
85
78
  type ZPropColorPicker = {
86
79
  ui: 'colorPicker';
87
80
  readonly?: boolean;
88
- default: string;
89
81
  } & ZPropBase;
90
82
  type ZPropMultiTypes = {
91
83
  ui: 'multiTypes';
92
84
  types: ZType[];
93
85
  readonly?: boolean;
94
- default: string;
95
86
  } & ZPropBase;
96
87
  type ZPropCompSelect = {
97
88
  ui: 'compSelect';
98
89
  readonly?: boolean;
99
- default: string;
100
90
  } & ZPropBase;
101
- export type ZProp = ZPropBranch | ZPropDummy | ZPropStrInput | ZPropNumInput | ZPropSwitch | ZPropSelect | ZPropColorPicker | ZPropMultiTypes | ZPropCompSelect;
91
+ export type ZProp = ({
92
+ array?: false;
93
+ default?: undefined;
94
+ } & ZPropBranch) | ({
95
+ array: true;
96
+ default: object[];
97
+ } & ZPropBranch) | ({
98
+ array?: false;
99
+ default: string | number | boolean | object;
100
+ } & ZPropDummy) | ({
101
+ array: true;
102
+ default: string[] | number[] | boolean | object[];
103
+ } & ZPropDummy) | ({
104
+ array?: false;
105
+ default: string;
106
+ } & ZPropStrInput) | ({
107
+ array: true;
108
+ default: string[];
109
+ } & ZPropStrInput) | ({
110
+ array?: false;
111
+ default: number;
112
+ } & ZPropNumInput) | ({
113
+ array: true;
114
+ default: number[];
115
+ } & ZPropNumInput) | ({
116
+ array?: false;
117
+ default: boolean;
118
+ } & ZPropSwitch) | ({
119
+ array: true;
120
+ default: boolean[];
121
+ } & ZPropSwitch) | ({
122
+ array?: false;
123
+ default: string;
124
+ } & ZPropSelect) | ({
125
+ array: true;
126
+ default: string[];
127
+ } & ZPropSelect) | ({
128
+ array?: false;
129
+ default: string;
130
+ } & ZPropColorPicker) | ({
131
+ array: true;
132
+ default: string[];
133
+ } & ZPropColorPicker) | ({
134
+ array?: false;
135
+ default: string;
136
+ } & ZPropMultiTypes) | ({
137
+ array: true;
138
+ default: string[];
139
+ } & ZPropMultiTypes) | ({
140
+ array?: false;
141
+ default: string;
142
+ } & ZPropCompSelect) | ({
143
+ array: true;
144
+ default: string[];
145
+ } & ZPropCompSelect);
102
146
  export type ZProps = {
103
147
  [key: string]: ZProp[];
104
148
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-runtime-lib",
3
3
  "private": false,
4
- "version": "0.5.5",
4
+ "version": "0.5.7",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -24,7 +24,7 @@
24
24
  "dependencies": {
25
25
  "js-interpreter": "^5.1.2",
26
26
  "lodash-es": "^4.17.21",
27
- "x-essential-lib": "^0.7.3"
27
+ "x-essential-lib": "^0.7.4"
28
28
  },
29
29
  "peerDependencies": {
30
30
  "vue": "^3.5.12",