@hyperdart/frontend 1.0.4 → 1.0.5
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 -167
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
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 r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=r(e);function s(){return s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},s.apply(this,arguments)}!function(e,t){void 0===t&&(t={});var a=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===a&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.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
|
|
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 r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=r(e);function s(){return s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},s.apply(this,arguments)}!function(e,t){void 0===t&&(t={});var a=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===a&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.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 l={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(l[this.state.themeName])}componentDidUpdate(e){this.props.themeName!==e.themeName&&(this.theme=a.createTheme(l[this.props.themeName]),this.setState({themeName:this.props.themeName}))}render(){return n.default.createElement(a.ThemeProvider,{theme:this.theme},this.props.children)}}exports.styles={test:"styles-module_test__1m8-E"},exports.themes=l,exports.withHD=a=>r=>{let{quickPanel:l,basename:o,...m}=r?{...r}:{};return l=l||!0,o=o||"",m.search=m.search||(e=>console.log("New query = ",e)),n.default.createElement(e.Fragment,null,r.match?n.default.createElement(a,r):n.default.createElement(t.BrowserRouter,{basename:o},n.default.createElement(i,{themeName:r.UIOptions?.themeName},n.default.createElement(t.Switch,null,n.default.createElement(t.Route,{path:r.baseURL,exact:!0,render:e=>n.default.createElement(a,s({},e,r,{quickPanel:l}))}),n.default.createElement(t.Route,{path:r.baseURL,render:e=>n.default.createElement(a,s({},e,r,{quickPanel:!1}))})))))};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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 {
|
|
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 { ThemeProvider, 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\tif (this.props.themeName !== prevProps.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\treturn (\n\t\t\t<ThemeProvider theme={this.theme}>\n\t\t\t\t{this.props.children}\n\t\t\t</ThemeProvider>\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\t// console.log('withHD props =', 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","setState","render","React","ThemeProvider","children","Comp","quickPanel","basename","propsCopy","search","query","console","log","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,YAAYR,SAASW,eAAed,2cCvB9C,MAAMe,EAAS,CACdC,QAAS,CACRC,QAAS,CACRT,KAAM,SAEPU,WAAY,CAAEC,iBAAiB,IAEhCC,MAAO,CACNH,QAAS,CACRI,QAAS,CACRC,KAAM,WAEPC,UAAW,CACVD,KAAM,WAEPd,KAAM,SAEPU,WAAY,CAAEC,iBAAiB,IAEhCK,KAAM,CACLP,QAAS,CACRI,QAAS,CACRC,KAAM,WAEPC,UAAW,CACVD,KAAM,WAEPd,KAAM,QAEPU,WAAY,CAAEC,iBAAiB,IAEhCM,UAAW,CACVR,QAAS,CACRI,QAAS,CACRC,KAAM,WAEPd,KAAM,OAC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AO/B,EAAjB,CAAwBe,YAAY"}
|
package/dist/index.modern.js
CHANGED
|
@@ -1,168 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { BrowserRouter, Switch, Route } from 'react-router-dom';
|
|
3
|
-
import { createTheme, MuiThemeProvider } from '@material-ui/core/styles';
|
|
4
|
-
|
|
5
|
-
function styleInject(css, ref) {
|
|
6
|
-
if ( ref === void 0 ) ref = {};
|
|
7
|
-
var insertAt = ref.insertAt;
|
|
8
|
-
|
|
9
|
-
if (!css || typeof document === 'undefined') { return; }
|
|
10
|
-
|
|
11
|
-
var head = document.head || document.getElementsByTagName('head')[0];
|
|
12
|
-
var style = document.createElement('style');
|
|
13
|
-
style.type = 'text/css';
|
|
14
|
-
|
|
15
|
-
if (insertAt === 'top') {
|
|
16
|
-
if (head.firstChild) {
|
|
17
|
-
head.insertBefore(style, head.firstChild);
|
|
18
|
-
} else {
|
|
19
|
-
head.appendChild(style);
|
|
20
|
-
}
|
|
21
|
-
} else {
|
|
22
|
-
head.appendChild(style);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
if (style.styleSheet) {
|
|
26
|
-
style.styleSheet.cssText = css;
|
|
27
|
-
} else {
|
|
28
|
-
style.appendChild(document.createTextNode(css));
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
var css_248z = "/* 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";
|
|
33
|
-
var styles_module = {"test":"styles-module_test__1m8-E"};
|
|
34
|
-
styleInject(css_248z);
|
|
35
|
-
|
|
36
|
-
function _extends() {
|
|
37
|
-
_extends = Object.assign || function (target) {
|
|
38
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
39
|
-
var source = arguments[i];
|
|
40
|
-
|
|
41
|
-
for (var key in source) {
|
|
42
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
43
|
-
target[key] = source[key];
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return target;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
return _extends.apply(this, arguments);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const themes = {
|
|
55
|
-
default: {
|
|
56
|
-
palette: {
|
|
57
|
-
type: 'light'
|
|
58
|
-
},
|
|
59
|
-
typography: {
|
|
60
|
-
useNextVariants: true
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
light: {
|
|
64
|
-
palette: {
|
|
65
|
-
primary: {
|
|
66
|
-
main: '#F05F40'
|
|
67
|
-
},
|
|
68
|
-
secondary: {
|
|
69
|
-
main: '#40f0bb'
|
|
70
|
-
},
|
|
71
|
-
type: 'light'
|
|
72
|
-
},
|
|
73
|
-
typography: {
|
|
74
|
-
useNextVariants: true
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
dark: {
|
|
78
|
-
palette: {
|
|
79
|
-
primary: {
|
|
80
|
-
main: '#F05F40'
|
|
81
|
-
},
|
|
82
|
-
secondary: {
|
|
83
|
-
main: '#40f0bb'
|
|
84
|
-
},
|
|
85
|
-
type: 'dark'
|
|
86
|
-
},
|
|
87
|
-
typography: {
|
|
88
|
-
useNextVariants: true
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
lightsOut: {
|
|
92
|
-
palette: {
|
|
93
|
-
primary: {
|
|
94
|
-
main: '#F05F40'
|
|
95
|
-
},
|
|
96
|
-
type: 'dark',
|
|
97
|
-
background: {
|
|
98
|
-
default: '#000',
|
|
99
|
-
paper: '#000'
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
shadows: Array(25).fill('0px 4px 12px #888888'),
|
|
103
|
-
typography: {
|
|
104
|
-
useNextVariants: true
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
class HDTheme extends Component {
|
|
110
|
-
constructor(props) {
|
|
111
|
-
super(props);
|
|
112
|
-
this.state = {
|
|
113
|
-
themeName: props.themeName || 'light'
|
|
114
|
-
};
|
|
115
|
-
this.theme = createTheme(themes[this.state.themeName]);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
componentDidUpdate(prevProps) {
|
|
119
|
-
if (this.props.themeName !== prevProps.themeName) {
|
|
120
|
-
this.theme = createTheme(themes[this.props.themeName]);
|
|
121
|
-
this.setState({
|
|
122
|
-
themeName: this.props.themeName
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
render() {
|
|
128
|
-
return /*#__PURE__*/React.createElement(MuiThemeProvider, {
|
|
129
|
-
theme: this.theme
|
|
130
|
-
}, this.props.children);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
var withHD = (Comp => props => {
|
|
136
|
-
let {
|
|
137
|
-
quickPanel,
|
|
138
|
-
basename,
|
|
139
|
-
...propsCopy
|
|
140
|
-
} = props ? { ...props
|
|
141
|
-
} : {};
|
|
142
|
-
quickPanel = quickPanel || true;
|
|
143
|
-
basename = basename || ''; // propsCopy.search = (query) => this.props.history.push('/web/search?q=' + decodeURIComponent(query)
|
|
144
|
-
|
|
145
|
-
propsCopy.search = propsCopy.search || (query => console.log('New query = ', query)); // props_copy.query = props_copy.query || props_copy.searchData?.query || ''
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
console.log('props in withHD', propsCopy);
|
|
149
|
-
return /*#__PURE__*/React.createElement(Fragment, null, props.match ? /*#__PURE__*/React.createElement(Comp, props) : /*#__PURE__*/React.createElement(BrowserRouter, {
|
|
150
|
-
basename: basename
|
|
151
|
-
}, /*#__PURE__*/React.createElement(HDTheme, {
|
|
152
|
-
themeName: props.UIOptions?.themeName
|
|
153
|
-
}, /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(Route, {
|
|
154
|
-
path: props.baseURL,
|
|
155
|
-
exact: true,
|
|
156
|
-
render: p => /*#__PURE__*/React.createElement(Comp, _extends({}, p, props, {
|
|
157
|
-
quickPanel: quickPanel
|
|
158
|
-
}))
|
|
159
|
-
}), /*#__PURE__*/React.createElement(Route, {
|
|
160
|
-
path: props.baseURL,
|
|
161
|
-
render: p => /*#__PURE__*/React.createElement(Comp, _extends({}, p, props, {
|
|
162
|
-
quickPanel: false
|
|
163
|
-
}))
|
|
164
|
-
})))));
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
export { styles_module as styles, themes, withHD };
|
|
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 m,ThemeProvider as i}from"@material-ui/core/styles";var l={test:"styles-module_test__1m8-E"};function o(){return o=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},o.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=m(p[this.state.themeName])}componentDidUpdate(e){this.props.themeName!==e.themeName&&(this.theme=m(p[this.props.themeName]),this.setState({themeName:this.props.themeName}))}render(){return e.createElement(i,{theme:this.theme},this.props.children)}}var d=a=>m=>{let{quickPanel:i,basename:l,...p}=m?{...m}:{};return i=i||!0,l=l||"",p.search=p.search||(e=>console.log("New query = ",e)),e.createElement(t,null,m.match?e.createElement(a,m):e.createElement(n,{basename:l},e.createElement(h,{themeName:m.UIOptions?.themeName},e.createElement(r,null,e.createElement(s,{path:m.baseURL,exact:!0,render:t=>e.createElement(a,o({},t,m,{quickPanel:i}))}),e.createElement(s,{path:m.baseURL,render:t=>e.createElement(a,o({},t,m,{quickPanel:!1}))})))))};export{l as styles,p as themes,d as withHD};
|
|
168
2
|
//# sourceMappingURL=index.modern.js.map
|
package/dist/index.modern.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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 {
|
|
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 { ThemeProvider, 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\tif (this.props.themeName !== prevProps.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\treturn (\n\t\t\t<ThemeProvider theme={this.theme}>\n\t\t\t\t{this.props.children}\n\t\t\t</ThemeProvider>\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\t// console.log('withHD props =', 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","setState","render","React","ThemeProvider","children","withHD","Comp","quickPanel","basename","propsCopy","search","query","console","log","Fragment","match","BrowserRouter","UIOptions","Switch","Route","path","baseURL","exact","p"],"mappings":"+bAAA,SAAqBA,EAAKC,QACX,IAARA,IAAiBA,EAAM,IAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAKF,GAA2B,oBAAbG,SAA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