@@ -3,7 +3,7 @@ import type {Command} from 'prosemirror-state';
33import { tabPanelType , tabsListType , tabsType , tabType } from '.' ;
44import { pType } from '../../base/BaseSchema' ;
55import { tabActiveClassname , tabPanelActiveClassname } from './const' ;
6- import { TabAttrs , TabPanelAttrs } from './YfmTabsSpecs/const' ;
6+ import { TabAttrs , TabPanelAttrs , TabsAttrs } from './YfmTabsSpecs/const' ;
77
88export const createYfmTabsCommand : Command = ( state , dispatch ) => {
99 if ( dispatch ) {
@@ -26,9 +26,15 @@ export const createYfmTabsCommand: Command = (state, dispatch) => {
2626 [ TabAttrs . id ] : tabId ,
2727 [ TabAttrs . class ] : tabActiveClassname ,
2828 [ TabAttrs . ariaControls ] : panelId ,
29+ [ TabAttrs . dataDiplodocIsActive ] : 'true' ,
30+ [ TabAttrs . dataDiplodocid ] : tabId ,
31+ [ TabAttrs . dataDiplodocKey ] : tabId ,
2932 } ) ;
3033
31- const tabs = yfmTabs . create ( null , [ yfmTabsList . create ( null , [ yfmTab ] ) , yfmTabPanel ] ) ;
34+ const tabs = yfmTabs . create ( { [ TabsAttrs . dataDiplodocGroup ] : generateID ( ) } , [
35+ yfmTabsList . create ( null , [ yfmTab ] ) ,
36+ yfmTabPanel ,
37+ ] ) ;
3238
3339 dispatch ( state . tr . replaceSelectionWith ( tabs ) . scrollIntoView ( ) ) ;
3440 }
0 commit comments