@rotorjs/dashboard 0.7.1 → 0.7.3
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/main.js +11 -22
- package/package.json +17 -17
package/dist/main.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ActionEvent as e, StateConsumer as t, StateEngine as n, StateEventTarget as r, StateReducer as i, TypedEventTarget as a } from "@rotorjs/state";
|
|
2
2
|
import o from "fast-deep-equal";
|
|
3
3
|
import { v7 as s } from "uuid";
|
|
4
|
-
|
|
4
|
+
// lib/DashboardEnvironment.ts
|
|
5
5
|
var c = class extends a {
|
|
6
6
|
#e;
|
|
7
7
|
#t = s();
|
|
@@ -18,16 +18,16 @@ var c = class extends a {
|
|
|
18
18
|
let n = t.action;
|
|
19
19
|
switch (n.type) {
|
|
20
20
|
case "var": {
|
|
21
|
-
let e = this.#n[n.name], t =
|
|
21
|
+
let e = this.#n[n.name], t = {
|
|
22
22
|
value: n.value,
|
|
23
23
|
exposed: n.exposed ?? !1
|
|
24
|
-
}
|
|
25
|
-
o(e, t) || (this.#n[n.name] = t, this.#r = void 0, this.dispatchEvent(new l(n.name, t.value, t.exposed)));
|
|
24
|
+
};
|
|
25
|
+
o(e, t) || (this.#n[n.name] = Object.freeze(t), this.#r = void 0, this.dispatchEvent(new l(n.name, t.value, t.exposed)));
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
28
|
case "fact": {
|
|
29
|
-
let e = this.#i[n.name], t =
|
|
30
|
-
o(e, t) || (this.#i[n.name] = t, this.#a = void 0, this.dispatchEvent(new u(n.name, t.value)));
|
|
29
|
+
let e = this.#i[n.name], t = { value: n.value };
|
|
30
|
+
o(e, t) || (this.#i[n.name] = Object.freeze(t), this.#a = void 0, this.dispatchEvent(new u(n.name, t.value)));
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
33
|
case "sync": this.vars.forEach(([t, { value: n, exposed: r }]) => {
|
|
@@ -108,16 +108,14 @@ var c = class extends a {
|
|
|
108
108
|
return this.#t;
|
|
109
109
|
}
|
|
110
110
|
};
|
|
111
|
-
|
|
112
|
-
//#region lib/interests.ts
|
|
111
|
+
// lib/interests.ts
|
|
113
112
|
function d(e) {
|
|
114
113
|
return `dashboard://var/${encodeURIComponent(e)}`;
|
|
115
114
|
}
|
|
116
115
|
function f(e) {
|
|
117
116
|
return `dashboard://fact/${encodeURIComponent(e)}`;
|
|
118
117
|
}
|
|
119
|
-
|
|
120
|
-
//#region lib/DashboardEngine.ts
|
|
118
|
+
// lib/DashboardEngine.ts
|
|
121
119
|
var p = class extends n {
|
|
122
120
|
#e;
|
|
123
121
|
#t;
|
|
@@ -185,11 +183,7 @@ var p = class extends n {
|
|
|
185
183
|
}, h = class extends t {
|
|
186
184
|
constructor(e, t, n) {
|
|
187
185
|
super(e, t, n), this.target.addEventListener("action", (e) => {
|
|
188
|
-
|
|
189
|
-
case "sync":
|
|
190
|
-
this.target.subscribeState(this.id, this.descriptor);
|
|
191
|
-
return;
|
|
192
|
-
}
|
|
186
|
+
e.action.type === "sync" && this.target.subscribeState(this.id, this.descriptor);
|
|
193
187
|
}, { signal: this.signal });
|
|
194
188
|
}
|
|
195
189
|
compareStates(e, t) {
|
|
@@ -222,9 +216,7 @@ var p = class extends n {
|
|
|
222
216
|
return new Intl.NumberFormat(this.getLocale(e));
|
|
223
217
|
}
|
|
224
218
|
format(e, t) {
|
|
225
|
-
|
|
226
|
-
default: return y(this.getFormat(t).format(e), t);
|
|
227
|
-
}
|
|
219
|
+
return t?.type, y(this.getFormat(t).format(e), t);
|
|
228
220
|
}
|
|
229
221
|
};
|
|
230
222
|
function y(e, t) {
|
|
@@ -235,14 +227,11 @@ function y(e, t) {
|
|
|
235
227
|
case "none":
|
|
236
228
|
r = "";
|
|
237
229
|
break;
|
|
238
|
-
default:
|
|
239
|
-
r = "\xA0";
|
|
240
|
-
break;
|
|
230
|
+
default: r = "\xA0";
|
|
241
231
|
}
|
|
242
232
|
switch (t.unit.position) {
|
|
243
233
|
case "left": return `${n}${r}${e}`;
|
|
244
234
|
default: return `${e}${r}${n}`;
|
|
245
235
|
}
|
|
246
236
|
}
|
|
247
|
-
//#endregion
|
|
248
237
|
export { p as DashboardEngine, c as DashboardEnvironment, m as DashboardEventTarget, h as DashboardStateConsumer, g as DashboardStateReducer, u as FactEvent, v as NumberFormatter, l as VarEvent, f as dashboardFactInterest, _ as dashboardLocaleFact, d as dashboardVarInterest };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rotorjs/dashboard",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"description": "Rotor",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Aaron Burmeister"
|
|
@@ -43,28 +43,28 @@
|
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@eslint/js": "^10.0.1",
|
|
46
|
-
"@types/react": "^19.
|
|
47
|
-
"@types/react-dom": "^19.
|
|
48
|
-
"@vitejs/plugin-react": "^6.0
|
|
49
|
-
"eslint": "^10.
|
|
46
|
+
"@types/react": "^19.3.0",
|
|
47
|
+
"@types/react-dom": "^19.3.0",
|
|
48
|
+
"@vitejs/plugin-react": "^6.3.0",
|
|
49
|
+
"eslint": "^10.14.0",
|
|
50
50
|
"eslint-config-prettier": "^10.1.8",
|
|
51
51
|
"eslint-import-resolver-typescript": "^4.4.5",
|
|
52
|
-
"eslint-plugin-import-x": "^4.
|
|
53
|
-
"eslint-plugin-prettier": "^5.5.
|
|
52
|
+
"eslint-plugin-import-x": "^4.18.1",
|
|
53
|
+
"eslint-plugin-prettier": "^5.5.7",
|
|
54
54
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
55
|
-
"eslint-plugin-react-refresh": "^0.5.
|
|
56
|
-
"globals": "^17.
|
|
57
|
-
"prettier": "^3.
|
|
58
|
-
"react": "^19.
|
|
59
|
-
"react-dom": "^19.
|
|
55
|
+
"eslint-plugin-react-refresh": "^0.5.7",
|
|
56
|
+
"globals": "^17.14.0",
|
|
57
|
+
"prettier": "^3.10.1",
|
|
58
|
+
"react": "^19.3.1",
|
|
59
|
+
"react-dom": "^19.3.1",
|
|
60
60
|
"typescript": "^6.0.3",
|
|
61
|
-
"typescript-eslint": "^8.
|
|
62
|
-
"unplugin-dts": "^1.
|
|
63
|
-
"vite": "^8.
|
|
61
|
+
"typescript-eslint": "^8.72.2",
|
|
62
|
+
"unplugin-dts": "^1.1.2",
|
|
63
|
+
"vite": "^8.3.8"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@rotorjs/state": "^0.7.
|
|
66
|
+
"@rotorjs/state": "^0.7.1",
|
|
67
67
|
"fast-deep-equal": "^3.1.3",
|
|
68
|
-
"uuid": "^14.0.
|
|
68
|
+
"uuid": "^14.0.3"
|
|
69
69
|
}
|
|
70
70
|
}
|