@solibo/solibo-ui 2.2.7 → 2.2.9

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 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index46.css');const r=require("react/jsx-runtime"),s=require("classix"),c="_figure_15uie_1",o="_preview_15uie_20",i={figure:c,preview:o},g=({accessibleLabel:e,children:t,className:n,variant:u="default"})=>r.jsxs("figure",{className:s(i.figure,u==="preview"&&i.preview,n),"data-component":"figure",children:[t,e&&r.jsx("figcaption",{"data-content":"screen-reader",children:e})]});exports.Figure=g;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index46.css');const s=require("react/jsx-runtime"),n=require("classix"),c="_figure_8kovu_1",v="_preview_8kovu_20",d="_reserved_8kovu_43",e={figure:c,preview:v,reserved:d},g=({accessibleLabel:r,children:t,className:o,reserveSpace:u=!1,variant:i="default"})=>s.jsxs("figure",{className:n(e.figure,i==="preview"&&e.preview,i==="preview"&&u&&e.reserved,o),"data-component":"figure",children:[t,r&&s.jsx("figcaption",{"data-content":"screen-reader",children:r})]});exports.Figure=g;
@@ -1,17 +1,19 @@
1
- import { jsxs as n, jsx as c } from "react/jsx-runtime";
2
- import f from "classix";
3
- import '../../assets/index46.css';const p = "_figure_15uie_1", s = "_preview_15uie_20", r = {
4
- figure: p,
5
- preview: s
6
- }, a = ({
7
- accessibleLabel: e,
8
- children: i,
9
- className: t,
10
- variant: o = "default"
11
- }) => /* @__PURE__ */ n("figure", { className: f(r.figure, o === "preview" && r.preview, t), "data-component": "figure", children: [
12
- i,
13
- e && /* @__PURE__ */ c("figcaption", { "data-content": "screen-reader", children: e })
1
+ import { jsxs as n, jsx as v } from "react/jsx-runtime";
2
+ import c from "classix";
3
+ import '../../assets/index46.css';const f = "_figure_8kovu_1", p = "_preview_8kovu_20", u = "_reserved_8kovu_43", e = {
4
+ figure: f,
5
+ preview: p,
6
+ reserved: u
7
+ }, g = ({
8
+ accessibleLabel: r,
9
+ children: o,
10
+ className: s,
11
+ reserveSpace: t = !1,
12
+ variant: i = "default"
13
+ }) => /* @__PURE__ */ n("figure", { className: c(e.figure, i === "preview" && e.preview, i === "preview" && t && e.reserved, s), "data-component": "figure", children: [
14
+ o,
15
+ r && /* @__PURE__ */ v("figcaption", { "data-content": "screen-reader", children: r })
14
16
  ] });
15
17
  export {
16
- a as Figure
18
+ g as Figure
17
19
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index19.css');const t=require("react/jsx-runtime"),A=require("classix"),i=require("react"),C=require("../button/index.cjs"),R=require("../controls/index.cjs"),V=require("../dialog/index.cjs"),$=require("../header/index.cjs"),b="_wrapper_vtkwq_1",X="_toolbar_vtkwq_6",J="_iframe_vtkwq_12",l={wrapper:b,toolbar:X,iframe:J,"fullscreen-iframe":"_fullscreen-iframe_vtkwq_18","print-content":"_print-content_vtkwq_23"},f=120,K=12e3,P=8,Q=({accessibleLabel:o,autoResize:s=!1,className:H,closeFullscreenLabel:F="Close fullscreen",fullscreenLabel:I="View in fullscreen",hasFullscreenView:O=!0,loading:N="lazy",onLoad:h,printContent:j,referrerPolicy:q="no-referrer",sandbox:y="",srcDoc:p,style:E,...M})=>{const w=i.useRef(null),a=i.useRef(null),c=i.useRef(null),[U,T]=i.useState(f),[_,g]=i.useState(!1),v=i.useCallback(()=>{a.current!==null&&(window.cancelAnimationFrame(a.current),a.current=null),c.current!==null&&(window.clearTimeout(c.current),c.current=null)},[]),x=i.useCallback(()=>{if(!s)return;const n=w.current,e=n==null?void 0:n.contentDocument;if(!n||!e)return;const m=n.style.height;try{n.style.height=`${f}px`;const u=e.querySelector("[data-iframe-content]")??e.body,d=u.getBoundingClientRect(),{body:k,documentElement:S}=e,G=Math.min(Math.max(Math.ceil(Math.max(u.scrollHeight,u.offsetHeight,d.height,k.scrollHeight,k.offsetHeight,S.scrollHeight,S.offsetHeight)+P),f),K);T(G)}catch{}finally{n.style.height=m}},[s]),r=i.useCallback(()=>{!s||a.current!==null||(a.current=window.requestAnimationFrame(()=>{a.current=null,x(),c.current!==null&&window.clearTimeout(c.current),c.current=window.setTimeout(()=>{c.current=null,x()},250)}))},[s,x]),B=n=>{var m,u;r();const e=(m=w.current)==null?void 0:m.contentDocument;Array.from((e==null?void 0:e.images)??[]).forEach(d=>{d.complete||(d.addEventListener("load",r,{once:!0}),d.addEventListener("error",r,{once:!0}))}),(u=e==null?void 0:e.fonts)==null||u.ready.then(r).catch(()=>{}),h==null||h(n)};return i.useEffect(()=>{if(s)return v(),T(f),r(),v},[s,v,r,p]),i.useEffect(()=>{var n;if(s)return window.addEventListener("resize",r),(n=window.visualViewport)==null||n.addEventListener("resize",r),()=>{var e;window.removeEventListener("resize",r),(e=window.visualViewport)==null||e.removeEventListener("resize",r)}},[s,r]),t.jsxs("div",{className:l.wrapper,"data-component":"iframe",children:[O&&t.jsx("div",{className:l.toolbar,children:t.jsx(C.Button,{"aria-expanded":_,"aria-haspopup":"dialog",onClick:()=>g(!0),variant:"tertiary",children:I})}),t.jsx("iframe",{...M,className:A(l.iframe,H),loading:N,onLoad:B,ref:w,referrerPolicy:q,sandbox:y,srcDoc:p,style:s?{...E,height:U,minHeight:f}:E,title:o}),!_&&t.jsx("div",{className:l["print-content"],"data-iframe-print-content":!0,children:j??t.jsx("p",{children:o})}),_&&t.jsxs(V.Dialog,{"aria-label":`${o} fullscreen`,controls:t.jsx(R.Controls,{children:t.jsx(C.Button,{onClick:()=>g(!1),children:F})}),fullscreen:!0,header:t.jsx($.Header,{children:t.jsx("h2",{children:o})}),open:!0,setOpen:g,children:[t.jsx("iframe",{...M,className:A(l.iframe,l["fullscreen-iframe"],H),loading:"eager",referrerPolicy:q,sandbox:y,srcDoc:p,title:`${o} fullscreen`}),t.jsx("div",{className:l["print-content"],"data-iframe-print-content":!0,children:j??t.jsx("p",{children:o})})]})]})};exports.Iframe=Q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index19.css');const r=require("react/jsx-runtime"),z=require("classix"),i=require("react"),L=require("../button/index.cjs"),te=require("../controls/index.cjs"),ne=require("../dialog/index.cjs"),re=require("../header/index.cjs"),ie="_wrapper_vtkwq_1",se="_toolbar_vtkwq_6",oe="_iframe_vtkwq_12",m={wrapper:ie,toolbar:se,iframe:oe,"fullscreen-iframe":"_fullscreen-iframe_vtkwq_18","print-content":"_print-content_vtkwq_23"},k=120,ce=12e3,ae=8,le=({accessibleLabel:v,autoResize:l=!1,className:S,closeFullscreenLabel:W="Close fullscreen",fullscreenLabel:X="View in fullscreen",hasFullscreenView:J=!0,loading:K="lazy",onLoad:w,printContent:C,referrerPolicy:F="no-referrer",sandbox:O="",srcDoc:f,style:N,...I})=>{const _=i.useRef(null),g=i.useRef(null),h=i.useRef(void 0),p=i.useRef(!0),x=i.useRef(f),y=i.useRef(void 0),[P,Q]=i.useState(k),[M,b]=i.useState(!1),R=i.useCallback(()=>{g.current!==null&&(window.cancelAnimationFrame(g.current),g.current=null)},[]),T=i.useCallback(()=>{if(!(!l||!p.current))try{const e=_.current,n=e==null?void 0:e.contentDocument;if(!e||!(n!=null&&n.body))return;const s=n.querySelector("[data-iframe-content]")??n.body,t=s.getBoundingClientRect(),c=e.clientHeight||Number.parseFloat(e.style.height),u=n.documentElement.scrollHeight,H=Math.max(s.scrollHeight,s.offsetHeight,t.height),o=Math.max(s===n.body&&s.scrollHeight<=c?0:s.scrollHeight,s.offsetHeight,t.height,t.bottom||0),A=u>c+1?u:0,Z=Number.parseFloat(window.getComputedStyle(s).height),D=Math.abs(H-c)<=1||Math.abs(Z-c)<=1&&s.scrollHeight<=s.offsetHeight,B=Math.min(Math.max(Math.ceil(D?c:Math.max(o,A)+ae),k),ce),d=y.current,q=Math.max(o,A),U=e.clientWidth,ee=(d==null?void 0:d.document)===n&&d.width===U,E=d?c-d.viewportHeight:0,V=d?q-d.contentHeight:0,G=!!(ee&&q>c&&(E>1&&Math.abs(V-E)<=1||d.viewportDependent&&Math.abs(E)<=1&&Math.abs(V)<=1));y.current={document:n,viewportHeight:c,width:U,contentHeight:q,viewportDependent:G},G||Q($=>$===B?$:B)}catch{return}},[l]),a=i.useCallback(()=>{!l||!p.current||g.current!==null||(g.current=window.requestAnimationFrame(()=>{g.current=null,T()}))},[l,T]),j=i.useCallback(()=>{var e,n,s;if((e=h.current)==null||e.call(h),h.current=void 0,y.current=void 0,!!l)try{const t=(n=_.current)==null?void 0:n.contentDocument;if(!(t!=null&&t.body))return;let c=!0;const u=()=>{c&&a()},H=t.querySelector("[data-iframe-content]")??t.body,o=typeof ResizeObserver>"u"?void 0:new ResizeObserver(u);o==null||o.observe(H),H!==t.body&&(o==null||o.observe(t.body)),t.addEventListener("load",u,!0),t.addEventListener("error",u,!0),(s=t.fonts)==null||s.ready.then(u).catch(()=>{}),h.current=()=>{c=!1,o==null||o.disconnect(),t.removeEventListener("load",u,!0),t.removeEventListener("error",u,!0)}}catch{return}},[l,a]),Y=e=>{p.current=!0,j(),w==null||w(e),a()};return i.useEffect(()=>(p.current=x.current===f,x.current===f&&(j(),a()),x.current=f,()=>{var e;p.current=!1,(e=h.current)==null||e.call(h),R()}),[R,j,a,f]),i.useEffect(()=>{var e;if(l)return window.addEventListener("resize",a),(e=window.visualViewport)==null||e.addEventListener("resize",a),()=>{var n;window.removeEventListener("resize",a),(n=window.visualViewport)==null||n.removeEventListener("resize",a)}},[l,a]),r.jsxs("div",{className:m.wrapper,"data-component":"iframe",children:[J&&r.jsx("div",{className:m.toolbar,children:r.jsx(L.Button,{"aria-expanded":M,"aria-haspopup":"dialog",onClick:()=>b(!0),variant:"tertiary",children:X})}),r.jsx("iframe",{...I,className:z(m.iframe,S),loading:K,onLoad:Y,ref:_,referrerPolicy:F,sandbox:O,srcDoc:f,style:l?{...N,height:P,minHeight:k}:N,title:v}),!M&&r.jsx("div",{className:m["print-content"],"data-iframe-print-content":!0,children:C??r.jsx("p",{children:v})}),M&&r.jsxs(ne.Dialog,{"aria-label":`${v} fullscreen`,controls:r.jsx(te.Controls,{children:r.jsx(L.Button,{onClick:()=>b(!1),children:W})}),fullscreen:!0,header:r.jsx(re.Header,{children:r.jsx("h2",{children:v})}),open:!0,setOpen:b,children:[r.jsx("iframe",{...I,className:z(m.iframe,m["fullscreen-iframe"],S),loading:"eager",onLoad:w,referrerPolicy:F,sandbox:O,srcDoc:f,title:`${v} fullscreen`}),r.jsx("div",{className:m["print-content"],"data-iframe-print-content":!0,children:C??r.jsx("p",{children:v})})]})]})};exports.Iframe=le;
@@ -1,93 +1,98 @@
1
- import { jsxs as N, jsx as r } from "react/jsx-runtime";
2
- import O from "classix";
3
- import { useRef as H, useState as C, useCallback as E, useEffect as S } from "react";
4
- import { Button as U } from "../button/index.js";
5
- import { Controls as K } from "../controls/index.js";
6
- import { Dialog as Q } from "../dialog/index.js";
7
- import { Header as W } from "../header/index.js";
8
- import '../../assets/index19.css';const Y = "_wrapper_vtkwq_1", Z = "_toolbar_vtkwq_6", z = "_iframe_vtkwq_12", o = {
9
- wrapper: Y,
10
- toolbar: Z,
11
- iframe: z,
1
+ import { jsxs as W, jsx as o } from "react/jsx-runtime";
2
+ import X from "classix";
3
+ import { useRef as v, useState as J, useCallback as _, useEffect as K } from "react";
4
+ import { Button as Q } from "../button/index.js";
5
+ import { Controls as oe } from "../controls/index.js";
6
+ import { Dialog as ce } from "../dialog/index.js";
7
+ import { Header as se } from "../header/index.js";
8
+ import '../../assets/index19.css';const ae = "_wrapper_vtkwq_1", le = "_toolbar_vtkwq_6", ue = "_iframe_vtkwq_12", m = {
9
+ wrapper: ae,
10
+ toolbar: le,
11
+ iframe: ue,
12
12
  "fullscreen-iframe": "_fullscreen-iframe_vtkwq_18",
13
13
  "print-content": "_print-content_vtkwq_23"
14
- }, f = 120, D = 12e3, L = 8, ie = ({
15
- accessibleLabel: c,
16
- autoResize: i = !1,
17
- className: y,
18
- closeFullscreenLabel: B = "Close fullscreen",
19
- fullscreenLabel: G = "View in fullscreen",
20
- hasFullscreenView: V = !0,
21
- loading: $ = "lazy",
22
- onLoad: d,
23
- printContent: M,
24
- referrerPolicy: T = "no-referrer",
25
- sandbox: k = "",
14
+ }, N = 120, de = 12e3, he = 8, _e = ({
15
+ accessibleLabel: f,
16
+ autoResize: a = !1,
17
+ className: O,
18
+ closeFullscreenLabel: R = "Close fullscreen",
19
+ fullscreenLabel: Y = "View in fullscreen",
20
+ hasFullscreenView: Z = !0,
21
+ loading: P = "lazy",
22
+ onLoad: g,
23
+ printContent: S,
24
+ referrerPolicy: A = "no-referrer",
25
+ sandbox: C = "",
26
26
  srcDoc: h,
27
- style: q,
28
- ...x
27
+ style: I,
28
+ ...T
29
29
  }) => {
30
- const p = H(null), a = H(null), l = H(null), [j, A] = C(f), [w, v] = C(!1), g = E(() => {
31
- a.current !== null && (window.cancelAnimationFrame(a.current), a.current = null), l.current !== null && (window.clearTimeout(l.current), l.current = null);
32
- }, []), _ = E(() => {
33
- if (!i) return;
34
- const t = p.current, e = t == null ? void 0 : t.contentDocument;
35
- if (!t || !e) return;
36
- const m = t.style.height;
37
- try {
38
- t.style.height = `${f}px`;
39
- const s = e.querySelector("[data-iframe-content]") ?? e.body, u = s.getBoundingClientRect(), {
40
- body: F,
41
- documentElement: I
42
- } = e, J = Math.min(Math.max(Math.ceil(Math.max(s.scrollHeight, s.offsetHeight, u.height, F.scrollHeight, F.offsetHeight, I.scrollHeight, I.offsetHeight) + L), f), D);
43
- A(J);
44
- } catch {
45
- } finally {
46
- t.style.height = m;
47
- }
48
- }, [i]), n = E(() => {
49
- !i || a.current !== null || (a.current = window.requestAnimationFrame(() => {
50
- a.current = null, _(), l.current !== null && window.clearTimeout(l.current), l.current = window.setTimeout(() => {
51
- l.current = null, _();
52
- }, 250);
30
+ const y = v(null), p = v(null), d = v(void 0), w = v(!0), M = v(h), E = v(void 0), [D, ee] = J(N), [b, x] = J(!1), B = _(() => {
31
+ p.current !== null && (window.cancelAnimationFrame(p.current), p.current = null);
32
+ }, []), U = _(() => {
33
+ if (!(!a || !w.current))
34
+ try {
35
+ const e = y.current, r = e == null ? void 0 : e.contentDocument;
36
+ if (!e || !(r != null && r.body)) return;
37
+ const n = r.querySelector("[data-iframe-content]") ?? r.body, t = n.getBoundingClientRect(), c = e.clientHeight || Number.parseFloat(e.style.height), l = r.documentElement.scrollHeight, H = Math.max(n.scrollHeight, n.offsetHeight, t.height), i = Math.max(n === r.body && n.scrollHeight <= c ? 0 : n.scrollHeight, n.offsetHeight, t.height, t.bottom || 0), V = l > c + 1 ? l : 0, re = Number.parseFloat(window.getComputedStyle(n).height), ne = Math.abs(H - c) <= 1 || Math.abs(re - c) <= 1 && n.scrollHeight <= n.offsetHeight, G = Math.min(Math.max(Math.ceil(ne ? c : Math.max(i, V) + he), N), de), u = E.current, k = Math.max(i, V), j = e.clientWidth, ie = (u == null ? void 0 : u.document) === r && u.width === j, q = u ? c - u.viewportHeight : 0, $ = u ? k - u.contentHeight : 0, z = !!(ie && k > c && (q > 1 && Math.abs($ - q) <= 1 || u.viewportDependent && Math.abs(q) <= 1 && Math.abs($) <= 1));
38
+ E.current = {
39
+ document: r,
40
+ viewportHeight: c,
41
+ width: j,
42
+ contentHeight: k,
43
+ viewportDependent: z
44
+ }, z || ee((L) => L === G ? L : G);
45
+ } catch {
46
+ return;
47
+ }
48
+ }, [a]), s = _(() => {
49
+ !a || !w.current || p.current !== null || (p.current = window.requestAnimationFrame(() => {
50
+ p.current = null, U();
53
51
  }));
54
- }, [i, _]), X = (t) => {
55
- var m, s;
56
- n();
57
- const e = (m = p.current) == null ? void 0 : m.contentDocument;
58
- Array.from((e == null ? void 0 : e.images) ?? []).forEach((u) => {
59
- u.complete || (u.addEventListener("load", n, {
60
- once: !0
61
- }), u.addEventListener("error", n, {
62
- once: !0
63
- }));
64
- }), (s = e == null ? void 0 : e.fonts) == null || s.ready.then(n).catch(() => {
65
- }), d == null || d(t);
52
+ }, [a, U]), F = _(() => {
53
+ var e, r, n;
54
+ if ((e = d.current) == null || e.call(d), d.current = void 0, E.current = void 0, !!a)
55
+ try {
56
+ const t = (r = y.current) == null ? void 0 : r.contentDocument;
57
+ if (!(t != null && t.body)) return;
58
+ let c = !0;
59
+ const l = () => {
60
+ c && s();
61
+ }, H = t.querySelector("[data-iframe-content]") ?? t.body, i = typeof ResizeObserver > "u" ? void 0 : new ResizeObserver(l);
62
+ i == null || i.observe(H), H !== t.body && (i == null || i.observe(t.body)), t.addEventListener("load", l, !0), t.addEventListener("error", l, !0), (n = t.fonts) == null || n.ready.then(l).catch(() => {
63
+ }), d.current = () => {
64
+ c = !1, i == null || i.disconnect(), t.removeEventListener("load", l, !0), t.removeEventListener("error", l, !0);
65
+ };
66
+ } catch {
67
+ return;
68
+ }
69
+ }, [a, s]), te = (e) => {
70
+ w.current = !0, F(), g == null || g(e), s();
66
71
  };
67
- return S(() => {
68
- if (i)
69
- return g(), A(f), n(), g;
70
- }, [i, g, n, h]), S(() => {
71
- var t;
72
- if (i)
73
- return window.addEventListener("resize", n), (t = window.visualViewport) == null || t.addEventListener("resize", n), () => {
74
- var e;
75
- window.removeEventListener("resize", n), (e = window.visualViewport) == null || e.removeEventListener("resize", n);
72
+ return K(() => (w.current = M.current === h, M.current === h && (F(), s()), M.current = h, () => {
73
+ var e;
74
+ w.current = !1, (e = d.current) == null || e.call(d), B();
75
+ }), [B, F, s, h]), K(() => {
76
+ var e;
77
+ if (a)
78
+ return window.addEventListener("resize", s), (e = window.visualViewport) == null || e.addEventListener("resize", s), () => {
79
+ var r;
80
+ window.removeEventListener("resize", s), (r = window.visualViewport) == null || r.removeEventListener("resize", s);
76
81
  };
77
- }, [i, n]), /* @__PURE__ */ N("div", { className: o.wrapper, "data-component": "iframe", children: [
78
- V && /* @__PURE__ */ r("div", { className: o.toolbar, children: /* @__PURE__ */ r(U, { "aria-expanded": w, "aria-haspopup": "dialog", onClick: () => v(!0), variant: "tertiary", children: G }) }),
79
- /* @__PURE__ */ r("iframe", { ...x, className: O(o.iframe, y), loading: $, onLoad: X, ref: p, referrerPolicy: T, sandbox: k, srcDoc: h, style: i ? {
80
- ...q,
81
- height: j,
82
- minHeight: f
83
- } : q, title: c }),
84
- !w && /* @__PURE__ */ r("div", { className: o["print-content"], "data-iframe-print-content": !0, children: M ?? /* @__PURE__ */ r("p", { children: c }) }),
85
- w && /* @__PURE__ */ N(Q, { "aria-label": `${c} fullscreen`, controls: /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(U, { onClick: () => v(!1), children: B }) }), fullscreen: !0, header: /* @__PURE__ */ r(W, { children: /* @__PURE__ */ r("h2", { children: c }) }), open: !0, setOpen: v, children: [
86
- /* @__PURE__ */ r("iframe", { ...x, className: O(o.iframe, o["fullscreen-iframe"], y), loading: "eager", referrerPolicy: T, sandbox: k, srcDoc: h, title: `${c} fullscreen` }),
87
- /* @__PURE__ */ r("div", { className: o["print-content"], "data-iframe-print-content": !0, children: M ?? /* @__PURE__ */ r("p", { children: c }) })
82
+ }, [a, s]), /* @__PURE__ */ W("div", { className: m.wrapper, "data-component": "iframe", children: [
83
+ Z && /* @__PURE__ */ o("div", { className: m.toolbar, children: /* @__PURE__ */ o(Q, { "aria-expanded": b, "aria-haspopup": "dialog", onClick: () => x(!0), variant: "tertiary", children: Y }) }),
84
+ /* @__PURE__ */ o("iframe", { ...T, className: X(m.iframe, O), loading: P, onLoad: te, ref: y, referrerPolicy: A, sandbox: C, srcDoc: h, style: a ? {
85
+ ...I,
86
+ height: D,
87
+ minHeight: N
88
+ } : I, title: f }),
89
+ !b && /* @__PURE__ */ o("div", { className: m["print-content"], "data-iframe-print-content": !0, children: S ?? /* @__PURE__ */ o("p", { children: f }) }),
90
+ b && /* @__PURE__ */ W(ce, { "aria-label": `${f} fullscreen`, controls: /* @__PURE__ */ o(oe, { children: /* @__PURE__ */ o(Q, { onClick: () => x(!1), children: R }) }), fullscreen: !0, header: /* @__PURE__ */ o(se, { children: /* @__PURE__ */ o("h2", { children: f }) }), open: !0, setOpen: x, children: [
91
+ /* @__PURE__ */ o("iframe", { ...T, className: X(m.iframe, m["fullscreen-iframe"], O), loading: "eager", onLoad: g, referrerPolicy: A, sandbox: C, srcDoc: h, title: `${f} fullscreen` }),
92
+ /* @__PURE__ */ o("div", { className: m["print-content"], "data-iframe-print-content": !0, children: S ?? /* @__PURE__ */ o("p", { children: f }) })
88
93
  ] })
89
94
  ] });
90
95
  };
91
96
  export {
92
- ie as Iframe
97
+ _e as Iframe
93
98
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index15.css');const n=require("react/jsx-runtime"),D=require("classix"),r=require("react"),G=require("../editor/index.cjs"),I=require("../list/index.cjs"),J=require("../tooltip/index.cjs"),K=require("../message/index.cjs"),Q="_messages_6nen5_1",V="_fill_6nen5_20",j={messages:Q,fill:V},X=({fill:M=!1,files:u,handleUpload:y,inlineImages:c,maxEditorRows:Y=5,message:d="",messages:l,minEditorRows:b=1,onChange:H,onFilesChange:a,onInlineImagesChange:B,onSubmit:N,placeholder:O,sending:m,submitLabel:P="Send message",tooltipLabel:f})=>{var L;const v=r.useRef(null),o=r.useRef(!0),h=r.useRef(!1),[U,W]=r.useState([]),p=u??U,g=(L=l[l.length-1])==null?void 0:L.id,k=d.replace(/<[^>]*>/g,"").replace(/&nbsp;/g," ").trim()==="";return r.useLayoutEffect(()=>{var q;const e=(q=v.current)==null?void 0:q.querySelector("[data-message-list]");if(!e||g===void 0)return;const z=e.scrollHeight-e.scrollTop-e.clientHeight<450,_=!h.current||z;o.current=_,h.current=!0;const A=window.setTimeout(()=>{o.current=!1},5e3),E=()=>{e.scrollTop=e.scrollHeight};_&&E();const T=t=>{o.current&&t.target instanceof HTMLImageElement&&E()},x=t=>{t.deltaY<0&&(o.current=!1)};let i;const w=t=>{var s;i=(s=t.touches[0])==null?void 0:s.clientY},R=t=>{var S;const s=(S=t.touches[0])==null?void 0:S.clientY;s!==void 0&&i!==void 0&&s>i&&(o.current=!1),i=s};return e.addEventListener("load",T,!0),e.addEventListener("wheel",x,{passive:!0}),e.addEventListener("touchstart",w,{passive:!0}),e.addEventListener("touchmove",R,{passive:!0}),()=>{window.clearTimeout(A),e.removeEventListener("load",T,!0),e.removeEventListener("wheel",x),e.removeEventListener("touchstart",w),e.removeEventListener("touchmove",R)}},[g]),n.jsxs("div",{className:D(j.messages,M&&j.fill),ref:v,"data-component":"messages",children:[n.jsx(I.List,{"data-message-list":!0,children:l.map(e=>n.jsx(K.Message,{...e},e.id))}),f&&n.jsx(J.Tooltip,{variant:"static",children:f}),n.jsx(G.Editor,{autofocus:!0,content:d,disabled:m||k&&p.length===0&&!(c!=null&&c.length),files:p,inlineImages:c,isSubmitting:m,maxRows:Y,minRows:b,onChange:H,onFilesChange:e=>{u===void 0&&W(e),a==null||a(e)},onInlineImagesChange:B,onSubmit:N,onUpload:y,placeholder:O,submitLabel:P})]})};exports.Messages=X;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index15.css');const p=require("react/jsx-runtime"),q=require("classix"),m=require("react"),j=require("../editor/index.cjs"),A=require("../list/index.cjs"),B=require("../tooltip/index.cjs"),D=require("../message/index.cjs"),H="_messages_88pw2_1",P="_fill_88pw2_22",y={messages:H,fill:P};function k(R){const v=m.useRef(null),a=m.useRef(()=>{});return m.useLayoutEffect(()=>{const e=v.current;if(!e)return;let c=!0,d=e.scrollTop,s;const i=()=>{const t=e.getBoundingClientRect().top,o=Array.from(e.children).find(x=>x instanceof HTMLElement&&x.getBoundingClientRect().bottom>t);s=o?{element:o,offset:o.getBoundingClientRect().top-t}:void 0},g=()=>{if(Math.abs(e.scrollTop-d)<=.5)return!1;const t=Math.max(0,e.scrollHeight-e.clientHeight);return!(d>t&&Math.abs(e.scrollTop-t)<=.5)},l=()=>{if(g()&&(c=!1,i()),c)e.scrollTop=e.scrollHeight;else if(s!=null&&s.element.isConnected&&e.contains(s.element)){const o=s.element.getBoundingClientRect().top-e.getBoundingClientRect().top-s.offset;Math.abs(o)>.5&&(e.scrollTop+=o)}d=e.scrollTop,i()};a.current=l;const r=()=>{c=!1,i()},h=()=>{g()&&(c=!1),d=e.scrollTop,i()},E=t=>{t.target===e&&r()},w=t=>{const o=t.target;o instanceof Element&&o.closest('input, textarea, select, [contenteditable="true"]')||["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"," "].includes(t.key)&&r()},n=typeof ResizeObserver>"u"?void 0:new ResizeObserver(l),u=()=>{n==null||n.disconnect(),n==null||n.observe(e),Array.from(e.children).forEach(t=>n==null?void 0:n.observe(t)),l()},L=new MutationObserver(u);return L.observe(e,{childList:!0,subtree:!0,characterData:!0}),u(),e.addEventListener("scroll",h,{passive:!0}),e.addEventListener("wheel",r,{passive:!0}),e.addEventListener("touchmove",r,{passive:!0}),e.addEventListener("pointerdown",E),e.addEventListener("keydown",w),e.addEventListener("load",l,!0),e.addEventListener("error",l,!0),()=>{a.current=()=>{},n==null||n.disconnect(),L.disconnect(),e.removeEventListener("scroll",h),e.removeEventListener("wheel",r),e.removeEventListener("touchmove",r),e.removeEventListener("pointerdown",E),e.removeEventListener("keydown",w),e.removeEventListener("load",l,!0),e.removeEventListener("error",l,!0)}},[]),m.useLayoutEffect(()=>a.current(),[R]),v}const C=({autofocus:R=!0,fill:v=!1,files:a,handleUpload:e,inlineImages:c,maxEditorRows:d=5,message:s="",messages:i,minEditorRows:g=1,onChange:l,onFilesChange:r,onInlineImagesChange:h,onSubmit:E,placeholder:w,resizableEditor:n=!1,sending:u,submitLabel:L="Send message",tooltipLabel:t})=>{var _;const[o,x]=m.useState([]),b=a??o,M=(_=i[i.length-1])==null?void 0:_.id,T=k(M),S=s.replace(/<[^>]*>/g,"").replace(/&nbsp;/g," ").trim()==="";return p.jsxs("div",{className:q(y.messages,v&&y.fill),"data-component":"messages",children:[p.jsx(A.List,{"data-message-list":!0,ref:T,tabIndex:0,children:i.map(f=>p.jsx(D.Message,{...f},f.id))}),t&&p.jsx(B.Tooltip,{variant:"static",children:t}),p.jsx(j.Editor,{autofocus:R,content:s,disabled:u||S&&b.length===0&&!(c!=null&&c.length),files:b,inlineImages:c,isSubmitting:u,maxRows:d,minRows:g,onChange:l,onFilesChange:f=>{a===void 0&&x(f),r==null||r(f)},onInlineImagesChange:h,onSubmit:E,onUpload:e,placeholder:w,resizable:n?"top":!1,submitLabel:L})]})};exports.Messages=C;
@@ -1,76 +1,99 @@
1
- import { jsxs as I, jsx as c } from "react/jsx-runtime";
2
- import J from "classix";
3
- import { useRef as i, useState as K, useLayoutEffect as O } from "react";
4
- import { Editor as P } from "../editor/index.js";
5
- import { List as Q } from "../list/index.js";
6
- import { Tooltip as V } from "../tooltip/index.js";
7
- import { Message as X } from "../message/index.js";
8
- import '../../assets/index15.css';const Z = "_messages_6nen5_1", $ = "_fill_6nen5_20", x = {
9
- messages: Z,
10
- fill: $
11
- }, ne = ({
12
- fill: y = !1,
13
- files: u,
14
- handleUpload: H,
15
- inlineImages: r,
16
- maxEditorRows: B = 5,
17
- message: d = "",
18
- messages: l,
19
- minEditorRows: b = 1,
20
- onChange: j,
21
- onFilesChange: a,
22
- onInlineImagesChange: q,
23
- onSubmit: N,
24
- placeholder: U,
25
- sending: m,
26
- submitLabel: W = "Send message",
27
- tooltipLabel: f
28
- }) => {
29
- var g;
30
- const h = i(null), o = i(!0), v = i(!1), [k, z] = K([]), p = u ?? k, L = (g = l[l.length - 1]) == null ? void 0 : g.id, A = d.replace(/<[^>]*>/g, "").replace(/&nbsp;/g, " ").trim() === "";
31
- return O(() => {
32
- var M;
33
- const e = (M = h.current) == null ? void 0 : M.querySelector("[data-message-list]");
34
- if (!e || L === void 0) return;
35
- const D = e.scrollHeight - e.scrollTop - e.clientHeight < 450, E = !v.current || D;
36
- o.current = E, v.current = !0;
37
- const G = window.setTimeout(() => {
38
- o.current = !1;
39
- }, 5e3), T = () => {
40
- e.scrollTop = e.scrollHeight;
41
- };
42
- E && T();
43
- const w = (t) => {
44
- o.current && t.target instanceof HTMLImageElement && T();
45
- }, R = (t) => {
46
- t.deltaY < 0 && (o.current = !1);
47
- };
48
- let n;
49
- const S = (t) => {
50
- var s;
51
- n = (s = t.touches[0]) == null ? void 0 : s.clientY;
52
- }, _ = (t) => {
53
- var Y;
54
- const s = (Y = t.touches[0]) == null ? void 0 : Y.clientY;
55
- s !== void 0 && n !== void 0 && s > n && (o.current = !1), n = s;
1
+ import { jsxs as B, jsx as L } from "react/jsx-runtime";
2
+ import D from "classix";
3
+ import { useRef as T, useLayoutEffect as y, useState as H } from "react";
4
+ import { Editor as k } from "../editor/index.js";
5
+ import { List as C } from "../list/index.js";
6
+ import { Tooltip as P } from "../tooltip/index.js";
7
+ import { Message as U } from "../message/index.js";
8
+ import '../../assets/index15.css';const j = "_messages_88pw2_1", q = "_fill_88pw2_22", x = {
9
+ messages: j,
10
+ fill: q
11
+ };
12
+ function K(R) {
13
+ const m = T(null), a = T(() => {
14
+ });
15
+ return y(() => {
16
+ const e = m.current;
17
+ if (!e) return;
18
+ let l = !0, d = e.scrollTop, s;
19
+ const i = () => {
20
+ const t = e.getBoundingClientRect().top, n = Array.from(e.children).find((E) => E instanceof HTMLElement && E.getBoundingClientRect().bottom > t);
21
+ s = n ? {
22
+ element: n,
23
+ offset: n.getBoundingClientRect().top - t
24
+ } : void 0;
25
+ }, p = () => {
26
+ if (Math.abs(e.scrollTop - d) <= 0.5) return !1;
27
+ const t = Math.max(0, e.scrollHeight - e.clientHeight);
28
+ return !(d > t && Math.abs(e.scrollTop - t) <= 0.5);
29
+ }, c = () => {
30
+ if (p() && (l = !1, i()), l)
31
+ e.scrollTop = e.scrollHeight;
32
+ else if (s != null && s.element.isConnected && e.contains(s.element)) {
33
+ const n = s.element.getBoundingClientRect().top - e.getBoundingClientRect().top - s.offset;
34
+ Math.abs(n) > 0.5 && (e.scrollTop += n);
35
+ }
36
+ d = e.scrollTop, i();
56
37
  };
57
- return e.addEventListener("load", w, !0), e.addEventListener("wheel", R, {
38
+ a.current = c;
39
+ const r = () => {
40
+ l = !1, i();
41
+ }, v = () => {
42
+ p() && (l = !1), d = e.scrollTop, i();
43
+ }, g = (t) => {
44
+ t.target === e && r();
45
+ }, h = (t) => {
46
+ const n = t.target;
47
+ n instanceof Element && n.closest('input, textarea, select, [contenteditable="true"]') || ["ArrowUp", "ArrowDown", "PageUp", "PageDown", "Home", "End", " "].includes(t.key) && r();
48
+ }, o = typeof ResizeObserver > "u" ? void 0 : new ResizeObserver(c), f = () => {
49
+ o == null || o.disconnect(), o == null || o.observe(e), Array.from(e.children).forEach((t) => o == null ? void 0 : o.observe(t)), c();
50
+ }, w = new MutationObserver(f);
51
+ return w.observe(e, {
52
+ childList: !0,
53
+ subtree: !0,
54
+ characterData: !0
55
+ }), f(), e.addEventListener("scroll", v, {
58
56
  passive: !0
59
- }), e.addEventListener("touchstart", S, {
57
+ }), e.addEventListener("wheel", r, {
60
58
  passive: !0
61
- }), e.addEventListener("touchmove", _, {
59
+ }), e.addEventListener("touchmove", r, {
62
60
  passive: !0
63
- }), () => {
64
- window.clearTimeout(G), e.removeEventListener("load", w, !0), e.removeEventListener("wheel", R), e.removeEventListener("touchstart", S), e.removeEventListener("touchmove", _);
61
+ }), e.addEventListener("pointerdown", g), e.addEventListener("keydown", h), e.addEventListener("load", c, !0), e.addEventListener("error", c, !0), () => {
62
+ a.current = () => {
63
+ }, o == null || o.disconnect(), w.disconnect(), e.removeEventListener("scroll", v), e.removeEventListener("wheel", r), e.removeEventListener("touchmove", r), e.removeEventListener("pointerdown", g), e.removeEventListener("keydown", h), e.removeEventListener("load", c, !0), e.removeEventListener("error", c, !0);
65
64
  };
66
- }, [L]), /* @__PURE__ */ I("div", { className: J(x.messages, y && x.fill), ref: h, "data-component": "messages", children: [
67
- /* @__PURE__ */ c(Q, { "data-message-list": !0, children: l.map((e) => /* @__PURE__ */ c(X, { ...e }, e.id)) }),
68
- f && /* @__PURE__ */ c(V, { variant: "static", children: f }),
69
- /* @__PURE__ */ c(P, { autofocus: !0, content: d, disabled: m || A && p.length === 0 && !(r != null && r.length), files: p, inlineImages: r, isSubmitting: m, maxRows: B, minRows: b, onChange: j, onFilesChange: (e) => {
70
- u === void 0 && z(e), a == null || a(e);
71
- }, onInlineImagesChange: q, onSubmit: N, onUpload: H, placeholder: U, submitLabel: W })
65
+ }, []), y(() => a.current(), [R]), m;
66
+ }
67
+ const W = ({
68
+ autofocus: R = !0,
69
+ fill: m = !1,
70
+ files: a,
71
+ handleUpload: e,
72
+ inlineImages: l,
73
+ maxEditorRows: d = 5,
74
+ message: s = "",
75
+ messages: i,
76
+ minEditorRows: p = 1,
77
+ onChange: c,
78
+ onFilesChange: r,
79
+ onInlineImagesChange: v,
80
+ onSubmit: g,
81
+ placeholder: h,
82
+ resizableEditor: o = !1,
83
+ sending: f,
84
+ submitLabel: w = "Send message",
85
+ tooltipLabel: t
86
+ }) => {
87
+ var M;
88
+ const [n, E] = H([]), b = a ?? n, S = (M = i[i.length - 1]) == null ? void 0 : M.id, _ = K(S), A = s.replace(/<[^>]*>/g, "").replace(/&nbsp;/g, " ").trim() === "";
89
+ return /* @__PURE__ */ B("div", { className: D(x.messages, m && x.fill), "data-component": "messages", children: [
90
+ /* @__PURE__ */ L(C, { "data-message-list": !0, ref: _, tabIndex: 0, children: i.map((u) => /* @__PURE__ */ L(U, { ...u }, u.id)) }),
91
+ t && /* @__PURE__ */ L(P, { variant: "static", children: t }),
92
+ /* @__PURE__ */ L(k, { autofocus: R, content: s, disabled: f || A && b.length === 0 && !(l != null && l.length), files: b, inlineImages: l, isSubmitting: f, maxRows: d, minRows: p, onChange: c, onFilesChange: (u) => {
93
+ a === void 0 && E(u), r == null || r(u);
94
+ }, onInlineImagesChange: v, onSubmit: g, onUpload: e, placeholder: h, resizable: o ? "top" : !1, submitLabel: w })
72
95
  ] });
73
96
  };
74
97
  export {
75
- ne as Messages
98
+ W as Messages
76
99
  };
package/dist/index.d.ts CHANGED
@@ -304,7 +304,7 @@ declare type DropzoneProps = {
304
304
  variant?: 'default' | 'minimal';
305
305
  };
306
306
 
307
- export declare const Editor: ({ autofocus, autolink, content, disabled, errorMessage, fill, files, inline, inlineImages, invalid, isSubmitting, maxRows, minRows, onChange, onFilesChange, onInlineImagesChange, onSubmit, onUpload, placeholder, required, submitLabel, }: EditorProps) => JSX.Element;
307
+ export declare const Editor: ({ autofocus, autolink, content, disabled, errorMessage, fill, files, inline, inlineImages, invalid, isSubmitting, maxRows, minRows, onChange, onFilesChange, onInlineImagesChange, onSubmit, onUpload, placeholder, required, resizable, submitLabel, }: EditorProps) => JSX.Element;
308
308
 
309
309
  export declare type EditorProps = {
310
310
  autofocus?: boolean;
@@ -327,6 +327,10 @@ export declare type EditorProps = {
327
327
  onUpload?: (files: FileList) => Promise<void> | void;
328
328
  placeholder?: string;
329
329
  required?: boolean;
330
+ /** Enables vertical resizing: true uses the native bottom grip, 'top' uses a top
331
+ * handle that grows upward. Ignored with fill. Automatic sizing keeps minRows/maxRows
332
+ * until resized; manual expansion is not capped by maxRows. */
333
+ resizable?: boolean | 'top';
330
334
  submitLabel?: string;
331
335
  };
332
336
 
@@ -343,12 +347,13 @@ export declare const Fieldset: ({ className, ...props }: FieldsetProps) => JSX.E
343
347
 
344
348
  export declare type FieldsetProps = React.ComponentPropsWithoutRef<'fieldset'>;
345
349
 
346
- export declare const Figure: ({ accessibleLabel, children, className, variant, }: FigureProps) => JSX.Element;
350
+ export declare const Figure: ({ accessibleLabel, children, className, reserveSpace, variant, }: FigureProps) => JSX.Element;
347
351
 
348
352
  declare type FigureProps = {
349
353
  accessibleLabel?: string;
350
354
  children?: React.ReactNode;
351
355
  className?: string;
356
+ reserveSpace?: boolean;
352
357
  variant?: 'default' | 'preview';
353
358
  };
354
359
 
@@ -809,9 +814,10 @@ export declare type MessageOptions = {
809
814
  type?: 'default' | 'minimal' | 'system' | 'user';
810
815
  };
811
816
 
812
- export declare const Messages: ({ fill, files, handleUpload, inlineImages, maxEditorRows, message, messages, minEditorRows, onChange, onFilesChange, onInlineImagesChange, onSubmit, placeholder, sending, submitLabel, tooltipLabel, }: MessagesProps) => JSX.Element;
817
+ export declare const Messages: ({ autofocus, fill, files, handleUpload, inlineImages, maxEditorRows, message, messages, minEditorRows, onChange, onFilesChange, onInlineImagesChange, onSubmit, placeholder, resizableEditor, sending, submitLabel, tooltipLabel, }: MessagesProps) => JSX.Element;
813
818
 
814
819
  export declare type MessagesProps = {
820
+ autofocus?: boolean;
815
821
  fill?: boolean;
816
822
  files?: readonly File[];
817
823
  handleUpload: (files: FileList) => Promise<void> | void;
@@ -825,6 +831,8 @@ export declare type MessagesProps = {
825
831
  onInlineImagesChange?: (images: PendingInlineImage[]) => void;
826
832
  onSubmit: () => Promise<void> | void;
827
833
  placeholder?: string;
834
+ /** Adds a top handle: drag upward to grow beyond maxEditorRows. Automatic sizing is preserved until dragged. */
835
+ resizableEditor?: boolean;
828
836
  sending: boolean;
829
837
  submitLabel?: string;
830
838
  tooltipLabel?: string;
package/dist/tokens.json CHANGED
@@ -363,7 +363,7 @@
363
363
  },
364
364
  "com.solibo": {
365
365
  "packageName": "@solibo/solibo-ui",
366
- "packageVersion": "2.2.7"
366
+ "packageVersion": "2.2.9"
367
367
  }
368
368
  },
369
369
  "$name": "TEST Solibo UI Tokens (Copy)",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solibo/solibo-ui",
3
- "version": "2.2.7",
3
+ "version": "2.2.9",
4
4
  "type": "module",
5
5
  "sideEffects": [
6
6
  "./dist/index.js",