x-state-lib 0.3.41 → 0.3.43

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/index.d.ts CHANGED
@@ -1 +1,275 @@
1
- export * from './state';
1
+ import { Type } from 'x-essential-lib';
2
+
3
+ export declare type ActiveApp = {
4
+ id: string;
5
+ compGroups: CompGroup[];
6
+ comps: Comp[];
7
+ };
8
+
9
+ export declare type ActiveComp = {
10
+ id: string;
11
+ meta: CompMeta;
12
+ };
13
+
14
+ export declare type ActiveFlow = {
15
+ id: string;
16
+ name: string;
17
+ };
18
+
19
+ export declare type ActiveFunc = {
20
+ id: string;
21
+ name: string;
22
+ inputs?: Field_2[];
23
+ outputs?: Field_2[];
24
+ };
25
+
26
+ export declare type ActiveObjectApp = {
27
+ type: 'page' | 'comp';
28
+ subtype: string;
29
+ version: string;
30
+ nodes: {
31
+ id: string;
32
+ key: string;
33
+ alias: string;
34
+ slot?: string;
35
+ comp?: string;
36
+ adaptSlot?: string;
37
+ }[];
38
+ };
39
+
40
+ export declare type ActiveObjectCompute = {
41
+ type: 'func' | 'flow';
42
+ version: string;
43
+ };
44
+
45
+ export declare type ActivePage = {
46
+ id: string;
47
+ meta: PageMeta;
48
+ };
49
+
50
+ export declare type App = {
51
+ appList: AppListEntry[];
52
+ activeApp: ActiveApp;
53
+ activePage: ActivePage;
54
+ activeComp: ActiveComp;
55
+ activeObject: ActiveObjectApp;
56
+ depends: {
57
+ [key: string]: Depend;
58
+ };
59
+ };
60
+
61
+ export declare type AppListEntry = {
62
+ id: string;
63
+ name: string;
64
+ pages: {
65
+ id: string;
66
+ name: string;
67
+ }[];
68
+ };
69
+
70
+ declare type Comp = {
71
+ id: string;
72
+ groupId: string;
73
+ name: string;
74
+ position: number;
75
+ };
76
+
77
+ declare type CompGroup = {
78
+ id: string;
79
+ name: string;
80
+ position: number;
81
+ };
82
+
83
+ declare type CompMeta = {
84
+ version: string;
85
+ properties?: Field[];
86
+ methods?: Method[];
87
+ events?: Event_2[];
88
+ slots?: Slot[];
89
+ states?: Field[];
90
+ };
91
+
92
+ export declare type Compute = {
93
+ spaces: ComputeSpace[];
94
+ activeFunc: ActiveFunc;
95
+ activeFlow: ActiveFlow;
96
+ activeObject: ActiveObjectCompute;
97
+ };
98
+
99
+ export declare type ComputeSpace = {
100
+ id: string;
101
+ name: string;
102
+ funcGroups: FuncGroup[];
103
+ funcs: Func[];
104
+ flowGroups: FlowGroup[];
105
+ flows: Flow[];
106
+ position: number;
107
+ };
108
+
109
+ export declare type Data = {
110
+ spaces: DataSpace[];
111
+ };
112
+
113
+ export declare type DataSpace = {
114
+ id: string;
115
+ name: string;
116
+ tableGroups: TableGroup[];
117
+ tables: Table[];
118
+ position: number;
119
+ };
120
+
121
+ export declare type Depend = {
122
+ name: string;
123
+ meta: CompMeta;
124
+ };
125
+
126
+ export declare interface DirEntry {
127
+ id: string;
128
+ name: string;
129
+ children: DirEntry[];
130
+ }
131
+
132
+ declare type Event_2 = {
133
+ id: string;
134
+ name: string;
135
+ params?: Field[];
136
+ };
137
+
138
+ declare type Field = {
139
+ id: string;
140
+ name: string;
141
+ type: Type;
142
+ };
143
+
144
+ declare type Field_2 = {
145
+ id: string;
146
+ name: string;
147
+ type: Type;
148
+ };
149
+
150
+ export declare type Flow = {
151
+ id: string;
152
+ spaceId: string;
153
+ groupId: string;
154
+ name: string;
155
+ position: number;
156
+ };
157
+
158
+ export declare type FlowGroup = {
159
+ id: string;
160
+ name: string;
161
+ position: number;
162
+ };
163
+
164
+ export declare type Func = {
165
+ id: string;
166
+ spaceId: string;
167
+ groupId: string;
168
+ name: string;
169
+ inputs: {
170
+ id: string;
171
+ name: string;
172
+ type: Type;
173
+ }[];
174
+ outputs: {
175
+ id: string;
176
+ name: string;
177
+ type: Type;
178
+ }[];
179
+ position: number;
180
+ };
181
+
182
+ export declare type FuncGroup = {
183
+ id: string;
184
+ name: string;
185
+ position: number;
186
+ };
187
+
188
+ export declare const globalState: State;
189
+
190
+ export declare function initApp(): App;
191
+
192
+ export declare function initCompute(): Compute;
193
+
194
+ export declare function initData(): Data;
195
+
196
+ export declare function initResource(): Resource;
197
+
198
+ declare type Method = {
199
+ id: string;
200
+ name: string;
201
+ inputs?: Field[];
202
+ outputs?: Field[];
203
+ };
204
+
205
+ declare type PageMeta = {
206
+ version: string;
207
+ arguments?: Field[];
208
+ states?: Field[];
209
+ };
210
+
211
+ export declare type Resource = {
212
+ spaces: ResourceSpace[];
213
+ };
214
+
215
+ export declare interface ResourceEntry {
216
+ id: string;
217
+ dirid: string;
218
+ name: string;
219
+ }
220
+
221
+ export declare type ResourceSpace = {
222
+ id: string;
223
+ name: string;
224
+ dirTree: DirEntry;
225
+ resources: ResourceEntry[];
226
+ position: number;
227
+ };
228
+
229
+ declare type Slot = {
230
+ id: string;
231
+ name: string;
232
+ properties?: Field[];
233
+ methods?: Method[];
234
+ events?: Event_2[];
235
+ };
236
+
237
+ export declare type State = {
238
+ app: App;
239
+ compute: Compute;
240
+ data: Data;
241
+ resource: Resource;
242
+ };
243
+
244
+ export declare type Table = {
245
+ id: string;
246
+ spaceId: string;
247
+ groupId: string;
248
+ name: string;
249
+ columns: {
250
+ id: string;
251
+ name: string;
252
+ type: string;
253
+ extend: string;
254
+ }[];
255
+ indexes: {
256
+ id: string;
257
+ columns: string[];
258
+ unique: boolean;
259
+ }[];
260
+ position: number;
261
+ };
262
+
263
+ export declare type TableGroup = {
264
+ id: string;
265
+ name: string;
266
+ position: number;
267
+ };
268
+
269
+ export declare function toCompMeta(src: CompMeta): CompMeta;
270
+
271
+ export declare function toFields(srcFields?: Field_2[]): Field_2[] | undefined;
272
+
273
+ export declare function toPageMeta(src: PageMeta): PageMeta;
274
+
275
+ export { }
package/dist/index.js CHANGED
@@ -1,67 +1,69 @@
1
- function toField$1({ id: e, name: a, type: o }) {
1
+ import "x-essential-lib";
2
+ //#region src/state/app.ts
3
+ function e({ id: e, name: t, type: n }) {
2
4
  return {
3
5
  id: e,
4
- name: a,
5
- type: o
6
+ name: t,
7
+ type: n
6
8
  };
7
9
  }
8
- function toFields$1(a) {
9
- if (!a) return;
10
- let o = [];
11
- for (let s of a) o.push(toField$1(s));
12
- return o;
10
+ function t(t) {
11
+ if (!t) return;
12
+ let n = [];
13
+ for (let r of t) n.push(e(r));
14
+ return n;
13
15
  }
14
- function toPageMeta(e) {
16
+ function n(e) {
15
17
  return {
16
18
  version: e.version,
17
- arguments: toFields$1(e.arguments),
18
- states: toFields$1(e.states)
19
+ arguments: t(e.arguments),
20
+ states: t(e.states)
19
21
  };
20
22
  }
21
- function toMethods(e) {
23
+ function r(e) {
22
24
  if (!e) return;
23
- let o = [];
24
- for (let { id: s, name: c, inputs: l, outputs: u } of e) o.push({
25
- id: s,
26
- name: c,
27
- inputs: toFields$1(l),
28
- outputs: toFields$1(u)
25
+ let n = [];
26
+ for (let { id: r, name: i, inputs: a, outputs: o } of e) n.push({
27
+ id: r,
28
+ name: i,
29
+ inputs: t(a),
30
+ outputs: t(o)
29
31
  });
30
- return o;
32
+ return n;
31
33
  }
32
- function toEvents(e) {
34
+ function i(e) {
33
35
  if (!e) return;
34
- let o = [];
35
- for (let { id: s, name: c, params: l } of e) o.push({
36
- id: s,
37
- name: c,
38
- params: toFields$1(l)
36
+ let n = [];
37
+ for (let { id: r, name: i, params: a } of e) n.push({
38
+ id: r,
39
+ name: i,
40
+ params: t(a)
39
41
  });
40
- return o;
42
+ return n;
41
43
  }
42
- function toSlots(e) {
44
+ function a(e) {
43
45
  if (!e) return;
44
- let o = [];
45
- for (let { id: l, name: u, properties: d, methods: f, events: p } of e) o.push({
46
- id: l,
47
- name: u,
48
- properties: toFields$1(d),
49
- methods: toMethods(f),
50
- events: toEvents(p)
46
+ let n = [];
47
+ for (let { id: a, name: o, properties: s, methods: c, events: l } of e) n.push({
48
+ id: a,
49
+ name: o,
50
+ properties: t(s),
51
+ methods: r(c),
52
+ events: i(l)
51
53
  });
52
- return o;
54
+ return n;
53
55
  }
54
- function toCompMeta(e) {
56
+ function o(e) {
55
57
  return {
56
58
  version: e.version,
57
- properties: toFields$1(e.properties),
58
- methods: toMethods(e.methods),
59
- events: toEvents(e.events),
60
- slots: toSlots(e.slots),
61
- states: toFields$1(e.states)
59
+ properties: t(e.properties),
60
+ methods: r(e.methods),
61
+ events: i(e.events),
62
+ slots: a(e.slots),
63
+ states: t(e.states)
62
64
  };
63
65
  }
64
- function initApp() {
66
+ function s() {
65
67
  return {
66
68
  appList: [],
67
69
  activeApp: {
@@ -86,20 +88,22 @@ function initApp() {
86
88
  depends: {}
87
89
  };
88
90
  }
89
- function toField({ id: e, name: a, type: o }) {
91
+ //#endregion
92
+ //#region src/state/compute.ts
93
+ function c({ id: e, name: t, type: n }) {
90
94
  return {
91
95
  id: e,
92
- name: a,
93
- type: o
96
+ name: t,
97
+ type: n
94
98
  };
95
99
  }
96
- function toFields(e) {
100
+ function l(e) {
97
101
  if (!e) return;
98
- let a = [];
99
- for (let o of e) a.push(toField(o));
100
- return a;
102
+ let t = [];
103
+ for (let n of e) t.push(c(n));
104
+ return t;
101
105
  }
102
- function initCompute() {
106
+ function u() {
103
107
  return {
104
108
  spaces: [],
105
109
  activeFunc: {
@@ -118,18 +122,25 @@ function initCompute() {
118
122
  }
119
123
  };
120
124
  }
121
- function initData() {
125
+ //#endregion
126
+ //#region src/state/data.ts
127
+ function d() {
122
128
  return { spaces: [] };
123
129
  }
124
- function initResource() {
130
+ //#endregion
131
+ //#region src/state/resource.ts
132
+ function f() {
125
133
  return { spaces: [] };
126
134
  }
127
- const globalState = (function() {
135
+ //#endregion
136
+ //#region src/state/state.ts
137
+ var p = (function() {
128
138
  return window.globalState || (window.globalState = {
129
- app: initApp(),
130
- compute: initCompute(),
131
- data: initData(),
132
- resource: initResource()
139
+ app: s(),
140
+ compute: u(),
141
+ data: d(),
142
+ resource: f()
133
143
  }), window.globalState;
134
144
  })();
135
- export { globalState, initApp, initCompute, initData, initResource, toCompMeta, toFields, toPageMeta };
145
+ //#endregion
146
+ export { p as globalState, s as initApp, u as initCompute, d as initData, f as initResource, o as toCompMeta, l as toFields, n as toPageMeta };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-state-lib",
3
3
  "private": false,
4
- "version": "0.3.41",
4
+ "version": "0.3.43",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -23,37 +23,38 @@
23
23
  },
24
24
  "dependencies": {
25
25
  "lodash-es": "^4.17.23",
26
- "vue": "^3.5.29",
27
- "vuetify": "^4.0.0"
26
+ "vue": "^3.5.30",
27
+ "vuetify": "^4.0.2"
28
28
  },
29
29
  "peerDependencies": {
30
- "x-error-lib": "^0.5.15",
31
- "x-essential-lib": "^0.9.27",
32
- "x-runtime-lib": "^0.8.221"
30
+ "x-error-lib": "^0.5.17",
31
+ "x-essential-lib": "^0.9.30",
32
+ "x-runtime-lib": "^0.9.31"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@eslint/js": "^10.0.1",
36
+ "@tsconfig/node24": "^24.0.4",
36
37
  "@types/lodash-es": "^4.17.12",
37
- "@types/node": "^25.3.0",
38
+ "@types/node": "^25.4.0",
38
39
  "@vitejs/plugin-vue": "^6.0.4",
39
- "eslint": "^10.0.2",
40
+ "@vue/tsconfig": "^0.9.1",
41
+ "eslint": "^10.0.3",
40
42
  "eslint-config-prettier": "^10.1.8",
41
43
  "eslint-plugin-prettier": "^5.5.5",
44
+ "eslint-plugin-simple-import-sort": "^12.1.1",
42
45
  "eslint-plugin-vue": "^10.8.0",
43
- "globals": "^17.3.0",
46
+ "globals": "^17.4.0",
44
47
  "husky": "^9.1.7",
45
- "lint-staged": "^16.2.7",
48
+ "lint-staged": "^16.3.3",
46
49
  "prettier": "3.8.1",
47
- "sass": "^1.97.3",
50
+ "sass": "^1.98.0",
48
51
  "typescript": "^5.9.3",
49
- "typescript-eslint": "^8.56.1",
50
- "vite": "npm:rolldown-vite@7.3.1",
51
- "vite-plugin-css-injected-by-js": "^3.5.2",
52
+ "typescript-eslint": "^8.57.0",
53
+ "vite": "^8.0.0",
54
+ "vite-plugin-css-injected-by-js": "^4.0.1",
55
+ "vite-plugin-dts": "^4.5.4",
52
56
  "vite-plugin-vuetify": "^2.1.3",
53
57
  "vue-eslint-parser": "^10.4.0",
54
58
  "vue-tsc": "^3.2.5"
55
- },
56
- "overrides": {
57
- "vite": "npm:rolldown-vite@7.3.1"
58
59
  }
59
60
  }
@@ -1,100 +0,0 @@
1
- import { Type } from 'x-essential-lib';
2
- export type AppListEntry = {
3
- id: string;
4
- name: string;
5
- pages: {
6
- id: string;
7
- name: string;
8
- }[];
9
- };
10
- type CompGroup = {
11
- id: string;
12
- name: string;
13
- position: number;
14
- };
15
- type Comp = {
16
- id: string;
17
- groupId: string;
18
- name: string;
19
- position: number;
20
- };
21
- export type ActiveApp = {
22
- id: string;
23
- compGroups: CompGroup[];
24
- comps: Comp[];
25
- };
26
- type Field = {
27
- id: string;
28
- name: string;
29
- type: Type;
30
- };
31
- type PageMeta = {
32
- version: string;
33
- arguments?: Field[];
34
- states?: Field[];
35
- };
36
- export type ActivePage = {
37
- id: string;
38
- meta: PageMeta;
39
- };
40
- export declare function toPageMeta(src: PageMeta): PageMeta;
41
- type Method = {
42
- id: string;
43
- name: string;
44
- inputs?: Field[];
45
- outputs?: Field[];
46
- };
47
- type Event = {
48
- id: string;
49
- name: string;
50
- params?: Field[];
51
- };
52
- type Slot = {
53
- id: string;
54
- name: string;
55
- properties?: Field[];
56
- methods?: Method[];
57
- events?: Event[];
58
- };
59
- type CompMeta = {
60
- version: string;
61
- properties?: Field[];
62
- methods?: Method[];
63
- events?: Event[];
64
- slots?: Slot[];
65
- states?: Field[];
66
- };
67
- export type ActiveComp = {
68
- id: string;
69
- meta: CompMeta;
70
- };
71
- export declare function toCompMeta(src: CompMeta): CompMeta;
72
- export type ActiveObjectApp = {
73
- type: 'page' | 'comp';
74
- subtype: string;
75
- version: string;
76
- nodes: {
77
- id: string;
78
- key: string;
79
- alias: string;
80
- slot?: string;
81
- comp?: string;
82
- adaptSlot?: string;
83
- }[];
84
- };
85
- export type Depend = {
86
- name: string;
87
- meta: CompMeta;
88
- };
89
- export type App = {
90
- appList: AppListEntry[];
91
- activeApp: ActiveApp;
92
- activePage: ActivePage;
93
- activeComp: ActiveComp;
94
- activeObject: ActiveObjectApp;
95
- depends: {
96
- [key: string]: Depend;
97
- };
98
- };
99
- export declare function initApp(): App;
100
- export {};
@@ -1,72 +0,0 @@
1
- import { Type } from 'x-essential-lib';
2
- export type FuncGroup = {
3
- id: string;
4
- name: string;
5
- position: number;
6
- };
7
- export type Func = {
8
- id: string;
9
- spaceId: string;
10
- groupId: string;
11
- name: string;
12
- inputs: {
13
- id: string;
14
- name: string;
15
- type: Type;
16
- }[];
17
- outputs: {
18
- id: string;
19
- name: string;
20
- type: Type;
21
- }[];
22
- position: number;
23
- };
24
- export type FlowGroup = {
25
- id: string;
26
- name: string;
27
- position: number;
28
- };
29
- export type Flow = {
30
- id: string;
31
- spaceId: string;
32
- groupId: string;
33
- name: string;
34
- position: number;
35
- };
36
- export type ComputeSpace = {
37
- id: string;
38
- name: string;
39
- funcGroups: FuncGroup[];
40
- funcs: Func[];
41
- flowGroups: FlowGroup[];
42
- flows: Flow[];
43
- position: number;
44
- };
45
- type Field = {
46
- id: string;
47
- name: string;
48
- type: Type;
49
- };
50
- export type ActiveFunc = {
51
- id: string;
52
- name: string;
53
- inputs?: Field[];
54
- outputs?: Field[];
55
- };
56
- export declare function toFields(srcFields?: Field[]): Field[] | undefined;
57
- export type ActiveFlow = {
58
- id: string;
59
- name: string;
60
- };
61
- export type ActiveObjectCompute = {
62
- type: 'func' | 'flow';
63
- version: string;
64
- };
65
- export type Compute = {
66
- spaces: ComputeSpace[];
67
- activeFunc: ActiveFunc;
68
- activeFlow: ActiveFlow;
69
- activeObject: ActiveObjectCompute;
70
- };
71
- export declare function initCompute(): Compute;
72
- export {};
@@ -1,34 +0,0 @@
1
- export type TableGroup = {
2
- id: string;
3
- name: string;
4
- position: number;
5
- };
6
- export type Table = {
7
- id: string;
8
- spaceId: string;
9
- groupId: string;
10
- name: string;
11
- columns: {
12
- id: string;
13
- name: string;
14
- type: string;
15
- extend: string;
16
- }[];
17
- indexes: {
18
- id: string;
19
- columns: string[];
20
- unique: boolean;
21
- }[];
22
- position: number;
23
- };
24
- export type DataSpace = {
25
- id: string;
26
- name: string;
27
- tableGroups: TableGroup[];
28
- tables: Table[];
29
- position: number;
30
- };
31
- export type Data = {
32
- spaces: DataSpace[];
33
- };
34
- export declare function initData(): Data;
@@ -1,5 +0,0 @@
1
- export * from './app';
2
- export * from './compute';
3
- export * from './data';
4
- export * from './resource';
5
- export * from './state';
@@ -1,21 +0,0 @@
1
- export interface DirEntry {
2
- id: string;
3
- name: string;
4
- children: DirEntry[];
5
- }
6
- export interface ResourceEntry {
7
- id: string;
8
- dirid: string;
9
- name: string;
10
- }
11
- export type ResourceSpace = {
12
- id: string;
13
- name: string;
14
- dirTree: DirEntry;
15
- resources: ResourceEntry[];
16
- position: number;
17
- };
18
- export type Resource = {
19
- spaces: ResourceSpace[];
20
- };
21
- export declare function initResource(): Resource;
@@ -1,16 +0,0 @@
1
- import { ZProperty } from 'x-runtime-lib';
2
- type Property = {
3
- keys: string;
4
- names: string[];
5
- raw: ZProperty;
6
- };
7
- type Properties = {
8
- [key: string]: {
9
- [tag: string]: Property[];
10
- };
11
- };
12
- export type Runtime = {
13
- properties: Properties;
14
- };
15
- export declare function initRuntime(): Runtime;
16
- export {};
@@ -1,11 +0,0 @@
1
- import { App } from './app';
2
- import { Compute } from './compute';
3
- import { Data } from './data';
4
- import { Resource } from './resource';
5
- export type State = {
6
- app: App;
7
- compute: Compute;
8
- data: Data;
9
- resource: Resource;
10
- };
11
- export declare const globalState: State;