kopia lustrzana https://github.com/wagtail/wagtail
Remove over-engineering index.js for Draftail sources folder
rodzic
03c7f662d2
commit
b31260a501
|
@ -6,12 +6,16 @@ import { IS_IE11 } from '../../config/wagtailConfig';
|
|||
|
||||
import Icon from '../Icon/Icon';
|
||||
|
||||
import sources from './sources';
|
||||
import Link from './decorators/Link';
|
||||
import Document from './decorators/Document';
|
||||
import ImageBlock from './blocks/ImageBlock';
|
||||
import EmbedBlock from './blocks/EmbedBlock';
|
||||
|
||||
import LinkSource from './sources/LinkSource';
|
||||
import DocumentSource from './sources/DocumentSource';
|
||||
import ImageSource from './sources/ImageSource';
|
||||
import EmbedSource from './sources/EmbedSource';
|
||||
|
||||
import registry from './registry';
|
||||
|
||||
const wrapWagtailIcon = type => {
|
||||
|
@ -82,7 +86,12 @@ export const initEditor = (fieldName, options = {}) => {
|
|||
ReactDOM.render(editor, editorWrapper);
|
||||
};
|
||||
|
||||
registry.registerSources(sources);
|
||||
registry.registerSources({
|
||||
LinkSource,
|
||||
DocumentSource,
|
||||
ImageSource,
|
||||
EmbedSource,
|
||||
});
|
||||
registry.registerDecorators({
|
||||
Link,
|
||||
Document,
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
import LinkSource from './LinkSource';
|
||||
import ImageSource from './ImageSource';
|
||||
import DocumentSource from './DocumentSource';
|
||||
import EmbedSource from './EmbedSource';
|
||||
|
||||
/**
|
||||
* Mapping object from name to component.
|
||||
*/
|
||||
export default {
|
||||
LinkSource,
|
||||
ImageSource,
|
||||
DocumentSource,
|
||||
EmbedSource,
|
||||
};
|
|
@ -1,7 +0,0 @@
|
|||
import sources from './index';
|
||||
|
||||
describe('sources', () => {
|
||||
it('exists', () => {
|
||||
expect(sources).toBeInstanceOf(Object);
|
||||
});
|
||||
});
|
Ładowanie…
Reference in New Issue