11import { LitElement , html } from "lit" ;
22import { customElement , query , state } from "lit/decorators.js" ;
3+ import { translateText } from "../../Utils" ;
34import { quickChatPhrases } from "./ChatModal" ;
45import {
56 DEFAULT_PRESETS ,
67 PresetSlot ,
78 QuickChatPresetService ,
89} from "./QuickChatPresetService" ;
9- import { translateText } from "../../Utils" ;
1010
1111const MAX_SLOTS = 5 ;
1212
@@ -159,64 +159,89 @@ export class QuickChatConfigModal extends LitElement {
159159 return html `
160160 < o-modal title ="${ translateText ( "quick_chat.configure_presets" ) } ">
161161 < div class ="chat-columns ">
162-
163162 <!-- Column 1: preset slots -->
164163 < div class ="chat-column ">
165- < div class ="column-title "> ${ translateText ( "quick_chat.preset_label" ) } </ div >
164+ < div class ="column-title ">
165+ ${ translateText ( "quick_chat.preset_label" ) }
166+ </ div >
166167
167168 ${ this . slots . map (
168169 ( slot , i ) => html `
169170 < div style ="display:flex;gap:4px; ">
170171 < button
171- class ="chat-option-button ${ this . editingIndex === i ? "selected" : "" } "
172+ class ="chat-option-button ${ this . editingIndex === i
173+ ? "selected"
174+ : "" } "
172175 style ="flex:1; "
173176 @click =${ ( ) => this . selectSlot ( i ) }
174- > ${ i + 1 } . ${ this . slotLabel ( slot ) } </ button >
177+ >
178+ ${ i + 1 } . ${ this . slotLabel ( slot ) }
179+ </ button >
175180 ${ this . slots . length > 1
176181 ? html `< button
177182 class ="chat-option-button "
178183 style ="padding:8px 10px; "
179- @click =${ ( e : Event ) => { e . stopPropagation ( ) ; this . removeSlot ( i ) ; } }
180- > ✕</ button > `
184+ @click =${ ( e : Event ) => {
185+ e . stopPropagation ( ) ;
186+ this . removeSlot ( i ) ;
187+ } }
188+ >
189+ ✕
190+ </ button > `
181191 : null }
182192 </ div >
183193 ` ,
184194 ) }
185-
186195 ${ this . slots . length < MAX_SLOTS
187- ? html `< button
188- class ="chat-option-button "
189- @click =${ this . addSlot }
190- > ${ translateText ( "quick_chat.add_preset" ) } </ button > `
196+ ? html `< button class ="chat-option-button " @click =${ this . addSlot } >
197+ ${ translateText ( "quick_chat.add_preset" ) }
198+ </ button > `
191199 : null }
192200 </ div >
193201
194202 <!-- Column 2: category + actions -->
195203 ${ editing !== null
196204 ? html `
197205 < div class ="chat-column ">
198- < div class ="column-title "> ${ translateText ( "chat.category" ) } </ div >
206+ < div class ="column-title ">
207+ ${ translateText ( "chat.category" ) }
208+ </ div >
199209
200210 ${ categories . map (
201211 ( cat ) => html `
202212 < button
203- class ="chat-option-button ${ this . selectedCategory === cat ? "selected" : "" } "
213+ class ="chat-option-button ${ this . selectedCategory ===
214+ cat
215+ ? "selected"
216+ : "" } "
204217 @click =${ ( ) => this . selectCategory ( cat ) }
205- > ${ translateText ( `chat.cat.${ cat } ` ) } </ button >
218+ >
219+ ${ translateText ( `chat.cat.${ cat } ` ) }
220+ </ button >
206221 ` ,
207222 ) }
208223
209- < div class ="column-title " style ="margin-top:8px; "> ${ translateText ( "quick_chat.actions" ) } </ div >
224+ < div class ="column-title " style ="margin-top:8px; ">
225+ ${ translateText ( "quick_chat.actions" ) }
226+ </ div >
210227
211228 < button
212- class ="chat-option-button ${ editing . type === "emoji" ? "selected" : "" } "
229+ class ="chat-option-button ${ editing . type === "emoji"
230+ ? "selected"
231+ : "" } "
213232 @click =${ ( ) => this . assignSpecial ( "emoji" ) }
214- > ${ translateText ( "quick_chat.emoji_panel" ) } </ button >
233+ >
234+ ${ translateText ( "quick_chat.emoji_panel" ) }
235+ </ button >
215236
216237 < button
217- class ="chat-option-button ${ editing . type === "trade" ? "selected" : "" } "
238+ class ="chat-option-button ${ editing . type === "trade"
239+ ? "selected"
240+ : "" } "
218241 @click =${ ( ) => this . assignSpecial ( "trade" ) }
219- > ${ translateText ( "quick_chat.trade_toggle" ) } </ button >
242+ >
243+ ${ translateText ( "quick_chat.trade_toggle" ) }
244+ </ button >
220245 </ div >
221246 `
222247 : null }
@@ -225,7 +250,9 @@ export class QuickChatConfigModal extends LitElement {
225250 ${ editing !== null && this . selectedCategory
226251 ? html `
227252 < div class ="chat-column ">
228- < div class ="column-title "> ${ translateText ( "chat.phrase" ) } </ div >
253+ < div class ="column-title ">
254+ ${ translateText ( "chat.phrase" ) }
255+ </ div >
229256 < div class ="phrase-scroll-area ">
230257 ${ ( quickChatPhrases [ this . selectedCategory ] ?? [ ] ) . map (
231258 ( phrase ) => {
@@ -238,7 +265,9 @@ export class QuickChatConfigModal extends LitElement {
238265 editing . key === phrase . key ;
239266 return html `
240267 < button
241- class ="chat-option-button ${ isActive ? "selected" : "" } "
268+ class ="chat-option-button ${ isActive
269+ ? "selected"
270+ : "" } "
242271 @click =${ ( ) =>
243272 this . assignQcPhrase (
244273 this . selectedCategory ! ,
@@ -247,7 +276,10 @@ export class QuickChatConfigModal extends LitElement {
247276 >
248277 ${ label }
249278 ${ phrase . requiresPlayer
250- ? html `< span style ="font-size:10px;opacity:0.4;margin-left:4px; "> [needs target]</ span > `
279+ ? html `< span
280+ style ="font-size:10px;opacity:0.4;margin-left:4px; "
281+ > [needs target]</ span
282+ > `
251283 : null }
252284 </ button >
253285 ` ;
@@ -261,7 +293,9 @@ export class QuickChatConfigModal extends LitElement {
261293
262294 < div class ="chat-preview " style ="font-size:12px;color:#aaa; ">
263295 ${ editing !== null
264- ? translateText ( "quick_chat.editing_hint" , { n : ( this . editingIndex ?? 0 ) + 1 } )
296+ ? translateText ( "quick_chat.editing_hint" , {
297+ n : ( this . editingIndex ?? 0 ) + 1 ,
298+ } )
265299 : translateText ( "quick_chat.select_hint" ) }
266300 </ div >
267301
@@ -273,9 +307,11 @@ export class QuickChatConfigModal extends LitElement {
273307 class ="chat-option-button "
274308 style ="${ this . confirmReset ? "color:#f87171;" : "opacity:0.45;" } "
275309 @click =${ this . reset }
276- > ${ this . confirmReset
277- ? translateText ( "quick_chat.confirm_reset" )
278- : translateText ( "quick_chat.reset_defaults" ) } </ button >
310+ >
311+ ${ this . confirmReset
312+ ? translateText ( "quick_chat.confirm_reset" )
313+ : translateText ( "quick_chat.reset_defaults" ) }
314+ </ button >
279315 </ div >
280316 </ o-modal >
281317 ` ;
0 commit comments