@hyperdart/frontend 1.0.2 → 1.0.3
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.js.map +1 -1
- package/dist/index.modern.js +1 -1
- package/dist/index.modern.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("react-router-dom"),a=require("@material-ui/core/styles");function
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("react-router-dom"),a=require("@material-ui/core/styles");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=n(e);function s(){return s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},s.apply(this,arguments)}!function(e,t){void 0===t&&(t={});var a=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===a&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}("/* add css module styles here (optional) */\nhtml, body {\n\tmargin: 0;\n\tpadding: 0;\n\theight: 100%;\n\twidth: 100%;\n\tposition: fixed;\n\toverflow: hidden;\n\tfont-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;\n }\n \n.styles-module_test__1m8-E {\n margin: 2em;\n padding: 0.5em;\n border: 2px solid #000;\n font-size: 2em;\n text-align: center;\n}\n");const o={default:{palette:{type:"light"},typography:{useNextVariants:!0}},light:{palette:{primary:{main:"#F05F40"},secondary:{main:"#40f0bb"},type:"light"},typography:{useNextVariants:!0}},dark:{palette:{primary:{main:"#F05F40"},secondary:{main:"#40f0bb"},type:"dark"},typography:{useNextVariants:!0}},lightsOut:{palette:{primary:{main:"#F05F40"},type:"dark",background:{default:"#000",paper:"#000"}},shadows:Array(25).fill("0px 4px 12px #888888"),typography:{useNextVariants:!0}}};class i extends e.Component{constructor(e){super(e),this.state={themeName:e.themeName||"light"},this.theme=a.createTheme(o[this.state.themeName])}componentDidUpdate(e){console.log("did update"),this.props.themeName!==e.themeName&&(console.log("did update - new theme",this.props.themeName),this.theme=a.createTheme(o[this.props.themeName]),this.setState({themeName:this.props.themeName}))}render(){return console.log("rendering",this.state.themeName,this.theme.shadows[1]),r.default.createElement(a.MuiThemeProvider,{theme:this.theme},this.props.children)}}exports.styles={test:"styles-module_test__1m8-E"},exports.themes=o,exports.withHD=a=>n=>{let{quickPanel:o,basename:l,...m}=n?{...n}:{};return o=o||!0,l=l||"",m.search=m.search||(e=>console.log("New query = ",e)),console.log("props in withHD",m),r.default.createElement(e.Fragment,null,n.match?r.default.createElement(a,n):r.default.createElement(t.BrowserRouter,{basename:l},r.default.createElement(i,{themeName:n.UIOptions?.themeName},r.default.createElement(t.Switch,null,r.default.createElement(t.Route,{path:n.baseURL,exact:!0,render:e=>r.default.createElement(a,s({},e,n,{quickPanel:o}))}),r.default.createElement(t.Route,{path:n.baseURL,render:e=>r.default.createElement(a,s({},e,n,{quickPanel:!1}))})))))};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/themes.js","../src/withHD.js"],"sourcesContent":["const themes = {\n\tdefault: {\n\t\tpalette: {\n\t\t\ttype: 'light',\n\t\t},\n\t\ttypography: { useNextVariants: true },\n\t},\n\tlight: {\n\t\tpalette: {\n\t\t\tprimary: {\n\t\t\t\tmain: '#F05F40'\n\t\t\t},\n\t\t\tsecondary: {\n\t\t\t\tmain: '#40f0bb'\n\t\t\t},\n\t\t\ttype: 'light',\n\t\t},\n\t\ttypography: { useNextVariants: true },\n\t},\n\tdark: {\n\t\tpalette: {\n\t\t\tprimary: {\n\t\t\t\tmain: '#F05F40'\n\t\t\t},\n\t\t\tsecondary: {\n\t\t\t\tmain: '#40f0bb'\n\t\t\t},\n\t\t\ttype: 'dark',\n\t\t},\n\t\ttypography: { useNextVariants: true },\n\t},\n\tlightsOut: {\n\t\tpalette: {\n\t\t\tprimary: {\n\t\t\t\tmain: '#F05F40'\n \t\t},\n\t\t\ttype: 'dark',\n\t\t\tbackground: {\n\t\t\t\tdefault: '#000',\n\t\t\t\tpaper: '#000'\n\t\t\t}\n\t\t},\n\t\tshadows: Array(25).fill('0px 4px 12px #888888'),\n\t\ttypography: { useNextVariants: true },\n\t}\n}\n\nexport default themes;\n","import React, {Fragment, Component} from 'react'\nimport { BrowserRouter, Route, Switch } from 'react-router-dom';\nimport { MuiThemeProvider, createTheme } from '@material-ui/core/styles'\nimport themes from './themes'\n\nclass HDTheme extends Component {\n\tconstructor(props) {\n\t\tsuper(props)\n\t\tthis.state = {\n\t\t\tthemeName: props.themeName || 'light'\n\t\t};\n\t\tthis.theme = createTheme(themes[this.state.themeName])\n\t}\n\tcomponentDidUpdate(prevProps) {\n\t\tconsole.log('did update')\n\t\tif (this.props.themeName !== prevProps.themeName) {\n\t\t\tconsole.log('did update - new theme', this.props.themeName)\n\t\t\tthis.theme = createTheme(themes[this.props.themeName])\n\t\t\tthis.setState({themeName: this.props.themeName})\n\t\t}\n\t}\n\trender() {\n\t\tconsole.log('rendering', this.state.themeName, this.theme.shadows[1])\n\t\treturn (\n\t\t\t<MuiThemeProvider theme={this.theme}>\n\t\t\t\t{this.props.children}\n\t\t\t</MuiThemeProvider>\n\t\t)\n\t}\n}\n\n\nexport default (Comp) => (props) => {\n\tlet {quickPanel, basename, ...propsCopy} = props ? {...props} : {}\n\tquickPanel = quickPanel || true\n\tbasename = basename || ''\n\t// propsCopy.search = (query) => this.props.history.push('/web/search?q=' + decodeURIComponent(query)\n\tpropsCopy.search = propsCopy.search || ((query) => console.log('New query = ', query))\n\t// props_copy.query = props_copy.query || props_copy.searchData?.query || ''\n\tconsole.log('props in withHD', propsCopy)\n\treturn (\n\t\t<Fragment>\n\t\t{ props.match ?\n\t\t\t(\n\t\t\t\t<Comp {...props} />\n\t\t\t)\n\t\t\t:\n\t\t\t(\n\t\t\t\t<BrowserRouter basename={basename}>\n\t\t\t\t<HDTheme themeName={props.UIOptions?.themeName}>\n\t\t\t\t\t<Switch>\n\t\t\t\t\t\t<Route path={props.baseURL} exact render={(p) => <Comp {...p} {...props} quickPanel={quickPanel}/> }/>\n\t\t\t\t\t\t<Route path={props.baseURL} render={(p) => <Comp {...p} {...props} quickPanel={false} /> }/>\n\t\t\t\t\t</Switch>\n\t\t\t\t</HDTheme>\n\t\t\t\t</BrowserRouter>\n\t\t\t)\n\t\t}\n\t\t</Fragment>\n\t)\n}"],"names":["
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../node_modules/style-inject/dist/style-inject.es.js","../src/themes.js","../src/withHD.js"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","const themes = {\n\tdefault: {\n\t\tpalette: {\n\t\t\ttype: 'light',\n\t\t},\n\t\ttypography: { useNextVariants: true },\n\t},\n\tlight: {\n\t\tpalette: {\n\t\t\tprimary: {\n\t\t\t\tmain: '#F05F40'\n\t\t\t},\n\t\t\tsecondary: {\n\t\t\t\tmain: '#40f0bb'\n\t\t\t},\n\t\t\ttype: 'light',\n\t\t},\n\t\ttypography: { useNextVariants: true },\n\t},\n\tdark: {\n\t\tpalette: {\n\t\t\tprimary: {\n\t\t\t\tmain: '#F05F40'\n\t\t\t},\n\t\t\tsecondary: {\n\t\t\t\tmain: '#40f0bb'\n\t\t\t},\n\t\t\ttype: 'dark',\n\t\t},\n\t\ttypography: { useNextVariants: true },\n\t},\n\tlightsOut: {\n\t\tpalette: {\n\t\t\tprimary: {\n\t\t\t\tmain: '#F05F40'\n \t\t},\n\t\t\ttype: 'dark',\n\t\t\tbackground: {\n\t\t\t\tdefault: '#000',\n\t\t\t\tpaper: '#000'\n\t\t\t}\n\t\t},\n\t\tshadows: Array(25).fill('0px 4px 12px #888888'),\n\t\ttypography: { useNextVariants: true },\n\t}\n}\n\nexport default themes;\n","import React, {Fragment, Component} from 'react'\nimport { BrowserRouter, Route, Switch } from 'react-router-dom';\nimport { MuiThemeProvider, createTheme } from '@material-ui/core/styles'\nimport themes from './themes'\n\nclass HDTheme extends Component {\n\tconstructor(props) {\n\t\tsuper(props)\n\t\tthis.state = {\n\t\t\tthemeName: props.themeName || 'light'\n\t\t};\n\t\tthis.theme = createTheme(themes[this.state.themeName])\n\t}\n\tcomponentDidUpdate(prevProps) {\n\t\tconsole.log('did update')\n\t\tif (this.props.themeName !== prevProps.themeName) {\n\t\t\tconsole.log('did update - new theme', this.props.themeName)\n\t\t\tthis.theme = createTheme(themes[this.props.themeName])\n\t\t\tthis.setState({themeName: this.props.themeName})\n\t\t}\n\t}\n\trender() {\n\t\tconsole.log('rendering', this.state.themeName, this.theme.shadows[1])\n\t\treturn (\n\t\t\t<MuiThemeProvider theme={this.theme}>\n\t\t\t\t{this.props.children}\n\t\t\t</MuiThemeProvider>\n\t\t)\n\t}\n}\n\n\nexport default (Comp) => (props) => {\n\tlet {quickPanel, basename, ...propsCopy} = props ? {...props} : {}\n\tquickPanel = quickPanel || true\n\tbasename = basename || ''\n\t// propsCopy.search = (query) => this.props.history.push('/web/search?q=' + decodeURIComponent(query)\n\tpropsCopy.search = propsCopy.search || ((query) => console.log('New query = ', query))\n\t// props_copy.query = props_copy.query || props_copy.searchData?.query || ''\n\tconsole.log('props in withHD', propsCopy)\n\treturn (\n\t\t<Fragment>\n\t\t{ props.match ?\n\t\t\t(\n\t\t\t\t<Comp {...props} />\n\t\t\t)\n\t\t\t:\n\t\t\t(\n\t\t\t\t<BrowserRouter basename={basename}>\n\t\t\t\t<HDTheme themeName={props.UIOptions?.themeName}>\n\t\t\t\t\t<Switch>\n\t\t\t\t\t\t<Route path={props.baseURL} exact render={(p) => <Comp {...p} {...props} quickPanel={quickPanel}/> }/>\n\t\t\t\t\t\t<Route path={props.baseURL} render={(p) => <Comp {...p} {...props} quickPanel={false} /> }/>\n\t\t\t\t\t</Switch>\n\t\t\t\t</HDTheme>\n\t\t\t\t</BrowserRouter>\n\t\t\t)\n\t\t}\n\t\t</Fragment>\n\t)\n}"],"names":["css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","themes","default","palette","typography","useNextVariants","light","primary","main","secondary","dark","lightsOut","background","paper","shadows","Array","fill","HDTheme","Component","constructor","props","super","this","state","themeName","theme","createTheme","componentDidUpdate","prevProps","console","log","setState","render","React","MuiThemeProvider","children","Comp","quickPanel","basename","propsCopy","search","query","Fragment","match","BrowserRouter","UIOptions","Switch","Route","path","baseURL","exact","p"],"mappings":"mcAAA,SAAqBA,EAAKC,QACX,IAARA,IAAiBA,EAAM,IAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAKF,GAA2B,oBAAbG,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ,GAC9DC,EAAQH,SAASI,cAAc,SACnCD,EAAME,KAAO,WAEI,QAAbN,GACEE,EAAKK,WACPL,EAAKM,aAAaJ,EAAOF,EAAKK,YAKhCL,EAAKO,YAAYL,GAGfA,EAAMM,WACRN,EAAMM,WAAWC,QAAUb,EAE3BM,EAAMK,YAAY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C,IAAI,eAAgBW,IAE/EZ,QAAQC,IAAI,kBAAmBS,GAE9BN,EAAC,QAAAxC,cAAAiD,EAADA,SACEtB,KAAAA,EAAMuB,MAENV,EAAC,QAAAxC,cAAA2C,EAAShB,GAIVa,EAAAA,sBAACW,EAAAA,cAAD,CAAeN,SAAUA,GACzBL,wBAAChB,EAAD,CAASO,UAAWJ,EAAMyB,WAAWrB,WACpCS,EAAAA,QAACxC,cAAAqD,EAADA,OACC,KAAAb,EAAA,QAAAxC,cAACsD,QAAD,CAAOC,KAAM5B,EAAM6B,QAASC,OAA5B,EAAkClB,OAASmB,GAAMlB,EAAAA,QAAAxC,cAAC2C,EAASe,EAAAA,GAAAA,EAAO/B,EAAjB,CAAwBiB,WAAYA,OACrFJ,EAAAA,sBAACc,QAAD,CAAOC,KAAM5B,EAAM6B,QAASjB,OAASmB,GAAMlB,EAAAA,QAAAxC,cAAC2C,EAASe,EAAAA,GAAAA,EAAO/B,EAAjB,CAAwBiB,YAAY"}
|
package/dist/index.modern.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e,{Fragment as t,Component as a}from"react";import{BrowserRouter as
|
|
1
|
+
import e,{Fragment as t,Component as a}from"react";import{BrowserRouter as n,Switch as r,Route as s}from"react-router-dom";import{createTheme as o,MuiThemeProvider as i}from"@material-ui/core/styles";var m={test:"styles-module_test__1m8-E"};function l(){return l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},l.apply(this,arguments)}!function(e,t){void 0===t&&(t={});var a=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===a&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}("/* add css module styles here (optional) */\nhtml, body {\n\tmargin: 0;\n\tpadding: 0;\n\theight: 100%;\n\twidth: 100%;\n\tposition: fixed;\n\toverflow: hidden;\n\tfont-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;\n }\n \n.styles-module_test__1m8-E {\n margin: 2em;\n padding: 0.5em;\n border: 2px solid #000;\n font-size: 2em;\n text-align: center;\n}\n");const p={default:{palette:{type:"light"},typography:{useNextVariants:!0}},light:{palette:{primary:{main:"#F05F40"},secondary:{main:"#40f0bb"},type:"light"},typography:{useNextVariants:!0}},dark:{palette:{primary:{main:"#F05F40"},secondary:{main:"#40f0bb"},type:"dark"},typography:{useNextVariants:!0}},lightsOut:{palette:{primary:{main:"#F05F40"},type:"dark",background:{default:"#000",paper:"#000"}},shadows:Array(25).fill("0px 4px 12px #888888"),typography:{useNextVariants:!0}}};class h extends a{constructor(e){super(e),this.state={themeName:e.themeName||"light"},this.theme=o(p[this.state.themeName])}componentDidUpdate(e){console.log("did update"),this.props.themeName!==e.themeName&&(console.log("did update - new theme",this.props.themeName),this.theme=o(p[this.props.themeName]),this.setState({themeName:this.props.themeName}))}render(){return console.log("rendering",this.state.themeName,this.theme.shadows[1]),e.createElement(i,{theme:this.theme},this.props.children)}}var d=a=>o=>{let{quickPanel:i,basename:m,...p}=o?{...o}:{};return i=i||!0,m=m||"",p.search=p.search||(e=>console.log("New query = ",e)),console.log("props in withHD",p),e.createElement(t,null,o.match?e.createElement(a,o):e.createElement(n,{basename:m},e.createElement(h,{themeName:o.UIOptions?.themeName},e.createElement(r,null,e.createElement(s,{path:o.baseURL,exact:!0,render:t=>e.createElement(a,l({},t,o,{quickPanel:i}))}),e.createElement(s,{path:o.baseURL,render:t=>e.createElement(a,l({},t,o,{quickPanel:!1}))})))))};export{m as styles,p as themes,d as withHD};
|
|
2
2
|
//# sourceMappingURL=index.modern.js.map
|
package/dist/index.modern.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.modern.js","sources":["../src/themes.js","../src/withHD.js"],"sourcesContent":["const themes = {\n\tdefault: {\n\t\tpalette: {\n\t\t\ttype: 'light',\n\t\t},\n\t\ttypography: { useNextVariants: true },\n\t},\n\tlight: {\n\t\tpalette: {\n\t\t\tprimary: {\n\t\t\t\tmain: '#F05F40'\n\t\t\t},\n\t\t\tsecondary: {\n\t\t\t\tmain: '#40f0bb'\n\t\t\t},\n\t\t\ttype: 'light',\n\t\t},\n\t\ttypography: { useNextVariants: true },\n\t},\n\tdark: {\n\t\tpalette: {\n\t\t\tprimary: {\n\t\t\t\tmain: '#F05F40'\n\t\t\t},\n\t\t\tsecondary: {\n\t\t\t\tmain: '#40f0bb'\n\t\t\t},\n\t\t\ttype: 'dark',\n\t\t},\n\t\ttypography: { useNextVariants: true },\n\t},\n\tlightsOut: {\n\t\tpalette: {\n\t\t\tprimary: {\n\t\t\t\tmain: '#F05F40'\n \t\t},\n\t\t\ttype: 'dark',\n\t\t\tbackground: {\n\t\t\t\tdefault: '#000',\n\t\t\t\tpaper: '#000'\n\t\t\t}\n\t\t},\n\t\tshadows: Array(25).fill('0px 4px 12px #888888'),\n\t\ttypography: { useNextVariants: true },\n\t}\n}\n\nexport default themes;\n","import React, {Fragment, Component} from 'react'\nimport { BrowserRouter, Route, Switch } from 'react-router-dom';\nimport { MuiThemeProvider, createTheme } from '@material-ui/core/styles'\nimport themes from './themes'\n\nclass HDTheme extends Component {\n\tconstructor(props) {\n\t\tsuper(props)\n\t\tthis.state = {\n\t\t\tthemeName: props.themeName || 'light'\n\t\t};\n\t\tthis.theme = createTheme(themes[this.state.themeName])\n\t}\n\tcomponentDidUpdate(prevProps) {\n\t\tconsole.log('did update')\n\t\tif (this.props.themeName !== prevProps.themeName) {\n\t\t\tconsole.log('did update - new theme', this.props.themeName)\n\t\t\tthis.theme = createTheme(themes[this.props.themeName])\n\t\t\tthis.setState({themeName: this.props.themeName})\n\t\t}\n\t}\n\trender() {\n\t\tconsole.log('rendering', this.state.themeName, this.theme.shadows[1])\n\t\treturn (\n\t\t\t<MuiThemeProvider theme={this.theme}>\n\t\t\t\t{this.props.children}\n\t\t\t</MuiThemeProvider>\n\t\t)\n\t}\n}\n\n\nexport default (Comp) => (props) => {\n\tlet {quickPanel, basename, ...propsCopy} = props ? {...props} : {}\n\tquickPanel = quickPanel || true\n\tbasename = basename || ''\n\t// propsCopy.search = (query) => this.props.history.push('/web/search?q=' + decodeURIComponent(query)\n\tpropsCopy.search = propsCopy.search || ((query) => console.log('New query = ', query))\n\t// props_copy.query = props_copy.query || props_copy.searchData?.query || ''\n\tconsole.log('props in withHD', propsCopy)\n\treturn (\n\t\t<Fragment>\n\t\t{ props.match ?\n\t\t\t(\n\t\t\t\t<Comp {...props} />\n\t\t\t)\n\t\t\t:\n\t\t\t(\n\t\t\t\t<BrowserRouter basename={basename}>\n\t\t\t\t<HDTheme themeName={props.UIOptions?.themeName}>\n\t\t\t\t\t<Switch>\n\t\t\t\t\t\t<Route path={props.baseURL} exact render={(p) => <Comp {...p} {...props} quickPanel={quickPanel}/> }/>\n\t\t\t\t\t\t<Route path={props.baseURL} render={(p) => <Comp {...p} {...props} quickPanel={false} /> }/>\n\t\t\t\t\t</Switch>\n\t\t\t\t</HDTheme>\n\t\t\t\t</BrowserRouter>\n\t\t\t)\n\t\t}\n\t\t</Fragment>\n\t)\n}"],"names":["
|
|
1
|
+
{"version":3,"file":"index.modern.js","sources":["../node_modules/style-inject/dist/style-inject.es.js","../src/themes.js","../src/withHD.js"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","const themes = {\n\tdefault: {\n\t\tpalette: {\n\t\t\ttype: 'light',\n\t\t},\n\t\ttypography: { useNextVariants: true },\n\t},\n\tlight: {\n\t\tpalette: {\n\t\t\tprimary: {\n\t\t\t\tmain: '#F05F40'\n\t\t\t},\n\t\t\tsecondary: {\n\t\t\t\tmain: '#40f0bb'\n\t\t\t},\n\t\t\ttype: 'light',\n\t\t},\n\t\ttypography: { useNextVariants: true },\n\t},\n\tdark: {\n\t\tpalette: {\n\t\t\tprimary: {\n\t\t\t\tmain: '#F05F40'\n\t\t\t},\n\t\t\tsecondary: {\n\t\t\t\tmain: '#40f0bb'\n\t\t\t},\n\t\t\ttype: 'dark',\n\t\t},\n\t\ttypography: { useNextVariants: true },\n\t},\n\tlightsOut: {\n\t\tpalette: {\n\t\t\tprimary: {\n\t\t\t\tmain: '#F05F40'\n \t\t},\n\t\t\ttype: 'dark',\n\t\t\tbackground: {\n\t\t\t\tdefault: '#000',\n\t\t\t\tpaper: '#000'\n\t\t\t}\n\t\t},\n\t\tshadows: Array(25).fill('0px 4px 12px #888888'),\n\t\ttypography: { useNextVariants: true },\n\t}\n}\n\nexport default themes;\n","import React, {Fragment, Component} from 'react'\nimport { BrowserRouter, Route, Switch } from 'react-router-dom';\nimport { MuiThemeProvider, createTheme } from '@material-ui/core/styles'\nimport themes from './themes'\n\nclass HDTheme extends Component {\n\tconstructor(props) {\n\t\tsuper(props)\n\t\tthis.state = {\n\t\t\tthemeName: props.themeName || 'light'\n\t\t};\n\t\tthis.theme = createTheme(themes[this.state.themeName])\n\t}\n\tcomponentDidUpdate(prevProps) {\n\t\tconsole.log('did update')\n\t\tif (this.props.themeName !== prevProps.themeName) {\n\t\t\tconsole.log('did update - new theme', this.props.themeName)\n\t\t\tthis.theme = createTheme(themes[this.props.themeName])\n\t\t\tthis.setState({themeName: this.props.themeName})\n\t\t}\n\t}\n\trender() {\n\t\tconsole.log('rendering', this.state.themeName, this.theme.shadows[1])\n\t\treturn (\n\t\t\t<MuiThemeProvider theme={this.theme}>\n\t\t\t\t{this.props.children}\n\t\t\t</MuiThemeProvider>\n\t\t)\n\t}\n}\n\n\nexport default (Comp) => (props) => {\n\tlet {quickPanel, basename, ...propsCopy} = props ? {...props} : {}\n\tquickPanel = quickPanel || true\n\tbasename = basename || ''\n\t// propsCopy.search = (query) => this.props.history.push('/web/search?q=' + decodeURIComponent(query)\n\tpropsCopy.search = propsCopy.search || ((query) => console.log('New query = ', query))\n\t// props_copy.query = props_copy.query || props_copy.searchData?.query || ''\n\tconsole.log('props in withHD', propsCopy)\n\treturn (\n\t\t<Fragment>\n\t\t{ props.match ?\n\t\t\t(\n\t\t\t\t<Comp {...props} />\n\t\t\t)\n\t\t\t:\n\t\t\t(\n\t\t\t\t<BrowserRouter basename={basename}>\n\t\t\t\t<HDTheme themeName={props.UIOptions?.themeName}>\n\t\t\t\t\t<Switch>\n\t\t\t\t\t\t<Route path={props.baseURL} exact render={(p) => <Comp {...p} {...props} quickPanel={quickPanel}/> }/>\n\t\t\t\t\t\t<Route path={props.baseURL} render={(p) => <Comp {...p} {...props} quickPanel={false} /> }/>\n\t\t\t\t\t</Switch>\n\t\t\t\t</HDTheme>\n\t\t\t\t</BrowserRouter>\n\t\t\t)\n\t\t}\n\t\t</Fragment>\n\t)\n}"],"names":["css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","themes","default","palette","typography","useNextVariants","light","primary","main","secondary","dark","lightsOut","background","paper","shadows","Array","fill","HDTheme","Component","constructor","props","super","this","state","themeName","theme","createTheme","componentDidUpdate","prevProps","console","log","setState","render","React","MuiThemeProvider","children","withHD","Comp","quickPanel","basename","propsCopy","search","query","Fragment","match","BrowserRouter","UIOptions","Switch","Route","path","baseURL","exact","p"],"mappings":"kcAAA,SAAqBA,EAAKC,QACX,IAARA,IAAiBA,EAAM,IAC5B,IAAIC,EAAWD,EAAI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KAAKG,MAAMX,QAAQ,IAEjEmB,gBAACC,EAAD,CAAkBT,MAAOH,KAAKG,OAC5BH,KAAKF,MAAMe,WAOhB,IAAAC,EAAgBC,GAAUjB,IACzB,IAAIkB,WAACA,EAADC,SAAaA,KAAaC,GAAapB,EAAQ,IAAIA,GAAS,GAOhE,OANAkB,EAAaA,IAAc,EAC3BC,EAAWA,GAAY,GAEvBC,EAAUC,OAASD,EAAUC,QAAYC,CAAAA,GAAUb,QAAQC,IAAI,eAAgBY,IAE/Eb,QAAQC,IAAI,kBAAmBU,GAE9BP,EAACxC,cAAAkD,EACCvB,KAAAA,EAAMwB,MAENX,EAACxC,cAAA4C,EAASjB,GAIVa,gBAACY,EAAD,CAAeN,SAAUA,GACzBN,gBAAChB,EAAD,CAASO,UAAWJ,EAAM0B,WAAWtB,WACpCS,EAACxC,cAAAsD,EACA,KAAAd,EAAAxC,cAACuD,EAAD,CAAOC,KAAM7B,EAAM8B,QAASC,OAA5B,EAAkCnB,OAASoB,GAAMnB,EAAAxC,cAAC4C,EAASe,EAAAA,GAAAA,EAAOhC,EAAjB,CAAwBkB,WAAYA,OACrFL,gBAACe,EAAD,CAAOC,KAAM7B,EAAM8B,QAASlB,OAASoB,GAAMnB,EAAAxC,cAAC4C,EAASe,EAAAA,GAAAA,EAAOhC,EAAjB,CAAwBkB,YAAY"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperdart/frontend",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "hyperDart frontend for dart development",
|
|
5
|
-
"author": "
|
|
5
|
+
"author": "hyperDart",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"module": "dist/index.modern.js",
|