mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-07 03:22:21 +03:00
09435ecf76
no issue Keeps component JS backing files and template files in the same directory which avoids hunting across directories when working with components. Also lets you see all components when looking at one directory, whereas previously template-only or js-only components may not have been obvious without looking at both directories. - ran [codemod](https://github.com/ember-codemods/ember-component-template-colocation-migrator/) for app-level components - manually moved in-repo-addon component templates in `lib/koenig-editor` - removed all explicit `layout` imports as JS/template associations are now made at build-time removing the need for them - updated `.embercli` to default to new flat component structure
59 lines
2.7 KiB
Handlebars
59 lines
2.7 KiB
Handlebars
<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}}
|
|
@toolbar={{this.toolbar}}
|
|
@hasEditMode={{false}}
|
|
@showSelectedOutline={{this.payload.html}}
|
|
@addParagraphAfterCard={{this.addParagraphAfterCard}}
|
|
@moveCursorToPrevSection={{this.moveCursorToPrevSection}}
|
|
@moveCursorToNextSection={{this.moveCursorToNextSection}}
|
|
@editor={{this.editor}}
|
|
as |card|
|
|
>
|
|
{{#if this.payload.html}}
|
|
<div class="kg-card-hover">
|
|
<div class="koenig-embed-{{this.payload.type}} flex justify-center relative" data-kg-embed>
|
|
<iframe class="bn miw-100" scrolling="no"></iframe>
|
|
<div class="koenig-card-click-overlay ba b--transparent" data-kg-overlay></div>
|
|
</div>
|
|
|
|
{{#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)"
|
|
/>
|
|
{{/if}}
|
|
</div>
|
|
{{else}}
|
|
{{#if this.convertUrl.isRunning}}
|
|
<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>
|
|
{{else if this.hasError}}
|
|
<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>
|
|
<button type="button" {{action this.deleteCard}} class="nudge-right--2">
|
|
{{svg-jar "close" class="w3 stroke-red-l3"}}
|
|
</button>
|
|
</div>
|
|
{{else}}
|
|
<input
|
|
type="text"
|
|
value={{this.payload.url}}
|
|
name="url"
|
|
placeholder="Paste URL to add embedded content..."
|
|
class="miw-100 pa2 ba br2 b--lightgrey-d2 f7 form-text lh-title tracked-2 h10 nl2 nr2"
|
|
oninput={{action "updateUrl"}}
|
|
onkeydown={{action "urlKeydown"}}>
|
|
{{/if}}
|
|
{{/if}}
|
|
</KoenigCard>
|