@e-llm-studio/citation 0.0.196 → 0.0.197
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 +33 -0
- package/dist/cjs/features/ChatDrawer/ChatDrawer.js +1 -1
- package/dist/features/ChatDrawer/ChatDrawer.js +1 -1
- package/dist/types/src/ChatDrawerTest.d.ts +9 -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 +2 -0
- package/dist/types/src/features/ChatDrawer/types/ChatDrawer.types.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -287,6 +287,39 @@ const [drawerHeight, setDrawerHeight] = useState(300);
|
|
|
287
287
|
</ChatDrawer>
|
|
288
288
|
```
|
|
289
289
|
|
|
290
|
+
|
|
291
|
+
### With drawer summary
|
|
292
|
+
```tsx
|
|
293
|
+
<ChatDrawer
|
|
294
|
+
uploadListTopContent="Custom Notch"
|
|
295
|
+
isExpanded={isOpen}
|
|
296
|
+
onToggle={() => setIsOpen(v => !v)}
|
|
297
|
+
styles={{
|
|
298
|
+
notch: { backgroundColor: '#6d28d9', border: '1px solid #5b21b6' },
|
|
299
|
+
notchArrowColor: '#fff',
|
|
300
|
+
}}
|
|
301
|
+
drawerSummaryComponent={<RedliningFixesSummaryUI approved={5} rejected={2} pending={3} />}
|
|
302
|
+
>
|
|
303
|
+
<YourComponent />
|
|
304
|
+
</ChatDrawer>
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
### With drawer countBadge
|
|
308
|
+
```tsx
|
|
309
|
+
<ChatDrawer
|
|
310
|
+
uploadListTopContent="Custom Notch"
|
|
311
|
+
isExpanded={isOpen}
|
|
312
|
+
onToggle={() => setIsOpen(v => !v)}
|
|
313
|
+
styles={{
|
|
314
|
+
notch: { backgroundColor: '#6d28d9', border: '1px solid #5b21b6' },
|
|
315
|
+
notchArrowColor: '#fff',
|
|
316
|
+
}}
|
|
317
|
+
totalCountsBadge={<TotalCountsBadge totalDeviations={10} resolvedDeviations={7} />}
|
|
318
|
+
>
|
|
319
|
+
<YourComponent />
|
|
320
|
+
</ChatDrawer>
|
|
321
|
+
```
|
|
322
|
+
|
|
290
323
|
**With styles (theme customization):**
|
|
291
324
|
```tsx
|
|
292
325
|
<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,v=o.onHeightChange,m=o.styles,
|
|
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,v=o.onHeightChange,m=o.styles,y=void 0===m?{}:m,_=o.drawerSummaryComponent,b=o.totalCountsBadge,w=n.useState(!1),j=w[0],C=w[1],H=n.useState(u),S=H[0],R=H[1],E=n.useRef(0),k=n.useRef(u),B=n.useRef(null),D=n.useRef(0),I="string"==typeof g?parseFloat(g)/100*window.innerHeight:null!=g?g:.4*window.innerHeight;n.useEffect(function(){!x&&B.current&&(D.current=B.current.getBoundingClientRect().height)},[x]);return n.useEffect(function(){if(j){var e=function(e){e.preventDefault();var t=e.clientY-E.current,n=Math.max(p,Math.min(I,k.current+t));R(n),null==v||v(n)},t=function(){C(!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:B,style:{position:"relative",width:"100%",minHeight:x?D.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(S,"px"):"auto",minHeight:x?"".concat(p,"px"):"auto",maxHeight:x?"".concat(S,"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:(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(),C(!0),E.current=e.clientY,k.current=S,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(S,"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,
|
|
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=k[0],E=k[1],D=n(f),I=D[0],L=D[1],R=i(0),j=i(f),z=i(null),F=i(0),M="string"==typeof x?parseFloat(x)/100*window.innerHeight:null!=x?x:.4*window.innerHeight;r(function(){!v&&z.current&&(F.current=z.current.getBoundingClientRect().height)},[v]);return r(function(){if(B){var e=function(e){e.preventDefault();var t=e.clientY-R.current,o=Math.max(m,Math.min(M,j.current+t));L(o),null==b||b(o)},t=function(){E(!1),document.body.style.userSelect=""};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),function(){document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}}},[B]),t("div",e({ref:z,style:{position:"relative",width:"100%",minHeight:v?F.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(I,"px"):"auto",minHeight:v?"".concat(m,"px"):"auto",maxHeight:v?"".concat(I,"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:(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(),E(!0),R.current=e.clientY,j.current=I,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:B?null!==(a=C.dragPillActiveColor)&&void 0!==a?a:"#a78bfa":"#d1d5db"},C.dragPill)})}))]})),o("div",e({style:{position:v?"absolute":"relative",top:v?"".concat(I,"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
|
|
@@ -1,2 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface RedliningSummaryProps {
|
|
3
|
+
approved: number;
|
|
4
|
+
rejected: number;
|
|
5
|
+
pending: number;
|
|
6
|
+
}
|
|
7
|
+
export declare const RedliningFixesSummaryUI: ({ approved, rejected, pending }: RedliningSummaryProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const TotalCountsBadge: React.FC<any>;
|
|
1
9
|
export default function ChatDrawerTest(): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
2
11
|
//# sourceMappingURL=ChatDrawerTest.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatDrawerTest.d.ts","sourceRoot":"","sources":["../../../src/ChatDrawerTest.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChatDrawerTest.d.ts","sourceRoot":"","sources":["../../../src/ChatDrawerTest.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,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,CAgB1C,CAAC;AA8CF,MAAM,CAAC,OAAO,UAAU,cAAc,4CAqCrC"}
|
|
@@ -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,CAmMzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -26,6 +26,8 @@ export interface ChatDrawerProps {
|
|
|
26
26
|
* Lets consuming teams customize colors, borders, and backgrounds
|
|
27
27
|
* without touching the component internals.
|
|
28
28
|
*/
|
|
29
|
+
drawerSummaryComponent?: React.ReactNode;
|
|
30
|
+
totalCountsBadge?: React.ReactNode;
|
|
29
31
|
styles?: {
|
|
30
32
|
/** Outer container — background, border, borderRadius, boxShadow */
|
|
31
33
|
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,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"}
|
|
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;IAKlC,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"}
|