src/scripts/story-steps.js
function(current) {
                    if (current && current.props) {
                      if (current.props.isScreenerComponent === true) {
                        return current.props.steps;
                      } else {
                        var steps = null;
                        if (typeof current.props.story === 'function') {
                          steps = findScreenerSteps(current.props.story());
                        }
                        if (!steps && typeof current.props.storyFn === 'function') {
                          steps = findScreenerSteps(current.props.storyFn());
                        }
                        if (!steps && current.props.initialContent) {
                          steps = findScreenerSteps(current.props.initialContent);
                        }
                        if (!steps && typeof current.type === 'function') {
                          try {
                            steps = findScreenerSteps(current.type());
                          } catch(ex) { /**/ }
                        }
                        if (!steps && current.props.children) {
                          var children = current.props.children;
                          // handle array of children
                          if (typeof children === 'object' && typeof children.map === 'function' && children.length > 0) {
                            for (var i = 0, len = children.length; i < len; i++) {
                              steps = findScreenerSteps(children[i]);
                              if (steps) break;
                            }
                          } else {
                            steps = findScreenerSteps(children);
                          }
                        }
                        return steps;
                      }
                    }
                  }
function(current) {
                    if (current && current.props) {
                      if (current.props.isScreenerComponent === true) {
                        return current.props.steps;
                      } else {
                        var steps = null;
                        if (typeof current.props.story === 'function') {
                          steps = findScreenerSteps(current.props.story());
                        }
                        if (!steps && typeof current.props.storyFn === 'function') {
                          steps = findScreenerSteps(current.props.storyFn());
                        }
                        if (!steps && current.props.initialContent) {
                          steps = findScreenerSteps(current.props.initialContent);
                        }
                        if (!steps && typeof current.type === 'function') {
                          try {
                            steps = findScreenerSteps(current.type());
                          } catch(ex) { /**/ }
                        }
                        if (!steps && current.props.children) {
                          var children = current.props.children;
                          // handle array of children
                          if (typeof children === 'object' && typeof children.map === 'function' && children.length > 0) {
                            for (var i = 0, len = children.length; i < len; i++) {
                              steps = findScreenerSteps(children[i]);
                              if (steps) break;
                            }
                          } else {
                            steps = findScreenerSteps(children);
                          }
                        }
                        return steps;
                      }
                    }
                  }
function ( current ) { if ( current && current . props ) { if ( current . props . isScreenerComponent === true ) { return current . props . steps ; } else { var steps = null ; if ( typeof current . props . story === 'function' ) { steps = findScreenerSteps ( current . props . story ( ) ) ; } if ( ! steps && typeof current . props . storyFn === 'function' ) { steps = findScreenerSteps ( current . props . storyFn ( ) ) ; } if ( ! steps && current . props . initialContent ) { steps = findScreenerSteps ( current . props . initialContent ) ; } if ( ! steps && typeof current . type === 'function' ) { try { steps = findScreenerSteps ( current . type ( ) ) ; } catch ( ex ) { /**/ } } if ( ! steps && current . props . children ) { var children = current . props . children ; // handle array of children if ( typeof children === 'object' && typeof children . map === 'function' && children . length > 0 ) { for ( var i = 0 , len = children . length ; i < len ; i ++ ) { steps = findScreenerSteps ( children [ i ] ) ; if ( steps ) break ; } } else { steps = findScreenerSteps ( children ) ; } } return steps ; } } }
recursively find screener steps
recursively find screener steps