1- import { property , query } from 'lit/decorators.js' ;
2- import { type CSSResultGroup , html , PropertyValues , unsafeCSS } from 'lit' ;
3- import ZincElement , { ZincFormControl } from '../../internal/zinc-element' ;
1+ import { property , query } from 'lit/decorators.js' ;
2+ import { type CSSResultGroup , html , PropertyValues , unsafeCSS } from 'lit' ;
3+ import ZincElement , { ZincFormControl } from '../../internal/zinc-element' ;
44import Quill from "quill" ;
5- import { FormControlController } from '../../internal/form' ;
6- import DropdownModule , { dropdownOpen } from "./modules/dropdown-module" ;
5+ import { FormControlController } from '../../internal/form' ;
6+ import DropdownModule , { dropdownOpen } from "./modules/dropdown-module" ;
77import AttachmentModule from "./modules/attachment-module" ;
88import TimeTrackingModule from "./modules/time-tracking-module" ;
99import DragAndDropModule from "./modules/drag-drop-module" ;
1010import ImageResizeModule from "./modules/image-resize-module/image-resize-module" ;
11- import { normalizeNative } from "./normalize-native" ;
11+ import { normalizeNative } from "./normalize-native" ;
1212
1313import styles from './editor.scss' ;
1414
@@ -43,15 +43,15 @@ export default class ZnEditor extends ZincElement implements ZincFormControl {
4343 @property ( ) name : string ;
4444 @property ( ) value : string ;
4545
46- @property ( { attribute : 'interaction-type' , type : String } )
46+ @property ( { attribute : 'interaction-type' , type : String } )
4747 interactionType : 'ticket' | 'chat' = 'chat' ;
4848
49- @property ( { attribute : 'canned-responses' , type : Array } )
50- cannedResponses : Array < any > ;
49+ @property ( { attribute : 'canned-responses' , type : Array } )
50+ cannedResponses : any [ ] ;
5151
52- @property ( { attribute : 'canned-responses-url' } ) cannedResponsesUri : string ;
52+ @property ( { attribute : 'canned-responses-url' } ) cannedResponsesUri : string ;
5353
54- @property ( { attribute : 'attachment-url' , type : String } )
54+ @property ( { attribute : 'attachment-url' , type : String } )
5555 uploadAttachmentUrl : string ;
5656
5757 private quillElement : Quill ;
@@ -101,7 +101,7 @@ export default class ZnEditor extends ZincElement implements ZincFormControl {
101101 const container = [
102102 [ 'bold' , 'italic' , 'underline' , 'strike' ] ,
103103 [ 'undo' , 'redo' ] ,
104- [ { 'list' : 'ordered' } , { 'list' : 'bullet' } ] ,
104+ [ { 'list' : 'ordered' } , { 'list' : 'bullet' } ] ,
105105 ] ;
106106 container . push ( this . interactionType === 'ticket' ? [ 'link' , 'image' , 'image-attachment' ] : [ 'link' , 'image' , 'video' ] ) ;
107107 container . push ( [ 'remove-formatting' ] ) ;
@@ -161,7 +161,7 @@ export default class ZnEditor extends ZincElement implements ZincFormControl {
161161 xhr . onload = ( ) => {
162162 if ( xhr . status === 200 ) {
163163 const response = JSON . parse ( xhr . responseText ) ;
164- resolve ( { path : response . uploadPath , url : response . uploadUrl , filename : response . originalFilename } ) ;
164+ resolve ( { path : response . uploadPath , url : response . uploadUrl , filename : response . originalFilename } ) ;
165165 }
166166 } ;
167167 xhr . send ( fd ) ;
@@ -195,10 +195,10 @@ export default class ZnEditor extends ZincElement implements ZincFormControl {
195195
196196 this . _setupTitleAttributes ( quill ) ;
197197
198- const html = quill . clipboard . convert ( { html : this . value } ) ;
198+ const html = quill . clipboard . convert ( { html : this . value } ) ;
199199 quill . setContents ( html , Quill . sources . SILENT ) ;
200200
201- this . emit ( 'zn-element-added' , { detail : { element : this . editor } } ) ;
201+ this . emit ( 'zn-element-added' , { detail : { element : this . editor } } ) ;
202202
203203 super . firstUpdated ( _changedProperties ) ;
204204 }
@@ -234,7 +234,7 @@ export default class ZnEditor extends ZincElement implements ZincFormControl {
234234 const clipboard = context . event . clipboardData ;
235235 const text = clipboard . getData ( 'text/plain' ) ;
236236 const html = clipboard . getData ( 'text/html' ) ;
237- const delta = this . quillElement . clipboard . convert ( { html : html , text : text } ) ;
237+ const delta = this . quillElement . clipboard . convert ( { html : html , text : text } ) ;
238238 this . quillElement . setContents ( delta , 'silent' ) ;
239239 this . quillElement . setSelection ( delta . length ( ) , Quill . sources . SILENT ) ;
240240 }
@@ -254,7 +254,7 @@ export default class ZnEditor extends ZincElement implements ZincFormControl {
254254 handler : ( ) => {
255255 const form = this . closest ( 'form' ) ;
256256 if ( form && ! dropdownOpen && this . value && this . value . trim ( ) . length > 0 && ! empty ( this . value ) ) {
257- this . emit ( 'zn-submit' , { detail : { value : this . value , element : this } } ) ;
257+ this . emit ( 'zn-submit' , { detail : { value : this . value , element : this } } ) ;
258258 form . requestSubmit ( ) ;
259259 this . quillElement . setText ( '' ) ;
260260 }
0 commit comments