-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathindex.js
More file actions
34 lines (31 loc) · 780 Bytes
/
index.js
File metadata and controls
34 lines (31 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import UXCore from 'uxcore';
import to from 'to-case';
import classnames from 'classnames';
import assign from 'object-assign';
import clipboard from 'react-clipboard.js';
const pkgMap = {
classnames,
'object-assign': assign,
'react-clipboard.js': clipboard,
};
window.require = (key) => {
let component = key;
if (key === 'uxcore') {
component = UXCore;
} else if (/uxcore-(.+)/.exec(key)) {
component = UXCore[to.pascal(key.split('-').slice(1).join('-'))];
} else if (key in pkgMap) {
component = pkgMap[key];
} else {
console.error(`${key} cannot match any package`);
}
return component;
};
/*
* init code highlighter
*/
$(() => {
require('./theme/js/navigation');
// require('./theme/js/setting');
require('./theme/js/doc');
});