ProseMirror plugin variables should be defined on plugin state.

Scenario without plugin state:

Expected behavior: Press `Add Parentheses` to generate parentheses in pairs.

Reproducing the issue with dropped transaction:

  1. Press `Add Parentheses`. Result: `(`.
  2. Press `Add Parentheses with dropped transaction`. Result: None.
  3. Press `Add Parentheses`. Result: `(`. Should yield `)` instead.

Reproducing the issue with multiple editors:

  1. Press `Add Parentheses`. Result: `(`.
  2. Press `Reuse the plugin to create another editor`. Create another editor using the plugin.
  3. Press `Add Parentheses to another editor`. Result: `)`. Should yield `(` instead.