@e-llm-studio/citation 0.0.197 → 0.0.198
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -0
- package/dist/cjs/features/ChatDrawer/ChatDrawer.js +1 -1
- package/dist/features/ChatDrawer/ChatDrawer.js +1 -1
- package/dist/types/src/AutopilotStyle.d.ts +2 -0
- package/dist/types/src/AutopilotStyle.d.ts.map +1 -0
- package/dist/types/src/ChatDrawerTest.d.ts +6 -0
- package/dist/types/src/ChatDrawerTest.d.ts.map +1 -1
- package/dist/types/src/features/ChatDrawer/ChatDrawer.d.ts.map +1 -1
- package/dist/types/src/features/ChatDrawer/types/ChatDrawer.types.d.ts +1 -0
- package/dist/types/src/features/ChatDrawer/types/ChatDrawer.types.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -320,6 +320,22 @@ const [drawerHeight, setDrawerHeight] = useState(300);
|
|
|
320
320
|
</ChatDrawer>
|
|
321
321
|
```
|
|
322
322
|
|
|
323
|
+
### With drawer header component prop
|
|
324
|
+
```tsx
|
|
325
|
+
<ChatDrawer
|
|
326
|
+
uploadListTopContent="Custom Notch"
|
|
327
|
+
isExpanded={isOpen}
|
|
328
|
+
onToggle={() => setIsOpen(v => !v)}
|
|
329
|
+
styles={{
|
|
330
|
+
notch: { backgroundColor: '#6d28d9', border: '1px solid #5b21b6' },
|
|
331
|
+
notchArrowColor: '#fff',
|
|
332
|
+
}}
|
|
333
|
+
headerComponent={<AutopilotIndicator />}
|
|
334
|
+
>
|
|
335
|
+
<YourComponent />
|
|
336
|
+
</ChatDrawer>
|
|
337
|
+
```
|
|
338
|
+
|
|
323
339
|
**With styles (theme customization):**
|
|
324
340
|
```tsx
|
|
325
341
|
<ChatDrawer
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),i=require("lucide-react");exports.default=function(o){var r,s,a=o.children,l=o.uploadListTopContent,d=o.defaultHeight,u=void 0===d?300:d,c=o.minHeight,p=void 0===c?150:c,g=o.maxHeight,f=o.isExpanded,x=void 0!==f&&f,h=o.onToggle,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),i=require("lucide-react");exports.default=function(o){var r,s,a=o.children,l=o.uploadListTopContent,d=o.defaultHeight,u=void 0===d?300:d,c=o.minHeight,p=void 0===c?150:c,g=o.maxHeight,f=o.isExpanded,x=void 0!==f&&f,h=o.onToggle,m=o.onHeightChange,v=o.styles,y=void 0===v?{}:v,_=o.drawerSummaryComponent,b=o.totalCountsBadge,w=o.headerComponent,C=n.useState(!1),j=C[0],H=C[1],S=n.useState(u),R=S[0],E=S[1],k=n.useRef(0),B=n.useRef(u),D=n.useRef(null),I=n.useRef(0),L="string"==typeof g?parseFloat(g)/100*window.innerHeight:null!=g?g:.4*window.innerHeight;n.useEffect(function(){!x&&D.current&&(I.current=D.current.getBoundingClientRect().height)},[x]);return n.useEffect(function(){if(j){var e=function(e){e.preventDefault();var t=e.clientY-k.current,n=Math.max(p,Math.min(L,B.current+t));E(n),null==m||m(n)},t=function(){H(!1),document.body.style.userSelect=""};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),function(){document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}}},[j]),t.jsxs("div",e.__assign({ref:D,style:{position:"relative",width:"100%",minHeight:x?I.current:"auto"}},{children:[t.jsxs("div",e.__assign({style:e.__assign({position:x?"absolute":"relative",zIndex:x?10:"auto",left:0,right:0,top:0,display:"flex",flexDirection:"column",backgroundColor:"#fff",borderRadius:20,border:"1px solid #BDB4FE",boxShadow:"0 4px 8px -2px rgba(16, 24, 40, 0.05), 0 2px 4px -2px rgba(16, 24, 40, 0.06)",height:x?"".concat(R,"px"):"auto",minHeight:x?"".concat(p,"px"):"auto",maxHeight:x?"".concat(R,"px"):"auto",overflow:"hidden",width:"100%"},y.container)},{children:[t.jsxs("div",e.__assign({style:e.__assign({display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",marginBottom:12,flexShrink:0,padding:"12px 20px 0 20px",gap:"16px"},y.header)},{children:[t.jsx("span",e.__assign({style:e.__assign({display:"inline-block",flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:16,fontWeight:500,lineHeight:"24px",color:"#101828",fontFamily:"Inter, sans-serif"},y.title)},{children:w||((null==l?void 0:l.trim())?l:"Data uploaded for your context")})),b]})),_,x&&t.jsx("div",e.__assign({style:e.__assign({flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,padding:"0 20px"},y.body)},{children:a})),x&&t.jsx("div",e.__assign({onMouseDown:function(e){e.preventDefault(),H(!0),k.current=e.clientY,B.current=R,document.body.style.userSelect="none"},style:{display:"flex",justifyContent:"center",alignItems:"center",padding:"8px 20px",cursor:"ns-resize",userSelect:"none",flexShrink:0}},{children:t.jsx("div",{style:e.__assign({width:48,height:4,borderRadius:4,background:j?null!==(r=y.dragPillActiveColor)&&void 0!==r?r:"#a78bfa":"#d1d5db"},y.dragPill)})}))]})),t.jsx("div",e.__assign({style:{position:x?"absolute":"relative",top:x?"".concat(R,"px"):"auto",width:"100%",display:"flex",justifyContent:"center",height:18,zIndex:x?10:"auto"}},{children:t.jsx("button",e.__assign({onClick:h,"aria-label":x?"Collapse":"Expand",style:e.__assign({position:"absolute",width:"52px",height:"18px",borderBottomLeftRadius:"10px",borderBottomRightRadius:"10px",border:"1px solid rgb(189, 180, 254)",borderTop:"none",backgroundColor:"#fff",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",padding:0},y.notch)},{children:t.jsx(i.ChevronDown,{size:14,color:null!==(s=y.notchArrowColor)&&void 0!==s?s:"#6d28d9",style:{transform:x?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"}})}))}))]}))};
|
|
2
2
|
//# sourceMappingURL=ChatDrawer.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsxs as t,jsx as o}from"react/jsx-runtime";import{useState as n,useRef as i,useEffect as r}from"react";import{ChevronDown as l}from"lucide-react";var d=function(d){var a,s,u=d.children,c=d.uploadListTopContent,p=d.defaultHeight,f=void 0===p?300:p,h=d.minHeight,m=void 0===h?150:h,x=d.maxHeight,g=d.isExpanded,v=void 0!==g&&g,y=d.onToggle,b=d.onHeightChange,w=d.styles,C=void 0===w?{}:w,H=d.drawerSummaryComponent,S=d.totalCountsBadge,k=n(!1),B
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as t,jsx as o}from"react/jsx-runtime";import{useState as n,useRef as i,useEffect as r}from"react";import{ChevronDown as l}from"lucide-react";var d=function(d){var a,s,u=d.children,c=d.uploadListTopContent,p=d.defaultHeight,f=void 0===p?300:p,h=d.minHeight,m=void 0===h?150:h,x=d.maxHeight,g=d.isExpanded,v=void 0!==g&&g,y=d.onToggle,b=d.onHeightChange,w=d.styles,C=void 0===w?{}:w,H=d.drawerSummaryComponent,S=d.totalCountsBadge,k=d.headerComponent,B=n(!1),E=B[0],D=B[1],I=n(f),L=I[0],R=I[1],j=i(0),z=i(f),F=i(null),M=i(0),T="string"==typeof x?parseFloat(x)/100*window.innerHeight:null!=x?x:.4*window.innerHeight;r(function(){!v&&F.current&&(M.current=F.current.getBoundingClientRect().height)},[v]);return r(function(){if(E){var e=function(e){e.preventDefault();var t=e.clientY-j.current,o=Math.max(m,Math.min(T,z.current+t));R(o),null==b||b(o)},t=function(){D(!1),document.body.style.userSelect=""};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),function(){document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}}},[E]),t("div",e({ref:F,style:{position:"relative",width:"100%",minHeight:v?M.current:"auto"}},{children:[t("div",e({style:e({position:v?"absolute":"relative",zIndex:v?10:"auto",left:0,right:0,top:0,display:"flex",flexDirection:"column",backgroundColor:"#fff",borderRadius:20,border:"1px solid #BDB4FE",boxShadow:"0 4px 8px -2px rgba(16, 24, 40, 0.05), 0 2px 4px -2px rgba(16, 24, 40, 0.06)",height:v?"".concat(L,"px"):"auto",minHeight:v?"".concat(m,"px"):"auto",maxHeight:v?"".concat(L,"px"):"auto",overflow:"hidden",width:"100%"},C.container)},{children:[t("div",e({style:e({display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",marginBottom:12,flexShrink:0,padding:"12px 20px 0 20px",gap:"16px"},C.header)},{children:[o("span",e({style:e({display:"inline-block",flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:16,fontWeight:500,lineHeight:"24px",color:"#101828",fontFamily:"Inter, sans-serif"},C.title)},{children:k||((null==c?void 0:c.trim())?c:"Data uploaded for your context")})),S]})),H,v&&o("div",e({style:e({flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,padding:"0 20px"},C.body)},{children:u})),v&&o("div",e({onMouseDown:function(e){e.preventDefault(),D(!0),j.current=e.clientY,z.current=L,document.body.style.userSelect="none"},style:{display:"flex",justifyContent:"center",alignItems:"center",padding:"8px 20px",cursor:"ns-resize",userSelect:"none",flexShrink:0}},{children:o("div",{style:e({width:48,height:4,borderRadius:4,background:E?null!==(a=C.dragPillActiveColor)&&void 0!==a?a:"#a78bfa":"#d1d5db"},C.dragPill)})}))]})),o("div",e({style:{position:v?"absolute":"relative",top:v?"".concat(L,"px"):"auto",width:"100%",display:"flex",justifyContent:"center",height:18,zIndex:v?10:"auto"}},{children:o("button",e({onClick:y,"aria-label":v?"Collapse":"Expand",style:e({position:"absolute",width:"52px",height:"18px",borderBottomLeftRadius:"10px",borderBottomRightRadius:"10px",border:"1px solid rgb(189, 180, 254)",borderTop:"none",backgroundColor:"#fff",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",padding:0},C.notch)},{children:o(l,{size:14,color:null!==(s=C.notchArrowColor)&&void 0!==s?s:"#6d28d9",style:{transform:v?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"}})}))}))]}))};export{d as default};
|
|
2
2
|
//# sourceMappingURL=ChatDrawer.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const autopilotStyles = "\n @keyframes shimmerSweep {\n 0% { background-position: -200% center; }\n 100% { background-position: 200% center; }\n }\n\n @keyframes dotGrow {\n 0%, 100% { transform: scale(0.3); opacity: 0.2; }\n 50% { transform: scale(1); opacity: 1; }\n }\n\n .autopilot-glow-text {\n background: linear-gradient(90deg, #6d28d9 0%, #a78bfa 30%, #c4b5fd 50%, #a78bfa 70%, #6d28d9 100%);\n background-size: 200% auto;\n -webkit-background-clip: text;\n -webkit-text-fill-color: transparent;\n background-clip: text;\n animation: shimmerSweep 2s linear infinite;\n }\n\n .autopilot-dot {\n display: inline-block;\n width: 5px;\n height: 5px;\n border-radius: 50%;\n background-color: #7c3aed;\n transform: scale(0.3);\n opacity: 0.2;\n }\n\n .autopilot-dot:nth-child(1) { animation: dotGrow 1.2s ease-in-out infinite; animation-delay: 0s; }\n .autopilot-dot:nth-child(2) { animation: dotGrow 1.2s ease-in-out infinite; animation-delay: 0.4s; }\n .autopilot-dot:nth-child(3) { animation: dotGrow 1.2s ease-in-out infinite; animation-delay: 0.8s; }\n";
|
|
2
|
+
//# sourceMappingURL=AutopilotStyle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AutopilotStyle.d.ts","sourceRoot":"","sources":["../../../src/AutopilotStyle.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,ylCAiC3B,CAAC"}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
interface AutopilotIndicatorProps {
|
|
3
|
+
label?: string;
|
|
4
|
+
AIlabel?: string;
|
|
5
|
+
style?: React.CSSProperties;
|
|
6
|
+
}
|
|
7
|
+
export declare const AutopilotIndicator: React.FC<AutopilotIndicatorProps>;
|
|
2
8
|
interface RedliningSummaryProps {
|
|
3
9
|
approved: number;
|
|
4
10
|
rejected: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatDrawerTest.d.ts","sourceRoot":"","sources":["../../../src/ChatDrawerTest.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ChatDrawerTest.d.ts","sourceRoot":"","sources":["../../../src/ChatDrawerTest.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,UAAU,uBAAuB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CA2BhE,CAAC;AAGF,UAAU,qBAAqB;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,uBAAuB,oCAAqC,qBAAqB,4CAiE7F,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,GAAG,CAsB1C,CAAC;AA8CF,MAAM,CAAC,OAAO,UAAU,cAAc,4CAsCrC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatDrawer.d.ts","sourceRoot":"","sources":["../../../../../src/features/ChatDrawer/ChatDrawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,
|
|
1
|
+
{"version":3,"file":"ChatDrawer.d.ts","sourceRoot":"","sources":["../../../../../src/features/ChatDrawer/ChatDrawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAoMzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -28,6 +28,7 @@ export interface ChatDrawerProps {
|
|
|
28
28
|
*/
|
|
29
29
|
drawerSummaryComponent?: React.ReactNode;
|
|
30
30
|
totalCountsBadge?: React.ReactNode;
|
|
31
|
+
headerComponent?: React.ReactNode;
|
|
31
32
|
styles?: {
|
|
32
33
|
/** Outer container — background, border, borderRadius, boxShadow */
|
|
33
34
|
container?: CSSProperties;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatDrawer.types.d.ts","sourceRoot":"","sources":["../../../../../../src/features/ChatDrawer/types/ChatDrawer.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEjD,MAAM,WAAW,eAAe;IAC9B,mGAAmG;IACnG,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,oEAAoE;IACpE,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,uDAAuD;IACvD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,4BAA4B;IAC5B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,sBAAsB;IACtB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,iEAAiE;IACjE,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAK1C,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"ChatDrawer.types.d.ts","sourceRoot":"","sources":["../../../../../../src/features/ChatDrawer/types/ChatDrawer.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEjD,MAAM,WAAW,eAAe;IAC9B,mGAAmG;IACnG,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,oEAAoE;IACpE,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,uDAAuD;IACvD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,4BAA4B;IAC5B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,sBAAsB;IACtB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,iEAAiE;IACjE,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAK1C,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAKpC,eAAe,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAMhC,MAAM,CAAC,EAAE;QACP,oEAAoE;QACpE,SAAS,CAAC,EAAE,aAAa,CAAC;QAC1B,sDAAsD;QACtD,MAAM,CAAC,EAAE,aAAa,CAAC;QACvB,sDAAsD;QACtD,KAAK,CAAC,EAAE,aAAa,CAAC;QACtB,oDAAoD;QACpD,IAAI,CAAC,EAAE,aAAa,CAAC;QACrB,0CAA0C;QAC1C,QAAQ,CAAC,EAAE,aAAa,CAAC;QACzB,qEAAqE;QACrE,KAAK,CAAC,EAAE,aAAa,CAAC;QACtB,6DAA6D;QAC7D,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,gEAAgE;QAChE,mBAAmB,CAAC,EAAE,MAAM,CAAC;KAC9B,CAAC;CACH"}
|