x-state-lib 0.3.36 → 0.3.37

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.
Files changed (2) hide show
  1. package/dist/index.js +121 -140
  2. package/package.json +11 -8
package/dist/index.js CHANGED
@@ -1,154 +1,135 @@
1
- function c({ id: t, name: e, type: n }) {
2
- return { id: t, name: e, type: n };
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 o(t) {
5
- if (!t)
6
- return;
7
- const e = [];
8
- for (const n of t)
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 g(t) {
13
- return {
14
- version: t.version,
15
- arguments: o(t.arguments),
16
- states: o(t.states)
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 u(t) {
20
- if (!t)
21
- return;
22
- const e = [];
23
- for (const { id: n, name: s, inputs: i, outputs: r } of t)
24
- e.push({
25
- id: n,
26
- name: s,
27
- inputs: o(i),
28
- outputs: o(r)
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 a(t) {
33
- if (!t)
34
- return;
35
- const e = [];
36
- for (const { id: n, name: s, params: i } of t)
37
- e.push({
38
- id: n,
39
- name: s,
40
- params: o(i)
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 d(t) {
45
- if (!t)
46
- return;
47
- const e = [];
48
- for (const { id: n, name: s, properties: i, methods: r, events: p } of t)
49
- e.push({
50
- id: n,
51
- name: s,
52
- properties: o(i),
53
- methods: u(r),
54
- events: a(p)
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 b(t) {
59
- return {
60
- version: t.version,
61
- properties: o(t.properties),
62
- methods: u(t.methods),
63
- events: a(t.events),
64
- slots: d(t.slots),
65
- states: o(t.states)
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 f() {
69
- return {
70
- appList: [],
71
- activeApp: {
72
- id: "",
73
- compGroups: [],
74
- comps: []
75
- },
76
- activePage: {
77
- id: "",
78
- meta: {
79
- version: ""
80
- }
81
- },
82
- activeComp: {
83
- id: "",
84
- meta: {
85
- version: ""
86
- }
87
- },
88
- activeObject: {
89
- type: "page",
90
- subtype: "",
91
- version: "",
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 m({ id: t, name: e, type: n }) {
98
- return { id: t, name: e, type: n };
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 w(t) {
101
- if (!t)
102
- return;
103
- const e = [];
104
- for (const n of t)
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 v() {
109
- return {
110
- spaces: [],
111
- activeFunc: {
112
- id: "",
113
- name: "",
114
- inputs: [],
115
- outputs: []
116
- },
117
- activeFlow: {
118
- id: "",
119
- name: ""
120
- },
121
- activeObject: {
122
- type: "func",
123
- version: ""
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 l() {
128
- return {
129
- spaces: []
130
- };
121
+ function initData() {
122
+ return { spaces: [] };
131
123
  }
132
- function h() {
133
- return {
134
- spaces: []
135
- };
124
+ function initResource() {
125
+ return { spaces: [] };
136
126
  }
137
- const F = (function() {
138
- return window.globalState || (window.globalState = {
139
- app: f(),
140
- compute: v(),
141
- data: l(),
142
- resource: h()
143
- }), window.globalState;
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.36",
4
+ "version": "0.3.37",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -23,10 +23,10 @@
23
23
  },
24
24
  "dependencies": {
25
25
  "lodash-es": "^4.17.22",
26
- "vue": "^3.5.26",
27
- "vuetify": "^3.11.6",
28
- "x-essential-lib": "^0.9.23",
29
- "x-runtime-lib": "^0.8.182"
26
+ "vue": "^3.5.27",
27
+ "vuetify": "^3.11.7",
28
+ "x-essential-lib": "^0.9.24",
29
+ "x-runtime-lib": "^0.8.188"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@eslint/js": "^9.39.2",
@@ -43,11 +43,14 @@
43
43
  "prettier": "3.8.0",
44
44
  "sass": "^1.97.2",
45
45
  "typescript": "^5.9.3",
46
- "typescript-eslint": "^8.53.0",
47
- "vite": "^7.3.1",
46
+ "typescript-eslint": "^8.53.1",
47
+ "vite": "npm:rolldown-vite@7.3.1",
48
48
  "vite-plugin-css-injected-by-js": "^3.5.2",
49
- "vite-plugin-vuetify": "^2.1.2",
49
+ "vite-plugin-vuetify": "^2.1.3",
50
50
  "vue-eslint-parser": "^10.2.0",
51
51
  "vue-tsc": "^3.2.2"
52
+ },
53
+ "overrides": {
54
+ "vite": "npm:rolldown-vite@7.3.1"
52
55
  }
53
56
  }