<commit_before>// Copyright 2014-2020, University of Colorado Boulder

/**
 * Shows an Options dialog that consists of sim-global options.
 *
 * @author <NAME> <<EMAIL>>
 * @author <NAME> (PixelZoom, Inc.)
 */

import inherit from '../../phet-core/js/inherit.js';
import merge from '../../phet-core/js/merge.js';
import PhetFont from '../../scenery-phet/js/PhetFont.js';
import Text from '../../scenery/js/nodes/Text.js';
import Dialog from '../../sun/js/Dialog.js';
import Tandem from '../../tandem/js/Tandem.js';
import joistStrings from './joistStrings.js';
import joist from './joist.js';

const optionsTitleString = joistStrings.options.title;

/**
 * @param {function(tandem:Tandem):Node} createContent - creates the dialog's content
 * @param {Object} [options]
 * @constructor
 */
function OptionsDialog( createContent, options ) {

  options = merge( {

    titleAlign: 'center',
    bottomMargin: 20,
    ySpacing: 20,

    // phet-io
    tandem: Tandem.REQUIRED,
    phetioDynamicElement: true
  }, options );

  assert && assert( !options.title, 'OptionsDialog sets title' );
  options.title = new Text( optionsTitleString, {
    font: new PhetFont( 30 ),
    maxWidth: 400, // determined empirically
    tandem: options.tandem.createTandem( 'title' )
  } );

  const content = createContent( options.tandem.createTandem( 'content' ) );<commit_msg>OptionsDialog can't be stateful, https://github.com/phetsims/joist/issues/634<commit_after>// Copyright 2014-2020, University of Colorado Boulder

/**
 * Shows an Options dialog that consists of sim-global options.
 *
 * @author <NAME> <<EMAIL>>
 * @author Chris Malley (PixelZoom, Inc.)
 */

import inherit from '../../phet-core/js/inherit.js';
import merge from '../../phet-core/js/merge.js';
import PhetFont from '../../scenery-phet/js/PhetFont.js';
import Text from '../../scenery/js/nodes/Text.js';
import Dialog from '../../sun/js/Dialog.js';
import Tandem from '../../tandem/js/Tandem.js';
import joistStrings from './joistStrings.js';
import joist from './joist.js';

const optionsTitleString = joistStrings.options.title;

/**
 * @param {function(tandem:Tandem):Node} createContent - creates the dialog's content
 * @param {Object} [options]
 * @constructor
 */
function OptionsDialog( createContent, options ) {

  options = merge( {

    titleAlign: 'center',
    bottomMargin: 20,
    ySpacing: 20,

    // phet-io
    tandem: Tandem.REQUIRED,
    phetioState: false, // cannot recreate the `createContent` function consistently, or dispose it
    phetioDynamicElement: true
  }, options );

  assert && assert( !options.title, 'OptionsDialog sets title' );
  options.title = new Text( optionsTitleString, {
    font: new PhetFont( 30 ),
    maxWidth: 400, // determined empirically
    tandem: options.tandem.createTandem( 'title' )
  } );

  const content = createContent( options.tandem.createTandem( 'content' ) );
{'fraction_non_alphanumeric': 0.15467128027681662, 'fraction_numerical': 0.012802768166089966, 'mean_word_length': 3.5961844197138313, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '724554', 'n_tokens_mistral': 957, 'n_tokens_neox': 896, 'n_words': 243}