x-state-lib 0.3.36 → 0.3.38
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.js +121 -140
- package/package.json +13 -8
package/dist/index.js
CHANGED
|
@@ -1,154 +1,135 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
1
|
+
function toField$1({ id: e, name: a, type: o }) {
|
|
2
|
+
return {
|
|
3
|
+
id: e,
|
|
4
|
+
name: a,
|
|
5
|
+
type: o
|
|
6
|
+
};
|
|
3
7
|
}
|
|
4
|
-
function
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
e.push(c(n));
|
|
10
|
-
return e;
|
|
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;
|
|
11
13
|
}
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
function toPageMeta(e) {
|
|
15
|
+
return {
|
|
16
|
+
version: e.version,
|
|
17
|
+
arguments: toFields$1(e.arguments),
|
|
18
|
+
states: toFields$1(e.states)
|
|
19
|
+
};
|
|
18
20
|
}
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
});
|
|
30
|
-
return e;
|
|
21
|
+
function toMethods(e) {
|
|
22
|
+
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)
|
|
29
|
+
});
|
|
30
|
+
return o;
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
});
|
|
42
|
-
return e;
|
|
32
|
+
function toEvents(e) {
|
|
33
|
+
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)
|
|
39
|
+
});
|
|
40
|
+
return o;
|
|
43
41
|
}
|
|
44
|
-
function
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
});
|
|
56
|
-
return e;
|
|
42
|
+
function toSlots(e) {
|
|
43
|
+
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)
|
|
51
|
+
});
|
|
52
|
+
return o;
|
|
57
53
|
}
|
|
58
|
-
function
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
54
|
+
function toCompMeta(e) {
|
|
55
|
+
return {
|
|
56
|
+
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)
|
|
62
|
+
};
|
|
67
63
|
}
|
|
68
|
-
function
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
nodes: []
|
|
93
|
-
},
|
|
94
|
-
depends: {}
|
|
95
|
-
};
|
|
64
|
+
function initApp() {
|
|
65
|
+
return {
|
|
66
|
+
appList: [],
|
|
67
|
+
activeApp: {
|
|
68
|
+
id: "",
|
|
69
|
+
compGroups: [],
|
|
70
|
+
comps: []
|
|
71
|
+
},
|
|
72
|
+
activePage: {
|
|
73
|
+
id: "",
|
|
74
|
+
meta: { version: "" }
|
|
75
|
+
},
|
|
76
|
+
activeComp: {
|
|
77
|
+
id: "",
|
|
78
|
+
meta: { version: "" }
|
|
79
|
+
},
|
|
80
|
+
activeObject: {
|
|
81
|
+
type: "page",
|
|
82
|
+
subtype: "",
|
|
83
|
+
version: "",
|
|
84
|
+
nodes: []
|
|
85
|
+
},
|
|
86
|
+
depends: {}
|
|
87
|
+
};
|
|
96
88
|
}
|
|
97
|
-
function
|
|
98
|
-
|
|
89
|
+
function toField({ id: e, name: a, type: o }) {
|
|
90
|
+
return {
|
|
91
|
+
id: e,
|
|
92
|
+
name: a,
|
|
93
|
+
type: o
|
|
94
|
+
};
|
|
99
95
|
}
|
|
100
|
-
function
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
e.push(m(n));
|
|
106
|
-
return e;
|
|
96
|
+
function toFields(e) {
|
|
97
|
+
if (!e) return;
|
|
98
|
+
let a = [];
|
|
99
|
+
for (let o of e) a.push(toField(o));
|
|
100
|
+
return a;
|
|
107
101
|
}
|
|
108
|
-
function
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
102
|
+
function initCompute() {
|
|
103
|
+
return {
|
|
104
|
+
spaces: [],
|
|
105
|
+
activeFunc: {
|
|
106
|
+
id: "",
|
|
107
|
+
name: "",
|
|
108
|
+
inputs: [],
|
|
109
|
+
outputs: []
|
|
110
|
+
},
|
|
111
|
+
activeFlow: {
|
|
112
|
+
id: "",
|
|
113
|
+
name: ""
|
|
114
|
+
},
|
|
115
|
+
activeObject: {
|
|
116
|
+
type: "func",
|
|
117
|
+
version: ""
|
|
118
|
+
}
|
|
119
|
+
};
|
|
126
120
|
}
|
|
127
|
-
function
|
|
128
|
-
|
|
129
|
-
spaces: []
|
|
130
|
-
};
|
|
121
|
+
function initData() {
|
|
122
|
+
return { spaces: [] };
|
|
131
123
|
}
|
|
132
|
-
function
|
|
133
|
-
|
|
134
|
-
spaces: []
|
|
135
|
-
};
|
|
124
|
+
function initResource() {
|
|
125
|
+
return { spaces: [] };
|
|
136
126
|
}
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
127
|
+
const globalState = (function() {
|
|
128
|
+
return window.globalState || (window.globalState = {
|
|
129
|
+
app: initApp(),
|
|
130
|
+
compute: initCompute(),
|
|
131
|
+
data: initData(),
|
|
132
|
+
resource: initResource()
|
|
133
|
+
}), window.globalState;
|
|
144
134
|
})();
|
|
145
|
-
export {
|
|
146
|
-
F as globalState,
|
|
147
|
-
f as initApp,
|
|
148
|
-
v as initCompute,
|
|
149
|
-
l as initData,
|
|
150
|
-
h as initResource,
|
|
151
|
-
b as toCompMeta,
|
|
152
|
-
w as toFields,
|
|
153
|
-
g as toPageMeta
|
|
154
|
-
};
|
|
135
|
+
export { globalState, initApp, initCompute, initData, initResource, toCompMeta, toFields, 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.
|
|
4
|
+
"version": "0.3.38",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -23,10 +23,12 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"lodash-es": "^4.17.22",
|
|
26
|
-
"vue": "^3.5.
|
|
27
|
-
"vuetify": "^3.11.
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
"vue": "^3.5.27",
|
|
27
|
+
"vuetify": "^3.11.7"
|
|
28
|
+
},
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"x-essential-lib": "^0.9.24",
|
|
31
|
+
"x-runtime-lib": "^0.8.189"
|
|
30
32
|
},
|
|
31
33
|
"devDependencies": {
|
|
32
34
|
"@eslint/js": "^9.39.2",
|
|
@@ -43,11 +45,14 @@
|
|
|
43
45
|
"prettier": "3.8.0",
|
|
44
46
|
"sass": "^1.97.2",
|
|
45
47
|
"typescript": "^5.9.3",
|
|
46
|
-
"typescript-eslint": "^8.53.
|
|
47
|
-
"vite": "
|
|
48
|
+
"typescript-eslint": "^8.53.1",
|
|
49
|
+
"vite": "npm:rolldown-vite@7.3.1",
|
|
48
50
|
"vite-plugin-css-injected-by-js": "^3.5.2",
|
|
49
|
-
"vite-plugin-vuetify": "^2.1.
|
|
51
|
+
"vite-plugin-vuetify": "^2.1.3",
|
|
50
52
|
"vue-eslint-parser": "^10.2.0",
|
|
51
53
|
"vue-tsc": "^3.2.2"
|
|
54
|
+
},
|
|
55
|
+
"overrides": {
|
|
56
|
+
"vite": "npm:rolldown-vite@7.3.1"
|
|
52
57
|
}
|
|
53
58
|
}
|