2018-05-02 19:31:17 +03:00
|
|
|
<div class="koenig-editor__editor-wrapper" data-kg="editor-wrapper">
|
2021-06-03 15:22:07 +03:00
|
|
|
<div class="koenig-editor__editor" data-kg="editor"></div>
|
2018-01-30 13:01:07 +03:00
|
|
|
</div>
|
|
|
|
|
|
|
|
{{!-- pop-up markup toolbar is shown when there's a selection --}}
|
2020-01-16 18:14:03 +03:00
|
|
|
<KoenigToolbar
|
|
|
|
@editor={{this.editor}}
|
|
|
|
@editorRange={{this.selectedRange}}
|
|
|
|
@activeMarkupTagNames={{this.activeMarkupTagNames}}
|
|
|
|
@activeSectionTagNames={{this.activeSectionTagNames}}
|
|
|
|
@toggleMarkup={{action "toggleMarkup"}}
|
|
|
|
@toggleSection={{action "toggleSection"}}
|
|
|
|
@toggleHeaderSection={{action "toggleHeaderSection"}}
|
|
|
|
@editLink={{action "editLink"}}
|
2020-10-27 17:42:36 +03:00
|
|
|
@addSnippet={{this.addSnippetIfPossible}}
|
2020-01-16 18:14:03 +03:00
|
|
|
/>
|
2018-01-30 18:18:08 +03:00
|
|
|
|
2018-04-11 20:42:27 +03:00
|
|
|
{{!-- pop-up link hover toolbar --}}
|
2020-01-16 18:14:03 +03:00
|
|
|
<KoenigLinkToolbar
|
|
|
|
@editor={{this.editor}}
|
|
|
|
@container={{this.element}}
|
|
|
|
@linkRange={{this.linkRange}}
|
|
|
|
@selectedRange={{this.selectedRange}}
|
|
|
|
@editLink={{action "editLink"}}
|
|
|
|
/>
|
2018-04-11 20:42:27 +03:00
|
|
|
|
2018-04-06 19:49:16 +03:00
|
|
|
{{!-- pop-up link editing toolbar --}}
|
2020-01-16 18:14:03 +03:00
|
|
|
{{#if this.linkRange}}
|
|
|
|
<KoenigLinkInput
|
|
|
|
@editor={{this.editor}}
|
|
|
|
@linkRange={{this.linkRange}}
|
2020-03-07 21:22:56 +03:00
|
|
|
@linkRect={{this.linkRect}}
|
2020-01-16 18:14:03 +03:00
|
|
|
@selectedRange={{this.selectedRange}}
|
|
|
|
@cancel={{action "cancelEditLink"}}
|
|
|
|
/>
|
2018-04-06 19:49:16 +03:00
|
|
|
{{/if}}
|
|
|
|
|
2020-10-15 20:03:18 +03:00
|
|
|
{{!-- pop-up snippet editing toolbar --}}
|
|
|
|
{{#if this.snippetRange}}
|
2021-09-01 11:09:40 +03:00
|
|
|
<KoenigSnippetInput
|
|
|
|
@editor={{this.editor}}
|
|
|
|
@snippetRange={{this.snippetRange}}
|
|
|
|
@snippetRect={{this.snippetRect}}
|
|
|
|
@snippets={{@snippets}}
|
|
|
|
@save={{@saveSnippet}}
|
|
|
|
@update={{@updateSnippet}}
|
|
|
|
@cancel={{this.cancelAddSnippet}}
|
|
|
|
/>
|
2020-10-15 20:03:18 +03:00
|
|
|
{{/if}}
|
|
|
|
|
2021-11-19 22:07:40 +03:00
|
|
|
{{!-- pop-up media selector --}}
|
|
|
|
{{#if this.activeSelectorComponent}}
|
|
|
|
<KoenigMediaSelector
|
|
|
|
@editor={{this.editor}}
|
|
|
|
@editorRange={{this.selectedRange}}
|
|
|
|
@replaceWithCardSection={{action "replaceWithCardSection"}}
|
2021-11-19 22:51:45 +03:00
|
|
|
@scrollContainerSelector={{this.scrollContainerSelector}}
|
2021-11-19 22:07:40 +03:00
|
|
|
@close={{action "closeSelectorComponent"}}
|
|
|
|
as |selector|
|
|
|
|
>
|
|
|
|
{{component this.activeSelectorComponent selector=selector}}
|
|
|
|
</KoenigMediaSelector>
|
|
|
|
{{/if}}
|
|
|
|
|
2018-01-31 17:49:20 +03:00
|
|
|
{{!-- (+) icon and pop-up menu --}}
|
2020-01-16 18:14:03 +03:00
|
|
|
<KoenigPlusMenu
|
|
|
|
@editor={{this.editor}}
|
|
|
|
@editorRange={{this.selectedRange}}
|
2020-10-15 20:03:18 +03:00
|
|
|
@snippets={{this.snippets}}
|
2020-10-26 20:09:09 +03:00
|
|
|
@deleteSnippet={{this.deleteSnippet}}
|
2020-01-16 18:14:03 +03:00
|
|
|
@replaceWithCardSection={{action "replaceWithCardSection"}}
|
2020-10-15 20:03:18 +03:00
|
|
|
@replaceWithPost={{action "replaceWithPost"}}
|
2021-11-19 22:07:40 +03:00
|
|
|
@openSelectorComponent={{action "openSelectorComponent"}}
|
2021-09-10 11:24:38 +03:00
|
|
|
@postType={{@postType}}
|
2020-01-16 18:14:03 +03:00
|
|
|
/>
|
2018-02-03 19:54:19 +03:00
|
|
|
|
|
|
|
{{!-- slash menu popup --}}
|
2020-01-16 18:14:03 +03:00
|
|
|
<KoenigSlashMenu
|
|
|
|
@editor={{this.editor}}
|
|
|
|
@editorRange={{this.selectedRange}}
|
2020-10-15 20:03:18 +03:00
|
|
|
@snippets={{this.snippets}}
|
2020-10-26 20:09:09 +03:00
|
|
|
@deleteSnippet={{this.deleteSnippet}}
|
2020-01-16 18:14:03 +03:00
|
|
|
@replaceWithCardSection={{action "replaceWithCardSection"}}
|
2020-10-15 20:03:18 +03:00
|
|
|
@replaceWithPost={{action "replaceWithPost"}}
|
2021-11-19 22:07:40 +03:00
|
|
|
@openSelectorComponent={{action "openSelectorComponent"}}
|
2021-09-10 11:24:38 +03:00
|
|
|
@postType={{@postType}}
|
2020-01-16 18:14:03 +03:00
|
|
|
/>
|
2018-01-31 17:49:20 +03:00
|
|
|
|
2018-02-03 19:54:19 +03:00
|
|
|
{{!-- all component cards wormholed into the editor canvas --}}
|
2020-01-16 18:14:03 +03:00
|
|
|
{{#each this.componentCards as |card|}}
|
2020-07-20 14:10:17 +03:00
|
|
|
{{#in-element card.destinationElement}}
|
2018-02-01 14:26:24 +03:00
|
|
|
{{component card.componentName
|
2020-01-16 18:14:03 +03:00
|
|
|
editor=this.editor
|
2018-01-30 18:18:08 +03:00
|
|
|
postModel=card.postModel
|
|
|
|
cardName=card.cardName
|
|
|
|
payload=card.payload
|
|
|
|
env=card.env
|
|
|
|
options=card.options
|
2020-01-16 18:14:03 +03:00
|
|
|
headerOffset=this.headerOffset
|
2018-01-30 18:18:08 +03:00
|
|
|
saveCard=(action card.env.save)
|
|
|
|
cancelCard=(action card.env.cancel)
|
|
|
|
removeCard=(action card.env.remove)
|
2021-11-24 23:02:10 +03:00
|
|
|
scrollToCard=(action "scrollToCard" card)
|
2018-02-04 22:35:44 +03:00
|
|
|
isSelected=card.isSelected
|
2018-02-13 21:00:54 +03:00
|
|
|
isEditing=card.isEditing
|
2018-05-23 13:38:30 +03:00
|
|
|
selectCard=(action "selectCard" card)
|
|
|
|
deselectCard=(action "deselectCard" card)
|
2018-02-13 21:00:54 +03:00
|
|
|
editCard=(action "editCard" card)
|
2018-03-15 20:54:15 +03:00
|
|
|
deleteCard=(action "deleteCard" card)
|
2020-11-03 16:57:11 +03:00
|
|
|
saveAsSnippet=(if this.saveCardAsSnippetIfPossible (fn this.saveCardAsSnippetIfPossible card))
|
2018-02-22 23:41:40 +03:00
|
|
|
moveCursorToPrevSection=(action "moveCursorToPrevSection" card)
|
|
|
|
moveCursorToNextSection=(action "moveCursorToNextSection" card)
|
|
|
|
addParagraphAfterCard=(action "addParagraphAfterCard" card)
|
2018-07-20 17:53:21 +03:00
|
|
|
registerComponent=(action (mut card.component))
|
2018-01-30 18:18:08 +03:00
|
|
|
}}
|
2020-07-20 14:10:17 +03:00
|
|
|
{{/in-element}}
|
2021-07-22 20:54:35 +03:00
|
|
|
{{/each}}
|
|
|
|
|
|
|
|
{{!-- all component atoms wormholed into the editor canvas --}}
|
|
|
|
{{#each this.componentAtoms as |atom|}}
|
|
|
|
{{#in-element atom.destinationElement}}
|
|
|
|
{{component atom.componentName
|
|
|
|
editor=this.editor
|
|
|
|
atom=atom
|
|
|
|
saveAtom=(fn atom.env.save atom.env.value atom.env.payload)
|
|
|
|
registerComponent=(action (mut atom.component))
|
|
|
|
}}
|
|
|
|
{{/in-element}}
|
2018-05-23 13:38:30 +03:00
|
|
|
{{/each}}
|