From 2f4c8726e0bb1e56204dffb8dab27fefb46f7996 Mon Sep 17 00:00:00 2001 From: Ian Storm Taylor Date: Mon, 11 Jul 2016 18:39:45 -0700 Subject: [PATCH] add attributes props in examples --- examples/auto-markdown/index.js | 19 +++++++++---------- examples/code-highlighting/index.js | 3 +-- examples/hovering-menu/index.js | 15 --------------- examples/images/index.js | 3 +-- examples/links/index.js | 2 +- examples/paste-html/index.js | 25 ++++++++++++------------- examples/tables/index.js | 7 +++---- 7 files changed, 27 insertions(+), 47 deletions(-) diff --git a/examples/auto-markdown/index.js b/examples/auto-markdown/index.js index 5b338040b..4f54cc226 100644 --- a/examples/auto-markdown/index.js +++ b/examples/auto-markdown/index.js @@ -11,16 +11,15 @@ import initialState from './state.json' */ const NODES = { - 'block-quote': props =>
{props.children}
, - 'bulleted-list': props => , - 'heading-one': props =>

{props.children}

, - 'heading-two': props =>

{props.children}

, - 'heading-three': props =>

{props.children}

, - 'heading-four': props =>

{props.children}

, - 'heading-five': props =>
{props.children}
, - 'heading-six': props =>
{props.children}
, - 'list-item': props =>
  • {props.children}
  • , - 'paragraph': props =>

    {props.children}

    + 'block-quote': props =>
    {props.children}
    , + 'bulleted-list': props => , + 'heading-one': props =>

    {props.children}

    , + 'heading-two': props =>

    {props.children}

    , + 'heading-three': props =>

    {props.children}

    , + 'heading-four': props =>

    {props.children}

    , + 'heading-five': props =>
    {props.children}
    , + 'heading-six': props =>
    {props.children}
    , + 'list-item': props =>
  • {props.children}
  • } /** diff --git a/examples/code-highlighting/index.js b/examples/code-highlighting/index.js index f593c520d..c6db5d1aa 100644 --- a/examples/code-highlighting/index.js +++ b/examples/code-highlighting/index.js @@ -12,8 +12,7 @@ import initialState from './state.json' */ const NODES = { - code: props =>
    {props.children}
    , - paragraph: props =>

    {props.children}

    + code: props =>
    {props.children}
    } /** diff --git a/examples/hovering-menu/index.js b/examples/hovering-menu/index.js index 62c560bc8..910e9ddff 100644 --- a/examples/hovering-menu/index.js +++ b/examples/hovering-menu/index.js @@ -5,16 +5,6 @@ import React from 'react' import position from 'selection-position' import initialState from './state.json' -/** - * Node renderers. - * - * @type {Object} - */ - -const NODES = { - paragraph: props =>

    {props.children}

    -} - /** * Mark renderers. * @@ -99,7 +89,6 @@ class HoveringMenu extends React.Component {
    @@ -107,10 +96,6 @@ class HoveringMenu extends React.Component { ) } - renderNode = (node) => { - return NODES[node.type] - } - renderMark = (mark) => { return MARKS[mark.type] } diff --git a/examples/images/index.js b/examples/images/index.js index 163d4a32a..15f25debf 100644 --- a/examples/images/index.js +++ b/examples/images/index.js @@ -12,13 +12,12 @@ import { Map } from 'immutable' */ const NODES = { - paragraph: props =>

    {props.children}

    , image: (props) => { const { node, state } = props const { data } = node const isActive = state.isFocused && state.blocks.includes(node) const src = data.get('src') - return + return } } diff --git a/examples/links/index.js b/examples/links/index.js index 3eb96b434..e30dc0ad2 100644 --- a/examples/links/index.js +++ b/examples/links/index.js @@ -16,7 +16,7 @@ const NODES = { link: (props) => { const { data } = props.node const href = data.get('href') - return {props.children} + return {props.children} } } diff --git a/examples/paste-html/index.js b/examples/paste-html/index.js index ff1449105..bdcbd162f 100644 --- a/examples/paste-html/index.js +++ b/examples/paste-html/index.js @@ -10,22 +10,21 @@ import initialState from './state.json' */ const NODES = { - 'bulleted-list': props =>
      {props.children}
    , - 'code': props =>
    {props.children}
    , - 'heading-one': props =>

    {props.children}

    , - 'heading-two': props =>

    {props.children}

    , - 'heading-three': props =>

    {props.children}

    , - 'heading-four': props =>

    {props.children}

    , - 'heading-five': props =>
    {props.children}
    , - 'heading-six': props =>
    {props.children}
    , - 'list-item': props =>
  • {props.children}
  • , - 'numbered-list': props =>
      {props.children}
    , - 'paragraph': props =>

    {props.children}

    , - 'quote': props =>
    {props.children}
    , + 'bulleted-list': props =>
      {props.children}
    , + 'code': props =>
    {props.children}
    , + 'heading-one': props =>

    {props.children}

    , + 'heading-two': props =>

    {props.children}

    , + 'heading-three': props =>

    {props.children}

    , + 'heading-four': props =>

    {props.children}

    , + 'heading-five': props =>
    {props.children}
    , + 'heading-six': props =>
    {props.children}
    , + 'list-item': props =>
  • {props.children}
  • , + 'numbered-list': props =>
      {props.children}
    , + 'quote': props =>
    {props.children}
    , 'link': (props) => { const { data } = props.node const href = data.get('href') - return {props.children} + return {props.children} } } diff --git a/examples/tables/index.js b/examples/tables/index.js index 998efdb5b..0004474f4 100644 --- a/examples/tables/index.js +++ b/examples/tables/index.js @@ -11,10 +11,9 @@ import keycode from 'keycode' */ const NODES = { - 'paragraph': props =>

    {props.children}

    , - 'table': props => {props.children}
    , - 'table-row': props => {props.children}, - 'table-cell': props => {props.children} + 'table': props => {props.children}
    , + 'table-row': props => {props.children}, + 'table-cell': props => {props.children} } /**