@e-llm-studio/citation 0.0.142 → 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.
|
@@ -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
|
-
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 +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"}
|