@solibo/solibo-ui 2.2.6 → 2.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/dist/assets/index15.css +1 -1
  2. package/dist/assets/index46.css +1 -1
  3. package/dist/components/app-link/index.cjs +0 -1
  4. package/dist/components/app-link/index.js +0 -1
  5. package/dist/components/app-shell/index.cjs +0 -1
  6. package/dist/components/app-shell/index.js +0 -1
  7. package/dist/components/aside/index.cjs +0 -1
  8. package/dist/components/aside/index.js +0 -1
  9. package/dist/components/avatar/index.cjs +0 -1
  10. package/dist/components/avatar/index.js +0 -1
  11. package/dist/components/badge/index.cjs +0 -1
  12. package/dist/components/badge/index.js +0 -1
  13. package/dist/components/banner/index.cjs +0 -1
  14. package/dist/components/banner/index.js +0 -1
  15. package/dist/components/branding/index.cjs +0 -1
  16. package/dist/components/branding/index.js +0 -1
  17. package/dist/components/button/index.cjs +0 -1
  18. package/dist/components/button/index.js +0 -1
  19. package/dist/components/card/index.cjs +0 -1
  20. package/dist/components/card/index.js +0 -1
  21. package/dist/components/checkbox/index.cjs +0 -1
  22. package/dist/components/checkbox/index.js +0 -1
  23. package/dist/components/chip/index.cjs +0 -1
  24. package/dist/components/chip/index.js +0 -1
  25. package/dist/components/clipboard/index.cjs +0 -1
  26. package/dist/components/clipboard/index.js +0 -1
  27. package/dist/components/collapsible/index.cjs +0 -1
  28. package/dist/components/collapsible/index.js +0 -1
  29. package/dist/components/controls/index.cjs +0 -1
  30. package/dist/components/controls/index.js +0 -1
  31. package/dist/components/croppable/index.cjs +0 -1
  32. package/dist/components/croppable/index.js +0 -1
  33. package/dist/components/dialog/index.cjs +0 -1
  34. package/dist/components/dialog/index.js +0 -1
  35. package/dist/components/divider/index.cjs +0 -1
  36. package/dist/components/divider/index.js +0 -1
  37. package/dist/components/dropdown/index.cjs +0 -1
  38. package/dist/components/dropdown/index.js +0 -1
  39. package/dist/components/dropzone/index.cjs +0 -1
  40. package/dist/components/dropzone/index.js +0 -1
  41. package/dist/components/editor/index.cjs +0 -1
  42. package/dist/components/editor/index.js +0 -1
  43. package/dist/components/empty-state/index.cjs +0 -1
  44. package/dist/components/empty-state/index.js +0 -1
  45. package/dist/components/fieldset/index.cjs +0 -1
  46. package/dist/components/fieldset/index.js +0 -1
  47. package/dist/components/figure/index.cjs +1 -2
  48. package/dist/components/figure/index.js +16 -15
  49. package/dist/components/file/index.cjs +0 -1
  50. package/dist/components/file/index.js +0 -1
  51. package/dist/components/footer/index.cjs +0 -1
  52. package/dist/components/footer/index.js +0 -1
  53. package/dist/components/form/index.cjs +0 -1
  54. package/dist/components/form/index.js +0 -1
  55. package/dist/components/graph/index.cjs +0 -1
  56. package/dist/components/graph/index.js +0 -1
  57. package/dist/components/group/index.cjs +0 -1
  58. package/dist/components/group/index.js +0 -1
  59. package/dist/components/header/index.cjs +0 -1
  60. package/dist/components/header/index.js +0 -1
  61. package/dist/components/icon/index.cjs +0 -1
  62. package/dist/components/icon/index.js +0 -1
  63. package/dist/components/iframe/index.cjs +1 -2
  64. package/dist/components/iframe/index.js +86 -82
  65. package/dist/components/image/index.cjs +0 -1
  66. package/dist/components/image/index.js +0 -1
  67. package/dist/components/input/index.cjs +0 -1
  68. package/dist/components/input/index.js +0 -1
  69. package/dist/components/link/index.cjs +0 -1
  70. package/dist/components/link/index.js +0 -1
  71. package/dist/components/list/index.cjs +0 -1
  72. package/dist/components/list/index.js +0 -1
  73. package/dist/components/loading/index.cjs +0 -1
  74. package/dist/components/loading/index.js +0 -1
  75. package/dist/components/menu/index.cjs +0 -1
  76. package/dist/components/menu/index.js +0 -1
  77. package/dist/components/message/index.cjs +0 -1
  78. package/dist/components/message/index.js +0 -1
  79. package/dist/components/messages/index.cjs +1 -2
  80. package/dist/components/messages/index.js +89 -68
  81. package/dist/components/nav/index.cjs +0 -1
  82. package/dist/components/nav/index.js +0 -1
  83. package/dist/components/object/index.cjs +0 -1
  84. package/dist/components/object/index.js +0 -1
  85. package/dist/components/page-layout/index.cjs +0 -1
  86. package/dist/components/page-layout/index.js +0 -1
  87. package/dist/components/panel/index.cjs +0 -1
  88. package/dist/components/panel/index.js +0 -1
  89. package/dist/components/popover/index.cjs +0 -1
  90. package/dist/components/popover/index.js +0 -1
  91. package/dist/components/portal/index.cjs +0 -1
  92. package/dist/components/portal/index.js +0 -1
  93. package/dist/components/search/index.cjs +0 -1
  94. package/dist/components/search/index.js +0 -1
  95. package/dist/components/select/index.cjs +0 -1
  96. package/dist/components/select/index.js +0 -1
  97. package/dist/components/sortable/index.cjs +0 -1
  98. package/dist/components/sortable/index.js +0 -1
  99. package/dist/components/table/index.cjs +0 -1
  100. package/dist/components/table/index.js +0 -1
  101. package/dist/components/textarea/index.cjs +0 -1
  102. package/dist/components/textarea/index.js +0 -1
  103. package/dist/components/toast/index.cjs +0 -1
  104. package/dist/components/toast/index.js +0 -1
  105. package/dist/components/toasts/index.cjs +0 -1
  106. package/dist/components/toasts/index.js +0 -1
  107. package/dist/components/toggle/index.cjs +0 -1
  108. package/dist/components/toggle/index.js +0 -1
  109. package/dist/components/toolbar/index.cjs +0 -1
  110. package/dist/components/toolbar/index.js +0 -1
  111. package/dist/components/tooltip/index.cjs +0 -1
  112. package/dist/components/tooltip/index.js +0 -1
  113. package/dist/components/widget/index.cjs +0 -1
  114. package/dist/components/widget/index.js +0 -1
  115. package/dist/icons-BIdcCH-v.cjs +0 -1
  116. package/dist/icons-DVeBguFb.js +0 -1
  117. package/dist/index-7blZaPiA.cjs +0 -1
  118. package/dist/index-Dd20d_9U.js +0 -1
  119. package/dist/index-Dx-KtGBg.js +0 -1
  120. package/dist/index-VLDsM9it.cjs +0 -1
  121. package/dist/index.cjs +0 -1
  122. package/dist/index.d.ts +4 -2
  123. package/dist/index.js +0 -1
  124. package/dist/menu-popover-Ceb_9V67.js +0 -1
  125. package/dist/menu-popover-bqblnK6P.cjs +0 -1
  126. package/dist/tokens.json +1 -1
  127. package/dist/use-touched-B999bBr8.js +0 -1
  128. package/dist/use-touched-Bq5Gjbpz.cjs +0 -1
  129. package/package.json +1 -1
@@ -1,2 +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;
2
- //# sourceMappingURL=index.cjs.map
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,94 +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
  };
94
- //# sourceMappingURL=index.js.map
@@ -1,2 +1 @@
1
1
  "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index18.css');const d=require("react/jsx-runtime"),c=require("react"),o="_image_14j8z_1",y={image:o};function S({fadeDurationMs:n=250,showOnError:r=!0,onLoad:a,onError:i,style:l,...t}){const u=c.useRef(null),[m,s]=c.useState(!1);c.useEffect(()=>{s(!1)},[t.src,t.srcSet]),c.useEffect(()=>{const e=u.current;e&&e.complete&&e.naturalWidth>0&&s(!0)},[t.src,t.srcSet]);const f=e=>{s(!0),a==null||a(e)},g=e=>{r&&s(!0),i==null||i(e)};return d.jsx("img",{...t,className:y.image,onLoad:f,onError:g,ref:u,style:{...l,opacity:m?1:0,"--duration-override":`${n}ms`},"data-component":"image"})}exports.Image=S;
2
- //# sourceMappingURL=index.cjs.map
@@ -32,4 +32,3 @@ function x({
32
32
  export {
33
33
  x as Image
34
34
  };
35
- //# sourceMappingURL=index.js.map
@@ -1,2 +1 @@
1
1
  "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");require("classix");require("react");require("../../icons-BIdcCH-v.cjs");require("../../use-touched-Bq5Gjbpz.cjs");const e=require("../../index-7blZaPiA.cjs");exports.Input=e.Input;
2
- //# sourceMappingURL=index.cjs.map
@@ -7,4 +7,3 @@ import { I as a } from "../../index-Dd20d_9U.js";
7
7
  export {
8
8
  a as Input
9
9
  };
10
- //# sourceMappingURL=index.js.map
@@ -1,2 +1 @@
1
1
  "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index51.css');const t=require("react/jsx-runtime"),o=require("classix"),c="_link_5i71r_1",l="_neutral_5i71r_19",m="_content_5i71r_24",_="_adornment_5i71r_33",d="_text_5i71r_37",u="_primary_5i71r_43",p="_danger_5i71r_49",x="_minimal_5i71r_57",n={link:c,neutral:l,content:m,adornment:_,text:d,primary:u,danger:p,minimal:x},k=({children:s,leading:e,trailing:r})=>t.jsxs("span",{className:n.content,"data-component":"linkcontent",children:[e!=null&&t.jsx("span",{className:n.adornment,children:e}),t.jsx("span",{className:n.text,children:s}),r!=null&&t.jsx("span",{className:n.adornment,children:r})]}),j=({children:s,className:e,to:r="#",variant:a="primary",...i})=>t.jsx("a",{className:o(e,n.link,n[a]),href:r,...i,"data-component":"link",children:s});exports.Link=j;exports.LinkContent=k;
2
- //# sourceMappingURL=index.cjs.map
@@ -28,4 +28,3 @@ export {
28
28
  f as Link,
29
29
  h as LinkContent
30
30
  };
31
- //# sourceMappingURL=index.js.map
@@ -1,2 +1 @@
1
1
  "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index52.css');const u=require("react/jsx-runtime"),H=require("classix"),r=require("react");function T(e){return r.isValidElement(e)&&e.type===r.Fragment}function O(e,n=[]){return r.Children.forEach(e,i=>{T(i)?O(i.props.children,n):n.push(i)}),n}function F(e,{wrapper:n="li"}={}){return O(e).filter(s=>s!==null).map((s,c)=>{if(r.isValidElement(s)&&s.type===n)return s;const m=r.isValidElement(s)&&s.key!=null?s.key:c;return r.createElement(n,{key:m,"data-component":"wrapchildren"},s)})}const V="_controls_uue68_1",A="_horizontal_uue68_9",I="_list_uue68_20",D="_columns_uue68_61",P="_masonry_uue68_71",$="_scrollable_uue68_81",G="_overflowing_uue68_88",J="_sized_uue68_111",K="_compact_uue68_123",l={controls:V,horizontal:A,list:I,columns:D,masonry:P,scrollable:$,overflowing:G,sized:J,compact:K},M=(e,n)=>{typeof e=="function"?e(n):e&&(e.current=n)};function Q({children:e,className:n,columns:i=1,columnWidth:b,compact:s=!1,controls:c,horizontal:m,layout:h="grid",maxVisibleItems:f,ordered:B,ref:p,style:S,...d}){const v=Number.isFinite(i)?Math.max(1,Math.floor(i)):1,y=r.useRef(null),[a,k]=r.useState(),o=h==="grid"&&v===1&&!m&&f!=null&&Number.isFinite(f)&&f>=1?Math.floor(f):void 0,w=!!o&&a!=null;r.useLayoutEffect(()=>{const t=y.current;if(!t||!o)return;const R=()=>{const g=Array.from(t.children).filter(j=>j instanceof HTMLElement&&getComputedStyle(j).display!=="none"),N=g[o-1],q=g.length>o&&N?N.getBoundingClientRect().bottom-t.getBoundingClientRect().top+t.scrollTop+(parseFloat(getComputedStyle(t).paddingBottom)||0):void 0;k(q)},_=new ResizeObserver(R),C=()=>{_.disconnect(),_.observe(t),Array.from(t.children).forEach(g=>_.observe(g)),R()},L=new MutationObserver(C);return L.observe(t,{childList:!0,subtree:!0,characterData:!0}),C(),()=>{_.disconnect(),L.disconnect()}},[e,o,w]);const x=H(n,l.list,h==="masonry"?l.masonry:v>1&&l.columns,!!o&&l.scrollable,w&&l.overflowing,m&&l.horizontal,s&&l.compact,b&&l.sized),z={...S,"--list-columns":v,"--list-column-width":b,"--list-max-height":o&&a!=null?`${a}px`:void 0},E=B?u.jsx("ol",{className:x,ref:t=>{y.current=t,M(p,t)},style:z,...d,tabIndex:d.tabIndex??(o&&a!=null?0:void 0),"data-component":"list",children:F(e)}):u.jsx("ul",{className:x,ref:t=>{y.current=t,M(p,t)},style:z,...d,tabIndex:d.tabIndex??(o&&a!=null?0:void 0),"data-component":"list",children:F(e)});return c==null?E:u.jsxs(u.Fragment,{children:[u.jsx("div",{className:l.controls,"data-component":"list",children:c}),E]})}exports.List=Q;
2
- //# sourceMappingURL=index.cjs.map
@@ -86,4 +86,3 @@ function nt({
86
86
  export {
87
87
  nt as List
88
88
  };
89
- //# sourceMappingURL=index.js.map
@@ -1,2 +1 @@
1
1
  "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index53.css');const l=require("react/jsx-runtime"),e=require("classix"),t="_loading_1jrs1_23",r="_spin_1jrs1_1",o="_small_1jrs1_40",_="_large_1jrs1_46",d="_ping_1jrs1_52",g="_fullscreen_1jrs1_78",u="_sticky_1jrs1_86",s={loading:t,default:"_default_1jrs1_29",spin:r,small:o,large:_,ping:d,fullscreen:g,sticky:u},m={fullscreen:s.fullscreen,large:s.large,medium:s.medium,small:s.small},j=({variant:n="default",size:a="medium",sticky:c=!1,...i})=>l.jsx("div",{className:e.cx(s.loading,c&&s.sticky),"data-component":"loading",children:l.jsx("span",{className:e.cx(s.loading,s[n],m[a]),...i})});exports.Loading=j;
2
- //# sourceMappingURL=index.cjs.map
@@ -23,4 +23,3 @@ import '../../assets/index53.css';const c = "_loading_1jrs1_23", o = "_spin_1jrs
23
23
  export {
24
24
  j as Loading
25
25
  };
26
- //# sourceMappingURL=index.js.map
@@ -1,2 +1 @@
1
1
  "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),j=require("../button/index.cjs"),M=require("../icon/index.cjs"),i=require("../../menu-popover-bqblnK6P.cjs");function v(e){return[...e].sort((n,a)=>+!!n.isDanger-+!!a.isDanger)}const D=e=>v(e).map(n=>({button:r.jsxs(j.Button,{"aria-label":n.accessibleLabel,disabled:n.disabled,children:[n.icon&&r.jsx(M.Icon,{gap:"right",name:n.icon,size:"small"}),r.jsx("span",{children:n.label})]}),id:n.id,isActive:n.isActive,isDanger:n.isDanger,value:n})),h=({inline:e=!1,items:n,menuAccessibleLabel:a="Menu",onItemSelect:s,triggerAccessibleLabel:l="Open menu",triggerIcon:p="DotsThreeVertical",triggerLabel:b,variant:g="popover"})=>{const d=D(n);return g==="simple"?r.jsx(i.MenuActionList,{actions:d,menuAccessibleLabel:a,onSelect:o=>{var u;(u=o.onSelect)==null||u.call(o),s==null||s(o)},"data-component":"menu"}):r.jsx(i.MenuPopover,{inline:e,triggerAccessibleLabel:l,triggerIcon:p,triggerLabel:b,"data-component":"menu",children:({close:o,initialFocus:u,isPositioned:x})=>r.jsx(i.MenuActionList,{actions:d,initialFocus:u,readyToFocus:x,menuAccessibleLabel:a,onSelect:c=>{var t;(t=c.onSelect)==null||t.call(c),s==null||s(c),o()},usesMenuSemantics:!0})})};exports.Menu=h;
2
- //# sourceMappingURL=index.cjs.map
@@ -40,4 +40,3 @@ const A = (o) => x(o).map((n) => ({
40
40
  export {
41
41
  T as Menu
42
42
  };
43
- //# sourceMappingURL=index.js.map
@@ -1,2 +1 @@
1
1
  "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index17.css');const e=require("react/jsx-runtime"),j=require("classix"),h=require("../avatar/index.cjs"),N=require("../icon/index.cjs"),w="_attachments_1crfp_1",y="_footer_1crfp_27",S="_message_1crfp_11",b="_timestamp_1crfp_147",q="_actions_1crfp_152",I="_preview_1crfp_164",s={attachments:w,"message-group":"_message-group_1crfp_11",footer:y,message:S,timestamp:b,actions:q,preview:I},M=({actions:o,appearance:m="default",attachments:i,author:a,authorColor:l,authorImageUrl:d,authorLink:_,authorRole:p,content:g,iconName:f="Info",id:u,preview:v,timestamp:r,timestampText:x,type:t="default"})=>{const c=r?new Date(r):void 0,n=c?e.jsx("time",{className:s.timestamp,dateTime:c.toISOString(),children:x??c.toLocaleString()}):null;return e.jsxs("div",{className:s["message-group"],"data-message-type":t,"data-component":"message",children:[a&&e.jsx(h.Avatar,{accessibleLabel:a,color:l,imageUrl:d,link:_,name:a,role:p}),t==="system"&&n,e.jsxs("div",{className:j(s.message,v&&s.preview),"data-appearance":m,"data-id":u,"data-type":t,children:[t=="system"&&e.jsx(N.Icon,{gap:"right",name:f,size:"tiny"}),g]}),i&&e.jsx("div",{className:s.attachments,children:i}),t!=="system"&&(o?e.jsxs("div",{className:s.footer,children:[n,e.jsx("div",{className:s.actions,"data-message-actions":!0,children:o})]}):n)]})};exports.Message=M;
2
- //# sourceMappingURL=index.cjs.map
@@ -45,4 +45,3 @@ import '../../assets/index17.css';const I = "_attachments_1crfp_1", S = "_footer
45
45
  export {
46
46
  M as Message
47
47
  };
48
- //# sourceMappingURL=index.js.map
@@ -1,2 +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;
2
- //# sourceMappingURL=index.cjs.map
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index15.css');const m=require("react/jsx-runtime"),S=require("classix"),v=require("react"),q=require("../editor/index.cjs"),j=require("../list/index.cjs"),A=require("../tooltip/index.cjs"),B=require("../message/index.cjs"),D="_messages_88pw2_1",H="_fill_88pw2_22",b={messages:D,fill:H};function P(R){const g=v.useRef(null),a=v.useRef(()=>{});return v.useLayoutEffect(()=>{const e=g.current;if(!e)return;let c=!0,d=e.scrollTop,s;const i=()=>{const n=e.getBoundingClientRect().top,o=Array.from(e.children).find(f=>f instanceof HTMLElement&&f.getBoundingClientRect().bottom>n);s=o?{element:o,offset:o.getBoundingClientRect().top-n}:void 0},h=()=>{if(Math.abs(e.scrollTop-d)<=.5)return!1;const n=Math.max(0,e.scrollHeight-e.clientHeight);return!(d>n&&Math.abs(e.scrollTop-n)<=.5)},l=()=>{if(h()&&(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()},E=()=>{h()&&(c=!1),d=e.scrollTop,i()},w=n=>{n.target===e&&r()},L=n=>{const o=n.target;o instanceof Element&&o.closest('input, textarea, select, [contenteditable="true"]')||["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"," "].includes(n.key)&&r()},t=typeof ResizeObserver>"u"?void 0:new ResizeObserver(l),x=()=>{t==null||t.disconnect(),t==null||t.observe(e),Array.from(e.children).forEach(n=>t==null?void 0:t.observe(n)),l()},u=new MutationObserver(x);return u.observe(e,{childList:!0,subtree:!0,characterData:!0}),x(),e.addEventListener("scroll",E,{passive:!0}),e.addEventListener("wheel",r,{passive:!0}),e.addEventListener("touchmove",r,{passive:!0}),e.addEventListener("pointerdown",w),e.addEventListener("keydown",L),e.addEventListener("load",l,!0),e.addEventListener("error",l,!0),()=>{a.current=()=>{},t==null||t.disconnect(),u.disconnect(),e.removeEventListener("scroll",E),e.removeEventListener("wheel",r),e.removeEventListener("touchmove",r),e.removeEventListener("pointerdown",w),e.removeEventListener("keydown",L),e.removeEventListener("load",l,!0),e.removeEventListener("error",l,!0)}},[]),v.useLayoutEffect(()=>a.current(),[R]),g}const k=({autofocus:R=!0,fill:g=!1,files:a,handleUpload:e,inlineImages:c,maxEditorRows:d=5,message:s="",messages:i,minEditorRows:h=1,onChange:l,onFilesChange:r,onInlineImagesChange:E,onSubmit:w,placeholder:L,sending:t,submitLabel:x="Send message",tooltipLabel:u})=>{var _;const[n,o]=v.useState([]),f=a??n,y=(_=i[i.length-1])==null?void 0:_.id,M=P(y),T=s.replace(/<[^>]*>/g,"").replace(/&nbsp;/g," ").trim()==="";return m.jsxs("div",{className:S(b.messages,g&&b.fill),"data-component":"messages",children:[m.jsx(j.List,{"data-message-list":!0,ref:M,tabIndex:0,children:i.map(p=>m.jsx(B.Message,{...p},p.id))}),u&&m.jsx(A.Tooltip,{variant:"static",children:u}),m.jsx(q.Editor,{autofocus:R,content:s,disabled:t||T&&f.length===0&&!(c!=null&&c.length),files:f,inlineImages:c,isSubmitting:t,maxRows:d,minRows:h,onChange:l,onFilesChange:p=>{a===void 0&&o(p),r==null||r(p)},onInlineImagesChange:E,onSubmit:w,onUpload:e,placeholder:L,submitLabel:x})]})};exports.Messages=k;
@@ -1,77 +1,98 @@
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 A, jsx as L } from "react/jsx-runtime";
2
+ import B from "classix";
3
+ import { useRef as M, useLayoutEffect as T, useState as D } from "react";
4
+ import { Editor as H } from "../editor/index.js";
5
+ import { List as k } from "../list/index.js";
6
+ import { Tooltip as C } from "../tooltip/index.js";
7
+ import { Message as P } from "../message/index.js";
8
+ import '../../assets/index15.css';const U = "_messages_88pw2_1", j = "_fill_88pw2_22", y = {
9
+ messages: U,
10
+ fill: j
11
+ };
12
+ function q(R) {
13
+ const p = M(null), a = M(() => {
14
+ });
15
+ return T(() => {
16
+ const e = p.current;
17
+ if (!e) return;
18
+ let l = !0, d = e.scrollTop, r;
19
+ const i = () => {
20
+ const o = e.getBoundingClientRect().top, n = Array.from(e.children).find((u) => u instanceof HTMLElement && u.getBoundingClientRect().bottom > o);
21
+ r = n ? {
22
+ element: n,
23
+ offset: n.getBoundingClientRect().top - o
24
+ } : void 0;
25
+ }, v = () => {
26
+ if (Math.abs(e.scrollTop - d) <= 0.5) return !1;
27
+ const o = Math.max(0, e.scrollHeight - e.clientHeight);
28
+ return !(d > o && Math.abs(e.scrollTop - o) <= 0.5);
29
+ }, c = () => {
30
+ if (v() && (l = !1, i()), l)
31
+ e.scrollTop = e.scrollHeight;
32
+ else if (r != null && r.element.isConnected && e.contains(r.element)) {
33
+ const n = r.element.getBoundingClientRect().top - e.getBoundingClientRect().top - r.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 s = () => {
40
+ l = !1, i();
41
+ }, g = () => {
42
+ v() && (l = !1), d = e.scrollTop, i();
43
+ }, h = (o) => {
44
+ o.target === e && s();
45
+ }, w = (o) => {
46
+ const n = o.target;
47
+ n instanceof Element && n.closest('input, textarea, select, [contenteditable="true"]') || ["ArrowUp", "ArrowDown", "PageUp", "PageDown", "Home", "End", " "].includes(o.key) && s();
48
+ }, t = typeof ResizeObserver > "u" ? void 0 : new ResizeObserver(c), E = () => {
49
+ t == null || t.disconnect(), t == null || t.observe(e), Array.from(e.children).forEach((o) => t == null ? void 0 : t.observe(o)), c();
50
+ }, f = new MutationObserver(E);
51
+ return f.observe(e, {
52
+ childList: !0,
53
+ subtree: !0,
54
+ characterData: !0
55
+ }), E(), e.addEventListener("scroll", g, {
58
56
  passive: !0
59
- }), e.addEventListener("touchstart", S, {
57
+ }), e.addEventListener("wheel", s, {
60
58
  passive: !0
61
- }), e.addEventListener("touchmove", _, {
59
+ }), e.addEventListener("touchmove", s, {
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", h), e.addEventListener("keydown", w), e.addEventListener("load", c, !0), e.addEventListener("error", c, !0), () => {
62
+ a.current = () => {
63
+ }, t == null || t.disconnect(), f.disconnect(), e.removeEventListener("scroll", g), e.removeEventListener("wheel", s), e.removeEventListener("touchmove", s), e.removeEventListener("pointerdown", h), e.removeEventListener("keydown", w), 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
+ }, []), T(() => a.current(), [R]), p;
66
+ }
67
+ const V = ({
68
+ autofocus: R = !0,
69
+ fill: p = !1,
70
+ files: a,
71
+ handleUpload: e,
72
+ inlineImages: l,
73
+ maxEditorRows: d = 5,
74
+ message: r = "",
75
+ messages: i,
76
+ minEditorRows: v = 1,
77
+ onChange: c,
78
+ onFilesChange: s,
79
+ onInlineImagesChange: g,
80
+ onSubmit: h,
81
+ placeholder: w,
82
+ sending: t,
83
+ submitLabel: E = "Send message",
84
+ tooltipLabel: f
85
+ }) => {
86
+ var b;
87
+ const [o, n] = D([]), u = a ?? o, x = (b = i[i.length - 1]) == null ? void 0 : b.id, S = q(x), _ = r.replace(/<[^>]*>/g, "").replace(/&nbsp;/g, " ").trim() === "";
88
+ return /* @__PURE__ */ A("div", { className: B(y.messages, p && y.fill), "data-component": "messages", children: [
89
+ /* @__PURE__ */ L(k, { "data-message-list": !0, ref: S, tabIndex: 0, children: i.map((m) => /* @__PURE__ */ L(P, { ...m }, m.id)) }),
90
+ f && /* @__PURE__ */ L(C, { variant: "static", children: f }),
91
+ /* @__PURE__ */ L(H, { autofocus: R, content: r, disabled: t || _ && u.length === 0 && !(l != null && l.length), files: u, inlineImages: l, isSubmitting: t, maxRows: d, minRows: v, onChange: c, onFilesChange: (m) => {
92
+ a === void 0 && n(m), s == null || s(m);
93
+ }, onInlineImagesChange: g, onSubmit: h, onUpload: e, placeholder: w, submitLabel: E })
72
94
  ] });
73
95
  };
74
96
  export {
75
- ne as Messages
97
+ V as Messages
76
98
  };
77
- //# sourceMappingURL=index.js.map
@@ -1,2 +1 @@
1
1
  "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index14.css');const i=require("react/jsx-runtime"),r=require("classix"),b=require("react"),m=require("../../icons-BIdcCH-v.cjs"),v="_nav_1jlcq_3",p="_label_1jlcq_9",j="_item_1jlcq_17",q="_actions_1jlcq_36",g="_highlighted_1jlcq_60",f="_horizontal_1jlcq_64",N="_sidebar_1jlcq_74",w="_stacked_1jlcq_124",x="_tabs_1jlcq_141",k="_pills_1jlcq_161",t={nav:v,label:p,item:j,actions:q,highlighted:g,horizontal:f,sidebar:N,stacked:w,tabs:x,pills:k},y={default:t.default,pills:t.pills,sidebar:t.sidebar,tabs:t.tabs},z=({className:a,...e})=>i.jsx("span",{className:r(a,t.label),...e,"data-component":"navlabel"}),S=({actions:a,children:e,className:c,highlighted:n=!1,layout:s="row",...o})=>i.jsxs("div",{className:r(t.item,n&&t.highlighted,s==="stack"&&t.stacked,c),"data-nav-item":!0,...o,"data-component":"navitem",children:[e,a&&i.jsx("span",{className:t.actions,children:a})]}),C=({animation:a,children:e,className:c,horizontal:n=!1,variant:s="default",...o})=>{const[_,d]=b.useState(!1),h={"--icon-svg":m.iconSVG("CaretDown")};return i.jsx("nav",{className:r(c,n&&t.horizontal,t.nav,y[s]),"data-animation":a,"data-open":_?"true":"false","data-orientation":n?"horizontal":"vertical",onBlurCapture:l=>{if(s!=="pills"||window.innerWidth>960)return;const u=l.relatedTarget;l.currentTarget.contains(u)||d(!1)},onClick:()=>{s!=="pills"||window.innerWidth>960||d(l=>!l)},style:h,...o,"data-component":"nav",children:e})};exports.Nav=C;exports.NavItem=S;exports.NavLabel=z;
2
- //# sourceMappingURL=index.cjs.map
@@ -55,4 +55,3 @@ export {
55
55
  B as NavItem,
56
56
  W as NavLabel
57
57
  };
58
- //# sourceMappingURL=index.js.map
@@ -1,2 +1 @@
1
1
  "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index13.css');const e=require("react/jsx-runtime"),n="_object_18i7r_1",s={object:n},a=({accessibleLabel:c,url:t,...o})=>e.jsx("object",{"aria-label":c,className:s.object,data:t,type:"application/pdf",...o,"data-component":"objectcomponent",children:t&&e.jsxs(e.Fragment,{children:["We cannot show this file. You can try accessing it directly:",e.jsx("br",{}),e.jsx("a",{href:t,children:t})]})});exports.Object=a;
2
- //# sourceMappingURL=index.cjs.map
@@ -13,4 +13,3 @@ import '../../assets/index13.css';const s = "_object_18i7r_1", i = {
13
13
  export {
14
14
  b as Object
15
15
  };
16
- //# sourceMappingURL=index.js.map
@@ -1,2 +1 @@
1
1
  "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index12.css');const e=require("react/jsx-runtime"),y=require("classix"),p=require("../loading/index.cjs"),w="_layout_1nh7z_1",f="_constrained_1nh7z_7",z="_reading_1nh7z_12",m="_loading_1nh7z_40",n={layout:w,constrained:f,reading:z,"with-sidebar":"_with-sidebar_1nh7z_24","fill-viewport":"_fill-viewport_1nh7z_34",loading:m,"loading-content":"_loading-content_1nh7z_48","without-padding":"_without-padding_1nh7z_87"},b=({"aria-busy":l,children:s,className:d,contentLayout:t="default",contentMaxWidth:i,fillViewport:r=!1,loading:a=!1,loadingLabel:_="Loading",padding:c="default",sidebar:o,style:u,...g})=>{const h={...u,"--page-content-max-width":i};return e.jsxs("main",{"aria-busy":l??(a||void 0),className:y(n.layout,!!o&&n["with-sidebar"],r&&n["fill-viewport"],i&&t==="default"&&n.constrained,t==="reading"&&n.reading,c==="none"&&n["without-padding"],a&&n.loading,d),style:h,...g,"data-component":"pagelayout",children:[o,a?e.jsx("div",{className:n["loading-content"],role:"status","aria-label":_,children:e.jsx(p.Loading,{size:"large"})}):s]})};exports.PageLayout=b;
2
- //# sourceMappingURL=index.cjs.map
@@ -36,4 +36,3 @@ import '../../assets/index12.css';const y = "_layout_1nh7z_1", w = "_constrained
36
36
  export {
37
37
  L as PageLayout
38
38
  };
39
- //# sourceMappingURL=index.js.map
@@ -1,2 +1 @@
1
1
  "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index11.css');const n=require("react/jsx-runtime"),d=require("classix"),p=require("react"),f=require("../loading/index.cjs"),g="_panel_1c69h_1",h="_none_1c69h_15",b="_page_1c69h_19",m="_scrollable_1c69h_27",x="_surface_1c69h_32",y="_loading_1c69h_36",e={panel:g,default:"_default_1c69h_11",none:h,page:b,scrollable:m,surface:x,loading:y},j=({"aria-busy":l,as:c="div",children:s,className:o,loading:a=!1,loadingLabel:t="Loading",padding:r="default",scroll:_="hidden",surface:i=!1,...u})=>p.createElement(c,{...u,"aria-busy":a||l,children:a?n.jsx("div",{role:"status","aria-label":t,children:n.jsx(f.Loading,{})}):s,className:d(e.panel,e[r],_==="auto"&&e.scrollable,i&&e.surface,a&&e.loading,o),"data-component":"panel"});exports.Panel=j;
2
- //# sourceMappingURL=index.cjs.map
@@ -31,4 +31,3 @@ import '../../assets/index11.css';const u = "_panel_1c69h_1", h = "_none_1c69h_1
31
31
  export {
32
32
  N as Panel
33
33
  };
34
- //# sourceMappingURL=index.js.map
@@ -1,2 +1 @@
1
1
  "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index54.css');const h=require("react/jsx-runtime"),T=require("classix"),t=require("react"),K=require("react-dom"),N=require("../button/index.cjs"),O="_popover_12bds_1",H="_inline_12bds_6",W="_below_12bds_47",M="_above_12bds_52",U="_trigger_12bds_62",a={popover:O,inline:H,"popover-panel":"_popover-panel_12bds_26",below:W,above:M,"floating-panel":"_floating-panel_12bds_57",trigger:U,"inline-trigger":"_inline-trigger_12bds_66"},X=({children:v,inline:m=!1,triggerAccessibleLabel:k,triggerAriaHasPopup:C,triggerButtonContent:z})=>{const y=t.useRef(null),P=t.useRef(void 0),c=t.useRef(null),R=t.useId(),d=t.useRef(null),[n,D]=t.useState(!1),[F,x]=t.useState(!1),[u,B]=t.useState(),[f,E]=t.useState(!1),[w,S]=t.useState("right"),b=({initialFocus:e}={})=>{var r;P.current=e,B((r=d.current)==null?void 0:r.getBoundingClientRect()),x(!1),E(!1),S("right"),D(!0)},l=t.useCallback(({restoreFocus:e=!0}={})=>{var r;D(!1),e&&((r=d.current)==null||r.focus({preventScroll:!0}))},[]),L=e=>{n&&e.key==="Escape"&&l()},j=e=>{if(!n){if(e.key==="ArrowDown"){e.preventDefault(),b({initialFocus:"first"});return}e.key==="ArrowUp"&&(e.preventDefault(),b({initialFocus:"last"}))}};t.useEffect(()=>{if(!n)return;const e=s=>{var i,p;const o=s.target;(i=y.current)!=null&&i.contains(o)||(p=c.current)!=null&&p.contains(o)||l({restoreFocus:!1})},r=s=>{var o,i;s.target instanceof Node&&((o=c.current)!=null&&o.contains(s.target))||l({restoreFocus:((i=c.current)==null?void 0:i.contains(document.activeElement))??!1})};return document.addEventListener("mousedown",e),window.addEventListener("scroll",r,!0),()=>{document.removeEventListener("mousedown",e),window.removeEventListener("scroll",r,!0)}},[l,n]);const g=t.useCallback(()=>{const e=c.current,r=d.current;if(!e||!r)return;const s=e.getBoundingClientRect(),o=r.getBoundingClientRect();B(o),x(!0);const i=o.top,p=window.innerHeight-o.bottom;E(s.height>p&&i>p),S(s.width>window.innerWidth-o.left&&o.right>window.innerWidth-o.left?"left":"right")},[]);t.useLayoutEffect(()=>{if(n)return g(),window.addEventListener("resize",g),()=>{window.removeEventListener("resize",g)}},[n,g]);const q=e=>{e.preventDefault(),e.stopPropagation(),n?l({restoreFocus:!1}):b()},A={"aria-controls":n?R:void 0,"aria-expanded":n,"aria-haspopup":C,"aria-label":k,className:m?a["inline-trigger"]:a.trigger,onClick:q,onKeyDown:j},I=[w==="left"?"translateX(-100%)":"",f?"translateY(calc(-100% - var(--shape-spacing-2xs)))":""].filter(Boolean).join(" "),_=n?h.jsx("div",{className:T(a["popover-panel"],a[f?"above":"below"],a["floating-panel"]),"data-horizontal-placement":w,"data-placement":f?"above":"below",id:R,ref:c,style:u?{left:w==="left"?u.right:u.left,position:"fixed",top:f?u.top:u.bottom,transform:I||void 0}:{position:"fixed",left:0,top:0},children:typeof v=="function"?v({close:l,initialFocus:P.current,isOpen:n,isPositioned:F}):v}):null;return h.jsxs("div",{className:T(a.popover,m&&a.inline),"data-open":n,onKeyDown:L,onClick:e=>{e.preventDefault(),e.stopPropagation()},ref:y,"data-component":"popover",children:[h.jsx(N.Button,{...A,ref:d,variant:m?"simple":"tertiary",children:z}),_&&typeof document<"u"?K.createPortal(_,document.body):_]})};exports.Popover=X;
2
- //# sourceMappingURL=index.cjs.map
@@ -116,4 +116,3 @@ import '../../assets/index54.css';const G = "_popover_12bds_1", J = "_inline_12b
116
116
  export {
117
117
  se as Popover
118
118
  };
119
- //# sourceMappingURL=index.js.map
@@ -1,2 +1 @@
1
1
  "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index10.css');const e=require("react/jsx-runtime"),c=require("classix"),i=require("../button/index.cjs"),a=require("../icon/index.cjs"),l=require("../aside/index.cjs"),_=require("../branding/index.cjs"),d=require("../figure/index.cjs"),u=require("../nav/index.cjs"),p="_portal_1wzqh_23",x="_content_1wzqh_279",g="_toggle_1wzqh_286",m="_open_1wzqh_337",n={portal:p,content:x,toggle:g,open:m},q=({children:t,portals:o,open:s,setOpen:r})=>e.jsxs(l.Aside,{className:c(n.portal,s&&n.open),sticky:!0,"data-component":"portal",children:[e.jsx(i.Button,{className:n.toggle,onClick:()=>r(!s),variant:"tertiary",children:e.jsx(a.Icon,{name:"SidebarSimple"})}),e.jsx(d.Figure,{children:e.jsx(_.Branding,{})}),e.jsxs("div",{className:n.content,children:[o&&e.jsx(u.Nav,{horizontal:!0,children:o}),t&&t]})]});exports.Portal=q;
2
- //# sourceMappingURL=index.cjs.map
@@ -27,4 +27,3 @@ import '../../assets/index10.css';const d = "_portal_1wzqh_23", h = "_content_1w
27
27
  export {
28
28
  k as Portal
29
29
  };
30
- //# sourceMappingURL=index.js.map