UNPKG

jssm

Version:

A Javascript finite state machine (FSM) with a terse DSL and a simple API. Most FSMs are one-liners. Fast, easy, powerful, well tested, typed with TypeScript, and visualizations. MIT License.

59 lines (58 loc) 1.76 kB
const base_state_style = { shape: 'rectangle', backgroundColor: 'white', textColor: 'black', borderColor: 'black' }; const base_active_state_style = { textColor: 'white', backgroundColor: 'dodgerblue4' }; const base_hooked_state_style = { shape: 'component' }; const base_terminal_state_style = { textColor: 'white', backgroundColor: 'crimson' }; const base_active_terminal_state_style = { textColor: 'white', backgroundColor: 'indigo' }; const base_start_state_style = { backgroundColor: 'yellow' }; const base_active_start_state_style = { backgroundColor: 'yellowgreen' }; const base_active_hooked_state_style = { backgroundColor: 'yellowgreen' }; const base_end_state_style = { textColor: 'white', backgroundColor: 'darkolivegreen' }; const base_active_end_state_style = { textColor: 'white', backgroundColor: 'darkgreen' }; const default_theme = { name: 'default', state: base_state_style, start: base_start_state_style, end: base_end_state_style, terminal: base_terminal_state_style, hooked: base_hooked_state_style, active: base_active_state_style, active_start: base_active_start_state_style, active_end: base_active_end_state_style, active_terminal: base_active_terminal_state_style, active_hooked: base_active_hooked_state_style, legal: undefined, main: undefined, forced: undefined, action: undefined, graph: undefined, title: undefined // TODO FIXME }; export { base_state_style, base_active_state_style, base_terminal_state_style, base_active_terminal_state_style, base_start_state_style, base_active_start_state_style, base_end_state_style, base_active_end_state_style, default_theme, default_theme as theme };