Add image placeholder and upload indicating frame (#1666)

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
Co-authored-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
Tilman Vatteroth 2021-12-11 15:34:33 +01:00 committed by GitHub
parent 58fecc0b3a
commit d4251519e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
37 changed files with 908 additions and 72 deletions

View file

@ -19,7 +19,8 @@ export enum CommunicationMessageType {
SET_BASE_CONFIGURATION = 'SET_BASE_CONFIGURATION',
GET_WORD_COUNT = 'GET_WORD_COUNT',
ON_WORD_COUNT_CALCULATED = 'ON_WORD_COUNT_CALCULATED',
SET_FRONTMATTER_INFO = 'SET_FRONTMATTER_INFO'
SET_FRONTMATTER_INFO = 'SET_FRONTMATTER_INFO',
IMAGE_UPLOAD = 'IMAGE_UPLOAD'
}
export interface NoPayloadMessage {
@ -37,6 +38,14 @@ export interface ImageDetails {
title?: string
}
export interface ImageUploadMessage {
type: CommunicationMessageType.IMAGE_UPLOAD
dataUri: string
fileName: string
lineIndex?: number
placeholderIndexInLine?: number
}
export interface SetBaseUrlMessage {
type: CommunicationMessageType.SET_BASE_CONFIGURATION
baseConfiguration: BaseConfiguration
@ -100,6 +109,7 @@ export type CommunicationMessages =
| SetFrontmatterInfoMessage
| OnHeightChangeMessage
| OnWordCountCalculatedMessage
| ImageUploadMessage
export type EditorToRendererMessageType =
| CommunicationMessageType.SET_MARKDOWN_CONTENT
@ -118,6 +128,7 @@ export type RendererToEditorMessageType =
| CommunicationMessageType.IMAGE_CLICKED
| CommunicationMessageType.ON_HEIGHT_CHANGE
| CommunicationMessageType.ON_WORD_COUNT_CALCULATED
| CommunicationMessageType.IMAGE_UPLOAD
export enum RendererType {
DOCUMENT = 'document',