import { FormatBold, FormatItalic, FormatUnderlined, FormatStrikethrough, FormatColorText, Link, Image, FormatListBulleted, FormatListNumbered, FormatIndentIncrease, FormatIndentDecrease, FormatAlignLeft, FormatAlignCenter, FormatAlignRight, FormatAlignJustify, Code, TableChart, InsertEmoticon, Undo, Redo, MoreVert, FormatQuote, HorizontalRule, Videocam, TextFields, FontDownload, Highlight } from "@mui/icons-material"; import { ToolbarType } from './rds-comp-toolbar-types'; import { type ToolbarConfig } from './rds-comp-toolbar-config-types'; export const getToolbarConfig = (type: ToolbarType | string): ToolbarConfig => { switch (type) { case ToolbarType.InlineEditor: case 'inline-editor': return { sections: [ [ { icon: , action: 'bold', ariaLabel: 'Bold' }, { icon: , action: 'italic', ariaLabel: 'Italic' }, { icon: , action: 'underline', ariaLabel: 'Underline' }, { icon: , action: 'strikethrough', ariaLabel: 'Strikethrough' }, { icon: A, action: 'textFormat', hasDropdown: true, ariaLabel: 'Text Format' }, { icon: , action: 'emoji', hasDropdown: true, ariaLabel: 'Insert Emoji' }, { icon: ΒΆ, action: 'paragraph', hasDropdown: true, ariaLabel: 'Paragraph' }, { icon: , action: 'textColor', hasDropdown: true, ariaLabel: 'Text Color' }, { icon: , action: 'bulletList', hasDropdown: true, ariaLabel: 'Bullet List' }, { icon: , action: 'numberList', hasDropdown: true, ariaLabel: 'Numbered List' }, { icon: , action: 'indent', ariaLabel: 'Increase Indent' }, { icon: , action: 'outdent', ariaLabel: 'Decrease Indent' }, { icon: , action: 'table', ariaLabel: 'Insert Table' }, { icon: , action: 'linkAction', ariaLabel: 'Link Action' }, { icon: , action: 'image', ariaLabel: 'Insert Image' }, { icon: πŸ“„, action: 'document', ariaLabel: 'Document' }, { icon: , action: 'video', ariaLabel: 'Insert Video' }, { icon: , action: 'undo', ariaLabel: 'Undo' }, { icon: , action: 'redo', ariaLabel: 'Redo' }, { icon: , action: 'more', ariaLabel: 'More Options' }, ] ] }; case ToolbarType.MoreText: case 'more-text': return { sections: [ [ { icon: , action: 'bold', ariaLabel: 'Bold' }, { icon: , action: 'italic', ariaLabel: 'Italic' }, { icon: , action: 'underline', ariaLabel: 'Underline' }, { icon: , action: 'strikethrough', ariaLabel: 'Strikethrough' }, { icon: A, action: 'textFormat', hasDropdown: true, ariaLabel: 'Text Format' }, { icon: , action: 'emoji', hasDropdown: true, ariaLabel: 'Insert Emoji' }, { icon: ΒΆ, action: 'paragraph', hasDropdown: true, ariaLabel: 'Paragraph' }, { icon: , action: 'textColor', hasDropdown: true, ariaLabel: 'Text Color' }, { icon: , action: 'bulletList', hasDropdown: true, ariaLabel: 'Bullet List' }, { icon: , action: 'numberList', hasDropdown: true, ariaLabel: 'Numbered List' }, { icon: , action: 'indent', ariaLabel: 'Increase Indent' }, { icon: , action: 'outdent', ariaLabel: 'Decrease Indent' }, { icon: , action: 'table', ariaLabel: 'Insert Table' }, { icon: , action: 'linkAction', ariaLabel: 'Link Action' }, { icon: , action: 'image', ariaLabel: 'Insert Image' }, { icon: πŸ“„, action: 'document', ariaLabel: 'Document' }, { icon: , action: 'video', ariaLabel: 'Insert Video' }, { icon: , action: 'undo', ariaLabel: 'Undo', className: 'rds-comp-toolbar__button--muted' }, { icon: , action: 'redo', ariaLabel: 'Redo', className: 'rds-comp-toolbar__button--muted' }, { icon: , action: 'more', ariaLabel: 'More Options' }, ], [ { icon: , action: 'strikethrough2', ariaLabel: 'Strikethrough' }, { icon: xβ‚‚, action: 'subscript', ariaLabel: 'Subscript' }, { icon: xΒ², action: 'superscript', ariaLabel: 'Superscript' }, { icon: , action: 'fontStyle', hasDropdown: true, ariaLabel: 'Font Style' }, { icon: , action: 'fontSize', hasDropdown: true, ariaLabel: 'Font Size' }, { icon: πŸ–Š, action: 'pen', ariaLabel: 'Pen' }, { icon: πŸ–, action: 'marker', hasDropdown: true, ariaLabel: 'Marker' }, { icon: , action: 'highlight', hasDropdown: true, ariaLabel: 'Highlight' }, { icon: , action: 'textColor2', ariaLabel: 'Text Color' }, ] ] }; case ToolbarType.MoreParagraph: case 'more-paragraph': return { sections: [ [ { icon: , action: 'bold', ariaLabel: 'Bold' }, { icon: , action: 'italic', ariaLabel: 'Italic' }, { icon: , action: 'underline', ariaLabel: 'Underline' }, { icon: , action: 'strikethrough', ariaLabel: 'Strikethrough' }, { icon: A, action: 'textFormat', hasDropdown: true, ariaLabel: 'Text Format' }, { icon: , action: 'emoji', hasDropdown: true, ariaLabel: 'Insert Emoji' }, { icon: ΒΆ, action: 'paragraph', hasDropdown: true, ariaLabel: 'Paragraph' }, { icon: , action: 'textColor', hasDropdown: true, ariaLabel: 'Text Color' }, { icon: , action: 'bulletList', hasDropdown: true, ariaLabel: 'Bullet List' }, { icon: , action: 'numberList', hasDropdown: true, ariaLabel: 'Numbered List' }, { icon: , action: 'indent', ariaLabel: 'Increase Indent' }, { icon: , action: 'outdent', ariaLabel: 'Decrease Indent' }, { icon: , action: 'table', ariaLabel: 'Insert Table' }, { icon: , action: 'linkAction', ariaLabel: 'Link Action' }, { icon: , action: 'image', ariaLabel: 'Insert Image' }, { icon: πŸ“„, action: 'document', ariaLabel: 'Document' }, { icon: , action: 'video', ariaLabel: 'Insert Video' }, { icon: , action: 'undo', ariaLabel: 'Undo' }, { icon: , action: 'redo', ariaLabel: 'Redo' }, { icon: , action: 'more', ariaLabel: 'More Options' }, ], [ { icon: , action: 'alignLeft', ariaLabel: 'Align Left' }, { icon: , action: 'alignCenter', ariaLabel: 'Align Center' }, { icon: , action: 'alignRight', ariaLabel: 'Align Right' }, { icon: , action: 'alignJustify', ariaLabel: 'Align Justify' }, { icon: , action: 'outdent2', hasDropdown: true, ariaLabel: 'Decrease Indent' }, { icon: , action: 'indent2', hasDropdown: true, ariaLabel: 'Increase Indent' }, { icon: ΒΆ+, action: 'paragraphPlus', hasDropdown: true, ariaLabel: 'Paragraph Plus' }, { icon: πŸ–+, action: 'markerPlus', hasDropdown: true, ariaLabel: 'Marker Plus' }, { icon: πŸ“‹, action: 'clipboard', ariaLabel: 'Clipboard' }, { icon: , action: 'bulletList2', ariaLabel: 'Bullet List' }, { icon: , action: 'quote', hasDropdown: true, ariaLabel: 'Quote' }, ] ] }; case ToolbarType.MoreRichContent: case 'more-rich-content': return { sections: [ [ { icon: , action: 'bold', ariaLabel: 'Bold' }, { icon: , action: 'italic', ariaLabel: 'Italic' }, { icon: , action: 'underline', ariaLabel: 'Underline' }, { icon: , action: 'strikethrough', ariaLabel: 'Strikethrough' }, { icon: A, action: 'textFormat', hasDropdown: true, ariaLabel: 'Text Format' }, { icon: , action: 'emoji', hasDropdown: true, ariaLabel: 'Insert Emoji' }, { icon: ΒΆ, action: 'paragraph', hasDropdown: true, ariaLabel: 'Paragraph' }, { icon: , action: 'textColor', hasDropdown: true, ariaLabel: 'Text Color' }, { icon: , action: 'bulletList', hasDropdown: true, ariaLabel: 'Bullet List' }, { icon: , action: 'numberList', hasDropdown: true, ariaLabel: 'Numbered List' }, { icon: , action: 'indent', ariaLabel: 'Increase Indent' }, { icon: , action: 'outdent', ariaLabel: 'Decrease Indent' }, { icon: , action: 'table', ariaLabel: 'Insert Table' }, { icon: , action: 'linkAction', ariaLabel: 'Link Action' }, { icon: , action: 'image', ariaLabel: 'Insert Image' }, { icon: πŸ“„, action: 'document', ariaLabel: 'Document' }, { icon: , action: 'video', ariaLabel: 'Insert Video' }, { icon: , action: 'undo', ariaLabel: 'Undo' }, { icon: , action: 'redo', ariaLabel: 'Redo' }, { icon: , action: 'more', ariaLabel: 'More Options' }, ], [ { icon: , action: 'insertTable', ariaLabel: 'Insert Table' }, { icon: , action: 'insertEmoji', hasDropdown: true, ariaLabel: 'Insert Emoji' }, { icon: Ξ©, action: 'omega', ariaLabel: 'Omega' }, { icon: πŸ“„, action: 'insertDocument', ariaLabel: 'Insert Document' }, { icon: , action: 'horizontalRule', ariaLabel: 'Horizontal Rule' }, ] ] }; case ToolbarType.Misc: case 'misc': return { sections: [ [ { icon: , action: 'bold', ariaLabel: 'Bold' }, { icon: , action: 'italic', ariaLabel: 'Italic' }, { icon: , action: 'underline', ariaLabel: 'Underline' }, { icon: , action: 'strikethrough', ariaLabel: 'Strikethrough' }, { icon: A, action: 'textFormat', hasDropdown: true, ariaLabel: 'Text Format' }, { icon: , action: 'emoji', hasDropdown: true, ariaLabel: 'Insert Emoji' }, { icon: ΒΆ, action: 'paragraph', hasDropdown: true, ariaLabel: 'Paragraph' }, { icon: , action: 'textColor', hasDropdown: true, ariaLabel: 'Text Color' }, { icon: , action: 'bulletList', hasDropdown: true, ariaLabel: 'Bullet List' }, { icon: , action: 'numberList', hasDropdown: true, ariaLabel: 'Numbered List' }, { icon: , action: 'indent', ariaLabel: 'Increase Indent' }, { icon: , action: 'outdent', ariaLabel: 'Decrease Indent' }, { icon: , action: 'table', ariaLabel: 'Insert Table' }, { icon: , action: 'linkAction', ariaLabel: 'Link Action' }, { icon: , action: 'image', ariaLabel: 'Insert Image' }, { icon: πŸ“„, action: 'document', ariaLabel: 'Document' }, { icon: , action: 'video', ariaLabel: 'Insert Video' }, { icon: , action: 'undo', ariaLabel: 'Undo' }, { icon: , action: 'redo', ariaLabel: 'Redo' }, { icon: , action: 'more', ariaLabel: 'More Options' }, ], [ { icon: β†Ά, action: 'rotate', ariaLabel: 'Rotate' }, { icon: πŸ–¨, action: 'print', ariaLabel: 'Print' }, { icon: πŸ“„, action: 'document2', ariaLabel: 'Document' }, { icon: A, action: 'textTool', ariaLabel: 'Text Tool' }, { icon: #, action: 'hash', ariaLabel: 'Hash' }, { icon: , action: 'code', ariaLabel: 'Code' }, { icon: ?, action: 'help', ariaLabel: 'Help' }, ] ] }; case ToolbarType.FullFeatured: case 'full-featured': default: return { sections: [ [ { icon: , action: 'bold', ariaLabel: 'Bold' }, { icon: , action: 'italic', ariaLabel: 'Italic' }, { icon: , action: 'underline', ariaLabel: 'Underline' }, { icon: , action: 'strikethrough', ariaLabel: 'Strikethrough' }, { icon: A, action: 'textFormat', hasDropdown: true, ariaLabel: 'Text Format' }, { icon: , action: 'emoji', hasDropdown: true, ariaLabel: 'Insert Emoji' }, { icon: ΒΆ, action: 'paragraph', hasDropdown: true, ariaLabel: 'Paragraph' }, { icon: , action: 'textColor', hasDropdown: true, ariaLabel: 'Text Color' }, { icon: , action: 'bulletList', hasDropdown: true, ariaLabel: 'Bullet List' }, { icon: , action: 'numberList', hasDropdown: true, ariaLabel: 'Numbered List' }, { icon: , action: 'indent', ariaLabel: 'Increase Indent' }, { icon: , action: 'outdent', ariaLabel: 'Decrease Indent' }, { icon: , action: 'table', ariaLabel: 'Insert Table' }, { icon: , action: 'linkAction', ariaLabel: 'Link Action' }, { icon: , action: 'image', ariaLabel: 'Insert Image' }, { icon: πŸ“„, action: 'document', ariaLabel: 'Document' }, { icon: , action: 'video', ariaLabel: 'Insert Video' }, { icon: , action: 'undo', ariaLabel: 'Undo' }, { icon: , action: 'redo', ariaLabel: 'Redo' }, { icon: , action: 'more', ariaLabel: 'More Options' }, ] ] }; } };