@e-llm-studio/citation 0.0.161 → 0.0.162
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 +20 -2
- package/dist/cjs/features/ChatDrawer/ChatDrawer.js +1 -1
- package/dist/cjs/features/PdfViewer/usePdfHighlight.js +1 -1
- package/dist/features/ChatDrawer/ChatDrawer.js +1 -1
- package/dist/features/PdfViewer/usePdfHighlight.js +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 +18 -1
- package/dist/types/src/features/ChatDrawer/types/ChatDrawer.types.d.ts.map +1 -1
- package/dist/types/src/features/PdfViewer/usePdfHighlight.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
- [CognitiveDecisioningCard](#cognitivedecisioningcard) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/CognitiveDecisioning/CognitiveDecisioningReadme.md)
|
|
15
15
|
- [CognitiveInternalGPTReasoning](#cognitiveinternalgptreasoning) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/CognitiveInternalgptReasoning/README.md)
|
|
16
16
|
- [CodeCitation](#codecitation) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/CodeCitation/README.md)
|
|
17
|
-
- [ChatDrawer](#chatdrawer) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/
|
|
17
|
+
- [ChatDrawer](#chatdrawer) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/ChatDrawer/ChatDrawerReadme.md)
|
|
18
18
|
- [CitationsViewer](#citationsviewer) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/CitationViewer/CitationViewerReadme.md)
|
|
19
19
|
- [PdfEditorCitation](#pdfeditorcitation) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/PdfEditorCitation/README.md)
|
|
20
20
|
- [RequirementAICitation](#requirementaicitation) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/RequirementAiCitations/RequirementAiCitationsReadme.md)
|
|
@@ -236,7 +236,6 @@ import ChatCitation from '@e-llm-studio/citation/ChatCitation'
|
|
|
236
236
|
---
|
|
237
237
|
|
|
238
238
|
|
|
239
|
-
|
|
240
239
|
## ChatDrawer
|
|
241
240
|
|
|
242
241
|
### Overview
|
|
@@ -250,6 +249,7 @@ ChatDrawer is a generic, resizable drawer component for rendering collapsible pa
|
|
|
250
249
|
- **Configurable height** — `defaultHeight`, `minHeight`, `maxHeight` all exposed as props
|
|
251
250
|
- **Chevron toggle** — Rotates 180° when open, standard drawer UX
|
|
252
251
|
- **Consumer-owned content** — Zero opinion on what goes inside, pass any React node
|
|
252
|
+
- **Deep style overrides** — Every visual region customizable via the `styles` prop
|
|
253
253
|
- **Inline styles only** — No Tailwind or MUI dependency, works in any consuming app
|
|
254
254
|
|
|
255
255
|
### Usage
|
|
@@ -285,6 +285,23 @@ const [drawerHeight, setDrawerHeight] = useState(300);
|
|
|
285
285
|
</ChatDrawer>
|
|
286
286
|
```
|
|
287
287
|
|
|
288
|
+
**With styles (theme customization):**
|
|
289
|
+
```tsx
|
|
290
|
+
<ChatDrawer
|
|
291
|
+
uploadListTopContent="Dark Panel"
|
|
292
|
+
isExpanded={isOpen}
|
|
293
|
+
onToggle={() => setIsOpen(v => !v)}
|
|
294
|
+
styles={{
|
|
295
|
+
container: { backgroundColor: '#1a1a2e', border: '1px solid #444' },
|
|
296
|
+
header: { backgroundColor: '#1a1a2e' },
|
|
297
|
+
title: { color: '#fff' },
|
|
298
|
+
body: { backgroundColor: '#1a1a2e' },
|
|
299
|
+
}}
|
|
300
|
+
>
|
|
301
|
+
<YourComponent />
|
|
302
|
+
</ChatDrawer>
|
|
303
|
+
```
|
|
304
|
+
|
|
288
305
|
### Props
|
|
289
306
|
|
|
290
307
|
| Prop | Type | Required | Description |
|
|
@@ -297,6 +314,7 @@ const [drawerHeight, setDrawerHeight] = useState(300);
|
|
|
297
314
|
| `minHeight` | `number` | ❌ | Minimum height in px when drag-resizing. Defaults to `150`. |
|
|
298
315
|
| `maxHeight` | `number \| string` | ❌ | Maximum height when drag-resizing. Accepts a px number or a CSS string like `"70vh"`. Defaults to `40vh`. |
|
|
299
316
|
| `onHeightChange` | `(height: number) => void` | ❌ | Fired on every drag tick with the current height in px. Useful when a sibling layout needs to react to height changes. |
|
|
317
|
+
| `styles` | `ChatDrawerStyles` | ❌ | Style overrides for each visual region. Keys: `container`, `header`, `title`, `body`, `dragPill`. Each accepts any valid `CSSProperties`. |
|
|
300
318
|
|
|
301
319
|
---
|
|
302
320
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),i=require("lucide-react");exports.default=function(r){var o=r.children,s=r.uploadListTopContent,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),i=require("lucide-react");exports.default=function(r){var o=r.children,s=r.uploadListTopContent,a=r.defaultHeight,d=void 0===a?300:a,l=r.minHeight,u=void 0===l?150:l,c=r.maxHeight,g=r.isExpanded,p=void 0!==g&&g,x=r.onToggle,f=r.onHeightChange,h=r.styles,m=void 0===h?{}:h,v=t.useState(!1),_=v[0],y=v[1],b=t.useState(d),w=b[0],j=b[1],H=t.useRef(0),S=t.useRef(d),k="string"==typeof c?parseFloat(c)/100*window.innerHeight:null!=c?c:.4*window.innerHeight;return t.useEffect(function(){if(_){var e=function(e){e.preventDefault();var n=e.clientY-H.current,t=Math.max(u,Math.min(k,S.current+n));j(t),null==f||f(t)},n=function(){y(!1),document.body.style.userSelect=""};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",n),function(){document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",n)}}},[_]),n.jsxs("div",e.__assign({style:e.__assign({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:p?"".concat(w,"px"):"auto",minHeight:p?"".concat(u,"px"):"auto",maxHeight:p?"".concat(w,"px"):"auto",overflow:"hidden",width:"100%"},m.container)},{children:[n.jsx("div",e.__assign({style:e.__assign({display:"flex",alignItems:"center",width:"100%",marginBottom:12,flexShrink:0,padding:"12px 20px 0 20px"},m.header)},{children:n.jsxs("button",e.__assign({onClick:x,style:{display:"flex",alignItems:"center",gap:8,background:"none",border:"none",cursor:"pointer",padding:0}},{children:[n.jsx("span",e.__assign({style:e.__assign({display:"inline-block",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:16,fontWeight:500,lineHeight:"24px",color:"#101828",fontFamily:"Inter, sans-serif"},m.title)},{children:(null==s?void 0:s.trim())?s:"Data uploaded for your context"})),n.jsx("span",e.__assign({style:{display:"flex",alignItems:"center",width:16,height:16,transform:p?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s"}},{children:n.jsx(i.ChevronDown,{})}))]}))})),p&&n.jsx("div",e.__assign({style:e.__assign({flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,padding:"0 20px"},m.body)},{children:o})),p&&n.jsx("div",e.__assign({onMouseDown:function(e){e.preventDefault(),y(!0),H.current=e.clientY,S.current=w,document.body.style.userSelect="none"},style:{display:"flex",justifyContent:"center",alignItems:"center",padding:"8px 20px",cursor:"ns-resize",userSelect:"none",flexShrink:0}},{children:n.jsx("div",{style:e.__assign({width:48,height:4,borderRadius:4,background:_?"#a78bfa":"#d1d5db"},m.dragPill)})}))]}))};
|
|
2
2
|
//# sourceMappingURL=ChatDrawer.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@react-pdf-viewer/search"),r=require("@react-pdf-viewer/page-navigation"),n=require("@react-pdf-viewer/zoom");exports.PdfHighlightControls=function(i,o,a
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@react-pdf-viewer/search"),r=require("@react-pdf-viewer/page-navigation"),n=require("@react-pdf-viewer/zoom");exports.PdfHighlightControls=function(i,o,u,a){var c=e.useState(0),l=c[0],s=c[1],h=e.useRef(!1),g=e.useState(0),f=g[0],p=g[1],v=function(e){if(!e)return[];return e.replace(/\]\s*\n\s*\(/g,"](").split(/\n+/).map(function(e){var t=e.trim(),r=(t=(t=t.replace(/[\u200B-\u200D\uFEFF]/g,"").replace(/[\u00A0\u2009\u202F]/g," ")).replace(/^[-•]\s+/,"")).match(/^((\d+(?:\.\d+)*[.)]?)|[A-Za-z][.)]|\([A-Za-z0-9]+\)|(?:i|ii|iii|iv|v|vi|vii|viii|ix|x)[.)])\s*/i);return r?t.slice(r[0].length).trim():t}).flatMap(function(e){var t=e.match(/^\s*\|(.+)\|\s*$/);return t?t[1].split("|").map(function(e){return e.trim()}).filter(Boolean):[e]}).map(function(e){return e.replace(/&[#\w]+;/g,function(e){return t=e,(r=document.createElement("textarea")).innerHTML=t,r.value;var t,r}).replace(/<br\s*\/?>/gi,"\n").replace(/\[([^\]]+)\]\(([^)]+)\)/g,"$1").replace(/[^\S\n]+/g," ").trim()}).flatMap(function(e){return e.split(/\n+/)}).flatMap(function(e){for(var t,r=[],n=/([*_]{1,3})([^*_]+)\1|([*_]{1,3})/g,i=0;null!==(t=n.exec(e));){var o=e.slice(i,t.index).trim();o&&r.push(o),t[2]&&r.push(t[2].trim()),i=t.index+t[0].length}var u=e.slice(i).trim();return u&&r.push(u),r.flatMap(function(e){return e.split(/[\u2013\u2014-]/g)}).flatMap(function(e){return e.split(/\n+/)}).map(function(e){return e.replace(/[*_]+/g,"").replace(/`([^`]+)`/g,"$1").replace(/[^\S\n]+/g," ").trim()})})},d=Object.keys(o).map(Number).sort(function(e,t){return e-t}),m=Object.values(o).filter(function(e){return e>0}).length,y=function(e){if(u.current){var t=u.current.querySelectorAll(".rpv-search__highlights"),r=new Set,n=new Set;t.forEach(function(t){var i=t.getAttribute("data-testid"),o=parseInt((null==i?void 0:i.replace("search__highlights-",""))||"-1"),u=t.querySelectorAll(".rpv-search__highlight");if(o===e){var a=new Set;u.forEach(function(e){var t=e,i=(t.getAttribute("title")||"").toLowerCase(),o=t.style.top,u="".concat(i,"_").concat(o);r.has(u)?t.style.display=a.has(u)?"none":"":(r.add(u),n.has(i)?(a.add(u),t.style.display="none"):(n.add(i),t.style.display=""))})}})}},_=function(e){u.current&&u.current.querySelectorAll(".rpv-search__highlights").forEach(function(t){var r=t.getAttribute("data-testid"),n=parseInt((null==r?void 0:r.replace(/search__highlights-/g,""))||"-1"),i=t.querySelectorAll(".rpv-search__highlight");e.has(n)||i.forEach(function(e){e.style.display="none"})})},T=i.map(function(e){return v(e)}).flat();console.log("[debug: PDF highlight text]",i,T);var x=t.searchPlugin({keyword:T}),S=r.pageNavigationPlugin(),b=n.zoomPlugin(),q=x.jumpToMatch,A=S.jumpToPage,P=b.zoomTo,j=b.ZoomInButton,w=b.ZoomOutButton,M=b.ZoomPopover,B=function(){if(!h.current)try{q(0),h.current=!0}catch(e){requestAnimationFrame(B)}},I=function(e,t){if(u.current&&u.current.querySelector(".rpv-core__viewer")){var r=-1,n=function(){var i,o,a=null===(i=u.current)||void 0===i?void 0:i.querySelector(".rpv-core__inner-pages");if(a){if(a.scrollTop!==r)return r=a.scrollTop,void setTimeout(n,100);var c=null===(o=u.current)||void 0===o?void 0:o.querySelector('[data-testid="core__page-layer-'.concat(e,'"]'));if(c){var l=c.querySelectorAll(".rpv-search__highlight")[t];if(l){var s=a.getBoundingClientRect(),h=l.getBoundingClientRect(),g=a.scrollTop+(h.top-s.top)-a.clientHeight/2+h.height/2;a.scrollTo({top:g,behavior:"smooth"})}}}};setTimeout(n,300)}},O=e.useMemo(function(){var e={};return d.forEach(function(t,r){var n=o[t];n>0&&(e[n]||(e[n]=[]),e[n].push(r))}),e},[d,o]),Z=function(e){var t=o[d[e]];return(O[t]||[]).indexOf(e)};return{setHighlightIndex:s,highlightIndex:l,cursorIndex:f,setCursorIndex:p,orderedKeys:d,totalHighlights:m,getValidPosition:function(e){for(var t=0,r=0;r<=e;r++){var n=d[r];o[n]>0&&t++}return t},tryJump:B,jumpToPage:A,zoomTo:P,hideNonTargetHighlights:_,deduplicateHighlights:y,plugins:[x,S,b],controls:{ZoomInButton:j,ZoomOutButton:w,ZoomPopover:M,goToNext:function(){for(var e=function(e){var t=d[e];if(o[t]>0){var r=o[t]-1,n=Z(e);return p(e),A(o[t]-1),I(r,n),setTimeout(function(){y(r)},500),1===Object.keys(o).length&&_(a),{value:void 0}}},t=f+1;t<d.length;t++){var r=e(t);if("object"==typeof r)return r.value}},goToPrevious:function(){for(var e=function(e){var t=d[e];if(o[t]>0){var r=o[t]-1,n=Z(e);return p(e),A(o[t]-1),I(r,n),setTimeout(function(){y(r)},500),1===Object.keys(o).length&&_(a),{value:void 0}}},t=f-1;t>=0;t--){var r=e(t);if("object"==typeof r)return r.value}}}}};
|
|
2
2
|
//# sourceMappingURL=usePdfHighlight.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsxs as t,jsx as n}from"react/jsx-runtime";import{useState as i,useRef as o,useEffect as r}from"react";import{ChevronDown as d}from"lucide-react";var l=function(l){var a=l.children,s=l.uploadListTopContent,c=l.defaultHeight,u=void 0===c?300:c,p=l.minHeight,f=void 0===p?150:p,m=l.maxHeight,h=l.isExpanded,
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as t,jsx as n}from"react/jsx-runtime";import{useState as i,useRef as o,useEffect as r}from"react";import{ChevronDown as d}from"lucide-react";var l=function(l){var a=l.children,s=l.uploadListTopContent,c=l.defaultHeight,u=void 0===c?300:c,p=l.minHeight,f=void 0===p?150:p,m=l.maxHeight,h=l.isExpanded,g=void 0!==h&&h,x=l.onToggle,v=l.onHeightChange,y=l.styles,b=void 0===y?{}:y,w=i(!1),H=w[0],S=w[1],k=i(u),D=k[0],E=k[1],C=o(0),I=o(u),L="string"==typeof m?parseFloat(m)/100*window.innerHeight:null!=m?m:.4*window.innerHeight;return r(function(){if(H){var e=function(e){e.preventDefault();var t=e.clientY-C.current,n=Math.max(f,Math.min(L,I.current+t));E(n),null==v||v(n)},t=function(){S(!1),document.body.style.userSelect=""};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),function(){document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}}},[H]),t("div",e({style:e({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:g?"".concat(D,"px"):"auto",minHeight:g?"".concat(f,"px"):"auto",maxHeight:g?"".concat(D,"px"):"auto",overflow:"hidden",width:"100%"},b.container)},{children:[n("div",e({style:e({display:"flex",alignItems:"center",width:"100%",marginBottom:12,flexShrink:0,padding:"12px 20px 0 20px"},b.header)},{children:t("button",e({onClick:x,style:{display:"flex",alignItems:"center",gap:8,background:"none",border:"none",cursor:"pointer",padding:0}},{children:[n("span",e({style:e({display:"inline-block",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:16,fontWeight:500,lineHeight:"24px",color:"#101828",fontFamily:"Inter, sans-serif"},b.title)},{children:(null==s?void 0:s.trim())?s:"Data uploaded for your context"})),n("span",e({style:{display:"flex",alignItems:"center",width:16,height:16,transform:g?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s"}},{children:n(d,{})}))]}))})),g&&n("div",e({style:e({flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,padding:"0 20px"},b.body)},{children:a})),g&&n("div",e({onMouseDown:function(e){e.preventDefault(),S(!0),C.current=e.clientY,I.current=D,document.body.style.userSelect="none"},style:{display:"flex",justifyContent:"center",alignItems:"center",padding:"8px 20px",cursor:"ns-resize",userSelect:"none",flexShrink:0}},{children:n("div",{style:e({width:48,height:4,borderRadius:4,background:H?"#a78bfa":"#d1d5db"},b.dragPill)})}))]}))};export{l as default};
|
|
2
2
|
//# sourceMappingURL=ChatDrawer.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useState as e,useRef as t,useMemo as r}from"react";import{searchPlugin as n}from"@react-pdf-viewer/search";import{pageNavigationPlugin as i}from"@react-pdf-viewer/page-navigation";import{zoomPlugin as o}from"@react-pdf-viewer/zoom";var a=function(a,u,c,l){var s=e(0),
|
|
1
|
+
import{useState as e,useRef as t,useMemo as r}from"react";import{searchPlugin as n}from"@react-pdf-viewer/search";import{pageNavigationPlugin as i}from"@react-pdf-viewer/page-navigation";import{zoomPlugin as o}from"@react-pdf-viewer/zoom";var a=function(a,u,c,l){var s=e(0),f=s[0],p=s[1],h=t(!1),v=e(0),g=v[0],d=v[1],m=function(e){if(!e)return[];return e.replace(/\]\s*\n\s*\(/g,"](").split(/\n+/).map(function(e){var t=e.trim(),r=(t=(t=t.replace(/[\u200B-\u200D\uFEFF]/g,"").replace(/[\u00A0\u2009\u202F]/g," ")).replace(/^[-•]\s+/,"")).match(/^((\d+(?:\.\d+)*[.)]?)|[A-Za-z][.)]|\([A-Za-z0-9]+\)|(?:i|ii|iii|iv|v|vi|vii|viii|ix|x)[.)])\s*/i);return r?t.slice(r[0].length).trim():t}).flatMap(function(e){var t=e.match(/^\s*\|(.+)\|\s*$/);return t?t[1].split("|").map(function(e){return e.trim()}).filter(Boolean):[e]}).map(function(e){return e.replace(/&[#\w]+;/g,function(e){return t=e,(r=document.createElement("textarea")).innerHTML=t,r.value;var t,r}).replace(/<br\s*\/?>/gi,"\n").replace(/\[([^\]]+)\]\(([^)]+)\)/g,"$1").replace(/[^\S\n]+/g," ").trim()}).flatMap(function(e){return e.split(/\n+/)}).flatMap(function(e){for(var t,r=[],n=/([*_]{1,3})([^*_]+)\1|([*_]{1,3})/g,i=0;null!==(t=n.exec(e));){var o=e.slice(i,t.index).trim();o&&r.push(o),t[2]&&r.push(t[2].trim()),i=t.index+t[0].length}var a=e.slice(i).trim();return a&&r.push(a),r.flatMap(function(e){return e.split(/[\u2013\u2014-]/g)}).flatMap(function(e){return e.split(/\n+/)}).map(function(e){return e.replace(/[*_]+/g,"").replace(/`([^`]+)`/g,"$1").replace(/[^\S\n]+/g," ").trim()})})},y=Object.keys(u).map(Number).sort(function(e,t){return e-t}),_=Object.values(u).filter(function(e){return e>0}).length,T=function(e){if(c.current){var t=c.current.querySelectorAll(".rpv-search__highlights"),r=new Set,n=new Set;t.forEach(function(t){var i=t.getAttribute("data-testid"),o=parseInt((null==i?void 0:i.replace("search__highlights-",""))||"-1"),a=t.querySelectorAll(".rpv-search__highlight");if(o===e){var u=new Set;a.forEach(function(e){var t=e,i=(t.getAttribute("title")||"").toLowerCase(),o=t.style.top,a="".concat(i,"_").concat(o);r.has(a)?t.style.display=u.has(a)?"none":"":(r.add(a),n.has(i)?(u.add(a),t.style.display="none"):(n.add(i),t.style.display=""))})}})}},x=function(e){c.current&&c.current.querySelectorAll(".rpv-search__highlights").forEach(function(t){var r=t.getAttribute("data-testid"),n=parseInt((null==r?void 0:r.replace(/search__highlights-/g,""))||"-1"),i=t.querySelectorAll(".rpv-search__highlight");e.has(n)||i.forEach(function(e){e.style.display="none"})})},b=a.map(function(e){return m(e)}).flat();console.log("[debug: PDF highlight text]",a,b);var S=n({keyword:b}),A=i(),w=o(),j=S.jumpToMatch,q=A.jumpToPage,B=w.zoomTo,I=w.ZoomInButton,Z=w.ZoomOutButton,E=w.ZoomPopover,M=function(){if(!h.current)try{j(0),h.current=!0}catch(e){requestAnimationFrame(M)}},O=function(e,t){if(c.current&&c.current.querySelector(".rpv-core__viewer")){var r=-1,n=function(){var i,o,a=null===(i=c.current)||void 0===i?void 0:i.querySelector(".rpv-core__inner-pages");if(a){if(a.scrollTop!==r)return r=a.scrollTop,void setTimeout(n,100);var u=null===(o=c.current)||void 0===o?void 0:o.querySelector('[data-testid="core__page-layer-'.concat(e,'"]'));if(u){var l=u.querySelectorAll(".rpv-search__highlight")[t];if(l){var s=a.getBoundingClientRect(),f=l.getBoundingClientRect(),p=a.scrollTop+(f.top-s.top)-a.clientHeight/2+f.height/2;a.scrollTo({top:p,behavior:"smooth"})}}}};setTimeout(n,300)}},P=r(function(){var e={};return y.forEach(function(t,r){var n=u[t];n>0&&(e[n]||(e[n]=[]),e[n].push(r))}),e},[y,u]),F=function(e){var t=u[y[e]];return(P[t]||[]).indexOf(e)};return{setHighlightIndex:p,highlightIndex:f,cursorIndex:g,setCursorIndex:d,orderedKeys:y,totalHighlights:_,getValidPosition:function(e){for(var t=0,r=0;r<=e;r++){var n=y[r];u[n]>0&&t++}return t},tryJump:M,jumpToPage:q,zoomTo:B,hideNonTargetHighlights:x,deduplicateHighlights:T,plugins:[S,A,w],controls:{ZoomInButton:I,ZoomOutButton:Z,ZoomPopover:E,goToNext:function(){for(var e=function(e){var t=y[e];if(u[t]>0){var r=u[t]-1,n=F(e);return d(e),q(u[t]-1),O(r,n),setTimeout(function(){T(r)},500),1===Object.keys(u).length&&x(l),{value:void 0}}},t=g+1;t<y.length;t++){var r=e(t);if("object"==typeof r)return r.value}},goToPrevious:function(){for(var e=function(e){var t=y[e];if(u[t]>0){var r=u[t]-1,n=F(e);return d(e),q(u[t]-1),O(r,n),setTimeout(function(){T(r)},500),1===Object.keys(u).length&&x(l),{value:void 0}}},t=g-1;t>=0;t--){var r=e(t);if("object"==typeof r)return r.value}}}}};export{a as PdfHighlightControls};
|
|
2
2
|
//# sourceMappingURL=usePdfHighlight.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatDrawer.d.ts","sourceRoot":"","sources":["../../../../../src/features/ChatDrawer/ChatDrawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAEpE,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,KAA+C,MAAM,OAAO,CAAC;AAEpE,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA2GzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
1
|
+
import { CSSProperties, ReactNode } from "react";
|
|
2
2
|
export interface ChatDrawerProps {
|
|
3
3
|
/** Scrollable body — fully consumer owned. Pass anything: forms, file lists, summaries, tables. */
|
|
4
4
|
children?: ReactNode;
|
|
@@ -16,5 +16,22 @@ export interface ChatDrawerProps {
|
|
|
16
16
|
onToggle?: () => void;
|
|
17
17
|
/** Called on every drag-resize tick with the new height in px */
|
|
18
18
|
onHeightChange?: (height: number) => void;
|
|
19
|
+
/**
|
|
20
|
+
* Style overrides for the drawer shell.
|
|
21
|
+
* Lets consuming teams customize colors, borders, and backgrounds
|
|
22
|
+
* without touching the component internals.
|
|
23
|
+
*/
|
|
24
|
+
styles?: {
|
|
25
|
+
/** Outer container — background, border, borderRadius, boxShadow */
|
|
26
|
+
container?: CSSProperties;
|
|
27
|
+
/** Always-visible header row — background, padding */
|
|
28
|
+
header?: CSSProperties;
|
|
29
|
+
/** Header title text — color, fontSize, fontFamily */
|
|
30
|
+
title?: CSSProperties;
|
|
31
|
+
/** Scrollable body wrapper — background, padding */
|
|
32
|
+
body?: CSSProperties;
|
|
33
|
+
/** Drag handle pill — background color */
|
|
34
|
+
dragPill?: CSSProperties;
|
|
35
|
+
};
|
|
19
36
|
}
|
|
20
37
|
//# sourceMappingURL=ChatDrawer.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatDrawer.types.d.ts","sourceRoot":"","sources":["../../../../../../src/features/ChatDrawer/types/ChatDrawer.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,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;;;;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;KAC1B,CAAC;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePdfHighlight.d.ts","sourceRoot":"","sources":["../../../../../src/features/PdfViewer/usePdfHighlight.tsx"],"names":[],"mappings":";AAKA,eAAO,MAAM,oBAAoB,kBAChB,MAAM,EAAE,kBACP,OAAO,MAAM,EAAE,MAAM,CAAC,aAC3B,MAAM,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,oBAC9B,IAAI,MAAM,CAAC;;;;;;;+BAyHI,MAAM;;;;2CA+HM,IAAI,MAAM,CAAC;wCA9Cd,MAAM;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"usePdfHighlight.d.ts","sourceRoot":"","sources":["../../../../../src/features/PdfViewer/usePdfHighlight.tsx"],"names":[],"mappings":";AAKA,eAAO,MAAM,oBAAoB,kBAChB,MAAM,EAAE,kBACP,OAAO,MAAM,EAAE,MAAM,CAAC,aAC3B,MAAM,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,oBAC9B,IAAI,MAAM,CAAC;;;;;;;+BAyHI,MAAM;;;;2CA+HM,IAAI,MAAM,CAAC;wCA9Cd,MAAM;;;;;;;;;CA2OlD,CAAC"}
|