<commit_before>React = require 'react'

{TaskStepStore} = require '../../flux/task-step'
{ArbitraryHtmlAndMath, ChapterSectionMixin} = require 'openstax-react-components'
{BookContentMixin, LinkContentMixin} = require '../book-content-mixin'

# TODO: will combine with below, after BookContentMixin clean up
ReadingStepContent = React.createClass
  displayName: 'ReadingStepContent'

  propTypes:
    id: React.PropTypes.string.isRequired
    courseDataProps: React.PropTypes.object.isRequired
    stepType: React.PropTypes.string.isRequired

  mixins: [BookContentMixin, ChapterSectionMixin]
  # used by BookContentMixin
  getSplashTitle: ->
    TaskStepStore.get(@props.id)?.title or ''
  getCnxId: ->
    TaskStepStore.getCnxId(@props.id)
  shouldOpenNewTab: -> true
  render: ->
    {id, courseDataProps, stepType} = @props
    {content_html} = TaskStepStore.get(id)

    <ArbitraryHtmlAndMath
      {...courseDataProps}
      className={"#{stepType}-step"}
      html={content_html} />


StepContent = React.createClass
  displayName: 'StepContent'

  propTypes:
    id: React.PropTypes.string.isRequired
    stepType: React.PropTypes.string.isRequired

  mixins: [LinkContentMixin]
  # used by LinkContentMixin
  getCnxId: ->
    TaskStepStore.getCnxId(@props.id)

  render: ->
    {id, stepType} = @props
    {content_html} = TaskStepStore.get(id)
    <div className={"#{stepType}-step"}>
      <ArbitraryHtmlAndMath className={"#{stepType}-content"} html={content_html} />
    </div>


module.exports = {StepContent, ReadingStepContent}<commit_msg>Fixes the problem where the embed frame gets wrapped around interactives when it shouldn't.  This makes the condition based on the type of step instead of trying to figure out what it is based on the URL.<commit_after>React = require 'react'

{TaskStepStore} = require '../../flux/task-step'
{ArbitraryHtmlAndMath, ChapterSectionMixin} = require 'openstax-react-components'
{BookContentMixin, LinkContentMixin} = require '../book-content-mixin'

# TODO: will combine with below, after BookContentMixin clean up
ReadingStepContent = React.createClass
  displayName: 'ReadingStepContent'

  propTypes:
    id: React.PropTypes.string.isRequired
    courseDataProps: React.PropTypes.object.isRequired
    stepType: React.PropTypes.string.isRequired

  mixins: [BookContentMixin, ChapterSectionMixin]
  # used by BookContentMixin
  getSplashTitle: ->
    TaskStepStore.get(@props.id)?.title or ''
  getCnxId: ->
    TaskStepStore.getCnxId(@props.id)
  shouldOpenNewTab: -> true
  render: ->
    {id, courseDataProps, stepType} = @props
    {content_html} = TaskStepStore.get(id)

    <ArbitraryHtmlAndMath
      {...courseDataProps}
      className={"#{stepType}-step"}
      html={content_html} />


StepContent = React.createClass
  displayName: 'StepContent'

  propTypes:
    id: React.PropTypes.string.isRequired
    stepType: React.PropTypes.string.isRequired

  mixins: [LinkContentMixin]
  # used by LinkContentMixin
  getCnxId: ->
    TaskStepStore.getCnxId(@props.id)

  shouldExcludeFrame: ->
    (@props.stepType == 'interactive')

  render: ->
    {id, stepType} = @props
    {content_html} = TaskStepStore.get(id)
    <div className={"#{stepType}-step"}>
      <ArbitraryHtmlAndMath className={"#{stepType}-content"} html={content_html} shouldExcludeFrame={@shouldExcludeFrame} />
    </div>


module.exports = {StepContent, ReadingStepContent}
{'fraction_non_alphanumeric': 0.12026987386330303, 'fraction_numerical': 0.0, 'mean_word_length': 4.336463223787168, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 24, 'https://': 0, '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': '1559979', 'n_tokens_mistral': 1089, 'n_tokens_neox': 1075, 'n_words': 217}