2023-10-06 11:58:08 +03:00
|
|
|
<div class="gh-koenig-editor relative z-0" {{did-insert this.registerElement}} ...attributes>
|
2022-08-23 13:45:50 +03:00
|
|
|
{{!-- full height content pane --}}
|
2023-01-04 12:39:32 +03:00
|
|
|
{{!-- template-lint-disable no-invalid-interactive no-passed-in-event-handlers --}}
|
2022-08-23 13:45:50 +03:00
|
|
|
<div
|
|
|
|
class="gh-koenig-editor-pane flex flex-column mih-100"
|
|
|
|
{{on "mousedown" this.trackMousedown}}
|
2023-02-22 18:01:25 +03:00
|
|
|
{{on "mouseup" this.focusEditor}}
|
2023-08-10 19:36:06 +03:00
|
|
|
{{on "dragover" this.editorPaneDragover}}
|
|
|
|
{{on "drop" this.editorPaneDrop}}
|
2022-08-23 13:45:50 +03:00
|
|
|
>
|
|
|
|
<GhEditorFeatureImage
|
|
|
|
@image={{@featureImage}}
|
|
|
|
@updateImage={{@setFeatureImage}}
|
|
|
|
@clearImage={{@clearFeatureImage}}
|
|
|
|
@alt={{@featureImageAlt}}
|
|
|
|
@updateAlt={{@setFeatureImageAlt}}
|
|
|
|
@caption={{@featureImageCaption}}
|
|
|
|
@updateCaption={{@setFeatureImageCaption}}
|
2023-11-02 01:44:55 +03:00
|
|
|
@handleCaptionBlur={{@handleFeatureImageCaptionBlur}}
|
2022-08-23 13:45:50 +03:00
|
|
|
@forceButtonDisplay={{or (not @title) (eq @title "(Untitled)") this.titleIsHovered this.titleIsFocused}}
|
2023-07-31 22:22:19 +03:00
|
|
|
@isHidden={{or (not @cardOptions.post.showTitleAndFeatureImage) false}}
|
2023-12-07 18:46:23 +03:00
|
|
|
@onTKCountChange={{@updateFeatureImageTkCount}}
|
2022-08-23 13:45:50 +03:00
|
|
|
/>
|
|
|
|
|
2023-12-12 13:51:59 +03:00
|
|
|
<div class="gh-editor-title-container">
|
2023-07-31 22:22:19 +03:00
|
|
|
{{#if (and (not @cardOptions.post.showTitleAndFeatureImage) (not @featureImage))}}
|
2023-07-10 11:02:56 +03:00
|
|
|
<span class="gh-editor-hidden-indicator" data-tooltip="Post title is hidden on page">
|
2023-07-03 12:26:33 +03:00
|
|
|
{{svg-jar "eye-closed"}}
|
|
|
|
</span>
|
|
|
|
{{/if}}
|
|
|
|
|
2024-01-17 11:57:35 +03:00
|
|
|
{{#if @titleHasTk}}
|
2023-12-05 18:41:54 +03:00
|
|
|
<div
|
|
|
|
class="tk-indicator" data-testid="tk-indicator"
|
|
|
|
{{on "click" this.focusTitle}}
|
|
|
|
>
|
|
|
|
TK
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
|
2023-07-03 12:26:33 +03:00
|
|
|
<GhTextarea
|
2023-07-31 22:22:19 +03:00
|
|
|
@class="gh-editor-title {{if (and (not @cardOptions.post.showTitleAndFeatureImage) (not this.titleIsFocused)) "faded"}}"
|
2023-07-03 12:26:33 +03:00
|
|
|
@placeholder={{@titlePlaceholder}}
|
|
|
|
@shouldFocus={{or @titleAutofocus false}}
|
|
|
|
@tabindex="1"
|
|
|
|
@autoExpand=".gh-koenig-editor"
|
|
|
|
@value={{readonly this.title}}
|
|
|
|
@input={{this.updateTitle}}
|
|
|
|
@focus-out={{optional @onTitleBlur}}
|
|
|
|
@keyDown={{this.onTitleKeydown}}
|
|
|
|
@didCreateTextarea={{this.registerTitleElement}}
|
|
|
|
{{on "focus" (fn (mut this.titleIsFocused) true)}}
|
|
|
|
{{on "blur" (fn (mut this.titleIsFocused) false)}}
|
|
|
|
{{on "mouseover" (fn (mut this.titleIsHovered) true)}}
|
|
|
|
{{on "mouseleave" (fn (mut this.titleIsHovered) false)}}
|
|
|
|
{{on "paste" this.cleanPastedTitle}}
|
|
|
|
data-test-editor-title-input={{true}}
|
|
|
|
/>
|
|
|
|
</div>
|
2022-08-23 13:45:50 +03:00
|
|
|
|
2022-09-13 23:01:53 +03:00
|
|
|
<KoenigLexicalEditor
|
|
|
|
@lexical={{@body}}
|
2023-09-25 18:39:54 +03:00
|
|
|
@placeholder={{@bodyPlaceholder}}
|
2023-04-12 22:24:02 +03:00
|
|
|
@cardConfig={{@cardOptions}}
|
2022-09-13 23:01:53 +03:00
|
|
|
@onChange={{@onBodyChange}}
|
2022-12-01 01:04:02 +03:00
|
|
|
@registerAPI={{this.registerEditorAPI}}
|
2022-12-01 19:46:00 +03:00
|
|
|
@cursorDidExitAtTop={{this.focusTitle}}
|
2023-06-14 19:56:03 +03:00
|
|
|
@updateWordCount={{@updateWordCount}}
|
2023-12-05 18:41:54 +03:00
|
|
|
@updatePostTkCount={{@updatePostTkCount}}
|
2022-09-13 23:01:53 +03:00
|
|
|
/>
|
2022-08-23 13:45:50 +03:00
|
|
|
</div>
|
2022-11-10 16:43:15 +03:00
|
|
|
</div>
|