@weasel-js/hud 1.2.0 → 1.3.0
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 +1 -1
- package/dist/react/index.js +1 -1
- package/dist/{tool-BPkQR6_K.js → tool-DJRTf-Oy.js} +17 -11
- package/dist/tool-DJRTf-Oy.js.map +1 -0
- package/dist/widgets/button.d.ts.map +1 -1
- package/dist/widgets/text.d.ts.map +1 -1
- package/package.json +5 -4
- package/dist/tool-BPkQR6_K.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c, u as l } from "./tool-
|
|
1
|
+
import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c, u as l } from "./tool-DJRTf-Oy.js";
|
|
2
2
|
import { createViewportLayer as u, screenToWorld as d, viewToTransform as f } from "@weasel-js/core";
|
|
3
3
|
//#region src/loupe/innerView.ts
|
|
4
4
|
function p(e, t, n, r) {
|
package/dist/react/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as e, n as t, r as n } from "../tool-
|
|
1
|
+
import { c as e, n as t, r as n } from "../tool-DJRTf-Oy.js";
|
|
2
2
|
import { resolveTheme as r, weaselTheme as i } from "@weasel-js/theme";
|
|
3
3
|
import { useEffect as a, useMemo as o, useState as s } from "react";
|
|
4
4
|
import { useThemeOptional as c } from "@weasel-js/theme/react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { pathFromD as e,
|
|
1
|
+
import { pathFromD as e, textCommandFromRuns as t, viewToTransform as n, worldToScreen as r } from "@weasel-js/core";
|
|
2
2
|
import { registerFont as i } from "@weasel-js/font";
|
|
3
3
|
import { resolveTheme as a, weaselTheme as o } from "@weasel-js/theme";
|
|
4
4
|
//#region src/widgets/rect.ts
|
|
@@ -92,13 +92,15 @@ function c(e) {
|
|
|
92
92
|
},
|
|
93
93
|
draw(n) {
|
|
94
94
|
let a = e.color ?? n.tokens["--wzl-fg"];
|
|
95
|
-
return [t(r.x, r.y,
|
|
96
|
-
|
|
97
|
-
fontSize: e.fontSize,
|
|
95
|
+
return [t(r.x, r.y, [{
|
|
96
|
+
text: i,
|
|
98
97
|
fill: {
|
|
99
98
|
fill: "solid",
|
|
100
99
|
color: a
|
|
101
100
|
}
|
|
101
|
+
}], {
|
|
102
|
+
fontFamily: e.fontFamily ?? n.defaultFont,
|
|
103
|
+
fontSize: e.fontSize
|
|
102
104
|
})];
|
|
103
105
|
},
|
|
104
106
|
hitTest() {
|
|
@@ -247,13 +249,15 @@ function d(e) {
|
|
|
247
249
|
fill: "solid",
|
|
248
250
|
color: o ? u : s ? l : i
|
|
249
251
|
}
|
|
250
|
-
}, t(f + 8, p + h / 2 + c / 3,
|
|
251
|
-
|
|
252
|
-
fontSize: c,
|
|
252
|
+
}, t(f + 8, p + h / 2 + c / 3, [{
|
|
253
|
+
text: a,
|
|
253
254
|
fill: {
|
|
254
255
|
fill: "solid",
|
|
255
256
|
color: d
|
|
256
257
|
}
|
|
258
|
+
}], {
|
|
259
|
+
fontFamily: e.fontFamily ?? n.defaultFont,
|
|
260
|
+
fontSize: c
|
|
257
261
|
})];
|
|
258
262
|
},
|
|
259
263
|
hitTest(e, t) {
|
|
@@ -459,13 +463,15 @@ function v(n) {
|
|
|
459
463
|
}
|
|
460
464
|
};
|
|
461
465
|
if (l.push(h), !r) return l;
|
|
462
|
-
l.push(t(i + a.edge + 2, o,
|
|
463
|
-
|
|
464
|
-
fontSize: 12,
|
|
466
|
+
l.push(t(i + a.edge + 2, o, [{
|
|
467
|
+
text: d,
|
|
465
468
|
fill: {
|
|
466
469
|
fill: "solid",
|
|
467
470
|
color: n.tokens["--wzl-fg-muted"]
|
|
468
471
|
}
|
|
472
|
+
}], {
|
|
473
|
+
fontFamily: n.defaultFont,
|
|
474
|
+
fontSize: 12
|
|
469
475
|
}, s - a.edge * 2 - a.closeSize - 4, a.titleH, "center"));
|
|
470
476
|
let g = E(), _ = g.x + 3, y = g.y + 3, b = g.x + g.w - 3, x = g.y + g.h - 3;
|
|
471
477
|
return l.push({
|
|
@@ -953,4 +959,4 @@ function z() {
|
|
|
953
959
|
//#endregion
|
|
954
960
|
export { T as a, y as c, w as i, f as l, z as n, S as o, D as r, C as s, O as t, g as u };
|
|
955
961
|
|
|
956
|
-
//# sourceMappingURL=tool-
|
|
962
|
+
//# sourceMappingURL=tool-DJRTf-Oy.js.map
|