mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 13:54:35 +03:00
35db77e342
refs https://github.com/TryGhost/Team/issues/1206 - prevents text in curly brakets from being wrapped into a <code> tag - updated the callout card to this generic textarea editor instead of the email-specific editor
85 lines
3.6 KiB
Handlebars
85 lines
3.6 KiB
Handlebars
<KoenigCard
|
|
@class={{concat (kg-style "container-card") " kg-card-callout-container"}}
|
|
@headerOffset={{@headerOffset}}
|
|
@toolbar={{this.toolbar}}
|
|
@payload={{@payload}}
|
|
@isSelected={{@isSelected}}
|
|
@isEditing={{@isEditing}}
|
|
@selectCard={{@selectCard}}
|
|
@deselectCard={{@deselectCard}}
|
|
@editCard={{@editCard}}
|
|
@hasEditMode={{true}}
|
|
@saveCard={{@saveCard}}
|
|
@saveAsSnippet={{@saveAsSnippet}}
|
|
@onLeaveEdit={{this.leaveEditMode}}
|
|
@addParagraphAfterCard={{@addParagraphAfterCard}}
|
|
@moveCursorToPrevSection={{@moveCursorToPrevSection}}
|
|
@moveCursorToNextSection={{@moveCursorToNextSection}}
|
|
@editor={{@editor}}
|
|
{{did-insert this.registerElement}}
|
|
as |card|
|
|
>
|
|
{{#if @isEditing}}
|
|
|
|
<div class="kg-card-callout kg-card-callout-{{@payload.backgroundColor}}">
|
|
{{#if @payload.calloutEmoji}}
|
|
<div class="kg-callout-emoji" onclick={{action "changeEmoji"}}>{{@payload.calloutEmoji}}</div>
|
|
{{/if}}
|
|
<KoenigBasicHtmlTextarea
|
|
@html={{@payload.calloutText}}
|
|
@placeholder="Callout text..."
|
|
@autofocus={{true}}
|
|
@class="w-100 bn bg-transparent"
|
|
@onChange={{action "setCalloutText"}}
|
|
@onFocus={{action (mut this.isFocused) true}}
|
|
@onBlur={{action (mut this.isFocused) false}}
|
|
@didCreateEditor={{action "registerEditor"}}
|
|
/>
|
|
<KoenigSettingsPanel>
|
|
<div class="kg-settings-panel-control kg-settings-panel-control-horizontal">
|
|
<div class="kg-settings-panel-control-label">Emoji</div>
|
|
<div class="kg-settings-panel-control-input">
|
|
<div class="for-switch x-small">
|
|
<label class="switch" for="has-emoji">
|
|
<input
|
|
type="checkbox"
|
|
checked={{@payload.calloutEmoji}}
|
|
id="has-emoji"
|
|
onclick={{action "toggleEmoji"}}
|
|
data-test-has-emoji
|
|
>
|
|
<span class="input-toggle-component mt1"></span>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="kg-settings-panel-control">
|
|
<div class="kg-settings-panel-control-label">Background color</div>
|
|
<div class="kg-settings-panel-control-input">
|
|
<div class="kg-callout-palette">
|
|
{{#each this.backgroundColors as |option| }}
|
|
<span class="kg-callout-palette-swatch {{if (eq this.selectedBackgroundColor option) "selected-swatch"}}" title={{option.name}} {{on "click" (fn this.setBackgroundColor option)}}>
|
|
<div class="kg-callout-palette-swatch-{{option.color}} w-100 h-100 br2"></div>
|
|
</span>
|
|
{{/each}}
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</KoenigSettingsPanel>
|
|
</div>
|
|
|
|
{{else}}
|
|
|
|
<div class="kg-card-callout kg-card-callout-{{@payload.backgroundColor}}">
|
|
{{#if @payload.calloutEmoji}}
|
|
<div class="kg-callout-emoji">{{@payload.calloutEmoji}}</div>
|
|
{{/if}}
|
|
<div>{{{@payload.calloutText}}}</div>
|
|
</div>
|
|
<div class="koenig-card-click-overlay"></div>
|
|
|
|
{{/if}}
|
|
</KoenigCard>
|