@@ -15,6 +15,7 @@ import {
15
15
alternativeOperatorSkillUsages ,
16
16
getDefaultRequirements ,
17
17
getEliteIconUrl ,
18
+ getModuleName ,
18
19
getSkillCount ,
19
20
getSkillUsageAltTitle ,
20
21
useLocalizedOperatorName ,
@@ -429,31 +430,54 @@ export const OperatorItem: FC<OperatorItemProps> = memo(
429
430
< Select
430
431
className = "row-start-4"
431
432
filterable = { false }
432
- items = { info . modules }
433
+ items = { [
434
+ CopilotDocV1 . Module . Default ,
435
+ ...info . modules
436
+ . map ( ( m ) =>
437
+ m
438
+ ? ( CopilotDocV1 . Module [ m ] as
439
+ | CopilotDocV1 . Module
440
+ | undefined )
441
+ : CopilotDocV1 . Module . Original ,
442
+ )
443
+ . filter ( ( m ) => m !== undefined ) ,
444
+ ] }
433
445
itemRenderer = { (
434
- item ,
435
- { index , handleClick, handleFocus, modifiers } ,
446
+ value ,
447
+ { handleClick, handleFocus, modifiers } ,
436
448
) => (
437
449
< MenuItem
438
450
roleStructure = "listoption"
439
- key = { item }
451
+ key = { value }
440
452
className = { clsx (
441
453
'min-w-12 !rounded-none text-base font-serif font-bold text-center text-slate-600 dark:text-slate-300' ,
442
454
modifiers . active && Classes . ACTIVE ,
443
455
) }
444
- text = { item || < Icon icon = "disable" /> }
456
+ text = {
457
+ value === CopilotDocV1 . Module . Default ? (
458
+ < Icon icon = "disable" />
459
+ ) : value === CopilotDocV1 . Module . Original ? (
460
+ < Icon icon = "small-square" />
461
+ ) : (
462
+ getModuleName ( value )
463
+ )
464
+ }
465
+ title = { t . components . editor2 . OperatorItem . module_title ( {
466
+ count : value ,
467
+ name : getModuleName ( value ) ,
468
+ } ) }
445
469
onClick = { handleClick }
446
470
onFocus = { handleFocus }
447
- selected = { index === requirements . module }
471
+ selected = { value === requirements . module }
448
472
/>
449
473
) }
450
- onItemSelect = { ( item ) => {
474
+ onItemSelect = { ( value ) => {
451
475
edit ( ( ) => {
452
476
onChange ?.( {
453
477
...operator ,
454
478
requirements : {
455
479
...operator . requirements ,
456
- module : info . modules . indexOf ( item ) ,
480
+ module : value ,
457
481
} ,
458
482
} )
459
483
return {
@@ -472,15 +496,28 @@ export const OperatorItem: FC<OperatorItemProps> = memo(
472
496
< Button
473
497
small
474
498
minimal
475
- title = { t . components . editor2 . OperatorItem . module }
499
+ title = {
500
+ t . components . editor2 . OperatorItem . module +
501
+ ': ' +
502
+ t . components . editor2 . OperatorItem . module_title ( {
503
+ count : requirements . module ,
504
+ name : getModuleName ( requirements . module ) ,
505
+ } )
506
+ }
476
507
className = { clsx (
477
508
'w-4 h-4 !p-0 flex items-center justify-center font-serif !font-bold !text-base !rounded-none !border-2 !border-current' ,
478
- requirements . module
509
+ requirements . module !== CopilotDocV1 . Module . Default
479
510
? '!bg-purple-100 dark:!bg-purple-900 dark:!text-purple-200 !text-purple-800'
480
511
: '!bg-gray-300 dark:!bg-gray-600 opacity-15 dark:opacity-25 hover:opacity-30 dark:hover:opacity-50' ,
481
512
) }
482
513
>
483
- { info . modules [ requirements . module ] }
514
+ { requirements . module ===
515
+ CopilotDocV1 . Module . Default ? null : requirements . module ===
516
+ CopilotDocV1 . Module . Original ? (
517
+ < Icon icon = "small-square" />
518
+ ) : (
519
+ getModuleName ( requirements . module )
520
+ ) }
484
521
</ Button >
485
522
</ Select >
486
523
) }
0 commit comments