@@ -2,13 +2,13 @@ import Module from '../../__module';
22import $ from '../../dom' ;
33import * as _ from '../../utils' ;
44import I18n from '../../i18n' ;
5- import { I18nInternalNS } from '../../i18n/namespace-internal' ;
5+ import { I18nInternalNS } from '../../i18n/namespace-internal' ;
66import * as tooltip from '../../utils/tooltip' ;
7- import { ModuleConfig } from '../../../types-internal/module-config' ;
7+ import { ModuleConfig } from '../../../types-internal/module-config' ;
88import Block from '../../block' ;
9- import Toolbox , { ToolboxEvent } from '../../ui/toolbox' ;
10- import { IconMenu , IconPlus } from '@codexteam/icons' ;
11- import { BlockHovered } from '../../events/BlockHovered' ;
9+ import Toolbox , { ToolboxEvent } from '../../ui/toolbox' ;
10+ import { IconMenu , IconPlus } from '@codexteam/icons' ;
11+ import { BlockHovered } from '../../events/BlockHovered' ;
1212
1313/**
1414 * @todo Tab on non-empty block should open Block Settings of the hoveredBlock (not where caret is set)
@@ -39,6 +39,7 @@ interface ToolbarNodes {
3939 plusButton : HTMLElement ;
4040 settingsToggler : HTMLElement ;
4141}
42+
4243/**
4344 *
4445 * «Toolbar» is the node that moves up/down over current block
@@ -108,7 +109,7 @@ export default class Toolbar extends Module<ToolbarNodes> {
108109 * @param moduleConfiguration.config - Editor's config
109110 * @param moduleConfiguration.eventsDispatcher - Editor's event dispatcher
110111 */
111- constructor ( { config, eventsDispatcher } : ModuleConfig ) {
112+ constructor ( { config, eventsDispatcher} : ModuleConfig ) {
112113 super ( {
113114 config,
114115 eventsDispatcher,
@@ -155,7 +156,7 @@ export default class Toolbar extends Module<ToolbarNodes> {
155156 open : ( ) => void ;
156157 toggle : ( ) => void ;
157158 hasFocus : ( ) => boolean | undefined ;
158- } {
159+ } {
159160 return {
160161 opened : this . toolboxInstance ?. opened ,
161162 close : ( ) => {
@@ -165,7 +166,7 @@ export default class Toolbar extends Module<ToolbarNodes> {
165166 /**
166167 * If Toolbox is not initialized yet, do nothing
167168 */
168- if ( this . toolboxInstance === null ) {
169+ if ( this . toolboxInstance === null ) {
169170 _ . log ( 'toolbox.open() called before initialization is finished' , 'warn' ) ;
170171
171172 return ;
@@ -182,7 +183,7 @@ export default class Toolbar extends Module<ToolbarNodes> {
182183 /**
183184 * If Toolbox is not initialized yet, do nothing
184185 */
185- if ( this . toolboxInstance === null ) {
186+ if ( this . toolboxInstance === null ) {
186187 _ . log ( 'toolbox.toggle() called before initialization is finished' , 'warn' ) ;
187188
188189 return ;
@@ -228,7 +229,7 @@ export default class Toolbar extends Module<ToolbarNodes> {
228229 window . requestIdleCallback ( ( ) => {
229230 this . drawUI ( ) ;
230231 this . enableModuleBindings ( ) ;
231- } , { timeout : 2000 } ) ;
232+ } , { timeout : 2000 } ) ;
232233 } else {
233234 this . destroy ( ) ;
234235 this . Editor . BlockSettings . destroy ( ) ;
@@ -245,7 +246,7 @@ export default class Toolbar extends Module<ToolbarNodes> {
245246 /**
246247 * Some UI elements creates inside requestIdleCallback, so the can be not ready yet
247248 */
248- if ( this . toolboxInstance === null ) {
249+ if ( this . toolboxInstance === null ) {
249250 _ . log ( 'Can\'t open Toolbar since Editor initialization is not finished yet' , 'warn' ) ;
250251
251252 return ;
@@ -272,7 +273,7 @@ export default class Toolbar extends Module<ToolbarNodes> {
272273 this . hoveredBlock = block ;
273274
274275 const targetBlockHolder = block . holder ;
275- const { isMobile } = this . Editor . UI ;
276+ const { isMobile} = this . Editor . UI ;
276277 const renderedContent = block . pluginsContent ;
277278 const renderedContentStyle = window . getComputedStyle ( renderedContent ) ;
278279 const blockRenderedElementPaddingTop = parseInt ( renderedContentStyle . paddingTop , 10 ) ;
@@ -390,9 +391,9 @@ export default class Toolbar extends Module<ToolbarNodes> {
390391 */
391392 const tooltipContent = $ . make ( 'div' ) ;
392393
393- tooltipContent . appendChild ( document . createTextNode ( I18n . ui ( I18nInternalNS . ui . toolbar . toolbox , 'Add' ) ) ) ;
394+ // tooltipContent.appendChild(document.createTextNode(I18n.ui(I18nInternalNS.ui.toolbar.toolbox, 'Add')));
394395 tooltipContent . appendChild ( $ . make ( 'div' , this . CSS . plusButtonShortcut , {
395- textContent : '⇥ Tab' ,
396+ textContent : _ . beautifyShortcut ( 'ctrl+/' ) ,
396397 } ) ) ;
397398
398399 tooltip . onHover ( this . nodes . plusButton , tooltipContent , {
@@ -455,8 +456,8 @@ export default class Toolbar extends Module<ToolbarNodes> {
455456 this . Editor . UI . nodes . wrapper . classList . remove ( this . CSS . openedToolboxHolderModifier ) ;
456457 } ) ;
457458
458- this . toolboxInstance . on ( ToolboxEvent . BlockAdded , ( { block } ) => {
459- const { BlockManager, Caret } = this . Editor ;
459+ this . toolboxInstance . on ( ToolboxEvent . BlockAdded , ( { block} ) => {
460+ const { BlockManager, Caret} = this . Editor ;
460461 const newBlock = BlockManager . getBlockById ( block . id ) ;
461462
462463 /**
0 commit comments