@e-llm-studio/citation 0.0.141 → 0.0.143
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 +21 -26
- package/dist/assests/svg/PdfViewerIcons.js +2 -0
- package/dist/assests/svg/PdfViewerIcons.js.map +1 -0
- package/dist/cjs/assests/svg/PdfViewerIcons.js +2 -0
- package/dist/cjs/assests/svg/PdfViewerIcons.js.map +1 -0
- package/dist/cjs/features/Bookemon/BookemonContent.js +1 -1
- package/dist/cjs/features/PdfViewer/PdfContainer.js +1 -1
- package/dist/cjs/features/PdfViewer/PdfStyle.js +1 -1
- package/dist/cjs/features/PdfViewer/PdfToolbar.js +1 -1
- package/dist/cjs/features/PdfViewer/PdfViewer.js +1 -1
- package/dist/features/Bookemon/BookemonContent.js +1 -1
- package/dist/features/PdfViewer/PdfContainer.js +1 -1
- package/dist/features/PdfViewer/PdfStyle.js +1 -1
- package/dist/features/PdfViewer/PdfToolbar.js +1 -1
- package/dist/features/PdfViewer/PdfViewer.js +1 -1
- package/dist/types/src/PdfViewerTest.d.ts.map +1 -1
- package/dist/types/src/assests/svg/PdfViewerIcons.d.ts +5 -0
- package/dist/types/src/assests/svg/PdfViewerIcons.d.ts.map +1 -0
- package/dist/types/src/features/Bookemon/BookemonContent.d.ts.map +1 -1
- package/dist/types/src/features/PdfViewer/PdfContainer.d.ts +3 -1
- package/dist/types/src/features/PdfViewer/PdfContainer.d.ts.map +1 -1
- package/dist/types/src/features/PdfViewer/PdfStyle.d.ts +29 -1
- package/dist/types/src/features/PdfViewer/PdfStyle.d.ts.map +1 -1
- package/dist/types/src/features/PdfViewer/PdfToolbar.d.ts +10 -1
- package/dist/types/src/features/PdfViewer/PdfToolbar.d.ts.map +1 -1
- package/dist/types/src/features/PdfViewer/PdfViewer.d.ts +34 -1
- package/dist/types/src/features/PdfViewer/PdfViewer.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1086,32 +1086,29 @@ import PaginatedTable from '@e-llm-studio/citation/PaginatedTable'
|
|
|
1086
1086
|
|
|
1087
1087
|
|
|
1088
1088
|
## PdfViewer
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
PdfViewer is a specialized React component designed to render PDF documents with built-in capabilities for text highlighting and highlight navigation. It is built on top of the @react-pdf-viewer library and is optimized for review workflows. It takes a specific list of keywords to highlight and a list of relevant pages, allowing users to "jump" directly between pages that contain relevant information.
|
|
1093
|
-
|
|
1094
|
-
### Features
|
|
1095
|
-
|
|
1096
|
-
- **Text highlighting** - Automatically highlight keywords within the document
|
|
1097
|
-
- **Highlight navigation** - Jump between pages with relevant content
|
|
1098
|
-
- **Zoom controls** - In/out zoom and popover zoom options
|
|
1099
|
-
- **Page navigation** - Navigate between highlighted pages
|
|
1100
|
-
- **Custom toolbar** - Sticky header with navigation controls
|
|
1101
|
-
- **Responsive design** - Works well on various screen sizes
|
|
1089
|
+
### Overview
|
|
1090
|
+
PdfViewer is a specialized, highly customizable React component designed to render PDF documents with built-in capabilities for text highlighting and highlight navigation. It is built on top of the @react-pdf-viewer library and is optimized for review workflows. It takes a specific list of keywords to highlight and a list of relevant pages, allowing users to "jump" directly between pages that contain relevant information. It supports deep UI overrides via custom classes, styles, and icons to fit seamlessly into any theme.FeaturesText highlighting - Automatically highlight keywords within the documentHighlight navigation - Jump between pages with relevant contentZoom controls - In/out zoom and popover zoom optionsPage navigation - Navigate between highlighted pagesCustom toolbar - Sticky header with navigation controlsDeep UI Customization - Extensive customization through customStyles, customClasses, and customIcons propsResponsive design - Works well on various screen sizesUsageTypeScriptimport PdfViewer from '@e-llm-studio/citation/PdfViewer'
|
|
1102
1091
|
|
|
1103
1092
|
### Usage
|
|
1104
|
-
|
|
1105
1093
|
```tsx
|
|
1106
1094
|
import PdfViewer from '@e-llm-studio/citation/PdfViewer'
|
|
1107
|
-
|
|
1108
1095
|
<PdfViewer
|
|
1109
1096
|
pdfUrl="https://example.com/contract.pdf"
|
|
1110
1097
|
highlightText={["confidential", "termination", "liability"]}
|
|
1111
1098
|
highlightPages={[3, 8, 12]}
|
|
1112
1099
|
jumpToPageValue={3}
|
|
1100
|
+
// Optional Customization Hooks
|
|
1101
|
+
customStyles={{
|
|
1102
|
+
pdfIconWrapper: { background: "#ffe4e6", border: "6px solid #fff1f2" },
|
|
1103
|
+
pdfName: { color: "#e11d48", fontWeight: "bold" },
|
|
1104
|
+
}}
|
|
1105
|
+
customClasses={{
|
|
1106
|
+
actionButton: "p-2 hover:bg-red-100 rounded-lg transition-colors text-red-500",
|
|
1107
|
+
}}
|
|
1108
|
+
customIcons={{
|
|
1109
|
+
pdfIcon: <MyCustomIcon />
|
|
1110
|
+
}}
|
|
1113
1111
|
/>
|
|
1114
|
-
```
|
|
1115
1112
|
|
|
1116
1113
|
### Navigation Behavior
|
|
1117
1114
|
- "Next" button jumps to next page with highlights
|
|
@@ -1119,17 +1116,15 @@ import PdfViewer from '@e-llm-studio/citation/PdfViewer'
|
|
|
1119
1116
|
- Direct page navigation based on highlightPages array
|
|
1120
1117
|
- Auto-zoom to actual size on load
|
|
1121
1118
|
|
|
1122
|
-
|
|
1123
1119
|
### Props
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
---
|
|
1120
|
+
Prop Name Type Description
|
|
1121
|
+
pdfUrl - string - The direct URL to the PDF file to be rendered
|
|
1122
|
+
highlightText - string[] - An array of keywords or phrases to automatically highlight
|
|
1123
|
+
highlightPages - number[] - An object of page numbers (1-based) where highlights appear
|
|
1124
|
+
jumpToPageValue - number - The specific page number to open the document at initially
|
|
1125
|
+
customStyles - CustomStylesType - Optional object to override default inline styles for elements like the viewer wrapper, header, or icons
|
|
1126
|
+
customClasses - CustomClassesType - Optional object to inject custom CSS or Tailwind classes
|
|
1127
|
+
customIcons - CustomIconsType - Optional object to replace default SVG icons (pdfIcon, fullScreenIcon, downloadIcon, closeIcon)
|
|
1133
1128
|
|
|
1134
1129
|
## ProjectAccordion
|
|
1135
1130
|
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as n,jsxs as i}from"react/jsx-runtime";var t=function(){return n("svg",e({xmlns:"http://www.w3.org/2000/svg",style:{width:"12px",height:"15px"},viewBox:"0 0 14 17",fill:"none"},{children:n("path",{d:"M8.25 0.952148V4.05005C8.25 4.47009 8.25 4.68011 8.33175 4.84055C8.40365 4.98167 8.51839 5.0964 8.65951 5.16831C8.81994 5.25005 9.02996 5.25005 9.45 5.25005H12.5479M9.75 9H3.75M9.75 12H3.75M5.25 6H3.75M8.25 0.75H4.35C3.08988 0.75 2.45982 0.75 1.97852 0.995235C1.55516 1.21095 1.21095 1.55516 0.995235 1.97852C0.75 2.45982 0.75 3.08988 0.75 4.35V12.15C0.75 13.4101 0.75 14.0402 0.995235 14.5215C1.21095 14.9448 1.55516 15.289 1.97852 15.5048C2.45982 15.75 3.08988 15.75 4.35 15.75H9.15C10.4101 15.75 11.0402 15.75 11.5215 15.5048C11.9448 15.289 12.289 14.9448 12.5048 14.5215C12.75 14.0402 12.75 13.4101 12.75 12.15V5.25L8.25 0.75Z",stroke:"#0019FF",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))},o=function(){return n("svg",e({width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:n("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"})}))},r=function(){return i("svg",e({width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[n("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),n("polyline",{points:"7 10 12 15 17 10"}),n("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}))},h=function(){return i("svg",e({width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[n("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}))};export{h as DefaultCloseIcon,r as DefaultDownloadIcon,o as DefaultFullScreenIcon,t as DefaultPdfIcon};
|
|
2
|
+
//# sourceMappingURL=PdfViewerIcons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PdfViewerIcons.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime");exports.DefaultCloseIcon=function(){return n.jsxs("svg",e.__assign({width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}))},exports.DefaultDownloadIcon=function(){return n.jsxs("svg",e.__assign({width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[n.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),n.jsx("polyline",{points:"7 10 12 15 17 10"}),n.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}))},exports.DefaultFullScreenIcon=function(){return n.jsx("svg",e.__assign({width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:n.jsx("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"})}))},exports.DefaultPdfIcon=function(){return n.jsx("svg",e.__assign({xmlns:"http://www.w3.org/2000/svg",style:{width:"12px",height:"15px"},viewBox:"0 0 14 17",fill:"none"},{children:n.jsx("path",{d:"M8.25 0.952148V4.05005C8.25 4.47009 8.25 4.68011 8.33175 4.84055C8.40365 4.98167 8.51839 5.0964 8.65951 5.16831C8.81994 5.25005 9.02996 5.25005 9.45 5.25005H12.5479M9.75 9H3.75M9.75 12H3.75M5.25 6H3.75M8.25 0.75H4.35C3.08988 0.75 2.45982 0.75 1.97852 0.995235C1.55516 1.21095 1.21095 1.55516 0.995235 1.97852C0.75 2.45982 0.75 3.08988 0.75 4.35V12.15C0.75 13.4101 0.75 14.0402 0.995235 14.5215C1.21095 14.9448 1.55516 15.289 1.97852 15.5048C2.45982 15.75 3.08988 15.75 4.35 15.75H9.15C10.4101 15.75 11.0402 15.75 11.5215 15.5048C11.9448 15.289 12.289 14.9448 12.5048 14.5215C12.75 14.0402 12.75 13.4101 12.75 12.15V5.25L8.25 0.75Z",stroke:"#0019FF",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))};
|
|
2
|
+
//# sourceMappingURL=PdfViewerIcons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PdfViewerIcons.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),i=require("react"),n=require("react-resizable-panels"),o=require("@mui/material/Accordion"),r=require("@mui/material/AccordionSummary"),a=require("@mui/material/Typography"),l=require("@mui/material/AccordionDetails"),s=require("@mui/material/IconButton"),d=require("./BookDetailsCard/BookDetailsCard.js"),u=require("./BookOverviewCard/BookOverviewCard.js"),c=require("./BookElementsCard/BookElementsCard.js"),h=require("./BookCopyrightsCard/BookCopyrightsCard.js"),g=require("./BookPeopleAwardsCard/BookPeopleAwardsCard.js"),x=require("./BookPreview/BookPreview.js"),p=require("@mui/icons-material/ExpandMore"),f=require("@mui/icons-material/Close");function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var v=_(o),b=_(r),m=_(a),y=_(l),j=_(s),k=_(p),C=_(f),w={dialogPaper:{maxWidth:"none",fontFamily:"Inter, sans-serif"},dialogHeight:{overflow:"hidden",height:"90vh",position:"relative"},dialogContent:{padding:0,backgroundColor:"#FFFFFF"},container:{display:"flex",height:"100%",width:"100%",alignItems:"flex-start"},leftPanel:{height:"100%",padding:"24px",overflowY:"auto",backgroundColor:"#F3F4F6",borderRadius:"12px",boxSizing:"border-box"},rightPanel:{width:"40%",backgroundColor:"#FFFFFF",height:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-start",overflow:"auto",flex:1,boxSizing:"border-box",overflowY:"auto"},accordion:{borderRadius:"12px",boxShadow:"none",marginBottom:"24px"},accordionSummary:{paddingLeft:"16px",paddingRight:"16px"},accordionDetails:{paddingLeft:"16px",paddingRight:"16px",paddingBottom:"16px"},heading:{fontWeight:"bold",color:"#000000",fontSize:"16px"},blurOverlay:{position:"absolute",top:0,left:0,width:"100%",height:"100%",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",backgroundColor:"rgba(255, 255, 255, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:10,borderRadius:"12px"},closeButton:{position:"absolute",top:"8px",right:"8px",color:"#111827"},resizeHandle:{width:"10px",backgroundColor:"#e5e7eb",cursor:"col-resize",display:"flex",alignItems:"center",justifyContent:"center"},iconContainer:{display:"flex",flexDirection:"column",gap:"4px"},dot:{width:"4px",height:"4px",backgroundColor:"#6b7280",borderRadius:"50%"},resizeHandleBar:{width:"2px",height:"24px",backgroundColor:"#666",borderRadius:"2px"}},S={wrapper:{alignItems:"center",justifyContent:"center",textAlign:"center"},inner:{width:"100%"},iconWrapper:{width:"80px",height:"80px",background:"linear-gradient(to right, #3B82F6, #9333EA)",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 24px auto"},icon:{width:"40px",height:"40px",color:"#FFFFFF"},heading:{fontSize:"36px",fontWeight:"bold",color:"#9333EA",marginBottom:"16px"},text:{fontSize:"18px",color:"#4B5563",lineHeight:1.6,textAlign:"center"},errorState:{color:"#CE3928",padding:"18px 0px",display:"flex",justifyContent:"center",width:"100%"}},B=function(i){var n=i.header,o=i.subheader,r=i.icon;return t.jsx("div",e.__assign({style:S.wrapper},{children:t.jsxs("div",e.__assign({style:S.inner},{children:[t.jsx("div",e.__assign({style:{marginBottom:"32px"}},{children:t.jsx("div",e.__assign({style:S.iconWrapper},{children:r}))})),t.jsxs("div",{children:[t.jsx("h1",e.__assign({style:S.heading},{children:n})),t.jsx("p",e.__assign({style:S.text},{children:o}))]})]}))}))};exports.BookemonContent=function(o){var r=o.showComingSoon,a=o.onClose,l=o.highlightTerms,s=o.data,p=o.customStyle,f=o.comingSoonData,_=o.isNonHighlightedBlur,S=o.isBlurToggleVisible,D=o.isBookemon,F=o.getHighlightContent,P=o.handleFetchManuscriptElements,q=o.isBookPreview,E=o.isDialog,H=o.defaultElementPages,I=o.citationType,T=o.citationSubTitle,z=i.useState({textToHighLight:"",content:""}),M=z[0],R=z[1],A=i.useState(1),O=A[0],L=A[1],V=i.useState(!1),W=V[0],N=V[1],Q=i.useState("Book Preview"),Y=Q[0],G=Q[1],J=i.useState(70),K=J[0],U=J[1],X=i.useRef(null),Z=i.useState(!1),$=Z[0],ee=Z[1],te=i.useRef(null),ie=i.useRef(null),ne=i.useRef(null),oe=i.useRef(null),re=i.useRef(null),ae=function(t,i,n,o){return void 0===o&&(o=0),e.__awaiter(void 0,void 0,void 0,function(){var r,a,l,s,d,u,c,h,g,x,p,f,_,v,b,m;return e.__generator(this,function(e){switch(e.label){case 0:R({textToHighLight:"",content:""}),ee(!1),N(!0),G(i),e.label=1;case 1:return e.trys.push([1,5,6,7]),n&&0!==n.length?[4,null==F?void 0:F([n[o]])]:(N(!1),U(70),null===(b=X.current)||void 0===b||b.resize(70),[2]);case 2:if(r=e.sent(),a=(null==r?void 0:r.data)||r||[],!Array.isArray(a)||0===a.length)return ee(!0),N(!1),[2];for(s=(l=function(e){return e?e.replace(/<[^>]*>/g," ").replace(/ /g," ").replace(/[\u200B-\u200D\uFEFF]/g,"").replace(/[\u2018\u2019]/g,"'").replace(/[\u201C\u201D]/g,'"').replace(/[\u2013\u2014]/g,"-").replace(/[.,!?;:'"(){}\[\]—–…\/\\@#&*_|\^~%=+<>`]/g,"").replace(/\s+/g," ").trim().toLowerCase():""})(t),d=null,u=0,c=a;u<c.length;u++)if(f=c[u],l(f.normalizedContent||f.htmlContent).includes(s)){d=f;break}if(!d)for(h=s.split(" ").filter(Boolean);h.length>0;){for(g=h.join(" "),x=0,p=a;x<p.length;x++)if(f=p[x],l(f.normalizedContent||f.htmlContent).includes(g)){d=f;break}if(d)break;h.pop()}return _=a.map(function(e){return e.htmlContent}).join("\n"),R({textToHighLight:d?d.htmlContent:"",content:_}),U(50),null===(m=X.current)||void 0===m||m.resize(50),!d&&o+1<n.length?[4,ae(t,i,n,o+1)]:[3,4];case 3:return[2,e.sent()];case 4:return[2];case 5:return v=e.sent(),console.error("Highlight error:",v),ee(!0),[3,7];case 6:return N(!1),[7];case 7:return[2]}})})},le=i.useState(!1),se=le[0],de=le[1],ue=i.useState(!1),ce=ue[0],he=ue[1],ge=i.useState(!1),xe=ge[0],pe=ge[1],fe=i.useState(!1),_e=fe[0],ve=fe[1],be=i.useState(!1),me=be[0],ye=be[1],je=i.useState(!1),ke=je[0],Ce=je[1],we=i.useState(!1),Se=we[0],Be=we[1],De=i.useState(!1),Fe=De[0],Pe=De[1],qe=i.useState(!1),Ee=qe[0],He=qe[1],Ie=i.useState(!1),Te=Ie[0],ze=Ie[1];i.useEffect(function(){se&&Ce(!0),ce&&Be(!0),xe&&Pe(!0),_e&&He(!0),me&&ze(!0)},[se,ce,xe,_e,me]);var Me=s.bookAwards,Re=s.bookCopyRight,Ae=s.bookDetails,Oe=s.bookElements,Le=s.bookOverView,Ve=s.bookCoverImage,We=null==Ae?void 0:Ae.isbn,Ne=null!=a?a:function(){},Qe=void 0!==T&&!!T.length&&["notable_quotes","location_details","notable_characters"].includes(T);return t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},w.dialogContent),E?w.dialogHeight:{})},{children:[!r&&t.jsx("div",e.__assign({style:w.container},{children:t.jsxs(n.PanelGroup,e.__assign({direction:"horizontal"},{children:[t.jsx(n.Panel,e.__assign({order:1,ref:X,defaultSize:K||70},{children:t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},null==w?void 0:w.leftPanel),null==p?void 0:p.leftPanel)},{children:[t.jsx("div",e.__assign({ref:te,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:t.jsxs(v.default,e.__assign({expanded:ke,onChange:function(e,t){return Ce(t)},slotProps:{transition:{onEntered:function(){var e=te.current,t=null==e?void 0:e.querySelector('[data-highlight="true"]');t&&e&&!e.dataset.scrolled&&(t.scrollIntoView({behavior:"smooth",block:"center"}),e.dataset.scrolled="true")}}},elevation:0,style:w.accordion},{children:[t.jsx(b.default,e.__assign({expandIcon:t.jsx(k.default,{}),style:w.accordionSummary},{children:t.jsx(m.default,e.__assign({style:w.heading},{children:"Book Overview"}))})),t.jsx(y.default,e.__assign({style:w.accordionDetails},{children:Le&&Object.keys(Le).length>0?t.jsx(u.default,{data:Le,highlightTerms:l,onHighlightMatch:de,highlightEnabled:!Qe}):t.jsx("div",e.__assign({style:w.errorState},{children:"No overview data available."}))}))]}))})),t.jsx("div",e.__assign({ref:ie,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:t.jsxs(v.default,e.__assign({elevation:0,style:w.accordion,expanded:Se,onChange:function(e,t){return Be(t)},slotProps:{transition:{onEntered:function(){var e=ie.current;if(e){var t=e.querySelector('[data-highlight="true"]');if(t){t.scrollIntoView({behavior:"smooth",block:"center"});var i=new MutationObserver(function(){var t=e.querySelector('[data-highlight="true"]');t&&t.scrollIntoView({behavior:"auto",block:"center"}),i.disconnect()});i.observe(e,{childList:!0,subtree:!0})}}}}}},{children:[t.jsx(b.default,e.__assign({expandIcon:t.jsx(k.default,{}),style:w.accordionSummary},{children:t.jsx(m.default,e.__assign({style:w.heading},{children:"Book Manuscript Elements"}))})),t.jsx(y.default,e.__assign({style:w.accordionDetails},{children:t.jsx(c.default,{data:Oe,title:(null==Le?void 0:Le.title)||"",handleFetchManuscriptElements:P,BookIsbn:We,updateQuotesToHighLight:ae,highlightTerms:l,onHighlightMatch:he,defaultPages:H,citationType:I,citationSubTitle:T,highlightEnabled:Qe})}))]}))})),t.jsx("div",e.__assign({ref:ne,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:t.jsxs(v.default,e.__assign({expanded:Fe,onChange:function(e,t){return Pe(t)},elevation:0,style:w.accordion,slotProps:{transition:{onEntered:function(){var e=ne.current,t=null==e?void 0:e.querySelector('[data-highlight="true"]');t&&e&&!e.dataset.scrolled&&(t.scrollIntoView({behavior:"smooth",block:"center"}),e.dataset.scrolled="true")}}}},{children:[t.jsx(b.default,e.__assign({expandIcon:t.jsx(k.default,{}),style:w.accordionSummary},{children:t.jsx(m.default,e.__assign({style:w.heading},{children:"Book Metadata Details"}))})),t.jsx(y.default,e.__assign({style:w.accordionDetails},{children:Ae&&Object.keys(Ae).length>0?t.jsx(d.default,{data:Ae,highlightTerms:l,onHighlightMatch:pe,highlightEnabled:!Qe,citationType:I,citationSubTitle:T}):t.jsx("div",e.__assign({style:w.errorState},{children:"No Book Metadata data available."}))}))]}))})),t.jsx("div",e.__assign({ref:oe,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:t.jsxs(v.default,e.__assign({elevation:0,style:w.accordion,expanded:Ee,onChange:function(e,t){return He(t)},slotProps:{transition:{onEntered:function(){var e=oe.current,t=null==e?void 0:e.querySelector('[data-highlight="true"]');t&&e&&!e.dataset.scrolled&&(t.scrollIntoView({behavior:"smooth",block:"center"}),e.dataset.scrolled="true")}}}},{children:[t.jsx(b.default,e.__assign({expandIcon:t.jsx(k.default,{}),style:w.accordionSummary},{children:t.jsx(m.default,e.__assign({style:w.heading},{children:"Copyrights & Marketing"}))})),t.jsx(y.default,e.__assign({style:w.accordionDetails},{children:Re&&Object.keys(Re).length>0?t.jsx(h.default,{data:Re,highlightTerms:l,onHighlightMatch:ve,highlightEnabled:!Qe}):t.jsx("div",e.__assign({style:w.errorState},{children:"No Copyrights & Marketing data available."}))}))]}))})),t.jsx("div",e.__assign({ref:re},{children:t.jsxs(v.default,e.__assign({elevation:0,style:w.accordion,expanded:Te,onChange:function(e,t){return ze(t)},slotProps:{transition:{onEntered:function(){var e=re.current,t=null==e?void 0:e.querySelector('[data-highlight="true"]');t&&e&&!e.dataset.scrolled&&(t.scrollIntoView({behavior:"smooth",block:"center"}),e.dataset.scrolled="true")}}}},{children:[t.jsx(b.default,e.__assign({expandIcon:t.jsx(k.default,{}),style:w.accordionSummary},{children:t.jsx(m.default,e.__assign({style:w.heading},{children:"People & Awards"}))})),t.jsx(y.default,e.__assign({style:w.accordionDetails},{children:Me&&Object.keys(Me).length>0?t.jsx(g.default,{data:Me,highlightTerms:l,onHighlightMatch:ye,highlightEnabled:!Qe}):t.jsx("div",e.__assign({style:w.errorState},{children:"No People & Awards data available."}))}))]}))}))]}))})),q&&t.jsx(n.PanelResizeHandle,{style:{width:"3px",background:"#D1D5DC",cursor:"col-resize"}}),q&&t.jsx(n.Panel,e.__assign({order:2,minSize:30,maxSize:50,style:{overflow:"visible",position:"relative",transition:"all 300ms ease-in-out",WebkitTransition:"all 300ms ease-in-out"}},{children:t.jsx(x.default,{bookOverView:Le,bookCoverImage:Ve,onClose:Ne,clickableElementCategory:Y,quotesToHighLightData:M,updateQuotesToHighLight:ae,citationLoad:W,previewPage:O,setPreviewPage:L,customStyle:p,comingSoonData:f,isNonHighlightedBlur:_,isBlurToggleVisible:S,isBookemon:D,noHtmlContent:$})}))]}))})),r&&t.jsxs("div",e.__assign({style:w.blurOverlay},{children:[t.jsx(j.default,e.__assign({style:w.closeButton,onClick:a,size:"large"},{children:t.jsx(C.default,{})})),t.jsx(B,{header:null==f?void 0:f.header,subheader:null==f?void 0:f.subheader,icon:null==f?void 0:f.icon})]}))]}))};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),i=require("react"),n=require("react-resizable-panels"),o=require("@mui/material/Accordion"),r=require("@mui/material/AccordionSummary"),a=require("@mui/material/Typography"),l=require("@mui/material/AccordionDetails"),s=require("@mui/material/IconButton"),d=require("./BookDetailsCard/BookDetailsCard.js"),u=require("./BookOverviewCard/BookOverviewCard.js"),c=require("./BookElementsCard/BookElementsCard.js"),h=require("./BookCopyrightsCard/BookCopyrightsCard.js"),g=require("./BookPeopleAwardsCard/BookPeopleAwardsCard.js"),x=require("./BookPreview/BookPreview.js"),f=require("@mui/icons-material/ExpandMore"),p=require("@mui/icons-material/Close");function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var v=_(o),m=_(r),b=_(a),y=_(l),j=_(s),k=_(f),C=_(p),w={dialogPaper:{maxWidth:"none",fontFamily:"Inter, sans-serif"},dialogHeight:{overflow:"hidden",height:"90vh",position:"relative"},dialogContent:{padding:0,backgroundColor:"#FFFFFF"},container:{display:"flex",height:"100%",width:"100%",alignItems:"flex-start"},leftPanel:{height:"100%",padding:"24px",overflowY:"auto",backgroundColor:"#F3F4F6",borderRadius:"12px",boxSizing:"border-box"},rightPanel:{width:"40%",backgroundColor:"#FFFFFF",height:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-start",overflow:"auto",flex:1,boxSizing:"border-box",overflowY:"auto"},accordion:{borderRadius:"12px",boxShadow:"none",marginBottom:"24px"},accordionSummary:{paddingLeft:"16px",paddingRight:"16px"},accordionDetails:{paddingLeft:"16px",paddingRight:"16px",paddingBottom:"16px"},heading:{fontWeight:"bold",color:"#000000",fontSize:"16px"},blurOverlay:{position:"absolute",top:0,left:0,width:"100%",height:"100%",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",backgroundColor:"rgba(255, 255, 255, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:10,borderRadius:"12px"},closeButton:{position:"absolute",top:"8px",right:"8px",color:"#111827"},resizeHandle:{width:"10px",backgroundColor:"#e5e7eb",cursor:"col-resize",display:"flex",alignItems:"center",justifyContent:"center"},iconContainer:{display:"flex",flexDirection:"column",gap:"4px"},dot:{width:"4px",height:"4px",backgroundColor:"#6b7280",borderRadius:"50%"},resizeHandleBar:{width:"2px",height:"24px",backgroundColor:"#666",borderRadius:"2px"}},S={wrapper:{alignItems:"center",justifyContent:"center",textAlign:"center"},inner:{width:"100%"},iconWrapper:{width:"80px",height:"80px",background:"linear-gradient(to right, #3B82F6, #9333EA)",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 24px auto"},icon:{width:"40px",height:"40px",color:"#FFFFFF"},heading:{fontSize:"36px",fontWeight:"bold",color:"#9333EA",marginBottom:"16px"},text:{fontSize:"18px",color:"#4B5563",lineHeight:1.6,textAlign:"center"},errorState:{color:"#CE3928",padding:"18px 0px",display:"flex",justifyContent:"center",width:"100%"}},B=function(i){var n=i.header,o=i.subheader,r=i.icon;return t.jsx("div",e.__assign({style:S.wrapper},{children:t.jsxs("div",e.__assign({style:S.inner},{children:[t.jsx("div",e.__assign({style:{marginBottom:"32px"}},{children:t.jsx("div",e.__assign({style:S.iconWrapper},{children:r}))})),t.jsxs("div",{children:[t.jsx("h1",e.__assign({style:S.heading},{children:n})),t.jsx("p",e.__assign({style:S.text},{children:o}))]})]}))}))};exports.BookemonContent=function(o){var r=o.showComingSoon,a=o.onClose,l=o.highlightTerms,s=o.data,f=o.customStyle,p=o.comingSoonData,_=o.isNonHighlightedBlur,S=o.isBlurToggleVisible,D=o.isBookemon,F=o.getHighlightContent,P=o.handleFetchManuscriptElements,q=o.isBookPreview,E=o.isDialog,T=o.defaultElementPages,H=o.citationType,I=o.citationSubTitle,z=i.useState({textToHighLight:"",content:""}),M=z[0],R=z[1],A=i.useState(1),O=A[0],L=A[1],V=i.useState(!1),N=V[0],W=V[1],Q=i.useState("Book Preview"),Y=Q[0],G=Q[1],J=i.useState(70),K=J[0],U=J[1],X=i.useRef(null),Z=i.useState(!1),$=Z[0],ee=Z[1],te=i.useRef(null),ie=i.useRef(null),ne=i.useRef(null),oe=i.useRef(null),re=i.useRef(null),ae=function(t,i,n,o){return void 0===o&&(o=0),e.__awaiter(void 0,void 0,void 0,function(){var r,a,l,s,d,u,c,h,g,x,f,p,_,v,m,b;return e.__generator(this,function(e){switch(e.label){case 0:R({textToHighLight:"",content:""}),ee(!1),W(!0),G(i),e.label=1;case 1:return e.trys.push([1,5,6,7]),n&&0!==n.length?[4,null==F?void 0:F([n[o]])]:(W(!1),U(70),null===(m=X.current)||void 0===m||m.resize(70),[2]);case 2:if(r=e.sent(),a=(null==r?void 0:r.data)||r||[],!Array.isArray(a)||0===a.length)return ee(!0),W(!1),[2];for(s=(l=function(e){return e?e.replace(/<[^>]*>/g," ").replace(/ /g," ").replace(/[\u200B-\u200D\uFEFF]/g,"").replace(/[\u2018\u2019]/g,"'").replace(/[\u201C\u201D]/g,'"').replace(/[\u2013\u2014]/g,"-").replace(/[.,!?;:'"(){}\[\]—–…\/\\@#&*_|\^~%=+<>`]/g,"").replace(/\s+/g," ").trim().toLowerCase():""})(t),d=null,u=0,c=a;u<c.length;u++)if(p=c[u],l(p.normalizedContent||p.htmlContent).includes(s)){d=p;break}if(!d)for(h=s.split(" ").filter(Boolean);h.length>0;){for(g=h.join(" "),x=0,f=a;x<f.length;x++)if(p=f[x],l(p.normalizedContent||p.htmlContent).includes(g)){d=p;break}if(d)break;h.pop()}return _=a.map(function(e){return e.htmlContent}).join("\n"),R({textToHighLight:d?d.htmlContent:"",content:_}),U(50),null===(b=X.current)||void 0===b||b.resize(50),!d&&o+1<n.length?[4,ae(t,i,n,o+1)]:[3,4];case 3:return[2,e.sent()];case 4:return[2];case 5:return v=e.sent(),console.error("Highlight error:",v),ee(!0),[3,7];case 6:return W(!1),[7];case 7:return[2]}})})},le=i.useState(!1),se=le[0],de=le[1],ue=i.useState(!1),ce=ue[0],he=ue[1],ge=i.useState(!1),xe=ge[0],fe=ge[1],pe=i.useState(!1),_e=pe[0],ve=pe[1],me=i.useState(!1),be=me[0],ye=me[1],je=i.useState(!1),ke=je[0],Ce=je[1],we=i.useState(!1),Se=we[0],Be=we[1],De=i.useState(!1),Fe=De[0],Pe=De[1],qe=i.useState(!1),Ee=qe[0],Te=qe[1],He=i.useState(!1),Ie=He[0],ze=He[1];i.useEffect(function(){se&&Ce(!0),ce&&Be(!0),xe&&Pe(!0),_e&&Te(!0),be&&ze(!0)},[se,ce,xe,_e,be]);var Me=s.bookAwards,Re=s.bookCopyRight,Ae=s.bookDetails,Oe=s.bookElements,Le=s.bookOverView,Ve=s.bookCoverImage,Ne=null==Ae?void 0:Ae.isbn,We=null!=a?a:function(){},Qe=void 0!==I&&!!I.length&&["notable_quotes","location_details","notable_characters"].includes(I);return t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},w.dialogContent),E?w.dialogHeight:{})},{children:[!r&&t.jsx("div",e.__assign({style:w.container},{children:t.jsxs(n.PanelGroup,e.__assign({direction:"horizontal"},{children:[t.jsx(n.Panel,e.__assign({order:1,ref:X,defaultSize:K||70},{children:t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},null==w?void 0:w.leftPanel),null==f?void 0:f.leftPanel)},{children:[t.jsx("div",e.__assign({ref:te,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:t.jsxs(v.default,e.__assign({expanded:ke,onChange:function(e,t){return Ce(t)},slotProps:{transition:{onEntered:function(){var e=te.current,t=null==e?void 0:e.querySelector('[data-highlight="true"]');t&&e&&!e.dataset.scrolled&&(t.scrollIntoView({behavior:"smooth",block:"center"}),e.dataset.scrolled="true")}}},elevation:0,style:w.accordion},{children:[t.jsx(m.default,e.__assign({expandIcon:t.jsx(k.default,{}),style:w.accordionSummary},{children:t.jsx(b.default,e.__assign({style:w.heading},{children:"Book Overview"}))})),t.jsx(y.default,e.__assign({style:w.accordionDetails},{children:Le&&Object.keys(Le).length>0?t.jsx(u.default,{data:Le,highlightTerms:l,onHighlightMatch:de,highlightEnabled:!Qe}):t.jsx("div",e.__assign({style:w.errorState},{children:"No overview data available."}))}))]}))})),t.jsx("div",e.__assign({ref:ie,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:t.jsxs(v.default,e.__assign({elevation:0,style:w.accordion,expanded:Se,onChange:function(e,t){return Be(t)},slotProps:{transition:{onEntered:function(){var e=ie.current;if(e){var t=e.querySelector('[data-highlight="true"]');if(t){t.scrollIntoView({behavior:"smooth",block:"center"});var i=!1,n=new MutationObserver(function(t){if(!i&&t.some(function(e){return"childList"===e.type&&e.addedNodes.length>0})){var o=e.querySelector('[data-highlight="true"]');o&&(i=!0,o.scrollIntoView({behavior:"auto",block:"center"}),n.disconnect())}});n.observe(e,{childList:!0,subtree:!0}),setTimeout(function(){return n.disconnect()},2e3)}}}}}},{children:[t.jsx(m.default,e.__assign({expandIcon:t.jsx(k.default,{}),style:w.accordionSummary},{children:t.jsx(b.default,e.__assign({style:w.heading},{children:"Book Manuscript Elements"}))})),t.jsx(y.default,e.__assign({style:w.accordionDetails},{children:t.jsx(c.default,{data:Oe,title:(null==Le?void 0:Le.title)||"",handleFetchManuscriptElements:P,BookIsbn:Ne,updateQuotesToHighLight:ae,highlightTerms:l,onHighlightMatch:he,defaultPages:T,citationType:H,citationSubTitle:I,highlightEnabled:Qe})}))]}))})),t.jsx("div",e.__assign({ref:ne,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:t.jsxs(v.default,e.__assign({expanded:Fe,onChange:function(e,t){return Pe(t)},elevation:0,style:w.accordion,slotProps:{transition:{onEntered:function(){var e=ne.current,t=null==e?void 0:e.querySelector('[data-highlight="true"]');t&&e&&!e.dataset.scrolled&&(t.scrollIntoView({behavior:"smooth",block:"center"}),e.dataset.scrolled="true")}}}},{children:[t.jsx(m.default,e.__assign({expandIcon:t.jsx(k.default,{}),style:w.accordionSummary},{children:t.jsx(b.default,e.__assign({style:w.heading},{children:"Book Metadata Details"}))})),t.jsx(y.default,e.__assign({style:w.accordionDetails},{children:Ae&&Object.keys(Ae).length>0?t.jsx(d.default,{data:Ae,highlightTerms:l,onHighlightMatch:fe,highlightEnabled:!Qe,citationType:H,citationSubTitle:I}):t.jsx("div",e.__assign({style:w.errorState},{children:"No Book Metadata data available."}))}))]}))})),t.jsx("div",e.__assign({ref:oe,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:t.jsxs(v.default,e.__assign({elevation:0,style:w.accordion,expanded:Ee,onChange:function(e,t){return Te(t)},slotProps:{transition:{onEntered:function(){var e=oe.current,t=null==e?void 0:e.querySelector('[data-highlight="true"]');t&&e&&!e.dataset.scrolled&&(t.scrollIntoView({behavior:"smooth",block:"center"}),e.dataset.scrolled="true")}}}},{children:[t.jsx(m.default,e.__assign({expandIcon:t.jsx(k.default,{}),style:w.accordionSummary},{children:t.jsx(b.default,e.__assign({style:w.heading},{children:"Copyrights & Marketing"}))})),t.jsx(y.default,e.__assign({style:w.accordionDetails},{children:Re&&Object.keys(Re).length>0?t.jsx(h.default,{data:Re,highlightTerms:l,onHighlightMatch:ve,highlightEnabled:!Qe}):t.jsx("div",e.__assign({style:w.errorState},{children:"No Copyrights & Marketing data available."}))}))]}))})),t.jsx("div",e.__assign({ref:re},{children:t.jsxs(v.default,e.__assign({elevation:0,style:w.accordion,expanded:Ie,onChange:function(e,t){return ze(t)},slotProps:{transition:{onEntered:function(){var e=re.current,t=null==e?void 0:e.querySelector('[data-highlight="true"]');t&&e&&!e.dataset.scrolled&&(t.scrollIntoView({behavior:"smooth",block:"center"}),e.dataset.scrolled="true")}}}},{children:[t.jsx(m.default,e.__assign({expandIcon:t.jsx(k.default,{}),style:w.accordionSummary},{children:t.jsx(b.default,e.__assign({style:w.heading},{children:"People & Awards"}))})),t.jsx(y.default,e.__assign({style:w.accordionDetails},{children:Me&&Object.keys(Me).length>0?t.jsx(g.default,{data:Me,highlightTerms:l,onHighlightMatch:ye,highlightEnabled:!Qe}):t.jsx("div",e.__assign({style:w.errorState},{children:"No People & Awards data available."}))}))]}))}))]}))})),q&&t.jsx(n.PanelResizeHandle,{style:{width:"3px",background:"#D1D5DC",cursor:"col-resize"}}),q&&t.jsx(n.Panel,e.__assign({order:2,minSize:30,maxSize:50,style:{overflow:"visible",position:"relative",transition:"all 300ms ease-in-out",WebkitTransition:"all 300ms ease-in-out"}},{children:t.jsx(x.default,{bookOverView:Le,bookCoverImage:Ve,onClose:We,clickableElementCategory:Y,quotesToHighLightData:M,updateQuotesToHighLight:ae,citationLoad:N,previewPage:O,setPreviewPage:L,customStyle:f,comingSoonData:p,isNonHighlightedBlur:_,isBlurToggleVisible:S,isBookemon:D,noHtmlContent:$})}))]}))})),r&&t.jsxs("div",e.__assign({style:w.blurOverlay},{children:[t.jsx(j.default,e.__assign({style:w.closeButton,onClick:a,size:"large"},{children:t.jsx(C.default,{})})),t.jsx(B,{header:null==p?void 0:p.header,subheader:null==p?void 0:p.subheader,icon:null==p?void 0:p.icon})]}))]}))};
|
|
2
2
|
//# sourceMappingURL=BookemonContent.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react/jsx-runtime"),s=require("@react-pdf-viewer/core"),i=require("./PdfStyle.js"),t="https://unpkg.com/pdfjs-dist@3.11.174/build/pdf.worker.min.js";exports.default=function(l){var n=l.pdfUrl,o=l.plugins,d=l.onLoad,u=l.customStyles;return r.jsx("div",e.__assign({style:e.__assign(e.__assign({},i.pdfStyles.pdfConatiner),null==u?void 0:u.pdfContainer)},{children:r.jsx(s.Worker,e.__assign({workerUrl:t},{children:r.jsx(s.Viewer,{fileUrl:n,defaultScale:s.SpecialZoomLevel.ActualSize,plugins:o,onDocumentLoad:d})}))}))},exports.pdfWorker=t;
|
|
2
2
|
//# sourceMappingURL=PdfContainer.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.pdfStyles={pdfViewer:{borderRadius:"12px",padding:"16px",width:"100%",height:"100%"},card:{border:"2px solid #E5E7EB",backgroundColor:"#FFFFFF",borderRadius:"12px",
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.pdfStyles={pdfViewer:{borderRadius:"12px",padding:"16px",width:"100%",height:"100%"},card:{border:"2px solid #E5E7EB",backgroundColor:"#FFFFFF",borderRadius:"12px",width:"100%"},header:{display:"flex",justifyContent:"space-between",alignItems:"center",position:"relative"},title:{fontSize:"14px",fontWeight:600,color:"#60A3F8",fontFamily:'Roboto, "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif'},toolbar:{display:"flex",alignItems:"center",gap:"8px",position:"relative"},button:{border:"1px solid #DFE5EC",borderRadius:"6px",padding:"4px 8px",fontSize:"14px",cursor:"pointer",backgroundColor:"#FFFFFF"},buttonDisabled:{opacity:.4,cursor:"not-allowed"},counter:{fontSize:"13px",color:"#64748B",margin:"0 6px"},viewerWrapper:{height:"30rem",overflow:"auto",display:"flex",justifyContent:"center",alignItems:"center",border:"1px solid #DEE4EB",borderRadius:"8px"},emptyState:{fontSize:"14px",color:"#EF4444"},pdfConatiner:{height:"100%",overflow:"auto",display:"flex",justifyContent:"center",alignItems:"center"}};
|
|
2
2
|
//# sourceMappingURL=PdfStyle.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),s=require("react/jsx-runtime"),n=require("./PdfStyle.js"),t=require("../../assests/svg/PdfViewerIcons.js");exports.default=function(l){l.highlightIndex,l.totalHighlights;var o=l.controls;l.currentPosition;var r=l.pdfName,i=l.onClose,a=l.pdfUrl,c=l.viewerRef,d=l.customStyles,u=l.customClasses,x=l.customIcons,g=o.ZoomInButton,m=o.ZoomOutButton,f=o.ZoomPopover;o.goToPrevious,o.goToNext;var _=(null==u?void 0:u.actionButton)||"p-1 hover:bg-gray-200 rounded-md transition-colors";return s.jsxs("div",e.__assign({className:(null==u?void 0:u.header)||"flex items-center justify-between mb-3 bg-[#FAFAFA] border-b border-gray-100 rounded-t-xl",style:e.__assign(e.__assign({},n.pdfStyles.header),null==d?void 0:d.header)},{children:[s.jsxs("div",e.__assign({className:"flex items-center gap-3"},{children:[s.jsx("div",e.__assign({style:e.__assign(e.__assign({},{borderRadius:"21px",border:"6px solid #E8F3FF",background:"#D5E8FF",display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",boxSizing:"content-box"}),null==d?void 0:d.pdfIconWrapper)},{children:(null==x?void 0:x.pdfIcon)||s.jsx(t.DefaultPdfIcon,{})})),s.jsx("span",e.__assign({className:(null==u?void 0:u.pdfName)||"text-gray-800 text-sm",style:e.__assign({fontWeight:500},null==d?void 0:d.pdfName)},{children:r}))]})),s.jsxs("div",e.__assign({className:"flex items-center gap-4 text-gray-600"},{children:[s.jsxs("div",e.__assign({className:"flex items-center gap-1"},{children:[s.jsx(m,{}),s.jsx("div",e.__assign({className:"text-sm font-medium w-14 text-center"},{children:s.jsx(f,{})})),s.jsx(g,{})]})),s.jsx("div",{className:"w-px h-5 bg-gray-300 mx-1"}),s.jsxs("div",e.__assign({className:"flex items-center gap-2"},{children:[s.jsx("button",e.__assign({onClick:function(){var e=null==c?void 0:c.current;e&&(document.fullscreenElement?document.exitFullscreen():e.requestFullscreen().catch(function(e){console.error("Error attempting to enable fullscreen: ".concat(e.message))}))},className:_,title:"Full Screen"},{children:(null==x?void 0:x.fullScreenIcon)||s.jsx(t.DefaultFullScreenIcon,{})})),a&&s.jsx("a",e.__assign({href:a,target:"_blank",rel:"noopener noreferrer",className:_,title:"Open in new tab"},{children:(null==x?void 0:x.downloadIcon)||s.jsx(t.DefaultDownloadIcon,{})})),i&&s.jsx("button",e.__assign({onClick:i,className:"".concat(_," ml-1"),title:"Close"},{children:(null==x?void 0:x.closeIcon)||s.jsx(t.DefaultCloseIcon,{})}))]}))]}))]}))};
|
|
2
2
|
//# sourceMappingURL=PdfToolbar.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),s=require("react/jsx-runtime"),i=require("@react-pdf-viewer/core"),r=require("./PdfContainer.js"),t=require("./PdfToolbar.js"),l=require("./PdfStyle.js"),o=require("./usePdfHighlight.js");require("@react-pdf-viewer/zoom/lib/styles/index.css"),require("@react-pdf-viewer/page-navigation/lib/styles/index.css"),require("@react-pdf-viewer/core/lib/styles/index.css"),require("@react-pdf-viewer/search/lib/styles/index.css");var a=require("react");exports.default=function(n){var u=n.pdfUrl,d=n.highlightText,c=n.highlightPages,f=n.jumpToPageValue,g=void 0===f?0:f,p=n.pdfName,h=n.onClose,m=n.customStyles,v=n.customClasses,x=n.customIcons,y=o.PdfHighlightControls(d,c),_=y.highlightIndex,q=y.cursorIndex,j=y.setCursorIndex,P=y.orderedKeys,w=y.totalHighlights,S=y.getValidPosition,b=y.tryJump,C=y.jumpToPage,I=y.zoomTo,A=y.plugins,F=y.controls,T=S(q),V=a.useRef(null);if(!u)return s.jsx("div",e.__assign({style:e.__assign(e.__assign({},l.pdfStyles.emptyState),null==m?void 0:m.emptyState)},{children:"PDF is not available for this selection"}));return s.jsxs("div",e.__assign({ref:V,className:(null==v?void 0:v.pdfViewerWrapper)||"",style:e.__assign(e.__assign(e.__assign({},l.pdfStyles.pdfViewer),{display:"flex",flexDirection:"column",height:"100%",width:"100%",backgroundColor:"#FAFAFA"}),null==m?void 0:m.pdfViewer)},{children:[s.jsx(t.default,{highlightIndex:_,totalHighlights:w,controls:F,currentPosition:T,pdfName:p,onClose:h,pdfUrl:u,viewerRef:V,customStyles:m,customClasses:v,customIcons:x}),s.jsx(r.default,{pdfUrl:u,plugins:A,customStyles:m,onLoad:function(){if(I(i.SpecialZoomLevel.ActualSize),g>0){var e=g-1,s=P[e],r=c[s];j(e),r>0&&C(r-1)}requestAnimationFrame(b)}})]}))};
|
|
2
2
|
//# sourceMappingURL=PdfViewer.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e,__awaiter as t,__generator as o}from"tslib";import{jsxs as i,jsx as r}from"react/jsx-runtime";import{useState as n,useRef as l,useEffect as a}from"react";import{PanelGroup as d,Panel as c,PanelResizeHandle as s}from"react-resizable-panels";import h from"@mui/material/Accordion";import u from"@mui/material/AccordionSummary";import g from"@mui/material/Typography";import p from"@mui/material/AccordionDetails";import m from"@mui/material/IconButton";import f from"./BookDetailsCard/BookDetailsCard.js";import v from"./BookOverviewCard/BookOverviewCard.js";import b from"./BookElementsCard/BookElementsCard.js";import y from"./BookCopyrightsCard/BookCopyrightsCard.js";import x from"./BookPeopleAwardsCard/BookPeopleAwardsCard.js";import k from"./BookPreview/BookPreview.js";import C from"@mui/icons-material/ExpandMore";import w from"@mui/icons-material/Close";var B={dialogPaper:{maxWidth:"none",fontFamily:"Inter, sans-serif"},dialogHeight:{overflow:"hidden",height:"90vh",position:"relative"},dialogContent:{padding:0,backgroundColor:"#FFFFFF"},container:{display:"flex",height:"100%",width:"100%",alignItems:"flex-start"},leftPanel:{height:"100%",padding:"24px",overflowY:"auto",backgroundColor:"#F3F4F6",borderRadius:"12px",boxSizing:"border-box"},rightPanel:{width:"40%",backgroundColor:"#FFFFFF",height:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-start",overflow:"auto",flex:1,boxSizing:"border-box",overflowY:"auto"},accordion:{borderRadius:"12px",boxShadow:"none",marginBottom:"24px"},accordionSummary:{paddingLeft:"16px",paddingRight:"16px"},accordionDetails:{paddingLeft:"16px",paddingRight:"16px",paddingBottom:"16px"},heading:{fontWeight:"bold",color:"#000000",fontSize:"16px"},blurOverlay:{position:"absolute",top:0,left:0,width:"100%",height:"100%",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",backgroundColor:"rgba(255, 255, 255, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:10,borderRadius:"12px"},closeButton:{position:"absolute",top:"8px",right:"8px",color:"#111827"},resizeHandle:{width:"10px",backgroundColor:"#e5e7eb",cursor:"col-resize",display:"flex",alignItems:"center",justifyContent:"center"},iconContainer:{display:"flex",flexDirection:"column",gap:"4px"},dot:{width:"4px",height:"4px",backgroundColor:"#6b7280",borderRadius:"50%"},resizeHandleBar:{width:"2px",height:"24px",backgroundColor:"#666",borderRadius:"2px"}},S={wrapper:{alignItems:"center",justifyContent:"center",textAlign:"center"},inner:{width:"100%"},iconWrapper:{width:"80px",height:"80px",background:"linear-gradient(to right, #3B82F6, #9333EA)",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 24px auto"},icon:{width:"40px",height:"40px",color:"#FFFFFF"},heading:{fontSize:"36px",fontWeight:"bold",color:"#9333EA",marginBottom:"16px"},text:{fontSize:"18px",color:"#4B5563",lineHeight:1.6,textAlign:"center"},errorState:{color:"#CE3928",padding:"18px 0px",display:"flex",justifyContent:"center",width:"100%"}},D=function(t){var o=t.header,n=t.subheader,l=t.icon;return r("div",e({style:S.wrapper},{children:i("div",e({style:S.inner},{children:[r("div",e({style:{marginBottom:"32px"}},{children:r("div",e({style:S.iconWrapper},{children:l}))})),i("div",{children:[r("h1",e({style:S.heading},{children:o})),r("p",e({style:S.text},{children:n}))]})]}))}))},F=function(S){var F=S.showComingSoon,E=S.onClose,P=S.highlightTerms,I=S.data,T=S.customStyle,H=S.comingSoonData,z=S.isNonHighlightedBlur,j=S.isBlurToggleVisible,M=S.isBookemon,A=S.getHighlightContent,O=S.handleFetchManuscriptElements,L=S.isBookPreview,V=S.isDialog,R=S.defaultElementPages,q=S.citationType,W=S.citationSubTitle,N=n({textToHighLight:"",content:""}),_=N[0],Q=N[1],Y=n(1),G=Y[0],J=Y[1],K=n(!1),U=K[0],X=K[1],Z=n("Book Preview"),$=Z[0],ee=Z[1],te=n(70),oe=te[0],ie=te[1],re=l(null),ne=n(!1),le=ne[0],ae=ne[1],de=l(null),ce=l(null),se=l(null),he=l(null),ue=l(null),ge=function(e,i,r,n){return void 0===n&&(n=0),t(void 0,void 0,void 0,function(){var t,l,a,d,c,s,h,u,g,p,m,f,v,b,y,x;return o(this,function(o){switch(o.label){case 0:Q({textToHighLight:"",content:""}),ae(!1),X(!0),ee(i),o.label=1;case 1:return o.trys.push([1,5,6,7]),r&&0!==r.length?[4,null==A?void 0:A([r[n]])]:(X(!1),ie(70),null===(y=re.current)||void 0===y||y.resize(70),[2]);case 2:if(t=o.sent(),l=(null==t?void 0:t.data)||t||[],!Array.isArray(l)||0===l.length)return ae(!0),X(!1),[2];for(d=(a=function(e){return e?e.replace(/<[^>]*>/g," ").replace(/ /g," ").replace(/[\u200B-\u200D\uFEFF]/g,"").replace(/[\u2018\u2019]/g,"'").replace(/[\u201C\u201D]/g,'"').replace(/[\u2013\u2014]/g,"-").replace(/[.,!?;:'"(){}\[\]—–…\/\\@#&*_|\^~%=+<>`]/g,"").replace(/\s+/g," ").trim().toLowerCase():""})(e),c=null,s=0,h=l;s<h.length;s++)if(f=h[s],a(f.normalizedContent||f.htmlContent).includes(d)){c=f;break}if(!c)for(u=d.split(" ").filter(Boolean);u.length>0;){for(g=u.join(" "),p=0,m=l;p<m.length;p++)if(f=m[p],a(f.normalizedContent||f.htmlContent).includes(g)){c=f;break}if(c)break;u.pop()}return v=l.map(function(e){return e.htmlContent}).join("\n"),Q({textToHighLight:c?c.htmlContent:"",content:v}),ie(50),null===(x=re.current)||void 0===x||x.resize(50),!c&&n+1<r.length?[4,ge(e,i,r,n+1)]:[3,4];case 3:return[2,o.sent()];case 4:return[2];case 5:return b=o.sent(),console.error("Highlight error:",b),ae(!0),[3,7];case 6:return X(!1),[7];case 7:return[2]}})})},pe=n(!1),me=pe[0],fe=pe[1],ve=n(!1),be=ve[0],ye=ve[1],xe=n(!1),ke=xe[0],Ce=xe[1],we=n(!1),Be=we[0],Se=we[1],De=n(!1),Fe=De[0],Ee=De[1],Pe=n(!1),Ie=Pe[0],Te=Pe[1],He=n(!1),ze=He[0],je=He[1],Me=n(!1),Ae=Me[0],Oe=Me[1],Le=n(!1),Ve=Le[0],Re=Le[1],qe=n(!1),We=qe[0],Ne=qe[1];a(function(){me&&Te(!0),be&&je(!0),ke&&Oe(!0),Be&&Re(!0),Fe&&Ne(!0)},[me,be,ke,Be,Fe]);var _e=I.bookAwards,Qe=I.bookCopyRight,Ye=I.bookDetails,Ge=I.bookElements,Je=I.bookOverView,Ke=I.bookCoverImage,Ue=null==Ye?void 0:Ye.isbn,Xe=null!=E?E:function(){},Ze=void 0!==W&&!!W.length&&["notable_quotes","location_details","notable_characters"].includes(W);return i("div",e({style:e(e({},B.dialogContent),V?B.dialogHeight:{})},{children:[!F&&r("div",e({style:B.container},{children:i(d,e({direction:"horizontal"},{children:[r(c,e({order:1,ref:re,defaultSize:oe||70},{children:i("div",e({style:e(e({},null==B?void 0:B.leftPanel),null==T?void 0:T.leftPanel)},{children:[r("div",e({ref:de,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:i(h,e({expanded:Ie,onChange:function(e,t){return Te(t)},slotProps:{transition:{onEntered:function(){var e=de.current,t=null==e?void 0:e.querySelector('[data-highlight="true"]');t&&e&&!e.dataset.scrolled&&(t.scrollIntoView({behavior:"smooth",block:"center"}),e.dataset.scrolled="true")}}},elevation:0,style:B.accordion},{children:[r(u,e({expandIcon:r(C,{}),style:B.accordionSummary},{children:r(g,e({style:B.heading},{children:"Book Overview"}))})),r(p,e({style:B.accordionDetails},{children:Je&&Object.keys(Je).length>0?r(v,{data:Je,highlightTerms:P,onHighlightMatch:fe,highlightEnabled:!Ze}):r("div",e({style:B.errorState},{children:"No overview data available."}))}))]}))})),r("div",e({ref:ce,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:i(h,e({elevation:0,style:B.accordion,expanded:ze,onChange:function(e,t){return je(t)},slotProps:{transition:{onEntered:function(){var e=ce.current;if(e){var t=e.querySelector('[data-highlight="true"]');if(t){t.scrollIntoView({behavior:"smooth",block:"center"});var o=new MutationObserver(function(){var t=e.querySelector('[data-highlight="true"]');t&&t.scrollIntoView({behavior:"auto",block:"center"}),o.disconnect()});o.observe(e,{childList:!0,subtree:!0})}}}}}},{children:[r(u,e({expandIcon:r(C,{}),style:B.accordionSummary},{children:r(g,e({style:B.heading},{children:"Book Manuscript Elements"}))})),r(p,e({style:B.accordionDetails},{children:r(b,{data:Ge,title:(null==Je?void 0:Je.title)||"",handleFetchManuscriptElements:O,BookIsbn:Ue,updateQuotesToHighLight:ge,highlightTerms:P,onHighlightMatch:ye,defaultPages:R,citationType:q,citationSubTitle:W,highlightEnabled:Ze})}))]}))})),r("div",e({ref:se,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:i(h,e({expanded:Ae,onChange:function(e,t){return Oe(t)},elevation:0,style:B.accordion,slotProps:{transition:{onEntered:function(){var e=se.current,t=null==e?void 0:e.querySelector('[data-highlight="true"]');t&&e&&!e.dataset.scrolled&&(t.scrollIntoView({behavior:"smooth",block:"center"}),e.dataset.scrolled="true")}}}},{children:[r(u,e({expandIcon:r(C,{}),style:B.accordionSummary},{children:r(g,e({style:B.heading},{children:"Book Metadata Details"}))})),r(p,e({style:B.accordionDetails},{children:Ye&&Object.keys(Ye).length>0?r(f,{data:Ye,highlightTerms:P,onHighlightMatch:Ce,highlightEnabled:!Ze,citationType:q,citationSubTitle:W}):r("div",e({style:B.errorState},{children:"No Book Metadata data available."}))}))]}))})),r("div",e({ref:he,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:i(h,e({elevation:0,style:B.accordion,expanded:Ve,onChange:function(e,t){return Re(t)},slotProps:{transition:{onEntered:function(){var e=he.current,t=null==e?void 0:e.querySelector('[data-highlight="true"]');t&&e&&!e.dataset.scrolled&&(t.scrollIntoView({behavior:"smooth",block:"center"}),e.dataset.scrolled="true")}}}},{children:[r(u,e({expandIcon:r(C,{}),style:B.accordionSummary},{children:r(g,e({style:B.heading},{children:"Copyrights & Marketing"}))})),r(p,e({style:B.accordionDetails},{children:Qe&&Object.keys(Qe).length>0?r(y,{data:Qe,highlightTerms:P,onHighlightMatch:Se,highlightEnabled:!Ze}):r("div",e({style:B.errorState},{children:"No Copyrights & Marketing data available."}))}))]}))})),r("div",e({ref:ue},{children:i(h,e({elevation:0,style:B.accordion,expanded:We,onChange:function(e,t){return Ne(t)},slotProps:{transition:{onEntered:function(){var e=ue.current,t=null==e?void 0:e.querySelector('[data-highlight="true"]');t&&e&&!e.dataset.scrolled&&(t.scrollIntoView({behavior:"smooth",block:"center"}),e.dataset.scrolled="true")}}}},{children:[r(u,e({expandIcon:r(C,{}),style:B.accordionSummary},{children:r(g,e({style:B.heading},{children:"People & Awards"}))})),r(p,e({style:B.accordionDetails},{children:_e&&Object.keys(_e).length>0?r(x,{data:_e,highlightTerms:P,onHighlightMatch:Ee,highlightEnabled:!Ze}):r("div",e({style:B.errorState},{children:"No People & Awards data available."}))}))]}))}))]}))})),L&&r(s,{style:{width:"3px",background:"#D1D5DC",cursor:"col-resize"}}),L&&r(c,e({order:2,minSize:30,maxSize:50,style:{overflow:"visible",position:"relative",transition:"all 300ms ease-in-out",WebkitTransition:"all 300ms ease-in-out"}},{children:r(k,{bookOverView:Je,bookCoverImage:Ke,onClose:Xe,clickableElementCategory:$,quotesToHighLightData:_,updateQuotesToHighLight:ge,citationLoad:U,previewPage:G,setPreviewPage:J,customStyle:T,comingSoonData:H,isNonHighlightedBlur:z,isBlurToggleVisible:j,isBookemon:M,noHtmlContent:le})}))]}))})),F&&i("div",e({style:B.blurOverlay},{children:[r(m,e({style:B.closeButton,onClick:E,size:"large"},{children:r(w,{})})),r(D,{header:null==H?void 0:H.header,subheader:null==H?void 0:H.subheader,icon:null==H?void 0:H.icon})]}))]}))};export{F as BookemonContent};
|
|
1
|
+
import{__assign as e,__awaiter as t,__generator as o}from"tslib";import{jsxs as i,jsx as r}from"react/jsx-runtime";import{useState as n,useRef as l,useEffect as a}from"react";import{PanelGroup as d,Panel as c,PanelResizeHandle as s}from"react-resizable-panels";import h from"@mui/material/Accordion";import u from"@mui/material/AccordionSummary";import g from"@mui/material/Typography";import p from"@mui/material/AccordionDetails";import m from"@mui/material/IconButton";import f from"./BookDetailsCard/BookDetailsCard.js";import v from"./BookOverviewCard/BookOverviewCard.js";import b from"./BookElementsCard/BookElementsCard.js";import y from"./BookCopyrightsCard/BookCopyrightsCard.js";import x from"./BookPeopleAwardsCard/BookPeopleAwardsCard.js";import k from"./BookPreview/BookPreview.js";import C from"@mui/icons-material/ExpandMore";import w from"@mui/icons-material/Close";var B={dialogPaper:{maxWidth:"none",fontFamily:"Inter, sans-serif"},dialogHeight:{overflow:"hidden",height:"90vh",position:"relative"},dialogContent:{padding:0,backgroundColor:"#FFFFFF"},container:{display:"flex",height:"100%",width:"100%",alignItems:"flex-start"},leftPanel:{height:"100%",padding:"24px",overflowY:"auto",backgroundColor:"#F3F4F6",borderRadius:"12px",boxSizing:"border-box"},rightPanel:{width:"40%",backgroundColor:"#FFFFFF",height:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-start",overflow:"auto",flex:1,boxSizing:"border-box",overflowY:"auto"},accordion:{borderRadius:"12px",boxShadow:"none",marginBottom:"24px"},accordionSummary:{paddingLeft:"16px",paddingRight:"16px"},accordionDetails:{paddingLeft:"16px",paddingRight:"16px",paddingBottom:"16px"},heading:{fontWeight:"bold",color:"#000000",fontSize:"16px"},blurOverlay:{position:"absolute",top:0,left:0,width:"100%",height:"100%",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",backgroundColor:"rgba(255, 255, 255, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:10,borderRadius:"12px"},closeButton:{position:"absolute",top:"8px",right:"8px",color:"#111827"},resizeHandle:{width:"10px",backgroundColor:"#e5e7eb",cursor:"col-resize",display:"flex",alignItems:"center",justifyContent:"center"},iconContainer:{display:"flex",flexDirection:"column",gap:"4px"},dot:{width:"4px",height:"4px",backgroundColor:"#6b7280",borderRadius:"50%"},resizeHandleBar:{width:"2px",height:"24px",backgroundColor:"#666",borderRadius:"2px"}},S={wrapper:{alignItems:"center",justifyContent:"center",textAlign:"center"},inner:{width:"100%"},iconWrapper:{width:"80px",height:"80px",background:"linear-gradient(to right, #3B82F6, #9333EA)",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 24px auto"},icon:{width:"40px",height:"40px",color:"#FFFFFF"},heading:{fontSize:"36px",fontWeight:"bold",color:"#9333EA",marginBottom:"16px"},text:{fontSize:"18px",color:"#4B5563",lineHeight:1.6,textAlign:"center"},errorState:{color:"#CE3928",padding:"18px 0px",display:"flex",justifyContent:"center",width:"100%"}},D=function(t){var o=t.header,n=t.subheader,l=t.icon;return r("div",e({style:S.wrapper},{children:i("div",e({style:S.inner},{children:[r("div",e({style:{marginBottom:"32px"}},{children:r("div",e({style:S.iconWrapper},{children:l}))})),i("div",{children:[r("h1",e({style:S.heading},{children:o})),r("p",e({style:S.text},{children:n}))]})]}))}))},F=function(S){var F=S.showComingSoon,E=S.onClose,P=S.highlightTerms,T=S.data,I=S.customStyle,H=S.comingSoonData,z=S.isNonHighlightedBlur,j=S.isBlurToggleVisible,M=S.isBookemon,A=S.getHighlightContent,L=S.handleFetchManuscriptElements,O=S.isBookPreview,V=S.isDialog,R=S.defaultElementPages,q=S.citationType,N=S.citationSubTitle,W=n({textToHighLight:"",content:""}),_=W[0],Q=W[1],Y=n(1),G=Y[0],J=Y[1],K=n(!1),U=K[0],X=K[1],Z=n("Book Preview"),$=Z[0],ee=Z[1],te=n(70),oe=te[0],ie=te[1],re=l(null),ne=n(!1),le=ne[0],ae=ne[1],de=l(null),ce=l(null),se=l(null),he=l(null),ue=l(null),ge=function(e,i,r,n){return void 0===n&&(n=0),t(void 0,void 0,void 0,function(){var t,l,a,d,c,s,h,u,g,p,m,f,v,b,y,x;return o(this,function(o){switch(o.label){case 0:Q({textToHighLight:"",content:""}),ae(!1),X(!0),ee(i),o.label=1;case 1:return o.trys.push([1,5,6,7]),r&&0!==r.length?[4,null==A?void 0:A([r[n]])]:(X(!1),ie(70),null===(y=re.current)||void 0===y||y.resize(70),[2]);case 2:if(t=o.sent(),l=(null==t?void 0:t.data)||t||[],!Array.isArray(l)||0===l.length)return ae(!0),X(!1),[2];for(d=(a=function(e){return e?e.replace(/<[^>]*>/g," ").replace(/ /g," ").replace(/[\u200B-\u200D\uFEFF]/g,"").replace(/[\u2018\u2019]/g,"'").replace(/[\u201C\u201D]/g,'"').replace(/[\u2013\u2014]/g,"-").replace(/[.,!?;:'"(){}\[\]—–…\/\\@#&*_|\^~%=+<>`]/g,"").replace(/\s+/g," ").trim().toLowerCase():""})(e),c=null,s=0,h=l;s<h.length;s++)if(f=h[s],a(f.normalizedContent||f.htmlContent).includes(d)){c=f;break}if(!c)for(u=d.split(" ").filter(Boolean);u.length>0;){for(g=u.join(" "),p=0,m=l;p<m.length;p++)if(f=m[p],a(f.normalizedContent||f.htmlContent).includes(g)){c=f;break}if(c)break;u.pop()}return v=l.map(function(e){return e.htmlContent}).join("\n"),Q({textToHighLight:c?c.htmlContent:"",content:v}),ie(50),null===(x=re.current)||void 0===x||x.resize(50),!c&&n+1<r.length?[4,ge(e,i,r,n+1)]:[3,4];case 3:return[2,o.sent()];case 4:return[2];case 5:return b=o.sent(),console.error("Highlight error:",b),ae(!0),[3,7];case 6:return X(!1),[7];case 7:return[2]}})})},pe=n(!1),me=pe[0],fe=pe[1],ve=n(!1),be=ve[0],ye=ve[1],xe=n(!1),ke=xe[0],Ce=xe[1],we=n(!1),Be=we[0],Se=we[1],De=n(!1),Fe=De[0],Ee=De[1],Pe=n(!1),Te=Pe[0],Ie=Pe[1],He=n(!1),ze=He[0],je=He[1],Me=n(!1),Ae=Me[0],Le=Me[1],Oe=n(!1),Ve=Oe[0],Re=Oe[1],qe=n(!1),Ne=qe[0],We=qe[1];a(function(){me&&Ie(!0),be&&je(!0),ke&&Le(!0),Be&&Re(!0),Fe&&We(!0)},[me,be,ke,Be,Fe]);var _e=T.bookAwards,Qe=T.bookCopyRight,Ye=T.bookDetails,Ge=T.bookElements,Je=T.bookOverView,Ke=T.bookCoverImage,Ue=null==Ye?void 0:Ye.isbn,Xe=null!=E?E:function(){},Ze=void 0!==N&&!!N.length&&["notable_quotes","location_details","notable_characters"].includes(N);return i("div",e({style:e(e({},B.dialogContent),V?B.dialogHeight:{})},{children:[!F&&r("div",e({style:B.container},{children:i(d,e({direction:"horizontal"},{children:[r(c,e({order:1,ref:re,defaultSize:oe||70},{children:i("div",e({style:e(e({},null==B?void 0:B.leftPanel),null==I?void 0:I.leftPanel)},{children:[r("div",e({ref:de,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:i(h,e({expanded:Te,onChange:function(e,t){return Ie(t)},slotProps:{transition:{onEntered:function(){var e=de.current,t=null==e?void 0:e.querySelector('[data-highlight="true"]');t&&e&&!e.dataset.scrolled&&(t.scrollIntoView({behavior:"smooth",block:"center"}),e.dataset.scrolled="true")}}},elevation:0,style:B.accordion},{children:[r(u,e({expandIcon:r(C,{}),style:B.accordionSummary},{children:r(g,e({style:B.heading},{children:"Book Overview"}))})),r(p,e({style:B.accordionDetails},{children:Je&&Object.keys(Je).length>0?r(v,{data:Je,highlightTerms:P,onHighlightMatch:fe,highlightEnabled:!Ze}):r("div",e({style:B.errorState},{children:"No overview data available."}))}))]}))})),r("div",e({ref:ce,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:i(h,e({elevation:0,style:B.accordion,expanded:ze,onChange:function(e,t){return je(t)},slotProps:{transition:{onEntered:function(){var e=ce.current;if(e){var t=e.querySelector('[data-highlight="true"]');if(t){t.scrollIntoView({behavior:"smooth",block:"center"});var o=!1,i=new MutationObserver(function(t){if(!o&&t.some(function(e){return"childList"===e.type&&e.addedNodes.length>0})){var r=e.querySelector('[data-highlight="true"]');r&&(o=!0,r.scrollIntoView({behavior:"auto",block:"center"}),i.disconnect())}});i.observe(e,{childList:!0,subtree:!0}),setTimeout(function(){return i.disconnect()},2e3)}}}}}},{children:[r(u,e({expandIcon:r(C,{}),style:B.accordionSummary},{children:r(g,e({style:B.heading},{children:"Book Manuscript Elements"}))})),r(p,e({style:B.accordionDetails},{children:r(b,{data:Ge,title:(null==Je?void 0:Je.title)||"",handleFetchManuscriptElements:L,BookIsbn:Ue,updateQuotesToHighLight:ge,highlightTerms:P,onHighlightMatch:ye,defaultPages:R,citationType:q,citationSubTitle:N,highlightEnabled:Ze})}))]}))})),r("div",e({ref:se,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:i(h,e({expanded:Ae,onChange:function(e,t){return Le(t)},elevation:0,style:B.accordion,slotProps:{transition:{onEntered:function(){var e=se.current,t=null==e?void 0:e.querySelector('[data-highlight="true"]');t&&e&&!e.dataset.scrolled&&(t.scrollIntoView({behavior:"smooth",block:"center"}),e.dataset.scrolled="true")}}}},{children:[r(u,e({expandIcon:r(C,{}),style:B.accordionSummary},{children:r(g,e({style:B.heading},{children:"Book Metadata Details"}))})),r(p,e({style:B.accordionDetails},{children:Ye&&Object.keys(Ye).length>0?r(f,{data:Ye,highlightTerms:P,onHighlightMatch:Ce,highlightEnabled:!Ze,citationType:q,citationSubTitle:N}):r("div",e({style:B.errorState},{children:"No Book Metadata data available."}))}))]}))})),r("div",e({ref:he,style:{marginBottom:"24px"},onMouseDown:function(e){return e.preventDefault()}},{children:i(h,e({elevation:0,style:B.accordion,expanded:Ve,onChange:function(e,t){return Re(t)},slotProps:{transition:{onEntered:function(){var e=he.current,t=null==e?void 0:e.querySelector('[data-highlight="true"]');t&&e&&!e.dataset.scrolled&&(t.scrollIntoView({behavior:"smooth",block:"center"}),e.dataset.scrolled="true")}}}},{children:[r(u,e({expandIcon:r(C,{}),style:B.accordionSummary},{children:r(g,e({style:B.heading},{children:"Copyrights & Marketing"}))})),r(p,e({style:B.accordionDetails},{children:Qe&&Object.keys(Qe).length>0?r(y,{data:Qe,highlightTerms:P,onHighlightMatch:Se,highlightEnabled:!Ze}):r("div",e({style:B.errorState},{children:"No Copyrights & Marketing data available."}))}))]}))})),r("div",e({ref:ue},{children:i(h,e({elevation:0,style:B.accordion,expanded:Ne,onChange:function(e,t){return We(t)},slotProps:{transition:{onEntered:function(){var e=ue.current,t=null==e?void 0:e.querySelector('[data-highlight="true"]');t&&e&&!e.dataset.scrolled&&(t.scrollIntoView({behavior:"smooth",block:"center"}),e.dataset.scrolled="true")}}}},{children:[r(u,e({expandIcon:r(C,{}),style:B.accordionSummary},{children:r(g,e({style:B.heading},{children:"People & Awards"}))})),r(p,e({style:B.accordionDetails},{children:_e&&Object.keys(_e).length>0?r(x,{data:_e,highlightTerms:P,onHighlightMatch:Ee,highlightEnabled:!Ze}):r("div",e({style:B.errorState},{children:"No People & Awards data available."}))}))]}))}))]}))})),O&&r(s,{style:{width:"3px",background:"#D1D5DC",cursor:"col-resize"}}),O&&r(c,e({order:2,minSize:30,maxSize:50,style:{overflow:"visible",position:"relative",transition:"all 300ms ease-in-out",WebkitTransition:"all 300ms ease-in-out"}},{children:r(k,{bookOverView:Je,bookCoverImage:Ke,onClose:Xe,clickableElementCategory:$,quotesToHighLightData:_,updateQuotesToHighLight:ge,citationLoad:U,previewPage:G,setPreviewPage:J,customStyle:I,comingSoonData:H,isNonHighlightedBlur:z,isBlurToggleVisible:j,isBookemon:M,noHtmlContent:le})}))]}))})),F&&i("div",e({style:B.blurOverlay},{children:[r(m,e({style:B.closeButton,onClick:E,size:"large"},{children:r(w,{})})),r(D,{header:null==H?void 0:H.header,subheader:null==H?void 0:H.subheader,icon:null==H?void 0:H.icon})]}))]}))};export{F as BookemonContent};
|
|
2
2
|
//# sourceMappingURL=BookemonContent.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as r}from"tslib";import{jsx as
|
|
1
|
+
import{__assign as r}from"tslib";import{jsx as t}from"react/jsx-runtime";import{Worker as e,Viewer as o,SpecialZoomLevel as i}from"@react-pdf-viewer/core";import{pdfStyles as l}from"./PdfStyle.js";var n="https://unpkg.com/pdfjs-dist@3.11.174/build/pdf.worker.min.js",d=function(d){var f=d.pdfUrl,p=d.plugins,a=d.onLoad,m=d.customStyles;return t("div",r({style:r(r({},l.pdfConatiner),null==m?void 0:m.pdfContainer)},{children:t(e,r({workerUrl:n},{children:t(o,{fileUrl:f,defaultScale:i.ActualSize,plugins:p,onDocumentLoad:a})}))}))};export{d as default,n as pdfWorker};
|
|
2
2
|
//# sourceMappingURL=PdfContainer.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e={pdfViewer:{borderRadius:"12px",padding:"16px",width:"100%",height:"100%"},card:{border:"2px solid #E5E7EB",backgroundColor:"#FFFFFF",borderRadius:"12px",
|
|
1
|
+
var e={pdfViewer:{borderRadius:"12px",padding:"16px",width:"100%",height:"100%"},card:{border:"2px solid #E5E7EB",backgroundColor:"#FFFFFF",borderRadius:"12px",width:"100%"},header:{display:"flex",justifyContent:"space-between",alignItems:"center",position:"relative"},title:{fontSize:"14px",fontWeight:600,color:"#60A3F8",fontFamily:'Roboto, "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif'},toolbar:{display:"flex",alignItems:"center",gap:"8px",position:"relative"},button:{border:"1px solid #DFE5EC",borderRadius:"6px",padding:"4px 8px",fontSize:"14px",cursor:"pointer",backgroundColor:"#FFFFFF"},buttonDisabled:{opacity:.4,cursor:"not-allowed"},counter:{fontSize:"13px",color:"#64748B",margin:"0 6px"},viewerWrapper:{height:"30rem",overflow:"auto",display:"flex",justifyContent:"center",alignItems:"center",border:"1px solid #DEE4EB",borderRadius:"8px"},emptyState:{fontSize:"14px",color:"#EF4444"},pdfConatiner:{height:"100%",overflow:"auto",display:"flex",justifyContent:"center",alignItems:"center"}};export{e as pdfStyles};
|
|
2
2
|
//# sourceMappingURL=PdfStyle.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as t,jsx as n}from"react/jsx-runtime";import{pdfStyles as l}from"./PdfStyle.js";import{DefaultPdfIcon as o,DefaultFullScreenIcon as r,DefaultDownloadIcon as i,DefaultCloseIcon as s}from"../../assests/svg/PdfViewerIcons.js";var c=function(c){c.highlightIndex,c.totalHighlights;var a=c.controls;c.currentPosition;var d=c.pdfName,m=c.onClose,u=c.pdfUrl,f=c.viewerRef,p=c.customStyles,v=c.customClasses,g=c.customIcons,h=a.ZoomInButton,x=a.ZoomOutButton,b=a.ZoomPopover;a.goToPrevious,a.goToNext;var N=(null==v?void 0:v.actionButton)||"p-1 hover:bg-gray-200 rounded-md transition-colors";return t("div",e({className:(null==v?void 0:v.header)||"flex items-center justify-between mb-3 bg-[#FAFAFA] border-b border-gray-100 rounded-t-xl",style:e(e({},l.header),null==p?void 0:p.header)},{children:[t("div",e({className:"flex items-center gap-3"},{children:[n("div",e({style:e(e({},{borderRadius:"21px",border:"6px solid #E8F3FF",background:"#D5E8FF",display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",boxSizing:"content-box"}),null==p?void 0:p.pdfIconWrapper)},{children:(null==g?void 0:g.pdfIcon)||n(o,{})})),n("span",e({className:(null==v?void 0:v.pdfName)||"text-gray-800 text-sm",style:e({fontWeight:500},null==p?void 0:p.pdfName)},{children:d}))]})),t("div",e({className:"flex items-center gap-4 text-gray-600"},{children:[t("div",e({className:"flex items-center gap-1"},{children:[n(x,{}),n("div",e({className:"text-sm font-medium w-14 text-center"},{children:n(b,{})})),n(h,{})]})),n("div",{className:"w-px h-5 bg-gray-300 mx-1"}),t("div",e({className:"flex items-center gap-2"},{children:[n("button",e({onClick:function(){var e=null==f?void 0:f.current;e&&(document.fullscreenElement?document.exitFullscreen():e.requestFullscreen().catch(function(e){console.error("Error attempting to enable fullscreen: ".concat(e.message))}))},className:N,title:"Full Screen"},{children:(null==g?void 0:g.fullScreenIcon)||n(r,{})})),u&&n("a",e({href:u,target:"_blank",rel:"noopener noreferrer",className:N,title:"Open in new tab"},{children:(null==g?void 0:g.downloadIcon)||n(i,{})})),m&&n("button",e({onClick:m,className:"".concat(N," ml-1"),title:"Close"},{children:(null==g?void 0:g.closeIcon)||n(s,{})}))]}))]}))]}))};export{c as default};
|
|
2
2
|
//# sourceMappingURL=PdfToolbar.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as t,jsxs as i}from"react/jsx-runtime";import{SpecialZoomLevel as o}from"@react-pdf-viewer/core";import r from"./PdfContainer.js";import s from"./PdfToolbar.js";import{pdfStyles as l}from"./PdfStyle.js";import{PdfHighlightControls as n}from"./usePdfHighlight.js";import"@react-pdf-viewer/zoom/lib/styles/index.css";import"@react-pdf-viewer/page-navigation/lib/styles/index.css";import"@react-pdf-viewer/core/lib/styles/index.css";import"@react-pdf-viewer/search/lib/styles/index.css";import{useRef as a}from"react";var d=function(d){var m=d.pdfUrl,c=d.highlightText,p=d.highlightPages,f=d.jumpToPageValue,u=void 0===f?0:f,h=d.pdfName,g=d.onClose,v=d.customStyles,y=d.customClasses,x=d.customIcons,w=n(c,p),P=w.highlightIndex,b=w.cursorIndex,j=w.setCursorIndex,C=w.orderedKeys,S=w.totalHighlights,I=w.getValidPosition,A=w.tryJump,F=w.jumpToPage,T=w.zoomTo,V=w.plugins,z=w.controls,H=I(b),N=a(null);if(!m)return t("div",e({style:e(e({},l.emptyState),null==v?void 0:v.emptyState)},{children:"PDF is not available for this selection"}));return i("div",e({ref:N,className:(null==y?void 0:y.pdfViewerWrapper)||"",style:e(e(e({},l.pdfViewer),{display:"flex",flexDirection:"column",height:"100%",width:"100%",backgroundColor:"#FAFAFA"}),null==v?void 0:v.pdfViewer)},{children:[t(s,{highlightIndex:P,totalHighlights:S,controls:z,currentPosition:H,pdfName:h,onClose:g,pdfUrl:m,viewerRef:N,customStyles:v,customClasses:y,customIcons:x}),t(r,{pdfUrl:m,plugins:V,customStyles:v,onLoad:function(){if(T(o.ActualSize),u>0){var e=u-1,t=C[e],i=p[t];j(e),i>0&&F(i-1)}requestAnimationFrame(A)}})]}))};export{d as default};
|
|
2
2
|
//# sourceMappingURL=PdfViewer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PdfViewerTest.d.ts","sourceRoot":"","sources":["../../../src/PdfViewerTest.tsx"],"names":[],"mappings":"AAcA,QAAA,MAAM,aAAa,+
|
|
1
|
+
{"version":3,"file":"PdfViewerTest.d.ts","sourceRoot":"","sources":["../../../src/PdfViewerTest.tsx"],"names":[],"mappings":"AAcA,QAAA,MAAM,aAAa,+CAwClB,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const DefaultPdfIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const DefaultFullScreenIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const DefaultDownloadIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare const DefaultCloseIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
//# sourceMappingURL=PdfViewerIcons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PdfViewerIcons.d.ts","sourceRoot":"","sources":["../../../../../src/assests/svg/PdfViewerIcons.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,+CAI1B,CAAC;AAEF,eAAO,MAAM,qBAAqB,+CAIjC,CAAC;AAEF,eAAO,MAAM,mBAAmB,+CAM/B,CAAC;AAEF,eAAO,MAAM,gBAAgB,+CAK5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BookemonContent.d.ts","sourceRoot":"","sources":["../../../../../src/features/Bookemon/BookemonContent.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AA0LvD,eAAO,MAAM,eAAe,4QAiBvB,aAAa,
|
|
1
|
+
{"version":3,"file":"BookemonContent.d.ts","sourceRoot":"","sources":["../../../../../src/features/Bookemon/BookemonContent.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AA0LvD,eAAO,MAAM,eAAe,4QAiBvB,aAAa,4CAoiBf,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { CustomStylesType } from "./PdfViewer";
|
|
1
2
|
export declare const pdfWorker: string;
|
|
2
3
|
type Props = {
|
|
3
4
|
pdfUrl: string;
|
|
4
5
|
plugins: any[];
|
|
5
6
|
onLoad: () => void;
|
|
7
|
+
customStyles?: CustomStylesType;
|
|
6
8
|
};
|
|
7
|
-
declare const PdfContainer: ({ pdfUrl, plugins, onLoad }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare const PdfContainer: ({ pdfUrl, plugins, onLoad, customStyles }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
8
10
|
export default PdfContainer;
|
|
9
11
|
//# sourceMappingURL=PdfContainer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PdfContainer.d.ts","sourceRoot":"","sources":["../../../../../src/features/PdfViewer/PdfContainer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PdfContainer.d.ts","sourceRoot":"","sources":["../../../../../src/features/PdfViewer/PdfContainer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,eAAO,MAAM,SAAS,EAAE,MAAwE,CAAC;AAEjG,KAAK,KAAK,GAAG;IACX,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,GAAG,EAAE,CAAC;IACf,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,YAAY,CAAC,EAAE,gBAAgB,CAAC;CACjC,CAAC;AAEF,QAAA,MAAM,YAAY,8CAA+C,KAAK,4CAarE,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1,4 +1,32 @@
|
|
|
1
|
-
import { CSSProperties } from "react";
|
|
1
|
+
import { CSSProperties, ReactNode } from "react";
|
|
2
|
+
export interface PdfCustomIcons {
|
|
3
|
+
pdfIcon?: ReactNode;
|
|
4
|
+
fullScreenIcon?: ReactNode;
|
|
5
|
+
downloadIcon?: ReactNode;
|
|
6
|
+
closeIcon?: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export interface PdfCustomStyles {
|
|
9
|
+
pdfViewer?: CSSProperties;
|
|
10
|
+
card?: CSSProperties;
|
|
11
|
+
header?: CSSProperties;
|
|
12
|
+
title?: CSSProperties;
|
|
13
|
+
toolbar?: CSSProperties;
|
|
14
|
+
button?: CSSProperties;
|
|
15
|
+
buttonDisabled?: CSSProperties;
|
|
16
|
+
counter?: CSSProperties;
|
|
17
|
+
viewerWrapper?: CSSProperties;
|
|
18
|
+
emptyState?: CSSProperties;
|
|
19
|
+
pdfContainer?: CSSProperties;
|
|
20
|
+
}
|
|
21
|
+
export interface PdfCustomClasses {
|
|
22
|
+
pdfViewer?: string;
|
|
23
|
+
header?: string;
|
|
24
|
+
headerLeft?: string;
|
|
25
|
+
headerRight?: string;
|
|
26
|
+
pdfContainer?: string;
|
|
27
|
+
emptyState?: string;
|
|
28
|
+
iconButton?: string;
|
|
29
|
+
}
|
|
2
30
|
export declare const pdfStyles: {
|
|
3
31
|
[key: string]: CSSProperties;
|
|
4
32
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PdfStyle.d.ts","sourceRoot":"","sources":["../../../../../src/features/PdfViewer/PdfStyle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"PdfStyle.d.ts","sourceRoot":"","sources":["../../../../../src/features/PdfViewer/PdfStyle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEjD,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,cAAc,CAAC,EAAE,aAAa,CAAC;IAC/B,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,YAAY,CAAC,EAAE,aAAa,CAAC;CAC9B;AAED,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,SAAS,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAA;CA8ErD,CAAC"}
|
|
@@ -1,9 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CustomIconsType, CustomStylesType, CustomClassesType } from "./PdfViewer";
|
|
1
3
|
type Props = {
|
|
2
4
|
highlightIndex: number;
|
|
3
5
|
totalHighlights: number;
|
|
4
6
|
controls: any;
|
|
5
7
|
currentPosition: any;
|
|
8
|
+
pdfName?: string;
|
|
9
|
+
onClose?: () => void;
|
|
10
|
+
pdfUrl?: string;
|
|
11
|
+
viewerRef?: React.RefObject<HTMLDivElement>;
|
|
12
|
+
customStyles?: CustomStylesType;
|
|
13
|
+
customClasses?: CustomClassesType;
|
|
14
|
+
customIcons?: CustomIconsType;
|
|
6
15
|
};
|
|
7
|
-
declare const PdfToolbar: ({ highlightIndex, totalHighlights, controls, currentPosition }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare const PdfToolbar: ({ highlightIndex, totalHighlights, controls, currentPosition, pdfName, onClose, pdfUrl, viewerRef, customStyles, customClasses, customIcons }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
8
17
|
export default PdfToolbar;
|
|
9
18
|
//# sourceMappingURL=PdfToolbar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PdfToolbar.d.ts","sourceRoot":"","sources":["../../../../../src/features/PdfViewer/PdfToolbar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PdfToolbar.d.ts","sourceRoot":"","sources":["../../../../../src/features/PdfViewer/PdfToolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGnF,KAAK,KAAK,GAAG;IACX,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,GAAG,CAAC;IACd,eAAe,EAAE,GAAG,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC5C,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAClC,WAAW,CAAC,EAAE,eAAe,CAAC;CAC/B,CAAC;AAEF,QAAA,MAAM,UAAU,kJAYb,KAAK,4CAwFP,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -2,6 +2,39 @@ import "@react-pdf-viewer/zoom/lib/styles/index.css";
|
|
|
2
2
|
import "@react-pdf-viewer/page-navigation/lib/styles/index.css";
|
|
3
3
|
import "@react-pdf-viewer/core/lib/styles/index.css";
|
|
4
4
|
import "@react-pdf-viewer/search/lib/styles/index.css";
|
|
5
|
-
|
|
5
|
+
import React from "react";
|
|
6
|
+
export type CustomIconsType = {
|
|
7
|
+
pdfIcon?: React.ReactNode;
|
|
8
|
+
fullScreenIcon?: React.ReactNode;
|
|
9
|
+
downloadIcon?: React.ReactNode;
|
|
10
|
+
closeIcon?: React.ReactNode;
|
|
11
|
+
};
|
|
12
|
+
export type CustomStylesType = {
|
|
13
|
+
pdfViewer?: React.CSSProperties;
|
|
14
|
+
header?: React.CSSProperties;
|
|
15
|
+
pdfIconWrapper?: React.CSSProperties;
|
|
16
|
+
pdfName?: React.CSSProperties;
|
|
17
|
+
pdfContainer?: React.CSSProperties;
|
|
18
|
+
emptyState?: React.CSSProperties;
|
|
19
|
+
};
|
|
20
|
+
export type CustomClassesType = {
|
|
21
|
+
header?: string;
|
|
22
|
+
pdfName?: string;
|
|
23
|
+
actionButton?: string;
|
|
24
|
+
pdfViewerWrapper?: string;
|
|
25
|
+
};
|
|
26
|
+
interface PdfViewerProps {
|
|
27
|
+
pdfUrl?: string;
|
|
28
|
+
highlightText: string[];
|
|
29
|
+
highlightPages?: any;
|
|
30
|
+
jumpToPageValue?: number;
|
|
31
|
+
pdfName?: string;
|
|
32
|
+
onClose?: () => void;
|
|
33
|
+
item?: any;
|
|
34
|
+
customStyles?: CustomStylesType;
|
|
35
|
+
customClasses?: CustomClassesType;
|
|
36
|
+
customIcons?: CustomIconsType;
|
|
37
|
+
}
|
|
38
|
+
declare const PdfViewer: ({ pdfUrl, highlightText, highlightPages, jumpToPageValue, pdfName, onClose, customStyles, customClasses, customIcons, }: PdfViewerProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
39
|
export default PdfViewer;
|
|
7
40
|
//# sourceMappingURL=PdfViewer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PdfViewer.d.ts","sourceRoot":"","sources":["../../../../../src/features/PdfViewer/PdfViewer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PdfViewer.d.ts","sourceRoot":"","sources":["../../../../../src/features/PdfViewer/PdfViewer.tsx"],"names":[],"mappings":"AAKA,OAAO,6CAA6C,CAAC;AACrD,OAAO,wDAAwD,CAAC;AAChE,OAAO,6CAA6C,CAAC;AACrD,OAAO,+CAA+C,CAAC;AACvD,OAAO,KAAiB,MAAM,OAAO,CAAC;AAEtC,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACjC,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAChC,MAAM,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC7B,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACrC,OAAO,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC9B,YAAY,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACnC,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,UAAU,cAAc;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,cAAc,CAAC,EAAE,GAAG,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAClC,WAAW,CAAC,EAAE,eAAe,CAAC;CAC/B;AAED,QAAA,MAAM,SAAS,4HAUZ,cAAc,4CAsFhB,CAAC;AAEF,eAAe,SAAS,CAAC"}
|