@bothub-chat/ui 2.54.3 → 2.55.1-develop-886f2f74-ef9d-4473-b65c-c49ebfc082ca
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
|
-
import{jsx as r,jsxs as e}from"react/jsx-runtime";import{forwardRef as l,useRef as t,useCallback as o,useImperativeHandle as s}from"react";import{MessagesStyled as c,MessagesScrollbarWrapper as n,MessagesContent as i,MessagesContainer as d,
|
|
1
|
+
import{jsx as r,jsxs as e}from"react/jsx-runtime";import{forwardRef as l,useRef as t,useCallback as o,useImperativeHandle as s}from"react";import{MessagesStyled as c,MessagesScrollbarWrapper as n,MessagesContent as i,MessagesContainer as d,MessageList as u,MessagesStart as m}from"./styled.js";import{MessagesProvider as a,MessagesScrollProvider as f}from"./context.js";export{MessagesContext,MessagesScrollContext,useMessages,useScrollbarRef}from"./context.js";import{ScrollButton as h}from"../scroll-button/index.js";const S=l(({scrollButton:l=!1,fullWidth:S=!1,className:x,startRef:p,scrollShadows:v,children:b},j)=>{const R=t(null),g=o(r=>{var e;return null===(e=R.current)||void 0===e?void 0:e.setScroll(null!=r?r:{side:"bottom"})},[R.current]);return s(j,()=>{var r,e;return{element:null!==(e=null===(r=R.current)||void 0===r?void 0:r.element)&&void 0!==e?e:null,setScroll:g}},[g,R.current]),r(a,{setScroll:g,children:e(c,{className:x,children:[r(n,{ref:R,scrollShadows:v,withStickyBottom:!0,defaultStickyBottom:!0,children:r(i,{children:e(d,{$fullWidth:S,children:[r(f,{scrollbarRef:R,children:r(u,{children:b})}),r(m,{ref:p})]})})}),l&&r(h,{scrollbarRef:R})]})})});export{S as Messages,a as MessagesProvider,f as MessagesScrollProvider};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{styled as
|
|
1
|
+
import{styled as e,css as t}from"styled-components";import{Scrollbar as i}from"../../scrollbar/index.js";import{adaptive as d}from"../../../adaptive/index.js";const o=e.div.withConfig({displayName:"styled__MessagesStyled",componentId:"sc-z7wbcu-0"})(["display:flex;position:relative;width:100%;"]),s=e(i).attrs({variant:"secondary"}).withConfig({displayName:"styled__MessagesScrollbarWrapper",componentId:"sc-z7wbcu-1"})(["overflow:auto;height:100%;",""],d({variant:"dashboard",desktop:t`
|
|
2
2
|
padding: 43px 34px;
|
|
3
3
|
padding-bottom: 106px;
|
|
4
|
-
`,tablet:
|
|
4
|
+
`,tablet:t`
|
|
5
5
|
padding: 43px 24px;
|
|
6
6
|
padding-bottom: 106px;
|
|
7
|
-
`,mobile:
|
|
7
|
+
`,mobile:t`
|
|
8
8
|
padding: 24px 16px;
|
|
9
9
|
padding-bottom: 78px;
|
|
10
|
-
`})),
|
|
10
|
+
`})),n=e.div.withConfig({displayName:"styled__MessagesContent",componentId:"sc-z7wbcu-2"})(["display:flex;width:inherit;justify-content:center;"]),a=e.div.withConfig({displayName:"styled__MessagesContainer",componentId:"sc-z7wbcu-3"})(["display:flex;flex-direction:column-reverse;width:inherit;max-width:",";"],({theme:e,$fullWidth:t})=>t?"none":e.dashboard.chat.containerWidth),p=e.div.withConfig({displayName:"styled__MessagesStart",componentId:"sc-z7wbcu-4"})(["display:flex;width:100%;height:1px;pointer-events:none;"]),l=e.div.withConfig({displayName:"styled__MessageList",componentId:"sc-z7wbcu-5"})(["display:flex;flex-direction:column;width:inherit;row-gap:24px;"]);export{l as MessageList,a as MessagesContainer,n as MessagesContent,s as MessagesScrollbarWrapper,p as MessagesStart,o as MessagesStyled};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{styled as t,css as a}from"styled-components";import{Avatar as s}from"../avatar/index.js";import{Typography as i}from"../typography/index.js";import{Button as o}from"../button/index.js";import{ArrowNarrowDownIcon as r}from"../../icons/arrow-narrow-down/index.js";import{ArrowNarrowLeftIcon as n}from"../../icons/arrow-narrow-left/index.js";import{ArrowNarrowRightIcon as d}from"../../icons/arrow-narrow-right/index.js";import{ArrowNarrowUpIcon as p}from"../../icons/arrow-narrow-up/index.js";import{EditIcon as l}from"../../icons/edit/index.js";import{adaptive as m}from"../../adaptive/index.js";import{Badge as c}from"../badge/index.js";import{Scrollbar as g}from"../scrollbar/index.js";import{MessageImageButton as w}from"./components/image/button/index.js";import{MessageImageButtonZoneWrapper as f}from"./components/image/button/styled.js";const x=t.div.withConfig({displayName:"styled__MessageStyledWrapper",componentId:"sc-1wz70sd-0"})(["display:flex;align-items:flex-start;width:100%;",""],({$variant:e})=>{switch(e){case"user":return a(["justify-content:flex-start;flex-direction:row-reverse;margin-left:auto;"]);case"assistant":return a(["margin-right:auto;"])}}),h=t.div.withConfig({displayName:"styled__MessageStyledWithBottomPanel",componentId:"sc-1wz70sd-1"})(["display:flex;width:fit-content;max-width:100%;flex-direction:column;gap:8px;"]),y=t.div.withConfig({displayName:"styled__MessageStyled",componentId:"sc-1wz70sd-2"})(["display:flex;max-width:100%;",""],({$variant:e})=>{if("user"===e)return a(["flex-direction:row-reverse;"])}),u=t.div.withConfig({displayName:"styled__MessageContent",componentId:"sc-1wz70sd-3"})(["position:relative;display:grid;column-gap:12px;row-gap:8px;max-width:100%;"," @media (max-width:","){","}"],({$variant:e})=>{switch(e){case"user":return a(["grid-template-areas:'. top .' 'block block avatar' 'buttons buttons .';"]);case"assistant":return a(["grid-template-areas:'. top .' 'avatar block block' '. buttons timestamp';"])}},({theme:e})=>e.mobile.maxWidth,({$variant:e})=>{switch(e){case"user":return a(["grid-template-areas:'top top' 'block block' 'buttons buttons';"]);case"assistant":return a(["grid-template-areas:'top top .' 'block block block' 'buttons buttons timestamp';"])}}),b=t.div.withConfig({displayName:"styled__MessageTop",componentId:"sc-1wz70sd-4"})(["display:flex;gap:10px;width:100%;align-items:center;justify-content:space-between;grid-area:top;"]),_=t.div.withConfig({displayName:"styled__MessageSender",componentId:"sc-1wz70sd-5"})(["display:flex;align-items:center;gap:10px;"]),v=t(i).attrs({variant:"body-m-regular"}).withConfig({displayName:"styled__MessageName",componentId:"sc-1wz70sd-6"})(["color:",";"],({theme:e,$color:t})=>{switch(t){case"green":return"dark"===e.mode?e.default.colors.base.white:e.colors.gpt3;case"purple":return"dark"===e.mode?e.default.colors.base.white:e.colors.gpt4;default:return e.colors.base.white}}),z=t.div.withConfig({displayName:"styled__MessageTags",componentId:"sc-1wz70sd-7"})([""]),C=t(c).withConfig({displayName:"styled__MessageTag",componentId:"sc-1wz70sd-8"})([""]),I=t.div.withConfig({displayName:"styled__MessageAvatarWrapper",componentId:"sc-1wz70sd-9"})(["grid-area:avatar;align-self:flex-end;user-select:none;@media (max-width:","){display:none;}"],({theme:e})=>e.mobile.maxWidth),N=t(s).withConfig({displayName:"styled__MessageAvatar",componentId:"sc-1wz70sd-10"})([""]),k=t.div.withConfig({displayName:"styled__MessageBlockWrapper",componentId:"sc-1wz70sd-11"})(["grid-area:block;display:flex;flex-direction:column;justify-content:center;gap:6px;position:relative;overflow:auto;"]),M=t.div.withConfig({displayName:"styled__MessageBlock",componentId:"sc-1wz70sd-12"})(["position:relative;display:flex;border-radius:10px;width:100%;max-width:100%;overflow:auto;"," "," "," ",""],({$variant:e})=>{switch(e){case"user":return a(["border-bottom-right-radius:0px;"]);case"assistant":return a(["border-bottom-left-radius:0px;"])}},({$hexColor:e,$variant:t})=>"user"===t&&`background: ${e};`,({$hasTimestamp:e,$timestampPosition:t,$variant:s})=>e?"user"===s&&m({variant:"dashboard",merge:!0,desktop:a(["padding:",";"],"right"===t?"8px":"8px 8px 5px 8px"),tablet:a(["padding:",";"],"right"===t?"8px":"8px 8px 5px 8px")}):"user"===s&&m({variant:"dashboard",merge:!0,desktop:a(["padding:14px 16px;"]),tablet:a(["padding:14px;"])}),({$timestampPosition:e})=>"bottom"===e&&a(["flex-direction:column;"])),j=t.div.withConfig({displayName:"styled__MessageBlockBottomPanel",componentId:"sc-1wz70sd-13"})(["grid-area:buttons;display:flex;align-items:center;gap:14px;"]),B=t.div.withConfig({displayName:"styled__MessageBlockTransaction",componentId:"sc-1wz70sd-14"})(["display:block;"]),$=t(g).attrs({variant:"secondary"}).withConfig({displayName:"styled__MessageBlockScrollbarWrapper",componentId:"sc-1wz70sd-15"})([""]),A=t.div.withConfig({displayName:"styled__MessageBlockContent",componentId:"sc-1wz70sd-16"})(["display:flex;flex-direction:column;align-items:flex-start;gap:10px;grid-area:block;border-radius:10px;padding:",";max-width:100%;overflow:
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{styled as t,css as a}from"styled-components";import{Avatar as s}from"../avatar/index.js";import{Typography as i}from"../typography/index.js";import{Button as o}from"../button/index.js";import{ArrowNarrowDownIcon as r}from"../../icons/arrow-narrow-down/index.js";import{ArrowNarrowLeftIcon as n}from"../../icons/arrow-narrow-left/index.js";import{ArrowNarrowRightIcon as d}from"../../icons/arrow-narrow-right/index.js";import{ArrowNarrowUpIcon as p}from"../../icons/arrow-narrow-up/index.js";import{EditIcon as l}from"../../icons/edit/index.js";import{adaptive as m}from"../../adaptive/index.js";import{Badge as c}from"../badge/index.js";import{Scrollbar as g}from"../scrollbar/index.js";import{MessageImageButton as w}from"./components/image/button/index.js";import{MessageImageButtonZoneWrapper as f}from"./components/image/button/styled.js";const x=t.div.withConfig({displayName:"styled__MessageStyledWrapper",componentId:"sc-1wz70sd-0"})(["display:flex;align-items:flex-start;width:100%;",""],({$variant:e})=>{switch(e){case"user":return a(["justify-content:flex-start;flex-direction:row-reverse;margin-left:auto;"]);case"assistant":return a(["margin-right:auto;"])}}),h=t.div.withConfig({displayName:"styled__MessageStyledWithBottomPanel",componentId:"sc-1wz70sd-1"})(["display:flex;width:fit-content;max-width:100%;flex-direction:column;gap:8px;"]),y=t.div.withConfig({displayName:"styled__MessageStyled",componentId:"sc-1wz70sd-2"})(["display:flex;max-width:100%;",""],({$variant:e})=>{if("user"===e)return a(["flex-direction:row-reverse;"])}),u=t.div.withConfig({displayName:"styled__MessageContent",componentId:"sc-1wz70sd-3"})(["position:relative;display:grid;column-gap:12px;row-gap:8px;max-width:100%;"," @media (max-width:","){","}"],({$variant:e})=>{switch(e){case"user":return a(["grid-template-areas:'. top .' 'block block avatar' 'buttons buttons .';"]);case"assistant":return a(["grid-template-areas:'. top .' 'avatar block block' '. buttons timestamp';"])}},({theme:e})=>e.mobile.maxWidth,({$variant:e})=>{switch(e){case"user":return a(["grid-template-areas:'top top' 'block block' 'buttons buttons';"]);case"assistant":return a(["grid-template-areas:'top top .' 'block block block' 'buttons buttons timestamp';"])}}),b=t.div.withConfig({displayName:"styled__MessageTop",componentId:"sc-1wz70sd-4"})(["display:flex;gap:10px;width:100%;align-items:center;justify-content:space-between;grid-area:top;"]),_=t.div.withConfig({displayName:"styled__MessageSender",componentId:"sc-1wz70sd-5"})(["display:flex;align-items:center;gap:10px;"]),v=t(i).attrs({variant:"body-m-regular"}).withConfig({displayName:"styled__MessageName",componentId:"sc-1wz70sd-6"})(["color:",";"],({theme:e,$color:t})=>{switch(t){case"green":return"dark"===e.mode?e.default.colors.base.white:e.colors.gpt3;case"purple":return"dark"===e.mode?e.default.colors.base.white:e.colors.gpt4;default:return e.colors.base.white}}),z=t.div.withConfig({displayName:"styled__MessageTags",componentId:"sc-1wz70sd-7"})([""]),C=t(c).withConfig({displayName:"styled__MessageTag",componentId:"sc-1wz70sd-8"})([""]),I=t.div.withConfig({displayName:"styled__MessageAvatarWrapper",componentId:"sc-1wz70sd-9"})(["grid-area:avatar;align-self:flex-end;user-select:none;@media (max-width:","){display:none;}"],({theme:e})=>e.mobile.maxWidth),N=t(s).withConfig({displayName:"styled__MessageAvatar",componentId:"sc-1wz70sd-10"})([""]),k=t.div.withConfig({displayName:"styled__MessageBlockWrapper",componentId:"sc-1wz70sd-11"})(["grid-area:block;display:flex;flex-direction:column;justify-content:center;gap:6px;position:relative;overflow:auto;"]),M=t.div.withConfig({displayName:"styled__MessageBlock",componentId:"sc-1wz70sd-12"})(["position:relative;display:flex;border-radius:10px;width:100%;max-width:100%;overflow:auto;"," "," "," ",""],({$variant:e})=>{switch(e){case"user":return a(["border-bottom-right-radius:0px;"]);case"assistant":return a(["border-bottom-left-radius:0px;"])}},({$hexColor:e,$variant:t})=>"user"===t&&`background: ${e};`,({$hasTimestamp:e,$timestampPosition:t,$variant:s})=>e?"user"===s&&m({variant:"dashboard",merge:!0,desktop:a(["padding:",";"],"right"===t?"8px":"8px 8px 5px 8px"),tablet:a(["padding:",";"],"right"===t?"8px":"8px 8px 5px 8px")}):"user"===s&&m({variant:"dashboard",merge:!0,desktop:a(["padding:14px 16px;"]),tablet:a(["padding:14px;"])}),({$timestampPosition:e})=>"bottom"===e&&a(["flex-direction:column;"])),j=t.div.withConfig({displayName:"styled__MessageBlockBottomPanel",componentId:"sc-1wz70sd-13"})(["grid-area:buttons;display:flex;align-items:center;gap:14px;"]),B=t.div.withConfig({displayName:"styled__MessageBlockTransaction",componentId:"sc-1wz70sd-14"})(["display:block;"]),$=t(g).attrs({variant:"secondary"}).withConfig({displayName:"styled__MessageBlockScrollbarWrapper",componentId:"sc-1wz70sd-15"})([""]),A=t.div.withConfig({displayName:"styled__MessageBlockContent",componentId:"sc-1wz70sd-16"})(["display:flex;flex-direction:column;align-items:flex-start;gap:10px;grid-area:block;border-radius:10px;padding:",";max-width:100%;overflow:hidden;"],({$variant:e})=>{switch(e){case"user":return"8px";case"assistant":return"0px 8px 0px 0px"}}),W=t.span.attrs({role:"textbox",contentEditable:!0,suppressContentEditableWarning:!0}).withConfig({displayName:"styled__MessageBlockTextArea",componentId:"sc-1wz70sd-17"})(["min-width:10ch;min-height:1ch;min-height:1cap;width:100%;max-width:100%;height:auto;resize:none;overflow:clip;white-space:pre-wrap;border:none;outline:none;background-color:transparent;",""],m({desktop:a(["font-size:16px;"]),tablet:a(["font-size:14px;"]),mobile:a(["font-size:14px;"])})),S=t.div.withConfig({displayName:"styled__MessageButtonsStyled",componentId:"sc-1wz70sd-18"})(["margin-left:48px;@media (max-width:","){margin-left:12px;}"],({theme:e})=>e.mobile.maxWidth),T=t(i).attrs({variant:"body-m-regular"}).withConfig({displayName:"styled__MessageTransaction",componentId:"sc-1wz70sd-19"})(["text-transform:uppercase;color:",";"],({theme:e})=>"light"===e.mode?e.colors.grayScale.gray1:e.default.colors.base.white),P=t(o).attrs({variant:"text",iconSize:18}).withConfig({displayName:"styled__MessageAction",componentId:"sc-1wz70sd-20"})([""]),E=t(P).attrs({children:e(l,{})}).withConfig({displayName:"styled__MessageEditAction",componentId:"sc-1wz70sd-21"})([""]),L=t(w).attrs({variant:"primary-transparent",zone:!0,children:e(n,{})}).withConfig({displayName:"styled__MessageImageLeftArrowButton",componentId:"sc-1wz70sd-22"})(["","{justify-content:flex-start;}"],f),R=t(w).attrs({variant:"primary-transparent",zone:!0,children:e(d,{})}).withConfig({displayName:"styled__MessageImageRightArrowButton",componentId:"sc-1wz70sd-23"})(["","{justify-content:flex-end;}"],f),q=t(w).attrs({variant:"primary-transparent",zone:!0,children:e(p,{})}).withConfig({displayName:"styled__MessageImageTopArrowButton",componentId:"sc-1wz70sd-24"})(["","{align-items:flex-start;}"],f),D=t(w).attrs({variant:"primary-transparent",zone:!0,children:e(r,{})}).withConfig({displayName:"styled__MessageImageBottomArrowButton",componentId:"sc-1wz70sd-25"})(["","{align-items:flex-end;}"],f);export{P as MessageAction,N as MessageAvatar,I as MessageAvatarWrapper,M as MessageBlock,j as MessageBlockBottomPanel,A as MessageBlockContent,$ as MessageBlockScrollbarWrapper,W as MessageBlockTextArea,B as MessageBlockTransaction,k as MessageBlockWrapper,S as MessageButtonsStyled,u as MessageContent,E as MessageEditAction,D as MessageImageBottomArrowButton,L as MessageImageLeftArrowButton,R as MessageImageRightArrowButton,q as MessageImageTopArrowButton,v as MessageName,_ as MessageSender,y as MessageStyled,h as MessageStyledWithBottomPanel,x as MessageStyledWrapper,C as MessageTag,z as MessageTags,b as MessageTop,T as MessageTransaction};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{forwardRef as r,useRef as o,useState as l,useCallback as s,useEffect as n,useImperativeHandle as i}from"react";import{ScrollbarContent as c,ScrollbarStyled as a,ScrollbarShadows as d}from"./styled.js";import{ScrollbarProvider as u}from"./context.js";export{ScrollbarContext,useScrollbar}from"./context.js";import"tslib";import"@react-spring/web";import"./shadow/styled.js";import"../../theme/index.js";export{ScrollbarStyle}from"./style/styled.js";const m=r(({className:r,scrollbarClassName:m,variant:h="primary",size:p=6,scrollShadows:v,scrollLocked:w,overflow:f="auto",disabled:b=!1,disableShadows:S=!1,children:T,onScroll:g,defaultStickyBottom:L=!1,withStickyBottom:x=!1,isHorizontalScrollbar:y=!1},z)=>{var j;const H=o(null),[E,M]=l(!1),[$,B]=l(!1),[N,k]=l(!1),[C,O]=l(!1),R=!!v,W=!!w,[D,Y]=l(L),[q,A]=l(0),F=null!==(j=null==v?void 0:v.size)&&void 0!==j?j:60,G=s(e=>{const{scrollTop:t,scrollHeight:r,clientHeight:o,scrollLeft:l,scrollWidth:s,clientWidth:n}=e,i=F>o,c=F>n,a=!i&&0!==t,d=!i&&Math.round(t)+1<r-o;k(a),O(d),M(!c&&0!==l),B(!c&&Math.round(l)+1<s-n);const u=q>e.scrollTop;if(A(e.scrollTop),x){const t=e.clientHeight-Math.ceil(e.scrollHeight-e.scrollTop);Math.abs(t)<20&&!u?Y(!0):u&&Y(!1)}b&&e.scrollTo(0,0),null==g||g({isTop:a,isBottom:d})},[H.current,b,q,x,F,g]);n(()=>{if(!y)return;const e=e=>{H.current&&(e.preventDefault(),H.current.scrollLeft+=e.deltaY)},t=H.current;return t&&t.addEventListener("wheel",e,{passive:!0}),()=>{t&&t.removeEventListener("wheel",e)}},[y,H.current]);const I=s(e=>{var t;const r=H.current;if(null!==r&&(W||void 0!==e)&&null!==r){const{side:o}=null!==(t=null!=e?e:w)&&void 0!==t?t:{side:"bottom"};if("bottom"===o)r.scrollTop=r.scrollHeight}},[W,w]);i(z,()=>({element:H.current,setScroll:I}),[H.current,I]),n(()=>{
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{forwardRef as r,useRef as o,useState as l,useCallback as s,useEffect as n,useImperativeHandle as i}from"react";import{ScrollbarContent as c,ScrollbarStyled as a,ScrollbarShadows as d}from"./styled.js";import{ScrollbarProvider as u}from"./context.js";export{ScrollbarContext,useScrollbar}from"./context.js";import"tslib";import"@react-spring/web";import"./shadow/styled.js";import"../../theme/index.js";export{ScrollbarStyle}from"./style/styled.js";const m=r(({className:r,scrollbarClassName:m,variant:h="primary",size:p=6,scrollShadows:v,scrollLocked:w,overflow:f="auto",disabled:b=!1,disableShadows:S=!1,children:T,onScroll:g,defaultStickyBottom:L=!1,withStickyBottom:x=!1,isHorizontalScrollbar:y=!1},z)=>{var j;const H=o(null),[E,M]=l(!1),[$,B]=l(!1),[N,k]=l(!1),[C,O]=l(!1),R=!!v,W=!!w,[D,Y]=l(L),[q,A]=l(0),F=null!==(j=null==v?void 0:v.size)&&void 0!==j?j:60,G=s(e=>{const{scrollTop:t,scrollHeight:r,clientHeight:o,scrollLeft:l,scrollWidth:s,clientWidth:n}=e,i=F>o,c=F>n,a=!i&&0!==t,d=!i&&Math.round(t)+1<r-o;k(a),O(d),M(!c&&0!==l),B(!c&&Math.round(l)+1<s-n);const u=q>e.scrollTop;if(A(e.scrollTop),x){const t=e.clientHeight-Math.ceil(e.scrollHeight-e.scrollTop);Math.abs(t)<20&&!u?Y(!0):u&&Y(!1)}b&&e.scrollTo(0,0),null==g||g({isTop:a,isBottom:d})},[H.current,b,q,x,F,g]);n(()=>{if(!y)return;const e=e=>{H.current&&(e.preventDefault(),H.current.scrollLeft+=e.deltaY)},t=H.current;return t&&t.addEventListener("wheel",e,{passive:!0}),()=>{t&&t.removeEventListener("wheel",e)}},[y,H.current]);const I=s(e=>{var t;const r=H.current;if(null!==r&&(W||void 0!==e)&&null!==r){const{side:o}=null!==(t=null!=e?e:w)&&void 0!==t?t:{side:"bottom"};if("bottom"===o)r.scrollTop=r.scrollHeight}},[W,w]);i(z,()=>({element:H.current,setScroll:I}),[H.current,I]),n(()=>{const e=H.current;if(null===e)return;G(e);let t=window.setTimeout(()=>{G(e)},500),r=null;D&&(r=new MutationObserver(()=>{G(e),D&&!W&&(e.scrollTop=e.scrollHeight)}),r.observe(e,{childList:!0,subtree:!0}));const o=()=>{window.clearTimeout(t),G(e),t=window.setTimeout(()=>{G(e)},500)};window.addEventListener("resize",o);let l=null;return H.current&&(l=new ResizeObserver(e=>{e.forEach(e=>{G(e.target)})}),l.observe(H.current)),()=>{clearTimeout(t),null==r||r.disconnect(),window.removeEventListener("resize",o),null==l||l.disconnect()}},[H.current,G,D]);const J=e(c,{$variant:h,$size:p,$disabled:b,$overflow:f,ref:H,className:r,onScroll:()=>{H.current&&G(H.current)},children:T});return R?e(u,{scrollbarSize:p,scrollShadows:v,setScroll:I,disabled:b,isLeft:E,isRight:$,isTop:N,isBottom:C,children:t(a,{$overflow:f,className:m,children:[J,!S&&t(d,{children:[v.left,v.right,v.top,v.bottom]})]})}):J});export{m as Scrollbar,c as ScrollbarContent,u as ScrollbarProvider,d as ScrollbarShadows,a as ScrollbarStyled};
|
package/package.json
CHANGED
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@bothub-chat/ui",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "Bothub UI Components",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"bot",
|
|
7
|
-
"chat",
|
|
8
|
-
"chatgpt",
|
|
9
|
-
"ai",
|
|
10
|
-
"react"
|
|
11
|
-
],
|
|
12
|
-
"repository": {
|
|
13
|
-
"url": "https://github.com/bothubchat/bothub.git",
|
|
14
|
-
"type": "git",
|
|
15
|
-
"directory": "./packages/ui"
|
|
16
|
-
},
|
|
17
|
-
"publishConfig": {
|
|
18
|
-
"access": "public",
|
|
19
|
-
"registry": "https://registry.npmjs.org/"
|
|
20
|
-
},
|
|
21
|
-
"author": "dev2alert <atmpotn@yandex.ru>",
|
|
22
|
-
"license": "MIT",
|
|
23
|
-
"homepage": "https://bothub.chat",
|
|
24
|
-
"files": [
|
|
25
|
-
"./dist",
|
|
26
|
-
"./fonts"
|
|
27
|
-
],
|
|
28
|
-
"type": "module",
|
|
29
|
-
"main": "./dist/index.js",
|
|
30
|
-
"module": "./dist/index.js",
|
|
31
|
-
"types": "./dist/index.d.ts",
|
|
32
|
-
"exports": {
|
|
33
|
-
".": {
|
|
34
|
-
"types": "./dist/index.d.ts",
|
|
35
|
-
"import": "./dist/index.js",
|
|
36
|
-
"default": "./dist/index.js"
|
|
37
|
-
},
|
|
38
|
-
"./components/*": "./dist/components/*",
|
|
39
|
-
"./fonts/*": "./fonts/*",
|
|
40
|
-
"./utils/*": "./dist/utils/*"
|
|
41
|
-
},
|
|
42
|
-
"sideEffects": false,
|
|
43
|
-
"resolutions": {
|
|
44
|
-
"react-helmet/react": "^19.0.0"
|
|
45
|
-
},
|
|
46
|
-
"peerDependencies": {
|
|
47
|
-
"@uidotdev/usehooks": "^2.4.1",
|
|
48
|
-
"react": "19.1.1",
|
|
49
|
-
"react-dom": "19.1.1",
|
|
50
|
-
"react-helmet": ">=2",
|
|
51
|
-
"styled-components": "^6.0.7"
|
|
52
|
-
},
|
|
53
|
-
"dependencies": {
|
|
54
|
-
"@dnd-kit/core": "^6.1.0",
|
|
55
|
-
"@floating-ui/react": "^0.26.16",
|
|
56
|
-
"@floating-ui/react-dom": "^2.1.0",
|
|
57
|
-
"@react-spring/web": "^10",
|
|
58
|
-
"date-fns": "^3.6.0",
|
|
59
|
-
"highlight.js": "^11.11.0",
|
|
60
|
-
"katex": "^0.16.10",
|
|
61
|
-
"marked": "^16.2.1",
|
|
62
|
-
"normalize.css": "^8.0.1",
|
|
63
|
-
"rc-slider": "^11.1.8",
|
|
64
|
-
"react-markdown": "^10.0.0",
|
|
65
|
-
"rehype-katex": "^7.0.0",
|
|
66
|
-
"remark-gfm": "^4.0.1",
|
|
67
|
-
"remark-math": "^6.0.0",
|
|
68
|
-
"tslib": "^2.6.2",
|
|
69
|
-
"unist-util-visit": "^5.0.0"
|
|
70
|
-
}
|
|
71
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@bothub-chat/ui",
|
|
3
|
+
"version": "2.55.1-develop-886f2f74-ef9d-4473-b65c-c49ebfc082ca",
|
|
4
|
+
"description": "Bothub UI Components",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"bot",
|
|
7
|
+
"chat",
|
|
8
|
+
"chatgpt",
|
|
9
|
+
"ai",
|
|
10
|
+
"react"
|
|
11
|
+
],
|
|
12
|
+
"repository": {
|
|
13
|
+
"url": "https://github.com/bothubchat/bothub.git",
|
|
14
|
+
"type": "git",
|
|
15
|
+
"directory": "./packages/ui"
|
|
16
|
+
},
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"access": "public",
|
|
19
|
+
"registry": "https://registry.npmjs.org/"
|
|
20
|
+
},
|
|
21
|
+
"author": "dev2alert <atmpotn@yandex.ru>",
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"homepage": "https://bothub.chat",
|
|
24
|
+
"files": [
|
|
25
|
+
"./dist",
|
|
26
|
+
"./fonts"
|
|
27
|
+
],
|
|
28
|
+
"type": "module",
|
|
29
|
+
"main": "./dist/index.js",
|
|
30
|
+
"module": "./dist/index.js",
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"exports": {
|
|
33
|
+
".": {
|
|
34
|
+
"types": "./dist/index.d.ts",
|
|
35
|
+
"import": "./dist/index.js",
|
|
36
|
+
"default": "./dist/index.js"
|
|
37
|
+
},
|
|
38
|
+
"./components/*": "./dist/components/*",
|
|
39
|
+
"./fonts/*": "./fonts/*",
|
|
40
|
+
"./utils/*": "./dist/utils/*"
|
|
41
|
+
},
|
|
42
|
+
"sideEffects": false,
|
|
43
|
+
"resolutions": {
|
|
44
|
+
"react-helmet/react": "^19.0.0"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"@uidotdev/usehooks": "^2.4.1",
|
|
48
|
+
"react": "19.1.1",
|
|
49
|
+
"react-dom": "19.1.1",
|
|
50
|
+
"react-helmet": ">=2",
|
|
51
|
+
"styled-components": "^6.0.7"
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"@dnd-kit/core": "^6.1.0",
|
|
55
|
+
"@floating-ui/react": "^0.26.16",
|
|
56
|
+
"@floating-ui/react-dom": "^2.1.0",
|
|
57
|
+
"@react-spring/web": "^10",
|
|
58
|
+
"date-fns": "^3.6.0",
|
|
59
|
+
"highlight.js": "^11.11.0",
|
|
60
|
+
"katex": "^0.16.10",
|
|
61
|
+
"marked": "^16.2.1",
|
|
62
|
+
"normalize.css": "^8.0.1",
|
|
63
|
+
"rc-slider": "^11.1.8",
|
|
64
|
+
"react-markdown": "^10.0.0",
|
|
65
|
+
"rehype-katex": "^7.0.0",
|
|
66
|
+
"remark-gfm": "^4.0.1",
|
|
67
|
+
"remark-math": "^6.0.0",
|
|
68
|
+
"tslib": "^2.6.2",
|
|
69
|
+
"unist-util-visit": "^5.0.0"
|
|
70
|
+
}
|
|
71
|
+
}
|