tgui-core 1.1.7 → 1.1.8
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/common/assets.d.ts +1 -1
- package/dist/common/assets.js +10 -6
- package/dist/components/DmIcon.js +26 -23
- package/package.json +1 -1
package/dist/common/assets.d.ts
CHANGED
package/dist/common/assets.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
const
|
|
1
|
+
const c = [/v4shim/i], a = {};
|
|
2
|
+
function l(t) {
|
|
3
|
+
return a[t] || t;
|
|
4
|
+
}
|
|
5
|
+
const f = (t) => (d) => (n) => {
|
|
2
6
|
const { type: i, payload: e } = n;
|
|
3
7
|
if (i === "asset/stylesheet") {
|
|
4
8
|
Byond.loadCss(e);
|
|
@@ -6,16 +10,16 @@ const l = [/v4shim/i], d = {}, r = (t) => d[t] || t, f = (t) => (p) => (n) => {
|
|
|
6
10
|
}
|
|
7
11
|
if (i === "asset/mappings") {
|
|
8
12
|
for (const s of Object.keys(e)) {
|
|
9
|
-
if (
|
|
13
|
+
if (c.some((p) => p.test(s)))
|
|
10
14
|
continue;
|
|
11
|
-
const o = e[s],
|
|
12
|
-
|
|
15
|
+
const o = e[s], r = s.split(".").pop();
|
|
16
|
+
a[s] = o, r === "css" && Byond.loadCss(o), r === "js" && Byond.loadJs(o);
|
|
13
17
|
}
|
|
14
18
|
return;
|
|
15
19
|
}
|
|
16
|
-
|
|
20
|
+
d(n);
|
|
17
21
|
};
|
|
18
22
|
export {
|
|
19
23
|
f as assetMiddleware,
|
|
20
|
-
|
|
24
|
+
l as resolveAsset
|
|
21
25
|
};
|
|
@@ -1,31 +1,34 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { resolveAsset as
|
|
4
|
-
import { fetchRetry as
|
|
5
|
-
import { Image as
|
|
6
|
-
let
|
|
7
|
-
function
|
|
1
|
+
import { jsxs as y, Fragment as $, jsx as g } from "react/jsx-runtime";
|
|
2
|
+
import { useState as c, useEffect as x } from "react";
|
|
3
|
+
import { resolveAsset as v } from "../common/assets.js";
|
|
4
|
+
import { fetchRetry as D } from "../common/http.js";
|
|
5
|
+
import { Image as I } from "./Image.js";
|
|
6
|
+
let t;
|
|
7
|
+
function S(m) {
|
|
8
8
|
const {
|
|
9
|
-
className:
|
|
10
|
-
direction:
|
|
11
|
-
fallback:
|
|
12
|
-
frame:
|
|
13
|
-
icon_state:
|
|
14
|
-
icon:
|
|
15
|
-
movement:
|
|
16
|
-
...
|
|
17
|
-
} =
|
|
18
|
-
return
|
|
19
|
-
if (
|
|
20
|
-
|
|
9
|
+
className: R,
|
|
10
|
+
direction: f = 2,
|
|
11
|
+
fallback: i,
|
|
12
|
+
frame: a = 1,
|
|
13
|
+
icon_state: l,
|
|
14
|
+
icon: o,
|
|
15
|
+
movement: p = !1,
|
|
16
|
+
...u
|
|
17
|
+
} = m, [n, s] = c(""), [h, r] = c(""), j = `${n}?state=${l}&dir=${f}&movement=${p}&frame=${a}`;
|
|
18
|
+
return x(() => {
|
|
19
|
+
if (t) {
|
|
20
|
+
r(Object.keys(t).length.toString()), s(t[o]);
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
|
-
v(
|
|
24
|
-
|
|
23
|
+
D(v("icon_ref_map.json")).then((e) => (r("!"), e.json())).then((e) => {
|
|
24
|
+
t = e, s(e[o]), r("!!");
|
|
25
25
|
}).catch(() => {
|
|
26
26
|
});
|
|
27
|
-
}, []),
|
|
27
|
+
}, []), n ? /* @__PURE__ */ y($, { children: [
|
|
28
|
+
/* @__PURE__ */ g(I, { fixErrors: !0, src: j, ...u }),
|
|
29
|
+
h
|
|
30
|
+
] }) : i;
|
|
28
31
|
}
|
|
29
32
|
export {
|
|
30
|
-
|
|
33
|
+
S as DmIcon
|
|
31
34
|
};
|