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.
@@ -1,4 +1,4 @@
1
1
  import { Middleware } from './redux';
2
2
 
3
- export declare const resolveAsset: (name: string) => string;
3
+ export declare function resolveAsset(name: string): string;
4
4
  export declare const assetMiddleware: Middleware;
@@ -1,4 +1,8 @@
1
- const l = [/v4shim/i], d = {}, r = (t) => d[t] || t, f = (t) => (p) => (n) => {
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 (l.some((c) => c.test(s)))
13
+ if (c.some((p) => p.test(s)))
10
14
  continue;
11
- const o = e[s], a = s.split(".").pop();
12
- d[s] = o, a === "css" && Byond.loadCss(o), a === "js" && Byond.loadJs(o);
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
- p(n);
20
+ d(n);
17
21
  };
18
22
  export {
19
23
  f as assetMiddleware,
20
- r as resolveAsset
24
+ l as resolveAsset
21
25
  };
@@ -1,31 +1,34 @@
1
- import { jsx as l } from "react/jsx-runtime";
2
- import { useState as $, useEffect as h } from "react";
3
- import { resolveAsset as j } from "../common/assets.js";
4
- import { fetchRetry as v } from "../common/http.js";
5
- import { Image as x } from "./Image.js";
6
- let r;
7
- function d(f) {
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: I,
10
- direction: m = 2,
11
- fallback: s,
12
- frame: c = 1,
13
- icon_state: i,
14
- icon: t,
15
- movement: a = !1,
16
- ...p
17
- } = f, [o, n] = $(""), u = `${o}?state=${i}&dir=${m}&movement=${a}&frame=${c}`;
18
- return h(() => {
19
- if (r) {
20
- n(r[t]);
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(j("icon_ref_map.json")).then((e) => e.json()).then((e) => {
24
- r = e, n(e[t]);
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
- }, []), o ? /* @__PURE__ */ l(x, { fixErrors: !0, src: u, ...p }) : s;
27
+ }, []), n ? /* @__PURE__ */ y($, { children: [
28
+ /* @__PURE__ */ g(I, { fixErrors: !0, src: j, ...u }),
29
+ h
30
+ ] }) : i;
28
31
  }
29
32
  export {
30
- d as DmIcon
33
+ S as DmIcon
31
34
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tgui-core",
3
- "version": "1.1.7",
3
+ "version": "1.1.8",
4
4
  "description": "TGUI core component library",
5
5
  "keywords": [
6
6
  "TGUI",