@@ -35,8 +35,6 @@ const EOL_PATTERN = /\r\n?|\n/g;
3535 * Basic text editor in order to create a FreeTex annotation.
3636 */
3737class FreeTextEditor extends AnnotationEditor {
38- #color;
39-
4038 #content = "" ;
4139
4240 #editorDivId = `${ this . id } -editor` ;
@@ -129,7 +127,7 @@ class FreeTextEditor extends AnnotationEditor {
129127
130128 constructor ( params ) {
131129 super ( { ...params , name : "freeTextEditor" } ) ;
132- this . # color =
130+ this . color =
133131 params . color ||
134132 FreeTextEditor . _defaultColor ||
135133 AnnotationEditor . _defaultLineColor ;
@@ -201,7 +199,7 @@ class FreeTextEditor extends AnnotationEditor {
201199 get propertiesToUpdate ( ) {
202200 return [
203201 [ AnnotationEditorParamsType . FREETEXT_SIZE , this . #fontSize] ,
204- [ AnnotationEditorParamsType . FREETEXT_COLOR , this . # color] ,
202+ [ AnnotationEditorParamsType . FREETEXT_COLOR , this . color ] ,
205203 ] ;
206204 }
207205
@@ -215,10 +213,6 @@ class FreeTextEditor extends AnnotationEditor {
215213 return AnnotationEditorParamsType . FREETEXT_COLOR ;
216214 }
217215
218- get colorValue ( ) {
219- return this . #color;
220- }
221-
222216 /**
223217 * Update the font size and make this action as undoable.
224218 * @param {number } fontSize
@@ -248,10 +242,10 @@ class FreeTextEditor extends AnnotationEditor {
248242 */
249243 #updateColor( color ) {
250244 const setColor = col => {
251- this . # color = this . editorDiv . style . color = col ;
245+ this . color = this . editorDiv . style . color = col ;
252246 this . _colorPicker ?. update ( col ) ;
253247 } ;
254- const savedColor = this . # color;
248+ const savedColor = this . color ;
255249 this . addCommands ( {
256250 cmd : setColor . bind ( this , color ) ,
257251 undo : setColor . bind ( this , savedColor ) ,
@@ -581,7 +575,7 @@ class FreeTextEditor extends AnnotationEditor {
581575
582576 const { style } = this . editorDiv ;
583577 style . fontSize = `calc(${ this . #fontSize} px * var(--total-scale-factor))` ;
584- style . color = this . # color;
578+ style . color = this . color ;
585579
586580 this . div . append ( this . editorDiv ) ;
587581
@@ -819,7 +813,7 @@ class FreeTextEditor extends AnnotationEditor {
819813 }
820814 const editor = await super . deserialize ( data , parent , uiManager ) ;
821815 editor . #fontSize = data . fontSize ;
822- editor . # color = Util . makeHexColor ( ...data . color ) ;
816+ editor . color = Util . makeHexColor ( ...data . color ) ;
823817 editor . #content = FreeTextEditor . #deserializeContent( data . value ) ;
824818 editor . _initialData = initialData ;
825819 if ( data . comment ) {
@@ -841,9 +835,7 @@ class FreeTextEditor extends AnnotationEditor {
841835
842836 const rect = this . getPDFRect ( ) ;
843837 const color = AnnotationEditor . _colorManager . convert (
844- this . isAttachedToDOM
845- ? getComputedStyle ( this . editorDiv ) . color
846- : this . #color
838+ this . isAttachedToDOM ? getComputedStyle ( this . editorDiv ) . color : this . color
847839 ) ;
848840
849841 const serialized = {
@@ -895,7 +887,7 @@ class FreeTextEditor extends AnnotationEditor {
895887 }
896888 const { style } = content ;
897889 style . fontSize = `calc(${ this . #fontSize} px * var(--total-scale-factor))` ;
898- style . color = this . # color;
890+ style . color = this . color ;
899891
900892 content . replaceChildren ( ) ;
901893 for ( const line of this . #content. split ( "\n" ) ) {
0 commit comments