@e-llm-studio/citation 0.0.77 → 0.0.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../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={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(r){r.data;var o=r.updateQuotesToHighLight,l=r.handleFetchManuscriptElements,d=r.BookIsbn,u=s.useState([]),c=u[0],g=u[1],x=s.useState(1),p=x[0],h=x[1],f=s.useState(!1),_=f[0],y=f[1],v=s.useState(!0),m=v[0],b=v[1],j=s.useState(0),S=j[0],C=j[1],T=s.useState([]),k=T[0],w=T[1],q=s.useState(1),B=q[0],D=q[1],L=s.useState(!1),F=L[0],E=L[1],M=s.useState(!0),P=M[0],W=M[1],I=s.useState(0),z=I[0],R=I[1],H=s.useState([]),N=H[0],G=H[1],A=s.useState(1),K=A[0],Y=A[1],O=s.useState(!1),Q=O[0],J=O[1],U=s.useState(!0),V=U[0],X=U[1],Z=s.useState(0),$=Z[0],ee=Z[1],te=s.useState({list:"",index:-1}),ne=te[0],se=te[1],ae=function(t){var n=t.endpoint,s=t.page,a=t.isbn,i=t.setData,r=t.setLoading,o=t.setHasMore,d=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,l({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)),d((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(){ae({endpoint:"notable-quotes",page:p,isbn:d,setData:g,setLoading:y,setHasMore:b,setTotalPage:C})}),[p]),s.useEffect((function(){ae({endpoint:"notable-characters",page:B,isbn:d,setData:w,setLoading:E,setHasMore:W,setTotalPage:R})}),[B]),s.useEffect((function(){ae({endpoint:"geo-locations",page:K,isbn:d,setData:G,setLoading:J,setHasMore:X,setTotalPage:ee})}),[K]),t.jsxs("div",{children:[t.jsxs("div",e.__assign({style:{marginBottom:"24px"}},{children:[t.jsx("p",e.__assign({style:i.sectionTitle},{children:"Notable Quotes"})),t.jsxs("div",e.__assign({style:i.quotesPadding},{children:[_?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:i.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===c.length?t.jsxs("p",e.__assign({style:{color:"#6B7280",fontStyle:"italic"}},{children:["No notable quotes found. ",t.jsx("button",e.__assign({style:i.retryButton,onClick:function(){return ae({endpoint:"notable-quotes",page:p,isbn:d,setData:g,setLoading:y,setHasMore:b,setTotalPage:C})}},{children:"Retry"}))]})):t.jsx(t.Fragment,{children:c.map((function(n,s){var a="notable"===ne.list&&ne.index===s;return t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},i.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]),se({list:"notable",index:s}),(null===(a=null==n?void 0:n.chunkIds)||void 0===a?void 0:a.length)>0?[4,o(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:i.quoteText},{children:null==n?void 0:n.text})),t.jsxs("p",e.__assign({style:i.quoteMeta},{children:[n.chapter," ",t.jsx("br",{})," ",n.page]})),t.jsxs("p",e.__assign({style:i.quoteAuthor},{children:["— ",null==n?void 0:n.author]}))]}),s)}))}),t.jsx("div",e.__assign({style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!m&&t.jsx(n.default,{disabled:_,count:S,page:p,onChange:function(e,t){return h(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),t.jsxs("div",e.__assign({style:i.geoLocationsContainer},{children:[t.jsx("p",e.__assign({style:i.sectionTitle},{children:"Key Geo Locations"})),t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},i.quotesPadding),{marginBottom:"8px"})},{children:[Q?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===N.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:i.retryButton,onClick:function(){return ae({endpoint:"geo-locations",page:K,isbn:d,setData:G,setLoading:J,setHasMore:X,setTotalPage:ee})}},{children:"Retry"}))]})):t.jsx(t.Fragment,{children:N.map((function(n,s){var a="geo_location"===ne.list&&ne.index===s;return t.jsxs("span",e.__assign({style:i.geoLocationFlex},{children:[t.jsx("span",e.__assign({style:e.__assign(e.__assign({},i.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]),se({list:"geo_location",index:s}),(null===(a=null==n?void 0:n.chunkIds)||void 0===a?void 0:a.length)>0?[4,o(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<N.length-1&&t.jsx("span",{style:i.geoDivider})]}),s)}))}),t.jsx("div",e.__assign({style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!V&&t.jsx(n.default,{disabled:Q,count:$,page:K,onChange:function(e,t){return Y(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),t.jsxs("div",e.__assign({style:i.charactersContainer},{children:[t.jsx("p",e.__assign({style:i.sectionTitle},{children:"Key Characters"})),F?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({},i.characterCard),{flexBasis:"40%"})},{children:[t.jsx(a.default,{variant:"circle",style:e.__assign(e.__assign({},i.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===k.length?t.jsxs("p",e.__assign({style:{color:"#6B7280",fontStyle:"italic",paddingLeft:"12px"}},{children:["No key characters found. ",t.jsx("button",e.__assign({style:i.retryButton,onClick:function(){return ae({endpoint:"notable-characters",page:B,isbn:d,setData:w,setLoading:E,setHasMore:W,setTotalPage:R})}},{children:"Retry"}))]})):t.jsx(t.Fragment,{children:t.jsx("div",e.__assign({style:i.charactersGrid},{children:k.map((function(n,s){var a=e.__assign(e.__assign({},i.avatar),{backgroundColor:n.bg,color:n.color}),r="key_character"===ne.list&&ne.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({},i.characterCard),{borderColor:r?"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:se({list:"key_character",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,o(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({},i.charName),{margin:0})},{children:n.name})),t.jsx("p",e.__assign({style:e.__assign(e.__assign({},i.charDesc),{margin:0,marginTop:"4px"})},{children:n.description}))]}))]}),s)}))}))}),t.jsx("div",e.__assign({style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!P&&t.jsx(n.default,{count:z,disabled:F,page:B,onChange:function(e,t){return D(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={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(r){r.data;var o=r.updateQuotesToHighLight,l=r.handleFetchManuscriptElements,d=r.BookIsbn,u=s.useState([]),c=u[0],g=u[1],x=s.useState(1),p=x[0],h=x[1],f=s.useState(!1),_=f[0],y=f[1],v=s.useState(!0),m=v[0],b=v[1],j=s.useState(0),S=j[0],C=j[1],T=s.useState([]),k=T[0],w=T[1],q=s.useState(1),B=q[0],D=q[1],L=s.useState(!1),F=L[0],E=L[1],M=s.useState(!0),P=M[0],W=M[1],I=s.useState(0),z=I[0],R=I[1],H=s.useState([]),N=H[0],G=H[1],A=s.useState(1),K=A[0],Y=A[1],O=s.useState(!1),Q=O[0],J=O[1],U=s.useState(!0),V=U[0],X=U[1],Z=s.useState(0),$=Z[0],ee=Z[1],te=s.useState({list:"",index:-1,page:1}),ne=te[0],se=te[1],ae=function(t){var n=t.endpoint,s=t.page,a=t.isbn,i=t.setData,r=t.setLoading,o=t.setHasMore,d=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,l({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)),d((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(){ae({endpoint:"notable-quotes",page:p,isbn:d,setData:g,setLoading:y,setHasMore:b,setTotalPage:C})}),[p]),s.useEffect((function(){ae({endpoint:"notable-characters",page:B,isbn:d,setData:w,setLoading:E,setHasMore:W,setTotalPage:R})}),[B]),s.useEffect((function(){ae({endpoint:"geo-locations",page:K,isbn:d,setData:G,setLoading:J,setHasMore:X,setTotalPage:ee})}),[K]),t.jsxs("div",{children:[t.jsxs("div",e.__assign({style:{marginBottom:"24px"}},{children:[t.jsx("p",e.__assign({style:i.sectionTitle},{children:"Notable Quotes"})),t.jsxs("div",e.__assign({style:i.quotesPadding},{children:[_?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:i.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===c.length?t.jsxs("p",e.__assign({style:{color:"#6B7280",fontStyle:"italic"}},{children:["No notable quotes found. ",t.jsx("button",e.__assign({style:i.retryButton,onClick:function(){return ae({endpoint:"notable-quotes",page:p,isbn:d,setData:g,setLoading:y,setHasMore:b,setTotalPage:C})}},{children:"Retry"}))]})):t.jsx(t.Fragment,{children:c.map((function(n,s){var a="notable"===ne.list&&ne.page===p&&ne.index===s;return t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},i.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]),se({list:"notable",page:p,index:s}),(null===(a=null==n?void 0:n.chunkIds)||void 0===a?void 0:a.length)>0?[4,o(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:i.quoteText},{children:null==n?void 0:n.text})),t.jsxs("p",e.__assign({style:i.quoteMeta},{children:[n.chapter," ",t.jsx("br",{})," ",n.page]})),t.jsxs("p",e.__assign({style:i.quoteAuthor},{children:["— ",null==n?void 0:n.author]}))]}),s)}))}),t.jsx("div",e.__assign({style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!m&&t.jsx(n.default,{disabled:_,count:S,page:p,onChange:function(e,t){return h(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),t.jsxs("div",e.__assign({style:i.geoLocationsContainer},{children:[t.jsx("p",e.__assign({style:i.sectionTitle},{children:"Key Geo Locations"})),t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},i.quotesPadding),{marginBottom:"8px"})},{children:[Q?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===N.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:i.retryButton,onClick:function(){return ae({endpoint:"geo-locations",page:K,isbn:d,setData:G,setLoading:J,setHasMore:X,setTotalPage:ee})}},{children:"Retry"}))]})):t.jsx(t.Fragment,{children:N.map((function(n,s){var a="geo_location"===ne.list&&ne.page===K&&ne.index===s;return t.jsxs("span",e.__assign({style:i.geoLocationFlex},{children:[t.jsx("span",e.__assign({style:e.__assign(e.__assign({},i.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]),se({list:"geo_location",page:K,index:s}),(null===(a=null==n?void 0:n.chunkIds)||void 0===a?void 0:a.length)>0?[4,o(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<N.length-1&&t.jsx("span",{style:i.geoDivider})]}),s)}))}),t.jsx("div",e.__assign({style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!V&&t.jsx(n.default,{disabled:Q,count:$,page:K,onChange:function(e,t){return Y(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),t.jsxs("div",e.__assign({style:i.charactersContainer},{children:[t.jsx("p",e.__assign({style:i.sectionTitle},{children:"Key Characters"})),F?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({},i.characterCard),{flexBasis:"40%"})},{children:[t.jsx(a.default,{variant:"circle",style:e.__assign(e.__assign({},i.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===k.length?t.jsxs("p",e.__assign({style:{color:"#6B7280",fontStyle:"italic",paddingLeft:"12px"}},{children:["No key characters found. ",t.jsx("button",e.__assign({style:i.retryButton,onClick:function(){return ae({endpoint:"notable-characters",page:B,isbn:d,setData:w,setLoading:E,setHasMore:W,setTotalPage:R})}},{children:"Retry"}))]})):t.jsx(t.Fragment,{children:t.jsx("div",e.__assign({style:i.charactersGrid},{children:k.map((function(n,s){var a=e.__assign(e.__assign({},i.avatar),{backgroundColor:n.bg,color:n.color}),r="key_character"===ne.list&&ne.page===B&&ne.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({},i.characterCard),{borderColor:r?"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:se({list:"key_character",page:B,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,o(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({},i.charName),{margin:0})},{children:n.name})),t.jsx("p",e.__assign({style:e.__assign(e.__assign({},i.charDesc),{margin:0,marginTop:"4px"})},{children:n.description}))]}))]}),s)}))}))}),t.jsx("div",e.__assign({style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!P&&t.jsx(n.default,{count:z,disabled:F,page:B,onChange:function(e,t){return D(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})};
|
|
2
2
|
//# sourceMappingURL=BookElementsCard.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e,__awaiter as t,__generator as n}from"../../../node_modules/tslib/tslib.es6.mjs.js";import{jsxs as o,jsx as r,Fragment as i}from"react/jsx-runtime";import a 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 l,useEffect as s}from"react";import"../../../node_modules/@material-ui/core/esm/SvgIcon/SvgIcon.js";import"react-dom";import d from"../../../node_modules/@material-ui/lab/esm/Skeleton/Skeleton.js";var c={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"}},u=function(u){u.data;var p=u.updateQuotesToHighLight,h=u.handleFetchManuscriptElements,g=u.BookIsbn,x=l([]),f=x[0],m=x[1],y=l(1),v=y[0],b=y[1],C=l(!1),T=C[0],S=C[1],k=l(!0),w=k[0],B=k[1],D=l(0),L=D[0],q=D[1],M=l([]),j=M[0],F=M[1],E=l(1),P=E[0],W=E[1],_=l(!1),I=_[0],z=_[1],R=l(!0),H=R[0],N=R[1],G=l(0),A=G[0],K=G[1],Y=l([]),Q=Y[0],O=Y[1],J=l(1),U=J[0],V=J[1],X=l(!1),Z=X[0],$=X[1],ee=l(!0),te=ee[0],ne=ee[1],oe=l(0),re=oe[0],ie=oe[1],ae=l({list:"",index:-1}),le=ae[0],se=ae[1],de=function(e){var o=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 n(this,(function(n){switch(n.label){case 0:return l(!0),[4,h({endpoint:o,page:r,pageSize:10,isbn:i})];case 1:return e=n.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 s((function(){de({endpoint:"notable-quotes",page:v,isbn:g,setData:m,setLoading:S,setHasMore:B,setTotalPage:q})}),[v]),s((function(){de({endpoint:"notable-characters",page:P,isbn:g,setData:F,setLoading:z,setHasMore:N,setTotalPage:K})}),[P]),s((function(){de({endpoint:"geo-locations",page:U,isbn:g,setData:O,setLoading:$,setHasMore:ne,setTotalPage:ie})}),[U]),o("div",{children:[o("div",e({style:{marginBottom:"24px"}},{children:[r("p",e({style:c.sectionTitle},{children:"Notable Quotes"})),o("div",e({style:c.quotesPadding},{children:[T?r("div",e({style:{display:"flex",flexDirection:"column",rowGap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map((function(t){return o("div",e({style:c.quoteCard},{children:[r(d,{variant:"text",width:"60%",height:28}),r(d,{variant:"text",width:"40%",height:20}),r(d,{variant:"text",width:"25%",height:20}),r(d,{variant:"text",width:"30%",height:20})]}),t)}))})):0===f.length?o("p",e({style:{color:"#6B7280",fontStyle:"italic"}},{children:["No notable quotes found. ",r("button",e({style:c.retryButton,onClick:function(){return de({endpoint:"notable-quotes",page:v,isbn:g,setData:m,setLoading:S,setHasMore:B,setTotalPage:q})}},{children:"Retry"}))]})):r(i,{children:f.map((function(i,a){var l="notable"===le.list&&le.index===a;return o("div",e({style:e(e({},c.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 n(this,(function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),se({list:"notable",index:a}),(null===(t=null==i?void 0:i.chunkIds)||void 0===t?void 0:t.length)>0?[4,p(i.text,"Notable Quotes",i.chunkIds,0)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[3,4];case 3:return e=n.sent(),console.error("Failed to highlight quote:",e),[3,4];case 4:return[2]}}))}))}},{children:[r("p",e({style:c.quoteText},{children:null==i?void 0:i.text})),o("p",e({style:c.quoteMeta},{children:[i.chapter," ",r("br",{})," ",i.page]})),o("p",e({style:c.quoteAuthor},{children:["— ",null==i?void 0:i.author]}))]}),a)}))}),r("div",e({style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!w&&r(a,{disabled:T,count:L,page:v,onChange:function(e,t){return b(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),o("div",e({style:c.geoLocationsContainer},{children:[r("p",e({style:c.sectionTitle},{children:"Key Geo Locations"})),o("div",e({style:e(e({},c.quotesPadding),{marginBottom:"8px"})},{children:[Z?r("div",e({style:{display:"flex",flexWrap:"wrap",gap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map((function(e){return r(d,{variant:"rect",width:100,height:20,style:{borderRadius:"8px"}},e)}))})):0===Q.length?o("p",e({style:{color:"#6B7280",fontStyle:"italic",paddingLeft:"12px"}},{children:["No key geo locations found. ",r("button",e({style:c.retryButton,onClick:function(){return de({endpoint:"geo-locations",page:U,isbn:g,setData:O,setLoading:$,setHasMore:ne,setTotalPage:ie})}},{children:"Retry"}))]})):r(i,{children:Q.map((function(i,a){var l="geo_location"===le.list&&le.index===a;return o("span",e({style:c.geoLocationFlex},{children:[r("span",e({style:e(e({},c.geoText),{fontWeight:l?"700":"",textDecoration:l?"underline":""}),onClick:function(){return t(void 0,void 0,void 0,(function(){var e,t;return n(this,(function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),se({list:"geo_location",index:a}),(null===(t=null==i?void 0:i.chunkIds)||void 0===t?void 0:t.length)>0?[4,p(i.name,"Key Geo Locations",i.chunkIds,0)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[3,4];case 3:return e=n.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==i?void 0:i.name})),a<Q.length-1&&r("span",{style:c.geoDivider})]}),a)}))}),r("div",e({style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!te&&r(a,{disabled:Z,count:re,page:U,onChange:function(e,t){return V(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),o("div",e({style:c.charactersContainer},{children:[r("p",e({style:c.sectionTitle},{children:"Key Characters"})),I?r("div",e({style:{display:"flex",flexWrap:"wrap",gap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map((function(t){return o("div",e({style:e(e({},c.characterCard),{flexBasis:"40%"})},{children:[r(d,{variant:"circle",style:e(e({},c.avatar),{flexShrink:0})}),o("div",e({style:{display:"flex",flexDirection:"column",flex:1}},{children:[r(d,{variant:"text",style:{flex:"1",flexShrink:0}}),r(d,{variant:"text",style:{flex:"1"}}),r(d,{variant:"text",style:{flex:"1"}}),r(d,{variant:"text",style:{flex:"1"}})]}))]}),t)}))})):0===j.length?o("p",e({style:{color:"#6B7280",fontStyle:"italic",paddingLeft:"12px"}},{children:["No key characters found. ",r("button",e({style:c.retryButton,onClick:function(){return de({endpoint:"notable-characters",page:P,isbn:g,setData:F,setLoading:z,setHasMore:N,setTotalPage:K})}},{children:"Retry"}))]})):r(i,{children:r("div",e({style:c.charactersGrid},{children:j.map((function(i,a){var l=e(e({},c.avatar),{backgroundColor:i.bg,color:i.color}),s="key_character"===le.list&&le.index===a;return o("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({},c.characterCard),{borderColor:s?"rgb(83, 43, 237)":"#E5E7EB"}),onClick:function(){return t(void 0,void 0,void 0,(function(){var e,t;return n(this,(function(n){switch(n.label){case 0:se({list:"key_character",index:a}),n.label=1;case 1:return n.trys.push([1,4,,5]),(null===(t=null==i?void 0:i.chunkIds)||void 0===t?void 0:t.length)>0?[4,p(i.name,"Key Characters",i.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:[r("div",e({style:l},{children:i.initials})),o("div",e({style:{display:"flex",flexDirection:"column"}},{children:[r("p",e({style:e(e({},c.charName),{margin:0})},{children:i.name})),r("p",e({style:e(e({},c.charDesc),{margin:0,marginTop:"4px"})},{children:i.description}))]}))]}),a)}))}))}),r("div",e({style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!H&&r(a,{count:A,disabled:I,page:P,onChange:function(e,t){return W(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})};export{u as default};
|
|
1
|
+
import{__assign as e,__awaiter as t,__generator as n}from"../../../node_modules/tslib/tslib.es6.mjs.js";import{jsxs as o,jsx as r,Fragment as i}from"react/jsx-runtime";import a 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 l,useEffect as s}from"react";import"../../../node_modules/@material-ui/core/esm/SvgIcon/SvgIcon.js";import"react-dom";import d from"../../../node_modules/@material-ui/lab/esm/Skeleton/Skeleton.js";var c={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"}},u=function(u){u.data;var p=u.updateQuotesToHighLight,g=u.handleFetchManuscriptElements,h=u.BookIsbn,x=l([]),f=x[0],m=x[1],y=l(1),v=y[0],b=y[1],C=l(!1),T=C[0],S=C[1],k=l(!0),w=k[0],B=k[1],D=l(0),L=D[0],q=D[1],M=l([]),j=M[0],F=M[1],E=l(1),P=E[0],W=E[1],_=l(!1),I=_[0],z=_[1],R=l(!0),H=R[0],N=R[1],G=l(0),A=G[0],K=G[1],Y=l([]),Q=Y[0],O=Y[1],J=l(1),U=J[0],V=J[1],X=l(!1),Z=X[0],$=X[1],ee=l(!0),te=ee[0],ne=ee[1],oe=l(0),re=oe[0],ie=oe[1],ae=l({list:"",index:-1,page:1}),le=ae[0],se=ae[1],de=function(e){var o=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 n(this,(function(n){switch(n.label){case 0:return l(!0),[4,g({endpoint:o,page:r,pageSize:10,isbn:i})];case 1:return e=n.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 s((function(){de({endpoint:"notable-quotes",page:v,isbn:h,setData:m,setLoading:S,setHasMore:B,setTotalPage:q})}),[v]),s((function(){de({endpoint:"notable-characters",page:P,isbn:h,setData:F,setLoading:z,setHasMore:N,setTotalPage:K})}),[P]),s((function(){de({endpoint:"geo-locations",page:U,isbn:h,setData:O,setLoading:$,setHasMore:ne,setTotalPage:ie})}),[U]),o("div",{children:[o("div",e({style:{marginBottom:"24px"}},{children:[r("p",e({style:c.sectionTitle},{children:"Notable Quotes"})),o("div",e({style:c.quotesPadding},{children:[T?r("div",e({style:{display:"flex",flexDirection:"column",rowGap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map((function(t){return o("div",e({style:c.quoteCard},{children:[r(d,{variant:"text",width:"60%",height:28}),r(d,{variant:"text",width:"40%",height:20}),r(d,{variant:"text",width:"25%",height:20}),r(d,{variant:"text",width:"30%",height:20})]}),t)}))})):0===f.length?o("p",e({style:{color:"#6B7280",fontStyle:"italic"}},{children:["No notable quotes found. ",r("button",e({style:c.retryButton,onClick:function(){return de({endpoint:"notable-quotes",page:v,isbn:h,setData:m,setLoading:S,setHasMore:B,setTotalPage:q})}},{children:"Retry"}))]})):r(i,{children:f.map((function(i,a){var l="notable"===le.list&&le.page===v&&le.index===a;return o("div",e({style:e(e({},c.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 n(this,(function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),se({list:"notable",page:v,index:a}),(null===(t=null==i?void 0:i.chunkIds)||void 0===t?void 0:t.length)>0?[4,p(i.text,"Notable Quotes",i.chunkIds,0)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[3,4];case 3:return e=n.sent(),console.error("Failed to highlight quote:",e),[3,4];case 4:return[2]}}))}))}},{children:[r("p",e({style:c.quoteText},{children:null==i?void 0:i.text})),o("p",e({style:c.quoteMeta},{children:[i.chapter," ",r("br",{})," ",i.page]})),o("p",e({style:c.quoteAuthor},{children:["— ",null==i?void 0:i.author]}))]}),a)}))}),r("div",e({style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!w&&r(a,{disabled:T,count:L,page:v,onChange:function(e,t){return b(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),o("div",e({style:c.geoLocationsContainer},{children:[r("p",e({style:c.sectionTitle},{children:"Key Geo Locations"})),o("div",e({style:e(e({},c.quotesPadding),{marginBottom:"8px"})},{children:[Z?r("div",e({style:{display:"flex",flexWrap:"wrap",gap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map((function(e){return r(d,{variant:"rect",width:100,height:20,style:{borderRadius:"8px"}},e)}))})):0===Q.length?o("p",e({style:{color:"#6B7280",fontStyle:"italic",paddingLeft:"12px"}},{children:["No key geo locations found. ",r("button",e({style:c.retryButton,onClick:function(){return de({endpoint:"geo-locations",page:U,isbn:h,setData:O,setLoading:$,setHasMore:ne,setTotalPage:ie})}},{children:"Retry"}))]})):r(i,{children:Q.map((function(i,a){var l="geo_location"===le.list&&le.page===U&&le.index===a;return o("span",e({style:c.geoLocationFlex},{children:[r("span",e({style:e(e({},c.geoText),{fontWeight:l?"700":"",textDecoration:l?"underline":""}),onClick:function(){return t(void 0,void 0,void 0,(function(){var e,t;return n(this,(function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),se({list:"geo_location",page:U,index:a}),(null===(t=null==i?void 0:i.chunkIds)||void 0===t?void 0:t.length)>0?[4,p(i.name,"Key Geo Locations",i.chunkIds,0)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[3,4];case 3:return e=n.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==i?void 0:i.name})),a<Q.length-1&&r("span",{style:c.geoDivider})]}),a)}))}),r("div",e({style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!te&&r(a,{disabled:Z,count:re,page:U,onChange:function(e,t){return V(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})),o("div",e({style:c.charactersContainer},{children:[r("p",e({style:c.sectionTitle},{children:"Key Characters"})),I?r("div",e({style:{display:"flex",flexWrap:"wrap",gap:"8px"}},{children:[1,2,3,4,5,6,7,8,9,10].map((function(t){return o("div",e({style:e(e({},c.characterCard),{flexBasis:"40%"})},{children:[r(d,{variant:"circle",style:e(e({},c.avatar),{flexShrink:0})}),o("div",e({style:{display:"flex",flexDirection:"column",flex:1}},{children:[r(d,{variant:"text",style:{flex:"1",flexShrink:0}}),r(d,{variant:"text",style:{flex:"1"}}),r(d,{variant:"text",style:{flex:"1"}}),r(d,{variant:"text",style:{flex:"1"}})]}))]}),t)}))})):0===j.length?o("p",e({style:{color:"#6B7280",fontStyle:"italic",paddingLeft:"12px"}},{children:["No key characters found. ",r("button",e({style:c.retryButton,onClick:function(){return de({endpoint:"notable-characters",page:P,isbn:h,setData:F,setLoading:z,setHasMore:N,setTotalPage:K})}},{children:"Retry"}))]})):r(i,{children:r("div",e({style:c.charactersGrid},{children:j.map((function(i,a){var l=e(e({},c.avatar),{backgroundColor:i.bg,color:i.color}),s="key_character"===le.list&&le.page===P&&le.index===a;return o("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({},c.characterCard),{borderColor:s?"rgb(83, 43, 237)":"#E5E7EB"}),onClick:function(){return t(void 0,void 0,void 0,(function(){var e,t;return n(this,(function(n){switch(n.label){case 0:se({list:"key_character",page:P,index:a}),n.label=1;case 1:return n.trys.push([1,4,,5]),(null===(t=null==i?void 0:i.chunkIds)||void 0===t?void 0:t.length)>0?[4,p(i.name,"Key Characters",i.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:[r("div",e({style:l},{children:i.initials})),o("div",e({style:{display:"flex",flexDirection:"column"}},{children:[r("p",e({style:e(e({},c.charName),{margin:0})},{children:i.name})),r("p",e({style:e(e({},c.charDesc),{margin:0,marginTop:"4px"})},{children:i.description}))]}))]}),a)}))}))}),r("div",e({style:{display:"flex",justifyContent:"flex-end",width:"100%"}},{children:!H&&r(a,{count:A,disabled:I,page:P,onChange:function(e,t){return W(t)},shape:"rounded",style:{marginTop:"8px"}})}))]}))]})};export{u as default};
|
|
2
2
|
//# sourceMappingURL=BookElementsCard.js.map
|