@@ -2,7 +2,7 @@ import { TranslationService } from "../lib/translation/index";
22import { DocumentNavigator } from "../lib/dom" ;
33import { languages } from "../constants/languages" ;
44import { BATCH_SIZE , DEFAULT_CONFIG } from "../constants" ;
5- import { Language , TranslationConfig , WidgetElements , TranslationResult , Position , LANG_PARAM , LOCALSTORAGE_KEYS , ATTRIBUTES } from "../types" ;
5+ import { Language , TranslationConfig , WidgetElements , TranslationResult , LANG_PARAM , LOCALSTORAGE_KEYS , ATTRIBUTES } from "../types" ;
66import widgetTemplate from "../templates/html/widget.html?raw" ;
77import { generateHashForContent , getUserLanguage , removeEmojis , validatePublicApiKey } from "../utils/utils" ;
88import { CACHE_PREFIX } from "../constants" ;
@@ -33,13 +33,13 @@ export class TranslationWidget {
3333 * @param config - The configuration for the translation widget
3434 */
3535 constructor ( publicKey : string , config : Partial < TranslationConfig > = { } ) {
36- const allowedPositions : Position [ ] = [ Position . TopRight , Position . TopLeft , Position . BottomLeft , Position . BottomRight ] ;
36+ const allowedPositions : string [ ] = [ "top-right" , "top-left" , "bottom-left" , "bottom-right" ] ;
3737
3838 let safeConfig = { ...DEFAULT_CONFIG , ...config } ;
3939
4040 if ( safeConfig . position && ! allowedPositions . includes ( safeConfig . position ) ) {
4141 console . warn ( `Invalid position '${ safeConfig . position } ' passed to TranslationWidget. Falling back to 'top-right'.` ) ;
42- safeConfig . position = Position . TopRight ;
42+ safeConfig . position = "top-right" ;
4343 }
4444
4545 this . config = safeConfig as Required < TranslationConfig > ;
0 commit comments