2021-11-09 12:39:47 +03:00
|
|
|
<KoenigCard
|
2021-11-11 17:48:07 +03:00
|
|
|
@class={{concat (kg-style "container-card") " kg-card-callout-container"}}
|
2021-11-09 12:39:47 +03:00
|
|
|
@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}}
|
|
|
|
|
2021-11-11 17:48:07 +03:00
|
|
|
<div class="kg-card-callout kg-card-callout-{{@payload.backgroundColor}}">
|
2021-11-10 20:31:00 +03:00
|
|
|
{{#if @payload.calloutEmoji}}
|
2021-11-15 20:37:16 +03:00
|
|
|
<div class="kg-callout-emoji" {{on "click" this.changeEmoji}}>{{@payload.calloutEmoji}}</div>
|
2021-11-10 20:31:00 +03:00
|
|
|
{{/if}}
|
2021-11-15 19:57:56 +03:00
|
|
|
<KoenigBasicHtmlTextarea
|
2021-11-09 12:39:47 +03:00
|
|
|
@html={{@payload.calloutText}}
|
|
|
|
@placeholder="Callout text..."
|
|
|
|
@autofocus={{true}}
|
2021-11-09 17:17:36 +03:00
|
|
|
@class="w-100 bn bg-transparent"
|
2021-11-15 20:37:16 +03:00
|
|
|
@onChange={{this.setCalloutText}}
|
|
|
|
@onFocus={{fn (mut this.isFocused) true}}
|
|
|
|
@onBlur={{fn (mut this.isFocused) false}}
|
|
|
|
@didCreateEditor={{this.registerEditor}}
|
2021-11-09 12:39:47 +03:00
|
|
|
/>
|
2021-11-10 17:51:11 +03:00
|
|
|
<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">
|
2021-11-11 17:48:07 +03:00
|
|
|
<div class="for-switch x-small">
|
2021-11-10 17:51:11 +03:00
|
|
|
<label class="switch" for="has-emoji">
|
|
|
|
<input
|
|
|
|
type="checkbox"
|
|
|
|
checked={{@payload.calloutEmoji}}
|
|
|
|
id="has-emoji"
|
2021-11-15 20:37:16 +03:00
|
|
|
{{on "click" this.toggleEmoji}}
|
2021-11-10 17:51:11 +03:00
|
|
|
data-test-has-emoji
|
|
|
|
>
|
2021-11-11 17:48:07 +03:00
|
|
|
<span class="input-toggle-component mt1"></span>
|
2021-11-10 17:51:11 +03:00
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-11-10 20:31:00 +03:00
|
|
|
|
|
|
|
<div class="kg-settings-panel-control">
|
|
|
|
<div class="kg-settings-panel-control-label">Background color</div>
|
|
|
|
<div class="kg-settings-panel-control-input">
|
2021-11-11 17:48:07 +03:00
|
|
|
<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>
|
2021-11-10 20:31:00 +03:00
|
|
|
</div>
|
2021-11-11 17:48:07 +03:00
|
|
|
|
2021-11-10 20:31:00 +03:00
|
|
|
</div>
|
2021-11-10 17:51:11 +03:00
|
|
|
</KoenigSettingsPanel>
|
2021-11-09 12:39:47 +03:00
|
|
|
</div>
|
|
|
|
|
|
|
|
{{else}}
|
|
|
|
|
2021-11-11 17:48:07 +03:00
|
|
|
<div class="kg-card-callout kg-card-callout-{{@payload.backgroundColor}}">
|
2021-11-10 20:31:00 +03:00
|
|
|
{{#if @payload.calloutEmoji}}
|
2021-11-09 17:09:28 +03:00
|
|
|
<div class="kg-callout-emoji">{{@payload.calloutEmoji}}</div>
|
2021-11-10 20:31:00 +03:00
|
|
|
{{/if}}
|
2021-11-09 12:39:47 +03:00
|
|
|
<div>{{{@payload.calloutText}}}</div>
|
|
|
|
</div>
|
|
|
|
<div class="koenig-card-click-overlay"></div>
|
|
|
|
|
|
|
|
{{/if}}
|
|
|
|
</KoenigCard>
|