2020-01-16 18:14:03 +03:00
|
|
|
<KoenigCard
|
|
|
|
@class="flex flex-column"
|
|
|
|
@isSelected={{this.isSelected}}
|
|
|
|
@isEditing={{this.isEditing}}
|
|
|
|
@selectCard={{action this.selectCard}}
|
|
|
|
@deselectCard={{action this.deselectCard}}
|
|
|
|
@onDeselect={{action "onDeselect"}}
|
|
|
|
@editCard={{action this.editCard}}
|
2020-10-21 20:27:26 +03:00
|
|
|
@saveAsSnippet={{if this.payload.html this.saveAsSnippet}}
|
2020-01-16 18:14:03 +03:00
|
|
|
@toolbar={{this.toolbar}}
|
|
|
|
@hasEditMode={{false}}
|
|
|
|
@showSelectedOutline={{this.payload.html}}
|
|
|
|
@addParagraphAfterCard={{this.addParagraphAfterCard}}
|
|
|
|
@moveCursorToPrevSection={{this.moveCursorToPrevSection}}
|
|
|
|
@moveCursorToNextSection={{this.moveCursorToNextSection}}
|
|
|
|
@editor={{this.editor}}
|
2018-06-12 20:08:27 +03:00
|
|
|
as |card|
|
2020-01-16 18:14:03 +03:00
|
|
|
>
|
2021-11-15 12:02:27 +03:00
|
|
|
{{#if (eq this.payload.metadata.card_type "nft")}}
|
|
|
|
<KoenigCardEmbed::Nft @payload={{this.payload}} />
|
|
|
|
{{else}}
|
2020-01-16 18:14:03 +03:00
|
|
|
{{#if this.payload.html}}
|
2018-06-07 13:34:50 +03:00
|
|
|
<div class="kg-card-hover">
|
2020-01-16 18:14:03 +03:00
|
|
|
<div class="koenig-embed-{{this.payload.type}} flex justify-center relative" data-kg-embed>
|
2021-11-15 13:26:10 +03:00
|
|
|
<iframe class="bn miw-100" scrolling="no"></iframe>
|
2018-08-20 15:34:45 +03:00
|
|
|
<div class="koenig-card-click-overlay ba b--transparent" data-kg-overlay></div>
|
2018-06-07 13:34:50 +03:00
|
|
|
</div>
|
|
|
|
|
2020-01-16 18:14:03 +03:00
|
|
|
{{#if (or this.isSelected (clean-basic-html this.payload.caption))}}
|
|
|
|
<card.CaptionInput
|
|
|
|
@caption={{this.payload.caption}}
|
|
|
|
@update={{action "updateCaption"}}
|
|
|
|
@placeholder="Type caption for embed (optional)"
|
|
|
|
/>
|
2018-06-07 13:34:50 +03:00
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
{{else}}
|
2020-01-16 18:14:03 +03:00
|
|
|
{{#if this.convertUrl.isRunning}}
|
2018-06-07 13:34:50 +03:00
|
|
|
<div class="miw-100 pa2 ba br2 b--lightgrey-d1 flex items-center justify-center bg-whitegrey-l2 f6 lh-title h10">
|
|
|
|
<div class="ghost-spinner spinner-blue"></div>
|
|
|
|
</div>
|
2020-01-16 18:14:03 +03:00
|
|
|
{{else if this.hasError}}
|
2018-06-07 13:34:50 +03:00
|
|
|
<div class="miw-100 flex flex-row pa2 pl3 ba br2 b--red-l3 red bg-error-red f7 fw4 lh-title h10 items-center">
|
|
|
|
<span class="mr3">There was an error when parsing the URL.</span>
|
|
|
|
<button type="button" class="red-d2 mr3 fw6 hover-red" {{action "retry"}}><span class="underline">Retry</span></button>
|
|
|
|
<button type="button" class="red-d2 mr-auto fw6 underline hover-red" {{action "insertAsLink"}}><span class="underline">Paste URL as link</span></button>
|
2020-01-16 18:14:03 +03:00
|
|
|
<button type="button" {{action this.deleteCard}} class="nudge-right--2">
|
2018-06-07 13:34:50 +03:00
|
|
|
{{svg-jar "close" class="w3 stroke-red-l3"}}
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
{{else}}
|
|
|
|
<input
|
|
|
|
type="text"
|
2020-01-16 18:14:03 +03:00
|
|
|
value={{this.payload.url}}
|
2018-06-13 13:14:34 +03:00
|
|
|
name="url"
|
2018-06-07 13:34:50 +03:00
|
|
|
placeholder="Paste URL to add embedded content..."
|
2018-11-20 13:12:15 +03:00
|
|
|
class="miw-100 pa2 ba br2 b--lightgrey-d2 f7 form-text lh-title tracked-2 h10 nl2 nr2"
|
2018-06-07 13:34:50 +03:00
|
|
|
oninput={{action "updateUrl"}}
|
|
|
|
onkeydown={{action "urlKeydown"}}>
|
|
|
|
{{/if}}
|
|
|
|
{{/if}}
|
2021-11-15 12:02:27 +03:00
|
|
|
{{/if}}
|
2020-01-16 18:14:03 +03:00
|
|
|
</KoenigCard>
|