@e-llm-studio/requirement-ai 0.0.360 → 0.0.362
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/dist/cjs/features/RequirementAI/components/citations/audio-citation/SearchWaveFromWrapper.js +1 -1
- package/dist/cjs/features/RequirementAI/components/common/TableWrapper.js +1 -1
- package/dist/cjs/utils/helperFunctions.js +1 -1
- package/dist/features/RequirementAI/components/citations/audio-citation/SearchWaveFromWrapper.js +1 -1
- package/dist/features/RequirementAI/components/common/TableWrapper.js +1 -1
- package/dist/types/src/features/RequirementAI/components/common/TableWrapper.d.ts +1 -1
- package/dist/types/src/features/RequirementAI/components/common/TableWrapper.d.ts.map +1 -1
- package/dist/types/src/utils/helperFunctions.d.ts +2 -0
- package/dist/types/src/utils/helperFunctions.d.ts.map +1 -1
- package/dist/utils/helperFunctions.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/features/RequirementAI/components/ai-reasoning/CitationPdfRendererWrapper.js +0 -2
- package/dist/cjs/features/RequirementAI/components/ai-reasoning/CitationPdfRendererWrapper.js.map +0 -1
- package/dist/cjs/features/RequirementAI/components/ai-reasoning/CitationPdfViewer.js +0 -2
- package/dist/cjs/features/RequirementAI/components/ai-reasoning/CitationPdfViewer.js.map +0 -1
- package/dist/cjs/features/RequirementAI/components/ai-reasoning/pdfCitationUtils.js +0 -2
- package/dist/cjs/features/RequirementAI/components/ai-reasoning/pdfCitationUtils.js.map +0 -1
- package/dist/features/RequirementAI/components/ai-reasoning/CitationPdfRendererWrapper.js +0 -2
- package/dist/features/RequirementAI/components/ai-reasoning/CitationPdfRendererWrapper.js.map +0 -1
- package/dist/features/RequirementAI/components/ai-reasoning/CitationPdfViewer.js +0 -2
- package/dist/features/RequirementAI/components/ai-reasoning/CitationPdfViewer.js.map +0 -1
- package/dist/features/RequirementAI/components/ai-reasoning/pdfCitationUtils.js +0 -2
- package/dist/features/RequirementAI/components/ai-reasoning/pdfCitationUtils.js.map +0 -1
package/dist/cjs/features/RequirementAI/components/citations/audio-citation/SearchWaveFromWrapper.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),i=require("./searchwaveform.js"),s=require("./components/videoPlayer.js"),a=require("./utils/word-segment-util.js"),l=require("./components/SegmentByWordsViral.js"),n=require("./SearchWaveFromWrapper.module.css.js"),d=require("./icons/AudioLinesIcon.js"),r=require("./icons/VideoIcon.js"),o=require("@mui/material"),u=require("../../../shared/CitationAIConfidenceDisplay.js"),c=require("../../RequirementAIWrapper/RequirementAIWrapper.js"),m=require("./store/autoplay.wavefrom.js");const v=e=>{const t=Math.floor(e/3600),i=Math.floor(e%3600/60),s=Math.floor(e%60),a=e=>String(e).padStart(2,"0");return`${a(t)}:${a(i)}:${s.toFixed(0)}`},g=t.memo(({title:g,segments:f,gsUtilPath:h,citationNumber:y,relevanceScore:p,customStyles:j})=>{const[x,S]=t.useState(0),[P,w]=t.useState(f.length>0),[A,N]=t.useState(!1),[q,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),i=require("./searchwaveform.js"),s=require("./components/videoPlayer.js"),a=require("./utils/word-segment-util.js"),l=require("./components/SegmentByWordsViral.js"),n=require("./SearchWaveFromWrapper.module.css.js"),d=require("./icons/AudioLinesIcon.js"),r=require("./icons/VideoIcon.js"),o=require("@mui/material"),u=require("../../../shared/CitationAIConfidenceDisplay.js"),c=require("../../RequirementAIWrapper/RequirementAIWrapper.js"),m=require("./store/autoplay.wavefrom.js");const v=e=>{const t=Math.floor(e/3600),i=Math.floor(e%3600/60),s=Math.floor(e%60),a=e=>String(e).padStart(2,"0");return`${a(t)}:${a(i)}:${s.toFixed(0)}`},g=t.memo(({title:g,segments:f,gsUtilPath:h,citationNumber:y,relevanceScore:p,customStyles:j})=>{const[x,S]=t.useState(0),[P,w]=t.useState(f.length>0),[A,N]=t.useState(!1),[q,k]=t.useState(!1),[C,T]=t.useState(""),[U,L]=t.useState(!0),[B,M]=t.useState("audio"),{queryClient:$,useGetSignedUrlQuery:b,useGetSignedUrlMutation:I,useExtractAudioPeaksMutation:W,useExtractAudioPeaksQuery:D,useGetVideoSignedUrlQuery:V,useGetVideoSignedUrlMutation:E,accessToken:Q}=c.useRequirementAI().apiCachingConfig,R=t.useRef(null),_=h.replace(/\.wav$|\.mp3$/i,".mp4"),O=["getSignedUrl",h],G=["extractAudioPeaks",h],z=["getVideoSignedUrl",_],{data:F}=b(h,O,null!=Q?Q:""),{data:H}=D(h,G,null!=Q?Q:""),{data:J}=V(_,z,null!=Q?Q:""),{mutate:K,isPending:X}=I(h),{mutate:Y,isPending:Z}=W(h,null!=Q?Q:""),{mutate:ee}=E(_,null!=Q?Q:""),te=t.useCallback(e=>{S(e)},[]);t.useEffect(()=>{if(!h)return void console.error("Error -> SearchWaveformWrapper: gsUtilPath is required to fetch signed URL");const e=$.getQueryData(O),t=$.getQueryData(G),i=$.getQueryData(z);e||K({gsUtilPath:h,accessToken:Q}),t||Y({gsUtilPath:h,accessToken:Q}),i||ee({gsUtilPath:_,accessToken:Q})},[h,Q]),t.useEffect(()=>{J&&(async()=>{const e=await fetch(J);T(e.ok?J:"")})()},[J]);return e.jsx(m.AudioPlayProvider,{children:e.jsxs("div",{className:n.default.wrapper,style:null==j?void 0:j.wrapper,children:[e.jsxs("div",{className:n.default.header,style:null==j?void 0:j.header,children:[e.jsx("h2",{className:n.default.title,style:null==j?void 0:j.title,children:g||"Audio Snippet"}),u.renderCitationAIConfidenceDisplay(p,!0,null==j?void 0:j.confidenceDisplay)]}),e.jsxs("div",{className:n.default.content,style:null==j?void 0:j.content,children:["audio"!==B&&C?e.jsxs("div",{className:n.default.videoSection,style:null==j?void 0:j.videoSection,children:[U&&e.jsxs("div",{className:n.default.videoLoader,style:null==j?void 0:j.videoLoader,children:[e.jsx(o.CircularProgress,{size:40}),e.jsx("p",{children:"Loading video..."})]}),e.jsx("div",{style:{visibility:U?"hidden":"visible",position:U?"absolute":"relative"},children:e.jsx(s.default,{videoSrc:C,currentTime:x,isWaveformPlaying:q,onBufferingStart:()=>{N(!0),q&&k(!1)},onBufferingEnd:()=>{N(!1)},onVideoPlayPause:e=>{R.current?e?q||R.current.togglePlayPause():q&&R.current.togglePlayPause():k(e)},className:"w-full aspect-video rounded-lg overflow-hidden shadow-lg mb-2",onVideoLoadingStateChange:e=>(e=>{L(e)})(e),isUrlPending:X,isPeaksPending:Z,signedUrl:F,AudioData:H,showOnlyMatched:P,wavesurferRef:R,handleAudioTimeUpdate:te,segments:f,setIsAudioPlaying:k,setShowOnlyMatched:w,customStyles:null==j?void 0:j.videoPlayer,waveformStyles:null==j?void 0:j.waveform},`video-${y}`)})]}):e.jsx("div",{className:n.default.audioSection,style:null==j?void 0:j.audioSection,children:X||Z?e.jsxs("div",{className:n.default.audioLoader,style:null==j?void 0:j.audioLoader,children:[e.jsx(o.CircularProgress,{size:48}),e.jsx("span",{children:"Loading audio peaks..."})]}):F&&H&&e.jsx(i.default,{ref:R,audio_file_name:F,matchedSegments:f,peaks:H.peaks,duration:H.duration,setIsAudioPlaying:k,onTimeUpdate:te,currentAudioTime:x,showOnlyMatched:P,setShowOnlyMatched:w,customStyles:null==j?void 0:j.waveform},`audio-${y}`)}),e.jsxs("div",{className:n.default.controls,style:null==j?void 0:j.controls,children:[C&&e.jsxs("div",{className:n.default.mediaToggle,style:null==j?void 0:j.mediaToggle,children:[e.jsx("span",{className:`\n ${n.default.mediaButton}\n ${"video"===B&&n.default.mediaButtonActive}\n `,style:"video"===B?null==j?void 0:j.mediaButtonActive:null==j?void 0:j.mediaButton,onClick:()=>M("video"),children:e.jsx(r.default,{})}),e.jsx("span",{className:`\n ${n.default.mediaButton}\n ${"audio"===B&&n.default.mediaButtonActive}\n `,style:"audio"===B?null==j?void 0:j.mediaButtonActive:null==j?void 0:j.mediaButton,onClick:()=>M("audio"),children:e.jsx(d.default,{})})]}),e.jsx("label",{className:n.default.switchLabel,style:null==j?void 0:j.switchLabel,children:e.jsx("span",{children:"play only matched segments"})})]}),e.jsxs("div",{className:n.default.transcript,style:null==j?void 0:j.transcriptContainer,children:[e.jsx("div",{className:n.default.transcriptHeader,style:null==j?void 0:j.transcriptHeader,children:"Transcript"}),(t=>{const i=a.sortTopicsByCheckedStatus(t);return e.jsx("div",{className:n.default.segmentList,style:null==j?void 0:j.segmentList,children:null==i?void 0:i.map(t=>e.jsx("div",{id:t.segment_id,className:n.default.segmentItem,style:null==j?void 0:j.transcriptSegment,children:e.jsx(l.default,{content:t.text,startTime:v(t.start),endTime:v(t.end),words:t.words||[],currentTime:x,containerStyle:null==j?void 0:j.transcriptContainer,customStyles:null==j?void 0:j.segmentWords})},t.segment_id))})})(f)]})]})]})})});exports.default=g,exports.formatTime=v;
|
|
2
2
|
//# sourceMappingURL=SearchWaveFromWrapper.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),l=require("react"),t=require("@mui/material"),r=require("lucide-react"),n=require("../../../../utils/helperFunctions.js"),i=require("../userstory-with-citation/UserStoryWithCitation.module.css.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=o(l);exports.default=({children:o,tableStyle:a,menuConfig:s,menuStyles:d,blockId:c,storyId:v})=>{var f,b,p,h,m;const y=null==s?void 0:s.elements,x=!!(null==y?void 0:y.length),j=l.useRef(null),[g,E]=l.useState(null),[M,S]=l.useState(40);if(l.useEffect(()=>{var e,l,t;if(!x)return;const r=null!==(l=null===(e=j.current)||void 0===e?void 0:e.querySelector("thead tr"))&&void 0!==l?l:null===(t=j.current)||void 0===t?void 0:t.querySelector("tr");if(!r)return;const n=()=>S(r.offsetHeight);n();const i=new ResizeObserver(n);return i.observe(r),()=>i.disconnect()},[x,o]),!x)return e.jsx("div",{className:i.default.tableWrapper,children:e.jsx("table",{className:i.default.table,style:a,children:o})});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),l=require("react"),t=require("@mui/material"),r=require("lucide-react"),n=require("../../../../utils/helperFunctions.js"),i=require("../userstory-with-citation/UserStoryWithCitation.module.css.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=o(l);exports.default=({children:o,tableStyle:a,menuConfig:s,menuStyles:d,blockId:c,storyId:v})=>{var f,b,p,h,m;const y=null==s?void 0:s.elements,x=!!(null==y?void 0:y.length),j=l.useRef(null),[g,E]=l.useState(null),[M,S]=l.useState(40);if(!n.hasTableContent(o))return null;if(l.useEffect(()=>{var e,l,t;if(!x)return;const r=null!==(l=null===(e=j.current)||void 0===e?void 0:e.querySelector("thead tr"))&&void 0!==l?l:null===(t=j.current)||void 0===t?void 0:t.querySelector("tr");if(!r)return;const n=()=>S(r.offsetHeight);n();const i=new ResizeObserver(n);return i.observe(r),()=>i.disconnect()},[x,o]),!x)return e.jsx("div",{className:i.default.tableWrapper,children:e.jsx("table",{className:i.default.table,style:a,children:o})});const C=()=>E(null),R=()=>{var e,l,t,r;const i=j.current;if(!i)return null;const o=n.serializeTable(i),u=i.closest(n.BLOCK_SELECTOR),a=Array.from(null!==(e=null==u?void 0:u.querySelectorAll(`table[${n.TABLE_MARKER}]`))&&void 0!==e?e:[]).filter(e=>e.closest(n.BLOCK_SELECTOR)===u&&n.serializeTable(e)===o),s=Math.max(a.indexOf(i)+1,1),[d,f]=(null!==(l=null==u?void 0:u.getAttribute("data-block-id"))&&void 0!==l?l:"").replace("user-story-card-wrapper-","").split("-");return{html:o,storyId:null!==(t=null!=v?v:d)&&void 0!==t?t:"1",blockId:null!==(r=null!=c?c:f)&&void 0!==r?r:"1",occurrence:s,element:i}},T=!!g,q=null!==(b=null===(f=null==d?void 0:d.icon)||void 0===f?void 0:f.size)&&void 0!==b?b:18,A=null!==(p=null==s?void 0:s.icon)&&void 0!==p?p:e.jsx(r.MoreVertical,{size:q,color:null===(h=null==d?void 0:d.icon)||void 0===h?void 0:h.color});return e.jsxs("div",{className:i.default.tableMenuWrapper,style:{...null==d?void 0:d.wrapper,"--table-menu-reserved":`${null!==(m=null==d?void 0:d.headerReservedSpace)&&void 0!==m?m:40}px`},children:[e.jsx("button",{type:"button","aria-label":"Table actions",className:`${i.default.tableMenuButton} ${T?i.default.tableMenuButtonActive:""}`,style:{height:M-1,...null==d?void 0:d.button,...T?null==d?void 0:d.buttonActive:{}},onClick:e=>{e.stopPropagation(),E(e.currentTarget)},children:A}),e.jsx(t.Menu,{anchorEl:g,open:T,onClose:C,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{minWidth:190,p:"5px",border:"1px solid #e2e8f0",borderRadius:"10px",backgroundColor:"#ffffff",...null==d?void 0:d.menuPaper}}},children:y.map((l,t)=>{var r;return u.default.isValidElement(l)?e.jsx("div",{style:null==d?void 0:d.menuItem,children:u.default.cloneElement(l,{getTableData:R,closeMenu:C})},null!==(r=l.key)&&void 0!==r?r:t):null})}),e.jsx("div",{className:i.default.tableWrapper,children:e.jsx("table",{ref:j,[n.TABLE_MARKER]:"true",className:`${i.default.table} ${i.default.tableWithMenu}`,style:a,children:o})})]})};
|
|
2
2
|
//# sourceMappingURL=TableWrapper.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const
|
|
1
|
+
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("react"));const r="data-menu-table",o=e=>t.default.Children.toArray(e).some(e=>"string"==typeof e?e.trim().length>0:"number"==typeof e||!!t.default.isValidElement(e)&&o(e.props.children));exports.BLOCK_SELECTOR='[data-block-id^="user-story-card-wrapper-"]',exports.TABLE_MARKER=r,exports.hasTableContent=o,exports.serializeTable=e=>{const t=e.cloneNode(!0);return t.removeAttribute(r),t.outerHTML};
|
|
2
2
|
//# sourceMappingURL=helperFunctions.js.map
|
package/dist/features/RequirementAI/components/citations/audio-citation/SearchWaveFromWrapper.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e,jsxs as i}from"react/jsx-runtime";import{memo as t,useState as o,useRef as n,useCallback as a,useEffect as l}from"react";import
|
|
1
|
+
import{jsx as e,jsxs as i}from"react/jsx-runtime";import{memo as t,useState as o,useRef as n,useCallback as a,useEffect as l}from"react";import s from"./searchwaveform.js";import r from"./components/videoPlayer.js";import{sortTopicsByCheckedStatus as d}from"./utils/word-segment-util.js";import c from"./components/SegmentByWordsViral.js";import u from"./SearchWaveFromWrapper.module.css.js";import m from"./icons/AudioLinesIcon.js";import v from"./icons/VideoIcon.js";import{CircularProgress as p}from"@mui/material";import{renderCitationAIConfidenceDisplay as g}from"../../../shared/CitationAIConfidenceDisplay.js";import{useRequirementAI as h}from"../../RequirementAIWrapper/RequirementAIWrapper.js";import{AudioPlayProvider as y}from"./store/autoplay.wavefrom.js";const f=e=>{const i=Math.floor(e/3600),t=Math.floor(e%3600/60),o=Math.floor(e%60),n=e=>String(e).padStart(2,"0");return`${n(i)}:${n(t)}:${o.toFixed(0)}`},S=t(({title:t,segments:S,gsUtilPath:P,citationNumber:w,relevanceScore:N,customStyles:A})=>{const[U,k]=o(0),[T,L]=o(S.length>0),[j,B]=o(!1),[$,C]=o(!1),[M,W]=o(""),[b,I]=o(!0),[x,V]=o("audio"),{queryClient:D,useGetSignedUrlQuery:Q,useGetSignedUrlMutation:q,useExtractAudioPeaksMutation:E,useExtractAudioPeaksQuery:G,useGetVideoSignedUrlQuery:O,useGetVideoSignedUrlMutation:R,accessToken:_}=h().apiCachingConfig,z=n(null),F=P.replace(/\.wav$|\.mp3$/i,".mp4"),H=["getSignedUrl",P],J=["extractAudioPeaks",P],K=["getVideoSignedUrl",F],{data:X}=Q(P,H,null!=_?_:""),{data:Y}=G(P,J,null!=_?_:""),{data:Z}=O(F,K,null!=_?_:""),{mutate:ee,isPending:ie}=q(P),{mutate:te,isPending:oe}=E(P,null!=_?_:""),{mutate:ne}=R(F,null!=_?_:""),ae=a(e=>{k(e)},[]);l(()=>{if(!P)return void console.error("Error -> SearchWaveformWrapper: gsUtilPath is required to fetch signed URL");const e=D.getQueryData(H),i=D.getQueryData(J),t=D.getQueryData(K);e||ee({gsUtilPath:P,accessToken:_}),i||te({gsUtilPath:P,accessToken:_}),t||ne({gsUtilPath:F,accessToken:_})},[P,_]),l(()=>{Z&&(async()=>{const e=await fetch(Z);W(e.ok?Z:"")})()},[Z]);return e(y,{children:i("div",{className:u.wrapper,style:null==A?void 0:A.wrapper,children:[i("div",{className:u.header,style:null==A?void 0:A.header,children:[e("h2",{className:u.title,style:null==A?void 0:A.title,children:t||"Audio Snippet"}),g(N,!0,null==A?void 0:A.confidenceDisplay)]}),i("div",{className:u.content,style:null==A?void 0:A.content,children:["audio"!==x&&M?i("div",{className:u.videoSection,style:null==A?void 0:A.videoSection,children:[b&&i("div",{className:u.videoLoader,style:null==A?void 0:A.videoLoader,children:[e(p,{size:40}),e("p",{children:"Loading video..."})]}),e("div",{style:{visibility:b?"hidden":"visible",position:b?"absolute":"relative"},children:e(r,{videoSrc:M,currentTime:U,isWaveformPlaying:$,onBufferingStart:()=>{B(!0),$&&C(!1)},onBufferingEnd:()=>{B(!1)},onVideoPlayPause:e=>{z.current?e?$||z.current.togglePlayPause():$&&z.current.togglePlayPause():C(e)},className:"w-full aspect-video rounded-lg overflow-hidden shadow-lg mb-2",onVideoLoadingStateChange:e=>(e=>{I(e)})(e),isUrlPending:ie,isPeaksPending:oe,signedUrl:X,AudioData:Y,showOnlyMatched:T,wavesurferRef:z,handleAudioTimeUpdate:ae,segments:S,setIsAudioPlaying:C,setShowOnlyMatched:L,customStyles:null==A?void 0:A.videoPlayer,waveformStyles:null==A?void 0:A.waveform},`video-${w}`)})]}):e("div",{className:u.audioSection,style:null==A?void 0:A.audioSection,children:ie||oe?i("div",{className:u.audioLoader,style:null==A?void 0:A.audioLoader,children:[e(p,{size:48}),e("span",{children:"Loading audio peaks..."})]}):X&&Y&&e(s,{ref:z,audio_file_name:X,matchedSegments:S,peaks:Y.peaks,duration:Y.duration,setIsAudioPlaying:C,onTimeUpdate:ae,currentAudioTime:U,showOnlyMatched:T,setShowOnlyMatched:L,customStyles:null==A?void 0:A.waveform},`audio-${w}`)}),i("div",{className:u.controls,style:null==A?void 0:A.controls,children:[M&&i("div",{className:u.mediaToggle,style:null==A?void 0:A.mediaToggle,children:[e("span",{className:`\n ${u.mediaButton}\n ${"video"===x&&u.mediaButtonActive}\n `,style:"video"===x?null==A?void 0:A.mediaButtonActive:null==A?void 0:A.mediaButton,onClick:()=>V("video"),children:e(v,{})}),e("span",{className:`\n ${u.mediaButton}\n ${"audio"===x&&u.mediaButtonActive}\n `,style:"audio"===x?null==A?void 0:A.mediaButtonActive:null==A?void 0:A.mediaButton,onClick:()=>V("audio"),children:e(m,{})})]}),e("label",{className:u.switchLabel,style:null==A?void 0:A.switchLabel,children:e("span",{children:"play only matched segments"})})]}),i("div",{className:u.transcript,style:null==A?void 0:A.transcriptContainer,children:[e("div",{className:u.transcriptHeader,style:null==A?void 0:A.transcriptHeader,children:"Transcript"}),(i=>{const t=d(i);return e("div",{className:u.segmentList,style:null==A?void 0:A.segmentList,children:null==t?void 0:t.map(i=>e("div",{id:i.segment_id,className:u.segmentItem,style:null==A?void 0:A.transcriptSegment,children:e(c,{content:i.text,startTime:f(i.start),endTime:f(i.end),words:i.words||[],currentTime:U,containerStyle:null==A?void 0:A.transcriptContainer,customStyles:null==A?void 0:A.segmentWords})},i.segment_id))})})(S)]})]})]})})});export{S as default,f as formatTime};
|
|
2
2
|
//# sourceMappingURL=SearchWaveFromWrapper.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e,jsxs as l}from"react/jsx-runtime";import t,{useRef as r,useState as o,useEffect as n}from"react";import{Menu as i}from"@mui/material";import{MoreVertical as u}from"lucide-react";import{
|
|
1
|
+
import{jsx as e,jsxs as l}from"react/jsx-runtime";import t,{useRef as r,useState as o,useEffect as n}from"react";import{Menu as i}from"@mui/material";import{MoreVertical as u}from"lucide-react";import{hasTableContent as a,TABLE_MARKER as s,serializeTable as c,BLOCK_SELECTOR as d}from"../../../../utils/helperFunctions.js";import v from"../userstory-with-citation/UserStoryWithCitation.module.css.js";const m=({children:m,tableStyle:p,menuConfig:b,menuStyles:h,blockId:f,storyId:y})=>{var g,x,S,k,M;const N=null==b?void 0:b.elements,W=!!(null==N?void 0:N.length),$=r(null),[z,A]=o(null),[C,I]=o(40);if(!a(m))return null;if(n(()=>{var e,l,t;if(!W)return;const r=null!==(l=null===(e=$.current)||void 0===e?void 0:e.querySelector("thead tr"))&&void 0!==l?l:null===(t=$.current)||void 0===t?void 0:t.querySelector("tr");if(!r)return;const o=()=>I(r.offsetHeight);o();const n=new ResizeObserver(o);return n.observe(r),()=>n.disconnect()},[W,m]),!W)return e("div",{className:v.tableWrapper,children:e("table",{className:v.table,style:p,children:m})});const w=()=>A(null),O=()=>{var e,l,t,r;const o=$.current;if(!o)return null;const n=c(o),i=o.closest(d),u=Array.from(null!==(e=null==i?void 0:i.querySelectorAll(`table[${s}]`))&&void 0!==e?e:[]).filter(e=>e.closest(d)===i&&c(e)===n),a=Math.max(u.indexOf(o)+1,1),[v,m]=(null!==(l=null==i?void 0:i.getAttribute("data-block-id"))&&void 0!==l?l:"").replace("user-story-card-wrapper-","").split("-");return{html:n,storyId:null!==(t=null!=y?y:v)&&void 0!==t?t:"1",blockId:null!==(r=null!=f?f:m)&&void 0!==r?r:"1",occurrence:a,element:o}},j=!!z,q=null!==(x=null===(g=null==h?void 0:h.icon)||void 0===g?void 0:g.size)&&void 0!==x?x:18,E=null!==(S=null==b?void 0:b.icon)&&void 0!==S?S:e(u,{size:q,color:null===(k=null==h?void 0:h.icon)||void 0===k?void 0:k.color});return l("div",{className:v.tableMenuWrapper,style:{...null==h?void 0:h.wrapper,"--table-menu-reserved":`${null!==(M=null==h?void 0:h.headerReservedSpace)&&void 0!==M?M:40}px`},children:[e("button",{type:"button","aria-label":"Table actions",className:`${v.tableMenuButton} ${j?v.tableMenuButtonActive:""}`,style:{height:C-1,...null==h?void 0:h.button,...j?null==h?void 0:h.buttonActive:{}},onClick:e=>{e.stopPropagation(),A(e.currentTarget)},children:E}),e(i,{anchorEl:z,open:j,onClose:w,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{minWidth:190,p:"5px",border:"1px solid #e2e8f0",borderRadius:"10px",backgroundColor:"#ffffff",...null==h?void 0:h.menuPaper}}},children:N.map((l,r)=>{var o;return t.isValidElement(l)?e("div",{style:null==h?void 0:h.menuItem,children:t.cloneElement(l,{getTableData:O,closeMenu:w})},null!==(o=l.key)&&void 0!==o?o:r):null})}),e("div",{className:v.tableWrapper,children:e("table",{ref:$,[s]:"true",className:`${v.table} ${v.tableWithMenu}`,style:p,children:m})})]})};export{m as default};
|
|
2
2
|
//# sourceMappingURL=TableWrapper.js.map
|
|
@@ -8,6 +8,6 @@ interface TableWithMenuProps {
|
|
|
8
8
|
blockId?: string;
|
|
9
9
|
storyId?: string;
|
|
10
10
|
}
|
|
11
|
-
declare const TableWithMenu: ({ children, tableStyle, menuConfig, menuStyles, blockId, storyId, }: TableWithMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare const TableWithMenu: ({ children, tableStyle, menuConfig, menuStyles, blockId, storyId, }: TableWithMenuProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
12
12
|
export default TableWithMenu;
|
|
13
13
|
//# sourceMappingURL=TableWrapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableWrapper.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/common/TableWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAG3D,OAAO,EAEL,eAAe,EAEf,eAAe,EAChB,MAAM,6BAA6B,CAAC;AAIrC,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACjC,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,QAAA,MAAM,aAAa,wEAOhB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"TableWrapper.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/common/TableWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAG3D,OAAO,EAEL,eAAe,EAEf,eAAe,EAChB,MAAM,6BAA6B,CAAC;AAIrC,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACjC,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,QAAA,MAAM,aAAa,wEAOhB,kBAAkB,mDAoIpB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
export declare const formatDateString: (inputDate: string) => string;
|
|
2
3
|
export declare function transformToArrayOfArrays(data: Record<string, any>[]): any[][];
|
|
3
4
|
export declare function mapColumnsToValues(columns: string[], valuesArray: string[][]): {
|
|
@@ -6,4 +7,5 @@ export declare function mapColumnsToValues(columns: string[], valuesArray: strin
|
|
|
6
7
|
export declare const TABLE_MARKER = "data-menu-table";
|
|
7
8
|
export declare const BLOCK_SELECTOR = "[data-block-id^=\"user-story-card-wrapper-\"]";
|
|
8
9
|
export declare const serializeTable: (el: HTMLElement) => string;
|
|
10
|
+
export declare const hasTableContent: (children: React.ReactNode) => boolean;
|
|
9
11
|
//# sourceMappingURL=helperFunctions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helperFunctions.d.ts","sourceRoot":"","sources":["../../../../src/utils/helperFunctions.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,cAAe,MAAM,WAqBjD,CAAA;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,GAAG,EAAE,EAAE,CAO7E;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,GAAG;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,EAAE,CASxG;AACD,eAAO,MAAM,YAAY,oBAAoB,CAAC;AAC9C,eAAO,MAAM,cAAc,kDAAgD,CAAC;AAE5E,eAAO,MAAM,cAAc,OAAQ,WAAW,WAI7C,CAAC"}
|
|
1
|
+
{"version":3,"file":"helperFunctions.d.ts","sourceRoot":"","sources":["../../../../src/utils/helperFunctions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,eAAO,MAAM,gBAAgB,cAAe,MAAM,WAqBjD,CAAA;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,GAAG,EAAE,EAAE,CAO7E;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,GAAG;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,EAAE,CASxG;AACD,eAAO,MAAM,YAAY,oBAAoB,CAAC;AAC9C,eAAO,MAAM,cAAc,kDAAgD,CAAC;AAE5E,eAAO,MAAM,cAAc,OAAQ,WAAW,WAI7C,CAAC;AAEF,eAAO,MAAM,eAAe,aAAc,MAAM,SAAS,KAAG,OAW3D,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const
|
|
1
|
+
import e from"react";const r="data-menu-table",t='[data-block-id^="user-story-card-wrapper-"]',o=e=>{const t=e.cloneNode(!0);return t.removeAttribute(r),t.outerHTML},n=r=>e.Children.toArray(r).some(r=>"string"==typeof r?r.trim().length>0:"number"==typeof r||!!e.isValidElement(r)&&n(r.props.children));export{t as BLOCK_SELECTOR,r as TABLE_MARKER,n as hasTableContent,o as serializeTable};
|
|
2
2
|
//# sourceMappingURL=helperFunctions.js.map
|
package/package.json
CHANGED
package/dist/cjs/features/RequirementAI/components/ai-reasoning/CitationPdfRendererWrapper.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("lucide-react"),i=require("react"),a=require("./pdfCitationUtils.js"),r=require("../RequirementAIWrapper/RequirementAIWrapper.js"),o=require("./pdfCitation.module.css.js"),l=require("./CitationPdfViewer.js");exports.default=function({citation:n,isCitationLoading:d=!1,renderMode:s,pdfViewHeaderAction:u,citationId:c}){var g,f,h,p,m;const{queryClient:v,useGetSignedUrlQuery:x,useGetSignedUrlMutation:w}=r.useRequirementAI().apiCachingConfig,[C,U]=i.useState(!1),V=null==n?void 0:n.customMetadata,_=null!==(g=null==V?void 0:V.value)&&void 0!==g?g:[],j=null!==(f=null==V?void 0:V.artifact_url)&&void 0!==f?f:"",q=null!==(h=null==V?void 0:V.artifact_title)&&void 0!==h?h:"",y=null!==(p=null==V?void 0:V.artifact_format)&&void 0!==p?p:"pdf",P=_.flatMap(e=>e.highlighted_text.map(e=>e.text)),A="docx"===y,S=["getSignedUrl",j],{data:I}=x(j,S),{mutate:M,isPending:N}=w(j),H=null!=I?I:"",D=!!j&&N&&!H;return j||console.warn("Artifact preview details not found in header message or message data",j),i.useEffect(()=>{if(!j)return void U(!0);const e=v.getQueryData(S);e||N||M({gsUtilPath:j}),e&&U(!1)},[j,v,S,N,M]),i.useEffect(()=>{H&&U(!1)},[H]),null!==(m=(()=>{try{const i=a.mapToHighlightAreas(_),r=i.length>0;if(D||d)return e.jsx("div",{className:o.default.loaderContainer,children:e.jsx(t.Loader2,{className:o.default.loaderIcon,size:28})});const n=_.some(e=>!!e.gs_url),g=_.some(e=>null!==e.page_no&&void 0!==e.page_no),f=_.some(e=>Array.isArray(e.highlighted_coordinates)&&e.highlighted_coordinates.length>0),h=i.length>0;return!(n||g||f||h)&&console.warn("No valid coordinates or gs_url found for this citation.",{hasValidGsUrl:n,hasValidPageNo:g,hasHighlightedCoords:f,hasCoordinatesPages:h,pages:_,artifactUrl:j}),(r||!g||C)&&(C||!r)?(console.warn("Error in loading PDF or no valid highlight coordinates found. Rendering fallback viewer without highlights.",{artifactUrl:j,hasValidCoordinates:r,coordinatesPages:i,pages:_}),e.jsx(l.default,{artifactUrl:j,pdfUrl:"",pdfName:q,pages:_,coordinatesPages:[],pdfViewHeaderAction:u,renderMode:null!=s?s:"fallback",isDocx:A,hasValidCoordinates:!1,customStyles:a.citationViewerStyles,highlightText:P,citationId:c})):e.jsx(l.default,{artifactUrl:j,pdfUrl:H,pdfName:q,pages:_,coordinatesPages:i,pdfViewHeaderAction:u,renderMode:null!=s?s:"default",isDocx:A,hasValidCoordinates:r,jumpToPageValue:1,customStyles:a.citationViewerStyles,highlightText:P,citationId:c})}catch(e){return console.warn("Error rendering citation",e),null}})())&&void 0!==m?m:null};
|
|
2
|
-
//# sourceMappingURL=CitationPdfRendererWrapper.js.map
|
package/dist/cjs/features/RequirementAI/components/ai-reasoning/CitationPdfRendererWrapper.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CitationPdfRendererWrapper.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("lucide-react"),t=require("@e-llm-studio/citation"),a=require("./pdfCitationUtils.js");const o={pdfViewer:{height:"50%",maxHeight:"50%",display:"flex",flexDirection:"column",backgroundColor:"#FAFAFA",border:"1px solid #e5e7eb",borderRadius:"8px",overflow:"hidden"},pdfContainer:{flex:1,overflowY:"auto",padding:"8px"},header:{borderBottom:"1px solid #e5e7eb"}},l={pdfViewerWrapper:"shadow-sm"},r=()=>e.jsx("div",{className:"h-full flex items-center justify-center",children:e.jsx(i.Loader2,{className:"animate-spin text-purple-500",size:28})});exports.default=({artifactUrl:i,pdfUrl:s,pdfName:n,pages:d,coordinatesPages:c,activeCitationIndex:u,onActiveCitationChange:h,pdfViewHeaderAction:f,isLoading:p,hasValidCoordinates:g,renderMode:x="default",useCoordinates:m=!0,jumpToPageValue:C,customStyles:b,customClasses:v,isDocx:j=!1,highlightText:k,citationId:P})=>{if(p)return e.jsx(r,{});const w=j||"fallback"===x?"":s,A="fallback"===x||!1===g?[]:c,V="fallback"!==x&&m,N=a.stringToNumber(P),y=f?{icon:f.icon,tooltip:f.tooltip,onClick:()=>{f.onClick({artifactUrl:i,artifactId:i,fileName:null!=n?n:"",pages:d,currentCitationIndex:null!=N?N:0})}}:void 0;return e.jsx(t.PdfViewer,{pdfUrl:w,pdfName:n,fallbackPages:d,highlightCordinatePages:A,highlightText:null!=k?k:[],highlightPages:{},useCoordinates:V,activeCitationIndex:u,headerAction:y,onActiveCitationChange:h,highlightColor:"oklch(0.78 0.16 95 / 0.35)",activeHighlightColor:"oklch(0.75 0.17 95 / 0.45)",jumpToPageValue:C,customStyles:null!=b?b:o,customClasses:null!=v?v:l})};
|
|
2
|
-
//# sourceMappingURL=CitationPdfViewer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CitationPdfViewer.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.citationViewerStyles={pdfViewer:{height:"550px",maxHeight:"550px",display:"flex",flexDirection:"column",backgroundColor:"#FAFAFA",border:"1px solid #e5e7eb",borderRadius:"8px",overflow:"hidden"},pdfContainer:{flex:1,overflowY:"auto",padding:"8px"},header:{borderBottom:"1px solid #e5e7eb"}},exports.mapToHighlightAreas=(e=[])=>Array.isArray(e)?null==e?void 0:e.flatMap(e=>{var r,i;const o=null==e?void 0:e.page_no;return!(null===(r=null==e?void 0:e.highlighted_coordinates)||void 0===r?void 0:r.length)&&o?[{pageNumber:o,pageIndex:o-1}]:o&&(null===(i=null==e?void 0:e.highlighted_coordinates)||void 0===i?void 0:i.length)?e.highlighted_coordinates.map(e=>({pageIndex:o-1,pageNumber:o,left:100*e.xmin,top:100*e.ymin,width:100*(e.xmax-e.xmin),height:100*(e.ymax-e.ymin)})):[]}):[],exports.stringToNumber=function(e,r=0){if("number"==typeof e)return Number.isFinite(e)?e:r;if(!e||"string"!=typeof e||!e.trim())return r;let i="";try{i=e.trim().replace(/[^\d.-]/g,"").replace(/(?!^)-/g,"")}catch(e){return console.error("Regex processing failed",e),r}const o=Number(i);return Number.isFinite(o)?o:r};
|
|
2
|
-
//# sourceMappingURL=pdfCitationUtils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pdfCitationUtils.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{Loader2 as i}from"lucide-react";import{useState as t,useEffect as a}from"react";import{mapToHighlightAreas as o,citationViewerStyles as r}from"./pdfCitationUtils.js";import{useRequirementAI as n}from"../RequirementAIWrapper/RequirementAIWrapper.js";import l from"./pdfCitation.module.css.js";import d from"./CitationPdfViewer.js";function s({citation:s,isCitationLoading:c=!1,renderMode:u,pdfViewHeaderAction:g,citationId:f}){var h,m,p,v,C;const{queryClient:U,useGetSignedUrlQuery:w,useGetSignedUrlMutation:P}=n().apiCachingConfig,[V,_]=t(!1),x=null==s?void 0:s.customMetadata,y=null!==(h=null==x?void 0:x.value)&&void 0!==h?h:[],A=null!==(m=null==x?void 0:x.artifact_url)&&void 0!==m?m:"",j=null!==(p=null==x?void 0:x.artifact_title)&&void 0!==p?p:"",I=null!==(v=null==x?void 0:x.artifact_format)&&void 0!==v?v:"pdf",M=y.flatMap(e=>e.highlighted_text.map(e=>e.text)),N="docx"===I,S=["getSignedUrl",A],{data:D}=w(A,S),{mutate:H,isPending:q}=P(A),G=null!=D?D:"",R=!!A&&q&&!G;A||console.warn("Artifact preview details not found in header message or message data",A);return a(()=>{if(!A)return void _(!0);const e=U.getQueryData(S);e||q||H({gsUtilPath:A}),e&&_(!1)},[A,U,S,q,H]),a(()=>{G&&_(!1)},[G]),null!==(C=(()=>{try{const t=o(y),a=t.length>0;if(R||c)return e("div",{className:l.loaderContainer,children:e(i,{className:l.loaderIcon,size:28})});const n=y.some(e=>!!e.gs_url),s=y.some(e=>null!==e.page_no&&void 0!==e.page_no),h=y.some(e=>Array.isArray(e.highlighted_coordinates)&&e.highlighted_coordinates.length>0),m=t.length>0;return!(n||s||h||m)&&console.warn("No valid coordinates or gs_url found for this citation.",{hasValidGsUrl:n,hasValidPageNo:s,hasHighlightedCoords:h,hasCoordinatesPages:m,pages:y,artifactUrl:A}),(a||!s||V)&&(V||!a)?(console.warn("Error in loading PDF or no valid highlight coordinates found. Rendering fallback viewer without highlights.",{artifactUrl:A,hasValidCoordinates:a,coordinatesPages:t,pages:y}),e(d,{artifactUrl:A,pdfUrl:"",pdfName:j,pages:y,coordinatesPages:[],pdfViewHeaderAction:g,renderMode:null!=u?u:"fallback",isDocx:N,hasValidCoordinates:!1,customStyles:r,highlightText:M,citationId:f})):e(d,{artifactUrl:A,pdfUrl:G,pdfName:j,pages:y,coordinatesPages:t,pdfViewHeaderAction:g,renderMode:null!=u?u:"default",isDocx:N,hasValidCoordinates:a,jumpToPageValue:1,customStyles:r,highlightText:M,citationId:f})}catch(e){return console.warn("Error rendering citation",e),null}})())&&void 0!==C?C:null}export{s as default};
|
|
2
|
-
//# sourceMappingURL=CitationPdfRendererWrapper.js.map
|
package/dist/features/RequirementAI/components/ai-reasoning/CitationPdfRendererWrapper.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CitationPdfRendererWrapper.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{Loader2 as i}from"lucide-react";import{PdfViewer as t}from"@e-llm-studio/citation";import{stringToNumber as o}from"./pdfCitationUtils.js";const a={pdfViewer:{height:"50%",maxHeight:"50%",display:"flex",flexDirection:"column",backgroundColor:"#FAFAFA",border:"1px solid #e5e7eb",borderRadius:"8px",overflow:"hidden"},pdfContainer:{flex:1,overflowY:"auto",padding:"8px"},header:{borderBottom:"1px solid #e5e7eb"}},l={pdfViewerWrapper:"shadow-sm"},r=()=>e("div",{className:"h-full flex items-center justify-center",children:e(i,{className:"animate-spin text-purple-500",size:28})}),n=({artifactUrl:i,pdfUrl:n,pdfName:s,pages:d,coordinatesPages:c,activeCitationIndex:f,onActiveCitationChange:h,pdfViewHeaderAction:p,isLoading:u,hasValidCoordinates:g,renderMode:m="default",useCoordinates:C=!0,jumpToPageValue:x,customStyles:b,customClasses:k,isDocx:v=!1,highlightText:A,citationId:w})=>{if(u)return e(r,{});const P=v||"fallback"===m?"":n,V="fallback"===m||!1===g?[]:c,j="fallback"!==m&&C,I=o(w),N=p?{icon:p.icon,tooltip:p.tooltip,onClick:()=>{p.onClick({artifactUrl:i,artifactId:i,fileName:null!=s?s:"",pages:d,currentCitationIndex:null!=I?I:0})}}:void 0;return e(t,{pdfUrl:P,pdfName:s,fallbackPages:d,highlightCordinatePages:V,highlightText:null!=A?A:[],highlightPages:{},useCoordinates:j,activeCitationIndex:f,headerAction:N,onActiveCitationChange:h,highlightColor:"oklch(0.78 0.16 95 / 0.35)",activeHighlightColor:"oklch(0.75 0.17 95 / 0.45)",jumpToPageValue:x,customStyles:null!=b?b:a,customClasses:null!=k?k:l})};export{n as default};
|
|
2
|
-
//# sourceMappingURL=CitationPdfViewer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CitationPdfViewer.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const e=(e=[])=>Array.isArray(e)?null==e?void 0:e.flatMap(e=>{var i,r;const o=null==e?void 0:e.page_no;return!(null===(i=null==e?void 0:e.highlighted_coordinates)||void 0===i?void 0:i.length)&&o?[{pageNumber:o,pageIndex:o-1}]:o&&(null===(r=null==e?void 0:e.highlighted_coordinates)||void 0===r?void 0:r.length)?e.highlighted_coordinates.map(e=>({pageIndex:o-1,pageNumber:o,left:100*e.xmin,top:100*e.ymin,width:100*(e.xmax-e.xmin),height:100*(e.ymax-e.ymin)})):[]}):[],i={pdfViewer:{height:"550px",maxHeight:"550px",display:"flex",flexDirection:"column",backgroundColor:"#FAFAFA",border:"1px solid #e5e7eb",borderRadius:"8px",overflow:"hidden"},pdfContainer:{flex:1,overflowY:"auto",padding:"8px"},header:{borderBottom:"1px solid #e5e7eb"}};function r(e,i=0){if("number"==typeof e)return Number.isFinite(e)?e:i;if(!e||"string"!=typeof e||!e.trim())return i;let r="";try{r=e.trim().replace(/[^\d.-]/g,"").replace(/(?!^)-/g,"")}catch(e){return console.error("Regex processing failed",e),i}const o=Number(r);return Number.isFinite(o)?o:i}export{i as citationViewerStyles,e as mapToHighlightAreas,r as stringToNumber};
|
|
2
|
-
//# sourceMappingURL=pdfCitationUtils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pdfCitationUtils.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|