<commit_before>import { ADD_COMPONENT, MOVE_COMPONENT, DELETE_COMPONENT, UPDATE_STYLE } from '../../actions/workspace';
import { ADD_STATE, ADD_PROPS, ADD_STYLES, ADD_EVENTS, DELETE_STATE, DELETE_PROPS, DELETE_STYLES, DELETE_EVENTS } from '../../actions/config';
import { SET_ACTIVE_COMPONENT } from '../../actions/FileSystemActions';
import { METHODS } from '../../actions/methods';
import { WORKSPACE_ID } from './../../constants';
import addComponent from './addComponent';
import deleteComponent from './deleteComponent';
import moveComponent from './moveComponent';
import addStateValue from './addStateValue';
import addPropsValue from './addPropsValue';
import addStyleValue from './addStyleValue';
import addEvent from './addEvent';
import deleteStateValue from './deleteStateValue';
import deletePropsValue from './deletePropsValue';
import deleteStylesValue from './deleteStylesValue';
import deleteEvent from './deleteEvent';
import setActiveComponent from './setActiveComponent';
import updateStyle from './updateStyle';
import updateMethods from './updateMethods';
// /// TEST DATA /////

const defaultWorkspace = {
  componentCounter: 2,
  activeComponent: '0',
  components: {
    workspace: {
      id: WORKSPACE_ID,
      children: [0, 1],
      events: {},
      props: {
        style: {
        }
      }
    },
  },
  state: {},
  methods: '/*Anything you type in here will be appended to App.js as a \n method. you can then attach them as event handlers, logic handlers, etc. \n make sure to append an "@" symbol following the closing bracket of your method!*/',
  methodNames: [],
};

defaultWorkspace.components[0] = {
  id: 0,
  name: 'BlackBox',
  children: [],
  parentID: WORKSPACE_ID,
  props: {
    style: {
      position: 'absolute',
      height: '100px',
      width: '100px',
      display: 'inline-block',
      backgroundColor: 'black',
      overflow: 'auto',
    },
  },
  events: { onClick: '()=>{console.log("test")}' }
};

defaultWorkspace.components[1] = {
  id: 1,
  name: 'BlueBox',
  children: [],
  parentID: WORKSPACE_ID,
  props: {
    style: {
      position: 'absolute',
      height: '100px',
      width: '100px',
      display: 'inline-block',
      backgroundColor: 'blue',
      overflow: 'auto',
    },
  },
  events: {}
};

// ////////

export default function workspace(state = defaultWorkspace, action) {
  switch (action.type) {
    case ADD_COMPONENT:
      return addComponent(state, action);

    case DELETE_COMPONENT:
      return deleteComponent(state, action);

    case MOVE_COMPONENT:
      return moveComponent(state, action);

    case ADD_STATE:
      return addStateValue(state, action.aState);<commit_msg>Disable components being added to initial application state<commit_after>import { ADD_COMPONENT, MOVE_COMPONENT, DELETE_COMPONENT, UPDATE_STYLE } from '../../actions/workspace';
import { ADD_STATE, ADD_PROPS, ADD_STYLES, ADD_EVENTS, DELETE_STATE, DELETE_PROPS, DELETE_STYLES, DELETE_EVENTS } from '../../actions/config';
import { SET_ACTIVE_COMPONENT } from '../../actions/FileSystemActions';
import { METHODS } from '../../actions/methods';
import { WORKSPACE_ID } from './../../constants';
import addComponent from './addComponent';
import deleteComponent from './deleteComponent';
import moveComponent from './moveComponent';
import addStateValue from './addStateValue';
import addPropsValue from './addPropsValue';
import addStyleValue from './addStyleValue';
import addEvent from './addEvent';
import deleteStateValue from './deleteStateValue';
import deletePropsValue from './deletePropsValue';
import deleteStylesValue from './deleteStylesValue';
import deleteEvent from './deleteEvent';
import setActiveComponent from './setActiveComponent';
import updateStyle from './updateStyle';
import updateMethods from './updateMethods';
// /// TEST DATA /////

const defaultWorkspace = {
  componentCounter: 0,
  // activeComponent: '0',
  activeComponent: WORKSPACE_ID,
  components: {
    workspace: {
      id: WORKSPACE_ID,
      // children: [0, 1],
      children: [],
      events: {},
      props: {
        style: {}
      }
    },
  },
  state: {},
  methods: '/*Anything you type in here will be appended to App.js as a \n method. you can then attach them as event handlers, logic handlers, etc. \n make sure to append an "@" symbol following the closing bracket of your method!*/',
  methodNames: [],
};

// defaultWorkspace.components[0] = {
//   id: 0,
//   name: 'BlackBox',
//   children: [],
//   parentID: WORKSPACE_ID,
//   props: {
//     style: {
//       position: 'absolute',
//       height: '100px',
//       width: '100px',
//       display: 'inline-block',
//       backgroundColor: 'black',
//       overflow: 'auto',
//     },
//   },
//   events: { onClick: '()=>{console.log("test")}' }
// };

// defaultWorkspace.components[1] = {
//   id: 1,
//   name: 'BlueBox',
//   children: [],
//   parentID: WORKSPACE_ID,
//   props: {
//     style: {
//       position: 'absolute',
//       height: '100px',
//       width: '100px',
//       display: 'inline-block',
//       backgroundColor: 'blue',
//       overflow: 'auto',
//     },
//   },
//   events: {}
// };

// ////////

export default function workspace(state = defaultWorkspace, action) {
  switch (action.type) {
    case ADD_COMPONENT:
      return addComponent(state, action);

    case DELETE_COMPONENT:
      return deleteComponent(state, action);

    case MOVE_COMPONENT:
      return moveComponent(state, action);

    case ADD_STATE:
      return addStateValue(state, action.aState);
{'fraction_non_alphanumeric': 0.1507736595897805, 'fraction_numerical': 0.007196833393306945, 'mean_word_length': 3.1828442437923252, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4868314', 'n_tokens_mistral': 1671, 'n_tokens_neox': 1644, 'n_words': 453}