-
Notifications
You must be signed in to change notification settings - Fork 8.2k
/
d-editor.hbs
105 lines (102 loc) · 3.42 KB
/
d-editor.hbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<div class="d-editor-container">
<div class="d-editor-textarea-column">
{{yield}}
{{#if this.showFormTemplateForm}}
{{#if (gt @formTemplateIds.length 1)}}
<FormTemplateChooser
@filteredIds={{@formTemplateIds}}
@value={{this.selectedFormTemplateId}}
@onChange={{this.updateSelectedFormTemplateId}}
@options={{hash maximum=1}}
class="composer-select-form-template"
/>
{{/if}}
<form id="form-template-form">
<FormTemplateField::Wrapper
@id={{this.selectedFormTemplateId}}
@initialValues={{@formTemplateInitialValues}}
@onSelectFormTemplate={{@onSelectFormTemplate}}
/>
</form>
{{else}}
<div
class="d-editor-textarea-wrapper
{{if this.disabled 'disabled'}}
{{if this.isEditorFocused 'in-focus'}}"
>
<div class="d-editor-button-bar" role="toolbar">
{{#each this.toolbar.groups as |group|}}
{{#each group.buttons as |b|}}
{{#if (b.condition this)}}
{{#if b.popupMenu}}
<ToolbarPopupMenuOptions
@content={{this.popupMenuOptions}}
@onChange={{this.onPopupMenuAction}}
@onOpen={{action b.action b}}
@tabindex={{-1}}
@onKeydown={{this.rovingButtonBar}}
@options={{hash icon=b.icon focusAfterOnChange=false}}
class={{b.className}}
/>
{{else}}
<DButton
@action={{fn (action b.action) b}}
@translatedTitle={{b.title}}
@label={{b.label}}
@icon={{b.icon}}
@preventFocus={{b.preventFocus}}
@onKeyDown={{this.rovingButtonBar}}
tabindex={{b.tabindex}}
class={{b.className}}
/>
{{/if}}
{{/if}}
{{/each}}
{{/each}}
</div>
<ConditionalLoadingSpinner @condition={{this.loading}} />
<DTextarea
@autocomplete="off"
@tabindex={{this.tabindex}}
@value={{this.value}}
@placeholder={{this.placeholderTranslated}}
@aria-label={{this.placeholderTranslated}}
@disabled={{this.disabled}}
@input={{this.change}}
@focusIn={{action "focusIn"}}
@focusOut={{action "focusOut"}}
class="d-editor-input"
/>
<PopupInputTip @validation={{this.validation}} />
<PluginOutlet
@name="after-d-editor"
@connectorTagName="div"
@outletArgs={{this.outletArgs}}
/>
</div>
{{/if}}
</div>
<div
class="d-editor-preview-wrapper {{if this.forcePreview 'force-preview'}}"
>
<div class="d-editor-preview">
{{#unless this.siteSettings.enable_diffhtml_preview}}
{{html-safe this.preview}}
{{/unless}}
</div>
<span class="d-editor-plugin">
<PluginOutlet
@name="editor-preview"
@connectorTagName="div"
@outletArgs={{this.outletArgs}}
/>
</span>
</div>
</div>
<EmojiPicker
@isActive={{this.emojiPickerIsActive}}
@isEditorFocused={{this.isEditorFocused}}
@initialFilter={{this.emojiFilter}}
@emojiSelected={{action "emojiSelected"}}
@onEmojiPickerClose={{this.onEmojiPickerClose}}
/>