@memobit/libs 3.24.0 → 3.25.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/components/ErrorBoundary/ErrorBoundary2.js +1 -1
- package/dist/components/Icon/AnimatedIcon.js +20 -0
- package/dist/components/Icon/Icon2.js +7 -7
- package/dist/components/IconPicker/IconPicker2.js +5 -5
- package/dist/components/ImageCropper/ImageCropper2.js +1 -1
- package/dist/components/QuickOptionUpdate/QuickOptionUpdate2.js +4 -4
- package/dist/contexts/AuthContext/AuthContext.js +1 -1
- package/dist/helpers/VersionInfo.js +1 -1
- package/dist/index.d.ts +14 -0
- package/dist/index.js +405 -403
- package/dist/version.js +1 -1
- package/dist/version.json +4 -4
- package/package.json +147 -147
|
@@ -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";
|
|
6
5
|
import { jsx as o } from "react/jsx-runtime";
|
|
6
|
+
import { logger 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 = () => {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import './Icon.css';
|
|
2
|
+
/* empty css */
|
|
3
|
+
import "react";
|
|
4
|
+
import { animatedIconMap as m } from "@memobit/icons/animated";
|
|
5
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
6
|
+
var f = ({ className: r = "", name: c, size: n, variant: o }) => {
|
|
7
|
+
const e = [
|
|
8
|
+
"icon",
|
|
9
|
+
n ? `icon--${n}` : "",
|
|
10
|
+
o && o !== "default" ? `icon--${o}` : "",
|
|
11
|
+
r
|
|
12
|
+
].filter(Boolean).join(" ");
|
|
13
|
+
return /* @__PURE__ */ t("span", {
|
|
14
|
+
className: e,
|
|
15
|
+
children: m[c]
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
f as AnimatedIcon
|
|
20
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
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
|
-
import {
|
|
4
|
+
import { jsx as y } from "react/jsx-runtime";
|
|
5
|
+
import { logger as N } from "@memobit/core";
|
|
6
|
+
import { canLoadMoreIcons as n, getIcon as w, loadIcon as x } from "@memobit/icons/map";
|
|
7
7
|
var c = /* @__PURE__ */ new Set(), a = (e) => {
|
|
8
|
-
c.has(e) || (c.add(e),
|
|
8
|
+
c.has(e) || (c.add(e), N.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
9
|
}, C = ({ className: e = "", fade: l, fadeOnHover: d, name: o, pulse: u, pulseOnHover: f, size: r, spin: p, spinOnHover: m, variant: t }) => {
|
|
10
10
|
const h = [
|
|
11
11
|
"icon",
|
|
@@ -18,11 +18,11 @@ var c = /* @__PURE__ */ new Set(), a = (e) => {
|
|
|
18
18
|
d ? "icon--fade-hover" : "",
|
|
19
19
|
f ? "icon--pulse-hover" : "",
|
|
20
20
|
e
|
|
21
|
-
].filter(Boolean).join(" "), [, v] = I(null), i =
|
|
21
|
+
].filter(Boolean).join(" "), [, v] = I(null), i = w(o);
|
|
22
22
|
return g(() => {
|
|
23
23
|
if (i !== void 0 || !n) return;
|
|
24
24
|
let s = !0;
|
|
25
|
-
return
|
|
25
|
+
return x(o).then((b) => {
|
|
26
26
|
if (s) {
|
|
27
27
|
if (b === void 0) {
|
|
28
28
|
a(o);
|
|
@@ -34,7 +34,7 @@ var c = /* @__PURE__ */ new Set(), a = (e) => {
|
|
|
34
34
|
}), () => {
|
|
35
35
|
s = !1;
|
|
36
36
|
};
|
|
37
|
-
}, [i, o]), i === void 0 && !n && a(o), /* @__PURE__ */
|
|
37
|
+
}, [i, o]), i === void 0 && !n && a(o), /* @__PURE__ */ y("span", {
|
|
38
38
|
className: h,
|
|
39
39
|
children: i
|
|
40
40
|
});
|
|
@@ -4,15 +4,15 @@ import { Tooltip as v } from "../Tooltip/Tooltip2.js";
|
|
|
4
4
|
import { InputSearch as y } from "../InputSearch/InputSearch2.js";
|
|
5
5
|
/* empty css */
|
|
6
6
|
import { useEffect as C, useMemo as h, useState as d } from "react";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { jsx as c, jsxs as S } from "react/jsx-runtime";
|
|
8
|
+
import { canLoadMoreIcons as b, iconMap as j, loadAllIcons as A } from "@memobit/icons/map";
|
|
9
9
|
import { iconAliases as L } from "@memobit/icons";
|
|
10
|
-
var T =
|
|
10
|
+
var T = b ? null : Object.keys(j), q = ({ color: a, emptyLabel: u = "No icons match", icons: o, onChange: f, placeholder: _ = "Search icons...", value: g }) => {
|
|
11
11
|
const [s, k] = d(""), [r, I] = d(T);
|
|
12
12
|
C(() => {
|
|
13
13
|
if (r || o) return;
|
|
14
14
|
let e = !0;
|
|
15
|
-
return
|
|
15
|
+
return A().then((l) => {
|
|
16
16
|
e && I(Object.keys(l));
|
|
17
17
|
}, () => {
|
|
18
18
|
}), () => {
|
|
@@ -25,7 +25,7 @@ var T = S ? null : Object.keys(b), q = ({ color: a, emptyLabel: u = "No icons ma
|
|
|
25
25
|
const l = e.replace(/[\s-]+/g, ""), m = (i) => i.includes(e) || i.replace(/-/g, "").includes(l);
|
|
26
26
|
return t.filter((i) => m(i) || (L[i] ?? []).some(m));
|
|
27
27
|
}, [t, s]);
|
|
28
|
-
return /* @__PURE__ */
|
|
28
|
+
return /* @__PURE__ */ S("div", {
|
|
29
29
|
className: "icon-picker",
|
|
30
30
|
children: [
|
|
31
31
|
/* @__PURE__ */ c("div", {
|
|
@@ -7,8 +7,8 @@ import { fitRegionToAspect as q, initialRegion as E } from "./cropGeometry.js";
|
|
|
7
7
|
import { useCropDrag as J } from "./useCropDrag.js";
|
|
8
8
|
/* empty css */
|
|
9
9
|
import { useEffect as Z, useMemo as ee, useRef as re, useState as n } from "react";
|
|
10
|
-
import { logger as A } from "@memobit/core";
|
|
11
10
|
import { jsx as a, jsxs as d } from "react/jsx-runtime";
|
|
11
|
+
import { logger as A } from "@memobit/core";
|
|
12
12
|
var oe = 1200, ae = 0.9, te = [
|
|
13
13
|
"nw",
|
|
14
14
|
"ne",
|
|
@@ -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 { jsx as a, jsxs as b } from "react/jsx-runtime";
|
|
7
|
+
import { logger as q } from "@memobit/core";
|
|
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) : q.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__ */ b(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 { logger as h } from "@memobit/core";
|
|
5
4
|
import { jsx as B } from "react/jsx-runtime";
|
|
5
|
+
import { logger as h } from "@memobit/core";
|
|
6
6
|
function C({ children: f, config: a }) {
|
|
7
7
|
const [d, u] = c(null), [p, s] = c(!0);
|
|
8
8
|
j(() => {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AnimatedIconName } from '@memobit/icons/animated';
|
|
1
2
|
import { Component } from 'react';
|
|
2
3
|
import { ComponentType } from 'react';
|
|
3
4
|
import { Context } from 'react';
|
|
@@ -113,6 +114,19 @@ export declare interface AngleSliderProps {
|
|
|
113
114
|
|
|
114
115
|
export declare type AngleSliderVariant = 'accent' | 'info' | 'success' | 'warning' | 'danger';
|
|
115
116
|
|
|
117
|
+
/**
|
|
118
|
+
* An icon that moves on its own, for something happening right now (motion in a room, a job
|
|
119
|
+
* running). Sized and coloured like `Icon`; the animation lives in the SVG itself.
|
|
120
|
+
*/
|
|
121
|
+
export declare const AnimatedIcon: default_2.FC<AnimatedIconProps>;
|
|
122
|
+
|
|
123
|
+
declare interface AnimatedIconProps {
|
|
124
|
+
className?: string;
|
|
125
|
+
name: AnimatedIconName;
|
|
126
|
+
size?: IconSize;
|
|
127
|
+
variant?: IconVariant;
|
|
128
|
+
}
|
|
129
|
+
|
|
116
130
|
export declare interface ApiClient {
|
|
117
131
|
get: <T>(path: string) => Promise<T>;
|
|
118
132
|
post: <T, P = unknown>(path: string, payload?: P) => Promise<T>;
|