@@ -3,7 +3,7 @@ import { Component, Element, h, Host, Listen, Prop, State, Watch } from '@stenci
33
44import type { LabelPropType , ToolbarAPI , ToolbarStates , ToolbarItemsPropType , ToolbarItemPropType } from '../../schema' ;
55import { validateLabel , validateToolbarItems } from '../../schema' ;
6- import { KolButtonWcTag , KolLinkButtonTag } from '../../core/component-names' ;
6+ import { KolButtonWcTag , KolLinkWcTag } from '../../core/component-names' ;
77
88const TOOLBAR_ITEM_TAG_NAME = 'kol-toolbar-item' ;
99
@@ -24,22 +24,23 @@ export class KolToolbar implements ToolbarAPI {
2424
2525 @State ( ) private currentIndex : number = 0 ;
2626
27- private indexToElement = new Map < number , HTMLKolLinkButtonElement | HTMLKolButtonWcElement > ( ) ;
27+ private indexToElement = new Map < number , HTMLKolLinkWcElement | HTMLKolButtonWcElement > ( ) ;
2828
2929 private renderItem = ( element : ToolbarItemPropType , index : number ) : JSX . Element => {
3030 const tabIndex = index === this . currentIndex && ! element ?. _disabled ? 0 : - 1 ;
3131 const props = {
3232 key : index ,
3333 _tabIndex : tabIndex ,
34+ class : `button normal ${ TOOLBAR_ITEM_TAG_NAME } ` ,
3435 } ;
35- const catchRef = ( element ?: HTMLKolLinkButtonElement | HTMLKolButtonWcElement ) => {
36+ const catchRef = ( element ?: HTMLKolLinkWcElement | HTMLKolButtonWcElement ) => {
3637 element && this . indexToElement . set ( index , element ) ;
3738 } ;
3839
3940 return '_href' in element ? (
40- < KolLinkButtonTag { ...element } { ...props } class = { TOOLBAR_ITEM_TAG_NAME } ref = { catchRef } > </ KolLinkButtonTag >
41+ < KolLinkWcTag { ...element } { ...props } ref = { catchRef } > </ KolLinkWcTag >
4142 ) : (
42- < KolButtonWcTag { ...element } { ...props } class = { { button : true , normal : true , TOOLBAR_ITEM_TAG_NAME : true } } ref = { catchRef } > </ KolButtonWcTag >
43+ < KolButtonWcTag { ...element } { ...props } ref = { catchRef } > </ KolButtonWcTag >
4344 ) ;
4445 } ;
4546
0 commit comments