diff --git a/js/common/view/NumberPairsScreenView.ts b/js/common/view/NumberPairsScreenView.ts index 76e3548..a5b946a 100644 --- a/js/common/view/NumberPairsScreenView.ts +++ b/js/common/view/NumberPairsScreenView.ts @@ -33,8 +33,10 @@ import NumberLineNode from './NumberLineNode.js'; import NumberLineOptionsCheckboxGroup from './NumberLineOptionsCheckboxGroup.js'; import OrganizeBeadsButton from './OrganizeBeadsButton.js'; import RepresentationRadioButtonGroup from './RepresentationRadioButtonGroup.js'; -import SpeechSynthesisButton from './SpeechSynthesisButton.js'; import TenFrameButton from './TenFrameButton.js'; +import SpeechSynthesisButton from '../../../../number-suite-common/js/common/view/SpeechSynthesisButton.js'; +import numberPairsSpeechSynthesisAnnouncer from './numberPairsSpeechSynthesisAnnouncer.js'; +import numberPairsUtteranceQueue from './numberPairsUtteranceQueue.js'; type SelfOptions = { @@ -114,8 +116,7 @@ export default class NumberPairsScreenView extends ScreenView { /** * Create the buttons along the left edge of each screen */ - const speechSynthesisButton = new SpeechSynthesisButton( { - tandem: options.tandem.createTandem( 'speechSynthesisButton' ), + const speechSynthesisButton = new SpeechSynthesisButton( numberPairsSpeechSynthesisAnnouncer, numberPairsUtteranceQueue, { x: this.layoutBounds.minX + NumberPairsConstants.SCREEN_VIEW_X_MARGIN, y: this.layoutBounds.minY + NumberPairsConstants.SCREEN_VIEW_Y_MARGIN } ); diff --git a/js/common/view/SpeechSynthesisButton.ts b/js/common/view/SpeechSynthesisButton.ts deleted file mode 100644 index 3ebb9f8..0000000 --- a/js/common/view/SpeechSynthesisButton.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2024, University of Colorado Boulder -/** - * SpeechSynthesisButton is a button that when clicked will speak the number sentence. - * - * @author Marla Schulz (PhET Interactive Simulations) - * - */ - -import { EmptySelfOptions, optionize4 } from '../../../../phet-core/js/optionize.js'; -import WithRequired from '../../../../phet-core/js/types/WithRequired.js'; -import { Color, Path } from '../../../../scenery/js/imports.js'; -import bullhornSolidShape from '../../../../sherpa/js/fontawesome-5/bullhornSolidShape.js'; -import RectangularPushButton, { RectangularPushButtonOptions } from '../../../../sun/js/buttons/RectangularPushButton.js'; -import numberPairs from '../../numberPairs.js'; -import NumberPairsConstants from '../NumberPairsConstants.js'; - -type SelfOptions = EmptySelfOptions; -type SpeechSynthesisButtonOptions = WithRequired; - -// TODO: Add speech synthesis functionality: https://github.com/phetsims/number-pairs/issues/18 -export default class SpeechSynthesisButton extends RectangularPushButton { - - public constructor( providedOptions: SpeechSynthesisButtonOptions ) { - - const options = optionize4()( {}, - { - content: new Path( bullhornSolidShape, { - fill: Color.BLACK - } ) - }, NumberPairsConstants.RECTANGULAR_PUSH_BUTTON_OPTIONS, providedOptions ); - super( options ); - } -} - -numberPairs.register( 'SpeechSynthesisButton', SpeechSynthesisButton ); \ No newline at end of file diff --git a/js/common/view/numberPairsUtteranceQueue.ts b/js/common/view/numberPairsUtteranceQueue.ts index 6080272..0fc940d 100644 --- a/js/common/view/numberPairsUtteranceQueue.ts +++ b/js/common/view/numberPairsUtteranceQueue.ts @@ -11,13 +11,9 @@ import StringProperty from '../../../../axon/js/StringProperty.js'; import TProperty from '../../../../axon/js/TProperty.js'; import TReadOnlyProperty from '../../../../axon/js/TReadOnlyProperty.js'; import NumberSuiteCommonUtteranceQueue from '../../../../number-suite-common/js/common/view/NumberSuiteCommonUtteranceQueue.js'; -import TenScreen from '../../ten/TenScreen.js'; -import TwentyScreen from '../../twenty/TwentyScreen.js'; import numberPairs from '../../numberPairs.js'; import NumberPairsPreferences from '../model/NumberPairsPreferences.js'; import numberPairsSpeechSynthesisAnnouncer from './numberPairsSpeechSynthesisAnnouncer.js'; -import IntroScreen from '../../intro/IntroScreen.js'; -import SumScreen from '../../sum/SumScreen.js'; class NumberPairsUtteranceQueue extends NumberSuiteCommonUtteranceQueue { @@ -56,10 +52,10 @@ class NumberPairsUtteranceQueue extends NumberSuiteCommonUtteranceQueue { // We want the speech data to reflect the selected screen. Returns null for screens that do not support speech // synthesis. - return selectedScreen instanceof IntroScreen ? introScreenSpeechData : - selectedScreen instanceof TenScreen ? tenScreenSpeechData : - selectedScreen instanceof TwentyScreen ? twentyScreenSpeechData : - selectedScreen instanceof SumScreen ? sumScreenSpeechData : + return selectedScreen instanceof phet.numberPairs.IntroScreen ? introScreenSpeechData : + selectedScreen instanceof phet.numberPairs.TenScreen ? tenScreenSpeechData : + selectedScreen instanceof phet.numberPairs.TwentyScreen ? twentyScreenSpeechData : + selectedScreen instanceof phet.numberPairs.SumScreen ? sumScreenSpeechData : null; } );