2018-11-22 02:18:19 +01:00
|
|
|
import createReactClass from 'create-react-class';
|
|
|
|
import React from 'react';
|
2018-07-27 12:37:13 -04:00
|
|
|
import CMS, { init } from 'netlify-cms-core/src';
|
2018-07-23 23:40:48 -04:00
|
|
|
import './backends';
|
|
|
|
import './widgets';
|
|
|
|
import './editor-components';
|
2018-08-30 16:24:28 -04:00
|
|
|
import './media-libraries';
|
2018-07-27 12:25:35 -04:00
|
|
|
|
2018-11-22 02:18:19 +01:00
|
|
|
/**
|
|
|
|
* Load Netlify CMS automatically if `window.CMS_MANUAL_INIT` is set.
|
|
|
|
*/
|
|
|
|
if (!window.CMS_MANUAL_INIT) {
|
|
|
|
init();
|
|
|
|
} else {
|
|
|
|
console.log('`window.CMS_MANUAL_INIT` flag set, skipping automatic initialization.');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Add extension hooks to global scope.
|
|
|
|
*/
|
|
|
|
if (typeof window !== 'undefined') {
|
|
|
|
window.CMS = CMS;
|
|
|
|
window.initCMS = init;
|
|
|
|
window.createClass = window.createClass || createReactClass;
|
|
|
|
window.h = window.h || React.createElement;
|
|
|
|
}
|
|
|
|
|
2018-07-27 12:25:35 -04:00
|
|
|
export { CMS as default, init };
|