diff --git a/packages/netlify-cms-core/src/index.js b/packages/netlify-cms-core/src/index.js index 36c4307f..a304f070 100644 --- a/packages/netlify-cms-core/src/index.js +++ b/packages/netlify-cms-core/src/index.js @@ -1,55 +1,8 @@ import bootstrap from './bootstrap'; -import { - registerPreviewStyle, - getPreviewStyles, - registerPreviewTemplate, - getPreviewTemplate, - registerWidget, - getWidget, - resolveWidget, - registerEditorComponent, - getEditorComponents, - registerWidgetValueSerializer, - getWidgetValueSerializer, - registerBackend, - getBackend, - registerMediaLibrary, - getMediaLibrary, -} from 'Lib/registry'; +import Registry from 'Lib/registry'; export const NetlifyCmsCore = { - registerPreviewStyle, - getPreviewStyles, - registerPreviewTemplate, - getPreviewTemplate, - registerWidget, - getWidget, - resolveWidget, - registerEditorComponent, - getEditorComponents, - registerWidgetValueSerializer, - getWidgetValueSerializer, - registerBackend, - getBackend, - registerMediaLibrary, - getMediaLibrary, + ...Registry, init: bootstrap, }; -export { - registerPreviewStyle, - getPreviewStyles, - registerPreviewTemplate, - getPreviewTemplate, - registerWidget, - getWidget, - resolveWidget, - registerEditorComponent, - getEditorComponents, - registerWidgetValueSerializer, - getWidgetValueSerializer, - registerBackend, - getBackend, - registerMediaLibrary, - getMediaLibrary, - bootstrap as init, -}; +export default NetlifyCmsCore; diff --git a/packages/netlify-cms-default-exports/src/index.js b/packages/netlify-cms-default-exports/src/index.js index 35864f85..3c5fe878 100644 --- a/packages/netlify-cms-default-exports/src/index.js +++ b/packages/netlify-cms-default-exports/src/index.js @@ -40,15 +40,3 @@ export const NetlifyCmsDefaultExports = { ReactDOM, UUId, }; -export { - EmotionCore, - EmotionStyled, - Immutable, - ImmutablePropTypes, - Lodash, - Moment, - PropTypes, - React, - ReactDOM, - UUId, -}; diff --git a/packages/netlify-cms-widget-boolean/src/index.js b/packages/netlify-cms-widget-boolean/src/index.js index a5634e66..b90dd3ed 100644 --- a/packages/netlify-cms-widget-boolean/src/index.js +++ b/packages/netlify-cms-widget-boolean/src/index.js @@ -1,3 +1,10 @@ import controlComponent from './BooleanControl'; -export const NetlifyCmsWidgetBoolean = { controlComponent }; -export { controlComponent }; + +const Widget = (opts = {}) => ({ + name: 'boolean', + controlComponent, + ...opts, +}); + +export const NetlifyCmsWidgetBoolean = { Widget, controlComponent }; +export default NetlifyCmsWidgetBoolean; diff --git a/packages/netlify-cms-widget-date/src/index.js b/packages/netlify-cms-widget-date/src/index.js index fb3d1883..b28ca92b 100644 --- a/packages/netlify-cms-widget-date/src/index.js +++ b/packages/netlify-cms-widget-date/src/index.js @@ -9,4 +9,4 @@ const Widget = (opts = {}) => ({ }); export const NetlifyCmsWidgetDate = { Widget, controlComponent, previewComponent }; -export { Widget as default, controlComponent, previewComponent }; +export default NetlifyCmsWidgetDate; diff --git a/packages/netlify-cms-widget-datetime/src/DateTimeControl.js b/packages/netlify-cms-widget-datetime/src/DateTimeControl.js index 9ca2c292..3d1b30cf 100644 --- a/packages/netlify-cms-widget-datetime/src/DateTimeControl.js +++ b/packages/netlify-cms-widget-datetime/src/DateTimeControl.js @@ -1,5 +1,7 @@ import React from 'react'; -import { controlComponent as DateControl } from 'netlify-cms-widget-date'; +import NetlifyCmsWidgetDate from 'netlify-cms-widget-date'; + +const DateControl = NetlifyCmsWidgetDate.controlComponent; export default class DateTimeControl extends React.Component { render() { diff --git a/packages/netlify-cms-widget-datetime/src/index.js b/packages/netlify-cms-widget-datetime/src/index.js index 01bb74bd..5c43c43d 100644 --- a/packages/netlify-cms-widget-datetime/src/index.js +++ b/packages/netlify-cms-widget-datetime/src/index.js @@ -1,6 +1,7 @@ import controlComponent from './DateTimeControl'; -import { previewComponent } from 'netlify-cms-widget-date'; +import NetlifyCmsWidgetDate from 'netlify-cms-widget-date'; +const previewComponent = NetlifyCmsWidgetDate.previewComponent; const Widget = (opts = {}) => ({ name: 'datetime', controlComponent, @@ -9,4 +10,4 @@ const Widget = (opts = {}) => ({ }); export const NetlifyCmsWidgetDatetime = { Widget, controlComponent, previewComponent }; -export { Widget as default, controlComponent, previewComponent }; +export default NetlifyCmsWidgetDatetime; diff --git a/packages/netlify-cms-widget-file/src/index.js b/packages/netlify-cms-widget-file/src/index.js index 42d382e1..ee28c2de 100644 --- a/packages/netlify-cms-widget-file/src/index.js +++ b/packages/netlify-cms-widget-file/src/index.js @@ -2,5 +2,12 @@ import withFileControl from './withFileControl'; import previewComponent from './FilePreview'; const controlComponent = withFileControl(); -export const NetlifyCmsWidgetFile = { controlComponent, previewComponent, withFileControl }; -export { controlComponent, previewComponent, withFileControl }; +const Widget = (opts = {}) => ({ + name: 'file', + controlComponent, + previewComponent, + ...opts, +}); + +export const NetlifyCmsWidgetFile = { Widget, controlComponent, previewComponent, withFileControl }; +export default NetlifyCmsWidgetFile; diff --git a/packages/netlify-cms-widget-image/src/index.js b/packages/netlify-cms-widget-image/src/index.js index 4f54db31..ade79a1c 100644 --- a/packages/netlify-cms-widget-image/src/index.js +++ b/packages/netlify-cms-widget-image/src/index.js @@ -1,6 +1,12 @@ -import { withFileControl } from 'netlify-cms-widget-file'; - -const controlComponent = withFileControl({ forImage: true }); +import NetlifyCmsWidgetFile from 'netlify-cms-widget-file'; import previewComponent from './ImagePreview'; -export const NetlifyCmsWidgetImage = { controlComponent, previewComponent }; -export { controlComponent, previewComponent }; + +const controlComponent = NetlifyCmsWidgetFile.withFileControl({ forImage: true }); +const Widget = (opts = {}) => ({ + name: 'image', + controlComponent, + ...opts, +}); + +export const NetlifyCmsWidgetImage = { Widget, controlComponent, previewComponent }; +export default NetlifyCmsWidgetImage; diff --git a/packages/netlify-cms-widget-list/src/ListControl.js b/packages/netlify-cms-widget-list/src/ListControl.js index 192df0d2..5c9748dd 100644 --- a/packages/netlify-cms-widget-list/src/ListControl.js +++ b/packages/netlify-cms-widget-list/src/ListControl.js @@ -7,7 +7,7 @@ import { jsx, css, ClassNames } from '@emotion/core'; import { List, Map } from 'immutable'; import { partial } from 'lodash'; import { SortableContainer, SortableElement, SortableHandle } from 'react-sortable-hoc'; -import { controlComponent as ObjectControl } from 'netlify-cms-widget-object'; +import NetlifyCmsWidgetObject from 'netlify-cms-widget-object'; import { TYPES_KEY, getTypedFieldForValue, @@ -20,6 +20,8 @@ function valueToString(value) { return value ? value.join(',').replace(/,([^\s]|$)/g, ', $1') : ''; } +const ObjectControl = NetlifyCmsWidgetObject.controlComponent; + const ListItem = styled.div(); const SortableListItem = SortableElement(ListItem); diff --git a/packages/netlify-cms-widget-list/src/index.js b/packages/netlify-cms-widget-list/src/index.js index 0821dfd8..4737a746 100644 --- a/packages/netlify-cms-widget-list/src/index.js +++ b/packages/netlify-cms-widget-list/src/index.js @@ -1,4 +1,13 @@ import controlComponent from './ListControl'; -import { previewComponent } from 'netlify-cms-widget-object'; -export const NetlifyCmsWidgetList = { controlComponent, previewComponent }; -export { controlComponent, previewComponent }; +import NetlifyCmsWidgetObject from 'netlify-cms-widget-object'; + +const previewComponent = NetlifyCmsWidgetObject.previewComponent; +const Widget = (opts = {}) => ({ + name: 'list', + controlComponent, + previewComponent, + ...opts, +}); + +export const NetlifyCmsWidgetList = { Widget, controlComponent, previewComponent }; +export default NetlifyCmsWidgetList; diff --git a/packages/netlify-cms-widget-map/src/index.js b/packages/netlify-cms-widget-map/src/index.js index 79fb26b1..bccf8501 100644 --- a/packages/netlify-cms-widget-map/src/index.js +++ b/packages/netlify-cms-widget-map/src/index.js @@ -1,6 +1,13 @@ import withMapControl from './withMapControl'; import previewComponent from './MapPreview'; -const controlComponent = withMapControl(); -export const NetlifyCmsWidgetMap = { controlComponent, previewComponent }; -export { controlComponent, previewComponent }; +const controlComponent = withMapControl(); +const Widget = (opts = {}) => ({ + name: 'map', + controlComponent, + previewComponent, + ...opts, +}); + +export const NetlifyCmsWidgetMap = { Widget, controlComponent, previewComponent }; +export default NetlifyCmsWidgetMap; diff --git a/packages/netlify-cms-widget-markdown/src/index.js b/packages/netlify-cms-widget-markdown/src/index.js index 92eb8147..8ea0f2bc 100644 --- a/packages/netlify-cms-widget-markdown/src/index.js +++ b/packages/netlify-cms-widget-markdown/src/index.js @@ -1,4 +1,12 @@ import controlComponent from './MarkdownControl'; import previewComponent from './MarkdownPreview'; -export const NetlifyCmsWidgetMarkdown = { controlComponent, previewComponent }; -export { controlComponent, previewComponent }; + +const Widget = (opts = {}) => ({ + name: 'markdown', + controlComponent, + previewComponent, + ...opts, +}); + +export const NetlifyCmsWidgetMarkdown = { Widget, controlComponent, previewComponent }; +export default NetlifyCmsWidgetMarkdown; diff --git a/packages/netlify-cms-widget-number/src/__tests__/number.spec.js b/packages/netlify-cms-widget-number/src/__tests__/number.spec.js index 716041f6..eb4afa6e 100644 --- a/packages/netlify-cms-widget-number/src/__tests__/number.spec.js +++ b/packages/netlify-cms-widget-number/src/__tests__/number.spec.js @@ -3,7 +3,9 @@ import { fromJS } from 'immutable'; import { render, fireEvent } from 'react-testing-library'; import 'react-testing-library/cleanup-after-each'; import 'jest-dom/extend-expect'; -import { controlComponent as NumberControl } from '../'; +import { NetlifyCmsWidgetNumber } from '../'; + +const NumberControl = NetlifyCmsWidgetNumber.controlComponent; const fieldSettings = { min: -20, diff --git a/packages/netlify-cms-widget-number/src/index.js b/packages/netlify-cms-widget-number/src/index.js index 3d8aa6ae..7865314a 100644 --- a/packages/netlify-cms-widget-number/src/index.js +++ b/packages/netlify-cms-widget-number/src/index.js @@ -1,4 +1,12 @@ import controlComponent from './NumberControl'; import previewComponent from './NumberPreview'; -export const NetlifyCmsWidgetNumber = { controlComponent, previewComponent }; -export { controlComponent, previewComponent }; + +const Widget = (opts = {}) => ({ + name: 'number', + controlComponent, + previewComponent, + ...opts, +}); + +export const NetlifyCmsWidgetNumber = { Widget, controlComponent, previewComponent }; +export default NetlifyCmsWidgetNumber; diff --git a/packages/netlify-cms-widget-object/src/index.js b/packages/netlify-cms-widget-object/src/index.js index 2995beaa..9df9d227 100644 --- a/packages/netlify-cms-widget-object/src/index.js +++ b/packages/netlify-cms-widget-object/src/index.js @@ -1,4 +1,12 @@ import controlComponent from './ObjectControl'; import previewComponent from './ObjectPreview'; -export const NetlifyCmsWidgetObject = { controlComponent, previewComponent }; -export { controlComponent, previewComponent }; + +const Widget = (opts = {}) => ({ + name: 'object', + controlComponent, + previewComponent, + ...opts, +}); + +export const NetlifyCmsWidgetObject = { Widget, controlComponent, previewComponent }; +export default NetlifyCmsWidgetObject; diff --git a/packages/netlify-cms-widget-relation/src/__tests__/relation.spec.js b/packages/netlify-cms-widget-relation/src/__tests__/relation.spec.js index fb42c103..9f38d05e 100644 --- a/packages/netlify-cms-widget-relation/src/__tests__/relation.spec.js +++ b/packages/netlify-cms-widget-relation/src/__tests__/relation.spec.js @@ -4,7 +4,9 @@ import { last } from 'lodash'; import { render, fireEvent, wait } from 'react-testing-library'; import 'react-testing-library/cleanup-after-each'; import 'jest-dom/extend-expect'; -import { controlComponent as RelationControl } from '../'; +import { NetlifyCmsWidgetRelation } from '../'; + +const RelationControl = NetlifyCmsWidgetRelation.controlComponent; const fieldConfig = { name: 'post', diff --git a/packages/netlify-cms-widget-relation/src/index.js b/packages/netlify-cms-widget-relation/src/index.js index 9be2fa60..87c106b0 100644 --- a/packages/netlify-cms-widget-relation/src/index.js +++ b/packages/netlify-cms-widget-relation/src/index.js @@ -1,4 +1,12 @@ import controlComponent from './RelationControl'; import previewComponent from './RelationPreview'; -export const NetlifyCmsWidgetRelation = { controlComponent, previewComponent }; -export { controlComponent, previewComponent }; + +const Widget = (opts = {}) => ({ + name: 'relation', + controlComponent, + previewComponent, + ...opts, +}); + +export const NetlifyCmsWidgetRelation = { Widget, controlComponent, previewComponent }; +export default NetlifyCmsWidgetRelation; diff --git a/packages/netlify-cms-widget-select/src/__tests__/select.spec.js b/packages/netlify-cms-widget-select/src/__tests__/select.spec.js index f51a6d42..b53db9d7 100644 --- a/packages/netlify-cms-widget-select/src/__tests__/select.spec.js +++ b/packages/netlify-cms-widget-select/src/__tests__/select.spec.js @@ -3,7 +3,9 @@ import { fromJS } from 'immutable'; import { render, fireEvent } from 'react-testing-library'; import 'react-testing-library/cleanup-after-each'; import 'jest-dom/extend-expect'; -import { controlComponent as SelectControl } from '../'; +import { NetlifyCmsWidgetSelect } from '../'; + +const SelectControl = NetlifyCmsWidgetSelect.controlComponent; const options = [ { value: 'foo', label: 'Foo' }, diff --git a/packages/netlify-cms-widget-select/src/index.js b/packages/netlify-cms-widget-select/src/index.js index 5b2228cd..b9b74ce6 100644 --- a/packages/netlify-cms-widget-select/src/index.js +++ b/packages/netlify-cms-widget-select/src/index.js @@ -1,4 +1,12 @@ import controlComponent from './SelectControl'; import previewComponent from './SelectPreview'; -export const NetlifyCmsWidgetSelect = { controlComponent, previewComponent }; -export { controlComponent, previewComponent }; + +const Widget = (opts = {}) => ({ + name: 'select', + controlComponent, + previewComponent, + ...opts, +}); + +export const NetlifyCmsWidgetSelect = { Widget, controlComponent, previewComponent }; +export default NetlifyCmsWidgetSelect; diff --git a/packages/netlify-cms-widget-string/src/index.js b/packages/netlify-cms-widget-string/src/index.js index d0c95dd4..b6202c5b 100644 --- a/packages/netlify-cms-widget-string/src/index.js +++ b/packages/netlify-cms-widget-string/src/index.js @@ -1,4 +1,12 @@ import controlComponent from './StringControl'; import previewComponent from './StringPreview'; -export const NetlifyCmsWidgetString = { controlComponent, previewComponent }; -export { controlComponent, previewComponent }; + +const Widget = (opts = {}) => ({ + name: 'string', + controlComponent, + previewComponent, + ...opts, +}); + +export const NetlifyCmsWidgetString = { Widget, controlComponent, previewComponent }; +export default NetlifyCmsWidgetString; diff --git a/packages/netlify-cms-widget-text/src/index.js b/packages/netlify-cms-widget-text/src/index.js index b8941d01..f4475d8c 100644 --- a/packages/netlify-cms-widget-text/src/index.js +++ b/packages/netlify-cms-widget-text/src/index.js @@ -1,5 +1,12 @@ import controlComponent from './TextControl'; import previewComponent from './TextPreview'; -export const NetlifyCmsWidgetText = { controlComponent, previewComponent }; -export { controlComponent, previewComponent }; +const Widget = (opts = {}) => ({ + name: 'text', + controlComponent, + previewComponent, + ...opts, +}); + +export const NetlifyCmsWidgetText = { Widget, controlComponent, previewComponent }; +export default NetlifyCmsWidgetText; diff --git a/packages/netlify-cms/src/backends.js b/packages/netlify-cms/src/backends.js index 27a0a8dd..3da2ce3f 100644 --- a/packages/netlify-cms/src/backends.js +++ b/packages/netlify-cms/src/backends.js @@ -1,12 +1,12 @@ -import { registerBackend } from 'netlify-cms-core'; +import { NetlifyCmsCore as CMS } from 'netlify-cms-core'; import { GitHubBackend } from 'netlify-cms-backend-github'; import { GitLabBackend } from 'netlify-cms-backend-gitlab'; import { GitGatewayBackend } from 'netlify-cms-backend-git-gateway'; import { BitbucketBackend } from 'netlify-cms-backend-bitbucket'; import { TestBackend } from 'netlify-cms-backend-test'; -registerBackend('git-gateway', GitGatewayBackend); -registerBackend('github', GitHubBackend); -registerBackend('gitlab', GitLabBackend); -registerBackend('bitbucket', BitbucketBackend); -registerBackend('test-repo', TestBackend); +CMS.registerBackend('git-gateway', GitGatewayBackend); +CMS.registerBackend('github', GitHubBackend); +CMS.registerBackend('gitlab', GitLabBackend); +CMS.registerBackend('bitbucket', BitbucketBackend); +CMS.registerBackend('test-repo', TestBackend); diff --git a/packages/netlify-cms/src/editor-components.js b/packages/netlify-cms/src/editor-components.js index 00f10da0..cdf023eb 100644 --- a/packages/netlify-cms/src/editor-components.js +++ b/packages/netlify-cms/src/editor-components.js @@ -1,4 +1,4 @@ -import { registerEditorComponent } from 'netlify-cms-core'; +import { NetlifyCmsCore as CMS } from 'netlify-cms-core'; import image from 'netlify-cms-editor-component-image'; -registerEditorComponent(image); +CMS.registerEditorComponent(image); diff --git a/packages/netlify-cms/src/index.js b/packages/netlify-cms/src/index.js index 99cfcb80..10b59b0c 100644 --- a/packages/netlify-cms/src/index.js +++ b/packages/netlify-cms/src/index.js @@ -1,6 +1,6 @@ import createReactClass from 'create-react-class'; import React from 'react'; -import * as CMS from 'netlify-cms-core'; +import { NetlifyCmsCore as CMS } from 'netlify-cms-core'; import './backends'; import './widgets'; import './editor-components'; diff --git a/packages/netlify-cms/src/media-libraries.js b/packages/netlify-cms/src/media-libraries.js index 92687676..347aa83c 100644 --- a/packages/netlify-cms/src/media-libraries.js +++ b/packages/netlify-cms/src/media-libraries.js @@ -1,6 +1,6 @@ -import { registerMediaLibrary } from 'netlify-cms-core'; +import { NetlifyCmsCore as CMS } from 'netlify-cms-core'; import uploadcare from 'netlify-cms-media-library-uploadcare'; import cloudinary from 'netlify-cms-media-library-cloudinary'; -registerMediaLibrary(uploadcare); -registerMediaLibrary(cloudinary); +CMS.registerMediaLibrary(uploadcare); +CMS.registerMediaLibrary(cloudinary); diff --git a/packages/netlify-cms/src/widgets.js b/packages/netlify-cms/src/widgets.js index c14ee6c5..9b58ff42 100644 --- a/packages/netlify-cms/src/widgets.js +++ b/packages/netlify-cms/src/widgets.js @@ -1,69 +1,32 @@ -import { registerWidget } from 'netlify-cms-core'; -import * as NetlifyCmsWidgetString from 'netlify-cms-widget-string'; -import * as NetlifyCmsWidgetNumber from 'netlify-cms-widget-number'; -import * as NetlifyCmsWidgetText from 'netlify-cms-widget-text'; -import * as NetlifyCmsWidgetImage from 'netlify-cms-widget-image'; -import * as NetlifyCmsWidgetFile from 'netlify-cms-widget-file'; -import * as NetlifyCmsWidgetSelect from 'netlify-cms-widget-select'; -import * as NetlifyCmsWidgetMarkdown from 'netlify-cms-widget-markdown'; -import * as NetlifyCmsWidgetList from 'netlify-cms-widget-list'; -import * as NetlifyCmsWidgetObject from 'netlify-cms-widget-object'; -import * as NetlifyCmsWidgetRelation from 'netlify-cms-widget-relation'; -import * as NetlifyCmsWidgetBoolean from 'netlify-cms-widget-boolean'; -import * as NetlifyCmsWidgetMap from 'netlify-cms-widget-map'; -import { NetlifyCmsWidgetDate } from 'netlify-cms-widget-date'; -import { NetlifyCmsWidgetDatetime } from 'netlify-cms-widget-datetime'; +import { NetlifyCmsCore as CMS } from 'netlify-cms-core'; +import NetlifyCmsWidgetString from 'netlify-cms-widget-string'; +import NetlifyCmsWidgetNumber from 'netlify-cms-widget-number'; +import NetlifyCmsWidgetText from 'netlify-cms-widget-text'; +import NetlifyCmsWidgetImage from 'netlify-cms-widget-image'; +import NetlifyCmsWidgetFile from 'netlify-cms-widget-file'; +import NetlifyCmsWidgetSelect from 'netlify-cms-widget-select'; +import NetlifyCmsWidgetMarkdown from 'netlify-cms-widget-markdown'; +import NetlifyCmsWidgetList from 'netlify-cms-widget-list'; +import NetlifyCmsWidgetObject from 'netlify-cms-widget-object'; +import NetlifyCmsWidgetRelation from 'netlify-cms-widget-relation'; +import NetlifyCmsWidgetBoolean from 'netlify-cms-widget-boolean'; +import NetlifyCmsWidgetMap from 'netlify-cms-widget-map'; +import NetlifyCmsWidgetDate from 'netlify-cms-widget-date'; +import NetlifyCmsWidgetDatetime from 'netlify-cms-widget-datetime'; -registerWidget( - 'string', - NetlifyCmsWidgetString.controlComponent, - NetlifyCmsWidgetString.previewComponent, -); -registerWidget( - 'number', - NetlifyCmsWidgetNumber.controlComponent, - NetlifyCmsWidgetNumber.previewComponent, -); -registerWidget( - 'text', - NetlifyCmsWidgetText.controlComponent, - NetlifyCmsWidgetText.previewComponent, -); -registerWidget( - 'list', - NetlifyCmsWidgetList.controlComponent, - NetlifyCmsWidgetList.previewComponent, -); -registerWidget( - 'markdown', - NetlifyCmsWidgetMarkdown.controlComponent, - NetlifyCmsWidgetMarkdown.previewComponent, -); -registerWidget( - 'image', - NetlifyCmsWidgetImage.controlComponent, - NetlifyCmsWidgetImage.previewComponent, -); -registerWidget( - 'file', - NetlifyCmsWidgetFile.controlComponent, - NetlifyCmsWidgetFile.previewComponent, -); -registerWidget( - 'select', - NetlifyCmsWidgetSelect.controlComponent, - NetlifyCmsWidgetSelect.previewComponent, -); -registerWidget( - 'object', - NetlifyCmsWidgetObject.controlComponent, - NetlifyCmsWidgetObject.previewComponent, -); -registerWidget( - 'relation', - NetlifyCmsWidgetRelation.controlComponent, - NetlifyCmsWidgetRelation.previewComponent, -); -registerWidget('boolean', NetlifyCmsWidgetBoolean.controlComponent); -registerWidget('map', NetlifyCmsWidgetMap.controlComponent, NetlifyCmsWidgetMap.previewComponent); -registerWidget([NetlifyCmsWidgetDate.Widget(), NetlifyCmsWidgetDatetime.Widget()]); +CMS.registerWidget([ + NetlifyCmsWidgetString.Widget(), + NetlifyCmsWidgetNumber.Widget(), + NetlifyCmsWidgetText.Widget(), + NetlifyCmsWidgetImage.Widget(), + NetlifyCmsWidgetFile.Widget(), + NetlifyCmsWidgetSelect.Widget(), + NetlifyCmsWidgetMarkdown.Widget(), + NetlifyCmsWidgetList.Widget(), + NetlifyCmsWidgetObject.Widget(), + NetlifyCmsWidgetRelation.Widget(), + NetlifyCmsWidgetBoolean.Widget(), + NetlifyCmsWidgetMap.Widget(), + NetlifyCmsWidgetDate.Widget(), + NetlifyCmsWidgetDatetime.Widget(), +]);