Upgrade Editor – Slate 0.44 / RME 8.0.0 (#863)

* Upgrade Slate

* Normalization

* Remove dupe dep

* Fixes placeholders

* Image uploading fixed

* Verbose but solid placeholder handling

* RME 8.0.0

* Fixes: Ability to delete embeds
This commit is contained in:
Tom Moor
2019-01-18 22:44:31 -08:00
committed by GitHub
parent 0be5aef1c6
commit d21dd710bb
11 changed files with 185 additions and 306 deletions

View File

@@ -49,7 +49,7 @@ You have unsaved changes.
Are you sure you want to discard them?
`;
const UPLOADING_WARNING = `
Image are still uploading.
Images are still uploading.
Are you sure you want to discard them?
`;
@@ -240,7 +240,7 @@ class DocumentScene extends React.Component<Props> {
const document = this.document;
this.isDirty =
document && this.getEditorText().trim() !== document.text.trim();
!!document && this.getEditorText().trim() !== document.text.trim();
}, IS_DIRTY_DELAY);
onImageUploadStart = () => {
@@ -340,11 +340,11 @@ class DocumentScene extends React.Component<Props> {
{this.isEditing && (
<React.Fragment>
<Prompt
when={this.isDirty || false}
when={this.isDirty && !this.isUploading}
message={DISCARD_CHANGES}
/>
<Prompt
when={this.isUploading || false}
when={this.isUploading && !this.isDirty}
message={UPLOADING_WARNING}
/>
</React.Fragment>
@@ -365,8 +365,6 @@ class DocumentScene extends React.Component<Props> {
<MaxWidth column auto>
<Editor
key={embedsDisabled ? 'embeds-disabled' : 'embeds-enabled'}
titlePlaceholder="Start with a title…"
bodyPlaceholder="…the rest is your canvas"
defaultValue={revision ? revision.text : document.text}
pretitle={document.emoji}
disableEmbeds={embedsDisabled}