| 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358 | 1×
1×
1×
9772×
9772×
1×
1×
8383×
1×
1×
1380×
1380×
1380×
1×
1×
1343×
1×
1×
1389×
1389×
1×
1×
1385×
1385×
1×
1×
4227×
4227×
4227×
1×
1×
1390×
1×
1×
1390×
1×
1×
85×
85×
1×
1×
1390×
1×
1×
1393×
1×
| define(["require", "exports", "../../models/enums"], function (require, exports, enums_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function isMacOS() {
var userAgent = navigator.userAgent;
return userAgent.indexOf('Mac OS') !== -1;
}
exports.isMacOS = isMacOS;
function getModifierKey() {
return isMacOS() ? 'Cmd' : 'Ctrl';
}
exports.getModifierKey = getModifierKey;
function getCommandMenuItems() {
var modifier = getModifierKey();
var blockCommandOptions = [
{
id: 'checklist-command',
type: enums_1.BlockType.Checklist,
groupBy: 'General',
label: 'Checklist',
tooltip: 'Create a checklist',
iconCss: 'e-icons e-check-box',
shortcut: modifier + "+Shift+7"
},
{
id: 'bullet-list-command',
type: enums_1.BlockType.BulletList,
groupBy: 'General',
label: 'Bullet List',
tooltip: 'Create a bullet list',
iconCss: 'e-icons e-list-unordered',
shortcut: modifier + "+Shift+8"
},
{
id: 'numbered-list-command',
type: enums_1.BlockType.NumberedList,
groupBy: 'General',
label: 'Numbered List',
tooltip: 'Create a numbered list',
iconCss: 'e-icons e-list-ordered',
shortcut: modifier + "+Shift+9"
},
{
id: 'divider-command',
type: enums_1.BlockType.Divider,
groupBy: 'General',
label: 'Divider',
tooltip: 'Add a horizontal line',
iconCss: 'e-icons e-be-divider',
shortcut: modifier + "+Shift+-"
},
{
id: 'callout-command',
type: enums_1.BlockType.Callout,
groupBy: 'General',
label: 'Callout',
tooltip: 'Add a callout block',
iconCss: 'e-icons e-be-callout',
shortcut: modifier + "+Alt+C"
},
{
id: 'code-command',
type: enums_1.BlockType.Code,
groupBy: 'Insert',
label: 'Code',
tooltip: 'Insert a code block',
iconCss: 'e-icons e-insert-code',
shortcut: modifier + "+Alt+K"
},
{
id: 'table-command',
type: enums_1.BlockType.Table,
groupBy: 'Insert',
label: 'Table',
tooltip: 'Insert a table block',
iconCss: 'e-icons e-be-table',
shortcut: modifier + "+Alt+T"
},
{
id: 'image-command',
type: enums_1.BlockType.Image,
groupBy: 'Media',
label: 'Image',
tooltip: 'Insert a image block',
iconCss: 'e-icons e-image',
shortcut: modifier + "+Alt+/"
},
{
id: 'paragraph-command',
type: enums_1.BlockType.Paragraph,
groupBy: 'Text Styles',
label: 'Paragraph',
tooltip: 'Add a paragraph',
iconCss: 'e-icons e-be-paragraph',
shortcut: modifier + "+Alt+P"
},
{
id: 'heading1-command',
type: enums_1.BlockType.Heading,
groupBy: 'Text Styles',
label: 'Heading 1',
tooltip: 'Page title or main heading',
iconCss: 'e-icons e-be-h1',
shortcut: modifier + "+Alt+1"
},
{
id: 'heading2-command',
type: enums_1.BlockType.Heading,
groupBy: 'Text Styles',
label: 'Heading 2',
tooltip: 'Section heading',
iconCss: 'e-icons e-be-h2',
shortcut: modifier + "+Alt+2"
},
{
id: 'heading3-command',
type: enums_1.BlockType.Heading,
groupBy: 'Text Styles',
label: 'Heading 3',
tooltip: 'Subsection heading',
iconCss: 'e-icons e-be-h3',
shortcut: modifier + "+Alt+3"
},
{
id: 'heading4-command',
type: enums_1.BlockType.Heading,
groupBy: 'Text Styles',
label: 'Heading 4',
tooltip: 'Smaller heading for nested content',
iconCss: 'e-icons e-be-h4',
shortcut: modifier + "+Alt+4"
},
{
id: 'collapsible-paragraph-command',
type: enums_1.BlockType.CollapsibleParagraph,
groupBy: 'Text Styles',
label: 'Collapsible Paragraph',
tooltip: 'Add a collapsible paragraph block',
iconCss: 'e-icons e-be-toggle-paragraph',
shortcut: modifier + "+Alt+5"
},
{
id: 'collapsible-heading1-command',
type: enums_1.BlockType.CollapsibleHeading,
groupBy: 'Text Styles',
label: 'Collapsible Heading 1',
tooltip: 'Add a collapsible heading1 block',
iconCss: 'e-icons e-be-toggle-h1',
shortcut: modifier + "+Alt+6"
},
{
id: 'collapsible-heading2-command',
type: enums_1.BlockType.CollapsibleHeading,
groupBy: 'Text Styles',
label: 'Collapsible Heading 2',
tooltip: 'Add a collapsible heading2 block',
iconCss: 'e-icons e-be-toggle-h2',
shortcut: modifier + "+Alt+7"
},
{
id: 'collapsible-heading3-command',
type: enums_1.BlockType.CollapsibleHeading,
groupBy: 'Text Styles',
label: 'Collapsible Heading 3',
tooltip: 'Add a collapsible heading3 block',
iconCss: 'e-icons e-be-toggle-h3',
shortcut: modifier + "+Alt+8"
},
{
id: 'collapsible-heading4-command',
type: enums_1.BlockType.CollapsibleHeading,
groupBy: 'Text Styles',
label: 'Collapsible Heading 4',
tooltip: 'Add a collapsible heading4 block',
iconCss: 'e-icons e-be-toggle-h4',
shortcut: modifier + "+Alt+9"
},
{
id: 'quote-command',
type: enums_1.BlockType.Quote,
groupBy: 'Text Styles',
label: 'Quote',
tooltip: 'Insert a quote block',
iconCss: 'e-icons e-blockquote',
shortcut: modifier + "+Alt+Q"
}
];
return blockCommandOptions;
}
exports.getCommandMenuItems = getCommandMenuItems;
function getLabelMenuItems() {
return [
{ id: 'progress', labelColor: '#678fff', text: 'In-progress', groupBy: 'Progress', iconCss: 'e-icons e-settings' },
{ id: 'hold', labelColor: '#ffdd5e', text: 'On-hold', groupBy: 'Progress', iconCss: 'e-icons e-pause' },
{ id: 'done', labelColor: '#5ac8fa', text: 'Done', groupBy: 'Progress', iconCss: 'e-icons e-check-box' },
{ id: 'high', labelColor: '#ff8a80', text: 'High', groupBy: 'Priority' },
{ id: 'medium', labelColor: '#ffb74d', text: 'Medium', groupBy: 'Priority' },
{ id: 'low', labelColor: '#81c784', text: 'Low', groupBy: 'Priority' }
];
}
exports.getLabelMenuItems = getLabelMenuItems;
function getContextMenuItems() {
var modifier = getModifierKey();
return [
{ id: 'undo', text: 'Undo', iconCss: 'e-icons e-undo', shortcut: modifier + "+Z" },
{ id: 'redo', text: 'Redo', iconCss: 'e-icons e-redo', shortcut: "" + modifier + (isMacOS() ? '+Shift+Z' : '+Y') },
{ separator: true },
{ id: 'cut', text: 'Cut', iconCss: 'e-icons e-cut', shortcut: modifier + "+X" },
{ id: 'copy', text: 'Copy', iconCss: 'e-icons e-copy', shortcut: modifier + "+C" },
{ id: 'paste', text: 'Paste', iconCss: 'e-icons e-paste', shortcut: modifier + "+V" },
{ separator: true },
{ id: 'increaseindent', text: 'Increase Indent', iconCss: 'e-icons e-increase-indent', shortcut: modifier + "+]" },
{ id: 'decreaseindent', text: 'Decrease Indent', iconCss: 'e-icons e-decrease-indent', shortcut: modifier + "+[" },
{ separator: true },
{ id: 'link', text: 'Link', iconCss: 'e-icons e-comment-show', shortcut: modifier + "+K" }
];
}
exports.getContextMenuItems = getContextMenuItems;
function getBlockActionsMenuItems() {
var modifier = getModifierKey();
return [
{ id: 'duplicate', label: 'Duplicate', iconCss: 'e-icons e-duplicate', tooltip: 'Duplicates a block', shortcut: modifier + "+D" },
{ id: 'delete', label: 'Delete', iconCss: 'e-icons e-trash', tooltip: 'Deletes a block', shortcut: modifier + "+Shift+D" },
{ id: 'moveup', label: 'Move Up', iconCss: 'e-icons e-arrow-up', tooltip: 'Moves a block up', shortcut: modifier + "+Shift+Up" },
{ id: 'movedown', label: 'Move Down', iconCss: 'e-icons e-arrow-down', tooltip: 'Moves a block down', shortcut: modifier + "+Shift+Down" }
];
}
exports.getBlockActionsMenuItems = getBlockActionsMenuItems;
function getInlineToolbarItems() {
var modifier = getModifierKey();
var inlineToolbarItems = [
{ id: 'bold', iconCss: 'e-icons e-bold', tooltipText: "Bold (" + modifier + "+B)", command: enums_1.CommandName.Bold, htmlAttributes: { 'data-command': enums_1.CommandName.Bold } },
{ id: 'italic', iconCss: 'e-icons e-italic', tooltipText: "Italic (" + modifier + "+I)", command: enums_1.CommandName.Italic, htmlAttributes: { 'data-command': enums_1.CommandName.Italic } },
{ id: 'underline', iconCss: 'e-icons e-underline', tooltipText: "Underline (" + modifier + "+U)", command: enums_1.CommandName.Underline, htmlAttributes: { 'data-command': enums_1.CommandName.Underline } },
{ id: 'strikethrough', iconCss: 'e-icons e-strikethrough', tooltipText: "Strikethrough (" + modifier + "+Shift+X)", command: enums_1.CommandName.Strikethrough, htmlAttributes: { 'data-command': enums_1.CommandName.Strikethrough } },
{ id: 'uppercase', iconCss: 'e-icons e-upper-case', tooltipText: 'Uppercase', command: enums_1.CommandName.Uppercase, htmlAttributes: { 'data-command': enums_1.CommandName.Uppercase } },
{ id: 'lowercase', iconCss: 'e-icons e-lower-case', tooltipText: 'Lowercase', command: enums_1.CommandName.Lowercase, htmlAttributes: { 'data-command': enums_1.CommandName.Lowercase } },
{ id: 'superscript', iconCss: 'e-icons e-superscript', tooltipText: 'Superscript', command: enums_1.CommandName.Superscript, htmlAttributes: { 'data-command': enums_1.CommandName.Superscript } },
{ id: 'subscript', iconCss: 'e-icons e-subscript', tooltipText: 'Subscript', command: enums_1.CommandName.Subscript, htmlAttributes: { 'data-command': enums_1.CommandName.Subscript } },
{
id: 'color',
tooltipText: 'Color',
command: enums_1.CommandName.Color,
htmlAttributes: { 'data-command': enums_1.CommandName.Color },
template: '<span class="e-toolbar-color-dropdown e-tbar-btn" id="toolbar-color-dropdown"></span>'
},
{
id: 'bgColor',
tooltipText: 'Background Color',
command: enums_1.CommandName.BackgroundColor,
htmlAttributes: { 'data-command': enums_1.CommandName.BackgroundColor },
template: '<span class="e-toolbar-bgcolor-dropdown e-tbar-btn" id="toolbar-bgcolor-dropdown"></span>'
}
];
return inlineToolbarItems;
}
exports.getInlineToolbarItems = getInlineToolbarItems;
function getUserMentionDisplayTemplate() {
return '<div class="em-avatar" style="background-color: ${avatarBgColor};">${if(avatarUrl)} <img src="${avatarUrl}" alt="${user}" class="em-img" /> ${else} <div class="em-initial">${initials}</div> ${/if} </div><div class="em-content">${user}</div>';
}
exports.getUserMentionDisplayTemplate = getUserMentionDisplayTemplate;
function getLabelMentionDisplayTemplate() {
return '${groupBy}: ${text}';
}
exports.getLabelMentionDisplayTemplate = getLabelMentionDisplayTemplate;
function getLanguageItems() {
var codeLanguageItems = [
{ language: 'plaintext', label: 'Plain Text' },
{ language: 'c', label: 'C' },
{ language: 'csharp', label: 'C#' },
{ language: 'cpp', label: 'C++' },
{ language: 'css', label: 'CSS' },
{ language: 'diff', label: 'Diff' },
{ language: 'html', label: 'HTML' },
{ language: 'java', label: 'Java' },
{ language: 'javascript', label: 'JavaScript' },
{ language: 'php', label: 'PHP' },
{ language: 'python', label: 'Python' },
{ language: 'ruby', label: 'Ruby' },
{ language: 'sql', label: 'SQL' },
{ language: 'typescript', label: 'TypeScript' },
{ language: 'xml', label: 'XML' }
];
return codeLanguageItems;
}
exports.getLanguageItems = getLanguageItems;
function getLocaleItems() {
return {
paragraph: 'Write something or ‘/’ for commands.',
heading1: 'Heading 1',
heading2: 'Heading 2',
heading3: 'Heading 3',
heading4: 'Heading 4',
collapsibleParagraph: 'Collapsible Paragraph',
collapsibleHeading1: 'Collapsible Heading 1',
collapsibleHeading2: 'Collapsible Heading 2',
collapsibleHeading3: 'Collapsible Heading 3',
collapsibleHeading4: 'Collapsible Heading 4',
bulletList: 'Add item',
numberedList: 'Add item',
checklist: 'Todo',
quote: 'Write a quote',
callout: 'Write a callout',
addIconTooltip: 'Click to insert below',
dragIconTooltipActionMenu: 'Click to open',
dragIconTooltip: '(Hold to drag)',
insertLink: 'Insert Link',
linkText: 'Text',
linkTextPlaceholder: 'Link text',
linkUrl: 'URL',
linkUrlPlaceholder: 'https://example.com',
linkTitle: 'Title',
linkTitlePlaceholder: 'Link title',
linkOpenInNewWindow: 'Open in new window',
linkInsert: 'Insert',
linkRemove: 'Remove',
linkCancel: 'Cancel',
codeCopyTooltip: 'Copy code'
};
}
exports.getLocaleItems = getLocaleItems;
function getCurrentLocaleJson(localeInstance) {
return {
paragraph: localeInstance.getConstant('paragraph'),
heading1: localeInstance.getConstant('heading1'),
heading2: localeInstance.getConstant('heading2'),
heading3: localeInstance.getConstant('heading3'),
heading4: localeInstance.getConstant('heading4'),
collapsibleParagraph: localeInstance.getConstant('collapsibleParagraph'),
collapsibleHeading1: localeInstance.getConstant('collapsibleHeading1'),
collapsibleHeading2: localeInstance.getConstant('collapsibleHeading2'),
collapsibleHeading3: localeInstance.getConstant('collapsibleHeading3'),
collapsibleHeading4: localeInstance.getConstant('collapsibleHeading4'),
bulletList: localeInstance.getConstant('bulletList'),
numberedList: localeInstance.getConstant('numberedList'),
checklist: localeInstance.getConstant('checklist'),
quote: localeInstance.getConstant('quote'),
callout: localeInstance.getConstant('callout'),
addIconTooltip: localeInstance.getConstant('addIconTooltip'),
dragIconTooltipActionMenu: localeInstance.getConstant('dragIconTooltipActionMenu'),
dragIconTooltip: localeInstance.getConstant('dragIconTooltip'),
insertLink: localeInstance.getConstant('insertLink'),
linkText: localeInstance.getConstant('linkText'),
linkTextPlaceholder: localeInstance.getConstant('linkTextPlaceholder'),
linkUrl: localeInstance.getConstant('linkUrl'),
linkUrlPlaceholder: localeInstance.getConstant('linkUrlPlaceholder'),
linkTitle: localeInstance.getConstant('linkTitle'),
linkTitlePlaceholder: localeInstance.getConstant('linkTitlePlaceholder'),
linkOpenInNewWindow: localeInstance.getConstant('linkOpenInNewWindow'),
linkInsert: localeInstance.getConstant('linkInsert'),
linkRemove: localeInstance.getConstant('linkRemove'),
linkCancel: localeInstance.getConstant('linkCancel'),
codeCopyTooltip: localeInstance.getConstant('codeCopyTooltip')
};
}
exports.getCurrentLocaleJson = getCurrentLocaleJson;
});
|