Created
April 5, 2020 03:18
-
-
Save jacobparis/1a27cf4ddb397f593a7008769e3e69ed to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions | |
// - XState (all XState exports) | |
const formatMachine = Machine({ | |
id: 'format', | |
type: 'parallel', | |
states: { | |
bold: { | |
initial: 'off', | |
states: { | |
on: { | |
on: { | |
BOLD: 'off' | |
} | |
}, | |
off: { | |
on: { | |
BOLD: 'on' | |
} | |
} | |
} | |
}, | |
italic: { | |
initial: 'off', | |
states: { | |
on: { | |
on: { | |
ITALICIZE: 'off' | |
} | |
}, | |
off: { | |
on: { | |
ITALICIZE: 'on' | |
} | |
} | |
} | |
}, | |
underlined: { | |
initial: 'off', | |
states: { | |
on: { | |
on: { | |
UNDERLINE: 'off' | |
} | |
}, | |
off: { | |
on: { | |
UNDERLINE: 'on' | |
} | |
} | |
} | |
}, | |
align: { | |
on: { | |
LEFT: 'align.left', | |
CENTER: 'align.center', | |
RIGHT: 'align.right', | |
JUSTIFY: 'align.justify' | |
}, | |
initial: 'left', | |
states: { | |
left: {}, | |
center: {}, | |
right: {}, | |
justify: {} | |
} | |
}, | |
line_break: { | |
initial: 'paragraph', | |
states: { | |
paragraph: { | |
on: { | |
NUMBER: 'numbers', | |
BULLET: 'bullets' | |
} | |
}, | |
numbers: { | |
on: { | |
NUMBER: 'paragraph', | |
BULLET: 'bullets' | |
} | |
}, | |
bullets: { | |
on: { | |
NUMBER: 'numbers', | |
BULLET: 'paragraph' | |
} | |
} | |
} | |
} | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment