@progress/kendo-react-editor
Version:
Kendo UI for React Editor package
506 lines • 19.6 kB
JavaScript
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
var messages_1 = require("./../messages");
var kendo_editor_common_1 = require("@progress/kendo-editor-common");
var listsTypes = __assign({}, kendo_editor_common_1.indentRules.listsTypes);
/**
* Represents a wrapping namespace for the tool settings of the Editor.
*/
var EditorToolsSettings;
(function (EditorToolsSettings) {
/**
* @hidden
*/
var buttonCommonProps = {
type: 'button'
};
/**
* The object of the Bold tool settings.
*/
EditorToolsSettings.bold = __assign({}, kendo_editor_common_1.bold, { props: __assign({ icon: 'bold' }, buttonCommonProps), messages: {
title: messages_1.keys.bold
}, commandName: 'Bold' });
/**
* The object of the Italic tool settings.
*/
EditorToolsSettings.italic = __assign({}, kendo_editor_common_1.italic, { props: __assign({ icon: 'italic' }, buttonCommonProps), messages: {
title: messages_1.keys.italic
}, commandName: 'Italic' });
/**
* The object of the Underline tool settings.
*/
EditorToolsSettings.underline = __assign({}, kendo_editor_common_1.underline, { props: __assign({ icon: 'underline' }, buttonCommonProps), messages: {
title: messages_1.keys.underline
}, commandName: 'Underline' });
/**
* The object of the Strikethrough tool settings.
*/
EditorToolsSettings.strikethrough = __assign({}, kendo_editor_common_1.strikethrough, { props: __assign({ icon: 'strikethrough' }, buttonCommonProps), messages: {
title: messages_1.keys.strikethrough
}, commandName: 'Strikethrough' });
/**
* The object of the Subscript tool settings.
*/
EditorToolsSettings.subscript = __assign({}, kendo_editor_common_1.subscript, { props: __assign({ icon: 'subscript' }, buttonCommonProps), messages: {
title: messages_1.keys.subscript
}, commandName: 'Subscript' });
/**
* The object of the Superscript tool settings.
*/
EditorToolsSettings.superscript = __assign({}, kendo_editor_common_1.superscript, { props: __assign({ icon: 'superscript' }, buttonCommonProps), messages: {
title: messages_1.keys.superscript
}, commandName: 'Superscript' });
/**
* The object of the Link tool settings.
*/
EditorToolsSettings.link = __assign({}, kendo_editor_common_1.link, { props: __assign({ icon: 'link-horizontal' }, buttonCommonProps), messages: {
insertHyperlink: messages_1.keys.insertHyperlink,
insertHyperlinkDialogTitle: messages_1.keys.insertHyperlinkDialogTitle,
insertHyperlinkAddress: messages_1.keys.insertHyperlinkAddress,
insertHyperlinkTitle: messages_1.keys.insertHyperlinkTitle,
insertHyperlinkNewWindow: messages_1.keys.insertHyperlinkNewWindow,
insertHyperlinkCancel: messages_1.keys.insertHyperlinkCancel,
insertHyperlinkInsert: messages_1.keys.insertHyperlinkInsert
}, commandName: 'Link' });
/**
* The object of the Link tool settings.
*/
EditorToolsSettings.insertFile = __assign({}, kendo_editor_common_1.link, { props: __assign({ icon: 'file-add' }, buttonCommonProps), messages: {
insertHyperlink: messages_1.keys.insertFile,
insertHyperlinkDialogTitle: messages_1.keys.insertFileDialogTitle,
insertHyperlinkAddress: messages_1.keys.insertFileAddress,
insertHyperlinkTitle: messages_1.keys.insertFileTitle,
insertHyperlinkNewWindow: '',
insertHyperlinkCancel: messages_1.keys.insertFileCancel,
insertHyperlinkInsert: messages_1.keys.insertFileInsert
}, commandName: 'InsertFile', linkTarget: false });
/**
* The object of the InsertTable tool settings.
*/
EditorToolsSettings.insertTable = {
props: __assign({ icon: 'table-insert' }, buttonCommonProps),
messages: {
createTable: messages_1.keys.createTable,
createTableHint: messages_1.keys.createTableHint
},
commandName: 'InsertTable'
};
/**
* The object of the AddRowBefore tool settings.
*/
EditorToolsSettings.addRowBefore = {
props: __assign({ icon: 'table-row-insert-above' }, buttonCommonProps),
messages: {
title: messages_1.keys.addRowBefore
},
commandName: 'AddRowBefore'
};
/**
* The object of the AddRowAfter tool settings.
*/
EditorToolsSettings.addRowAfter = {
props: __assign({ icon: 'table-row-insert-below' }, buttonCommonProps),
messages: {
title: messages_1.keys.addRowAfter
},
commandName: 'AddRowAfter'
};
/**
* The object of the AddColumnBefore tool settings.
*/
EditorToolsSettings.addColumnBefore = {
props: __assign({ icon: 'table-column-insert-left' }, buttonCommonProps),
messages: {
title: messages_1.keys.addColumnBefore
},
commandName: 'AddColumnBefore'
};
/**
* The object of the AddColumnAfter tool settings.
*/
EditorToolsSettings.addColumnAfter = {
props: __assign({ icon: 'table-column-insert-right' }, buttonCommonProps),
messages: {
title: messages_1.keys.addColumnAfter
},
commandName: 'AddColumnAfter'
};
/**
* The object of the DeleteRow tool settings.
*/
EditorToolsSettings.deleteRow = {
props: __assign({ icon: 'table-row-delete' }, buttonCommonProps),
messages: {
title: messages_1.keys.deleteRow
},
commandName: 'DeleteRow'
};
/**
* The object of the DeleteColumn tool settings.
*/
EditorToolsSettings.deleteColumn = {
props: __assign({ icon: 'table-column-delete' }, buttonCommonProps),
messages: {
title: messages_1.keys.deleteColumn
},
commandName: 'DeleteColumn'
};
/**
* The object of the DeleteTable tool settings.
*/
EditorToolsSettings.deleteTable = {
props: __assign({ icon: 'table-delete' }, buttonCommonProps),
messages: {
title: messages_1.keys.deleteTable
},
commandName: 'DeleteTable'
};
/**
* The object of the MergeCells tool settings.
*/
EditorToolsSettings.mergeCells = {
props: __assign({ icon: 'cells-merge' }, buttonCommonProps),
messages: {
title: messages_1.keys.mergeCells
},
commandName: 'MergeCells'
};
/**
* The object of the SplitCell tool settings.
*/
EditorToolsSettings.splitCell = {
props: __assign({ icon: 'cell-split-horizontally' }, buttonCommonProps),
messages: {
title: messages_1.keys.splitCell
},
commandName: 'SplitCell'
};
/**
* The object of the Print tool settings.
*/
EditorToolsSettings.print = {
props: __assign({ icon: 'print' }, buttonCommonProps),
messages: {
title: messages_1.keys.print
}
};
/**
* The object of the Print tool settings.
*/
EditorToolsSettings.selectAll = {
props: __assign({ icon: 'select-all' }, buttonCommonProps),
messages: {
title: messages_1.keys.selectAll
}
};
/**
* The object of the Print tool settings.
*/
EditorToolsSettings.pdf = {
props: __assign({ icon: 'pdf' }, buttonCommonProps),
messages: {
title: messages_1.keys.pdf
}
};
/**
* The PDF export options.
*
* const savePdfOptions = {
* fileName: 'editor.pdf',
* paperSize: 'A4',
* margin: '1cm'
* };
*/
EditorToolsSettings.savePdfOptions = {
fileName: 'editor.pdf',
paperSize: 'A4',
margin: '1cm'
};
/**
* The object of the CleanFormatting tool settings.
*/
EditorToolsSettings.cleanFormatting = {
props: __assign({ icon: 'clear-css' }, buttonCommonProps),
messages: {
title: messages_1.keys.cleanFormatting
},
commandName: 'CleanFormatting'
};
/**
* The object of the InsertImage tool settings.
*/
EditorToolsSettings.image = {
node: 'image',
props: __assign({ icon: 'image' }, buttonCommonProps),
messages: {
insertImage: messages_1.keys.insertImage,
insertImageDialogTitle: messages_1.keys.insertImageDialogTitle,
insertImageAddress: messages_1.keys.insertImageAddress,
insertImageTitle: messages_1.keys.insertImageTitle,
insertImageAltText: messages_1.keys.insertImageAltText,
insertImageWidth: messages_1.keys.insertImageWidth,
insertImageHeight: messages_1.keys.insertImageHeight,
insertImageCancel: messages_1.keys.insertImageCancel,
insertImageInsert: messages_1.keys.insertImageInsert
},
commandName: 'InsertImage'
};
/**
* The object of the ViewHtml tool settings.
*/
EditorToolsSettings.viewHtml = {
props: __assign({ icon: 'html' }, buttonCommonProps),
messages: {
viewHtml: messages_1.keys.viewHtml,
viewHtmlDialogTitle: messages_1.keys.viewHtmlDialogTitle,
viewHtmlCancel: messages_1.keys.viewHtmlCancel,
viewHtmlUpdate: messages_1.keys.viewHtmlUpdate
},
commandName: 'SetContent'
};
/**
* The object of the Find and Replace tool settings.
*/
EditorToolsSettings.findAndReplace = {
props: __assign({ icon: 'find' }, buttonCommonProps),
messages: {
findReplaceToolTitle: messages_1.keys.findReplaceToolTitle,
findReplaceDialogTitle: messages_1.keys.findReplaceDialogTitle,
findReplaceTabFind: messages_1.keys.findReplaceTabFind,
findReplaceTabReplace: messages_1.keys.findReplaceTabReplace,
findReplaceFindWhat: messages_1.keys.findReplaceFindWhat,
findReplaceReplaceWith: messages_1.keys.findReplaceReplaceWith,
findReplaceReplace: messages_1.keys.findReplaceReplace,
findReplaceReplaceAll: messages_1.keys.findReplaceReplaceAll,
findReplaceMatchCase: messages_1.keys.findReplaceMatchCase,
findReplaceMatchWord: messages_1.keys.findReplaceMatchWord,
findReplaceMatchCyclic: messages_1.keys.findReplaceMatchCyclic,
findReplaceUseRegExp: messages_1.keys.findReplaceUseRegExp,
findReplacePrevMatch: messages_1.keys.findReplacePrevMatch,
findReplaceNextMatch: messages_1.keys.findReplaceNextMatch,
findReplaceMatches: messages_1.keys.findReplaceMatches
}
};
/**
* The object of the Unlink tool settings.
*/
EditorToolsSettings.unlink = __assign({}, kendo_editor_common_1.link, { props: __assign({ icon: 'unlink-horizontal' }, buttonCommonProps), messages: {
title: messages_1.keys.unlink
}, commandName: 'Unlink' });
/**
* The object of the Undo tool settings.
*/
EditorToolsSettings.undo = {
props: __assign({ icon: 'undo' }, buttonCommonProps),
messages: {
title: messages_1.keys.undo
},
commandName: 'Undo'
};
/**
* The object of the Redo tool settings.
*/
EditorToolsSettings.redo = {
props: __assign({ icon: 'redo' }, buttonCommonProps),
messages: {
title: messages_1.keys.redo
},
commandName: 'Redo'
};
/**
* The object of the FontSize tool settings.
*/
EditorToolsSettings.fontSize = {
style: 'font-size',
defaultItem: { text: messages_1.messages[messages_1.keys.fontSize], value: '', localizationKey: messages_1.keys.fontSize },
items: [
{ text: '1 (8pt)', value: 'xx-small' },
{ text: '2 (10pt)', value: 'x-small' },
{ text: '3 (12pt)', value: 'small' },
{ text: '4 (14pt)', value: 'medium' },
{ text: '5 (18pt)', value: 'large' },
{ text: '6 (24pt)', value: 'x-large' },
{ text: '7 (36pt)', value: 'xx-large' }
],
commandName: 'FontSize'
};
/**
* The object of the FontName tool settings.
*/
EditorToolsSettings.fontName = {
style: 'font-family',
defaultItem: { text: messages_1.messages[messages_1.keys.fontName], value: '', localizationKey: messages_1.keys.fontName },
items: [
{ text: 'Arial', value: 'Arial, Helvetica, sans-serif',
style: { fontFamily: 'Arial, Helvetica, sans-serif' } },
{ text: 'Courier New', value: '\'Courier New\', Courier, monospace',
style: { fontFamily: '\'Courier New\', Courier, monospace' } },
{ text: 'Georgia', value: 'Georgia, serif',
style: { fontFamily: 'Georgia, serif' } },
{ text: 'Impact', value: 'Impact, Charcoal, sans-serif',
style: { fontFamily: 'Impact, Charcoal, sans-serif' } },
{ text: 'Lucida Console', value: '\'Lucida Console\', Monaco, monospace',
style: { fontFamily: '\'Lucida Console\', Monaco, monospace' } },
{ text: 'Tahoma', value: 'Tahoma, Geneva, sans-serif',
style: { fontFamily: 'Tahoma, Geneva, sans-serif' } },
{ text: 'Times New Roman', value: '\'Times New Roman\', Times,serif',
style: { fontFamily: '\'Times New Roman\', Times,serif' } },
{ text: 'Trebuchet MS', value: '\'Trebuchet MS\', Helvetica, sans-serif',
style: { fontFamily: '\'Trebuchet MS\', Helvetica, sans-serif' } },
{ text: 'Verdana', value: 'Verdana, Geneva, sans-serif',
style: { fontFamily: 'Verdana, Geneva, sans-serif' } }
],
commandName: 'FontName'
};
/**
* The object of the FormatBlock tool settings.
*/
EditorToolsSettings.formatBlock = {
defaultItem: { text: messages_1.messages[messages_1.keys.format], value: '', localizationKey: messages_1.keys.format },
items: [
{ text: 'Paragraph', value: 'p', style: { display: 'block', marginLeft: 0 } },
{ text: 'Heading 1', value: 'h1', style: { display: 'block', fontSize: '2em', marginLeft: 0, fontWeight: 'bold' } },
{ text: 'Heading 2', value: 'h2', style: { display: 'block', fontSize: '1.5em', marginLeft: 0, fontWeight: 'bold' } },
{ text: 'Heading 3', value: 'h3', style: { display: 'block', fontSize: '1.17em', marginLeft: 0, fontWeight: 'bold' } },
{ text: 'Heading 4', value: 'h4', style: { display: 'block', fontSize: '1em', marginLeft: 0, fontWeight: 'bold' } },
{ text: 'Heading 5', value: 'h5', style: { display: 'block', fontSize: '0.83em', marginLeft: 0, fontWeight: 'bold' } },
{ text: 'Heading 6', value: 'h6', style: { display: 'block', fontSize: '0.67em', marginLeft: 0, fontWeight: 'bold' } }
],
commandName: 'FormatBlock'
};
/**
* The object of the ForeColor tool settings.
*/
EditorToolsSettings.foreColor = {
style: 'color',
colorPickerProps: {
icon: 'foreground-color',
view: 'palette'
},
commandName: 'ForeColor'
};
/**
* The object of the BackColor tool settings.
*/
EditorToolsSettings.backColor = {
style: 'background-color',
colorPickerProps: {
icon: 'background',
view: 'palette'
},
commandName: 'BackColor'
};
/**
* The object of the AlignLeft tool settings.
*/
EditorToolsSettings.alignLeft = {
actions: kendo_editor_common_1.alignLeftRules.slice(),
props: __assign({ icon: 'align-left' }, buttonCommonProps),
messages: {
title: messages_1.keys.alignLeft
},
commandName: 'AlignLeft'
};
/**
* The object of the AlignRight tool settings.
*/
EditorToolsSettings.alignRight = {
actions: kendo_editor_common_1.alignRightRules.slice(),
props: __assign({ icon: 'align-right' }, buttonCommonProps),
messages: {
title: messages_1.keys.alignRight
},
commandName: 'AlignRight'
};
/**
* The object of the AlignCenter tool settings.
*/
EditorToolsSettings.alignCenter = {
actions: kendo_editor_common_1.alignCenterRules.slice(),
props: __assign({ icon: 'align-center' }, buttonCommonProps),
messages: {
title: messages_1.keys.alignCenter
},
commandName: 'AlignCenter'
};
/**
* The object of the AlignJustify tool settings.
*/
EditorToolsSettings.alignJustify = {
actions: kendo_editor_common_1.alignJustifyRules.slice(),
props: __assign({ icon: 'align-justify' }, buttonCommonProps),
messages: {
title: messages_1.keys.alignJustify
},
commandName: 'AlignJustify'
};
/**
* The object of the AlignRemove tool settings.
*/
EditorToolsSettings.alignRemove = {
actions: kendo_editor_common_1.alignRemoveRules.slice(),
props: __assign({ icon: 'align-remove' }, buttonCommonProps),
messages: {},
commandName: 'AlignRemove'
};
/**
* The object of the Indent tool settings.
*/
EditorToolsSettings.indent = {
actions: kendo_editor_common_1.indentRules.nodes,
listsTypes: listsTypes,
props: __assign({ icon: 'indent-increase' }, buttonCommonProps),
messages: {
title: messages_1.keys.indent
},
commandName: 'Indent'
};
/**
* The object of the Outdent tool settings.
*/
EditorToolsSettings.outdent = {
actions: kendo_editor_common_1.outdentRules.nodes,
listsTypes: listsTypes,
props: __assign({ icon: 'indent-decrease' }, buttonCommonProps),
messages: {
title: messages_1.keys.outdent
},
commandName: 'Outdent'
};
/**
* The object of the OrderedList tool settings.
*/
EditorToolsSettings.orderedList = {
listType: listsTypes.orderedList,
props: __assign({ icon: 'list-ordered' }, buttonCommonProps),
messages: {
title: messages_1.keys.orderedList
},
commandName: 'OrderedList',
types: __assign({}, listsTypes)
};
/**
* The object of the UnorderedList tool settings.
*/
EditorToolsSettings.bulletList = {
listType: listsTypes.bulletList,
props: __assign({ icon: 'list-unordered' }, buttonCommonProps),
messages: {
title: messages_1.keys.bulletList
},
commandName: 'UnorderedList',
types: __assign({}, listsTypes)
};
})(EditorToolsSettings = exports.EditorToolsSettings || (exports.EditorToolsSettings = {}));
//# sourceMappingURL=toolsSettings.js.map