migrate image editor component
This commit is contained in:
@ -49,6 +49,7 @@
|
||||
"netlify-cms-lib-auth": "file:../netlify-cms-lib-auth",
|
||||
"netlify-cms-lib-util": "file:../netlify-cms-lib-util",
|
||||
"netlify-cms-ui-default": "file:../netlify-cms-ui-default",
|
||||
"netlify-cms-editor-component-image": "file:../netlify-cms-editor-component-image",
|
||||
"prop-types": "^15.5.10",
|
||||
"react": "15.x || 16.x",
|
||||
"react-aria-menubutton": "^5.1.0",
|
||||
|
@ -285,7 +285,7 @@ export default class EditorToolbar extends React.Component {
|
||||
dropdownTopOverlap="40px"
|
||||
dropdownWidth="150px"
|
||||
renderButton={() => (
|
||||
<PublishButton>{isPersisting ? 'Publishing...' : 'Publish'}</PublishButton>
|
||||
<PublishButton>{isPublishing ? 'Publishing...' : 'Publish'}</PublishButton>
|
||||
)}
|
||||
>
|
||||
<DropdownItem label="Publish now" icon="arrow" iconDirection="right" onClick={onPublish}/>
|
||||
|
@ -1,23 +0,0 @@
|
||||
import React from 'react';
|
||||
|
||||
const image = {
|
||||
label: 'Image',
|
||||
id: 'image',
|
||||
fromBlock: match => match && {
|
||||
image: match[2],
|
||||
alt: match[1],
|
||||
},
|
||||
toBlock: data => ``,
|
||||
toPreview: (data, getAsset) => <img src={getAsset(data.image) || ''} alt={data.alt || ''} />,
|
||||
pattern: /^!\[(.*)\]\((.*)\)$/,
|
||||
fields: [{
|
||||
label: 'Image',
|
||||
name: 'image',
|
||||
widget: 'image',
|
||||
}, {
|
||||
label: 'Alt Text',
|
||||
name: 'alt',
|
||||
}],
|
||||
};
|
||||
|
||||
export default image;
|
@ -1,5 +1,5 @@
|
||||
import { registerEditorComponent } from 'Lib/registry';
|
||||
import image from './image';
|
||||
import image from 'netlify-cms-editor-component-image';
|
||||
|
||||
const plugins = [
|
||||
image,
|
||||
|
Reference in New Issue
Block a user