<commit_before>/** @jsx jsx */
import { jsx } from '@emotion/core';
import * as React from 'react';
import Image from '../Image';

export let type = 'image';

export let ImageAlignmentContext = React.createContext({
  aligment: '',
  onAlignmentChange() {},
});

export function Node(props) {
  let { data } = props.node;
  let { aligment, onAlignmentChange } = React.useContext(ImageAlignmentContext);
  return (
    <Image
      alignment={aligment}
      attributes={props.attributes}
      isFocused={props.isFocused}
      src={data.get('src')}
      onAlignmentChange={onAlignmentChange}
    />
  );
}

export let schema = {
  isVoid: true,
  data: {
    alignment(value) {
      switch (value) {
        case 'center':
        case 'left':
        case 'right': {
          return true;
        }
      }
      return false;
    },
  },
  normalize(editor, { code, node, key }) {
    switch (code) {
      case 'node_data_invalid': {
        if (key === 'alignment') {
          editor.setNodeByKey(node.key, {
            data: node.data.set('alignment', 'center'),
          });
        }
      }
    }
  },
};<commit_msg>Remove alignment stuff for images<commit_after>/** @jsx jsx */
import { jsx } from '@emotion/core';
import * as React from 'react';
import Image from '../Image';

export let type = 'image';

export let ImageAlignmentContext = React.createContext({
  aligment: '',
  onAlignmentChange() {},
});

export function Node(props) {
  let { data } = props.node;
  let { aligment, onAlignmentChange } = React.useContext(ImageAlignmentContext);
  return (
    <Image
      alignment={aligment}
      attributes={props.attributes}
      isFocused={props.isFocused}
      src={data.get('src')}
      onAlignmentChange={onAlignmentChange}
    />
  );
}

export let schema = {
  isVoid: true,
};
{'fraction_non_alphanumeric': 0.14735099337748345, 'fraction_numerical': 0.0, 'mean_word_length': 2.769230769230769, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6437455', 'n_tokens_mistral': 564, 'n_tokens_neox': 563, 'n_words': 129}