@memobit/libs 3.12.4 → 3.13.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.
@@ -0,0 +1 @@
1
+ .ImageCropper{gap:var(--spacing-12);flex-direction:column;display:flex}.ImageCropper_stage{min-height:var(--spacing-200);padding:var(--spacing-8);border-radius:var(--radius);background:var(--card-background-accent-color);justify-content:center;align-items:center;display:flex}.ImageCropper_frame{touch-action:none;-webkit-user-select:none;user-select:none;max-width:100%;display:flex;position:relative;overflow:hidden}.ImageCropper_image{pointer-events:none;max-width:100%;max-height:60vh;display:block}.ImageCropper_box{box-sizing:border-box;border:2px solid var(--body-accent-color);box-shadow:0 0 0 9999px color-mix(in srgb, var(--modal-background-color) 72%, transparent);cursor:move;position:absolute}.ImageCropper_grid{background:linear-gradient(to right, transparent calc(33.333% - .5px), var(--delimiter-color) 33.333%, transparent calc(33.333% + .5px)), linear-gradient(to right, transparent calc(66.666% - .5px), var(--delimiter-color) 66.666%, transparent calc(66.666% + .5px)), linear-gradient(to bottom, transparent calc(33.333% - .5px), var(--delimiter-color) 33.333%, transparent calc(33.333% + .5px)), linear-gradient(to bottom, transparent calc(66.666% - .5px), var(--delimiter-color) 66.666%, transparent calc(66.666% + .5px));pointer-events:none;position:absolute;inset:0}.ImageCropper_handle{width:var(--spacing-24);height:var(--spacing-24);border:3px solid var(--body-accent-color);background:0 0;position:absolute}.ImageCropper_handle--nw{top:calc(var(--spacing-4) * -1);left:calc(var(--spacing-4) * -1);cursor:nwse-resize;border-bottom:none;border-right:none}.ImageCropper_handle--ne{top:calc(var(--spacing-4) * -1);right:calc(var(--spacing-4) * -1);cursor:nesw-resize;border-bottom:none;border-left:none}.ImageCropper_handle--sw{bottom:calc(var(--spacing-4) * -1);left:calc(var(--spacing-4) * -1);cursor:nesw-resize;border-top:none;border-right:none}.ImageCropper_handle--se{bottom:calc(var(--spacing-4) * -1);right:calc(var(--spacing-4) * -1);cursor:nwse-resize;border-top:none;border-left:none}.ImageCropper_controls{align-items:center;gap:var(--spacing-8);flex-wrap:wrap;display:flex}.ImageCropper_lock{align-items:center;gap:var(--spacing-8);color:var(--body-color);font-size:var(--font-size-sm);margin-left:auto;display:flex}.ImageCropper_loading,.ImageCropper_error{font-size:var(--font-size-sm);margin:0}.ImageCropper_loading{color:var(--body-color-muted)}.ImageCropper_error{color:var(--body-danger-color)}
@@ -0,0 +1,184 @@
1
+ import './ImageCropper.css';
2
+ import { Button as T } from "../Button/Button2.js";
3
+ import { Modal as K } from "../Modal/Modal2.js";
4
+ import { FULL_IMAGE as C, cropImage as O, loadImageElement as Q, renderImageRegion as X, rotatedSize as z } from "../../helpers/ImageCrop.js";
5
+ import { ToggleSwitch as Y } from "../ToggleSwitch/ToggleSwitch2.js";
6
+ import { fitRegionToAspect as q, initialRegion as E } from "./cropGeometry.js";
7
+ import { useCropDrag as J } from "./useCropDrag.js";
8
+ /* empty css */
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
+ import { jsx as a, jsxs as d } from "react/jsx-runtime";
12
+ var oe = 1200, ae = 0.9, te = [
13
+ "nw",
14
+ "ne",
15
+ "sw",
16
+ "se"
17
+ ], ie = {
18
+ 0: 90,
19
+ 90: 180,
20
+ 180: 270,
21
+ 270: 0
22
+ }, p = (l) => `${(l * 100).toFixed(3)}%`, ue = ({ isOpen: l, source: s, onApply: D, onCancel: _, title: H = "Crop image", aspect: t, aspectLabel: S = "Keep shape", allowFreeAspect: U = !0, allowFullImage: W = !0, maxEdge: B, quality: P }) => {
23
+ const w = re(null), [h, j] = n(null), [f, u] = n(null), [c, I] = n(0), [N, v] = n(!!t), [i, m] = n(C), [y, R] = n(!1), r = h && h.source === s ? h.element : null, g = r ? z(r, c) : {
24
+ width: 1,
25
+ height: 1
26
+ }, k = N ? t : void 0;
27
+ Z(() => {
28
+ if (!l || !s) return;
29
+ let e = !1;
30
+ return u(null), Q(s).then((o) => {
31
+ e || (j({
32
+ source: s,
33
+ element: o
34
+ }), I(0), v(!!t), m(E(o.naturalWidth, o.naturalHeight, t)));
35
+ }).catch((o) => {
36
+ e || u(o instanceof Error ? o.message : "This image could not be opened.");
37
+ }), () => {
38
+ e = !0;
39
+ };
40
+ }, [
41
+ l,
42
+ s,
43
+ t
44
+ ]);
45
+ const x = ee(() => {
46
+ if (!r) return null;
47
+ try {
48
+ return X(r, C, c, oe).toDataURL("image/jpeg", ae);
49
+ } catch (e) {
50
+ return A.error("Image preview failed", e), null;
51
+ }
52
+ }, [r, c]), { startDrag: L, frameHandlers: M } = J({
53
+ frameRef: w,
54
+ region: i,
55
+ onChange: m,
56
+ imageWidth: g.width,
57
+ imageHeight: g.height,
58
+ aspect: k
59
+ }), F = () => {
60
+ if (!r) return;
61
+ const e = ie[c], o = z(r, e);
62
+ I(e), m(E(o.width, o.height, k));
63
+ }, G = () => {
64
+ r && (I(0), v(!!t), m(E(r.naturalWidth, r.naturalHeight, t)));
65
+ }, V = (e) => {
66
+ v(e), e && t && m((o) => q(o, g.width, g.height, t));
67
+ }, b = async (e) => {
68
+ if (r) {
69
+ R(!0);
70
+ try {
71
+ D(await O(r, e, {
72
+ rotation: c,
73
+ maxEdge: B,
74
+ quality: P
75
+ }));
76
+ } catch (o) {
77
+ A.error("Image crop failed", o), u(o instanceof Error ? o.message : "The image could not be cropped.");
78
+ } finally {
79
+ R(!1);
80
+ }
81
+ }
82
+ }, $ = {
83
+ left: p(i.x),
84
+ top: p(i.y),
85
+ width: p(i.width),
86
+ height: p(i.height)
87
+ };
88
+ return /* @__PURE__ */ a(K, {
89
+ isOpen: l,
90
+ onClose: _,
91
+ title: H,
92
+ titleIcon: "image",
93
+ size: "large",
94
+ primary: {
95
+ text: "Apply",
96
+ icon: "checkmark",
97
+ variant: "info",
98
+ onClick: () => {
99
+ b(i);
100
+ },
101
+ loading: y,
102
+ disabled: !r
103
+ },
104
+ secondary: {
105
+ text: "Cancel",
106
+ variant: "plain",
107
+ onClick: _
108
+ },
109
+ tertiary: W ? {
110
+ text: "Use full image",
111
+ variant: "ghost",
112
+ onClick: () => {
113
+ b(C);
114
+ },
115
+ disabled: !r || y
116
+ } : void 0,
117
+ children: /* @__PURE__ */ d("div", {
118
+ className: "ImageCropper",
119
+ children: [
120
+ f && /* @__PURE__ */ a("p", {
121
+ className: "ImageCropper_error",
122
+ children: f
123
+ }),
124
+ /* @__PURE__ */ a("div", {
125
+ className: "ImageCropper_stage",
126
+ children: x ? /* @__PURE__ */ d("div", {
127
+ className: "ImageCropper_frame",
128
+ ref: w,
129
+ ...M,
130
+ children: [/* @__PURE__ */ a("img", {
131
+ className: "ImageCropper_image",
132
+ src: x,
133
+ alt: "",
134
+ draggable: !1
135
+ }), /* @__PURE__ */ d("div", {
136
+ className: "ImageCropper_box",
137
+ style: $,
138
+ onPointerDown: L("move"),
139
+ children: [/* @__PURE__ */ a("span", { className: "ImageCropper_grid" }), te.map((e) => /* @__PURE__ */ a("span", {
140
+ className: `ImageCropper_handle ImageCropper_handle--${e}`,
141
+ onPointerDown: L(e)
142
+ }, e))]
143
+ })]
144
+ }) : !f && /* @__PURE__ */ a("p", {
145
+ className: "ImageCropper_loading",
146
+ children: "Opening image…"
147
+ })
148
+ }),
149
+ /* @__PURE__ */ d("div", {
150
+ className: "ImageCropper_controls",
151
+ children: [
152
+ /* @__PURE__ */ a(T, {
153
+ size: "small",
154
+ variant: "default",
155
+ icon: "synchronize",
156
+ onClick: F,
157
+ disabled: !r,
158
+ children: "Rotate"
159
+ }),
160
+ /* @__PURE__ */ a(T, {
161
+ size: "small",
162
+ variant: "ghost",
163
+ icon: "return",
164
+ onClick: G,
165
+ disabled: !r,
166
+ children: "Reset"
167
+ }),
168
+ t && U && /* @__PURE__ */ d("div", {
169
+ className: "ImageCropper_lock",
170
+ children: [/* @__PURE__ */ a(Y, {
171
+ size: "small",
172
+ checked: N,
173
+ onChange: V
174
+ }), /* @__PURE__ */ a("span", { children: S })]
175
+ })
176
+ ]
177
+ })
178
+ ]
179
+ })
180
+ });
181
+ };
182
+ export {
183
+ ue as ImageCropper
184
+ };
@@ -0,0 +1,56 @@
1
+ var y = 0.08, x = 0.9, f = (i, n, o) => Math.min(o, Math.max(n, i)), s = (i, n, o) => i * o / n, A = (i, n, o) => {
2
+ if (!o) {
3
+ const e = 0.04999999999999999;
4
+ return {
5
+ x: e,
6
+ y: e,
7
+ width: x,
8
+ height: x
9
+ };
10
+ }
11
+ const w = s(o, i, n);
12
+ let r = x, t = r / w;
13
+ return t > x && (t = x, r = t * w), {
14
+ x: (1 - r) / 2,
15
+ y: (1 - t) / 2,
16
+ width: r,
17
+ height: t
18
+ };
19
+ }, E = (i, n, o, w) => {
20
+ const r = s(w, n, o);
21
+ let t = i.width, e = t / r;
22
+ e > 1 && (e = 1, t = e * r), t > 1 && (t = 1, e = t / r);
23
+ const m = i.x + i.width / 2, g = i.y + i.height / 2;
24
+ return {
25
+ x: f(m - t / 2, 0, 1 - t),
26
+ y: f(g - e / 2, 0, 1 - e),
27
+ width: t,
28
+ height: e
29
+ };
30
+ }, X = (i, n, o, w, r, t, e) => {
31
+ if (n === "move") return {
32
+ ...i,
33
+ x: f(i.x + o, 0, 1 - i.width),
34
+ y: f(i.y + w, 0, 1 - i.height)
35
+ };
36
+ const m = n === "nw" || n === "sw", g = n === "nw" || n === "ne", v = m ? i.x + i.width : i.x, M = g ? i.y + i.height : i.y, R = m ? v : 1 - v, l = g ? M : 1 - M;
37
+ let h = f(i.width + (m ? -o : o), y, R), c = f(i.height + (g ? -w : w), y, l);
38
+ if (e) {
39
+ const a = s(e, r, t);
40
+ Math.abs(o) >= Math.abs(w) * a ? c = h / a : h = c * a, c > l && (c = l, h = c * a), h > R && (h = R, c = h / a);
41
+ const u = Math.max(y, y * a);
42
+ h < u && (h = u, c = h / a);
43
+ }
44
+ return h = Math.min(h, 1), c = Math.min(c, 1), {
45
+ x: f(m ? v - h : v, 0, 1 - h),
46
+ y: f(g ? M - c : M, 0, 1 - c),
47
+ width: h,
48
+ height: c
49
+ };
50
+ };
51
+ export {
52
+ y as MIN_CROP,
53
+ X as dragRegion,
54
+ E as fitRegionToAspect,
55
+ A as initialRegion
56
+ };
@@ -0,0 +1,37 @@
1
+ import { dragRegion as l } from "./cropGeometry.js";
2
+ import { useRef as m } from "react";
3
+ var P = ({ frameRef: a, region: c, onChange: s, imageWidth: d, imageHeight: u, aspect: p }) => {
4
+ const n = m(null), f = (t) => (r) => {
5
+ const e = a.current;
6
+ if (!e || r.button !== 0) return;
7
+ r.preventDefault(), r.stopPropagation(), r.currentTarget.setPointerCapture(r.pointerId);
8
+ const o = e.getBoundingClientRect();
9
+ n.current = {
10
+ handle: t,
11
+ pointerId: r.pointerId,
12
+ startX: r.clientX,
13
+ startY: r.clientY,
14
+ start: c,
15
+ frameWidth: o.width,
16
+ frameHeight: o.height
17
+ };
18
+ }, g = (t) => {
19
+ const r = n.current;
20
+ if (!r || r.pointerId !== t.pointerId) return;
21
+ const e = (t.clientX - r.startX) / r.frameWidth, o = (t.clientY - r.startY) / r.frameHeight;
22
+ s(l(r.start, r.handle, e, o, d, u, p));
23
+ }, i = (t) => {
24
+ n.current?.pointerId === t.pointerId && (n.current = null);
25
+ };
26
+ return {
27
+ startDrag: f,
28
+ frameHandlers: {
29
+ onPointerMove: g,
30
+ onPointerUp: i,
31
+ onPointerCancel: i
32
+ }
33
+ };
34
+ };
35
+ export {
36
+ P as useCropDrag
37
+ };
@@ -4,8 +4,8 @@ import { Checkbox as Q } from "../Checkbox/Checkbox2.js";
4
4
  import { Dropdown as V } from "../Dropdown/Dropdown2.js";
5
5
  import { InputSearch as W } from "../InputSearch/InputSearch2.js";
6
6
  import { Drawer as K } from "../Drawer/Drawer2.js";
7
- import { FAVORITE_THEMES as L, THEME_CONFIGS as U, getThemeAppearance as B } from "./themeConfig.js";
8
- import { ToggleSwitch as k } from "../ToggleSwitch/ToggleSwitch2.js";
7
+ import { ToggleSwitch as L } from "../ToggleSwitch/ToggleSwitch2.js";
8
+ import { FAVORITE_THEMES as k, THEME_CONFIGS as U, getThemeAppearance as B } from "./themeConfig.js";
9
9
  /* empty css */
10
10
  import { useEffect as x, useMemo as J, useRef as R, useState as v } from "react";
11
11
  import { Fragment as X, jsx as t, jsxs as a } from "react/jsx-runtime";
@@ -51,7 +51,7 @@ var Z = [
51
51
  const s = new Set(d);
52
52
  e = e.filter((l) => s.has(l.value));
53
53
  }
54
- if (m && (e = e.filter((s) => L.has(s.value))), h && _ && (e = e.filter((s) => (s.recommendedApps ?? []).some((l) => l.toLowerCase() === _))), c !== "all" && (e = e.filter((s) => B(s.value) === c)), i.trim()) {
54
+ if (m && (e = e.filter((s) => k.has(s.value))), h && _ && (e = e.filter((s) => (s.recommendedApps ?? []).some((l) => l.toLowerCase() === _))), c !== "all" && (e = e.filter((s) => B(s.value) === c)), i.trim()) {
55
55
  const s = i.toLowerCase().trim();
56
56
  e = e.filter((l) => l.label.toLowerCase().includes(s) || (l.recommendedApps ?? []).some((u) => u.toLowerCase().includes(s)));
57
57
  }
@@ -138,14 +138,14 @@ var Z = [
138
138
  value: i,
139
139
  onChange: C
140
140
  }),
141
- o && /* @__PURE__ */ t(k, {
141
+ o && /* @__PURE__ */ t(L, {
142
142
  checked: h,
143
143
  onChange: S,
144
144
  onLabel: `For ${o}`,
145
145
  offLabel: `For ${o}`,
146
146
  size: "small"
147
147
  }),
148
- b && /* @__PURE__ */ t(k, {
148
+ b && /* @__PURE__ */ t(L, {
149
149
  checked: m,
150
150
  onChange: y,
151
151
  onLabel: "Favorites",
@@ -177,7 +177,7 @@ var Z = [
177
177
  className: "theme-settings__preview",
178
178
  style: Y[e.value],
179
179
  children: [
180
- L.has(e.value) && /* @__PURE__ */ t("span", {
180
+ k.has(e.value) && /* @__PURE__ */ t("span", {
181
181
  className: "theme-settings__favorite-badge",
182
182
  children: "⭐"
183
183
  }),
@@ -0,0 +1,51 @@
1
+ var c = {
2
+ x: 0,
3
+ y: 0,
4
+ width: 1,
5
+ height: 1
6
+ }, d = 1600, l = 0.82, m = 0.85, w = (t) => new Promise((e, r) => {
7
+ const h = typeof t == "string" ? t : URL.createObjectURL(t), a = () => {
8
+ typeof t != "string" && URL.revokeObjectURL(h);
9
+ }, n = new Image();
10
+ n.onload = () => {
11
+ a(), e(n);
12
+ }, n.onerror = () => {
13
+ a(), r(/* @__PURE__ */ new Error("This file could not be read as an image."));
14
+ }, n.src = h;
15
+ }), p = (t) => t === 90 || t === 270, v = (t, e = 0) => p(e) ? {
16
+ width: t.naturalHeight,
17
+ height: t.naturalWidth
18
+ } : {
19
+ width: t.naturalWidth,
20
+ height: t.naturalHeight
21
+ }, u = (t) => {
22
+ const e = t.getContext("2d");
23
+ if (!e) throw new Error("Image processing is not available in this browser.");
24
+ return e;
25
+ }, b = (t, e, r = 0, h = d) => {
26
+ const a = v(t, r), n = e.width * a.width, o = e.height * a.height, s = Math.min(1, h / Math.max(n, o)), g = document.createElement("canvas");
27
+ g.width = Math.max(1, Math.round(n * s)), g.height = Math.max(1, Math.round(o * s));
28
+ const i = u(g);
29
+ return i.scale(s, s), i.translate(-e.x * a.width, -e.y * a.height), r === 90 ? i.translate(a.width, 0) : r === 180 ? i.translate(a.width, a.height) : r === 270 && i.translate(0, a.height), i.rotate(r * Math.PI / 180), i.imageSmoothingQuality = "high", i.drawImage(t, 0, 0), g;
30
+ }, x = (t, e) => {
31
+ const r = t.toDataURL("image/webp", e ?? l), h = r.startsWith("data:image/webp"), a = h ? r : t.toDataURL("image/jpeg", e ?? m);
32
+ return {
33
+ dataUrl: a,
34
+ base64: a.split(",")[1] ?? "",
35
+ mimeType: h ? "image/webp" : "image/jpeg",
36
+ extension: h ? "webp" : "jpg",
37
+ width: t.width,
38
+ height: t.height
39
+ };
40
+ }, E = async (t, e = c, r = {}) => {
41
+ const h = t instanceof HTMLImageElement ? t : await w(t), a = b(h, e, r.rotation ?? 0, r.maxEdge ?? d);
42
+ return x(a, r.quality);
43
+ };
44
+ export {
45
+ c as FULL_IMAGE,
46
+ E as cropImage,
47
+ x as encodeCanvas,
48
+ w as loadImageElement,
49
+ b as renderImageRegion,
50
+ v as rotatedSize
51
+ };
@@ -23,7 +23,7 @@ var r = (i) => {
23
23
  const o = {
24
24
  ...i,
25
25
  lib: d,
26
- libBuildNumber: 524,
26
+ libBuildNumber: 534,
27
27
  libCommit: n,
28
28
  libBuildDate: t
29
29
  };
package/dist/index.d.ts CHANGED
@@ -1044,6 +1044,20 @@ export declare const createApiClient: ({ baseUrl, loginPath }: ApiClientConfig)
1044
1044
  */
1045
1045
  export declare const createImagePaths: (folder: string) => ImagePaths;
1046
1046
 
1047
+ /**
1048
+ * Crops, rotates, downscales and encodes an image in the browser before it is uploaded: a phone
1049
+ * photo shrinks from megabytes to a few hundred kilobytes, and EXIF metadata (GPS included) is dropped.
1050
+ */
1051
+ export declare const cropImage: (source: Blob | string | HTMLImageElement, region?: CropRegion, options?: EncodeImageOptions) => Promise<EncodedImage>;
1052
+
1053
+ /** A region of an image as fractions (0–1) of its width and height, measured after rotation. */
1054
+ export declare interface CropRegion {
1055
+ x: number;
1056
+ y: number;
1057
+ width: number;
1058
+ height: number;
1059
+ }
1060
+
1047
1061
  export declare const CSRF_HEADER = "X-CSRF-Token";
1048
1062
 
1049
1063
  export declare const DATA_FILES_PATH = "/data-files";
@@ -1462,6 +1476,28 @@ export declare interface EmptyStateProps {
1462
1476
  children?: default_2.ReactNode;
1463
1477
  }
1464
1478
 
1479
+ /** Encodes a canvas as WebP, or JPEG where the browser cannot encode WebP (canvas then falls back to PNG). */
1480
+ export declare const encodeCanvas: (canvas: HTMLCanvasElement, quality?: number) => EncodedImage;
1481
+
1482
+ export declare interface EncodedImage {
1483
+ /** `data:` URL, handy for an instant preview. */
1484
+ dataUrl: string;
1485
+ /** The same bytes as base64 without the `data:` prefix, the shape memobit-framework uploads expect. */
1486
+ base64: string;
1487
+ mimeType: 'image/webp' | 'image/jpeg';
1488
+ extension: 'webp' | 'jpg';
1489
+ width: number;
1490
+ height: number;
1491
+ }
1492
+
1493
+ export declare interface EncodeImageOptions {
1494
+ /** Longest edge of the output, in pixels. Smaller images are never upscaled. Defaults to 1600. */
1495
+ maxEdge?: number;
1496
+ /** 0–1. Defaults to 0.82 for WebP and 0.85 for the JPEG fallback. */
1497
+ quality?: number;
1498
+ rotation?: ImageRotation;
1499
+ }
1500
+
1465
1501
  /**
1466
1502
  * Normalizes a value into HTML suitable for rendering via dangerouslySetInnerHTML
1467
1503
  * or feeding to the RichTextEditor. If the value already contains HTML tags, it
@@ -1715,6 +1751,8 @@ export declare const formatRelativeTime: (dateValue?: string) => string | null;
1715
1751
  */
1716
1752
  export declare const formatSecondsToMediaTime: (seconds: number | undefined) => string;
1717
1753
 
1754
+ export declare const FULL_IMAGE: CropRegion;
1755
+
1718
1756
  export declare const fuzzyMatch: (text: string, query: string) => boolean;
1719
1757
 
1720
1758
  export declare const getCsrfToken: () => string | null;
@@ -1906,6 +1944,33 @@ export declare type IconSize = 'sm' | 'md' | 'lg' | 'xl' | 'xxl' | 'xxxl';
1906
1944
 
1907
1945
  export declare type IconVariant = 'default' | 'muted' | 'accent' | 'info' | 'success' | 'warning' | 'danger';
1908
1946
 
1947
+ /**
1948
+ * Crop (and rotate) a photo before it is uploaded. The result is already downscaled and encoded as
1949
+ * WebP (JPEG where WebP cannot be encoded), ready to send as a memobit-framework upload.
1950
+ */
1951
+ export declare const ImageCropper: FC<ImageCropperProps>;
1952
+
1953
+ export declare interface ImageCropperProps {
1954
+ isOpen: boolean;
1955
+ /** The photo to crop: a picked File/Blob or an image URL. */
1956
+ source: Blob | string | null;
1957
+ onApply: (image: EncodedImage) => void;
1958
+ onCancel: () => void;
1959
+ title?: string;
1960
+ /** Width ÷ height the crop is locked to, e.g. 85.6 / 54 for a bank card. Omit for a free crop. */
1961
+ aspect?: number;
1962
+ /** Label for the switch that unlocks the aspect, e.g. "Card shape". */
1963
+ aspectLabel?: string;
1964
+ /** Shows the switch that lets the user crop freely when `aspect` is set. Defaults to true. */
1965
+ allowFreeAspect?: boolean;
1966
+ /** Offers "Use full image", which encodes the whole (rotated) image. Defaults to true. */
1967
+ allowFullImage?: boolean;
1968
+ /** Longest edge of the result, in pixels. Defaults to 1600. */
1969
+ maxEdge?: number;
1970
+ /** 0–1 encoder quality. Defaults to the helper's WebP/JPEG defaults. */
1971
+ quality?: number;
1972
+ }
1973
+
1909
1974
  export declare interface ImagePaths {
1910
1975
  basePath: string;
1911
1976
  getDefaultImageUrl: () => string;
@@ -1915,6 +1980,8 @@ export declare interface ImagePaths {
1915
1980
  applyImageFallback: (event: SyntheticEvent<HTMLImageElement>, categoryKey?: string) => void;
1916
1981
  }
1917
1982
 
1983
+ export declare type ImageRotation = 0 | 90 | 180 | 270;
1984
+
1918
1985
  export declare const InfiniteScroll: ({ children, onLoadMore, hasMore, isLoading, threshold, rootMargin, height, onScrollChange, endMessage, className, }: InfiniteScrollProps) => JSX.Element;
1919
1986
 
1920
1987
  declare interface InfiniteScrollProps {
@@ -2362,6 +2429,9 @@ declare interface ListProps {
2362
2429
  className?: string;
2363
2430
  }
2364
2431
 
2432
+ /** Loads a Blob/File or URL into a decoded image element. */
2433
+ export declare const loadImageElement: (source: Blob | string) => Promise<HTMLImageElement>;
2434
+
2365
2435
  export declare const Loading: default_2.FC;
2366
2436
 
2367
2437
  export declare type LogicalOperator = 'and' | 'or';
@@ -2822,6 +2892,12 @@ export declare type RatingVariant = 'success' | 'info' | 'warning' | 'danger';
2822
2892
 
2823
2893
  export declare const readErrorMessage: (response: Response) => Promise<string>;
2824
2894
 
2895
+ /**
2896
+ * Draws `region` of the rotated image into a canvas no bigger than `maxEdge`. The rotation and
2897
+ * crop are applied in one pass from the original pixels, so nothing is resampled twice.
2898
+ */
2899
+ export declare const renderImageRegion: (image: HTMLImageElement, region: CropRegion, rotation?: ImageRotation, maxEdge?: number) => HTMLCanvasElement;
2900
+
2825
2901
  export declare const RichTextEditor: ({ advanced, error, format, id, label, onBlur, onChange, placeholder, required, value, }: RichTextEditorProps) => default_2.JSX.Element;
2826
2902
 
2827
2903
  declare interface RichTextEditorProps {
@@ -2864,6 +2940,12 @@ export declare type RollingNumberSize = 'sm' | 'md' | 'lg' | 'xl' | 'xxl' | 'xxx
2864
2940
 
2865
2941
  export declare type RollingNumberVariant = 'default' | 'accent' | 'info' | 'success' | 'warning' | 'danger';
2866
2942
 
2943
+ /** Image size once rotated. */
2944
+ export declare const rotatedSize: (image: HTMLImageElement, rotation?: ImageRotation) => {
2945
+ width: number;
2946
+ height: number;
2947
+ };
2948
+
2867
2949
  export declare interface ScrollInfo {
2868
2950
  scrollTop: number;
2869
2951
  scrollHeight: number;
@@ -3177,7 +3259,7 @@ export declare interface SwipeHandlers {
3177
3259
  onTouchCancel: () => void;
3178
3260
  }
3179
3261
 
3180
- export declare type Theme = 'amber-meridian' | 'archive-indigo' | 'arctic-blue' | 'asphalt-code' | 'atelier-media' | 'audit-ember' | 'azure-night' | 'blossom-meadow' | 'blueprint-clay' | 'blush-market' | 'brass-chronicle' | 'carbon-velocity' | 'chalk-circuit' | 'chrono-atlas' | 'clinical-aqua' | 'cobalt-pulse' | 'citrus-vital' | 'command-slate' | 'crawler-dusk' | 'crimson-dusk' | 'cyber-forest' | 'dashdarkx' | 'ember-night' | 'emerald-ledger' | 'frost-petal' | 'garden-harvest' | 'gilded-bear' | 'graphite-shell' | 'horizon-amber' | 'horizon-drift' | 'ivory-serif' | 'kindred-ink' | 'lamplight' | 'lavender-mist' | 'light-blue' | 'lumen' | 'luna' | 'mesh-circuit' | 'midnight-atlas' | 'midnight-amber' | 'midnight-folio' | 'mint-meadow' | 'mintone' | 'neon-tokyo' | 'noir-marquee' | 'ocean-breeze' | 'ocean-depths' | 'orbital-night' | 'sandstone' | 'sandy-parchment' | 'screening-room' | 'signal-burst' | 'signal-clarity' | 'slate-focus' | 'slate-bazaar' | 'spectrum-vault' | 'tailwind-vue-dark' | 'terminal-phosphor' | 'terracotta-kitchen' | 'twilight-pulse' | 'vault-guard' | 'velvet-reel' | 'velvet-tome' | 'verdant-pulse' | 'vital-aurora' | 'vital-signal';
3262
+ export declare type Theme = 'amber-meridian' | 'archive-indigo' | 'arctic-blue' | 'asphalt-code' | 'atelier-media' | 'audit-ember' | 'azure-night' | 'blossom-meadow' | 'blueprint-clay' | 'blush-market' | 'brass-chronicle' | 'carbon-velocity' | 'chalk-circuit' | 'chrono-atlas' | 'clinical-aqua' | 'cobalt-pulse' | 'citrus-vital' | 'command-slate' | 'crawler-dusk' | 'crimson-dusk' | 'cyber-forest' | 'dashdarkx' | 'ember-night' | 'emerald-ledger' | 'frost-petal' | 'garden-harvest' | 'gilded-bear' | 'graphite-shell' | 'horizon-amber' | 'horizon-drift' | 'indigo-stitch' | 'ivory-serif' | 'kindred-ink' | 'lamplight' | 'lavender-mist' | 'light-blue' | 'lumen' | 'luna' | 'mesh-circuit' | 'midnight-atlas' | 'midnight-amber' | 'midnight-folio' | 'mint-meadow' | 'mintone' | 'neon-tokyo' | 'noir-marquee' | 'ocean-breeze' | 'ocean-depths' | 'orbital-night' | 'sandstone' | 'sandy-parchment' | 'screening-room' | 'signal-burst' | 'signal-clarity' | 'slate-focus' | 'slate-bazaar' | 'spectrum-vault' | 'tailwind-vue-dark' | 'terminal-phosphor' | 'terracotta-kitchen' | 'twilight-pulse' | 'vault-guard' | 'velvet-reel' | 'velvet-tome' | 'verdant-pulse' | 'vital-aurora' | 'vital-signal' | 'war-room';
3181
3263
 
3182
3264
  export { THEME_CONFIGS }
3183
3265
 
package/dist/index.js CHANGED
@@ -5,35 +5,35 @@ import { ThemeContext as f } from "./components/ThemeSettings/ThemeContextValue.
5
5
  import { useTheme as n } from "./components/ThemeSettings/useTheme.js";
6
6
  import { useComponentEffect as s } from "./hooks/useComponentEffect.js";
7
7
  import { Button as d } from "./components/Button/Button2.js";
8
- import { Tooltip as g } from "./components/Tooltip/Tooltip2.js";
8
+ import { Tooltip as c } from "./components/Tooltip/Tooltip2.js";
9
9
  import { Modal as S } from "./components/Modal/Modal2.js";
10
10
  import { AlertDialog as P } from "./components/AlertDialog/AlertDialog2.js";
11
11
  import { AnalogClock as D } from "./components/AnalogClock/AnalogClock2.js";
12
- import { AngleSlider as A } from "./components/AngleSlider/AngleSlider2.js";
12
+ import { AngleSlider as h } from "./components/AngleSlider/AngleSlider2.js";
13
13
  import { Separator as B } from "./components/Separator/Separator2.js";
14
14
  import { AppHeader as E } from "./components/AppHeader/AppHeader2.js";
15
- import { AvatarInitials as y } from "./components/AvatarInitials/AvatarInitials2.js";
15
+ import { AvatarInitials as L } from "./components/AvatarInitials/AvatarInitials2.js";
16
16
  import { Badge as _ } from "./components/Badge/Badge2.js";
17
17
  import { Banner as v } from "./components/Banner/Banner2.js";
18
18
  import { Blockquote as H } from "./components/Blockquote/Blockquote2.js";
19
- import { ADULT_RANGES as N, PEDIATRIC_THRESHOLDS as w, calculateBMI as O, getIndicatorColor as U, getIndicatorPosition as V, getPediatricRanges as W, getRangeLabel as Q } from "./components/BMI/bmiUtils.js";
19
+ import { ADULT_RANGES as N, PEDIATRIC_THRESHOLDS as w, calculateBMI as U, getIndicatorColor as O, getIndicatorPosition as V, getPediatricRanges as W, getRangeLabel as z } from "./components/BMI/bmiUtils.js";
20
20
  import { BMI as G } from "./components/BMI/BMI2.js";
21
21
  import { Breadcrumb as j } from "./components/Breadcrumb/Breadcrumb2.js";
22
22
  import { BulkActionBar as K } from "./components/BulkActionBar/BulkActionBar2.js";
23
- import { APP_DATE_FORMAT as Y, APP_DATE_TIME_FORMAT as Z, addDays as $, addMonths as rr, formatAppDate as or, formatAppDateTime as tr, formatDate as mr, formatDateLocale as ir, formatDuration as er, formatRelativeDuration as pr, formatRelativeTime as fr, formatSecondsToMediaTime as ar, getDaysInMonth as nr, getIsoWeek as lr, getMonthMatrix as sr, getTodayDateString as ur, isAfter as dr, isBefore as cr, isDateInRange as gr, isSameDay as Tr, isToday as Sr, isWeekend as Ir } from "./helpers/Datetime.js";
23
+ import { APP_DATE_FORMAT as Y, APP_DATE_TIME_FORMAT as Z, addDays as $, addMonths as rr, formatAppDate as or, formatAppDateTime as tr, formatDate as mr, formatDateLocale as ir, formatDuration as er, formatRelativeDuration as pr, formatRelativeTime as fr, formatSecondsToMediaTime as ar, getDaysInMonth as nr, getIsoWeek as lr, getMonthMatrix as sr, getTodayDateString as ur, isAfter as dr, isBefore as gr, isDateInRange as cr, isSameDay as Tr, isToday as Sr, isWeekend as Ir } from "./helpers/Datetime.js";
24
24
  import { Calendar as Cr } from "./components/Calendar/Calendar2.js";
25
- import { CalendarHeatmap as hr } from "./components/CalendarHeatmap/CalendarHeatmap2.js";
25
+ import { CalendarHeatmap as Ar } from "./components/CalendarHeatmap/CalendarHeatmap2.js";
26
26
  import { Card as Mr } from "./components/Card/Card2.js";
27
27
  import { Checkbox as kr } from "./components/Checkbox/Checkbox2.js";
28
28
  import { Chip as Rr } from "./components/Chip/Chip2.js";
29
- import { CollapsibleSection as Lr } from "./components/CollapsibleSection/CollapsibleSection2.js";
29
+ import { CollapsibleSection as yr } from "./components/CollapsibleSection/CollapsibleSection2.js";
30
30
  import { InputNumber as br } from "./components/InputNumber/InputNumber2.js";
31
31
  import { InputText as xr } from "./components/InputText/InputText2.js";
32
32
  import { ColorPicker as Fr } from "./components/ColorPicker/ColorPicker2.js";
33
33
  import { CommandPalette as wr } from "./components/CommandPalette/CommandPalette2.js";
34
- import { Confetti as Ur } from "./components/Confetti/Confetti2.js";
34
+ import { Confetti as Or } from "./components/Confetti/Confetti2.js";
35
35
  import Wr from "./components/ConfirmDialog/ConfirmDialog2.js";
36
- import { usePopover as zr } from "./components/Popover/hooks/Popover.hook.js";
36
+ import { usePopover as Qr } from "./components/Popover/hooks/Popover.hook.js";
37
37
  import { Popover as qr } from "./components/Popover/Popover2.js";
38
38
  import { ConfirmPopover as Jr } from "./components/ConfirmPopover/ConfirmPopover2.js";
39
39
  import { ContextMenu as Xr } from "./components/ContextMenu/ContextMenu2.js";
@@ -44,20 +44,20 @@ import { DatePicker as eo } from "./components/DatePicker/DatePicker2.js";
44
44
  import { foldDiacritics as fo, fuzzyMatch as ao } from "./helpers/Search.js";
45
45
  import { Dropdown as lo } from "./components/Dropdown/Dropdown2.js";
46
46
  import { InputDate as uo } from "./components/InputDate/InputDate2.js";
47
- import { InputSearch as go } from "./components/InputSearch/InputSearch2.js";
47
+ import { InputSearch as co } from "./components/InputSearch/InputSearch2.js";
48
48
  import { Rating as So } from "./components/Rating/Rating2.js";
49
49
  import { Slider as Po } from "./components/Slider/Slider2.js";
50
- import { useControlPanel as Do, useControlPanelContext as ho } from "./components/ControlPanel/useControlPanel.js";
50
+ import { useControlPanel as Do, useControlPanelContext as Ao } from "./components/ControlPanel/useControlPanel.js";
51
51
  import { ControlPanel as Mo } from "./components/ControlPanel/ControlPanel2.js";
52
52
  import { breakpoints as ko, useBreakpoint as Eo } from "./hooks/useBreakpoint.js";
53
- import { ControlPanelProvider as yo } from "./components/ControlPanel/ControlPanelContext.js";
53
+ import { ControlPanelProvider as Lo } from "./components/ControlPanel/ControlPanelContext.js";
54
54
  import { CopyButton as _o } from "./components/CopyButton/CopyButton2.js";
55
55
  import { Flag as vo } from "./components/Flag/Flag2.js";
56
56
  import { CountryWithFlag as Ho } from "./components/CountryWithFlag/CountryWithFlag2.js";
57
57
  import { getResultsCount as No } from "./helpers/Pagination.js";
58
- import { EmptyState as Oo } from "./components/EmptyState/EmptyState2.js";
58
+ import { EmptyState as Uo } from "./components/EmptyState/EmptyState2.js";
59
59
  import { Pagination as Vo } from "./components/Pagination/Pagination2.js";
60
- import { calculateTimelineMarkers as Qo } from "./components/TimelineMarkers/calculateTimelineMarkers.js";
60
+ import { calculateTimelineMarkers as zo } from "./components/TimelineMarkers/calculateTimelineMarkers.js";
61
61
  import { TimelineMarkerDot as Go, TimelineMarkers as qo, TimelineMobileSeparator as jo } from "./components/TimelineMarkers/TimelineMarkers2.js";
62
62
  import { MiniSort as Ko } from "./components/MiniSort/MiniSort2.js";
63
63
  import { DataView as Yo } from "./components/DataView/DataView2.js";
@@ -69,91 +69,93 @@ import { DiffViewer as ft } from "./components/DiffViewer/DiffViewer2.js";
69
69
  import { EmojiPicker as nt } from "./components/EmojiPicker/EmojiPicker2.js";
70
70
  import { ErrorBoundary as st } from "./components/ErrorBoundary/ErrorBoundary2.js";
71
71
  import { ToggleButtons as dt } from "./components/ToggleButtons/ToggleButtons2.js";
72
- import { EventCalendar as gt } from "./components/EventCalendar/EventCalendar2.js";
72
+ import { EventCalendar as ct } from "./components/EventCalendar/EventCalendar2.js";
73
73
  import { FileDropzone as St } from "./components/FileDropzone/FileDropzone2.js";
74
74
  import { FloatButton as Pt } from "./components/FloatButton/FloatButton2.js";
75
75
  import { FloatingWindow as Dt } from "./components/FloatingWindow/FloatingWindow2.js";
76
- import { Loading as At } from "./components/Loading/Loading2.js";
76
+ import { Loading as ht } from "./components/Loading/Loading2.js";
77
77
  import { FolderBrowserModal as Bt } from "./components/FolderBrowserModal/FolderBrowserModal2.js";
78
78
  import { Col as Et } from "./components/Grid/Col.js";
79
- import { Grid as yt } from "./components/Grid/Grid2.js";
79
+ import { Grid as Lt } from "./components/Grid/Grid2.js";
80
80
  import { IconPicker as _t } from "./components/IconPicker/IconPicker2.js";
81
- import { InfiniteScroll as vt } from "./components/InfiniteScroll/InfiniteScroll2.js";
82
- import { validateEmail as Ht } from "./components/InputEmail/validateEmail.js";
83
- import { InputEmail as Nt } from "./components/InputEmail/InputEmail2.js";
84
- import { InputFile as Ot } from "./components/InputFile/InputFile2.js";
85
- import { InputMask as Vt } from "./components/InputMask/InputMask2.js";
86
- import { InputMaskPresets as Qt } from "./components/InputMask/InputMaskPresets.js";
87
- import { InputPassword as Gt } from "./components/InputPassword/InputPassword2.js";
88
- import { InputPhone as jt } from "./components/InputPhone/InputPhone2.js";
89
- import { InputPIN as Kt } from "./components/InputPIN/InputPIN2.js";
90
- import { InputTextarea as Yt } from "./components/InputTextarea/InputTextarea2.js";
91
- import { InputTime as $t } from "./components/InputTime/InputTime2.js";
92
- import { InputUrl as om } from "./components/InputUrl/InputUrl2.js";
93
- import { JourneyWizard as mm } from "./components/JourneyWizard/JourneyWizard2.js";
94
- import { List as em } from "./components/List/List2.js";
95
- import { MenuHamburger as fm } from "./components/MenuHamburger/MenuHamburger2.js";
96
- import { Minimap as nm } from "./components/Minimap/Minimap2.js";
97
- import { MiniStatsCard as sm } from "./components/MiniStatsCard/MiniStatsCard2.js";
98
- import { NavBar as dm } from "./components/NavBar/NavBar2.js";
99
- import { NotificationPanel as gm } from "./components/NotificationPanel/NotificationPanel2.js";
100
- import { PieChart as Sm } from "./components/PieChart/PieChart2.js";
101
- import { clamp as Pm, format2Digits as Cm, getPercent as Dm, getPercentsOf2Numbers as hm } from "./helpers/Numbers.js";
102
- import { ProgressBar as Mm } from "./components/ProgressBar/ProgressBar2.js";
103
- import { ProgressRing as km } from "./components/ProgressRing/ProgressRing2.js";
104
- import { QuantitySelector as Rm } from "./components/QuantitySelector/QuantitySelector2.js";
105
- import { QuickAdd as Lm } from "./components/QuickAdd/QuickAdd2.js";
106
- import { QuickNumberUpdate as bm } from "./components/QuickNumberUpdate/QuickNumberUpdate2.js";
107
- import { Radio as xm } from "./components/Radio/Radio2.js";
108
- import { QuickOptionUpdate as Fm } from "./components/QuickOptionUpdate/QuickOptionUpdate2.js";
109
- import { RangeSlider as wm } from "./components/RangeSlider/RangeSlider2.js";
110
- import { ensureHtml as Um, htmlToMarkdown as Vm, htmlToPlainText as Wm, splitHtmlIntoSteps as Qm } from "./helpers/HtmlContent.js";
111
- import { RichTextEditor as Gm } from "./components/RichTextEditor/RichTextEditor2.js";
112
- import { RollingNumber as jm } from "./components/RollingNumber/RollingNumber2.js";
113
- import { ScrollToTop as Km } from "./components/ScrollToTop/ScrollToTop2.js";
114
- import { useSidebar as Ym } from "./components/Sidebar/useSidebar.js";
115
- import { Sidebar as $m } from "./components/Sidebar/Sidebar2.js";
116
- import { SidebarProvider as oi } from "./components/Sidebar/SidebarContext.js";
117
- import { SignalStrength as mi } from "./components/SignalStrength/SignalStrength2.js";
118
- import { Skeleton as ei } from "./components/Skeleton/Skeleton2.js";
119
- import { SplitPanel as fi } from "./components/SplitPanel/SplitPanel2.js";
120
- import { Splitter as ni } from "./components/Splitter/Splitter2.js";
121
- import { StackedBar as si } from "./components/StackedBar/StackedBar2.js";
122
- import { Stats as di } from "./components/Stats/Stats2.js";
123
- import { StickyBar as gi } from "./components/StickyBar/StickyBar2.js";
124
- import { SuggestionsList as Si } from "./components/SuggestionsList/SuggestionsList2.js";
125
- import { THEME_CONFIGS as Pi, getThemeConfig as Ci } from "./components/ThemeSettings/themeConfig.js";
126
- import { ThemeProvider as hi } from "./components/ThemeSettings/ThemeContext.js";
127
- import { ToggleSwitch as Mi } from "./components/ToggleSwitch/ToggleSwitch2.js";
128
- import { ThemeSettings as ki } from "./components/ThemeSettings/ThemeSettings2.js";
129
- import { Timeline as Ri } from "./components/Timeline/Timeline2.js";
130
- import { TipsOfTheDay as Li } from "./components/TipsOfTheDay/TipsOfTheDay2.js";
131
- import { Toast as bi } from "./components/Toast/Toast2.js";
132
- import { Toolbar as xi } from "./components/Toolbar/Toolbar2.js";
133
- import { TourHud as Fi } from "./components/TourHud/TourHud2.js";
134
- import { Transition as wi } from "./components/Transition/Transition2.js";
135
- import { Tree as Ui } from "./components/Tree/Tree2.js";
136
- import { VirtualList as Wi } from "./components/VirtualList/VirtualList2.js";
137
- import { WHtR as zi } from "./components/WHtR/WHtR2.js";
138
- import { ApiError as qi, CSRF_HEADER as ji, HttpMethod as Ji, HttpStatus as Ki, buildRequestHeaders as Xi, createApiClient as Yi, getCsrfToken as Zi, isClientErrorStatus as $i, isServerErrorStatus as re, isSuccessStatus as oe, logUnexpectedError as te, readErrorMessage as me } from "./helpers/Http.js";
139
- import { AuthContext as ee } from "./contexts/AuthContext/AuthContext.context.js";
140
- import { AuthProvider as fe } from "./contexts/AuthContext/AuthContext.js";
141
- import { useAuth as ne } from "./hooks/useAuth/useAuth.js";
142
- import { ChangePasswordModal as se } from "./components/Auth/ChangePasswordModal/ChangePasswordModal2.js";
143
- import { Login as de } from "./components/Auth/Login/Login2.js";
144
- import { useAccountMenu as ge } from "./hooks/useAccountMenu.js";
145
- import { AppPersistenceStorage as Se } from "./helpers/AppPersistenceStorage.js";
146
- import { useAppPersistence as Pe } from "./hooks/useAppPersistence.js";
147
- import { chartColors as De, chartTooltipStyle as he } from "./helpers/Charts.js";
148
- import { formatBigNumber as Me, formatBytes as Be, formatMoney as ke } from "./helpers/Format.js";
149
- import { highlightText as Re } from "./helpers/Highlight.js";
150
- import { DATA_FILES_PATH as Le, createImagePaths as _e } from "./helpers/Images.js";
151
- import { matchStringsByLogicalOperator as ve } from "./helpers/LogicalOperators.js";
152
- import { shortenText as He, slugify as Fe, truncateText as Ne } from "./helpers/Strings.js";
153
- import { extractDomainFromUrl as Oe, stripQueryString as Ue, stripTrackingParams as Ve } from "./helpers/Urls.js";
154
- import { LIB_BUILD_DATE as Qe, LIB_BUILD_ID as ze, LIB_BUILD_NUMBER as Ge, LIB_COMMIT as qe, LIB_VERSION as je } from "./version.js";
155
- import { initVersionInfo as Ke } from "./helpers/VersionInfo.js";
156
- import { validateVin as Ye } from "./validators/Vin.js";
81
+ import { FULL_IMAGE as vt, cropImage as xt, encodeCanvas as Ht, loadImageElement as Ft, renderImageRegion as Nt, rotatedSize as wt } from "./helpers/ImageCrop.js";
82
+ import { ToggleSwitch as Ot } from "./components/ToggleSwitch/ToggleSwitch2.js";
83
+ import { ImageCropper as Wt } from "./components/ImageCropper/ImageCropper2.js";
84
+ import { InfiniteScroll as Qt } from "./components/InfiniteScroll/InfiniteScroll2.js";
85
+ import { validateEmail as qt } from "./components/InputEmail/validateEmail.js";
86
+ import { InputEmail as Jt } from "./components/InputEmail/InputEmail2.js";
87
+ import { InputFile as Xt } from "./components/InputFile/InputFile2.js";
88
+ import { InputMask as Zt } from "./components/InputMask/InputMask2.js";
89
+ import { InputMaskPresets as rm } from "./components/InputMask/InputMaskPresets.js";
90
+ import { InputPassword as tm } from "./components/InputPassword/InputPassword2.js";
91
+ import { InputPhone as im } from "./components/InputPhone/InputPhone2.js";
92
+ import { InputPIN as pm } from "./components/InputPIN/InputPIN2.js";
93
+ import { InputTextarea as am } from "./components/InputTextarea/InputTextarea2.js";
94
+ import { InputTime as lm } from "./components/InputTime/InputTime2.js";
95
+ import { InputUrl as um } from "./components/InputUrl/InputUrl2.js";
96
+ import { JourneyWizard as gm } from "./components/JourneyWizard/JourneyWizard2.js";
97
+ import { List as Tm } from "./components/List/List2.js";
98
+ import { MenuHamburger as Im } from "./components/MenuHamburger/MenuHamburger2.js";
99
+ import { Minimap as Cm } from "./components/Minimap/Minimap2.js";
100
+ import { MiniStatsCard as Am } from "./components/MiniStatsCard/MiniStatsCard2.js";
101
+ import { NavBar as Mm } from "./components/NavBar/NavBar2.js";
102
+ import { NotificationPanel as km } from "./components/NotificationPanel/NotificationPanel2.js";
103
+ import { PieChart as Rm } from "./components/PieChart/PieChart2.js";
104
+ import { clamp as ym, format2Digits as _m, getPercent as bm, getPercentsOf2Numbers as vm } from "./helpers/Numbers.js";
105
+ import { ProgressBar as Hm } from "./components/ProgressBar/ProgressBar2.js";
106
+ import { ProgressRing as Nm } from "./components/ProgressRing/ProgressRing2.js";
107
+ import { QuantitySelector as Um } from "./components/QuantitySelector/QuantitySelector2.js";
108
+ import { QuickAdd as Vm } from "./components/QuickAdd/QuickAdd2.js";
109
+ import { QuickNumberUpdate as zm } from "./components/QuickNumberUpdate/QuickNumberUpdate2.js";
110
+ import { Radio as Gm } from "./components/Radio/Radio2.js";
111
+ import { QuickOptionUpdate as jm } from "./components/QuickOptionUpdate/QuickOptionUpdate2.js";
112
+ import { RangeSlider as Km } from "./components/RangeSlider/RangeSlider2.js";
113
+ import { ensureHtml as Ym, htmlToMarkdown as Zm, htmlToPlainText as $m, splitHtmlIntoSteps as ri } from "./helpers/HtmlContent.js";
114
+ import { RichTextEditor as ti } from "./components/RichTextEditor/RichTextEditor2.js";
115
+ import { RollingNumber as ii } from "./components/RollingNumber/RollingNumber2.js";
116
+ import { ScrollToTop as pi } from "./components/ScrollToTop/ScrollToTop2.js";
117
+ import { useSidebar as ai } from "./components/Sidebar/useSidebar.js";
118
+ import { Sidebar as li } from "./components/Sidebar/Sidebar2.js";
119
+ import { SidebarProvider as ui } from "./components/Sidebar/SidebarContext.js";
120
+ import { SignalStrength as gi } from "./components/SignalStrength/SignalStrength2.js";
121
+ import { Skeleton as Ti } from "./components/Skeleton/Skeleton2.js";
122
+ import { SplitPanel as Ii } from "./components/SplitPanel/SplitPanel2.js";
123
+ import { Splitter as Ci } from "./components/Splitter/Splitter2.js";
124
+ import { StackedBar as Ai } from "./components/StackedBar/StackedBar2.js";
125
+ import { Stats as Mi } from "./components/Stats/Stats2.js";
126
+ import { StickyBar as ki } from "./components/StickyBar/StickyBar2.js";
127
+ import { SuggestionsList as Ri } from "./components/SuggestionsList/SuggestionsList2.js";
128
+ import { THEME_CONFIGS as yi, getThemeConfig as _i } from "./components/ThemeSettings/themeConfig.js";
129
+ import { ThemeProvider as vi } from "./components/ThemeSettings/ThemeContext.js";
130
+ import { ThemeSettings as Hi } from "./components/ThemeSettings/ThemeSettings2.js";
131
+ import { Timeline as Ni } from "./components/Timeline/Timeline2.js";
132
+ import { TipsOfTheDay as Ui } from "./components/TipsOfTheDay/TipsOfTheDay2.js";
133
+ import { Toast as Vi } from "./components/Toast/Toast2.js";
134
+ import { Toolbar as zi } from "./components/Toolbar/Toolbar2.js";
135
+ import { TourHud as Gi } from "./components/TourHud/TourHud2.js";
136
+ import { Transition as ji } from "./components/Transition/Transition2.js";
137
+ import { Tree as Ki } from "./components/Tree/Tree2.js";
138
+ import { VirtualList as Yi } from "./components/VirtualList/VirtualList2.js";
139
+ import { WHtR as $i } from "./components/WHtR/WHtR2.js";
140
+ import { ApiError as oe, CSRF_HEADER as te, HttpMethod as me, HttpStatus as ie, buildRequestHeaders as ee, createApiClient as pe, getCsrfToken as fe, isClientErrorStatus as ae, isServerErrorStatus as ne, isSuccessStatus as le, logUnexpectedError as se, readErrorMessage as ue } from "./helpers/Http.js";
141
+ import { AuthContext as ge } from "./contexts/AuthContext/AuthContext.context.js";
142
+ import { AuthProvider as Te } from "./contexts/AuthContext/AuthContext.js";
143
+ import { useAuth as Ie } from "./hooks/useAuth/useAuth.js";
144
+ import { ChangePasswordModal as Ce } from "./components/Auth/ChangePasswordModal/ChangePasswordModal2.js";
145
+ import { Login as Ae } from "./components/Auth/Login/Login2.js";
146
+ import { useAccountMenu as Me } from "./hooks/useAccountMenu.js";
147
+ import { AppPersistenceStorage as ke } from "./helpers/AppPersistenceStorage.js";
148
+ import { useAppPersistence as Re } from "./hooks/useAppPersistence.js";
149
+ import { chartColors as ye, chartTooltipStyle as _e } from "./helpers/Charts.js";
150
+ import { formatBigNumber as ve, formatBytes as xe, formatMoney as He } from "./helpers/Format.js";
151
+ import { highlightText as Ne } from "./helpers/Highlight.js";
152
+ import { DATA_FILES_PATH as Ue, createImagePaths as Oe } from "./helpers/Images.js";
153
+ import { matchStringsByLogicalOperator as We } from "./helpers/LogicalOperators.js";
154
+ import { shortenText as Qe, slugify as Ge, truncateText as qe } from "./helpers/Strings.js";
155
+ import { extractDomainFromUrl as Je, stripQueryString as Ke, stripTrackingParams as Xe } from "./helpers/Urls.js";
156
+ import { LIB_BUILD_DATE as Ze, LIB_BUILD_ID as $e, LIB_BUILD_NUMBER as rp, LIB_COMMIT as op, LIB_VERSION as tp } from "./version.js";
157
+ import { initVersionInfo as ip } from "./helpers/VersionInfo.js";
158
+ import { validateVin as pp } from "./validators/Vin.js";
157
159
  export {
158
160
  N as ADULT_RANGES,
159
161
  Y as APP_DATE_FORMAT,
@@ -161,14 +163,14 @@ export {
161
163
  m as Accordion,
162
164
  P as AlertDialog,
163
165
  D as AnalogClock,
164
- A as AngleSlider,
165
- qi as ApiError,
166
+ h as AngleSlider,
167
+ oe as ApiError,
166
168
  E as AppHeader,
167
- Se as AppPersistenceStorage,
168
- ee as AuthContext,
169
- de as AuthLogin,
170
- fe as AuthProvider,
171
- y as AvatarInitials,
169
+ ke as AppPersistenceStorage,
170
+ ge as AuthContext,
171
+ Ae as AuthLogin,
172
+ Te as AuthProvider,
173
+ L as AvatarInitials,
172
174
  G as BMI,
173
175
  _ as Badge,
174
176
  v as Banner,
@@ -176,26 +178,26 @@ export {
176
178
  j as Breadcrumb,
177
179
  K as BulkActionBar,
178
180
  d as Button,
179
- ji as CSRF_HEADER,
181
+ te as CSRF_HEADER,
180
182
  Cr as Calendar,
181
- hr as CalendarHeatmap,
183
+ Ar as CalendarHeatmap,
182
184
  Mr as Card,
183
- se as ChangePasswordModal,
185
+ Ce as ChangePasswordModal,
184
186
  kr as Checkbox,
185
187
  Rr as Chip,
186
188
  Et as Col,
187
- Lr as CollapsibleSection,
189
+ yr as CollapsibleSection,
188
190
  Fr as ColorPicker,
189
191
  wr as CommandPalette,
190
- Ur as Confetti,
192
+ Or as Confetti,
191
193
  Wr as ConfirmDialog,
192
194
  Jr as ConfirmPopover,
193
195
  Xr as ContextMenu,
194
196
  Mo as ControlPanel,
195
- yo as ControlPanelProvider,
197
+ Lo as ControlPanelProvider,
196
198
  _o as CopyButton,
197
199
  Ho as CountryWithFlag,
198
- Le as DATA_FILES_PATH,
200
+ Ue as DATA_FILES_PATH,
199
201
  Yo as DataView,
200
202
  eo as DatePicker,
201
203
  $o as DateRangePicker,
@@ -204,174 +206,181 @@ export {
204
206
  mt as Drawer,
205
207
  lo as Dropdown,
206
208
  nt as EmojiPicker,
207
- Oo as EmptyState,
209
+ Uo as EmptyState,
208
210
  st as ErrorBoundary,
209
- gt as EventCalendar,
211
+ ct as EventCalendar,
212
+ vt as FULL_IMAGE,
210
213
  St as FileDropzone,
211
214
  vo as Flag,
212
215
  Pt as FloatButton,
213
216
  Dt as FloatingWindow,
214
217
  Bt as FolderBrowserModal,
215
- yt as Grid,
216
- Ji as HttpMethod,
217
- Ki as HttpStatus,
218
+ Lt as Grid,
219
+ me as HttpMethod,
220
+ ie as HttpStatus,
218
221
  o as Icon,
219
222
  _t as IconPicker,
220
- vt as InfiniteScroll,
223
+ Wt as ImageCropper,
224
+ Qt as InfiniteScroll,
221
225
  uo as InputDate,
222
- Nt as InputEmail,
223
- Ot as InputFile,
224
- Vt as InputMask,
225
- Qt as InputMaskPresets,
226
+ Jt as InputEmail,
227
+ Xt as InputFile,
228
+ Zt as InputMask,
229
+ rm as InputMaskPresets,
226
230
  br as InputNumber,
227
- Kt as InputPIN,
228
- Gt as InputPassword,
229
- jt as InputPhone,
230
- go as InputSearch,
231
+ pm as InputPIN,
232
+ tm as InputPassword,
233
+ im as InputPhone,
234
+ co as InputSearch,
231
235
  xr as InputText,
232
- Yt as InputTextarea,
233
- $t as InputTime,
234
- om as InputUrl,
235
- mm as JourneyWizard,
236
- Qe as LIB_BUILD_DATE,
237
- ze as LIB_BUILD_ID,
238
- Ge as LIB_BUILD_NUMBER,
239
- qe as LIB_COMMIT,
240
- je as LIB_VERSION,
241
- em as List,
242
- At as Loading,
243
- fm as MenuHamburger,
236
+ am as InputTextarea,
237
+ lm as InputTime,
238
+ um as InputUrl,
239
+ gm as JourneyWizard,
240
+ Ze as LIB_BUILD_DATE,
241
+ $e as LIB_BUILD_ID,
242
+ rp as LIB_BUILD_NUMBER,
243
+ op as LIB_COMMIT,
244
+ tp as LIB_VERSION,
245
+ Tm as List,
246
+ ht as Loading,
247
+ Im as MenuHamburger,
244
248
  Ko as MiniSort,
245
- sm as MiniStatsCard,
246
- nm as Minimap,
249
+ Am as MiniStatsCard,
250
+ Cm as Minimap,
247
251
  S as Modal,
248
- dm as NavBar,
249
- gm as NotificationPanel,
252
+ Mm as NavBar,
253
+ km as NotificationPanel,
250
254
  w as PEDIATRIC_THRESHOLDS,
251
255
  Vo as Pagination,
252
- Sm as PieChart,
256
+ Rm as PieChart,
253
257
  qr as Popover,
254
- Mm as ProgressBar,
255
- km as ProgressRing,
256
- Rm as QuantitySelector,
257
- Lm as QuickAdd,
258
- bm as QuickNumberUpdate,
259
- Fm as QuickOptionUpdate,
260
- xm as Radio,
261
- wm as RangeSlider,
258
+ Hm as ProgressBar,
259
+ Nm as ProgressRing,
260
+ Um as QuantitySelector,
261
+ Vm as QuickAdd,
262
+ zm as QuickNumberUpdate,
263
+ jm as QuickOptionUpdate,
264
+ Gm as Radio,
265
+ Km as RangeSlider,
262
266
  So as Rating,
263
- Gm as RichTextEditor,
264
- jm as RollingNumber,
265
- Km as ScrollToTop,
267
+ ti as RichTextEditor,
268
+ ii as RollingNumber,
269
+ pi as ScrollToTop,
266
270
  B as Separator,
267
- $m as Sidebar,
268
- oi as SidebarProvider,
269
- mi as SignalStrength,
270
- ei as Skeleton,
271
+ li as Sidebar,
272
+ ui as SidebarProvider,
273
+ gi as SignalStrength,
274
+ Ti as Skeleton,
271
275
  Po as Slider,
272
- fi as SplitPanel,
273
- ni as Splitter,
274
- si as StackedBar,
275
- di as Stats,
276
- gi as StickyBar,
277
- Si as SuggestionsList,
278
- Pi as THEME_CONFIGS,
276
+ Ii as SplitPanel,
277
+ Ci as Splitter,
278
+ Ai as StackedBar,
279
+ Mi as Stats,
280
+ ki as StickyBar,
281
+ Ri as SuggestionsList,
282
+ yi as THEME_CONFIGS,
279
283
  f as ThemeContext,
280
- hi as ThemeProvider,
281
- ki as ThemeSettings,
284
+ vi as ThemeProvider,
285
+ Hi as ThemeSettings,
282
286
  mo as TimePicker,
283
- Ri as Timeline,
287
+ Ni as Timeline,
284
288
  Go as TimelineMarkerDot,
285
289
  qo as TimelineMarkers,
286
290
  jo as TimelineMobileSeparator,
287
- Li as TipsOfTheDay,
288
- bi as Toast,
291
+ Ui as TipsOfTheDay,
292
+ Vi as Toast,
289
293
  ro as ToastContainer,
290
294
  oo as ToastProvider,
291
295
  dt as ToggleButtons,
292
- Mi as ToggleSwitch,
293
- xi as Toolbar,
294
- g as Tooltip,
295
- Fi as TourHud,
296
- wi as Transition,
297
- Ui as Tree,
298
- Wi as VirtualList,
299
- zi as WHtR,
296
+ Ot as ToggleSwitch,
297
+ zi as Toolbar,
298
+ c as Tooltip,
299
+ Gi as TourHud,
300
+ ji as Transition,
301
+ Ki as Tree,
302
+ Yi as VirtualList,
303
+ $i as WHtR,
300
304
  $ as addDays,
301
305
  rr as addMonths,
302
306
  ko as breakpoints,
303
- Xi as buildRequestHeaders,
304
- O as calculateBMI,
305
- Qo as calculateTimelineMarkers,
306
- De as chartColors,
307
- he as chartTooltipStyle,
308
- Pm as clamp,
309
- Yi as createApiClient,
310
- _e as createImagePaths,
311
- Um as ensureHtml,
312
- Oe as extractDomainFromUrl,
307
+ ee as buildRequestHeaders,
308
+ U as calculateBMI,
309
+ zo as calculateTimelineMarkers,
310
+ ye as chartColors,
311
+ _e as chartTooltipStyle,
312
+ ym as clamp,
313
+ pe as createApiClient,
314
+ Oe as createImagePaths,
315
+ xt as cropImage,
316
+ Ht as encodeCanvas,
317
+ Ym as ensureHtml,
318
+ Je as extractDomainFromUrl,
313
319
  fo as foldDiacritics,
314
- Cm as format2Digits,
320
+ _m as format2Digits,
315
321
  or as formatAppDate,
316
322
  tr as formatAppDateTime,
317
- Me as formatBigNumber,
318
- Be as formatBytes,
323
+ ve as formatBigNumber,
324
+ xe as formatBytes,
319
325
  mr as formatDate,
320
326
  ir as formatDateLocale,
321
327
  er as formatDuration,
322
- ke as formatMoney,
328
+ He as formatMoney,
323
329
  pr as formatRelativeDuration,
324
330
  fr as formatRelativeTime,
325
331
  ar as formatSecondsToMediaTime,
326
332
  ao as fuzzyMatch,
327
- Zi as getCsrfToken,
333
+ fe as getCsrfToken,
328
334
  nr as getDaysInMonth,
329
- U as getIndicatorColor,
335
+ O as getIndicatorColor,
330
336
  V as getIndicatorPosition,
331
337
  lr as getIsoWeek,
332
338
  sr as getMonthMatrix,
333
339
  W as getPediatricRanges,
334
- Dm as getPercent,
335
- hm as getPercentsOf2Numbers,
336
- Q as getRangeLabel,
340
+ bm as getPercent,
341
+ vm as getPercentsOf2Numbers,
342
+ z as getRangeLabel,
337
343
  No as getResultsCount,
338
- Ci as getThemeConfig,
344
+ _i as getThemeConfig,
339
345
  ur as getTodayDateString,
340
- Re as highlightText,
341
- Vm as htmlToMarkdown,
342
- Wm as htmlToPlainText,
343
- Ke as initVersionInfo,
346
+ Ne as highlightText,
347
+ Zm as htmlToMarkdown,
348
+ $m as htmlToPlainText,
349
+ ip as initVersionInfo,
344
350
  dr as isAfter,
345
- cr as isBefore,
346
- $i as isClientErrorStatus,
347
- gr as isDateInRange,
351
+ gr as isBefore,
352
+ ae as isClientErrorStatus,
353
+ cr as isDateInRange,
348
354
  Tr as isSameDay,
349
- re as isServerErrorStatus,
350
- oe as isSuccessStatus,
355
+ ne as isServerErrorStatus,
356
+ le as isSuccessStatus,
351
357
  Sr as isToday,
352
358
  Ir as isWeekend,
353
- te as logUnexpectedError,
354
- ve as matchStringsByLogicalOperator,
355
- me as readErrorMessage,
356
- He as shortenText,
357
- Fe as slugify,
358
- Qm as splitHtmlIntoSteps,
359
- Ue as stripQueryString,
360
- Ve as stripTrackingParams,
361
- Ne as truncateText,
362
- ge as useAccountMenu,
363
- Pe as useAppPersistence,
364
- ne as useAuth,
359
+ Ft as loadImageElement,
360
+ se as logUnexpectedError,
361
+ We as matchStringsByLogicalOperator,
362
+ ue as readErrorMessage,
363
+ Nt as renderImageRegion,
364
+ wt as rotatedSize,
365
+ Qe as shortenText,
366
+ Ge as slugify,
367
+ ri as splitHtmlIntoSteps,
368
+ Ke as stripQueryString,
369
+ Xe as stripTrackingParams,
370
+ qe as truncateText,
371
+ Me as useAccountMenu,
372
+ Re as useAppPersistence,
373
+ Ie as useAuth,
365
374
  e as useBodyScrollLock,
366
375
  Eo as useBreakpoint,
367
376
  s as useComponentEffect,
368
377
  Do as useControlPanel,
369
- ho as useControlPanelContext,
370
- zr as usePopover,
371
- Ym as useSidebar,
378
+ Ao as useControlPanelContext,
379
+ Qr as usePopover,
380
+ ai as useSidebar,
372
381
  ot as useSwipe,
373
382
  n as useTheme,
374
383
  Zr as useToast,
375
- Ht as validateEmail,
376
- Ye as validateVin
384
+ qt as validateEmail,
385
+ pp as validateVin
377
386
  };
@@ -28,6 +28,7 @@
28
28
  "food",
29
29
  "gallery",
30
30
  "grid",
31
+ "image",
31
32
  "key",
32
33
  "link",
33
34
  "lock",
@@ -47,6 +48,7 @@
47
48
  "search",
48
49
  "sparkle",
49
50
  "star",
51
+ "synchronize",
50
52
  "table",
51
53
  "target",
52
54
  "theme-picker",
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
- var I = "3.12.4", B = 524, L = "e26bc6f", _ = "2026-10-19T21:26:10.045Z", r = "524";
1
+ var I = "3.13.0", B = 534, L = "d3ccc4e", _ = "2026-10-21T04:38:40.467Z", r = "534";
2
2
  export {
3
3
  _ as LIB_BUILD_DATE,
4
4
  r as LIB_BUILD_ID,
package/dist/version.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "3.12.4",
3
- "buildNumber": 524,
4
- "commit": "e26bc6f",
5
- "buildDate": "2026-10-19T21:26:10.045Z"
2
+ "version": "3.13.0",
3
+ "buildNumber": 534,
4
+ "commit": "d3ccc4e",
5
+ "buildDate": "2026-10-21T04:38:40.467Z"
6
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memobit/libs",
3
- "version": "3.12.4",
3
+ "version": "3.13.0",
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",