ngx-editor
Version:
WYSIWYG Editor for Angular Applications
2 lines (1 loc) • 50.7 kB
Source Map (JSON)
{"version":3,"file":"ngx-editor.umd.js.map","sources":["ng://ngx-editor/app/ngx-editor/common/utils/ngx-editor.utils.ts","ng://ngx-editor/app/ngx-editor/common/services/command-executor.service.ts","ng://ngx-editor/app/ngx-editor/common/services/message.service.ts","ng://ngx-editor/app/ngx-editor/common/ngx-editor.defaults.ts","ng://ngx-editor/app/ngx-editor/ngx-editor.component.ts","ng://ngx-editor/app/ngx-editor/ngx-grippie/ngx-grippie.component.ts","ng://ngx-editor/app/ngx-editor/ngx-editor-message/ngx-editor-message.component.ts","ng://ngx-editor/app/ngx-editor/ngx-editor-toolbar/ngx-editor-toolbar.component.ts","ng://ngx-editor/app/ngx-editor/ngx-editor.module.ts","ng://ngx-editor/app/ngx-editor/validators/maxlength-validator.ts"],"sourcesContent":["/**\n * enable or disable toolbar based on configuration\n *\n * @param value toolbar item\n * @param toolbar toolbar configuration object\n */\nexport function canEnableToolbarOptions(value: string, toolbar: any): boolean {\n if (value) {\n if (toolbar['length'] === 0) {\n return true;\n } else {\n const found = toolbar.filter(array => {\n return array.indexOf(value) !== -1;\n });\n\n return found.length ? true : false;\n }\n } else {\n return false;\n }\n}\n\n/**\n * set editor configuration\n *\n * @param value configuration via [config] property\n * @param ngxEditorConfig default editor configuration\n * @param input direct configuration inputs via directives\n */\nexport function getEditorConfiguration(value: any, ngxEditorConfig: any, input: any): any {\n for (const i in ngxEditorConfig) {\n if (i) {\n if (input[i] !== undefined) {\n value[i] = input[i];\n }\n if (!value.hasOwnProperty(i)) {\n value[i] = ngxEditorConfig[i];\n }\n }\n }\n\n return value;\n}\n\n/**\n * return vertical if the element is the resizer property is set to basic\n *\n * @param resizer type of resizer, either basic or stack\n */\nexport function canResize(resizer: string): any {\n if (resizer === 'basic') {\n return 'vertical';\n }\n return false;\n}\n\n/**\n * save selection when the editor is focussed out\n */\nexport function saveSelection(): any {\n if (window.getSelection) {\n const sel = window.getSelection();\n if (sel.getRangeAt && sel.rangeCount) {\n return sel.getRangeAt(0);\n }\n } else if (document.getSelection && document.createRange) {\n return document.createRange();\n }\n return null;\n}\n\n/**\n * restore selection when the editor is focussed in\n *\n * @param range saved selection when the editor is focussed out\n */\nexport function restoreSelection(range): boolean {\n if (range) {\n if (window.getSelection) {\n const sel = window.getSelection();\n sel.removeAllRanges();\n sel.addRange(range);\n return true;\n } else if (document.getSelection && range.select) {\n range.select();\n return true;\n }\n } else {\n return false;\n }\n}\n","import { Injectable } from '@angular/core';\nimport { HttpClient, HttpRequest } from '@angular/common/http';\nimport * as Utils from '../utils/ngx-editor.utils';\n\n@Injectable()\nexport class CommandExecutorService {\n /** saves the selection from the editor when focussed out */\n savedSelection: any = undefined;\n\n /**\n *\n * @param _http HTTP Client for making http requests\n */\n constructor(private _http: HttpClient) { }\n\n /**\n * executes command from the toolbar\n *\n * @param command command to be executed\n */\n execute(command: string): void {\n if (!this.savedSelection && command !== 'enableObjectResizing') {\n throw new Error('Range out of Editor');\n }\n\n if (command === 'enableObjectResizing') {\n document.execCommand('enableObjectResizing', true);\n }\n\n if (command === 'blockquote') {\n document.execCommand('formatBlock', false, 'blockquote');\n }\n\n if (command === 'removeBlockquote') {\n document.execCommand('formatBlock', false, 'div');\n }\n\n document.execCommand(command, false, null);\n }\n\n /**\n * inserts image in the editor\n *\n * @param imageURI url of the image to be inserted\n */\n insertImage(imageURI: string): void {\n if (this.savedSelection) {\n if (imageURI) {\n const restored = Utils.restoreSelection(this.savedSelection);\n if (restored) {\n const inserted = document.execCommand('insertImage', false, imageURI);\n if (!inserted) {\n throw new Error('Invalid URL');\n }\n }\n }\n } else {\n throw new Error('Range out of the editor');\n }\n }\n\n /**\n * inserts image in the editor\n *\n * @param videParams url of the image to be inserted\n */\n insertVideo(videParams: any): void {\n if (this.savedSelection) {\n if (videParams) {\n const restored = Utils.restoreSelection(this.savedSelection);\n if (restored) {\n if (this.isYoutubeLink(videParams.videoUrl)) {\n const youtubeURL = '<iframe width=\"' + videParams.width + '\" height=\"' + videParams.height + '\"'\n + 'src=\"' + videParams.videoUrl + '\"></iframe>';\n this.insertHtml(youtubeURL);\n } else if (this.checkTagSupportInBrowser('video')) {\n\n if (this.isValidURL(videParams.videoUrl)) {\n const videoSrc = '<video width=\"' + videParams.width + '\" height=\"' + videParams.height + '\"'\n + ' controls=\"true\"><source src=\"' + videParams.videoUrl + '\"></video>';\n this.insertHtml(videoSrc);\n } else {\n throw new Error('Invalid video URL');\n }\n\n } else {\n throw new Error('Unable to insert video');\n }\n }\n }\n } else {\n throw new Error('Range out of the editor');\n }\n }\n\n /**\n * checks the input url is a valid youtube URL or not\n *\n * @param url Youtue URL\n */\n private isYoutubeLink(url: string): boolean {\n const ytRegExp = /^(http(s)?:\\/\\/)?((w){3}.)?youtu(be|.be)?(\\.com)?\\/.+/;\n return ytRegExp.test(url);\n }\n\n /**\n * check whether the string is a valid url or not\n * @param url url\n */\n private isValidURL(url: string) {\n const urlRegExp = /(http|https):\\/\\/(\\w+:{0,1}\\w*)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%!\\-\\/]))?/;\n return urlRegExp.test(url);\n }\n\n /**\n * uploads image to the server\n *\n * @param file file that has to be uploaded\n * @param endPoint enpoint to which the image has to be uploaded\n */\n uploadImage(file: File, endPoint: string): any {\n if (!endPoint) {\n throw new Error('Image Endpoint isn`t provided or invalid');\n }\n\n const formData: FormData = new FormData();\n\n if (file) {\n\n formData.append('file', file);\n\n const req = new HttpRequest('POST', endPoint, formData, {\n reportProgress: true\n });\n\n return this._http.request(req);\n\n } else {\n throw new Error('Invalid Image');\n }\n }\n\n /**\n * inserts link in the editor\n *\n * @param params parameters that holds the information for the link\n */\n createLink(params: any): void {\n if (this.savedSelection) {\n /**\n * check whether the saved selection contains a range or plain selection\n */\n if (params.urlNewTab) {\n const newUrl = '<a href=\"' + params.urlLink + '\" target=\"_blank\">' + params.urlText + '</a>';\n\n if (document.getSelection().type !== 'Range') {\n const restored = Utils.restoreSelection(this.savedSelection);\n if (restored) {\n this.insertHtml(newUrl);\n }\n } else {\n throw new Error('Only new links can be inserted. You cannot edit URL`s');\n }\n } else {\n const restored = Utils.restoreSelection(this.savedSelection);\n if (restored) {\n document.execCommand('createLink', false, params.urlLink);\n }\n }\n } else {\n throw new Error('Range out of the editor');\n }\n }\n\n /**\n * insert color either font or background\n *\n * @param color color to be inserted\n * @param where where the color has to be inserted either text/background\n */\n insertColor(color: string, where: string): void {\n if (this.savedSelection) {\n const restored = Utils.restoreSelection(this.savedSelection);\n if (restored && this.checkSelection()) {\n if (where === 'textColor') {\n document.execCommand('foreColor', false, color);\n } else {\n document.execCommand('hiliteColor', false, color);\n }\n }\n } else {\n throw new Error('Range out of the editor');\n }\n }\n\n /**\n * set font size for text\n *\n * @param fontSize font-size to be set\n */\n setFontSize(fontSize: string): void {\n if (this.savedSelection && this.checkSelection()) {\n const deletedValue = this.deleteAndGetElement();\n\n if (deletedValue) {\n const restored = Utils.restoreSelection(this.savedSelection);\n\n if (restored) {\n if (this.isNumeric(fontSize)) {\n const fontPx = '<span style=\"font-size: ' + fontSize + 'px;\">' + deletedValue + '</span>';\n this.insertHtml(fontPx);\n } else {\n const fontPx = '<span style=\"font-size: ' + fontSize + ';\">' + deletedValue + '</span>';\n this.insertHtml(fontPx);\n }\n }\n }\n } else {\n throw new Error('Range out of the editor');\n }\n }\n\n /**\n * set font name/family for text\n *\n * @param fontName font-family to be set\n */\n setFontName(fontName: string): void {\n if (this.savedSelection && this.checkSelection()) {\n const deletedValue = this.deleteAndGetElement();\n\n if (deletedValue) {\n const restored = Utils.restoreSelection(this.savedSelection);\n\n if (restored) {\n if (this.isNumeric(fontName)) {\n const fontFamily = '<span style=\"font-family: ' + fontName + 'px;\">' + deletedValue + '</span>';\n this.insertHtml(fontFamily);\n } else {\n const fontFamily = '<span style=\"font-family: ' + fontName + ';\">' + deletedValue + '</span>';\n this.insertHtml(fontFamily);\n }\n }\n }\n } else {\n throw new Error('Range out of the editor');\n }\n }\n\n /** insert HTML */\n private insertHtml(html: string): void {\n const isHTMLInserted = document.execCommand('insertHTML', false, html);\n\n if (!isHTMLInserted) {\n throw new Error('Unable to perform the operation');\n }\n }\n\n /**\n * check whether the value is a number or string\n * if number return true\n * else return false\n */\n private isNumeric(value: any): boolean {\n return /^-{0,1}\\d+$/.test(value);\n }\n\n /** delete the text at selected range and return the value */\n private deleteAndGetElement(): any {\n let slectedText;\n\n if (this.savedSelection) {\n slectedText = this.savedSelection.toString();\n this.savedSelection.deleteContents();\n return slectedText;\n }\n\n return false;\n }\n\n /** check any slection is made or not */\n private checkSelection(): any {\n const slectedText = this.savedSelection.toString();\n\n if (slectedText.length === 0) {\n throw new Error('No Selection Made');\n }\n\n return true;\n }\n\n /**\n * check tag is supported by browser or not\n *\n * @param tag HTML tag\n */\n private checkTagSupportInBrowser(tag: string): boolean {\n return !(document.createElement(tag) instanceof HTMLUnknownElement);\n }\n\n}\n","import { Injectable } from '@angular/core';\nimport { Subject, Observable } from 'rxjs';\n\n\n/** time in which the message has to be cleared */\nconst DURATION = 7000;\n\n@Injectable()\nexport class MessageService {\n /** variable to hold the user message */\n private message: Subject<string> = new Subject();\n\n constructor() { }\n\n /** returns the message sent by the editor */\n getMessage(): Observable<string> {\n return this.message.asObservable();\n }\n\n /**\n * sends message to the editor\n *\n * @param message message to be sent\n */\n sendMessage(message: string): void {\n this.message.next(message);\n this.clearMessageIn(DURATION);\n }\n\n /**\n * a short interval to clear message\n *\n * @param milliseconds time in seconds in which the message has to be cleared\n */\n private clearMessageIn(milliseconds: number): void {\n setTimeout(() => {\n this.message.next(undefined);\n }, milliseconds);\n }\n}\n","/**\n * toolbar default configuration\n */\nexport const ngxEditorConfig = {\n editable: true,\n spellcheck: true,\n height: 'auto',\n minHeight: '0',\n width: 'auto',\n minWidth: '0',\n translate: 'yes',\n enableToolbar: true,\n showToolbar: true,\n placeholder: 'Enter text here...',\n imageEndPoint: '',\n toolbar: [\n ['bold', 'italic', 'underline', 'strikeThrough', 'superscript', 'subscript'],\n ['fontName', 'fontSize', 'color'],\n ['justifyLeft', 'justifyCenter', 'justifyRight', 'justifyFull', 'indent', 'outdent'],\n ['cut', 'copy', 'delete', 'removeFormat', 'undo', 'redo'],\n ['paragraph', 'blockquote', 'removeBlockquote', 'horizontalLine', 'orderedList', 'unorderedList'],\n ['link', 'unlink', 'image', 'video']\n ]\n};\n","import {\n Component, OnInit, Input, Output, ViewChild,\n EventEmitter, Renderer2, forwardRef\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR, ControlValueAccessor } from '@angular/forms';\n\nimport { CommandExecutorService } from './common/services/command-executor.service';\nimport { MessageService } from './common/services/message.service';\n\nimport { ngxEditorConfig } from './common/ngx-editor.defaults';\nimport * as Utils from './common/utils/ngx-editor.utils';\n\n@Component({\n selector: 'app-ngx-editor',\n templateUrl: './ngx-editor.component.html',\n styleUrls: ['./ngx-editor.component.scss'],\n providers: [{\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => NgxEditorComponent),\n multi: true\n }]\n})\n\nexport class NgxEditorComponent implements OnInit, ControlValueAccessor {\n /** Specifies weather the textarea to be editable or not */\n @Input() editable: boolean;\n /** The spellcheck property specifies whether the element is to have its spelling and grammar checked or not. */\n @Input() spellcheck: boolean;\n /** Placeholder for the textArea */\n @Input() placeholder: string;\n /**\n * The translate property specifies whether the content of an element should be translated or not.\n *\n * Check https://www.w3schools.com/tags/att_global_translate.asp for more information and browser support\n */\n @Input() translate: string;\n /** Sets height of the editor */\n @Input() height: string;\n /** Sets minimum height for the editor */\n @Input() minHeight: string;\n /** Sets Width of the editor */\n @Input() width: string;\n /** Sets minimum width of the editor */\n @Input() minWidth: string;\n /**\n * Toolbar accepts an array which specifies the options to be enabled for the toolbar\n *\n * Check ngxEditorConfig for toolbar configuration\n *\n * Passing an empty array will enable all toolbar\n */\n @Input() toolbar: Object;\n /**\n * The editor can be resized vertically.\n *\n * `basic` resizer enables the html5 reszier. Check here https://www.w3schools.com/cssref/css3_pr_resize.asp\n *\n * `stack` resizer enable a resizer that looks like as if in https://stackoverflow.com\n */\n @Input() resizer = 'stack';\n /**\n * The config property is a JSON object\n *\n * All avaibale inputs inputs can be provided in the configuration as JSON\n * inputs provided directly are considered as top priority\n */\n @Input() config = ngxEditorConfig;\n /** Weather to show or hide toolbar */\n @Input() showToolbar: boolean;\n /** Weather to enable or disable the toolbar */\n @Input() enableToolbar: boolean;\n /** Endpoint for which the image to be uploaded */\n @Input() imageEndPoint: string;\n\n /** emits `blur` event when focused out from the textarea */\n @Output() blur: EventEmitter<string> = new EventEmitter<string>();\n /** emits `focus` event when focused in to the textarea */\n @Output() focus: EventEmitter<string> = new EventEmitter<string>();\n\n @ViewChild('ngxTextArea') textArea: any;\n @ViewChild('ngxWrapper') ngxWrapper: any;\n\n Utils: any = Utils;\n\n private onChange: (value: string) => void;\n private onTouched: () => void;\n\n /**\n * @param _messageService service to send message to the editor message component\n * @param _commandExecutor executes command from the toolbar\n * @param _renderer access and manipulate the dom element\n */\n constructor(\n private _messageService: MessageService,\n private _commandExecutor: CommandExecutorService,\n private _renderer: Renderer2) { }\n\n /**\n * events\n */\n onTextAreaFocus(): void {\n this.focus.emit('focus');\n }\n\n /** focus the text area when the editor is focussed */\n onEditorFocus() {\n this.textArea.nativeElement.focus();\n }\n\n /**\n * Executed from the contenteditable section while the input property changes\n * @param html html string from contenteditable\n */\n onContentChange(innerHTML: string): void {\n if (typeof this.onChange === 'function') {\n this.onChange(innerHTML);\n this.togglePlaceholder(innerHTML);\n }\n }\n\n onTextAreaBlur(): void {\n /** save selection if focussed out */\n this._commandExecutor.savedSelection = Utils.saveSelection();\n\n if (typeof this.onTouched === 'function') {\n this.onTouched();\n }\n this.blur.emit('blur');\n }\n\n /**\n * resizing text area\n *\n * @param offsetY vertical height of the eidtable portion of the editor\n */\n resizeTextArea(offsetY: number): void {\n let newHeight = parseInt(this.height, 10);\n newHeight += offsetY;\n this.height = newHeight + 'px';\n this.textArea.nativeElement.style.height = this.height;\n }\n\n /**\n * editor actions, i.e., executes command from toolbar\n *\n * @param commandName name of the command to be executed\n */\n executeCommand(commandName: string): void {\n try {\n this._commandExecutor.execute(commandName);\n } catch (error) {\n this._messageService.sendMessage(error.message);\n }\n }\n\n /**\n * Write a new value to the element.\n *\n * @param value value to be executed when there is a change in contenteditable\n */\n writeValue(value: any): void {\n this.togglePlaceholder(value);\n\n if (value === null || value === undefined || value === '' || value === '<br>') {\n value = null;\n }\n\n this.refreshView(value);\n }\n\n /**\n * Set the function to be called\n * when the control receives a change event.\n *\n * @param fn a function\n */\n registerOnChange(fn: any): void {\n this.onChange = fn;\n }\n\n /**\n * Set the function to be called\n * when the control receives a touch event.\n *\n * @param fn a function\n */\n registerOnTouched(fn: any): void {\n this.onTouched = fn;\n }\n\n /**\n * refresh view/HTML of the editor\n *\n * @param value html string from the editor\n */\n refreshView(value: string): void {\n const normalizedValue = value === null ? '' : value;\n this._renderer.setProperty(this.textArea.nativeElement, 'innerHTML', normalizedValue);\n }\n\n /**\n * toggles placeholder based on input string\n *\n * @param value A HTML string from the editor\n */\n togglePlaceholder(value: any): void {\n if (!value || value === '<br>' || value === '') {\n this._renderer.addClass(this.ngxWrapper.nativeElement, 'show-placeholder');\n } else {\n this._renderer.removeClass(this.ngxWrapper.nativeElement, 'show-placeholder');\n }\n }\n\n /**\n * returns a json containing input params\n */\n getCollectiveParams(): any {\n return {\n editable: this.editable,\n spellcheck: this.spellcheck,\n placeholder: this.placeholder,\n translate: this.translate,\n height: this.height,\n minHeight: this.minHeight,\n width: this.width,\n minWidth: this.minWidth,\n enableToolbar: this.enableToolbar,\n showToolbar: this.showToolbar,\n imageEndPoint: this.imageEndPoint,\n toolbar: this.toolbar\n };\n }\n\n ngOnInit() {\n /**\n * set configuartion\n */\n this.config = this.Utils.getEditorConfiguration(this.config, ngxEditorConfig, this.getCollectiveParams());\n\n this.height = this.height || this.textArea.nativeElement.offsetHeight;\n\n this.executeCommand('enableObjectResizing');\n }\n}\n","import { Component, HostListener } from '@angular/core';\nimport { NgxEditorComponent } from '../ngx-editor.component';\n\n@Component({\n selector: 'app-ngx-grippie',\n templateUrl: './ngx-grippie.component.html',\n styleUrls: ['./ngx-grippie.component.scss']\n})\n\nexport class NgxGrippieComponent {\n /** height of the editor */\n height: number;\n /** previous value befor resizing the editor */\n oldY = 0;\n /** set to true on mousedown event */\n grabber = false;\n\n /**\n * Constructor\n *\n * @param _editorComponent Editor component\n */\n constructor(private _editorComponent: NgxEditorComponent) { }\n\n /**\n *\n * @param event Mouseevent\n *\n * Update the height of the editor when the grabber is dragged\n */\n @HostListener('document:mousemove', ['$event']) onMouseMove(event: MouseEvent) {\n if (!this.grabber) {\n return;\n }\n\n this._editorComponent.resizeTextArea(event.clientY - this.oldY);\n this.oldY = event.clientY;\n }\n\n /**\n *\n * @param event Mouseevent\n *\n * set the grabber to false on mouse up action\n */\n @HostListener('document:mouseup', ['$event']) onMouseUp(event: MouseEvent) {\n this.grabber = false;\n }\n\n @HostListener('mousedown', ['$event']) onResize(event: MouseEvent, resizer?: Function) {\n this.grabber = true;\n this.oldY = event.clientY;\n event.preventDefault();\n }\n\n}\n","import { Component } from '@angular/core';\n\nimport { MessageService } from '../common/services/message.service';\n\n@Component({\n selector: 'app-ngx-editor-message',\n templateUrl: './ngx-editor-message.component.html',\n styleUrls: ['./ngx-editor-message.component.scss']\n})\n\nexport class NgxEditorMessageComponent {\n /** property that holds the message to be displayed on the editor */\n ngxMessage = undefined;\n\n /**\n * @param _messageService service to send message to the editor\n */\n constructor(private _messageService: MessageService) {\n this._messageService.getMessage().subscribe((message: string) => this.ngxMessage = message);\n }\n\n /**\n * clears editor message\n */\n clearMessage(): void {\n this.ngxMessage = undefined;\n }\n}\n","import { Component, Input, Output, EventEmitter, OnInit, ViewChild } from '@angular/core';\nimport { FormBuilder, FormGroup, Validators } from '@angular/forms';\nimport { HttpResponse } from '@angular/common/http';\nimport { PopoverConfig } from 'ngx-bootstrap';\nimport { CommandExecutorService } from '../common/services/command-executor.service';\nimport { MessageService } from '../common/services/message.service';\nimport * as Utils from '../common/utils/ngx-editor.utils';\n\n@Component({\n selector: 'app-ngx-editor-toolbar',\n templateUrl: './ngx-editor-toolbar.component.html',\n styleUrls: ['./ngx-editor-toolbar.component.scss'],\n providers: [PopoverConfig]\n})\n\nexport class NgxEditorToolbarComponent implements OnInit {\n /** holds values of the insert link form */\n urlForm: FormGroup;\n /** holds values of the insert image form */\n imageForm: FormGroup;\n /** holds values of the insert video form */\n videoForm: FormGroup;\n /** set to false when image is being uploaded */\n uploadComplete = true;\n /** upload percentage */\n updloadPercentage = 0;\n /** set to true when the image is being uploaded */\n isUploading = false;\n /** which tab to active for color insetion */\n selectedColorTab = 'textColor';\n /** font family name */\n fontName = '';\n /** font size */\n fontSize = '';\n /** hex color code */\n hexColor = '';\n /** show/hide image uploader */\n isImageUploader = false;\n\n /**\n * Editor configuration\n */\n @Input() config: any;\n @ViewChild('urlPopover') urlPopover;\n @ViewChild('imagePopover') imagePopover;\n @ViewChild('videoPopover') videoPopover;\n @ViewChild('fontSizePopover') fontSizePopover;\n @ViewChild('colorPopover') colorPopover;\n /**\n * Emits an event when a toolbar button is clicked\n */\n @Output() execute: EventEmitter<string> = new EventEmitter<string>();\n\n constructor(private _popOverConfig: PopoverConfig,\n private _formBuilder: FormBuilder,\n private _messageService: MessageService,\n private _commandExecutorService: CommandExecutorService) {\n this._popOverConfig.outsideClick = true;\n this._popOverConfig.placement = 'bottom';\n this._popOverConfig.container = 'body';\n }\n\n /**\n * enable or diable toolbar based on configuration\n *\n * @param value name of the toolbar buttons\n */\n canEnableToolbarOptions(value): boolean {\n return Utils.canEnableToolbarOptions(value, this.config['toolbar']);\n }\n\n /**\n * triggers command from the toolbar to be executed and emits an event\n *\n * @param command name of the command to be executed\n */\n triggerCommand(command: string): void {\n this.execute.emit(command);\n }\n\n /**\n * create URL insert form\n */\n buildUrlForm(): void {\n this.urlForm = this._formBuilder.group({\n urlLink: ['', [Validators.required]],\n urlText: ['', [Validators.required]],\n urlNewTab: [true]\n });\n }\n\n /**\n * inserts link in the editor\n */\n insertLink(): void {\n try {\n this._commandExecutorService.createLink(this.urlForm.value);\n } catch (error) {\n this._messageService.sendMessage(error.message);\n }\n\n /** reset form to default */\n this.buildUrlForm();\n /** close inset URL pop up */\n this.urlPopover.hide();\n }\n\n /**\n * create insert image form\n */\n buildImageForm(): void {\n this.imageForm = this._formBuilder.group({\n imageUrl: ['', [Validators.required]]\n });\n }\n\n /**\n * create insert image form\n */\n buildVideoForm(): void {\n this.videoForm = this._formBuilder.group({\n videoUrl: ['', [Validators.required]],\n height: [''],\n width: ['']\n });\n }\n\n /**\n * Executed when file is selected\n *\n * @param e onChange event\n */\n onFileChange(e): void {\n this.uploadComplete = false;\n this.isUploading = true;\n\n if (e.target.files.length > 0) {\n const file = e.target.files[0];\n\n try {\n this._commandExecutorService.uploadImage(file, this.config.imageEndPoint).subscribe(event => {\n\n if (event.type) {\n this.updloadPercentage = Math.round(100 * event.loaded / event.total);\n }\n\n if (event instanceof HttpResponse) {\n try {\n this._commandExecutorService.insertImage(event.body.url);\n } catch (error) {\n this._messageService.sendMessage(error.message);\n }\n this.uploadComplete = true;\n this.isUploading = false;\n }\n });\n } catch (error) {\n this._messageService.sendMessage(error.message);\n this.uploadComplete = true;\n this.isUploading = false;\n }\n }\n }\n\n /** insert image in the editor */\n insertImage(): void {\n try {\n this._commandExecutorService.insertImage(this.imageForm.value.imageUrl);\n } catch (error) {\n this._messageService.sendMessage(error.message);\n }\n\n /** reset form to default */\n this.buildImageForm();\n /** close inset URL pop up */\n this.imagePopover.hide();\n }\n\n /** insert image in the editor */\n insertVideo(): void {\n try {\n this._commandExecutorService.insertVideo(this.videoForm.value);\n } catch (error) {\n this._messageService.sendMessage(error.message);\n }\n\n /** reset form to default */\n this.buildVideoForm();\n /** close inset URL pop up */\n this.videoPopover.hide();\n }\n\n /** inser text/background color */\n insertColor(color: string, where: string): void {\n try {\n this._commandExecutorService.insertColor(color, where);\n } catch (error) {\n this._messageService.sendMessage(error.message);\n }\n\n this.colorPopover.hide();\n }\n\n /** set font size */\n setFontSize(fontSize: string): void {\n try {\n this._commandExecutorService.setFontSize(fontSize);\n } catch (error) {\n this._messageService.sendMessage(error.message);\n }\n\n this.fontSizePopover.hide();\n }\n\n /** set font Name/family */\n setFontName(fontName: string): void {\n try {\n this._commandExecutorService.setFontName(fontName);\n } catch (error) {\n this._messageService.sendMessage(error.message);\n }\n\n this.fontSizePopover.hide();\n }\n\n ngOnInit() {\n this.buildUrlForm();\n this.buildImageForm();\n this.buildVideoForm();\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { PopoverModule } from 'ngx-bootstrap';\nimport { NgxEditorComponent } from './ngx-editor.component';\nimport { NgxGrippieComponent } from './ngx-grippie/ngx-grippie.component';\nimport { NgxEditorMessageComponent } from './ngx-editor-message/ngx-editor-message.component';\nimport { NgxEditorToolbarComponent } from './ngx-editor-toolbar/ngx-editor-toolbar.component';\nimport { MessageService } from './common/services/message.service';\nimport { CommandExecutorService } from './common/services/command-executor.service';\n\n@NgModule({\n imports: [CommonModule, FormsModule, ReactiveFormsModule, PopoverModule.forRoot()],\n declarations: [NgxEditorComponent, NgxGrippieComponent, NgxEditorMessageComponent, NgxEditorToolbarComponent],\n exports: [NgxEditorComponent],\n providers: [CommandExecutorService, MessageService]\n})\n\nexport class NgxEditorModule { }\n","import { AbstractControl } from '@angular/forms';\n\ninterface IMaxLengthValidatorOptions {\n excludeLineBreaks?: boolean;\n concatWhiteSpaces?: boolean;\n excludeWhiteSpaces?: boolean;\n}\n\nexport function MaxLengthValidator(maxlength: number, options?: IMaxLengthValidatorOptions) {\n return (control: AbstractControl): { [key: string]: any } | null => {\n const parsedDocument = new DOMParser().parseFromString(control.value, 'text/html');\n let innerText = parsedDocument.body.innerText || '';\n\n // replace all linebreaks\n if (options.excludeLineBreaks) {\n innerText = innerText.replace(/(\\r\\n\\t|\\n|\\r\\t)/gm, '');\n }\n\n // concat multiple whitespaces into a single whitespace\n if (options.concatWhiteSpaces) {\n innerText = innerText.replace(/(\\s\\s+)/gm, ' ');\n }\n\n // remove all whitespaces\n if (options.excludeWhiteSpaces) {\n innerText = innerText.replace(/(\\s)/gm, '');\n }\n\n if (innerText.length > maxlength) {\n return {\n ngxEditor: {\n allowedLength: maxlength,\n textLength: innerText.length\n }\n };\n }\n return null;\n };\n}\n"],"names":["Utils.restoreSelection","HttpRequest","Injectable","HttpClient","Subject","EventEmitter","Utils.saveSelection","Component","NG_VALUE_ACCESSOR","forwardRef","Renderer2","Input","Output","ViewChild","HostListener","Utils.canEnableToolbarOptions","Validators","HttpResponse","PopoverConfig","FormBuilder","NgModule","CommonModule","FormsModule","ReactiveFormsModule","PopoverModule"],"mappings":";;;;;;;;;;;;;;;;;AAMA,qCAAwC,KAAa,EAAE,OAAY;QACjE,IAAI,KAAK,EAAE;YACT,IAAI,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;gBAC3B,OAAO,IAAI,CAAC;aACb;iBAAM;;gBACL,IAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,UAAA,KAAK;oBAChC,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;iBACpC,CAAC,CAAC;gBAEH,OAAO,KAAK,CAAC,MAAM,GAAG,IAAI,GAAG,KAAK,CAAC;aACpC;SACF;aAAM;YACL,OAAO,KAAK,CAAC;SACd;KACF;;;;;;;;;AASD,oCAAuC,KAAU,EAAE,eAAoB,EAAE,KAAU;QACjF,KAAK,IAAM,CAAC,IAAI,eAAe,EAAE;YAC/B,IAAI,CAAC,EAAE;gBACL,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,SAAS,EAAE;oBAC1B,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,C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