{{#koenig-card icon="koenig/card-indicator-markdown" class=(concat (kg-style "container-card") " koenig-card-markdown-rendered") headerOffset=headerOffset toolbar=toolbar payload=payload isSelected=isSelected isEditing=isEditing onEnterEdit=(action "enterEditMode") onLeaveEdit=(action "leaveEditMode") selectCard=(action selectCard) deselectCard=(action deselectCard) editCard=(action editCard) saveCard=(action saveCard) editor=editor }} {{#if isEditing}} {{#gh-editor as |editor|}} {{gh-scroll-trigger triggerOffset=(hash bottom=bottomOffset) enter=(action "topEntered") exit=(action "topExited") registerElement=(action "registerTop") }} {{#gh-markdown-editor markdown=(readonly payload.markdown) onChange=(action "updateMarkdown") autofocus=true enableSideBySide=false enablePreview=false enableHemingway=false options=(hash status=false) uploadedImageUrls=editor.uploadedImageUrls onImageFilesSelected=(action editor.uploadImages) imageMimeTypes=editor.imageMimeTypes as |markdown| }} {{markdown.editor}} {{/gh-markdown-editor}} {{gh-scroll-trigger enter=(action "bottomEntered") exit=(action "bottomExited") registerElement=(action "registerBottom") }} {{!-- files are dragged over editor pane --}} {{#if editor.isDraggedOver}}

Drop image(s) here to upload

{{/if}} {{!-- files have been dropped ready to be uploaded --}} {{#if editor.droppedFiles}} {{#gh-uploader files=editor.droppedFiles accept=editor.imageMimeTypes extensions=editor.imageExtensions onComplete=(action editor.uploadComplete) onCancel=(action editor.uploadCancelled) as |upload| }}
{{#if upload.errors}}

Upload failed

{{#each upload.errors as |error|}}
{{error.fileName}} - {{error.message}}
{{/each}} {{else}}

Uploading {{pluralize upload.files.length "image"}}...

{{upload.progressBar}} {{/if}}
{{/gh-uploader}} {{/if}} {{/gh-editor}} {{#if preventClick}}
{{/if}} {{else}} {{renderedMarkdown}}
{{/if}} {{/koenig-card}}