@hyperdart/frontend 2.0.8 → 2.0.9

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/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("react"),t=require("react-router-dom"),n=require("@mui/material/styles"),a=require("react-dom/client"),o=require("@mui/material"),r=require("@mui/icons-material/Add"),i=require("@mui/icons-material/FilterList"),s=require("@mui/icons-material/DoubleArrow"),l=require("@mui/icons-material/Close");function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},c.apply(null,arguments)}const d={default:{palette:{mode:"light"},typography:{},shape:{borderRadius:12}},light:{components:{...{MuiTableRow:{styleOverrides:{head:{background:"#EEEEEE"}}}}},palette:{primary:{main:"#F05F40"},secondary:{main:"#40f0bb"},mode:"light",background:{default:"#F5F5F5",cardContainer:"#fafafa"},customShadow:"0px 6px 9px 0px #00000014"},typography:{},shape:{borderRadius:12}},dark:{components:{...{MuiTableRow:{styleOverrides:{head:{background:"#212121"}}},MuiCard:{styleOverrides:{root:{backgroundColor:"#424242",backgroundImage:"none"}}},MuiPaper:{styleOverrides:{root:{backgroundColor:"#424242",backgroundImage:"none"}}}}},palette:{primary:{main:"#F05F40"},mode:"dark",background:{default:"#303030",paper:"#424242",cardContainer:"#424242"},customShadow:"0px 3px 1px -2px rgba(0,0,0,0.2),0px 2px 2px 0px rgba(0,0,0,0.14),0px 1px 5px 0px rgba(0,0,0,0.12)"},typography:{},shape:{borderRadius:12}},lightsOut:{components:{...{MuiTableRow:{styleOverrides:{head:{background:"#212121"}}},MuiCard:{styleOverrides:{root:{backgroundColor:"#000",backgroundImage:"none"}}},MuiPaper:{styleOverrides:{root:{backgroundColor:"#000",backgroundImage:"none"}}}}},palette:{primary:{main:"#F05F40"},mode:"dark",background:{default:"#000",paper:"#000",cardContainer:"#000"}},shadows:Array(25).fill("0px 4px 12px #888888"),typography:{},shape:{borderRadius:12}}};let m=null;function p(t,n,o,r,i){const s=document.getElementById("root");m||(m=a.createRoot(s));const l=location.pathname.indexOf(n)<0?"":location.pathname.slice(0,location.pathname.indexOf(n));m.render(e.createElement(t,{baseURL:n,basename:l,searchData:o,UIOptions:r,deployedBackendURL:i}))}function u(e,t,n){window.onmessage=function(a){if("dataRefresh"===a.data.type){const o=a.data.searchData&&a.data.searchData[0];p(e,t,o,a.data.UIOptions,n)}},p(e,t,[],{},"");const a=new ResizeObserver(e=>{if(e.length>0){const t=e[0].target.clientHeight;window.parent.postMessage({type:"resizeIframe",height:t},"*")}}),o=document.getElementById("root");o&&a.observe(o)}const h=n.styled(o.Fab)(({theme:e})=>({zIndex:"5",position:"fixed",bottom:58,right:10,opacity:.8,width:"48px",height:"48px",[e.breakpoints.up("lg")]:{bottom:58,right:"calc(100% - 1140px)"}})),g=n.styled("div")(({theme:e})=>({display:"flex",justifyContent:"space-evenly",cursor:"pointer",position:"sticky",bottom:0,backgroundColor:e.palette.background.default,zIndex:1e3})),y=t=>{const{isMdUp:n}=t,[a,c]=e.useState(n),[d,m]=e.useState(!1);e.useEffect(()=>{c(n)},[n]);const{menu:p,componentFullWidth:u,fullHeight:y,applyBtnMdUp:f,applyBtnMdUpOnClick:b,applyBtnSmDown:x,applyBtnSmDownOnClick:w,filters:E,noOfFilters:k,preventAutoClose:C}=t.secondaryMenu,v=()=>{c(!a),m(!d)},S=e=>{v(),e()},M=()=>{v()};return e.useEffect(()=>{if(t.secondaryMenu?.menu&&document.getElementById("secondaryMenu")){const e=document.getElementById("secondaryMenu").clientHeight>window.innerHeight;t.setHeightOverflow(e)}},[t.secondaryMenu?.menu]),e.createElement(e.Fragment,null,!a&&e.createElement(h,{onClick:v,color:"primary",className:u?"fabButtonClose":"fabButton"},E?k?e.createElement(o.Badge,{badgeContent:k,color:"primary"},e.createElement(i,null)):e.createElement(i,null):e.createElement(r,null)),n&&a&&e.createElement(o.Drawer,{variant:"persistent",anchor:"right",open:a,PaperProps:{elevation:1,id:"secondaryMenu",sx:{boxSizing:"border-box",paddingTop:"4px",width:a?"100%":0,position:"static",height:y?"inherit":"auto"}}},p,f&&b?e.createElement(g,null,e.createElement(o.Button,{variant:"outlined",sx:{width:"50%"},color:"primary",onClick:M},"Close"),e.createElement(o.Button,{variant:"contained",sx:{width:"50%"},color:"primary",onClick:()=>S(b)},"Apply")):e.createElement(o.Box,{sx:{display:"flex",padding:"16px",cursor:"pointer"},onClick:v},e.createElement(o.Typography,{variant:"caption"},"Hide Menu"),e.createElement(s,{sx:{color:"grey",width:16,height:20}}))),!n&&e.createElement(o.Drawer,{anchor:"right",open:d,onClose:v,PaperProps:{sx:{width:"80%"}}},e.createElement("div",{tabIndex:0,role:"button",onClick:x&&w||C?void 0:v,onKeyDown:x&&w||C?void 0:v},C&&e.createElement(o.Box,{sx:{display:"flex",justifyContent:"flex-start",padding:"10px"}},e.createElement(o.IconButton,{onClick:v,edge:"end","aria-label":"close",size:"large"},e.createElement(l,null))),p,x&&w&&e.createElement(g,null,e.createElement(o.Button,{variant:"outlined",color:"primary",style:{width:"50%"},onClick:M},"Close"),e.createElement(o.Button,{variant:"contained",color:"primary",style:{width:"50%"},onClick:()=>S(w)},"Apply")))))};var f=e.memo(y);const b=({secondaryMenuProps:t,isMdUp:n})=>{const[a,o]=e.useState(!1),[r,i]=e.useState({scrollPos:0,top:0}),s=e.useRef(null);return e.useEffect(()=>{const e=()=>{const e=s?.current?.offsetHeight,t=window.innerHeight;i(n=>{const a=n.scrollPos-window.scrollY;let o=n.top+a;return o>0&&(o=0),o<t-e&&(o=t-e),{top:o,scrollPos:window.scrollY}})};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}},[]),t&&""!==t&&""!==t.menu?e.createElement("div",{ref:s,style:{position:"sticky",top:0,bottom:"auto",display:"flex",flexDirection:"column",top:a?r?.top:0,width:n?"240px":0,height:"100%"}},e.createElement(f,{setHeightOverflow:o,secondaryMenu:t,isMdUp:n})):null},x=e=>({MuiCard:{styleOverrides:{root:({theme:t})=>({backgroundColor:"dark"===t.palette.mode?e.palette?.background?.cardContainer||"#424242":void 0,backgroundImage:"none"})}},MuiPaper:{styleOverrides:{root:({theme:t})=>({backgroundColor:"dark"===t.palette.mode?e.palette?.background?.paper||"#424242":void 0,backgroundImage:"none"})}}});class w extends e.Component{constructor(e){super(e),this.state={themeName:e.themeName||"light"},this.themeSource=e.theme||d;const t=this.themeSource[this.state.themeName];this.theme=n.createTheme({...n.adaptV4Theme(t),components:{...x(t)}})}componentDidUpdate(e){if(this.props.themeName!==e.themeName){const e=this.themeSource[this.props.themeName];this.theme=n.createTheme({...n.adaptV4Theme(e),components:{...x(e)}}),this.setState({themeName:this.props.themeName})}}render(){return e.createElement(n.StyledEngineProvider,{injectFirst:!0},e.createElement(n.ThemeProvider,{theme:this.theme},this.props.children))}}const E=n=>{const a=e.useRef(!1),r=t.useNavigate(),i=t.useLocation(),s=o.useTheme(),l=o.useMediaQuery(s.breakpoints.up("md")),[d,m]=e.useState(null),{format:p,UIOptions:u,searchData:h,baseURL:g="",basename:y=""}=n,f="fullscreen"===p,x=y+g,{componentStyles:w,...E}=u||{},{componentPath:k,...C}=h||{};let v={setWebsearchHeader:e=>{window.parent.postMessage({type:"setWebsearchHeader",header:e},"*")},secondaryMenu:e=>{m(e)},searchQuery:e=>{window.parent.postMessage({type:"searchQuery",query:e},"*")},switchFullScreen:(e=!0,t=!1)=>{window.parent.postMessage({type:"switchFullScreen",fullScreen:e,navigatedViaRoute:t},"*")},componentLoaded:()=>{window.parent.postMessage({type:"componentLoaded"})}};return e.useEffect(()=>{if(n.searchData&&n.searchData.componentPath){const e=n.searchData.componentPath,t=e.startsWith(x)?e.substring(x.length):e;r(t,{replace:!0})}},[n?.searchData?.componentPath]),e.useEffect(()=>{const e=x+i.pathname+i.search;i.pathname,i.search,a.current?e&&(!n.searchData||!n.searchData.componentPath||n.searchData&&n.searchData.componentPath&&e!==n.searchData.componentPath)&&window.parent.postMessage({type:"updateComponentPath",componentPath:e},"*"):a.current=!0},[i?.pathname,i?.search]),e.createElement("div",{style:{display:"flex",position:"relative",flexDirection:"row",width:"100%"}},e.createElement("div",{style:{width:l&&f&&d&&""!==d.menu?"calc(100% - 400px)":"100%",maxWidth:l&&f&&d&&""!==d.menu?"966px":"1160px",margin:l&&f&&u?.componentStyles?.margin||""}},e.createElement(n.comp,c({},n,{UIOptions:E,searchData:C,messageHandlers:v}))),f?((t,n)=>e.createElement(b,{secondaryMenuProps:t,isMdUp:n}))(d,l):null)};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if("undefined"!=typeof document){var a=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&a.firstChild?a.insertBefore(o,a.firstChild):a.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("/* placeholder animations */\n.imgComponentStyles_placeholder__GXJke {\n margin: 0 auto;\n width: 100%;\n height: 18px;\n border-radius: 8px;\n background-color: #eee;\n}\n\n@keyframes imgComponentStyles_placeHolderShimmer__5-fnD {\n 0% {\n background-position: -468px 0\n }\n\n 100% {\n background-position: 468px 0\n }\n}\n\n.imgComponentStyles_animated-background__vGXc6 {\n animation-duration: 1s;\n animation-fill-mode: forwards;\n animation-iteration-count: infinite;\n animation-name: imgComponentStyles_placeHolderShimmer__5-fnD;\n animation-timing-function: linear;\n background: darkgray;\n background: linear-gradient(to right, #eeeeee 15%, #b2b2b2 18%, #eeeeee 33%);\n background-size: 800px 104px;\n height: 100%;\n border-radius: 20px;\n position: relative;\n}\n\n/* blinking dot */\n@keyframes imgComponentStyles_up-right__Y-xzl {\n 0% {\n transform: scale(1);\n opacity: .25\n }\n\n 50% {\n transform: scale (1, 5);\n opacity: 1;\n }\n\n 100% {\n transform: scale(1);\n opacity: .25;\n }\n}\n\n.imgComponentStyles_border__Lvjsc {\n border-radius: 50%;\n width: 8px;\n height: 8px;\n opacity: .25;\n}\n\n.imgComponentStyles_dot-animation__T9Onq {\n background-color: white;\n position: relative;\n top: -12px;\n left: 30px;\n -webkit-animation: imgComponentStyles_up-right__Y-xzl 1s infinite;\n -moz-animation: imgComponentStyles_up-right__Y-xzl 1s infinite;\n -o-animation: imgComponentStyles_up-right__Y-xzl 1s infinite;\n animation: imgComponentStyles_up-right__Y-xzl 1s infinite;\n}");exports.Img=t=>{const{isLoading:n,src:a,alt:o,placeholderClassName:r,placeholderStyle:i,contentClassName:s,contentStyle:l,onError:c,fallbackUrl:d,id:m,onClick:p}=t,[u,h]=e.useState(0);return n?e.createElement("div",{style:{...i,height:!r&&i&&(i.height||"20px"),width:!r&&i&&(i.width||"100px")},className:`${r} animated-background`}):e.createElement("img",{className:s,style:{...l},alt:o,src:a,onError:e=>{d&&e.target.src!==d&&!u&&(e.target.src=d,h(u+1)),c&&u<2&&(h(u+1),c(e))},id:m,onClick:p||(()=>{})})},exports.themes=d,exports.withHD=n=>{const a=a=>{let{quickPanel:o,basename:r,searchData:i,UIOptions:s,...l}=a?{...a}:{};o=o||!0,r=r||"",l.search=l.search||(e=>console.log("New query = ",e));const d=i&&("object"==typeof i||Array.isArray(i)&&i.length>0);let m=!0;try{m=window.self!==window.top}catch(e){m=!0}return e.createElement(e.Fragment,null,d||s&&s.sandbox||!m?a.match?e.createElement(E,a):e.createElement(t.BrowserRouter,{basename:r+a.baseURL},e.createElement(w,{themeName:s&&s.themeName,theme:s&&s.theme},e.createElement(t.Routes,null,e.createElement(t.Route,{path:"*",element:e.createElement(E,c({},a,{comp:n,quickPanel:o,format:s.format}))})))):e.createElement(e.Fragment,null),!d&&s&&s.sandbox?e.createElement("div",{style:{position:"fixed",top:0,width:"100%",display:"flex",justifyContent:"center",backgroundColor:"red",color:"white"}},e.createElement("h6",{style:{margin:"5px"}}," No search data received. Component will not be loaded... ")):e.createElement(e.Fragment,null))};return a.initHD=u,a};
1
+ "use strict";var e=require("react"),t=require("react-router-dom"),n=require("@mui/material/styles"),a=require("react-dom/client"),o=require("@mui/material"),r=require("@mui/icons-material/Add"),i=require("@mui/icons-material/FilterList"),s=require("@mui/icons-material/DoubleArrow"),l=require("@mui/icons-material/Close");function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},c.apply(null,arguments)}const d={default:{palette:{mode:"light"},typography:{},shape:{borderRadius:12}},light:{components:{...{MuiTableRow:{styleOverrides:{head:{background:"#EEEEEE"}}}}},palette:{primary:{main:"#F05F40"},secondary:{main:"#40f0bb"},mode:"light",background:{default:"#F5F5F5",cardContainer:"#fafafa"},customShadow:"0px 6px 9px 0px #00000014"},typography:{},shape:{borderRadius:12}},dark:{components:{...{MuiTableRow:{styleOverrides:{head:{background:"#212121"}}},MuiCard:{styleOverrides:{root:{backgroundColor:"#424242",backgroundImage:"none"}}},MuiPaper:{styleOverrides:{root:{backgroundColor:"#424242",backgroundImage:"none"}}}}},palette:{primary:{main:"#F05F40"},mode:"dark",background:{default:"#303030",paper:"#424242",cardContainer:"#424242"},customShadow:"0px 3px 1px -2px rgba(0,0,0,0.2),0px 2px 2px 0px rgba(0,0,0,0.14),0px 1px 5px 0px rgba(0,0,0,0.12)"},typography:{},shape:{borderRadius:12}},lightsOut:{components:{...{MuiTableRow:{styleOverrides:{head:{background:"#212121"}}},MuiCard:{styleOverrides:{root:{backgroundColor:"#000",backgroundImage:"none"}}},MuiPaper:{styleOverrides:{root:{backgroundColor:"#000",backgroundImage:"none"}}}}},palette:{primary:{main:"#F05F40"},mode:"dark",background:{default:"#000",paper:"#000",cardContainer:"#000"}},shadows:Array(25).fill("0px 4px 12px #888888"),typography:{},shape:{borderRadius:12}}};let m=null;function p(t,n,o,r,i){const s=document.getElementById("root");m||(m=a.createRoot(s));const l=location.pathname.indexOf(n)<0?"":location.pathname.slice(0,location.pathname.indexOf(n));m.render(e.createElement(t,{baseURL:n,basename:l,searchData:o,UIOptions:r,deployedBackendURL:i}))}function u(e,t,n){window.onmessage=function(a){if("dataRefresh"===a.data.type){const o=a.data.searchData&&a.data.searchData[0];p(e,t,o,a.data.UIOptions,n)}},p(e,t,[],{},"");const a=new ResizeObserver(e=>{if(e.length>0){const t=e[0].target.clientHeight;window.parent.postMessage({type:"resizeIframe",height:t},"*")}}),o=document.getElementById("root");o&&a.observe(o)}const h=n.styled(o.Fab)(({theme:e})=>({zIndex:"5",position:"fixed",bottom:58,right:10,opacity:.8,width:"48px",height:"48px",[e.breakpoints.up("lg")]:{bottom:58,right:"calc(100% - 1140px)"}})),g=n.styled("div")(({theme:e})=>({display:"flex",justifyContent:"space-evenly",cursor:"pointer",position:"sticky",bottom:0,backgroundColor:e.palette.background.default,zIndex:1e3})),y=t=>{const{isMdUp:n}=t,[a,c]=e.useState(n),[d,m]=e.useState(!1);e.useEffect(()=>{c(n)},[n]);const{menu:p,componentFullWidth:u,fullHeight:y,applyBtnMdUp:f,applyBtnMdUpOnClick:b,applyBtnSmDown:x,applyBtnSmDownOnClick:w,filters:E,noOfFilters:k,preventAutoClose:v}=t.secondaryMenu,C=()=>{c(!a),m(!d)},S=e=>{C(),e()},M=()=>{C()};return e.useEffect(()=>{if(t.secondaryMenu?.menu&&document.getElementById("secondaryMenu")){const e=document.getElementById("secondaryMenu").clientHeight>window.innerHeight;t.setHeightOverflow(e)}},[t.secondaryMenu?.menu]),e.createElement(e.Fragment,null,!a&&e.createElement(h,{onClick:C,color:"primary",className:u?"fabButtonClose":"fabButton"},E?k?e.createElement(o.Badge,{badgeContent:k,color:"primary"},e.createElement(i,null)):e.createElement(i,null):e.createElement(r,null)),n&&a&&e.createElement(o.Drawer,{variant:"persistent",anchor:"right",open:a,PaperProps:{elevation:1,id:"secondaryMenu",sx:{boxSizing:"border-box",paddingTop:"4px",width:a?"100%":0,position:"static",height:y?"inherit":"auto"}}},p,f&&b?e.createElement(g,null,e.createElement(o.Button,{variant:"outlined",sx:{width:"50%"},color:"primary",onClick:M},"Close"),e.createElement(o.Button,{variant:"contained",sx:{width:"50%"},color:"primary",onClick:()=>S(b)},"Apply")):e.createElement(o.Box,{sx:{display:"flex",padding:"16px",cursor:"pointer"},onClick:C},e.createElement(o.Typography,{variant:"caption"},"Hide Menu"),e.createElement(s,{sx:{color:"grey",width:16,height:20}}))),!n&&e.createElement(o.Drawer,{anchor:"right",open:d,onClose:C,PaperProps:{sx:{width:"80%"}}},e.createElement("div",{tabIndex:0,role:"button",onClick:x&&w||v?void 0:C,onKeyDown:x&&w||v?void 0:C},v&&e.createElement(o.Box,{sx:{display:"flex",justifyContent:"flex-start",padding:"10px"}},e.createElement(o.IconButton,{onClick:C,edge:"end","aria-label":"close",size:"large"},e.createElement(l,null))),p,x&&w&&e.createElement(g,null,e.createElement(o.Button,{variant:"outlined",color:"primary",style:{width:"50%"},onClick:M},"Close"),e.createElement(o.Button,{variant:"contained",color:"primary",style:{width:"50%"},onClick:()=>S(w)},"Apply")))))};var f=e.memo(y);const b=({secondaryMenuProps:t,isMdUp:n})=>{const[a,o]=e.useState(!1),[r,i]=e.useState({scrollPos:0,top:0}),s=e.useRef(null);return e.useEffect(()=>{const e=()=>{const e=s?.current?.offsetHeight,t=window.innerHeight;i(n=>{const a=n.scrollPos-window.scrollY;let o=n.top+a;return o>0&&(o=0),o<t-e&&(o=t-e),{top:o,scrollPos:window.scrollY}})};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}},[]),t&&""!==t&&""!==t.menu?e.createElement("div",{ref:s,style:{position:"sticky",top:0,bottom:"auto",display:"flex",flexDirection:"column",top:a?r?.top:0,width:n?"240px":0,height:"100%"}},e.createElement(f,{setHeightOverflow:o,secondaryMenu:t,isMdUp:n})):null},x=e=>({MuiCard:{styleOverrides:{root:({theme:t})=>({backgroundColor:"dark"===t.palette.mode?e.palette?.background?.cardContainer||"#424242":void 0,backgroundImage:"none"})}},MuiPaper:{styleOverrides:{root:({theme:t})=>({backgroundColor:"dark"===t.palette.mode?e.palette?.background?.paper||"#424242":void 0,backgroundImage:"none"})}}});class w extends e.Component{constructor(e){super(e),this.state={themeName:e.themeName||"light"},this.themeSource=e.theme||d;const t=this.themeSource[this.state.themeName];this.theme=n.createTheme({...n.adaptV4Theme(t),components:{...x(t)}})}componentDidUpdate(e){if(this.props.themeName!==e.themeName){const e=this.themeSource[this.props.themeName];this.theme=n.createTheme({...n.adaptV4Theme(e),components:{...x(e)}}),this.setState({themeName:this.props.themeName})}}render(){return e.createElement(n.StyledEngineProvider,{injectFirst:!0},e.createElement(n.ThemeProvider,{theme:this.theme},this.props.children))}}const E=n=>{const a=e.useRef(!1),r=t.useNavigate(),i=t.useLocation(),s=o.useTheme(),l=o.useMediaQuery(s.breakpoints.up("md")),[d,m]=e.useState(null),{format:p,UIOptions:u,searchData:h,baseURL:g="",basename:y=""}=n,f="fullscreen"===p,x=y+g,{componentStyles:w,...E}=u||{},{componentPath:k,...v}=h||{};let C={setWebsearchHeader:e=>{window.parent.postMessage({type:"setWebsearchHeader",header:e},"*")},secondaryMenu:e=>{m(e)},searchQuery:e=>{window.parent.postMessage({type:"searchQuery",query:e},"*")},switchFullScreen:(e=!0,t=!1)=>{window.parent.postMessage({type:"switchFullScreen",fullScreen:e,navigatedViaRoute:t},"*")},componentLoaded:()=>{window.parent.postMessage({type:"componentLoaded"})},loadAiGeneratedResponse:(e,t)=>new Promise((n,a)=>{const o=Date.now();window.addEventListener("message",function e(t){"loadAiGeneratedResponseResult"===t.data?.type&&t.data?.requestId===o&&(window.removeEventListener("message",e),t.data.error?a(new Error(t.data.error)):n(t.data.response))}),window.parent.postMessage({type:"loadAiGeneratedResponse",query:e,context:t,requestId:o},"*")})};return e.useEffect(()=>{if(n.searchData&&n.searchData.componentPath){const e=n.searchData.componentPath,t=e.startsWith(x)?e.substring(x.length):e;r(t,{replace:!0})}},[n?.searchData?.componentPath]),e.useEffect(()=>{const e=x+i.pathname+i.search;i.pathname,i.search,a.current?e&&(!n.searchData||!n.searchData.componentPath||n.searchData&&n.searchData.componentPath&&e!==n.searchData.componentPath)&&window.parent.postMessage({type:"updateComponentPath",componentPath:e},"*"):a.current=!0},[i?.pathname,i?.search]),e.createElement("div",{style:{display:"flex",position:"relative",flexDirection:"row",width:"100%"}},e.createElement("div",{style:{width:l&&f&&d&&""!==d.menu?"calc(100% - 400px)":"100%",maxWidth:l&&f&&d&&""!==d.menu?"966px":"1160px",margin:l&&f&&u?.componentStyles?.margin||""}},e.createElement(n.comp,c({},n,{UIOptions:E,searchData:v,messageHandlers:C}))),f?((t,n)=>e.createElement(b,{secondaryMenuProps:t,isMdUp:n}))(d,l):null)};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if("undefined"!=typeof document){var a=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&a.firstChild?a.insertBefore(o,a.firstChild):a.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("/* placeholder animations */\n.imgComponentStyles_placeholder__GXJke {\n margin: 0 auto;\n width: 100%;\n height: 18px;\n border-radius: 8px;\n background-color: #eee;\n}\n\n@keyframes imgComponentStyles_placeHolderShimmer__5-fnD {\n 0% {\n background-position: -468px 0\n }\n\n 100% {\n background-position: 468px 0\n }\n}\n\n.imgComponentStyles_animated-background__vGXc6 {\n animation-duration: 1s;\n animation-fill-mode: forwards;\n animation-iteration-count: infinite;\n animation-name: imgComponentStyles_placeHolderShimmer__5-fnD;\n animation-timing-function: linear;\n background: darkgray;\n background: linear-gradient(to right, #eeeeee 15%, #b2b2b2 18%, #eeeeee 33%);\n background-size: 800px 104px;\n height: 100%;\n border-radius: 20px;\n position: relative;\n}\n\n/* blinking dot */\n@keyframes imgComponentStyles_up-right__Y-xzl {\n 0% {\n transform: scale(1);\n opacity: .25\n }\n\n 50% {\n transform: scale (1, 5);\n opacity: 1;\n }\n\n 100% {\n transform: scale(1);\n opacity: .25;\n }\n}\n\n.imgComponentStyles_border__Lvjsc {\n border-radius: 50%;\n width: 8px;\n height: 8px;\n opacity: .25;\n}\n\n.imgComponentStyles_dot-animation__T9Onq {\n background-color: white;\n position: relative;\n top: -12px;\n left: 30px;\n -webkit-animation: imgComponentStyles_up-right__Y-xzl 1s infinite;\n -moz-animation: imgComponentStyles_up-right__Y-xzl 1s infinite;\n -o-animation: imgComponentStyles_up-right__Y-xzl 1s infinite;\n animation: imgComponentStyles_up-right__Y-xzl 1s infinite;\n}");exports.Img=t=>{const{isLoading:n,src:a,alt:o,placeholderClassName:r,placeholderStyle:i,contentClassName:s,contentStyle:l,onError:c,fallbackUrl:d,id:m,onClick:p}=t,[u,h]=e.useState(0);return n?e.createElement("div",{style:{...i,height:!r&&i&&(i.height||"20px"),width:!r&&i&&(i.width||"100px")},className:`${r} animated-background`}):e.createElement("img",{className:s,style:{...l},alt:o,src:a,onError:e=>{d&&e.target.src!==d&&!u&&(e.target.src=d,h(u+1)),c&&u<2&&(h(u+1),c(e))},id:m,onClick:p||(()=>{})})},exports.themes=d,exports.withHD=n=>{const a=a=>{let{quickPanel:o,basename:r,searchData:i,UIOptions:s,...l}=a?{...a}:{};o=o||!0,r=r||"",l.search=l.search||(e=>console.log("New query = ",e));const d=i&&("object"==typeof i||Array.isArray(i)&&i.length>0);let m=!0;try{m=window.self!==window.top}catch(e){m=!0}return e.createElement(e.Fragment,null,d||s&&s.sandbox||!m?a.match?e.createElement(E,a):e.createElement(t.BrowserRouter,{basename:r+a.baseURL},e.createElement(w,{themeName:s&&s.themeName,theme:s&&s.theme},e.createElement(t.Routes,null,e.createElement(t.Route,{path:"*",element:e.createElement(E,c({},a,{comp:n,quickPanel:o,format:s.format}))})))):e.createElement(e.Fragment,null),!d&&s&&s.sandbox?e.createElement("div",{style:{position:"fixed",top:0,width:"100%",display:"flex",justifyContent:"center",backgroundColor:"red",color:"white"}},e.createElement("h6",{style:{margin:"5px"}}," No search data received. Component will not be loaded... ")):e.createElement(e.Fragment,null))};return a.initHD=u,a};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- import e,{memo as t,useState as n,useEffect as a,useRef as o,Fragment as r,Component as i}from"react";import{BrowserRouter as s,Routes as l,Route as c,useNavigate as m,useLocation as p}from"react-router-dom";import{styled as d,createTheme as h,adaptV4Theme as u,StyledEngineProvider as g,ThemeProvider as y}from"@mui/material/styles";import f from"react-dom/client";import{Fab as b,Badge as x,Drawer as w,Button as k,Box as E,Typography as C,IconButton as v,useTheme as _,useMediaQuery as M}from"@mui/material";import S from"@mui/icons-material/Add";import O from"@mui/icons-material/FilterList";import D from"@mui/icons-material/DoubleArrow";import P from"@mui/icons-material/Close";function I(){return I=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},I.apply(null,arguments)}const N={default:{palette:{mode:"light"},typography:{},shape:{borderRadius:12}},light:{components:{...{MuiTableRow:{styleOverrides:{head:{background:"#EEEEEE"}}}}},palette:{primary:{main:"#F05F40"},secondary:{main:"#40f0bb"},mode:"light",background:{default:"#F5F5F5",cardContainer:"#fafafa"},customShadow:"0px 6px 9px 0px #00000014"},typography:{},shape:{borderRadius:12}},dark:{components:{...{MuiTableRow:{styleOverrides:{head:{background:"#212121"}}},MuiCard:{styleOverrides:{root:{backgroundColor:"#424242",backgroundImage:"none"}}},MuiPaper:{styleOverrides:{root:{backgroundColor:"#424242",backgroundImage:"none"}}}}},palette:{primary:{main:"#F05F40"},mode:"dark",background:{default:"#303030",paper:"#424242",cardContainer:"#424242"},customShadow:"0px 3px 1px -2px rgba(0,0,0,0.2),0px 2px 2px 0px rgba(0,0,0,0.14),0px 1px 5px 0px rgba(0,0,0,0.12)"},typography:{},shape:{borderRadius:12}},lightsOut:{components:{...{MuiTableRow:{styleOverrides:{head:{background:"#212121"}}},MuiCard:{styleOverrides:{root:{backgroundColor:"#000",backgroundImage:"none"}}},MuiPaper:{styleOverrides:{root:{backgroundColor:"#000",backgroundImage:"none"}}}}},palette:{primary:{main:"#F05F40"},mode:"dark",background:{default:"#000",paper:"#000",cardContainer:"#000"}},shadows:Array(25).fill("0px 4px 12px #888888"),typography:{},shape:{borderRadius:12}}};let F=null;function U(t,n,a,o,r){const i=document.getElementById("root");F||(F=f.createRoot(i));const s=location.pathname.indexOf(n)<0?"":location.pathname.slice(0,location.pathname.indexOf(n));F.render(e.createElement(t,{baseURL:n,basename:s,searchData:a,UIOptions:o,deployedBackendURL:r}))}function H(e,t,n){window.onmessage=function(a){if("dataRefresh"===a.data.type){const o=a.data.searchData&&a.data.searchData[0];U(e,t,o,a.data.UIOptions,n)}},U(e,t,[],{},"");const a=new ResizeObserver(e=>{if(e.length>0){const t=e[0].target.clientHeight;window.parent.postMessage({type:"resizeIframe",height:t},"*")}}),o=document.getElementById("root");o&&a.observe(o)}const R=d(b)(({theme:e})=>({zIndex:"5",position:"fixed",bottom:58,right:10,opacity:.8,width:"48px",height:"48px",[e.breakpoints.up("lg")]:{bottom:58,right:"calc(100% - 1140px)"}})),z=d("div")(({theme:e})=>({display:"flex",justifyContent:"space-evenly",cursor:"pointer",position:"sticky",bottom:0,backgroundColor:e.palette.background.default,zIndex:1e3}));var B=t(t=>{const{isMdUp:o}=t,[r,i]=n(o),[s,l]=n(!1);a(()=>{i(o)},[o]);const{menu:c,componentFullWidth:m,fullHeight:p,applyBtnMdUp:d,applyBtnMdUpOnClick:h,applyBtnSmDown:u,applyBtnSmDownOnClick:g,filters:y,noOfFilters:f,preventAutoClose:b}=t.secondaryMenu,_=()=>{i(!r),l(!s)},M=e=>{_(),e()},I=()=>{_()};return a(()=>{if(t.secondaryMenu?.menu&&document.getElementById("secondaryMenu")){const e=document.getElementById("secondaryMenu").clientHeight>window.innerHeight;t.setHeightOverflow(e)}},[t.secondaryMenu?.menu]),e.createElement(e.Fragment,null,!r&&e.createElement(R,{onClick:_,color:"primary",className:m?"fabButtonClose":"fabButton"},y?f?e.createElement(x,{badgeContent:f,color:"primary"},e.createElement(O,null)):e.createElement(O,null):e.createElement(S,null)),o&&r&&e.createElement(w,{variant:"persistent",anchor:"right",open:r,PaperProps:{elevation:1,id:"secondaryMenu",sx:{boxSizing:"border-box",paddingTop:"4px",width:r?"100%":0,position:"static",height:p?"inherit":"auto"}}},c,d&&h?e.createElement(z,null,e.createElement(k,{variant:"outlined",sx:{width:"50%"},color:"primary",onClick:I},"Close"),e.createElement(k,{variant:"contained",sx:{width:"50%"},color:"primary",onClick:()=>M(h)},"Apply")):e.createElement(E,{sx:{display:"flex",padding:"16px",cursor:"pointer"},onClick:_},e.createElement(C,{variant:"caption"},"Hide Menu"),e.createElement(D,{sx:{color:"grey",width:16,height:20}}))),!o&&e.createElement(w,{anchor:"right",open:s,onClose:_,PaperProps:{sx:{width:"80%"}}},e.createElement("div",{tabIndex:0,role:"button",onClick:u&&g||b?void 0:_,onKeyDown:u&&g||b?void 0:_},b&&e.createElement(E,{sx:{display:"flex",justifyContent:"flex-start",padding:"10px"}},e.createElement(v,{onClick:_,edge:"end","aria-label":"close",size:"large"},e.createElement(P,null))),c,u&&g&&e.createElement(z,null,e.createElement(k,{variant:"outlined",color:"primary",style:{width:"50%"},onClick:I},"Close"),e.createElement(k,{variant:"contained",color:"primary",style:{width:"50%"},onClick:()=>M(g)},"Apply")))))});const L=({secondaryMenuProps:t,isMdUp:r})=>{const[i,s]=n(!1),[l,c]=n({scrollPos:0,top:0}),m=o(null);return a(()=>{const e=()=>{const e=m?.current?.offsetHeight,t=window.innerHeight;c(n=>{const a=n.scrollPos-window.scrollY;let o=n.top+a;return o>0&&(o=0),o<t-e&&(o=t-e),{top:o,scrollPos:window.scrollY}})};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}},[]),t&&""!==t&&""!==t.menu?e.createElement("div",{ref:m,style:{position:"sticky",top:0,bottom:"auto",display:"flex",flexDirection:"column",top:i?l?.top:0,width:r?"240px":0,height:"100%"}},e.createElement(B,{setHeightOverflow:s,secondaryMenu:t,isMdUp:r})):null},A=e=>({MuiCard:{styleOverrides:{root:({theme:t})=>({backgroundColor:"dark"===t.palette.mode?e.palette?.background?.cardContainer||"#424242":void 0,backgroundImage:"none"})}},MuiPaper:{styleOverrides:{root:({theme:t})=>({backgroundColor:"dark"===t.palette.mode?e.palette?.background?.paper||"#424242":void 0,backgroundImage:"none"})}}});class j extends i{constructor(e){super(e),this.state={themeName:e.themeName||"light"},this.themeSource=e.theme||N;const t=this.themeSource[this.state.themeName];this.theme=h({...u(t),components:{...A(t)}})}componentDidUpdate(e){if(this.props.themeName!==e.themeName){const e=this.themeSource[this.props.themeName];this.theme=h({...u(e),components:{...A(e)}}),this.setState({themeName:this.props.themeName})}}render(){return e.createElement(g,{injectFirst:!0},e.createElement(y,{theme:this.theme},this.props.children))}}const T=t=>{const r=o(!1),i=m(),s=p(),l=_(),c=M(l.breakpoints.up("md")),[d,h]=n(null),{format:u,UIOptions:g,searchData:y,baseURL:f="",basename:b=""}=t,x="fullscreen"===u,w=b+f,{componentStyles:k,...E}=g||{},{componentPath:C,...v}=y||{};let S={setWebsearchHeader:e=>{window.parent.postMessage({type:"setWebsearchHeader",header:e},"*")},secondaryMenu:e=>{h(e)},searchQuery:e=>{window.parent.postMessage({type:"searchQuery",query:e},"*")},switchFullScreen:(e=!0,t=!1)=>{window.parent.postMessage({type:"switchFullScreen",fullScreen:e,navigatedViaRoute:t},"*")},componentLoaded:()=>{window.parent.postMessage({type:"componentLoaded"})}};return a(()=>{if(t.searchData&&t.searchData.componentPath){const e=t.searchData.componentPath,n=e.startsWith(w)?e.substring(w.length):e;i(n,{replace:!0})}},[t?.searchData?.componentPath]),a(()=>{const e=w+s.pathname+s.search;s.pathname,s.search,r.current?e&&(!t.searchData||!t.searchData.componentPath||t.searchData&&t.searchData.componentPath&&e!==t.searchData.componentPath)&&window.parent.postMessage({type:"updateComponentPath",componentPath:e},"*"):r.current=!0},[s?.pathname,s?.search]),e.createElement("div",{style:{display:"flex",position:"relative",flexDirection:"row",width:"100%"}},e.createElement("div",{style:{width:c&&x&&d&&""!==d.menu?"calc(100% - 400px)":"100%",maxWidth:c&&x&&d&&""!==d.menu?"966px":"1160px",margin:c&&x&&g?.componentStyles?.margin||""}},e.createElement(t.comp,I({},t,{UIOptions:E,searchData:v,messageHandlers:S}))),x?((t,n)=>e.createElement(L,{secondaryMenuProps:t,isMdUp:n}))(d,c):null)},Y=t=>{const n=n=>{let{quickPanel:a,basename:o,searchData:i,UIOptions:m,...p}=n?{...n}:{};a=a||!0,o=o||"",p.search=p.search||(e=>console.log("New query = ",e));const d=i&&("object"==typeof i||Array.isArray(i)&&i.length>0);let h=!0;try{h=window.self!==window.top}catch(e){h=!0}return e.createElement(r,null,d||m&&m.sandbox||!h?n.match?e.createElement(T,n):e.createElement(s,{basename:o+n.baseURL},e.createElement(j,{themeName:m&&m.themeName,theme:m&&m.theme},e.createElement(l,null,e.createElement(c,{path:"*",element:e.createElement(T,I({},n,{comp:t,quickPanel:a,format:m.format}))})))):e.createElement(e.Fragment,null),!d&&m&&m.sandbox?e.createElement("div",{style:{position:"fixed",top:0,width:"100%",display:"flex",justifyContent:"center",backgroundColor:"red",color:"white"}},e.createElement("h6",{style:{margin:"5px"}}," No search data received. Component will not be loaded... ")):e.createElement(e.Fragment,null))};return n.initHD=H,n};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if("undefined"!=typeof document){var a=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&a.firstChild?a.insertBefore(o,a.firstChild):a.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("/* placeholder animations */\n.imgComponentStyles_placeholder__GXJke {\n margin: 0 auto;\n width: 100%;\n height: 18px;\n border-radius: 8px;\n background-color: #eee;\n}\n\n@keyframes imgComponentStyles_placeHolderShimmer__5-fnD {\n 0% {\n background-position: -468px 0\n }\n\n 100% {\n background-position: 468px 0\n }\n}\n\n.imgComponentStyles_animated-background__vGXc6 {\n animation-duration: 1s;\n animation-fill-mode: forwards;\n animation-iteration-count: infinite;\n animation-name: imgComponentStyles_placeHolderShimmer__5-fnD;\n animation-timing-function: linear;\n background: darkgray;\n background: linear-gradient(to right, #eeeeee 15%, #b2b2b2 18%, #eeeeee 33%);\n background-size: 800px 104px;\n height: 100%;\n border-radius: 20px;\n position: relative;\n}\n\n/* blinking dot */\n@keyframes imgComponentStyles_up-right__Y-xzl {\n 0% {\n transform: scale(1);\n opacity: .25\n }\n\n 50% {\n transform: scale (1, 5);\n opacity: 1;\n }\n\n 100% {\n transform: scale(1);\n opacity: .25;\n }\n}\n\n.imgComponentStyles_border__Lvjsc {\n border-radius: 50%;\n width: 8px;\n height: 8px;\n opacity: .25;\n}\n\n.imgComponentStyles_dot-animation__T9Onq {\n background-color: white;\n position: relative;\n top: -12px;\n left: 30px;\n -webkit-animation: imgComponentStyles_up-right__Y-xzl 1s infinite;\n -moz-animation: imgComponentStyles_up-right__Y-xzl 1s infinite;\n -o-animation: imgComponentStyles_up-right__Y-xzl 1s infinite;\n animation: imgComponentStyles_up-right__Y-xzl 1s infinite;\n}");const q=t=>{const{isLoading:n,src:a,alt:o,placeholderClassName:r,placeholderStyle:i,contentClassName:s,contentStyle:l,onError:c,fallbackUrl:m,id:p,onClick:d}=t,[h,u]=e.useState(0);return n?e.createElement("div",{style:{...i,height:!r&&i&&(i.height||"20px"),width:!r&&i&&(i.width||"100px")},className:`${r} animated-background`}):e.createElement("img",{className:s,style:{...l},alt:o,src:a,onError:e=>{m&&e.target.src!==m&&!h&&(e.target.src=m,u(h+1)),c&&h<2&&(u(h+1),c(e))},id:p,onClick:d||(()=>{})})};export{q as Img,N as themes,Y as withHD};
1
+ import e,{memo as t,useState as n,useEffect as a,useRef as o,Fragment as r,Component as i}from"react";import{BrowserRouter as s,Routes as l,Route as c,useNavigate as d,useLocation as m}from"react-router-dom";import{styled as p,createTheme as h,adaptV4Theme as u,StyledEngineProvider as g,ThemeProvider as y}from"@mui/material/styles";import f from"react-dom/client";import{Fab as b,Badge as x,Drawer as w,Button as k,Box as E,Typography as C,IconButton as v,useTheme as M,useMediaQuery as _}from"@mui/material";import S from"@mui/icons-material/Add";import O from"@mui/icons-material/FilterList";import D from"@mui/icons-material/DoubleArrow";import P from"@mui/icons-material/Close";function I(){return I=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},I.apply(null,arguments)}const N={default:{palette:{mode:"light"},typography:{},shape:{borderRadius:12}},light:{components:{...{MuiTableRow:{styleOverrides:{head:{background:"#EEEEEE"}}}}},palette:{primary:{main:"#F05F40"},secondary:{main:"#40f0bb"},mode:"light",background:{default:"#F5F5F5",cardContainer:"#fafafa"},customShadow:"0px 6px 9px 0px #00000014"},typography:{},shape:{borderRadius:12}},dark:{components:{...{MuiTableRow:{styleOverrides:{head:{background:"#212121"}}},MuiCard:{styleOverrides:{root:{backgroundColor:"#424242",backgroundImage:"none"}}},MuiPaper:{styleOverrides:{root:{backgroundColor:"#424242",backgroundImage:"none"}}}}},palette:{primary:{main:"#F05F40"},mode:"dark",background:{default:"#303030",paper:"#424242",cardContainer:"#424242"},customShadow:"0px 3px 1px -2px rgba(0,0,0,0.2),0px 2px 2px 0px rgba(0,0,0,0.14),0px 1px 5px 0px rgba(0,0,0,0.12)"},typography:{},shape:{borderRadius:12}},lightsOut:{components:{...{MuiTableRow:{styleOverrides:{head:{background:"#212121"}}},MuiCard:{styleOverrides:{root:{backgroundColor:"#000",backgroundImage:"none"}}},MuiPaper:{styleOverrides:{root:{backgroundColor:"#000",backgroundImage:"none"}}}}},palette:{primary:{main:"#F05F40"},mode:"dark",background:{default:"#000",paper:"#000",cardContainer:"#000"}},shadows:Array(25).fill("0px 4px 12px #888888"),typography:{},shape:{borderRadius:12}}};let R=null;function F(t,n,a,o,r){const i=document.getElementById("root");R||(R=f.createRoot(i));const s=location.pathname.indexOf(n)<0?"":location.pathname.slice(0,location.pathname.indexOf(n));R.render(e.createElement(t,{baseURL:n,basename:s,searchData:a,UIOptions:o,deployedBackendURL:r}))}function U(e,t,n){window.onmessage=function(a){if("dataRefresh"===a.data.type){const o=a.data.searchData&&a.data.searchData[0];F(e,t,o,a.data.UIOptions,n)}},F(e,t,[],{},"");const a=new ResizeObserver(e=>{if(e.length>0){const t=e[0].target.clientHeight;window.parent.postMessage({type:"resizeIframe",height:t},"*")}}),o=document.getElementById("root");o&&a.observe(o)}const H=p(b)(({theme:e})=>({zIndex:"5",position:"fixed",bottom:58,right:10,opacity:.8,width:"48px",height:"48px",[e.breakpoints.up("lg")]:{bottom:58,right:"calc(100% - 1140px)"}})),z=p("div")(({theme:e})=>({display:"flex",justifyContent:"space-evenly",cursor:"pointer",position:"sticky",bottom:0,backgroundColor:e.palette.background.default,zIndex:1e3}));var B=t(t=>{const{isMdUp:o}=t,[r,i]=n(o),[s,l]=n(!1);a(()=>{i(o)},[o]);const{menu:c,componentFullWidth:d,fullHeight:m,applyBtnMdUp:p,applyBtnMdUpOnClick:h,applyBtnSmDown:u,applyBtnSmDownOnClick:g,filters:y,noOfFilters:f,preventAutoClose:b}=t.secondaryMenu,M=()=>{i(!r),l(!s)},_=e=>{M(),e()},I=()=>{M()};return a(()=>{if(t.secondaryMenu?.menu&&document.getElementById("secondaryMenu")){const e=document.getElementById("secondaryMenu").clientHeight>window.innerHeight;t.setHeightOverflow(e)}},[t.secondaryMenu?.menu]),e.createElement(e.Fragment,null,!r&&e.createElement(H,{onClick:M,color:"primary",className:d?"fabButtonClose":"fabButton"},y?f?e.createElement(x,{badgeContent:f,color:"primary"},e.createElement(O,null)):e.createElement(O,null):e.createElement(S,null)),o&&r&&e.createElement(w,{variant:"persistent",anchor:"right",open:r,PaperProps:{elevation:1,id:"secondaryMenu",sx:{boxSizing:"border-box",paddingTop:"4px",width:r?"100%":0,position:"static",height:m?"inherit":"auto"}}},c,p&&h?e.createElement(z,null,e.createElement(k,{variant:"outlined",sx:{width:"50%"},color:"primary",onClick:I},"Close"),e.createElement(k,{variant:"contained",sx:{width:"50%"},color:"primary",onClick:()=>_(h)},"Apply")):e.createElement(E,{sx:{display:"flex",padding:"16px",cursor:"pointer"},onClick:M},e.createElement(C,{variant:"caption"},"Hide Menu"),e.createElement(D,{sx:{color:"grey",width:16,height:20}}))),!o&&e.createElement(w,{anchor:"right",open:s,onClose:M,PaperProps:{sx:{width:"80%"}}},e.createElement("div",{tabIndex:0,role:"button",onClick:u&&g||b?void 0:M,onKeyDown:u&&g||b?void 0:M},b&&e.createElement(E,{sx:{display:"flex",justifyContent:"flex-start",padding:"10px"}},e.createElement(v,{onClick:M,edge:"end","aria-label":"close",size:"large"},e.createElement(P,null))),c,u&&g&&e.createElement(z,null,e.createElement(k,{variant:"outlined",color:"primary",style:{width:"50%"},onClick:I},"Close"),e.createElement(k,{variant:"contained",color:"primary",style:{width:"50%"},onClick:()=>_(g)},"Apply")))))});const L=({secondaryMenuProps:t,isMdUp:r})=>{const[i,s]=n(!1),[l,c]=n({scrollPos:0,top:0}),d=o(null);return a(()=>{const e=()=>{const e=d?.current?.offsetHeight,t=window.innerHeight;c(n=>{const a=n.scrollPos-window.scrollY;let o=n.top+a;return o>0&&(o=0),o<t-e&&(o=t-e),{top:o,scrollPos:window.scrollY}})};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}},[]),t&&""!==t&&""!==t.menu?e.createElement("div",{ref:d,style:{position:"sticky",top:0,bottom:"auto",display:"flex",flexDirection:"column",top:i?l?.top:0,width:r?"240px":0,height:"100%"}},e.createElement(B,{setHeightOverflow:s,secondaryMenu:t,isMdUp:r})):null},A=e=>({MuiCard:{styleOverrides:{root:({theme:t})=>({backgroundColor:"dark"===t.palette.mode?e.palette?.background?.cardContainer||"#424242":void 0,backgroundImage:"none"})}},MuiPaper:{styleOverrides:{root:({theme:t})=>({backgroundColor:"dark"===t.palette.mode?e.palette?.background?.paper||"#424242":void 0,backgroundImage:"none"})}}});class j extends i{constructor(e){super(e),this.state={themeName:e.themeName||"light"},this.themeSource=e.theme||N;const t=this.themeSource[this.state.themeName];this.theme=h({...u(t),components:{...A(t)}})}componentDidUpdate(e){if(this.props.themeName!==e.themeName){const e=this.themeSource[this.props.themeName];this.theme=h({...u(e),components:{...A(e)}}),this.setState({themeName:this.props.themeName})}}render(){return e.createElement(g,{injectFirst:!0},e.createElement(y,{theme:this.theme},this.props.children))}}const q=t=>{const r=o(!1),i=d(),s=m(),l=M(),c=_(l.breakpoints.up("md")),[p,h]=n(null),{format:u,UIOptions:g,searchData:y,baseURL:f="",basename:b=""}=t,x="fullscreen"===u,w=b+f,{componentStyles:k,...E}=g||{},{componentPath:C,...v}=y||{};let S={setWebsearchHeader:e=>{window.parent.postMessage({type:"setWebsearchHeader",header:e},"*")},secondaryMenu:e=>{h(e)},searchQuery:e=>{window.parent.postMessage({type:"searchQuery",query:e},"*")},switchFullScreen:(e=!0,t=!1)=>{window.parent.postMessage({type:"switchFullScreen",fullScreen:e,navigatedViaRoute:t},"*")},componentLoaded:()=>{window.parent.postMessage({type:"componentLoaded"})},loadAiGeneratedResponse:(e,t)=>new Promise((n,a)=>{const o=Date.now();window.addEventListener("message",function e(t){"loadAiGeneratedResponseResult"===t.data?.type&&t.data?.requestId===o&&(window.removeEventListener("message",e),t.data.error?a(new Error(t.data.error)):n(t.data.response))}),window.parent.postMessage({type:"loadAiGeneratedResponse",query:e,context:t,requestId:o},"*")})};return a(()=>{if(t.searchData&&t.searchData.componentPath){const e=t.searchData.componentPath,n=e.startsWith(w)?e.substring(w.length):e;i(n,{replace:!0})}},[t?.searchData?.componentPath]),a(()=>{const e=w+s.pathname+s.search;s.pathname,s.search,r.current?e&&(!t.searchData||!t.searchData.componentPath||t.searchData&&t.searchData.componentPath&&e!==t.searchData.componentPath)&&window.parent.postMessage({type:"updateComponentPath",componentPath:e},"*"):r.current=!0},[s?.pathname,s?.search]),e.createElement("div",{style:{display:"flex",position:"relative",flexDirection:"row",width:"100%"}},e.createElement("div",{style:{width:c&&x&&p&&""!==p.menu?"calc(100% - 400px)":"100%",maxWidth:c&&x&&p&&""!==p.menu?"966px":"1160px",margin:c&&x&&g?.componentStyles?.margin||""}},e.createElement(t.comp,I({},t,{UIOptions:E,searchData:v,messageHandlers:S}))),x?((t,n)=>e.createElement(L,{secondaryMenuProps:t,isMdUp:n}))(p,c):null)},T=t=>{const n=n=>{let{quickPanel:a,basename:o,searchData:i,UIOptions:d,...m}=n?{...n}:{};a=a||!0,o=o||"",m.search=m.search||(e=>console.log("New query = ",e));const p=i&&("object"==typeof i||Array.isArray(i)&&i.length>0);let h=!0;try{h=window.self!==window.top}catch(e){h=!0}return e.createElement(r,null,p||d&&d.sandbox||!h?n.match?e.createElement(q,n):e.createElement(s,{basename:o+n.baseURL},e.createElement(j,{themeName:d&&d.themeName,theme:d&&d.theme},e.createElement(l,null,e.createElement(c,{path:"*",element:e.createElement(q,I({},n,{comp:t,quickPanel:a,format:d.format}))})))):e.createElement(e.Fragment,null),!p&&d&&d.sandbox?e.createElement("div",{style:{position:"fixed",top:0,width:"100%",display:"flex",justifyContent:"center",backgroundColor:"red",color:"white"}},e.createElement("h6",{style:{margin:"5px"}}," No search data received. Component will not be loaded... ")):e.createElement(e.Fragment,null))};return n.initHD=U,n};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if("undefined"!=typeof document){var a=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&a.firstChild?a.insertBefore(o,a.firstChild):a.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("/* placeholder animations */\n.imgComponentStyles_placeholder__GXJke {\n margin: 0 auto;\n width: 100%;\n height: 18px;\n border-radius: 8px;\n background-color: #eee;\n}\n\n@keyframes imgComponentStyles_placeHolderShimmer__5-fnD {\n 0% {\n background-position: -468px 0\n }\n\n 100% {\n background-position: 468px 0\n }\n}\n\n.imgComponentStyles_animated-background__vGXc6 {\n animation-duration: 1s;\n animation-fill-mode: forwards;\n animation-iteration-count: infinite;\n animation-name: imgComponentStyles_placeHolderShimmer__5-fnD;\n animation-timing-function: linear;\n background: darkgray;\n background: linear-gradient(to right, #eeeeee 15%, #b2b2b2 18%, #eeeeee 33%);\n background-size: 800px 104px;\n height: 100%;\n border-radius: 20px;\n position: relative;\n}\n\n/* blinking dot */\n@keyframes imgComponentStyles_up-right__Y-xzl {\n 0% {\n transform: scale(1);\n opacity: .25\n }\n\n 50% {\n transform: scale (1, 5);\n opacity: 1;\n }\n\n 100% {\n transform: scale(1);\n opacity: .25;\n }\n}\n\n.imgComponentStyles_border__Lvjsc {\n border-radius: 50%;\n width: 8px;\n height: 8px;\n opacity: .25;\n}\n\n.imgComponentStyles_dot-animation__T9Onq {\n background-color: white;\n position: relative;\n top: -12px;\n left: 30px;\n -webkit-animation: imgComponentStyles_up-right__Y-xzl 1s infinite;\n -moz-animation: imgComponentStyles_up-right__Y-xzl 1s infinite;\n -o-animation: imgComponentStyles_up-right__Y-xzl 1s infinite;\n animation: imgComponentStyles_up-right__Y-xzl 1s infinite;\n}");const Y=t=>{const{isLoading:n,src:a,alt:o,placeholderClassName:r,placeholderStyle:i,contentClassName:s,contentStyle:l,onError:c,fallbackUrl:d,id:m,onClick:p}=t,[h,u]=e.useState(0);return n?e.createElement("div",{style:{...i,height:!r&&i&&(i.height||"20px"),width:!r&&i&&(i.width||"100px")},className:`${r} animated-background`}):e.createElement("img",{className:s,style:{...l},alt:o,src:a,onError:e=>{d&&e.target.src!==d&&!h&&(e.target.src=d,u(h+1)),c&&h<2&&(u(h+1),c(e))},id:m,onClick:p||(()=>{})})};export{Y as Img,N as themes,T as withHD};
2
2
  //# sourceMappingURL=index.modern.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperdart/frontend",
3
- "version": "2.0.8",
3
+ "version": "2.0.9",
4
4
  "description": "hyperDart frontend for dart development",
5
5
  "author": "hyperDart",
6
6
  "license": "MIT",