@memobit/libs 3.12.1 → 3.12.2
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/components/ErrorBoundary/ErrorBoundary2.js +2 -2
- package/dist/components/Icon/Icon2.js +16 -15
- package/dist/components/QuickOptionUpdate/QuickOptionUpdate2.js +4 -4
- package/dist/contexts/AuthContext/AuthContext.js +1 -1
- package/dist/helpers/Numbers.js +10 -6
- package/dist/helpers/VersionInfo.js +1 -1
- package/dist/version.js +1 -1
- package/dist/version.json +4 -4
- package/package.json +2 -1
|
@@ -2,8 +2,8 @@ import './ErrorBoundary.css';
|
|
|
2
2
|
import { EmptyState as s } from "../EmptyState/EmptyState2.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import { Component as a } from "react";
|
|
5
|
+
import { logger as c } from "@memobit/core";
|
|
5
6
|
import { jsx as o } from "react/jsx-runtime";
|
|
6
|
-
import { reportError as c } from "@memobit/core";
|
|
7
7
|
var h = class extends a {
|
|
8
8
|
constructor(...r) {
|
|
9
9
|
super(...r), this.state = { error: null }, this.reset = () => {
|
|
@@ -14,7 +14,7 @@ var h = class extends a {
|
|
|
14
14
|
return { error: r };
|
|
15
15
|
}
|
|
16
16
|
componentDidCatch(r, t) {
|
|
17
|
-
c(r, { componentStack: t.componentStack ?? void 0 }),
|
|
17
|
+
c.error("ErrorBoundary caught an error", r, { componentStack: t.componentStack ?? void 0 }), this.props.onError?.(r, t);
|
|
18
18
|
}
|
|
19
19
|
render() {
|
|
20
20
|
const { error: r } = this.state, { children: t, title: n, resetLabel: i, fallback: e } = this.props;
|
|
@@ -1,43 +1,44 @@
|
|
|
1
1
|
import './Icon.css';
|
|
2
2
|
/* empty css */
|
|
3
3
|
import { useEffect as g, useState as I } from "react";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
import { logger as y } from "@memobit/core";
|
|
5
|
+
import { canLoadMoreIcons as n, getIcon as N, loadIcon as w } from "@memobit/icons/map";
|
|
6
|
+
import { jsx as x } from "react/jsx-runtime";
|
|
7
|
+
var c = /* @__PURE__ */ new Set(), a = (e) => {
|
|
8
|
+
c.has(e) || (c.add(e), y.warn(n ? "[@memobit/libs] No icon named <name>." : "[@memobit/libs] No icon named <name>. If this app trims icons with @memobit/icons/vite, add it to the plugin's `include` option or use `lazy` — a name that only exists at runtime cannot be found by the source scan.", { name: e }));
|
|
9
|
+
}, C = ({ className: e = "", fade: l, fadeOnHover: d, name: o, pulse: u, pulseOnHover: f, size: r, spin: p, spinOnHover: m, variant: t }) => {
|
|
10
|
+
const h = [
|
|
10
11
|
"icon",
|
|
11
12
|
r ? `icon--${r}` : "",
|
|
12
13
|
t && t !== "default" ? `icon--${t}` : "",
|
|
13
14
|
p ? "icon--spin" : "",
|
|
14
15
|
l ? "icon--fade" : "",
|
|
15
16
|
u ? "icon--pulse" : "",
|
|
16
|
-
|
|
17
|
+
m ? "icon--spin-hover" : "",
|
|
17
18
|
d ? "icon--fade-hover" : "",
|
|
18
19
|
f ? "icon--pulse-hover" : "",
|
|
19
|
-
|
|
20
|
-
].filter(Boolean).join(" "), [, v] = I(null), i =
|
|
20
|
+
e
|
|
21
|
+
].filter(Boolean).join(" "), [, v] = I(null), i = N(o);
|
|
21
22
|
return g(() => {
|
|
22
23
|
if (i !== void 0 || !n) return;
|
|
23
24
|
let s = !0;
|
|
24
|
-
return
|
|
25
|
+
return w(o).then((b) => {
|
|
25
26
|
if (s) {
|
|
26
27
|
if (b === void 0) {
|
|
27
|
-
a(
|
|
28
|
+
a(o);
|
|
28
29
|
return;
|
|
29
30
|
}
|
|
30
|
-
v(
|
|
31
|
+
v(o);
|
|
31
32
|
}
|
|
32
33
|
}, () => {
|
|
33
34
|
}), () => {
|
|
34
35
|
s = !1;
|
|
35
36
|
};
|
|
36
|
-
}, [i,
|
|
37
|
-
className:
|
|
37
|
+
}, [i, o]), i === void 0 && !n && a(o), /* @__PURE__ */ x("span", {
|
|
38
|
+
className: h,
|
|
38
39
|
children: i
|
|
39
40
|
});
|
|
40
41
|
};
|
|
41
42
|
export {
|
|
42
|
-
|
|
43
|
+
C as Icon
|
|
43
44
|
};
|
|
@@ -3,8 +3,8 @@ import { Modal as x } from "../Modal/Modal2.js";
|
|
|
3
3
|
import { Radio as C } from "../Radio/Radio2.js";
|
|
4
4
|
/* empty css */
|
|
5
5
|
import { useEffect as S, useState as n } from "react";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { logger as b } from "@memobit/core";
|
|
7
|
+
import { jsx as a, jsxs as q } from "react/jsx-runtime";
|
|
8
8
|
var U = ({ isOpen: m = !1, list: c, title: f, onClose: t, onSave: u, icon: v, value: i }) => {
|
|
9
9
|
const [r, l] = n(i), [s, d] = n(!1), [p, o] = n("");
|
|
10
10
|
S(() => {
|
|
@@ -24,11 +24,11 @@ var U = ({ isOpen: m = !1, list: c, title: f, onClose: t, onSave: u, icon: v, va
|
|
|
24
24
|
d(!1);
|
|
25
25
|
}
|
|
26
26
|
}, h = (e) => {
|
|
27
|
-
typeof e == "string" || typeof e == "number" ? l(e) :
|
|
27
|
+
typeof e == "string" || typeof e == "number" ? l(e) : b.error("QuickOptionUpdate received an unsupported value type", void 0, { type: typeof e });
|
|
28
28
|
};
|
|
29
29
|
return /* @__PURE__ */ a("div", {
|
|
30
30
|
className: "quick-set",
|
|
31
|
-
children: /* @__PURE__ */
|
|
31
|
+
children: /* @__PURE__ */ q(x, {
|
|
32
32
|
isOpen: m,
|
|
33
33
|
titleIcon: v,
|
|
34
34
|
title: f,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { HttpMethod as o, buildRequestHeaders as A } from "../../helpers/Http.js";
|
|
2
2
|
import { AuthContext as U } from "./AuthContext.context.js";
|
|
3
3
|
import { useCallback as i, useEffect as j, useState as c } from "react";
|
|
4
|
-
import { jsx as B } from "react/jsx-runtime";
|
|
5
4
|
import { logger as h } from "@memobit/core";
|
|
5
|
+
import { jsx as B } from "react/jsx-runtime";
|
|
6
6
|
function C({ children: f, config: a }) {
|
|
7
7
|
const [d, u] = c(null), [p, s] = c(!0);
|
|
8
8
|
j(() => {
|
package/dist/helpers/Numbers.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { logger as n } from "@memobit/core";
|
|
2
|
+
var m = (r) => Number((typeof r == "number" ? r : Number(r)).toFixed(2)), o = (r, e) => (r > e && n.warn("getPercent: value is higher than total", {
|
|
3
|
+
value: r,
|
|
4
|
+
total: e
|
|
5
|
+
}), r === e ? r === 0 ? 0 : 100 : r / (e / 100)), a = (r, e) => {
|
|
2
6
|
const t = r + e;
|
|
3
7
|
return t === 0 ? {
|
|
4
8
|
a: 0,
|
|
@@ -7,10 +11,10 @@ var o = (r) => Number((typeof r == "number" ? r : Number(r)).toFixed(2)), a = (r
|
|
|
7
11
|
a: Math.round(r / t * 100 * 10) / 10,
|
|
8
12
|
b: Math.round(e / t * 100 * 10) / 10
|
|
9
13
|
};
|
|
10
|
-
},
|
|
14
|
+
}, f = (r, e, t) => Math.min(t, Math.max(e, r));
|
|
11
15
|
export {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
f as clamp,
|
|
17
|
+
m as format2Digits,
|
|
18
|
+
o as getPercent,
|
|
19
|
+
a as getPercentsOf2Numbers
|
|
16
20
|
};
|
package/dist/version.js
CHANGED
package/dist/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memobit/libs",
|
|
3
|
-
"version": "3.12.
|
|
3
|
+
"version": "3.12.2",
|
|
4
4
|
"description": "React component library powering the Memobit apps — 100+ components, helpers and hooks. Icons ship as @memobit/icons and themes as @memobit/themes. TypeScript-first, ESM-only, React 19.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -98,6 +98,7 @@
|
|
|
98
98
|
"@memobit/icons": "file:../memobit-react-icons",
|
|
99
99
|
"@memobit/themes": "file:../memobit-react-themes",
|
|
100
100
|
"@microsoft/api-extractor": "7.59.2",
|
|
101
|
+
"@types/node": "25.9.8",
|
|
101
102
|
"@types/react": "19.3.0",
|
|
102
103
|
"@types/react-dom": "19.3.0",
|
|
103
104
|
"@vitejs/plugin-react": "6.1.1",
|