@e-llm-studio/citation 0.0.93 → 0.0.94
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/features/Bookemon/BookElementsCard/BookElementsCard.js +1 -1
- package/dist/cjs/features/Bookemon/Bookemon.js +1 -1
- package/dist/cjs/features/CitationRenderer/MarkdownRenderer.js +1 -1
- package/dist/features/Bookemon/BookElementsCard/BookElementsCard.js +1 -1
- package/dist/features/Bookemon/Bookemon.js +1 -1
- package/dist/features/CitationRenderer/MarkdownRenderer.js +1 -1
- package/dist/types/src/features/Bookemon/BookElementsCard/BookElementsCard.d.ts +4 -2
- package/dist/types/src/features/Bookemon/BookElementsCard/BookElementsCard.d.ts.map +1 -1
- package/dist/types/src/features/Bookemon/Bookemon.d.ts +2 -1
- package/dist/types/src/features/Bookemon/Bookemon.d.ts.map +1 -1
- package/dist/types/src/features/CitationRenderer/MarkdownRenderer.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../node_modules/tslib/tslib.es6.mjs.js"),t=require("react/jsx-runtime"),n=require("../../../node_modules/@material-ui/lab/esm/Pagination/Pagination.js");require("../../../node_modules/@material-ui/utils/esm/elementAcceptingRef.js"),require("../../../node_modules/@material-ui/utils/esm/elementTypeAcceptingRef.js"),require("../../../_virtual/index.js"),require("../../../node_modules/@material-ui/utils/esm/ponyfillGlobal.js"),require("../../../node_modules/@material-ui/utils/esm/refType.js");var s=require("react");require("../../../node_modules/@material-ui/core/esm/SvgIcon/SvgIcon.js"),require("react-dom");var a=require("../../../node_modules/@material-ui/lab/esm/Skeleton/Skeleton.js"),i=require("../../../node_modules/react-markdown/lib/react-markdown.js"),r={sectionTitle:{fontSize:"14px",fontWeight:600,color:"#667085",marginBottom:"12px"},quotesPadding:{paddingLeft:"12px"},quoteCard:{border:"1px solid #CBD5E1",borderRadius:"8px",padding:"16px",backgroundColor:"#F8FAFC",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",marginBottom:"16px",cursor:"pointer",transition:"transform 0.2s ease, box-shadow 0.2s ease"},quoteText:{fontStyle:"italic",color:"#475569",fontSize:"14px",fontWeight:400,marginBottom:"12px"},quoteMeta:{color:"#475569",fontSize:"12px",fontWeight:400},quoteAuthor:{fontSize:"10px",fontWeight:600,color:"#475569",marginTop:"8px",marginBottom:"18px"},button:{color:"#5928ED",fontSize:"14px",fontWeight:600,background:"none",border:"none",cursor:"pointer",padding:0,textDecoration:"none",paddingLeft:"12px"},geoLocationsContainer:{marginTop:"24px",marginBottom:"24px"},geoText:{fontSize:"14px",fontWeight:500,cursor:"pointer",color:"#532BED"},geoDivider:{margin:"0 8px",color:"#475abb",backgroundColor:"#475abb",width:"1px",height:"18px",display:"inline-block"},geoLocationFlex:{display:"inline-flex",alignItems:"center",gap:"8px",marginBottom:"8px"},charactersContainer:{marginTop:"16px"},charactersGrid:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"16px",marginBottom:"16px",paddingLeft:"12px"},characterCard:{border:"1px solid #E5E7EB",borderRadius:"8px",backgroundColor:"#FFFFFF",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",display:"flex",alignItems:"flex-start",gap:"12px",padding:"16px",cursor:"pointer",transition:"transform 0.2s ease, box-shadow 0.2s ease"},avatar:{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"9999px",fontSize:"14px",fontWeight:600,flexShrink:0},charName:{fontStyle:"normal",fontWeight:600,color:"#101827",fontSize:"16px"},charDesc:{fontStyle:"normal",fontWeight:400,fontSize:"14px",color:"#6B7280"},retryButton:{backgroundColor:"#5928EC",color:"#fff",padding:"6px 10px",border:"none",borderRadius:"6px",cursor:"pointer",fontSize:"12px",fontWeight:"500"}};exports.default=function(o){o.data;var l=o.updateQuotesToHighLight,d=o.handleFetchManuscriptElements,u=o.BookIsbn,c=s.useState([]),g=c[0],x=c[1],p=s.useState(1),h=p[0],_=p[1],f=s.useState(!1),y=f[0],m=f[1],v=s.useState(!0),b=v[0],j=v[1],S=s.useState(0),C=S[0],T=S[1],k=s.useState([]),w=k[0],q=k[1],B=s.useState(1),D=B[0],L=B[1],F=s.useState(!1),M=F[0],E=F[1],P=s.useState(!0),W=P[0],I=P[1],z=s.useState(0),R=z[0],H=z[1],N=s.useState([]),G=N[0],A=N[1],K=s.useState(1),Y=K[0],O=K[1],Q=s.useState(!1),J=Q[0],U=Q[1],V=s.useState(!0),X=V[0],Z=V[1],$=s.useState(0),ee=$[0],te=$[1],ne=s.useState({list:"",index:-1,page:1}),se=ne[0],ae=ne[1],ie=function(t){var n=t.endpoint,s=t.page,a=t.isbn,i=t.setData,r=t.setLoading,o=t.setHasMore,l=t.setTotalPage;return e.__awaiter(void 0,void 0,void 0,(function(){var t,u,c,g;return e.__generator(this,(function(e){switch(e.label){case 0:return r(!0),[4,d({endpoint:n,page:s,pageSize:10,isbn:a})];case 1:return t=e.sent(),o(!(null===(u=null==t?void 0:t.pagination)||void 0===u?void 0:u.hasNext)&&!(null===(c=null==t?void 0:t.pagination)||void 0===c?void 0:c.hasPrevious)),l((null===(g=null==t?void 0:t.pagination)||void 0===g?void 0:g.totalPages)||0),i((null==t?void 0:t.data)||[]),r(!1),[2]}}))}))};return s.useEffect((function(){ie({endpoint:"notable-quotes",page:h,isbn:u,setData:x,setLoading:m,setHasMore:j,setTotalPage:T})}),[h]),s.useEffect((function(){ie({endpoint:"notable-characters",page:D,isbn:u,setData:q,setLoading:E,setHasMore:I,setTotalPage:H})}),[D]),s.useEffect((function(){ie({endpoint:"geo-locations",page:Y,isbn:u,setData:A,setLoading:U,setHasMore:Z,setTotalPage:te})}),[Y]),t.jsxs("div",{children:[t.jsxs("div",e.__assign({style:{marginBottom:"24px"}},{children:[t.jsx("p",e.__assign({style:r.sectionTitle},{children:"Notable Quotes"})),t.jsxs("div",e.__assign({style:r.quotesPadding},{children:[y?t.jsx("div",e.__assign({style:{display:"flex",flexDirection:"column",rowGap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map((function(n){return t.jsxs("div",e.__assign({style:r.quoteCard},{children:[t.jsx(a.default,{variant:"text",width:"60%",height:28}),t.jsx(a.default,{variant:"text",width:"40%",height:20}),t.jsx(a.default,{variant:"text",width:"25%",height:20}),t.jsx(a.default,{variant:"text",width:"30%",height:20})]}),n)}))})):0===g.length?t.jsxs("p",e.__assign({style:{color:"#6B7280",fontStyle:"italic"}},{children:["No notable quotes found. ",t.jsx("button",e.__assign({style:r.retryButton,onClick:function(){return ie({endpoint:"notable-quotes",page:h,isbn:u,setData:x,setLoading:m,setHasMore:j,setTotalPage:T})}},{children:"Retry"}))]})):t.jsx(t.Fragment,{children:g.map((function(n,s){var a="notable"===se.list&&se.page===h&&se.index===s;return t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},r.quoteCard),{borderColor:a?"rgb(83, 43, 237)":"#CBD5E1"}),onMouseEnter:function(e){e.currentTarget.style.transform="translateY(-4px)",e.currentTarget.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"},onMouseLeave:function(e){e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.1)"},onClick:function(){return e.__awaiter(void 0,void 0,void 0,(function(){var t,a;return e.__generator(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),ae({list:"notable",page:h,index:s}),(null===(a=null==n?void 0:n.chunkIds)||void 0===a?void 0:a.length)>0?[4,l(n.text,"Notable Quotes",n.chunkIds,0)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[3,4];case 3:return t=e.sent(),console.error("Failed to highlight quote:",t),[3,4];case 4:return[2]}}))}))}},{children:[t.jsx("p",e.__assign({style:r.quoteText},{children:null==n?void 0:n.text})),t.jsxs("p",e.__assign({style:r.quoteMeta},{children:[n.chapter," ",t.jsx("br",{})," ",n.page]})),t.jsxs("p",e.__assign({style:r.quoteAuthor},{children:["— ",null==n?void 0:n.author]}))]}),s)}))}),t.jsx("div",e.__assign({style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!b&&t.jsx(n.default,{disabled:y,count:C,page:h,onChange:function(e,t){return _(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),t.jsxs("div",e.__assign({style:r.geoLocationsContainer},{children:[t.jsx("p",e.__assign({style:r.sectionTitle},{children:"Key Geo Locations"})),t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},r.quotesPadding),{marginBottom:"8px"})},{children:[J?t.jsx("div",e.__assign({style:{display:"flex",flexWrap:"wrap",gap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map((function(e){return t.jsx(a.default,{variant:"rect",width:100,height:20,style:{borderRadius:"8px"}},e)}))})):0===G.length?t.jsxs("p",e.__assign({style:{color:"#6B7280",fontStyle:"italic",paddingLeft:"12px"}},{children:["No key geo locations found. ",t.jsx("button",e.__assign({style:r.retryButton,onClick:function(){return ie({endpoint:"geo-locations",page:Y,isbn:u,setData:A,setLoading:U,setHasMore:Z,setTotalPage:te})}},{children:"Retry"}))]})):t.jsx(t.Fragment,{children:G.map((function(n,s){var a="geo_location"===se.list&&se.page===Y&&se.index===s;return t.jsxs("span",e.__assign({style:r.geoLocationFlex},{children:[t.jsx("span",e.__assign({style:e.__assign(e.__assign({},r.geoText),{fontWeight:a?"700":"",textDecoration:a?"underline":""}),onClick:function(){return e.__awaiter(void 0,void 0,void 0,(function(){var t,a;return e.__generator(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),ae({list:"geo_location",page:Y,index:s}),(null===(a=null==n?void 0:n.chunkIds)||void 0===a?void 0:a.length)>0?[4,l(n.name,"Key Geo Locations",n.chunkIds,0)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[3,4];case 3:return t=e.sent(),console.error("Failed to highlight location:",t),[3,4];case 4:return[2]}}))}))},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:null==n?void 0:n.name})),s<G.length-1&&t.jsx("span",{style:r.geoDivider})]}),s)}))}),t.jsx("div",e.__assign({style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!X&&t.jsx(n.default,{disabled:J,count:ee,page:Y,onChange:function(e,t){return O(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),t.jsxs("div",e.__assign({style:r.charactersContainer},{children:[t.jsx("p",e.__assign({style:r.sectionTitle},{children:"Key Characters"})),M?t.jsx("div",e.__assign({style:{display:"flex",flexWrap:"wrap",gap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map((function(n){return t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},r.characterCard),{flexBasis:"40%"})},{children:[t.jsx(a.default,{variant:"circle",style:e.__assign(e.__assign({},r.avatar),{flexShrink:0})}),t.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",flex:1}},{children:[t.jsx(a.default,{variant:"text",style:{flex:"1",flexShrink:0}}),t.jsx(a.default,{variant:"text",style:{flex:"1"}}),t.jsx(a.default,{variant:"text",style:{flex:"1"}}),t.jsx(a.default,{variant:"text",style:{flex:"1"}})]}))]}),n)}))})):0===w.length?t.jsxs("p",e.__assign({style:{color:"#6B7280",fontStyle:"italic",paddingLeft:"12px"}},{children:["No key characters found. ",t.jsx("button",e.__assign({style:r.retryButton,onClick:function(){return ie({endpoint:"notable-characters",page:D,isbn:u,setData:q,setLoading:E,setHasMore:I,setTotalPage:H})}},{children:"Retry"}))]})):t.jsx(t.Fragment,{children:t.jsx("div",e.__assign({style:r.charactersGrid},{children:w.map((function(n,s){var a=e.__assign(e.__assign({},r.avatar),{backgroundColor:n.bg,color:n.color}),o="key_character"===se.list&&se.page===D&&se.index===s;return t.jsxs("div",e.__assign({onMouseEnter:function(e){e.currentTarget.style.transform="translateY(-4px)",e.currentTarget.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"},onMouseLeave:function(e){e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.1)"},style:e.__assign(e.__assign({},r.characterCard),{borderColor:o?"rgb(83, 43, 237)":"#E5E7EB"}),onClick:function(){return e.__awaiter(void 0,void 0,void 0,(function(){var t,a;return e.__generator(this,(function(e){switch(e.label){case 0:ae({list:"key_character",page:D,index:s}),e.label=1;case 1:return e.trys.push([1,4,,5]),(null===(a=null==n?void 0:n.chunkIds)||void 0===a?void 0:a.length)>0?[4,l(n.name,"Key Characters",n.chunkIds,0)]:[3,3];case 2:e.sent(),e.label=3;case 3:return[3,5];case 4:return t=e.sent(),console.error("Failed to highlight character:",t),[3,5];case 5:return[2]}}))}))}},{children:[t.jsx("div",e.__assign({style:a},{children:n.initials})),t.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column"}},{children:[t.jsx("p",e.__assign({style:e.__assign(e.__assign({},r.charName),{margin:0})},{children:n.name})),t.jsx("p",e.__assign({style:e.__assign(e.__assign({},r.charDesc),{margin:0,marginTop:"4px"})},{children:t.jsx(i.ReactMarkdown,e.__assign({components:{p:function(n){n.node;var s=e.__rest(n,["node"]);return t.jsx("p",e.__assign({style:{marginTop:"0"}},s))}}},{children:null==n?void 0:n.description}))}))]}))]}),s)}))}))}),t.jsx("div",e.__assign({style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!W&&t.jsx(n.default,{count:R,disabled:M,page:D,onChange:function(e,t){return L(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../node_modules/tslib/tslib.es6.mjs.js"),t=require("react/jsx-runtime"),n=require("../../../node_modules/@material-ui/lab/esm/Pagination/Pagination.js");require("../../../node_modules/@material-ui/utils/esm/elementAcceptingRef.js"),require("../../../node_modules/@material-ui/utils/esm/elementTypeAcceptingRef.js"),require("../../../_virtual/index.js"),require("../../../node_modules/@material-ui/utils/esm/ponyfillGlobal.js"),require("../../../node_modules/@material-ui/utils/esm/refType.js");var s=require("react");require("../../../node_modules/@material-ui/core/esm/SvgIcon/SvgIcon.js"),require("react-dom");var a=require("../../../node_modules/@material-ui/lab/esm/Skeleton/Skeleton.js"),i=require("../../../node_modules/react-markdown/lib/react-markdown.js"),r={sectionTitle:{fontSize:"14px",fontWeight:600,color:"#667085",marginBottom:"12px"},quotesPadding:{paddingLeft:"12px"},quoteCard:{border:"1px solid #CBD5E1",borderRadius:"8px",padding:"16px",backgroundColor:"#F8FAFC",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",marginBottom:"16px",cursor:"pointer",transition:"transform 0.2s ease, box-shadow 0.2s ease"},quoteText:{fontStyle:"italic",color:"#475569",fontSize:"14px",fontWeight:400,marginBottom:"12px"},quoteMeta:{color:"#475569",fontSize:"12px",fontWeight:400},quoteAuthor:{fontSize:"10px",fontWeight:600,color:"#475569",marginTop:"8px",marginBottom:"18px"},button:{color:"#5928ED",fontSize:"14px",fontWeight:600,background:"none",border:"none",cursor:"pointer",padding:0,textDecoration:"none",paddingLeft:"12px"},geoLocationsContainer:{marginTop:"24px",marginBottom:"24px"},geoText:{fontSize:"14px",fontWeight:500,cursor:"pointer",color:"#532BED"},geoDivider:{margin:"0 8px",color:"#475abb",backgroundColor:"#475abb",width:"1px",height:"18px",display:"inline-block"},geoLocationFlex:{display:"inline-flex",alignItems:"center",gap:"8px",marginBottom:"8px"},charactersContainer:{marginTop:"16px"},charactersGrid:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"16px",marginBottom:"16px",paddingLeft:"12px"},characterCard:{border:"1px solid #E5E7EB",borderRadius:"8px",backgroundColor:"#FFFFFF",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",display:"flex",alignItems:"flex-start",gap:"12px",padding:"16px",cursor:"pointer",transition:"transform 0.2s ease, box-shadow 0.2s ease"},avatar:{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"9999px",fontSize:"14px",fontWeight:600,flexShrink:0},charName:{fontStyle:"normal",fontWeight:600,color:"#101827",fontSize:"16px"},charDesc:{fontStyle:"normal",fontWeight:400,fontSize:"14px",color:"#6B7280"},retryButton:{backgroundColor:"#5928EC",color:"#fff",padding:"6px 10px",border:"none",borderRadius:"6px",cursor:"pointer",fontSize:"12px",fontWeight:"500"}};exports.default=function(o){o.data;var l=o.updateQuotesToHighLight,d=o.handleFetchManuscriptElements,u=o.BookIsbn,c=o.title,g=s.useState([]),x=g[0],p=g[1],h=s.useState(1),_=h[0],f=h[1],y=s.useState(!1),m=y[0],v=y[1],b=s.useState(!0),j=b[0],S=b[1],C=s.useState(0),T=C[0],k=C[1],w=s.useState([]),q=w[0],B=w[1],D=s.useState(1),L=D[0],F=D[1],M=s.useState(!1),E=M[0],P=M[1],W=s.useState(!0),I=W[0],z=W[1],R=s.useState(0),H=R[0],N=R[1],G=s.useState([]),A=G[0],K=G[1],Y=s.useState(1),O=Y[0],Q=Y[1],J=s.useState(!1),U=J[0],V=J[1],X=s.useState(!0),Z=X[0],$=X[1],ee=s.useState(0),te=ee[0],ne=ee[1],se=s.useState({list:"",index:-1,page:1}),ae=se[0],ie=se[1],re=function(t){var n=t.endpoint,s=t.page,a=t.isbn,i=t.setData,r=t.setLoading,o=t.setHasMore,l=t.setTotalPage,u=t.title;return e.__awaiter(void 0,void 0,void 0,(function(){var t,c,g,x;return e.__generator(this,(function(e){switch(e.label){case 0:return r(!0),[4,d({endpoint:n,page:s,pageSize:10,isbn:a,title:u})];case 1:return t=e.sent(),o(!(null===(c=null==t?void 0:t.pagination)||void 0===c?void 0:c.hasNext)&&!(null===(g=null==t?void 0:t.pagination)||void 0===g?void 0:g.hasPrevious)),l((null===(x=null==t?void 0:t.pagination)||void 0===x?void 0:x.totalPages)||0),i((null==t?void 0:t.data)||[]),r(!1),[2]}}))}))};return s.useEffect((function(){re({endpoint:"notable-quotes",page:_,isbn:u,setData:p,setLoading:v,setHasMore:S,setTotalPage:k,title:c})}),[_]),s.useEffect((function(){re({endpoint:"notable-characters",page:L,isbn:u,setData:B,setLoading:P,setHasMore:z,setTotalPage:N,title:c})}),[L]),s.useEffect((function(){re({endpoint:"geo-locations",page:O,isbn:u,setData:K,setLoading:V,setHasMore:$,setTotalPage:ne,title:c})}),[O]),t.jsxs("div",{children:[t.jsxs("div",e.__assign({style:{marginBottom:"24px"}},{children:[t.jsx("p",e.__assign({style:r.sectionTitle},{children:"Notable Quotes"})),t.jsxs("div",e.__assign({style:r.quotesPadding},{children:[m?t.jsx("div",e.__assign({style:{display:"flex",flexDirection:"column",rowGap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map((function(n){return t.jsxs("div",e.__assign({style:r.quoteCard},{children:[t.jsx(a.default,{variant:"text",width:"60%",height:28}),t.jsx(a.default,{variant:"text",width:"40%",height:20}),t.jsx(a.default,{variant:"text",width:"25%",height:20}),t.jsx(a.default,{variant:"text",width:"30%",height:20})]}),n)}))})):0===x.length?t.jsxs("p",e.__assign({style:{color:"#6B7280",fontStyle:"italic"}},{children:["No notable quotes found. ",t.jsx("button",e.__assign({style:r.retryButton,onClick:function(){return re({endpoint:"notable-quotes",page:_,isbn:u,setData:p,setLoading:v,setHasMore:S,setTotalPage:k,title:c})}},{children:"Retry"}))]})):t.jsx(t.Fragment,{children:x.map((function(n,s){var a="notable"===ae.list&&ae.page===_&&ae.index===s;return t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},r.quoteCard),{borderColor:a?"rgb(83, 43, 237)":"#CBD5E1"}),onMouseEnter:function(e){e.currentTarget.style.transform="translateY(-4px)",e.currentTarget.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"},onMouseLeave:function(e){e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.1)"},onClick:function(){return e.__awaiter(void 0,void 0,void 0,(function(){var t,a;return e.__generator(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),ie({list:"notable",page:_,index:s}),(null===(a=null==n?void 0:n.chunkIds)||void 0===a?void 0:a.length)>0?[4,l(n.text,"Notable Quotes",n.chunkIds,0)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[3,4];case 3:return t=e.sent(),console.error("Failed to highlight quote:",t),[3,4];case 4:return[2]}}))}))}},{children:[t.jsx("p",e.__assign({style:r.quoteText},{children:null==n?void 0:n.text})),t.jsxs("p",e.__assign({style:r.quoteMeta},{children:[n.chapter," ",t.jsx("br",{})," ",n.page]})),t.jsxs("p",e.__assign({style:r.quoteAuthor},{children:["— ",null==n?void 0:n.author]}))]}),s)}))}),t.jsx("div",e.__assign({style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!j&&t.jsx(n.default,{disabled:m,count:T,page:_,onChange:function(e,t){return f(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),t.jsxs("div",e.__assign({style:r.geoLocationsContainer},{children:[t.jsx("p",e.__assign({style:r.sectionTitle},{children:"Key Geo Locations"})),t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},r.quotesPadding),{marginBottom:"8px"})},{children:[U?t.jsx("div",e.__assign({style:{display:"flex",flexWrap:"wrap",gap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map((function(e){return t.jsx(a.default,{variant:"rect",width:100,height:20,style:{borderRadius:"8px"}},e)}))})):0===A.length?t.jsxs("p",e.__assign({style:{color:"#6B7280",fontStyle:"italic",paddingLeft:"12px"}},{children:["No key geo locations found. ",t.jsx("button",e.__assign({style:r.retryButton,onClick:function(){return re({endpoint:"geo-locations",page:O,isbn:u,setData:K,setLoading:V,setHasMore:$,setTotalPage:ne,title:c})}},{children:"Retry"}))]})):t.jsx(t.Fragment,{children:A.map((function(n,s){var a="geo_location"===ae.list&&ae.page===O&&ae.index===s;return t.jsxs("span",e.__assign({style:r.geoLocationFlex},{children:[t.jsx("span",e.__assign({style:e.__assign(e.__assign({},r.geoText),{fontWeight:a?"700":"",textDecoration:a?"underline":""}),onClick:function(){return e.__awaiter(void 0,void 0,void 0,(function(){var t,a;return e.__generator(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),ie({list:"geo_location",page:O,index:s}),(null===(a=null==n?void 0:n.chunkIds)||void 0===a?void 0:a.length)>0?[4,l(n.name,"Key Geo Locations",n.chunkIds,0)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[3,4];case 3:return t=e.sent(),console.error("Failed to highlight location:",t),[3,4];case 4:return[2]}}))}))},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:null==n?void 0:n.name})),s<A.length-1&&t.jsx("span",{style:r.geoDivider})]}),s)}))}),t.jsx("div",e.__assign({style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!Z&&t.jsx(n.default,{disabled:U,count:te,page:O,onChange:function(e,t){return Q(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),t.jsxs("div",e.__assign({style:r.charactersContainer},{children:[t.jsx("p",e.__assign({style:r.sectionTitle},{children:"Key Characters"})),E?t.jsx("div",e.__assign({style:{display:"flex",flexWrap:"wrap",gap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map((function(n){return t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},r.characterCard),{flexBasis:"40%"})},{children:[t.jsx(a.default,{variant:"circle",style:e.__assign(e.__assign({},r.avatar),{flexShrink:0})}),t.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",flex:1}},{children:[t.jsx(a.default,{variant:"text",style:{flex:"1",flexShrink:0}}),t.jsx(a.default,{variant:"text",style:{flex:"1"}}),t.jsx(a.default,{variant:"text",style:{flex:"1"}}),t.jsx(a.default,{variant:"text",style:{flex:"1"}})]}))]}),n)}))})):0===q.length?t.jsxs("p",e.__assign({style:{color:"#6B7280",fontStyle:"italic",paddingLeft:"12px"}},{children:["No key characters found. ",t.jsx("button",e.__assign({style:r.retryButton,onClick:function(){return re({endpoint:"notable-characters",page:L,isbn:u,setData:B,setLoading:P,setHasMore:z,setTotalPage:N,title:c})}},{children:"Retry"}))]})):t.jsx(t.Fragment,{children:t.jsx("div",e.__assign({style:r.charactersGrid},{children:q.map((function(n,s){var a=e.__assign(e.__assign({},r.avatar),{backgroundColor:n.bg,color:n.color}),o="key_character"===ae.list&&ae.page===L&&ae.index===s;return t.jsxs("div",e.__assign({onMouseEnter:function(e){e.currentTarget.style.transform="translateY(-4px)",e.currentTarget.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"},onMouseLeave:function(e){e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.1)"},style:e.__assign(e.__assign({},r.characterCard),{borderColor:o?"rgb(83, 43, 237)":"#E5E7EB"}),onClick:function(){return e.__awaiter(void 0,void 0,void 0,(function(){var t,a;return e.__generator(this,(function(e){switch(e.label){case 0:ie({list:"key_character",page:L,index:s}),e.label=1;case 1:return e.trys.push([1,4,,5]),(null===(a=null==n?void 0:n.chunkIds)||void 0===a?void 0:a.length)>0?[4,l(n.name,"Key Characters",n.chunkIds,0)]:[3,3];case 2:e.sent(),e.label=3;case 3:return[3,5];case 4:return t=e.sent(),console.error("Failed to highlight character:",t),[3,5];case 5:return[2]}}))}))}},{children:[t.jsx("div",e.__assign({style:a},{children:n.initials})),t.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column"}},{children:[t.jsx("p",e.__assign({style:e.__assign(e.__assign({},r.charName),{margin:0})},{children:n.name})),t.jsx("p",e.__assign({style:e.__assign(e.__assign({},r.charDesc),{margin:0,marginTop:"4px"})},{children:t.jsx(i.ReactMarkdown,e.__assign({components:{p:function(n){n.node;var s=e.__rest(n,["node"]);return t.jsx("p",e.__assign({style:{marginTop:"0"}},s))}}},{children:null==n?void 0:n.description}))}))]}))]}),s)}))}))}),t.jsx("div",e.__assign({style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!I&&t.jsx(n.default,{count:H,disabled:E,page:L,onChange:function(e,t){return F(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})};
|
|
2
2
|
//# sourceMappingURL=BookElementsCard.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../node_modules/tslib/tslib.es6.mjs.js"),i=require("react/jsx-runtime"),t=require("react"),o=require("../../node_modules/@material-ui/core/esm/Accordion/Accordion.js"),n=require("../../node_modules/@material-ui/core/esm/AccordionSummary/AccordionSummary.js"),r=require("../../_virtual/ExpandMore.js"),a=require("../../_virtual/Close.js"),s=require("../../node_modules/react-resizable-panels/dist/react-resizable-panels.browser.js"),l=require("./BookDetailsCard/BookDetailsCard.js"),d=require("./BookOverviewCard/BookOverviewCard.js"),c=require("./BookElementsCard/BookElementsCard.js"),u=require("./BookCopyrightsCard/BookCopyrightsCard.js"),g=require("./BookPeopleAwardsCard/BookPeopleAwardsCard.js"),h=require("./BookPreview/BookPreview.js"),x=require("../../node_modules/@material-ui/core/esm/Dialog/Dialog.js"),p=require("../../node_modules/@material-ui/core/esm/DialogContent/DialogContent.js"),_=require("../../node_modules/@material-ui/core/esm/Typography/Typography.js"),m=require("../../node_modules/@material-ui/core/esm/AccordionDetails/AccordionDetails.js"),f=require("../../node_modules/@material-ui/core/esm/IconButton/IconButton.js"),j={dialogPaper:{maxWidth:"none",fontFamily:"Inter, sans-serif"},dialogContent:{padding:0,backgroundColor:"#FFFFFF",overflow:"hidden",height:"90vh",position:"relative"},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"}},y={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%"}},v=i.jsx("svg",e.__assign({style:y.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},{children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})})),b=function(t){var o=t.header,n=t.subheader,r=t.icon;return i.jsx("div",e.__assign({style:y.wrapper},{children:i.jsxs("div",e.__assign({style:y.inner},{children:[i.jsx("div",e.__assign({style:{marginBottom:"32px"}},{children:i.jsx("div",e.__assign({style:y.iconWrapper},{children:r||v}))})),i.jsxs("div",{children:[i.jsx("h1",e.__assign({style:y.heading},{children:o})),i.jsx("p",e.__assign({style:y.text},{children:n}))]})]}))}))};exports.comingSoonStyles=y,exports.default=function(y){var k=y.open,C=y.onClose,B=y.isNonHighlightedBlur,w=y.isBookemon,S=y.getHighlightContent,F=y.handleFetchManuscriptElements,D=y.data,z=y.showComingSoon,P=void 0!==z&&z,q=y.comingSoonData,I=void 0===q?{header:"Bookemon Coming Soon!!",subheader:"We're working on something amazing. Stay tuned for updates!",icon:v}:q,A=y.customStyle,H=void 0===A?{}:A,E=y.isBlurToggleVisible,L=void 0!==E&&E,O=t.useState({textToHighLight:"",content:""}),R=O[0],T=O[1],M=t.useState(1),W=M[0],N=M[1],V=t.useState(!1),Q=V[0],Y=V[1],G=t.useState("Book Preview"),J=G[0],K=G[1],U=t.useState(70),X=U[0],Z=U[1],$=t.useRef(null),ee=t.useState(!1),ie=ee[0],te=ee[1],oe=function(i,t,o,n){return void 0===n&&(n=0),e.__awaiter(void 0,void 0,void 0,(function(){var r,a,s,l,d,c,u,g,h,x,p,_,m,f,j,y;return e.__generator(this,(function(e){switch(e.label){case 0:T({textToHighLight:"",content:""}),te(!1),Y(!0),K(t),e.label=1;case 1:return e.trys.push([1,5,6,7]),o&&0!==o.length?[4,S([o[n]])]:(Y(!1),Z(70),null===(j=$.current)||void 0===j||j.resize(70),[2]);case 2:if(r=e.sent(),a=(null==r?void 0:r.data)||r||[],!Array.isArray(a)||0===a.length)return te(!0),Y(!1),[2];for(l=(s=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():""})(i),d=null,c=0,u=a;c<u.length;c++)if(_=u[c],s(_.normalizedContent||_.htmlContent).includes(l)){d=_;break}if(!d)for(g=l.split(" ").filter(Boolean);g.length>0;){for(h=g.join(" "),x=0,p=a;x<p.length;x++)if(_=p[x],s(_.normalizedContent||_.htmlContent).includes(h)){d=_;break}if(d)break;g.pop()}return m=a.map((function(e){return e.htmlContent})).join("\n"),T({textToHighLight:d?d.htmlContent:"",content:m}),Z(50),null===(y=$.current)||void 0===y||y.resize(50),!d&&n+1<o.length?[4,oe(i,t,o,n+1)]:[3,4];case 3:return[2,e.sent()];case 4:return[2];case 5:return f=e.sent(),console.error("Highlight error:",f),te(!0),[3,7];case 6:return Y(!1),[7];case 7:return[2]}}))}))},ne=D.bookAwards,re=D.bookCopyRight,ae=D.bookDetails,se=D.bookElements,le=D.bookOverView,de=D.bookCoverImage,ce=null==ae?void 0:ae.isbn;return i.jsx(x.default,e.__assign({open:k,fullWidth:!0,PaperProps:{style:e.__assign(e.__assign({},null==j?void 0:j.dialogPaper),null==H?void 0:H.dialogDimension)}},{children:i.jsxs(p.default,e.__assign({style:j.dialogContent},{children:[!P&&i.jsx("div",e.__assign({style:j.container},{children:i.jsxs(s.PanelGroup,e.__assign({direction:"horizontal"},{children:[i.jsx(s.Panel,e.__assign({order:1,ref:$,defaultSize:X||70},{children:i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},null==j?void 0:j.leftPanel),null==H?void 0:H.leftPanel)},{children:[i.jsx("div",e.__assign({style:{marginBottom:"24px"}},{children:i.jsxs(o.default,e.__assign({defaultExpanded:!0,elevation:0,style:j.accordion},{children:[i.jsx(n.default,e.__assign({expandIcon:i.jsx(r.default,{}),style:j.accordionSummary},{children:i.jsx(_.default,e.__assign({style:j.heading},{children:"Book Overview"}))})),i.jsx(m.default,e.__assign({style:j.accordionDetails},{children:le&&Object.keys(le).length>0?i.jsx(d.default,{data:le}):i.jsx("div",e.__assign({style:j.errorState},{children:"No overview data available."}))}))]}))})),i.jsx("div",e.__assign({style:{marginBottom:"24px"}},{children:i.jsxs(o.default,e.__assign({elevation:0,style:j.accordion},{children:[i.jsx(n.default,e.__assign({expandIcon:i.jsx(r.default,{}),style:j.accordionSummary},{children:i.jsx(_.default,e.__assign({style:j.heading},{children:"Book Manuscript Elements"}))})),i.jsx(m.default,e.__assign({style:j.accordionDetails},{children:i.jsx(c.default,{data:se,handleFetchManuscriptElements:F,BookIsbn:ce,updateQuotesToHighLight:oe})}))]}))})),i.jsx("div",e.__assign({style:{marginBottom:"24px"}},{children:i.jsxs(o.default,e.__assign({elevation:0,style:j.accordion},{children:[i.jsx(n.default,e.__assign({expandIcon:i.jsx(r.default,{}),style:j.accordionSummary},{children:i.jsx(_.default,e.__assign({style:j.heading},{children:"Book Metadata Details"}))})),i.jsx(m.default,e.__assign({style:j.accordionDetails},{children:ae&&Object.keys(ae).length>0?i.jsx(l.default,{data:ae}):i.jsx("div",e.__assign({style:j.errorState},{children:"No Book Metadata data available."}))}))]}))})),i.jsx("div",e.__assign({style:{marginBottom:"24px"}},{children:i.jsxs(o.default,e.__assign({elevation:0,style:j.accordion},{children:[i.jsx(n.default,e.__assign({expandIcon:i.jsx(r.default,{}),style:j.accordionSummary},{children:i.jsx(_.default,e.__assign({style:j.heading},{children:"Copyrights & Marketing"}))})),i.jsx(m.default,e.__assign({style:j.accordionDetails},{children:re&&Object.keys(re).length>0?i.jsx(u.default,{data:re}):i.jsx("div",e.__assign({style:j.errorState},{children:"No Copyrights & Marketing data available."}))}))]}))})),i.jsx("div",{children:i.jsxs(o.default,e.__assign({elevation:0,style:j.accordion},{children:[i.jsx(n.default,e.__assign({expandIcon:i.jsx(r.default,{}),style:j.accordionSummary},{children:i.jsx(_.default,e.__assign({style:j.heading},{children:"People & Awards"}))})),i.jsx(m.default,e.__assign({style:j.accordionDetails},{children:ne&&Object.keys(ne).length>0?i.jsx(g.default,{data:ne}):i.jsx("div",e.__assign({style:j.errorState},{children:"No People & Awards data available."}))}))]}))})]}))})),i.jsx(s.PanelResizeHandle,{style:{width:"3px",background:"#D1D5DC",cursor:"col-resize"}}),i.jsx(s.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:i.jsx(h.default,{bookOverView:le,bookCoverImage:de,onClose:C,clickableElementCategory:J,quotesToHighLightData:R,updateQuotesToHighLight:oe,citationLoad:Q,previewPage:W,setPreviewPage:N,customStyle:H,comingSoonData:I,isNonHighlightedBlur:B,isBlurToggleVisible:L,isBookemon:w,noHtmlContent:ie})}))]}))})),P?i.jsxs("div",e.__assign({style:j.blurOverlay},{children:[i.jsx(f.default,e.__assign({style:j.closeButton,onClick:C},{children:i.jsx(a.default,{})})),i.jsx(b,{header:I.header,subheader:I.subheader,icon:I.icon})]})):i.jsx(i.Fragment,{})]}))}))},exports.defaultIcon=v;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../node_modules/tslib/tslib.es6.mjs.js"),i=require("react/jsx-runtime"),t=require("react"),o=require("../../node_modules/@material-ui/core/esm/Accordion/Accordion.js"),n=require("../../node_modules/@material-ui/core/esm/AccordionSummary/AccordionSummary.js"),r=require("../../_virtual/ExpandMore.js"),a=require("../../_virtual/Close.js"),s=require("../../node_modules/react-resizable-panels/dist/react-resizable-panels.browser.js"),l=require("./BookDetailsCard/BookDetailsCard.js"),d=require("./BookOverviewCard/BookOverviewCard.js"),c=require("./BookElementsCard/BookElementsCard.js"),u=require("./BookCopyrightsCard/BookCopyrightsCard.js"),g=require("./BookPeopleAwardsCard/BookPeopleAwardsCard.js"),h=require("./BookPreview/BookPreview.js"),x=require("../../node_modules/@material-ui/core/esm/Dialog/Dialog.js"),p=require("../../node_modules/@material-ui/core/esm/DialogContent/DialogContent.js"),_=require("../../node_modules/@material-ui/core/esm/Typography/Typography.js"),m=require("../../node_modules/@material-ui/core/esm/AccordionDetails/AccordionDetails.js"),f=require("../../node_modules/@material-ui/core/esm/IconButton/IconButton.js"),j={dialogPaper:{maxWidth:"none",fontFamily:"Inter, sans-serif"},dialogContent:{padding:0,backgroundColor:"#FFFFFF",overflow:"hidden",height:"90vh",position:"relative"},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"}},y={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%"}},v=i.jsx("svg",e.__assign({style:y.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},{children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})})),b=function(t){var o=t.header,n=t.subheader,r=t.icon;return i.jsx("div",e.__assign({style:y.wrapper},{children:i.jsxs("div",e.__assign({style:y.inner},{children:[i.jsx("div",e.__assign({style:{marginBottom:"32px"}},{children:i.jsx("div",e.__assign({style:y.iconWrapper},{children:r||v}))})),i.jsxs("div",{children:[i.jsx("h1",e.__assign({style:y.heading},{children:o})),i.jsx("p",e.__assign({style:y.text},{children:n}))]})]}))}))};exports.comingSoonStyles=y,exports.default=function(y){var k=y.open,C=y.onClose,B=y.isNonHighlightedBlur,w=y.isBookemon,S=y.getHighlightContent,F=y.handleFetchManuscriptElements,D=y.data,z=y.showComingSoon,P=void 0!==z&&z,q=y.comingSoonData,I=void 0===q?{header:"Bookemon Coming Soon!!",subheader:"We're working on something amazing. Stay tuned for updates!",icon:v}:q,A=y.customStyle,H=void 0===A?{}:A,E=y.isBlurToggleVisible,L=void 0!==E&&E,O=t.useState({textToHighLight:"",content:""}),R=O[0],T=O[1],M=t.useState(1),W=M[0],N=M[1],V=t.useState(!1),Q=V[0],Y=V[1],G=t.useState("Book Preview"),J=G[0],K=G[1],U=t.useState(70),X=U[0],Z=U[1],$=t.useRef(null),ee=t.useState(!1),ie=ee[0],te=ee[1],oe=D.bookAwards,ne=D.bookCopyRight,re=D.bookDetails,ae=D.bookElements,se=D.bookOverView,le=D.bookCoverImage,de=function(i,t,o,n){return void 0===n&&(n=0),e.__awaiter(void 0,void 0,void 0,(function(){var r,a,s,l,d,c,u,g,h,x,p,_,m,f,j,y;return e.__generator(this,(function(e){switch(e.label){case 0:T({textToHighLight:"",content:""}),te(!1),Y(!0),K(t),e.label=1;case 1:return e.trys.push([1,5,6,7]),o&&0!==o.length?[4,S([o[n]])]:(Y(!1),Z(70),null===(j=$.current)||void 0===j||j.resize(70),[2]);case 2:if(r=e.sent(),a=(null==r?void 0:r.data)||r||[],!Array.isArray(a)||0===a.length)return te(!0),Y(!1),[2];for(l=(s=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():""})(i),d=null,c=0,u=a;c<u.length;c++)if(_=u[c],s(_.normalizedContent||_.htmlContent).includes(l)){d=_;break}if(!d)for(g=l.split(" ").filter(Boolean);g.length>0;){for(h=g.join(" "),x=0,p=a;x<p.length;x++)if(_=p[x],s(_.normalizedContent||_.htmlContent).includes(h)){d=_;break}if(d)break;g.pop()}return m=a.map((function(e){return e.htmlContent})).join("\n"),T({textToHighLight:d?d.htmlContent:"",content:m}),Z(50),null===(y=$.current)||void 0===y||y.resize(50),!d&&n+1<o.length?[4,de(i,t,o,n+1)]:[3,4];case 3:return[2,e.sent()];case 4:return[2];case 5:return f=e.sent(),console.error("Highlight error:",f),te(!0),[3,7];case 6:return Y(!1),[7];case 7:return[2]}}))}))},ce=null==re?void 0:re.isbn;return i.jsx(x.default,e.__assign({open:k,fullWidth:!0,PaperProps:{style:e.__assign(e.__assign({},null==j?void 0:j.dialogPaper),null==H?void 0:H.dialogDimension)}},{children:i.jsxs(p.default,e.__assign({style:j.dialogContent},{children:[!P&&i.jsx("div",e.__assign({style:j.container},{children:i.jsxs(s.PanelGroup,e.__assign({direction:"horizontal"},{children:[i.jsx(s.Panel,e.__assign({order:1,ref:$,defaultSize:X||70},{children:i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},null==j?void 0:j.leftPanel),null==H?void 0:H.leftPanel)},{children:[i.jsx("div",e.__assign({style:{marginBottom:"24px"}},{children:i.jsxs(o.default,e.__assign({defaultExpanded:!0,elevation:0,style:j.accordion},{children:[i.jsx(n.default,e.__assign({expandIcon:i.jsx(r.default,{}),style:j.accordionSummary},{children:i.jsx(_.default,e.__assign({style:j.heading},{children:"Book Overview"}))})),i.jsx(m.default,e.__assign({style:j.accordionDetails},{children:se&&Object.keys(se).length>0?i.jsx(d.default,{data:se}):i.jsx("div",e.__assign({style:j.errorState},{children:"No overview data available."}))}))]}))})),i.jsx("div",e.__assign({style:{marginBottom:"24px"}},{children:i.jsxs(o.default,e.__assign({elevation:0,style:j.accordion},{children:[i.jsx(n.default,e.__assign({expandIcon:i.jsx(r.default,{}),style:j.accordionSummary},{children:i.jsx(_.default,e.__assign({style:j.heading},{children:"Book Manuscript Elements"}))})),i.jsx(m.default,e.__assign({style:j.accordionDetails},{children:i.jsx(c.default,{data:ae,title:(null==se?void 0:se.title)||"",handleFetchManuscriptElements:F,BookIsbn:ce,updateQuotesToHighLight:de})}))]}))})),i.jsx("div",e.__assign({style:{marginBottom:"24px"}},{children:i.jsxs(o.default,e.__assign({elevation:0,style:j.accordion},{children:[i.jsx(n.default,e.__assign({expandIcon:i.jsx(r.default,{}),style:j.accordionSummary},{children:i.jsx(_.default,e.__assign({style:j.heading},{children:"Book Metadata Details"}))})),i.jsx(m.default,e.__assign({style:j.accordionDetails},{children:re&&Object.keys(re).length>0?i.jsx(l.default,{data:re}):i.jsx("div",e.__assign({style:j.errorState},{children:"No Book Metadata data available."}))}))]}))})),i.jsx("div",e.__assign({style:{marginBottom:"24px"}},{children:i.jsxs(o.default,e.__assign({elevation:0,style:j.accordion},{children:[i.jsx(n.default,e.__assign({expandIcon:i.jsx(r.default,{}),style:j.accordionSummary},{children:i.jsx(_.default,e.__assign({style:j.heading},{children:"Copyrights & Marketing"}))})),i.jsx(m.default,e.__assign({style:j.accordionDetails},{children:ne&&Object.keys(ne).length>0?i.jsx(u.default,{data:ne}):i.jsx("div",e.__assign({style:j.errorState},{children:"No Copyrights & Marketing data available."}))}))]}))})),i.jsx("div",{children:i.jsxs(o.default,e.__assign({elevation:0,style:j.accordion},{children:[i.jsx(n.default,e.__assign({expandIcon:i.jsx(r.default,{}),style:j.accordionSummary},{children:i.jsx(_.default,e.__assign({style:j.heading},{children:"People & Awards"}))})),i.jsx(m.default,e.__assign({style:j.accordionDetails},{children:oe&&Object.keys(oe).length>0?i.jsx(g.default,{data:oe}):i.jsx("div",e.__assign({style:j.errorState},{children:"No People & Awards data available."}))}))]}))})]}))})),i.jsx(s.PanelResizeHandle,{style:{width:"3px",background:"#D1D5DC",cursor:"col-resize"}}),i.jsx(s.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:i.jsx(h.default,{bookOverView:se,bookCoverImage:le,onClose:C,clickableElementCategory:J,quotesToHighLightData:R,updateQuotesToHighLight:de,citationLoad:Q,previewPage:W,setPreviewPage:N,customStyle:H,comingSoonData:I,isNonHighlightedBlur:B,isBlurToggleVisible:L,isBookemon:w,noHtmlContent:ie})}))]}))})),P?i.jsxs("div",e.__assign({style:j.blurOverlay},{children:[i.jsx(f.default,e.__assign({style:j.closeButton,onClick:C},{children:i.jsx(a.default,{})})),i.jsx(b,{header:I.header,subheader:I.subheader,icon:I.icon})]})):i.jsx(i.Fragment,{})]}))}))},exports.defaultIcon=v;
|
|
2
2
|
//# sourceMappingURL=Bookemon.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../node_modules/tslib/tslib.es6.mjs.js"),n=require("react/jsx-runtime"),t=require("react"),r=require("../../node_modules/react-markdown/lib/react-markdown.js"),i=require("../../node_modules/rehype-raw/lib/index.js"),a=require("../../node_modules/remark-gfm/lib/index.js"),o=require("../../node_modules/unist-util-visit/lib/index.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=s(t);function d(){return function(n){o.visit(n,"text",(function(n,t,r){var i;if(r&&"string"==typeof n.value&&n.value.includes("✓")){for(var a=n.value.split("✓"),o=[],s=0;s<a.length;s++){var l=a[s];l&&o.push({type:"text",value:l}),s<a.length-1&&o.push({type:"element",tagName:"span",properties:{className:["text-green-600","font-medium","inline-block","mr-1","align-middle"]},children:[{type:"text",value:"✓"}]})}return(i=r.children).splice.apply(i,e.__spreadArray([t,1],o,!1)),t+o.length}}))}}var p=function(t,r){if(!r)return t;var i=new RegExp(r.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&"),"gi")
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../node_modules/tslib/tslib.es6.mjs.js"),n=require("react/jsx-runtime"),t=require("react"),r=require("../../node_modules/react-markdown/lib/react-markdown.js"),i=require("../../node_modules/rehype-raw/lib/index.js"),a=require("../../node_modules/remark-gfm/lib/index.js"),o=require("../../node_modules/unist-util-visit/lib/index.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=s(t);function d(){return function(n){o.visit(n,"text",(function(n,t,r){var i;if(r&&"string"==typeof n.value&&n.value.includes("✓")){for(var a=n.value.split("✓"),o=[],s=0;s<a.length;s++){var l=a[s];l&&o.push({type:"text",value:l}),s<a.length-1&&o.push({type:"element",tagName:"span",properties:{className:["text-green-600","font-medium","inline-block","mr-1","align-middle"]},children:[{type:"text",value:"✓"}]})}return(i=r.children).splice.apply(i,e.__spreadArray([t,1],o,!1)),t+o.length}}))}}var p=function(t,r){if(!r||!r.trim())return t;var i=new RegExp("(".concat(r.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&"),")"),"gi");return t.split(i).map((function(t,r){return i.test(t)?n.jsx("mark",e.__assign({className:"custom-highlight"},{children:t}),r):t}))};function u(){return function(e){o.visit(e,"element",(function(e,n,t){if(t&&"p"===e.tagName)return e.children&&1===e.children.length&&"element"===e.children[0].type&&"details"===e.children[0].tagName?(t.children.splice(n,1,e.children[0]),n):void 0}))}}var c=function(e){var n;return"text"===(null==e?void 0:e.type)&&/^\s*$/.test(null!==(n=e.value)&&void 0!==n?n:"")};function m(){return function(e){o.visit(e,"element",(function(e){var n,t;if("details"===e.tagName&&"data-target"in(e.properties||{})){var r=e.children||[],i=0;"element"===(null===(n=r[0])||void 0===n?void 0:n.type)&&"summary"===(null===(t=r[0])||void 0===t?void 0:t.tagName)&&(i=1);var a=r.slice(i),o=a.filter((function(e){return!c(e)}));if((1!==o.length||"element"!==o[0].type||!o[0].properties||!("data-popup"in o[0].properties)&&void 0===o[0].properties["data-popup"])&&!o.some((function(e){return"element"===(null==e?void 0:e.type)&&(null==e?void 0:e.properties)&&("data-popup"in e.properties||void 0!==e.properties["data-popup"])}))){var s={type:"element",tagName:"div",properties:{"data-popup":""},children:a};e.children=r.slice(0,i).concat([s])}}}))}}function g(){return function(e){o.visit(e,"element",(function(e){var n,t;if("details"===e.tagName){var r=e.properties||{};if(!("data-inline"in r)&&!("data-target"in r)){var i=e.children||[],a=0;"element"===(null===(n=i[0])||void 0===n?void 0:n.type)&&"summary"===(null===(t=i[0])||void 0===t?void 0:t.tagName)&&(a=1);var o=i.slice(a),s=o.filter((function(e){return!c(e)}));if((1!==s.length||"element"!==s[0].type||!s[0].properties||!("data-popup"in s[0].properties)&&void 0===s[0].properties["data-popup"])&&!s.some((function(e){return"element"===(null==e?void 0:e.type)&&(null==e?void 0:e.properties)&&("data-popup"in e.properties||void 0!==e.properties["data-popup"])}))){var l={type:"element",tagName:"div",properties:{"data-popup":""},children:o};e.children=i.slice(0,a).concat([l])}}}}))}}exports.default=function(o){var s=o.value,c=o.highlightedText,f=l.default.useRef(null),h=l.default.useRef(null);t.useEffect((function(){if(c){var e=setTimeout((function(){if(h.current){var e=h.current.querySelector("mark.custom-highlight");e&&e.scrollIntoView({behavior:"smooth",block:"center"})}}),100);return function(){return clearTimeout(e)}}}),[c,s]);return n.jsxs("div",e.__assign({ref:h,className:"flex h-[42vh] gap-4"},{children:[n.jsx("div",e.__assign({className:"h-[42vh] flex-1 rounded-xl border border-gray-200 bg-white p-5 shadow-sm"},{children:n.jsx("div",e.__assign({ref:h,className:"h-full overflow-y-auto pr-2"},{children:n.jsx(r.ReactMarkdown,e.__assign({remarkPlugins:[a.default],rehypePlugins:[i.default,u,d,m,g],components:{details:function(t){t.node;var r=e.__rest(t,["node"]),i=!!r["data-inline"],a=!!r["data-target"];return i?n.jsx("details",e.__assign({},r,{className:"md-details md-details--inline relative my-1 inline-block rounded-[8px] align-middle",onToggle:function(e){e.stopPropagation(),function(e){var n=e.currentTarget,t=n.getAttribute("data-inline");if(t&&f.current){var r=f.current.querySelector('details[data-target="'.concat(t,'"]'));r&&(r.open=n.open)}}(e)}},{children:r.children})):a?n.jsxs("details",e.__assign({},r,{className:"md-details md-details--target my-2 block",onToggle:function(e){return e.stopPropagation()}},{children:[n.jsx("summary",{className:"md-target-dummy-summary","aria-hidden":"true"}),r.children]})):n.jsx("details",e.__assign({},r,{className:"md-details md-details--block relative my-1 w-full rounded-[8px] align-middle",onToggle:function(e){return e.stopPropagation()}},{children:r.children}))},summary:function(t){t.node;var r=e.__rest(t,["node"]);return n.jsx("div",e.__assign({className:"mt-0"},{children:n.jsx("summary",e.__assign({className:"md-summary inline-flex cursor-pointer select-none items-center gap-1 py-1 font-medium hover:opacity-90",style:{color:"#19213D",fontWeight:500},onClick:function(e){return e.stopPropagation()}},r,{children:n.jsx("span",e.__assign({className:"whitespace-nowrap align-middle"},{children:r.children}))}))}))},ul:function(t){t.node;var r=e.__rest(t,["node"]);return n.jsx("ol",e.__assign({className:"md-ol my-1 list-decimal pl-5"},r))},ol:function(t){t.node;var r=e.__rest(t,["node"]);return n.jsx("ol",e.__assign({className:"md-ol my-1 list-decimal pl-5"},r))},div:function(t){var r,i=t.node,a=e.__rest(t,["node"]);return(null==i?void 0:i.properties)&&("data-popup"in i.properties||void 0!==(null===(r=i.properties)||void 0===r?void 0:r["data-popup"]))?n.jsx("div",e.__assign({},a,{className:(a.className?a.className+" ":"")+"md-popup",role:"region"})):n.jsx("div",e.__assign({},a))},p:function(e){var t=e.children,r=Array.isArray(t)?t:[t];return n.jsx("p",{children:r.map((function(e,t){return"string"==typeof e?p(e,c):n.jsx(l.default.Fragment,{children:e},t)}))})},li:function(t){var r=t.children;return n.jsx("li",e.__assign({style:{marginBottom:"4px"}},{children:r.map((function(e){return"string"==typeof e?p(e,c):e}))}))},code:function(t){var r=t.children,i=e.__rest(t,["children"]);return n.jsx("code",e.__assign({},i,{children:r.map((function(e){return"string"==typeof e?p(e,c):e}))}))}}},{children:s}))}))})),n.jsx("style",{children:"\n .custom-highlight {\n background-color: #fef08a; \n color: #374151; \n padding: 2px 4px;\n border-radius: 4px;\n }\n .md-root strong { color: #19213D !important; }\n .md-check-green { color: #16A34A !important; font-weight: 500; }\n details > summary::-webkit-details-marker { display: none; }\n .md-summary span { white-space: nowrap; }\n\n .md-target-dummy-summary { display: none !important; }\n\n /* Chevron animation */\n .md-details[open] > summary .md-chevron { transform: rotate(180deg); transition: transform .25s cubic-bezier(.2,.8,.2,1); }\n .md-details > summary .md-chevron { transition: transform .25s cubic-bezier(.2,.8,.2,1); }\n\n /* Normal details open look */\n .md-details--block[open] {\n \n padding: 8px 10px;\n border-radius: 8px;\n }\n\n /* Inline trigger never reveals inner content */\n .md-details--inline > :not(summary) { display: none !important; }\n\n /* Target popups (animated) */\n .md-details--target .md-popup,\n .md-details--target [data-popup] {\n display: block;\n margin-top: 6px;\n border: 1px solid #6D28D9;\n color: #6D28D9;\n border-radius: 10px;\n padding: 12px;\n box-shadow: 0 8px 24px rgba(0,0,0,.06);\n opacity: 0;\n transform: translateY(-4px);\n transition: opacity .2s ease, transform .2s ease;\n font-size: 12px;\n line-height: 1.35;\n background: #6D28D91A;\n }\n .md-details--target[open] .md-popup,\n .md-details--target[open] [data-popup] {\n opacity: 1;\n transform: translateY(0);\n }\n\n /* Popup body for normal details (✓ items) */\n .md-details--block[open] .md-popup,\n .md-details--block[open] [data-popup] {\n display: block;\n border: 1px solid #6D28D9;\n color: #6D28D9;\n border-radius: 10px;\n padding: 12px; \n font-size: 12px;\n line-height: 1.35;\n font-weight: 500;\n background: #6D28D91A;\n }\n\n /* ---- NESTED POPUP GUARD: if a popup is inside a popup, neutralize the inner one ---- */\n .md-popup .md-popup,\n .md-popup [data-popup] {\n border: none !important;\n background: transparent !important;\n padding: 0 !important;\n box-shadow: none !important;\n color: inherit !important;\n }\n "})]}))};
|
|
2
2
|
//# sourceMappingURL=MarkdownRenderer.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e,__awaiter as t,__rest as n,__generator as o}from"../../../node_modules/tslib/tslib.es6.mjs.js";import{jsxs as r,jsx as i,Fragment as a}from"react/jsx-runtime";import l from"../../../node_modules/@material-ui/lab/esm/Pagination/Pagination.js";import"../../../node_modules/@material-ui/utils/esm/elementAcceptingRef.js";import"../../../node_modules/@material-ui/utils/esm/elementTypeAcceptingRef.js";import"../../../_virtual/index.js";import"../../../node_modules/@material-ui/utils/esm/ponyfillGlobal.js";import"../../../node_modules/@material-ui/utils/esm/refType.js";import{useState as s,useEffect as d}from"react";import"../../../node_modules/@material-ui/core/esm/SvgIcon/SvgIcon.js";import"react-dom";import c from"../../../node_modules/@material-ui/lab/esm/Skeleton/Skeleton.js";import{ReactMarkdown as u}from"../../../node_modules/react-markdown/lib/react-markdown.js";var p={sectionTitle:{fontSize:"14px",fontWeight:600,color:"#667085",marginBottom:"12px"},quotesPadding:{paddingLeft:"12px"},quoteCard:{border:"1px solid #CBD5E1",borderRadius:"8px",padding:"16px",backgroundColor:"#F8FAFC",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",marginBottom:"16px",cursor:"pointer",transition:"transform 0.2s ease, box-shadow 0.2s ease"},quoteText:{fontStyle:"italic",color:"#475569",fontSize:"14px",fontWeight:400,marginBottom:"12px"},quoteMeta:{color:"#475569",fontSize:"12px",fontWeight:400},quoteAuthor:{fontSize:"10px",fontWeight:600,color:"#475569",marginTop:"8px",marginBottom:"18px"},button:{color:"#5928ED",fontSize:"14px",fontWeight:600,background:"none",border:"none",cursor:"pointer",padding:0,textDecoration:"none",paddingLeft:"12px"},geoLocationsContainer:{marginTop:"24px",marginBottom:"24px"},geoText:{fontSize:"14px",fontWeight:500,cursor:"pointer",color:"#532BED"},geoDivider:{margin:"0 8px",color:"#475abb",backgroundColor:"#475abb",width:"1px",height:"18px",display:"inline-block"},geoLocationFlex:{display:"inline-flex",alignItems:"center",gap:"8px",marginBottom:"8px"},charactersContainer:{marginTop:"16px"},charactersGrid:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"16px",marginBottom:"16px",paddingLeft:"12px"},characterCard:{border:"1px solid #E5E7EB",borderRadius:"8px",backgroundColor:"#FFFFFF",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",display:"flex",alignItems:"flex-start",gap:"12px",padding:"16px",cursor:"pointer",transition:"transform 0.2s ease, box-shadow 0.2s ease"},avatar:{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"9999px",fontSize:"14px",fontWeight:600,flexShrink:0},charName:{fontStyle:"normal",fontWeight:600,color:"#101827",fontSize:"16px"},charDesc:{fontStyle:"normal",fontWeight:400,fontSize:"14px",color:"#6B7280"},retryButton:{backgroundColor:"#5928EC",color:"#fff",padding:"6px 10px",border:"none",borderRadius:"6px",cursor:"pointer",fontSize:"12px",fontWeight:"500"}},g=function(g){g.data;var h=g.updateQuotesToHighLight,x=g.handleFetchManuscriptElements,f=g.BookIsbn,m=s([]),y=m[0],v=m[1],b=s(1),C=b[0],T=b[1],k=s(!1),S=k[0],w=k[1],B=s(!0),D=B[0],L=B[1],j=s(0),q=j[0],M=j[1],F=s([]),E=F[0],P=F[1],_=s(1),W=_[0],I=_[1],z=s(!1),R=z[0],H=z[1],N=s(!0),G=N[0],A=N[1],K=s(0),Y=K[0],Q=K[1],O=s([]),J=O[0],U=O[1],V=s(1),X=V[0],Z=V[1],$=s(!1),ee=$[0],te=$[1],ne=s(!0),oe=ne[0],re=ne[1],ie=s(0),ae=ie[0],le=ie[1],se=s({list:"",index:-1,page:1}),de=se[0],ce=se[1],ue=function(e){var n=e.endpoint,r=e.page,i=e.isbn,a=e.setData,l=e.setLoading,s=e.setHasMore,d=e.setTotalPage;return t(void 0,void 0,void 0,(function(){var e,t,c,u;return o(this,(function(o){switch(o.label){case 0:return l(!0),[4,x({endpoint:n,page:r,pageSize:10,isbn:i})];case 1:return e=o.sent(),s(!(null===(t=null==e?void 0:e.pagination)||void 0===t?void 0:t.hasNext)&&!(null===(c=null==e?void 0:e.pagination)||void 0===c?void 0:c.hasPrevious)),d((null===(u=null==e?void 0:e.pagination)||void 0===u?void 0:u.totalPages)||0),a((null==e?void 0:e.data)||[]),l(!1),[2]}}))}))};return d((function(){ue({endpoint:"notable-quotes",page:C,isbn:f,setData:v,setLoading:w,setHasMore:L,setTotalPage:M})}),[C]),d((function(){ue({endpoint:"notable-characters",page:W,isbn:f,setData:P,setLoading:H,setHasMore:A,setTotalPage:Q})}),[W]),d((function(){ue({endpoint:"geo-locations",page:X,isbn:f,setData:U,setLoading:te,setHasMore:re,setTotalPage:le})}),[X]),r("div",{children:[r("div",e({style:{marginBottom:"24px"}},{children:[i("p",e({style:p.sectionTitle},{children:"Notable Quotes"})),r("div",e({style:p.quotesPadding},{children:[S?i("div",e({style:{display:"flex",flexDirection:"column",rowGap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map((function(t){return r("div",e({style:p.quoteCard},{children:[i(c,{variant:"text",width:"60%",height:28}),i(c,{variant:"text",width:"40%",height:20}),i(c,{variant:"text",width:"25%",height:20}),i(c,{variant:"text",width:"30%",height:20})]}),t)}))})):0===y.length?r("p",e({style:{color:"#6B7280",fontStyle:"italic"}},{children:["No notable quotes found. ",i("button",e({style:p.retryButton,onClick:function(){return ue({endpoint:"notable-quotes",page:C,isbn:f,setData:v,setLoading:w,setHasMore:L,setTotalPage:M})}},{children:"Retry"}))]})):i(a,{children:y.map((function(n,a){var l="notable"===de.list&&de.page===C&&de.index===a;return r("div",e({style:e(e({},p.quoteCard),{borderColor:l?"rgb(83, 43, 237)":"#CBD5E1"}),onMouseEnter:function(e){e.currentTarget.style.transform="translateY(-4px)",e.currentTarget.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"},onMouseLeave:function(e){e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.1)"},onClick:function(){return t(void 0,void 0,void 0,(function(){var e,t;return o(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),ce({list:"notable",page:C,index:a}),(null===(t=null==n?void 0:n.chunkIds)||void 0===t?void 0:t.length)>0?[4,h(n.text,"Notable Quotes",n.chunkIds,0)]:[3,2];case 1:o.sent(),o.label=2;case 2:return[3,4];case 3:return e=o.sent(),console.error("Failed to highlight quote:",e),[3,4];case 4:return[2]}}))}))}},{children:[i("p",e({style:p.quoteText},{children:null==n?void 0:n.text})),r("p",e({style:p.quoteMeta},{children:[n.chapter," ",i("br",{})," ",n.page]})),r("p",e({style:p.quoteAuthor},{children:["— ",null==n?void 0:n.author]}))]}),a)}))}),i("div",e({style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!D&&i(l,{disabled:S,count:q,page:C,onChange:function(e,t){return T(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),r("div",e({style:p.geoLocationsContainer},{children:[i("p",e({style:p.sectionTitle},{children:"Key Geo Locations"})),r("div",e({style:e(e({},p.quotesPadding),{marginBottom:"8px"})},{children:[ee?i("div",e({style:{display:"flex",flexWrap:"wrap",gap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map((function(e){return i(c,{variant:"rect",width:100,height:20,style:{borderRadius:"8px"}},e)}))})):0===J.length?r("p",e({style:{color:"#6B7280",fontStyle:"italic",paddingLeft:"12px"}},{children:["No key geo locations found. ",i("button",e({style:p.retryButton,onClick:function(){return ue({endpoint:"geo-locations",page:X,isbn:f,setData:U,setLoading:te,setHasMore:re,setTotalPage:le})}},{children:"Retry"}))]})):i(a,{children:J.map((function(n,a){var l="geo_location"===de.list&&de.page===X&&de.index===a;return r("span",e({style:p.geoLocationFlex},{children:[i("span",e({style:e(e({},p.geoText),{fontWeight:l?"700":"",textDecoration:l?"underline":""}),onClick:function(){return t(void 0,void 0,void 0,(function(){var e,t;return o(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),ce({list:"geo_location",page:X,index:a}),(null===(t=null==n?void 0:n.chunkIds)||void 0===t?void 0:t.length)>0?[4,h(n.name,"Key Geo Locations",n.chunkIds,0)]:[3,2];case 1:o.sent(),o.label=2;case 2:return[3,4];case 3:return e=o.sent(),console.error("Failed to highlight location:",e),[3,4];case 4:return[2]}}))}))},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:null==n?void 0:n.name})),a<J.length-1&&i("span",{style:p.geoDivider})]}),a)}))}),i("div",e({style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!oe&&i(l,{disabled:ee,count:ae,page:X,onChange:function(e,t){return Z(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),r("div",e({style:p.charactersContainer},{children:[i("p",e({style:p.sectionTitle},{children:"Key Characters"})),R?i("div",e({style:{display:"flex",flexWrap:"wrap",gap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map((function(t){return r("div",e({style:e(e({},p.characterCard),{flexBasis:"40%"})},{children:[i(c,{variant:"circle",style:e(e({},p.avatar),{flexShrink:0})}),r("div",e({style:{display:"flex",flexDirection:"column",flex:1}},{children:[i(c,{variant:"text",style:{flex:"1",flexShrink:0}}),i(c,{variant:"text",style:{flex:"1"}}),i(c,{variant:"text",style:{flex:"1"}}),i(c,{variant:"text",style:{flex:"1"}})]}))]}),t)}))})):0===E.length?r("p",e({style:{color:"#6B7280",fontStyle:"italic",paddingLeft:"12px"}},{children:["No key characters found. ",i("button",e({style:p.retryButton,onClick:function(){return ue({endpoint:"notable-characters",page:W,isbn:f,setData:P,setLoading:H,setHasMore:A,setTotalPage:Q})}},{children:"Retry"}))]})):i(a,{children:i("div",e({style:p.charactersGrid},{children:E.map((function(a,l){var s=e(e({},p.avatar),{backgroundColor:a.bg,color:a.color}),d="key_character"===de.list&&de.page===W&&de.index===l;return r("div",e({onMouseEnter:function(e){e.currentTarget.style.transform="translateY(-4px)",e.currentTarget.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"},onMouseLeave:function(e){e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.1)"},style:e(e({},p.characterCard),{borderColor:d?"rgb(83, 43, 237)":"#E5E7EB"}),onClick:function(){return t(void 0,void 0,void 0,(function(){var e,t;return o(this,(function(n){switch(n.label){case 0:ce({list:"key_character",page:W,index:l}),n.label=1;case 1:return n.trys.push([1,4,,5]),(null===(t=null==a?void 0:a.chunkIds)||void 0===t?void 0:t.length)>0?[4,h(a.name,"Key Characters",a.chunkIds,0)]:[3,3];case 2:n.sent(),n.label=3;case 3:return[3,5];case 4:return e=n.sent(),console.error("Failed to highlight character:",e),[3,5];case 5:return[2]}}))}))}},{children:[i("div",e({style:s},{children:a.initials})),r("div",e({style:{display:"flex",flexDirection:"column"}},{children:[i("p",e({style:e(e({},p.charName),{margin:0})},{children:a.name})),i("p",e({style:e(e({},p.charDesc),{margin:0,marginTop:"4px"})},{children:i(u,e({components:{p:function(t){t.node;var o=n(t,["node"]);return i("p",e({style:{marginTop:"0"}},o))}}},{children:null==a?void 0:a.description}))}))]}))]}),l)}))}))}),i("div",e({style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!G&&i(l,{count:Y,disabled:R,page:W,onChange:function(e,t){return I(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})};export{g as default};
|
|
1
|
+
import{__assign as e,__awaiter as t,__rest as n,__generator as o}from"../../../node_modules/tslib/tslib.es6.mjs.js";import{jsxs as r,jsx as i,Fragment as a}from"react/jsx-runtime";import l from"../../../node_modules/@material-ui/lab/esm/Pagination/Pagination.js";import"../../../node_modules/@material-ui/utils/esm/elementAcceptingRef.js";import"../../../node_modules/@material-ui/utils/esm/elementTypeAcceptingRef.js";import"../../../_virtual/index.js";import"../../../node_modules/@material-ui/utils/esm/ponyfillGlobal.js";import"../../../node_modules/@material-ui/utils/esm/refType.js";import{useState as s,useEffect as d}from"react";import"../../../node_modules/@material-ui/core/esm/SvgIcon/SvgIcon.js";import"react-dom";import c from"../../../node_modules/@material-ui/lab/esm/Skeleton/Skeleton.js";import{ReactMarkdown as u}from"../../../node_modules/react-markdown/lib/react-markdown.js";var p={sectionTitle:{fontSize:"14px",fontWeight:600,color:"#667085",marginBottom:"12px"},quotesPadding:{paddingLeft:"12px"},quoteCard:{border:"1px solid #CBD5E1",borderRadius:"8px",padding:"16px",backgroundColor:"#F8FAFC",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",marginBottom:"16px",cursor:"pointer",transition:"transform 0.2s ease, box-shadow 0.2s ease"},quoteText:{fontStyle:"italic",color:"#475569",fontSize:"14px",fontWeight:400,marginBottom:"12px"},quoteMeta:{color:"#475569",fontSize:"12px",fontWeight:400},quoteAuthor:{fontSize:"10px",fontWeight:600,color:"#475569",marginTop:"8px",marginBottom:"18px"},button:{color:"#5928ED",fontSize:"14px",fontWeight:600,background:"none",border:"none",cursor:"pointer",padding:0,textDecoration:"none",paddingLeft:"12px"},geoLocationsContainer:{marginTop:"24px",marginBottom:"24px"},geoText:{fontSize:"14px",fontWeight:500,cursor:"pointer",color:"#532BED"},geoDivider:{margin:"0 8px",color:"#475abb",backgroundColor:"#475abb",width:"1px",height:"18px",display:"inline-block"},geoLocationFlex:{display:"inline-flex",alignItems:"center",gap:"8px",marginBottom:"8px"},charactersContainer:{marginTop:"16px"},charactersGrid:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"16px",marginBottom:"16px",paddingLeft:"12px"},characterCard:{border:"1px solid #E5E7EB",borderRadius:"8px",backgroundColor:"#FFFFFF",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",display:"flex",alignItems:"flex-start",gap:"12px",padding:"16px",cursor:"pointer",transition:"transform 0.2s ease, box-shadow 0.2s ease"},avatar:{width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"9999px",fontSize:"14px",fontWeight:600,flexShrink:0},charName:{fontStyle:"normal",fontWeight:600,color:"#101827",fontSize:"16px"},charDesc:{fontStyle:"normal",fontWeight:400,fontSize:"14px",color:"#6B7280"},retryButton:{backgroundColor:"#5928EC",color:"#fff",padding:"6px 10px",border:"none",borderRadius:"6px",cursor:"pointer",fontSize:"12px",fontWeight:"500"}},g=function(g){g.data;var h=g.updateQuotesToHighLight,x=g.handleFetchManuscriptElements,f=g.BookIsbn,m=g.title,y=s([]),v=y[0],b=y[1],C=s(1),T=C[0],k=C[1],S=s(!1),w=S[0],B=S[1],D=s(!0),L=D[0],j=D[1],q=s(0),M=q[0],F=q[1],E=s([]),P=E[0],_=E[1],W=s(1),I=W[0],z=W[1],R=s(!1),H=R[0],N=R[1],G=s(!0),A=G[0],K=G[1],Y=s(0),Q=Y[0],O=Y[1],J=s([]),U=J[0],V=J[1],X=s(1),Z=X[0],$=X[1],ee=s(!1),te=ee[0],ne=ee[1],oe=s(!0),re=oe[0],ie=oe[1],ae=s(0),le=ae[0],se=ae[1],de=s({list:"",index:-1,page:1}),ce=de[0],ue=de[1],pe=function(e){var n=e.endpoint,r=e.page,i=e.isbn,a=e.setData,l=e.setLoading,s=e.setHasMore,d=e.setTotalPage,c=e.title;return t(void 0,void 0,void 0,(function(){var e,t,u,p;return o(this,(function(o){switch(o.label){case 0:return l(!0),[4,x({endpoint:n,page:r,pageSize:10,isbn:i,title:c})];case 1:return e=o.sent(),s(!(null===(t=null==e?void 0:e.pagination)||void 0===t?void 0:t.hasNext)&&!(null===(u=null==e?void 0:e.pagination)||void 0===u?void 0:u.hasPrevious)),d((null===(p=null==e?void 0:e.pagination)||void 0===p?void 0:p.totalPages)||0),a((null==e?void 0:e.data)||[]),l(!1),[2]}}))}))};return d((function(){pe({endpoint:"notable-quotes",page:T,isbn:f,setData:b,setLoading:B,setHasMore:j,setTotalPage:F,title:m})}),[T]),d((function(){pe({endpoint:"notable-characters",page:I,isbn:f,setData:_,setLoading:N,setHasMore:K,setTotalPage:O,title:m})}),[I]),d((function(){pe({endpoint:"geo-locations",page:Z,isbn:f,setData:V,setLoading:ne,setHasMore:ie,setTotalPage:se,title:m})}),[Z]),r("div",{children:[r("div",e({style:{marginBottom:"24px"}},{children:[i("p",e({style:p.sectionTitle},{children:"Notable Quotes"})),r("div",e({style:p.quotesPadding},{children:[w?i("div",e({style:{display:"flex",flexDirection:"column",rowGap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map((function(t){return r("div",e({style:p.quoteCard},{children:[i(c,{variant:"text",width:"60%",height:28}),i(c,{variant:"text",width:"40%",height:20}),i(c,{variant:"text",width:"25%",height:20}),i(c,{variant:"text",width:"30%",height:20})]}),t)}))})):0===v.length?r("p",e({style:{color:"#6B7280",fontStyle:"italic"}},{children:["No notable quotes found. ",i("button",e({style:p.retryButton,onClick:function(){return pe({endpoint:"notable-quotes",page:T,isbn:f,setData:b,setLoading:B,setHasMore:j,setTotalPage:F,title:m})}},{children:"Retry"}))]})):i(a,{children:v.map((function(n,a){var l="notable"===ce.list&&ce.page===T&&ce.index===a;return r("div",e({style:e(e({},p.quoteCard),{borderColor:l?"rgb(83, 43, 237)":"#CBD5E1"}),onMouseEnter:function(e){e.currentTarget.style.transform="translateY(-4px)",e.currentTarget.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"},onMouseLeave:function(e){e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.1)"},onClick:function(){return t(void 0,void 0,void 0,(function(){var e,t;return o(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),ue({list:"notable",page:T,index:a}),(null===(t=null==n?void 0:n.chunkIds)||void 0===t?void 0:t.length)>0?[4,h(n.text,"Notable Quotes",n.chunkIds,0)]:[3,2];case 1:o.sent(),o.label=2;case 2:return[3,4];case 3:return e=o.sent(),console.error("Failed to highlight quote:",e),[3,4];case 4:return[2]}}))}))}},{children:[i("p",e({style:p.quoteText},{children:null==n?void 0:n.text})),r("p",e({style:p.quoteMeta},{children:[n.chapter," ",i("br",{})," ",n.page]})),r("p",e({style:p.quoteAuthor},{children:["— ",null==n?void 0:n.author]}))]}),a)}))}),i("div",e({style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!L&&i(l,{disabled:w,count:M,page:T,onChange:function(e,t){return k(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),r("div",e({style:p.geoLocationsContainer},{children:[i("p",e({style:p.sectionTitle},{children:"Key Geo Locations"})),r("div",e({style:e(e({},p.quotesPadding),{marginBottom:"8px"})},{children:[te?i("div",e({style:{display:"flex",flexWrap:"wrap",gap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map((function(e){return i(c,{variant:"rect",width:100,height:20,style:{borderRadius:"8px"}},e)}))})):0===U.length?r("p",e({style:{color:"#6B7280",fontStyle:"italic",paddingLeft:"12px"}},{children:["No key geo locations found. ",i("button",e({style:p.retryButton,onClick:function(){return pe({endpoint:"geo-locations",page:Z,isbn:f,setData:V,setLoading:ne,setHasMore:ie,setTotalPage:se,title:m})}},{children:"Retry"}))]})):i(a,{children:U.map((function(n,a){var l="geo_location"===ce.list&&ce.page===Z&&ce.index===a;return r("span",e({style:p.geoLocationFlex},{children:[i("span",e({style:e(e({},p.geoText),{fontWeight:l?"700":"",textDecoration:l?"underline":""}),onClick:function(){return t(void 0,void 0,void 0,(function(){var e,t;return o(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),ue({list:"geo_location",page:Z,index:a}),(null===(t=null==n?void 0:n.chunkIds)||void 0===t?void 0:t.length)>0?[4,h(n.name,"Key Geo Locations",n.chunkIds,0)]:[3,2];case 1:o.sent(),o.label=2;case 2:return[3,4];case 3:return e=o.sent(),console.error("Failed to highlight location:",e),[3,4];case 4:return[2]}}))}))},onMouseOver:function(e){return e.currentTarget.style.textDecoration="underline"},onMouseOut:function(e){return e.currentTarget.style.textDecoration="none"}},{children:null==n?void 0:n.name})),a<U.length-1&&i("span",{style:p.geoDivider})]}),a)}))}),i("div",e({style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!re&&i(l,{disabled:te,count:le,page:Z,onChange:function(e,t){return $(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),r("div",e({style:p.charactersContainer},{children:[i("p",e({style:p.sectionTitle},{children:"Key Characters"})),H?i("div",e({style:{display:"flex",flexWrap:"wrap",gap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map((function(t){return r("div",e({style:e(e({},p.characterCard),{flexBasis:"40%"})},{children:[i(c,{variant:"circle",style:e(e({},p.avatar),{flexShrink:0})}),r("div",e({style:{display:"flex",flexDirection:"column",flex:1}},{children:[i(c,{variant:"text",style:{flex:"1",flexShrink:0}}),i(c,{variant:"text",style:{flex:"1"}}),i(c,{variant:"text",style:{flex:"1"}}),i(c,{variant:"text",style:{flex:"1"}})]}))]}),t)}))})):0===P.length?r("p",e({style:{color:"#6B7280",fontStyle:"italic",paddingLeft:"12px"}},{children:["No key characters found. ",i("button",e({style:p.retryButton,onClick:function(){return pe({endpoint:"notable-characters",page:I,isbn:f,setData:_,setLoading:N,setHasMore:K,setTotalPage:O,title:m})}},{children:"Retry"}))]})):i(a,{children:i("div",e({style:p.charactersGrid},{children:P.map((function(a,l){var s=e(e({},p.avatar),{backgroundColor:a.bg,color:a.color}),d="key_character"===ce.list&&ce.page===I&&ce.index===l;return r("div",e({onMouseEnter:function(e){e.currentTarget.style.transform="translateY(-4px)",e.currentTarget.style.boxShadow="0 4px 12px rgba(0, 0, 0, 0.15)"},onMouseLeave:function(e){e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.1)"},style:e(e({},p.characterCard),{borderColor:d?"rgb(83, 43, 237)":"#E5E7EB"}),onClick:function(){return t(void 0,void 0,void 0,(function(){var e,t;return o(this,(function(n){switch(n.label){case 0:ue({list:"key_character",page:I,index:l}),n.label=1;case 1:return n.trys.push([1,4,,5]),(null===(t=null==a?void 0:a.chunkIds)||void 0===t?void 0:t.length)>0?[4,h(a.name,"Key Characters",a.chunkIds,0)]:[3,3];case 2:n.sent(),n.label=3;case 3:return[3,5];case 4:return e=n.sent(),console.error("Failed to highlight character:",e),[3,5];case 5:return[2]}}))}))}},{children:[i("div",e({style:s},{children:a.initials})),r("div",e({style:{display:"flex",flexDirection:"column"}},{children:[i("p",e({style:e(e({},p.charName),{margin:0})},{children:a.name})),i("p",e({style:e(e({},p.charDesc),{margin:0,marginTop:"4px"})},{children:i(u,e({components:{p:function(t){t.node;var o=n(t,["node"]);return i("p",e({style:{marginTop:"0"}},o))}}},{children:null==a?void 0:a.description}))}))]}))]}),l)}))}))}),i("div",e({style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!A&&i(l,{count:Q,disabled:H,page:I,onChange:function(e,t){return z(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})};export{g as default};
|
|
2
2
|
//# sourceMappingURL=BookElementsCard.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e,__awaiter as o,__generator as t}from"../../node_modules/tslib/tslib.es6.mjs.js";import{jsx as i,jsxs as r,Fragment as n}from"react/jsx-runtime";import{useState as l,useRef as a}from"react";import d from"../../node_modules/@material-ui/core/esm/Accordion/Accordion.js";import s from"../../node_modules/@material-ui/core/esm/AccordionSummary/AccordionSummary.js";import c from"../../_virtual/ExpandMore.js";import h from"../../_virtual/Close.js";import{PanelGroup as p,Panel as u,PanelResizeHandle as m}from"../../node_modules/react-resizable-panels/dist/react-resizable-panels.browser.js";import g from"./BookDetailsCard/BookDetailsCard.js";import y from"./BookOverviewCard/BookOverviewCard.js";import v from"./BookElementsCard/BookElementsCard.js";import f from"./BookCopyrightsCard/BookCopyrightsCard.js";import x from"./BookPeopleAwardsCard/BookPeopleAwardsCard.js";import b from"./BookPreview/BookPreview.js";import k from"../../node_modules/@material-ui/core/esm/Dialog/Dialog.js";import C from"../../node_modules/@material-ui/core/esm/DialogContent/DialogContent.js";import B from"../../node_modules/@material-ui/core/esm/Typography/Typography.js";import w from"../../node_modules/@material-ui/core/esm/AccordionDetails/AccordionDetails.js";import j from"../../node_modules/@material-ui/core/esm/IconButton/IconButton.js";var F={dialogPaper:{maxWidth:"none",fontFamily:"Inter, sans-serif"},dialogContent:{padding:0,backgroundColor:"#FFFFFF",overflow:"hidden",height:"90vh",position:"relative"},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=i("svg",e({style:S.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},{children:i("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})})),z=function(o){var t=o.header,n=o.subheader,l=o.icon;return i("div",e({style:S.wrapper},{children:r("div",e({style:S.inner},{children:[i("div",e({style:{marginBottom:"32px"}},{children:i("div",e({style:S.iconWrapper},{children:l||D}))})),r("div",{children:[i("h1",e({style:S.heading},{children:t})),i("p",e({style:S.text},{children:n}))]})]}))}))},P=function(S){var P=S.open,A=S.onClose,I=S.isNonHighlightedBlur,H=S.isBookemon,E=S.getHighlightContent,L=S.handleFetchManuscriptElements,_=S.data,O=S.showComingSoon,T=void 0!==O&&O,W=S.comingSoonData,M=void 0===W?{header:"Bookemon Coming Soon!!",subheader:"We're working on something amazing. Stay tuned for updates!",icon:D}:W,R=S.customStyle,N=void 0===R?{}:R,V=S.isBlurToggleVisible,Q=void 0!==V&&V,Y=l({textToHighLight:"",content:""}),q=Y[0],G=Y[1],J=l(1),K=J[0],U=J[1],X=l(!1),Z=X[0],$=X[1],ee=l("Book Preview"),oe=ee[0],te=ee[1],ie=l(70),re=ie[0],ne=ie[1],le=a(null),ae=l(!1),de=ae[0],se=ae[1],ce=function(e,i,r,n){return void 0===n&&(n=0),o(void 0,void 0,void 0,(function(){var o,l,a,d,s,c,h,p,u,m,g,y,v,f,x,b;return t(this,(function(t){switch(t.label){case 0:G({textToHighLight:"",content:""}),se(!1),$(!0),te(i),t.label=1;case 1:return t.trys.push([1,5,6,7]),r&&0!==r.length?[4,E([r[n]])]:($(!1),ne(70),null===(x=le.current)||void 0===x||x.resize(70),[2]);case 2:if(o=t.sent(),l=(null==o?void 0:o.data)||o||[],!Array.isArray(l)||0===l.length)return se(!0),$(!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),s=null,c=0,h=l;c<h.length;c++)if(y=h[c],a(y.normalizedContent||y.htmlContent).includes(d)){s=y;break}if(!s)for(p=d.split(" ").filter(Boolean);p.length>0;){for(u=p.join(" "),m=0,g=l;m<g.length;m++)if(y=g[m],a(y.normalizedContent||y.htmlContent).includes(u)){s=y;break}if(s)break;p.pop()}return v=l.map((function(e){return e.htmlContent})).join("\n"),G({textToHighLight:s?s.htmlContent:"",content:v}),ne(50),null===(b=le.current)||void 0===b||b.resize(50),!s&&n+1<r.length?[4,
|
|
1
|
+
import{__assign as e,__awaiter as o,__generator as t}from"../../node_modules/tslib/tslib.es6.mjs.js";import{jsx as i,jsxs as r,Fragment as n}from"react/jsx-runtime";import{useState as l,useRef as a}from"react";import d from"../../node_modules/@material-ui/core/esm/Accordion/Accordion.js";import s from"../../node_modules/@material-ui/core/esm/AccordionSummary/AccordionSummary.js";import c from"../../_virtual/ExpandMore.js";import h from"../../_virtual/Close.js";import{PanelGroup as p,Panel as u,PanelResizeHandle as m}from"../../node_modules/react-resizable-panels/dist/react-resizable-panels.browser.js";import g from"./BookDetailsCard/BookDetailsCard.js";import y from"./BookOverviewCard/BookOverviewCard.js";import v from"./BookElementsCard/BookElementsCard.js";import f from"./BookCopyrightsCard/BookCopyrightsCard.js";import x from"./BookPeopleAwardsCard/BookPeopleAwardsCard.js";import b from"./BookPreview/BookPreview.js";import k from"../../node_modules/@material-ui/core/esm/Dialog/Dialog.js";import C from"../../node_modules/@material-ui/core/esm/DialogContent/DialogContent.js";import B from"../../node_modules/@material-ui/core/esm/Typography/Typography.js";import w from"../../node_modules/@material-ui/core/esm/AccordionDetails/AccordionDetails.js";import j from"../../node_modules/@material-ui/core/esm/IconButton/IconButton.js";var F={dialogPaper:{maxWidth:"none",fontFamily:"Inter, sans-serif"},dialogContent:{padding:0,backgroundColor:"#FFFFFF",overflow:"hidden",height:"90vh",position:"relative"},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=i("svg",e({style:S.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},{children:i("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})})),z=function(o){var t=o.header,n=o.subheader,l=o.icon;return i("div",e({style:S.wrapper},{children:r("div",e({style:S.inner},{children:[i("div",e({style:{marginBottom:"32px"}},{children:i("div",e({style:S.iconWrapper},{children:l||D}))})),r("div",{children:[i("h1",e({style:S.heading},{children:t})),i("p",e({style:S.text},{children:n}))]})]}))}))},P=function(S){var P=S.open,A=S.onClose,I=S.isNonHighlightedBlur,H=S.isBookemon,E=S.getHighlightContent,L=S.handleFetchManuscriptElements,_=S.data,O=S.showComingSoon,T=void 0!==O&&O,W=S.comingSoonData,M=void 0===W?{header:"Bookemon Coming Soon!!",subheader:"We're working on something amazing. Stay tuned for updates!",icon:D}:W,R=S.customStyle,N=void 0===R?{}:R,V=S.isBlurToggleVisible,Q=void 0!==V&&V,Y=l({textToHighLight:"",content:""}),q=Y[0],G=Y[1],J=l(1),K=J[0],U=J[1],X=l(!1),Z=X[0],$=X[1],ee=l("Book Preview"),oe=ee[0],te=ee[1],ie=l(70),re=ie[0],ne=ie[1],le=a(null),ae=l(!1),de=ae[0],se=ae[1],ce=_.bookAwards,he=_.bookCopyRight,pe=_.bookDetails,ue=_.bookElements,me=_.bookOverView,ge=_.bookCoverImage,ye=function(e,i,r,n){return void 0===n&&(n=0),o(void 0,void 0,void 0,(function(){var o,l,a,d,s,c,h,p,u,m,g,y,v,f,x,b;return t(this,(function(t){switch(t.label){case 0:G({textToHighLight:"",content:""}),se(!1),$(!0),te(i),t.label=1;case 1:return t.trys.push([1,5,6,7]),r&&0!==r.length?[4,E([r[n]])]:($(!1),ne(70),null===(x=le.current)||void 0===x||x.resize(70),[2]);case 2:if(o=t.sent(),l=(null==o?void 0:o.data)||o||[],!Array.isArray(l)||0===l.length)return se(!0),$(!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),s=null,c=0,h=l;c<h.length;c++)if(y=h[c],a(y.normalizedContent||y.htmlContent).includes(d)){s=y;break}if(!s)for(p=d.split(" ").filter(Boolean);p.length>0;){for(u=p.join(" "),m=0,g=l;m<g.length;m++)if(y=g[m],a(y.normalizedContent||y.htmlContent).includes(u)){s=y;break}if(s)break;p.pop()}return v=l.map((function(e){return e.htmlContent})).join("\n"),G({textToHighLight:s?s.htmlContent:"",content:v}),ne(50),null===(b=le.current)||void 0===b||b.resize(50),!s&&n+1<r.length?[4,ye(e,i,r,n+1)]:[3,4];case 3:return[2,t.sent()];case 4:return[2];case 5:return f=t.sent(),console.error("Highlight error:",f),se(!0),[3,7];case 6:return $(!1),[7];case 7:return[2]}}))}))},ve=null==pe?void 0:pe.isbn;return i(k,e({open:P,fullWidth:!0,PaperProps:{style:e(e({},null==F?void 0:F.dialogPaper),null==N?void 0:N.dialogDimension)}},{children:r(C,e({style:F.dialogContent},{children:[!T&&i("div",e({style:F.container},{children:r(p,e({direction:"horizontal"},{children:[i(u,e({order:1,ref:le,defaultSize:re||70},{children:r("div",e({style:e(e({},null==F?void 0:F.leftPanel),null==N?void 0:N.leftPanel)},{children:[i("div",e({style:{marginBottom:"24px"}},{children:r(d,e({defaultExpanded:!0,elevation:0,style:F.accordion},{children:[i(s,e({expandIcon:i(c,{}),style:F.accordionSummary},{children:i(B,e({style:F.heading},{children:"Book Overview"}))})),i(w,e({style:F.accordionDetails},{children:me&&Object.keys(me).length>0?i(y,{data:me}):i("div",e({style:F.errorState},{children:"No overview data available."}))}))]}))})),i("div",e({style:{marginBottom:"24px"}},{children:r(d,e({elevation:0,style:F.accordion},{children:[i(s,e({expandIcon:i(c,{}),style:F.accordionSummary},{children:i(B,e({style:F.heading},{children:"Book Manuscript Elements"}))})),i(w,e({style:F.accordionDetails},{children:i(v,{data:ue,title:(null==me?void 0:me.title)||"",handleFetchManuscriptElements:L,BookIsbn:ve,updateQuotesToHighLight:ye})}))]}))})),i("div",e({style:{marginBottom:"24px"}},{children:r(d,e({elevation:0,style:F.accordion},{children:[i(s,e({expandIcon:i(c,{}),style:F.accordionSummary},{children:i(B,e({style:F.heading},{children:"Book Metadata Details"}))})),i(w,e({style:F.accordionDetails},{children:pe&&Object.keys(pe).length>0?i(g,{data:pe}):i("div",e({style:F.errorState},{children:"No Book Metadata data available."}))}))]}))})),i("div",e({style:{marginBottom:"24px"}},{children:r(d,e({elevation:0,style:F.accordion},{children:[i(s,e({expandIcon:i(c,{}),style:F.accordionSummary},{children:i(B,e({style:F.heading},{children:"Copyrights & Marketing"}))})),i(w,e({style:F.accordionDetails},{children:he&&Object.keys(he).length>0?i(f,{data:he}):i("div",e({style:F.errorState},{children:"No Copyrights & Marketing data available."}))}))]}))})),i("div",{children:r(d,e({elevation:0,style:F.accordion},{children:[i(s,e({expandIcon:i(c,{}),style:F.accordionSummary},{children:i(B,e({style:F.heading},{children:"People & Awards"}))})),i(w,e({style:F.accordionDetails},{children:ce&&Object.keys(ce).length>0?i(x,{data:ce}):i("div",e({style:F.errorState},{children:"No People & Awards data available."}))}))]}))})]}))})),i(m,{style:{width:"3px",background:"#D1D5DC",cursor:"col-resize"}}),i(u,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:i(b,{bookOverView:me,bookCoverImage:ge,onClose:A,clickableElementCategory:oe,quotesToHighLightData:q,updateQuotesToHighLight:ye,citationLoad:Z,previewPage:K,setPreviewPage:U,customStyle:N,comingSoonData:M,isNonHighlightedBlur:I,isBlurToggleVisible:Q,isBookemon:H,noHtmlContent:de})}))]}))})),T?r("div",e({style:F.blurOverlay},{children:[i(j,e({style:F.closeButton,onClick:A},{children:i(h,{})})),i(z,{header:M.header,subheader:M.subheader,icon:M.icon})]})):i(n,{})]}))}))};export{S as comingSoonStyles,P as default,D as defaultIcon};
|
|
2
2
|
//# sourceMappingURL=Bookemon.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e,__rest as n,__spreadArray as t}from"../../node_modules/tslib/tslib.es6.mjs.js";import{jsxs as r,jsx as i}from"react/jsx-runtime";import o,{useEffect as a}from"react";import{ReactMarkdown as l}from"../../node_modules/react-markdown/lib/react-markdown.js";import d from"../../node_modules/rehype-raw/lib/index.js";import p from"../../node_modules/remark-gfm/lib/index.js";import{visit as s}from"../../node_modules/unist-util-visit/lib/index.js";function
|
|
1
|
+
import{__assign as e,__rest as n,__spreadArray as t}from"../../node_modules/tslib/tslib.es6.mjs.js";import{jsxs as r,jsx as i}from"react/jsx-runtime";import o,{useEffect as a}from"react";import{ReactMarkdown as l}from"../../node_modules/react-markdown/lib/react-markdown.js";import d from"../../node_modules/rehype-raw/lib/index.js";import p from"../../node_modules/remark-gfm/lib/index.js";import{visit as s}from"../../node_modules/unist-util-visit/lib/index.js";function m(){return function(e){s(e,"text",(function(e,n,r){var i;if(r&&"string"==typeof e.value&&e.value.includes("✓")){for(var o=e.value.split("✓"),a=[],l=0;l<o.length;l++){var d=o[l];d&&a.push({type:"text",value:d}),l<o.length-1&&a.push({type:"element",tagName:"span",properties:{className:["text-green-600","font-medium","inline-block","mr-1","align-middle"]},children:[{type:"text",value:"✓"}]})}return(i=r.children).splice.apply(i,t([n,1],a,!1)),n+a.length}}))}}var u=function(n,t){if(!t||!t.trim())return n;var r=new RegExp("(".concat(t.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&"),")"),"gi");return n.split(r).map((function(n,t){return r.test(n)?i("mark",e({className:"custom-highlight"},{children:n}),t):n}))};function c(){return function(e){s(e,"element",(function(e,n,t){if(t&&"p"===e.tagName)return e.children&&1===e.children.length&&"element"===e.children[0].type&&"details"===e.children[0].tagName?(t.children.splice(n,1,e.children[0]),n):void 0}))}}var f=function(e){var n;return"text"===(null==e?void 0:e.type)&&/^\s*$/.test(null!==(n=e.value)&&void 0!==n?n:"")};function g(){return function(e){s(e,"element",(function(e){var n,t;if("details"===e.tagName&&"data-target"in(e.properties||{})){var r=e.children||[],i=0;"element"===(null===(n=r[0])||void 0===n?void 0:n.type)&&"summary"===(null===(t=r[0])||void 0===t?void 0:t.tagName)&&(i=1);var o=r.slice(i),a=o.filter((function(e){return!f(e)}));if((1!==a.length||"element"!==a[0].type||!a[0].properties||!("data-popup"in a[0].properties)&&void 0===a[0].properties["data-popup"])&&!a.some((function(e){return"element"===(null==e?void 0:e.type)&&(null==e?void 0:e.properties)&&("data-popup"in e.properties||void 0!==e.properties["data-popup"])}))){var l={type:"element",tagName:"div",properties:{"data-popup":""},children:o};e.children=r.slice(0,i).concat([l])}}}))}}function h(){return function(e){s(e,"element",(function(e){var n,t;if("details"===e.tagName){var r=e.properties||{};if(!("data-inline"in r)&&!("data-target"in r)){var i=e.children||[],o=0;"element"===(null===(n=i[0])||void 0===n?void 0:n.type)&&"summary"===(null===(t=i[0])||void 0===t?void 0:t.tagName)&&(o=1);var a=i.slice(o),l=a.filter((function(e){return!f(e)}));if((1!==l.length||"element"!==l[0].type||!l[0].properties||!("data-popup"in l[0].properties)&&void 0===l[0].properties["data-popup"])&&!l.some((function(e){return"element"===(null==e?void 0:e.type)&&(null==e?void 0:e.properties)&&("data-popup"in e.properties||void 0!==e.properties["data-popup"])}))){var d={type:"element",tagName:"div",properties:{"data-popup":""},children:a};e.children=i.slice(0,o).concat([d])}}}}))}}var v=function(t){var s=t.value,f=t.highlightedText,v=o.useRef(null),y=o.useRef(null);a((function(){if(f){var e=setTimeout((function(){if(y.current){var e=y.current.querySelector("mark.custom-highlight");e&&e.scrollIntoView({behavior:"smooth",block:"center"})}}),100);return function(){return clearTimeout(e)}}}),[f,s]);return r("div",e({ref:y,className:"flex h-[42vh] gap-4"},{children:[i("div",e({className:"h-[42vh] flex-1 rounded-xl border border-gray-200 bg-white p-5 shadow-sm"},{children:i("div",e({ref:y,className:"h-full overflow-y-auto pr-2"},{children:i(l,e({remarkPlugins:[p],rehypePlugins:[d,c,m,g,h],components:{details:function(t){t.node;var o=n(t,["node"]),a=!!o["data-inline"],l=!!o["data-target"];return a?i("details",e({},o,{className:"md-details md-details--inline relative my-1 inline-block rounded-[8px] align-middle",onToggle:function(e){e.stopPropagation(),function(e){var n=e.currentTarget,t=n.getAttribute("data-inline");if(t&&v.current){var r=v.current.querySelector('details[data-target="'.concat(t,'"]'));r&&(r.open=n.open)}}(e)}},{children:o.children})):l?r("details",e({},o,{className:"md-details md-details--target my-2 block",onToggle:function(e){return e.stopPropagation()}},{children:[i("summary",{className:"md-target-dummy-summary","aria-hidden":"true"}),o.children]})):i("details",e({},o,{className:"md-details md-details--block relative my-1 w-full rounded-[8px] align-middle",onToggle:function(e){return e.stopPropagation()}},{children:o.children}))},summary:function(t){t.node;var r=n(t,["node"]);return i("div",e({className:"mt-0"},{children:i("summary",e({className:"md-summary inline-flex cursor-pointer select-none items-center gap-1 py-1 font-medium hover:opacity-90",style:{color:"#19213D",fontWeight:500},onClick:function(e){return e.stopPropagation()}},r,{children:i("span",e({className:"whitespace-nowrap align-middle"},{children:r.children}))}))}))},ul:function(t){t.node;var r=n(t,["node"]);return i("ol",e({className:"md-ol my-1 list-decimal pl-5"},r))},ol:function(t){t.node;var r=n(t,["node"]);return i("ol",e({className:"md-ol my-1 list-decimal pl-5"},r))},div:function(t){var r,o=t.node,a=n(t,["node"]),l=(null==o?void 0:o.properties)&&("data-popup"in o.properties||void 0!==(null===(r=o.properties)||void 0===r?void 0:r["data-popup"]));return i("div",l?e({},a,{className:(a.className?a.className+" ":"")+"md-popup",role:"region"}):e({},a))},p:function(e){var n=e.children,t=Array.isArray(n)?n:[n];return i("p",{children:t.map((function(e,n){return"string"==typeof e?u(e,f):i(o.Fragment,{children:e},n)}))})},li:function(n){var t=n.children;return i("li",e({style:{marginBottom:"4px"}},{children:t.map((function(e){return"string"==typeof e?u(e,f):e}))}))},code:function(t){var r=t.children,o=n(t,["children"]);return i("code",e({},o,{children:r.map((function(e){return"string"==typeof e?u(e,f):e}))}))}}},{children:s}))}))})),i("style",{children:"\n .custom-highlight {\n background-color: #fef08a; \n color: #374151; \n padding: 2px 4px;\n border-radius: 4px;\n }\n .md-root strong { color: #19213D !important; }\n .md-check-green { color: #16A34A !important; font-weight: 500; }\n details > summary::-webkit-details-marker { display: none; }\n .md-summary span { white-space: nowrap; }\n\n .md-target-dummy-summary { display: none !important; }\n\n /* Chevron animation */\n .md-details[open] > summary .md-chevron { transform: rotate(180deg); transition: transform .25s cubic-bezier(.2,.8,.2,1); }\n .md-details > summary .md-chevron { transition: transform .25s cubic-bezier(.2,.8,.2,1); }\n\n /* Normal details open look */\n .md-details--block[open] {\n \n padding: 8px 10px;\n border-radius: 8px;\n }\n\n /* Inline trigger never reveals inner content */\n .md-details--inline > :not(summary) { display: none !important; }\n\n /* Target popups (animated) */\n .md-details--target .md-popup,\n .md-details--target [data-popup] {\n display: block;\n margin-top: 6px;\n border: 1px solid #6D28D9;\n color: #6D28D9;\n border-radius: 10px;\n padding: 12px;\n box-shadow: 0 8px 24px rgba(0,0,0,.06);\n opacity: 0;\n transform: translateY(-4px);\n transition: opacity .2s ease, transform .2s ease;\n font-size: 12px;\n line-height: 1.35;\n background: #6D28D91A;\n }\n .md-details--target[open] .md-popup,\n .md-details--target[open] [data-popup] {\n opacity: 1;\n transform: translateY(0);\n }\n\n /* Popup body for normal details (✓ items) */\n .md-details--block[open] .md-popup,\n .md-details--block[open] [data-popup] {\n display: block;\n border: 1px solid #6D28D9;\n color: #6D28D9;\n border-radius: 10px;\n padding: 12px; \n font-size: 12px;\n line-height: 1.35;\n font-weight: 500;\n background: #6D28D91A;\n }\n\n /* ---- NESTED POPUP GUARD: if a popup is inside a popup, neutralize the inner one ---- */\n .md-popup .md-popup,\n .md-popup [data-popup] {\n border: none !important;\n background: transparent !important;\n padding: 0 !important;\n box-shadow: none !important;\n color: inherit !important;\n }\n "})]}))};export{v as default};
|
|
2
2
|
//# sourceMappingURL=MarkdownRenderer.js.map
|
|
@@ -25,14 +25,16 @@ export interface IBookElementsData {
|
|
|
25
25
|
interface BookElementsCardProps {
|
|
26
26
|
data: IBookElementsData;
|
|
27
27
|
updateQuotesToHighLight: (textToHighLight: string, content: string, chunkIds: string[], currentIndex: number) => void;
|
|
28
|
-
handleFetchManuscriptElements: ({ endpoint, page, pageSize, isbn, }: {
|
|
28
|
+
handleFetchManuscriptElements: ({ endpoint, page, pageSize, isbn, title }: {
|
|
29
29
|
endpoint: any;
|
|
30
30
|
page: any;
|
|
31
31
|
pageSize: number;
|
|
32
32
|
isbn: any;
|
|
33
|
+
title: string;
|
|
33
34
|
}) => Promise<any>;
|
|
34
35
|
BookIsbn: string;
|
|
36
|
+
title: string;
|
|
35
37
|
}
|
|
36
|
-
declare const BookElementsCard: ({ data, updateQuotesToHighLight, handleFetchManuscriptElements, BookIsbn }: BookElementsCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
declare const BookElementsCard: ({ data, updateQuotesToHighLight, handleFetchManuscriptElements, BookIsbn, title }: BookElementsCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
37
39
|
export default BookElementsCard;
|
|
38
40
|
//# sourceMappingURL=BookElementsCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BookElementsCard.d.ts","sourceRoot":"","sources":["../../../../../../src/features/Bookemon/BookElementsCard/BookElementsCard.tsx"],"names":[],"mappings":"AA8IA,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAG,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAG,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAG,MAAM,EAAE,CAAC;IACpB,IAAI,EAAG,MAAM,CAAA;CACd;AAED,MAAM,WAAW,iBAAiB;IAChC,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,EAAE,eAAe,EAAE,CAAC;IAChC,UAAU,EAAE,UAAU,EAAE,CAAC;CAC1B;AAED,UAAU,qBAAqB;IAC7B,IAAI,EAAE,iBAAiB,CAAC;IACxB,uBAAuB,EAAE,CAAC,eAAe,EAAE,MAAM,EAAC,OAAO,EAAC,MAAM,EAAE,QAAQ,EAAC,MAAM,EAAE,EAAE,YAAY,EAAG,MAAM,KAAK,IAAI,CAAC;IACnH,6BAA6B,EAAE,CAAC,EAC/B,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,IAAI,
|
|
1
|
+
{"version":3,"file":"BookElementsCard.d.ts","sourceRoot":"","sources":["../../../../../../src/features/Bookemon/BookElementsCard/BookElementsCard.tsx"],"names":[],"mappings":"AA8IA,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAG,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAG,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAG,MAAM,EAAE,CAAC;IACpB,IAAI,EAAG,MAAM,CAAA;CACd;AAED,MAAM,WAAW,iBAAiB;IAChC,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,EAAE,eAAe,EAAE,CAAC;IAChC,UAAU,EAAE,UAAU,EAAE,CAAC;CAC1B;AAED,UAAU,qBAAqB;IAC7B,IAAI,EAAE,iBAAiB,CAAC;IACxB,uBAAuB,EAAE,CAAC,eAAe,EAAE,MAAM,EAAC,OAAO,EAAC,MAAM,EAAE,QAAQ,EAAC,MAAM,EAAE,EAAE,YAAY,EAAG,MAAM,KAAK,IAAI,CAAC;IACnH,6BAA6B,EAAE,CAAC,EAC/B,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,KAAK,EACN,EAAE;QACD,QAAQ,EAAE,GAAG,CAAC;QACd,IAAI,EAAE,GAAG,CAAC;QACV,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,GAAG,CAAC;QACV,KAAK,EAAG,MAAM,CAAA;KACf,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IACnB,QAAQ,EAAG,MAAM,CAAC;IAClB,KAAK,EAAG,MAAM,CAAA;CACf;AAED,QAAA,MAAM,gBAAgB,sFAMnB,qBAAqB,4CA8YvB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -25,11 +25,12 @@ declare const Bookemon: ({ open, onClose, isNonHighlightedBlur, isBookemon, getH
|
|
|
25
25
|
isBookemon: boolean;
|
|
26
26
|
isBlurToggleVisible?: boolean | undefined;
|
|
27
27
|
getHighlightContent: (chunkIds: string[]) => Promise<any>;
|
|
28
|
-
handleFetchManuscriptElements: ({ endpoint, page, pageSize, isbn, }: {
|
|
28
|
+
handleFetchManuscriptElements: ({ endpoint, page, pageSize, isbn, title }: {
|
|
29
29
|
endpoint: any;
|
|
30
30
|
page: any;
|
|
31
31
|
pageSize: number;
|
|
32
32
|
isbn: any;
|
|
33
|
+
title: string;
|
|
33
34
|
}) => Promise<any>;
|
|
34
35
|
data: any;
|
|
35
36
|
showComingSoon?: boolean | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Bookemon.d.ts","sourceRoot":"","sources":["../../../../../src/features/Bookemon/Bookemon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAY,aAAa,EAAU,MAAM,OAAO,CAAC;AAuI/D,eAAO,MAAM,gBAAgB,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAA;CA4C5D,CAAC;AACF,eAAO,MAAM,WAAW,yCAcvB,CAAC;AAyBF,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,cAAc,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACxB;AAKD,QAAA,MAAM,QAAQ;UAiBN,OAAO;aACJ,MAAM,IAAI;0BACI,OAAO;gBACjB,OAAO;;oCAEY,MAAM,EAAE,KAAK,QAAQ,GAAG,CAAC;;
|
|
1
|
+
{"version":3,"file":"Bookemon.d.ts","sourceRoot":"","sources":["../../../../../src/features/Bookemon/Bookemon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAY,aAAa,EAAU,MAAM,OAAO,CAAC;AAuI/D,eAAO,MAAM,gBAAgB,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAA;CA4C5D,CAAC;AACF,eAAO,MAAM,WAAW,yCAcvB,CAAC;AAyBF,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,cAAc,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACxB;AAKD,QAAA,MAAM,QAAQ;UAiBN,OAAO;aACJ,MAAM,IAAI;0BACI,OAAO;gBACjB,OAAO;;oCAEY,MAAM,EAAE,KAAK,QAAQ,GAAG,CAAC;;kBAQ7C,GAAG;cACP,GAAG;kBACC,MAAM;cACV,GAAG;eACD,MAAM;UACV,QAAQ,GAAG,CAAC;UACZ,GAAG;;;;;eAKA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;6CAwXzB,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownRenderer.d.ts","sourceRoot":"","sources":["../../../../../src/features/CitationRenderer/MarkdownRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAOzC,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,GAAG,EAAE,CAAC;CACvB,CAAC;
|
|
1
|
+
{"version":3,"file":"MarkdownRenderer.d.ts","sourceRoot":"","sources":["../../../../../src/features/CitationRenderer/MarkdownRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAOzC,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,GAAG,EAAE,CAAC;CACvB,CAAC;AAoLF,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAyPrC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|