@hyperdart/frontend 2.0.7 → 2.0.8
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 +1 -1
- package/dist/index.modern.js +1 -1
- package/package.json +10 -9
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 m={default:{palette:{mode:"light"},typography:{useNextVariants:!0}},light:{palette:{primary:{main:"#F05F40"},secondary:{main:"#40f0bb"},type:"light"},typography:{useNextVariants:!0}},lightsOut:{palette:{primary:{main:"#F05F40"},secondary:{main:"#40f0bb"},type:"dark"},typography:{useNextVariants:!0}},dark:{palette:{primary:{main:"#F05F40"},type:"dark",background:{default:"#000",paper:"#000"}},shadows:Array(25).fill("0px 4px 12px #888888"),typography:{useNextVariants:!0}}};let p=null;function d(t,n,o,r,i){const s=document.getElementById("root");p||(p=a.createRoot(s));const l=location.pathname.indexOf(n)<0?"":location.pathname.slice(0,location.pathname.indexOf(n));p.render(e.createElement(t,{baseURL:n,basename:l,searchData:o,UIOptions:r,deployedBackendURL:i}))}function h(e,t,n){window.onmessage=function(a){if("dataRefresh"===a.data.type){const o=a.data.searchData&&a.data.searchData[0];d(e,t,o,a.data.UIOptions,n)}},d(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 u=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)"}})),y=n.styled("div")(({theme:e})=>({display:"flex",justifyContent:"space-evenly",cursor:"pointer",position:"sticky",bottom:0,backgroundColor:e.palette.background.default,zIndex:1e3})),g=t=>{const{isMdUp:n}=t,[a,c]=e.useState(n),[m,p]=e.useState(!1);e.useEffect(()=>{c(n)},[n]);const{menu:d,componentFullWidth:h,fullHeight:g,applyBtnMdUp:f,applyBtnMdUpOnClick:x,applyBtnSmDown:w,applyBtnSmDownOnClick:b,filters:E,noOfFilters:C,preventAutoClose:v}=t.secondaryMenu,k=()=>{c(!a),p(!m)},S=e=>{k(),e()},_=()=>{k()};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(u,{onClick:k,color:"primary",className:h?"fabButtonClose":"fabButton"},E?C?e.createElement(o.Badge,{badgeContent:C,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:g?"inherit":"auto"}}},d,f&&x?e.createElement(y,null,e.createElement(o.Button,{variant:"outlined",sx:{width:"50%"},color:"primary",onClick:_},"Close"),e.createElement(o.Button,{variant:"contained",sx:{width:"50%"},color:"primary",onClick:()=>S(x)},"Apply")):e.createElement(o.Box,{sx:{display:"flex",padding:"16px",cursor:"pointer"},onClick:k},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:m,onClose:k,PaperProps:{sx:{width:"80%"}}},e.createElement("div",{tabIndex:0,role:"button",onClick:w&&b||v?void 0:k,onKeyDown:w&&b||v?void 0:k},v&&e.createElement(o.Box,{sx:{display:"flex",justifyContent:"flex-start",padding:"10px"}},e.createElement(o.IconButton,{onClick:k,edge:"end","aria-label":"close",size:"large"},e.createElement(l,null))),d,w&&b&&e.createElement(y,null,e.createElement(o.Button,{variant:"outlined",color:"primary",style:{width:"50%"},onClick:_},"Close"),e.createElement(o.Button,{variant:"contained",color:"primary",style:{width:"50%"},onClick:()=>S(b)},"Apply")))))};var f=e.memo(g);const x=({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};class w extends e.Component{constructor(e){super(e),this.state={themeName:e.themeName||"light"},this.themeSource=e.theme||m,this.theme=n.createTheme(n.adaptV4Theme(this.themeSource[this.state.themeName]))}componentDidUpdate(e){this.props.themeName!==e.themeName&&(this.theme=n.createTheme(n.adaptV4Theme(this.themeSource[this.props.themeName])),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 b=n=>{const a=e.useRef(!1),r=t.useNavigate(),i=t.useLocation(),s=o.useTheme(),l=o.useMediaQuery(s.breakpoints.up("md")),[m,p]=e.useState(null),{format:d,UIOptions:h,baseURL:u="",basename:y=""}=n,g="fullscreen"===d,f=y+u,{componentStyles:w,...b}=h||{};let E={setWebsearchHeader:e=>{h.format&&"fullscreen"===h.format&&window.parent.postMessage({type:"setWebsearchHeader",header:e},"*")},secondaryMenu:e=>{p(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(f)?e.substring(f.length):e;r(t,{replace:!0})}},[n?.searchData?.componentPath]),e.useEffect(()=>{const e=f+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&&g&&m&&""!==m.menu?"calc(100% - 400px)":"100%",maxWidth:l&&g&&m&&""!==m.menu?"966px":"1160px",margin:l&&g&&h?.componentStyles?.margin||""}},e.createElement(n.comp,c({},n,{UIOptions:b,messageHandlers:E}))),g?((t,n)=>e.createElement(x,{secondaryMenuProps:t,isMdUp:n}))(m,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: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||(()=>{})})},exports.themes=m,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 m=i&&("object"==typeof i||Array.isArray(i)&&i.length>0);let p=!0;try{p=window.self!==window.top}catch(e){p=!0}return e.createElement(e.Fragment,null,m||s&&s.sandbox||!p?a.match?e.createElement(b,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(b,c({},a,{comp:n,quickPanel:o,format:s.format}))})))):e.createElement(e.Fragment,null),!m&&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=h,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: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};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.modern.js
CHANGED
|
@@ -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 l,Routes as s,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 y,ThemeProvider as g}from"@mui/material/styles";import f from"react-dom/client";import{Fab as x,Badge as w,Drawer as b,Button as E,Box as C,Typography as k,IconButton as v,useTheme as _,useMediaQuery as S}from"@mui/material";import D from"@mui/icons-material/Add";import M from"@mui/icons-material/FilterList";import N from"@mui/icons-material/DoubleArrow";import P from"@mui/icons-material/Close";function O(){return O=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},O.apply(null,arguments)}const U={default:{palette:{mode:"light"},typography:{useNextVariants:!0}},light:{palette:{primary:{main:"#F05F40"},secondary:{main:"#40f0bb"},type:"light"},typography:{useNextVariants:!0}},lightsOut:{palette:{primary:{main:"#F05F40"},secondary:{main:"#40f0bb"},type:"dark"},typography:{useNextVariants:!0}},dark:{palette:{primary:{main:"#F05F40"},type:"dark",background:{default:"#000",paper:"#000"}},shadows:Array(25).fill("0px 4px 12px #888888"),typography:{useNextVariants:!0}}};let F=null;function H(t,n,a,o,r){const i=document.getElementById("root");F||(F=f.createRoot(i));const l=location.pathname.indexOf(n)<0?"":location.pathname.slice(0,location.pathname.indexOf(n));F.render(e.createElement(t,{baseURL:n,basename:l,searchData:a,UIOptions:o,deployedBackendURL:r}))}function z(e,t,n){window.onmessage=function(a){if("dataRefresh"===a.data.type){const o=a.data.searchData&&a.data.searchData[0];H(e,t,o,a.data.UIOptions,n)}},H(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 B=d(x)(({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)"}})),I=d("div")(({theme:e})=>({display:"flex",justifyContent:"space-evenly",cursor:"pointer",position:"sticky",bottom:0,backgroundColor:e.palette.background.default,zIndex:1e3}));var L=t(t=>{const{isMdUp:o}=t,[r,i]=n(o),[l,s]=n(!1);a(()=>{i(o)},[o]);const{menu:c,componentFullWidth:m,fullHeight:p,applyBtnMdUp:d,applyBtnMdUpOnClick:h,applyBtnSmDown:u,applyBtnSmDownOnClick:y,filters:g,noOfFilters:f,preventAutoClose:x}=t.secondaryMenu,_=()=>{i(!r),s(!l)},S=e=>{_(),e()},O=()=>{_()};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(B,{onClick:_,color:"primary",className:m?"fabButtonClose":"fabButton"},g?f?e.createElement(w,{badgeContent:f,color:"primary"},e.createElement(M,null)):e.createElement(M,null):e.createElement(D,null)),o&&r&&e.createElement(b,{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(I,null,e.createElement(E,{variant:"outlined",sx:{width:"50%"},color:"primary",onClick:O},"Close"),e.createElement(E,{variant:"contained",sx:{width:"50%"},color:"primary",onClick:()=>S(h)},"Apply")):e.createElement(C,{sx:{display:"flex",padding:"16px",cursor:"pointer"},onClick:_},e.createElement(k,{variant:"caption"},"Hide Menu"),e.createElement(N,{sx:{color:"grey",width:16,height:20}}))),!o&&e.createElement(b,{anchor:"right",open:l,onClose:_,PaperProps:{sx:{width:"80%"}}},e.createElement("div",{tabIndex:0,role:"button",onClick:u&&y||x?void 0:_,onKeyDown:u&&y||x?void 0:_},x&&e.createElement(C,{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&&y&&e.createElement(I,null,e.createElement(E,{variant:"outlined",color:"primary",style:{width:"50%"},onClick:O},"Close"),e.createElement(E,{variant:"contained",color:"primary",style:{width:"50%"},onClick:()=>S(y)},"Apply")))))});const A=({secondaryMenuProps:t,isMdUp:r})=>{const[i,l]=n(!1),[s,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?s?.top:0,width:r?"240px":0,height:"100%"}},e.createElement(L,{setHeightOverflow:l,secondaryMenu:t,isMdUp:r})):null};class j extends i{constructor(e){super(e),this.state={themeName:e.themeName||"light"},this.themeSource=e.theme||U,this.theme=h(u(this.themeSource[this.state.themeName]))}componentDidUpdate(e){this.props.themeName!==e.themeName&&(this.theme=h(u(this.themeSource[this.props.themeName])),this.setState({themeName:this.props.themeName}))}render(){return e.createElement(y,{injectFirst:!0},e.createElement(g,{theme:this.theme},this.props.children))}}const R=t=>{const r=o(!1),i=m(),l=p(),s=_(),c=S(s.breakpoints.up("md")),[d,h]=n(null),{format:u,UIOptions:y,baseURL:g="",basename:f=""}=t,x="fullscreen"===u,w=f+g,{componentStyles:b,...E}=y||{};let C={setWebsearchHeader:e=>{y.format&&"fullscreen"===y.format&&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+l.pathname+l.search;l.pathname,l.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},[l?.pathname,l?.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&&y?.componentStyles?.margin||""}},e.createElement(t.comp,O({},t,{UIOptions:E,messageHandlers:C}))),x?((t,n)=>e.createElement(A,{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(R,n):e.createElement(l,{basename:o+n.baseURL},e.createElement(j,{themeName:m&&m.themeName,theme:m&&m.theme},e.createElement(s,null,e.createElement(c,{path:"*",element:e.createElement(R,O({},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=z,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:l,contentStyle:s,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:l,style:{...s},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,U 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 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};
|
|
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.
|
|
3
|
+
"version": "2.0.8",
|
|
4
4
|
"description": "hyperDart frontend for dart development",
|
|
5
5
|
"author": "hyperDart",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,32 +18,33 @@
|
|
|
18
18
|
"dist/*.js"
|
|
19
19
|
],
|
|
20
20
|
"peerDependencies": {
|
|
21
|
-
"@mui/icons-material": "^6.0.0",
|
|
22
|
-
"@mui/material": "^6.0.0",
|
|
23
21
|
"@emotion/react": "^11.7.1",
|
|
24
22
|
"@emotion/styled": "^11.6.0",
|
|
23
|
+
"@mui/icons-material": "^6.0.0",
|
|
24
|
+
"@mui/material": "^6.0.0",
|
|
25
25
|
"react": ">=18.0.0",
|
|
26
26
|
"react-dom": ">=18.0.0",
|
|
27
27
|
"react-router-dom": "^6.0.0 || ^7.0.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@
|
|
31
|
-
"@
|
|
30
|
+
"@babel/core": "^7.26.0",
|
|
31
|
+
"@babel/preset-env": "^7.26.0",
|
|
32
|
+
"@babel/preset-react": "^7.26.0",
|
|
32
33
|
"@emotion/react": "^11.7.1",
|
|
33
34
|
"@emotion/styled": "^11.6.0",
|
|
35
|
+
"@mui/icons-material": "^6.0.0",
|
|
36
|
+
"@mui/material": "^6.0.0",
|
|
34
37
|
"@rollup/plugin-babel": "^6.0.4",
|
|
35
38
|
"@rollup/plugin-commonjs": "^26.0.1",
|
|
36
39
|
"@rollup/plugin-node-resolve": "^15.2.4",
|
|
37
40
|
"@rollup/plugin-replace": "^5.0.2",
|
|
41
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
42
|
+
"postcss": "^8.5.8",
|
|
38
43
|
"react": ">=18.0.0",
|
|
39
44
|
"react-dom": ">=18.0.0",
|
|
40
45
|
"react-router-dom": "^6.0.0 || ^7.0.0",
|
|
41
46
|
"rollup": "^4.22.4",
|
|
42
47
|
"rollup-plugin-postcss": "^4.0.2",
|
|
43
|
-
"@rollup/plugin-terser": "^0.4.4",
|
|
44
|
-
"@babel/core": "^7.26.0",
|
|
45
|
-
"@babel/preset-react": "^7.26.0",
|
|
46
|
-
"@babel/preset-env": "^7.26.0",
|
|
47
48
|
"rollup-plugin-visualizer": "^5.14.0"
|
|
48
49
|
}
|
|
49
50
|
}
|