@atlaskit/prosemirror-input-rules 2.1.9 → 2.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @atlaskit/prosemirror-input-rules
2
2
 
3
+ ## 2.1.11
4
+
5
+ ### Patch Changes
6
+
7
+ - [`2e01c9c74b5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2e01c9c74b5) - DUMMY remove before merging to master; dupe adf-schema via adf-utils
8
+ - Updated dependencies
9
+
10
+ ## 2.1.10
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+
3
16
  ## 2.1.9
4
17
 
5
18
  ### Patch Changes
@@ -1,45 +1,34 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.createInputEventHandler = void 0;
9
-
10
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
-
12
9
  var _selection = require("@atlaskit/editor-common/selection");
13
-
14
10
  var _constants = require("./constants");
15
-
16
11
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
17
-
18
12
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
19
-
20
13
  var createInputEventHandler = function createInputEventHandler(_ref) {
21
14
  var rules = _ref.rules,
22
- pluginKey = _ref.pluginKey,
23
- allowInsertTextOnDocument = _ref.allowInsertTextOnDocument,
24
- onInputEvent = _ref.onInputEvent,
25
- onBeforeRegexMatch = _ref.onBeforeRegexMatch;
15
+ pluginKey = _ref.pluginKey,
16
+ allowInsertTextOnDocument = _ref.allowInsertTextOnDocument,
17
+ onInputEvent = _ref.onInputEvent,
18
+ onBeforeRegexMatch = _ref.onBeforeRegexMatch;
26
19
  return function (_ref2) {
27
20
  var view = _ref2.view,
28
- from = _ref2.from,
29
- to = _ref2.to,
30
- text = _ref2.text;
31
-
21
+ from = _ref2.from,
22
+ to = _ref2.to,
23
+ text = _ref2.text;
32
24
  if (view.composing) {
33
25
  return false;
34
26
  }
35
-
36
27
  var state = view.state;
37
28
  var $from = state.doc.resolve(from);
38
-
39
29
  if ($from.parent.type.spec.code) {
40
30
  return false;
41
31
  }
42
-
43
32
  if (onInputEvent && !onInputEvent({
44
33
  state: state,
45
34
  from: from,
@@ -47,7 +36,6 @@ var createInputEventHandler = function createInputEventHandler(_ref) {
47
36
  })) {
48
37
  return false;
49
38
  }
50
-
51
39
  var textBefore = $from.parent.textBetween(Math.max(0, $from.parentOffset - _constants.MAX_REGEX_MATCH), $from.parentOffset, undefined, _constants.leafNodeReplacementCharacter) + text;
52
40
  var result = findMatchOnRules({
53
41
  rules: rules,
@@ -56,11 +44,9 @@ var createInputEventHandler = function createInputEventHandler(_ref) {
56
44
  to: to,
57
45
  state: state
58
46
  });
59
-
60
47
  if (!result) {
61
48
  return false;
62
49
  }
63
-
64
50
  var tr = allowInsertTextOnDocument ? state.tr.insertText(text, from, to) : state.tr;
65
51
  tr.setMeta(_constants.TEXT_INPUT_RULE_TRANSACTION_KEY, true);
66
52
  tr.setMeta(pluginKey, {
@@ -69,46 +55,38 @@ var createInputEventHandler = function createInputEventHandler(_ref) {
69
55
  to: result.to,
70
56
  matchedRule: result.matchedRule
71
57
  });
72
-
73
58
  if (onBeforeRegexMatch) {
74
59
  onBeforeRegexMatch(tr);
75
60
  }
76
-
77
61
  view.dispatch(tr);
78
62
  return true;
79
63
  };
80
64
  };
81
-
82
65
  exports.createInputEventHandler = createInputEventHandler;
83
-
84
66
  function findMatchOnRules(_ref3) {
85
67
  var rules = _ref3.rules,
86
- textBefore = _ref3.textBefore,
87
- from = _ref3.from,
88
- to = _ref3.to,
89
- state = _ref3.state;
90
-
68
+ textBefore = _ref3.textBefore,
69
+ from = _ref3.from,
70
+ to = _ref3.to,
71
+ state = _ref3.state;
91
72
  for (var i = 0; i < rules.length; i++) {
92
73
  var _textBefore$at;
74
+ var rule = rules[i];
93
75
 
94
- var rule = rules[i]; // Some plugins like Typeahead require a whitespace before a trigger character.
76
+ // Some plugins like Typeahead require a whitespace before a trigger character.
95
77
  // We want them to fire inside a gap cursor. Yet, a gap cursor is not considered a whitespace,
96
78
  // and `textBefore` contains the text in the previous block before the gap cursor.
97
79
  // Here is a workaround: if we inside a gap cursor, match the input rule only against the last typed character
98
80
  // (which may be a typeahead trigger) and ignore the rest.
99
-
100
81
  var matchString = state.selection instanceof _selection.GapCursorSelection ? (_textBefore$at = textBefore.at(-1)) !== null && _textBefore$at !== void 0 ? _textBefore$at : '' : textBefore;
101
82
  var match = rule.match.exec(matchString);
102
-
103
83
  if (!match) {
104
84
  continue;
105
85
  }
106
-
107
86
  var parentNodeStartAt = state.selection.$from.start();
108
87
  var offset = Math.max(0, state.selection.$from.parentOffset - _constants.MAX_REGEX_MATCH);
109
88
  var fromFixed = Math.max(parentNodeStartAt + match.index + offset, 1);
110
89
  var transform = rule.handler(state, match, fromFixed, to);
111
-
112
90
  if (transform) {
113
91
  return {
114
92
  from: fromFixed,
@@ -119,6 +97,5 @@ function findMatchOnRules(_ref3) {
119
97
  };
120
98
  }
121
99
  }
122
-
123
100
  return null;
124
101
  }
package/dist/cjs/index.js CHANGED
@@ -27,7 +27,5 @@ Object.defineProperty(exports, "leafNodeReplacementCharacter", {
27
27
  return _constants.leafNodeReplacementCharacter;
28
28
  }
29
29
  });
30
-
31
30
  var _constants = require("./constants");
32
-
33
31
  var _plugin = require("./plugin");
@@ -4,15 +4,10 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.createInputRulePlugin = createInputRulePlugin;
7
-
8
7
  var _prosemirrorState = require("prosemirror-state");
9
-
10
8
  var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
11
-
12
9
  var _constants = require("./constants");
13
-
14
10
  var _handler = require("./handler");
15
-
16
11
  function createInputRulePlugin(pluginName, rules) {
17
12
  var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
18
13
  var onInputEvent = options === null || options === void 0 ? void 0 : options.onInputEvent;
@@ -34,11 +29,9 @@ function createInputRulePlugin(pluginName, rules) {
34
29
  },
35
30
  apply: function apply(tr, prev) {
36
31
  var stored = tr.getMeta(pluginKey);
37
-
38
32
  if (stored) {
39
33
  return stored;
40
34
  }
41
-
42
35
  return tr.selectionSet || tr.docChanged ? null : prev;
43
36
  }
44
37
  },
@@ -47,28 +40,22 @@ function createInputRulePlugin(pluginName, rules) {
47
40
  return tr.getMeta(pluginKey);
48
41
  });
49
42
  var pluginState = transactionWithInputRuleMeta === null || transactionWithInputRuleMeta === void 0 ? void 0 : transactionWithInputRuleMeta.getMeta(pluginKey);
50
-
51
43
  if (!pluginState || !transactionWithInputRuleMeta) {
52
44
  return null;
53
45
  }
54
-
55
46
  var matchedRule = pluginState.matchedRule,
56
- from = pluginState.from,
57
- to = pluginState.to;
47
+ from = pluginState.from,
48
+ to = pluginState.to;
58
49
  var result = matchedRule.result;
59
50
  var mappedTo = transactionWithInputRuleMeta.mapping.map(to);
60
51
  var tr = matchedRule.handler(newState, result, from, mappedTo);
61
-
62
52
  if (!tr) {
63
53
  return null;
64
54
  }
65
-
66
55
  tr.setMeta(_constants.TEXT_INPUT_RULE_TRANSACTION_KEY, true);
67
-
68
56
  if (matchedRule.onHandlerApply) {
69
57
  matchedRule.onHandlerApply(newState, tr, matchedRule.result);
70
58
  }
71
-
72
59
  return tr;
73
60
  },
74
61
  props: {
@@ -84,13 +71,10 @@ function createInputRulePlugin(pluginName, rules) {
84
71
  compositionend: function compositionend(view) {
85
72
  setTimeout(function () {
86
73
  var selection = view.state.selection;
87
-
88
74
  if (!(selection instanceof _prosemirrorState.TextSelection)) {
89
75
  return;
90
76
  }
91
-
92
77
  var $cursor = selection.$cursor;
93
-
94
78
  if ($cursor) {
95
79
  inputEvent({
96
80
  view: view,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/prosemirror-input-rules",
3
- "version": "2.1.9",
3
+ "version": "2.1.11",
4
4
  "sideEffects": false
5
5
  }
@@ -15,14 +15,11 @@ export const createInputEventHandler = ({
15
15
  if (view.composing) {
16
16
  return false;
17
17
  }
18
-
19
18
  const state = view.state;
20
19
  const $from = state.doc.resolve(from);
21
-
22
20
  if ($from.parent.type.spec.code) {
23
21
  return false;
24
22
  }
25
-
26
23
  if (onInputEvent && !onInputEvent({
27
24
  state,
28
25
  from,
@@ -30,7 +27,6 @@ export const createInputEventHandler = ({
30
27
  })) {
31
28
  return false;
32
29
  }
33
-
34
30
  const textBefore = $from.parent.textBetween(Math.max(0, $from.parentOffset - MAX_REGEX_MATCH), $from.parentOffset, undefined, leafNodeReplacementCharacter) + text;
35
31
  const result = findMatchOnRules({
36
32
  rules,
@@ -39,11 +35,9 @@ export const createInputEventHandler = ({
39
35
  to,
40
36
  state
41
37
  });
42
-
43
38
  if (!result) {
44
39
  return false;
45
40
  }
46
-
47
41
  const tr = allowInsertTextOnDocument ? state.tr.insertText(text, from, to) : state.tr;
48
42
  tr.setMeta(TEXT_INPUT_RULE_TRANSACTION_KEY, true);
49
43
  tr.setMeta(pluginKey, {
@@ -52,15 +46,12 @@ export const createInputEventHandler = ({
52
46
  to: result.to,
53
47
  matchedRule: result.matchedRule
54
48
  });
55
-
56
49
  if (onBeforeRegexMatch) {
57
50
  onBeforeRegexMatch(tr);
58
51
  }
59
-
60
52
  view.dispatch(tr);
61
53
  return true;
62
54
  };
63
-
64
55
  function findMatchOnRules({
65
56
  rules,
66
57
  textBefore,
@@ -70,35 +61,32 @@ function findMatchOnRules({
70
61
  }) {
71
62
  for (let i = 0; i < rules.length; i++) {
72
63
  var _textBefore$at;
64
+ const rule = rules[i];
73
65
 
74
- const rule = rules[i]; // Some plugins like Typeahead require a whitespace before a trigger character.
66
+ // Some plugins like Typeahead require a whitespace before a trigger character.
75
67
  // We want them to fire inside a gap cursor. Yet, a gap cursor is not considered a whitespace,
76
68
  // and `textBefore` contains the text in the previous block before the gap cursor.
77
69
  // Here is a workaround: if we inside a gap cursor, match the input rule only against the last typed character
78
70
  // (which may be a typeahead trigger) and ignore the rest.
79
-
80
71
  const matchString = state.selection instanceof GapCursorSelection ? (_textBefore$at = textBefore.at(-1)) !== null && _textBefore$at !== void 0 ? _textBefore$at : '' : textBefore;
81
72
  const match = rule.match.exec(matchString);
82
-
83
73
  if (!match) {
84
74
  continue;
85
75
  }
86
-
87
76
  const parentNodeStartAt = state.selection.$from.start();
88
77
  const offset = Math.max(0, state.selection.$from.parentOffset - MAX_REGEX_MATCH);
89
78
  const fromFixed = Math.max(parentNodeStartAt + match.index + offset, 1);
90
79
  const transform = rule.handler(state, match, fromFixed, to);
91
-
92
80
  if (transform) {
93
81
  return {
94
82
  from: fromFixed,
95
83
  to,
96
- matchedRule: { ...rule,
84
+ matchedRule: {
85
+ ...rule,
97
86
  result: match
98
87
  }
99
88
  };
100
89
  }
101
90
  }
102
-
103
91
  return null;
104
92
  }
@@ -20,26 +20,20 @@ export function createInputRulePlugin(pluginName, rules, options = {}) {
20
20
  init() {
21
21
  return null;
22
22
  },
23
-
24
23
  apply(tr, prev) {
25
24
  const stored = tr.getMeta(pluginKey);
26
-
27
25
  if (stored) {
28
26
  return stored;
29
27
  }
30
-
31
28
  return tr.selectionSet || tr.docChanged ? null : prev;
32
29
  }
33
-
34
30
  },
35
31
  appendTransaction: (transactions, oldState, newState) => {
36
32
  const transactionWithInputRuleMeta = transactions.find(tr => tr.getMeta(pluginKey));
37
33
  const pluginState = transactionWithInputRuleMeta === null || transactionWithInputRuleMeta === void 0 ? void 0 : transactionWithInputRuleMeta.getMeta(pluginKey);
38
-
39
34
  if (!pluginState || !transactionWithInputRuleMeta) {
40
35
  return null;
41
36
  }
42
-
43
37
  const {
44
38
  matchedRule,
45
39
  from,
@@ -50,17 +44,13 @@ export function createInputRulePlugin(pluginName, rules, options = {}) {
50
44
  } = matchedRule;
51
45
  const mappedTo = transactionWithInputRuleMeta.mapping.map(to);
52
46
  const tr = matchedRule.handler(newState, result, from, mappedTo);
53
-
54
47
  if (!tr) {
55
48
  return null;
56
49
  }
57
-
58
50
  tr.setMeta(TEXT_INPUT_RULE_TRANSACTION_KEY, true);
59
-
60
51
  if (matchedRule.onHandlerApply) {
61
52
  matchedRule.onHandlerApply(newState, tr, matchedRule.result);
62
53
  }
63
-
64
54
  return tr;
65
55
  },
66
56
  props: {
@@ -72,20 +62,16 @@ export function createInputRulePlugin(pluginName, rules, options = {}) {
72
62
  text
73
63
  });
74
64
  },
75
-
76
65
  handleDOMEvents: {
77
66
  compositionend: view => {
78
67
  setTimeout(() => {
79
68
  const selection = view.state.selection;
80
-
81
69
  if (!(selection instanceof TextSelection)) {
82
70
  return;
83
71
  }
84
-
85
72
  const {
86
73
  $cursor
87
74
  } = selection;
88
-
89
75
  if ($cursor) {
90
76
  inputEvent({
91
77
  view,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/prosemirror-input-rules",
3
- "version": "2.1.9",
3
+ "version": "2.1.11",
4
4
  "sideEffects": false
5
5
  }
@@ -1,34 +1,27 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
-
3
2
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
-
5
3
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6
-
7
4
  import { GapCursorSelection } from '@atlaskit/editor-common/selection';
8
5
  import { leafNodeReplacementCharacter, MAX_REGEX_MATCH, TEXT_INPUT_RULE_TRANSACTION_KEY } from './constants';
9
6
  export var createInputEventHandler = function createInputEventHandler(_ref) {
10
7
  var rules = _ref.rules,
11
- pluginKey = _ref.pluginKey,
12
- allowInsertTextOnDocument = _ref.allowInsertTextOnDocument,
13
- onInputEvent = _ref.onInputEvent,
14
- onBeforeRegexMatch = _ref.onBeforeRegexMatch;
8
+ pluginKey = _ref.pluginKey,
9
+ allowInsertTextOnDocument = _ref.allowInsertTextOnDocument,
10
+ onInputEvent = _ref.onInputEvent,
11
+ onBeforeRegexMatch = _ref.onBeforeRegexMatch;
15
12
  return function (_ref2) {
16
13
  var view = _ref2.view,
17
- from = _ref2.from,
18
- to = _ref2.to,
19
- text = _ref2.text;
20
-
14
+ from = _ref2.from,
15
+ to = _ref2.to,
16
+ text = _ref2.text;
21
17
  if (view.composing) {
22
18
  return false;
23
19
  }
24
-
25
20
  var state = view.state;
26
21
  var $from = state.doc.resolve(from);
27
-
28
22
  if ($from.parent.type.spec.code) {
29
23
  return false;
30
24
  }
31
-
32
25
  if (onInputEvent && !onInputEvent({
33
26
  state: state,
34
27
  from: from,
@@ -36,7 +29,6 @@ export var createInputEventHandler = function createInputEventHandler(_ref) {
36
29
  })) {
37
30
  return false;
38
31
  }
39
-
40
32
  var textBefore = $from.parent.textBetween(Math.max(0, $from.parentOffset - MAX_REGEX_MATCH), $from.parentOffset, undefined, leafNodeReplacementCharacter) + text;
41
33
  var result = findMatchOnRules({
42
34
  rules: rules,
@@ -45,11 +37,9 @@ export var createInputEventHandler = function createInputEventHandler(_ref) {
45
37
  to: to,
46
38
  state: state
47
39
  });
48
-
49
40
  if (!result) {
50
41
  return false;
51
42
  }
52
-
53
43
  var tr = allowInsertTextOnDocument ? state.tr.insertText(text, from, to) : state.tr;
54
44
  tr.setMeta(TEXT_INPUT_RULE_TRANSACTION_KEY, true);
55
45
  tr.setMeta(pluginKey, {
@@ -58,44 +48,37 @@ export var createInputEventHandler = function createInputEventHandler(_ref) {
58
48
  to: result.to,
59
49
  matchedRule: result.matchedRule
60
50
  });
61
-
62
51
  if (onBeforeRegexMatch) {
63
52
  onBeforeRegexMatch(tr);
64
53
  }
65
-
66
54
  view.dispatch(tr);
67
55
  return true;
68
56
  };
69
57
  };
70
-
71
58
  function findMatchOnRules(_ref3) {
72
59
  var rules = _ref3.rules,
73
- textBefore = _ref3.textBefore,
74
- from = _ref3.from,
75
- to = _ref3.to,
76
- state = _ref3.state;
77
-
60
+ textBefore = _ref3.textBefore,
61
+ from = _ref3.from,
62
+ to = _ref3.to,
63
+ state = _ref3.state;
78
64
  for (var i = 0; i < rules.length; i++) {
79
65
  var _textBefore$at;
66
+ var rule = rules[i];
80
67
 
81
- var rule = rules[i]; // Some plugins like Typeahead require a whitespace before a trigger character.
68
+ // Some plugins like Typeahead require a whitespace before a trigger character.
82
69
  // We want them to fire inside a gap cursor. Yet, a gap cursor is not considered a whitespace,
83
70
  // and `textBefore` contains the text in the previous block before the gap cursor.
84
71
  // Here is a workaround: if we inside a gap cursor, match the input rule only against the last typed character
85
72
  // (which may be a typeahead trigger) and ignore the rest.
86
-
87
73
  var matchString = state.selection instanceof GapCursorSelection ? (_textBefore$at = textBefore.at(-1)) !== null && _textBefore$at !== void 0 ? _textBefore$at : '' : textBefore;
88
74
  var match = rule.match.exec(matchString);
89
-
90
75
  if (!match) {
91
76
  continue;
92
77
  }
93
-
94
78
  var parentNodeStartAt = state.selection.$from.start();
95
79
  var offset = Math.max(0, state.selection.$from.parentOffset - MAX_REGEX_MATCH);
96
80
  var fromFixed = Math.max(parentNodeStartAt + match.index + offset, 1);
97
81
  var transform = rule.handler(state, match, fromFixed, to);
98
-
99
82
  if (transform) {
100
83
  return {
101
84
  from: fromFixed,
@@ -106,6 +89,5 @@ function findMatchOnRules(_ref3) {
106
89
  };
107
90
  }
108
91
  }
109
-
110
92
  return null;
111
93
  }
@@ -23,11 +23,9 @@ export function createInputRulePlugin(pluginName, rules) {
23
23
  },
24
24
  apply: function apply(tr, prev) {
25
25
  var stored = tr.getMeta(pluginKey);
26
-
27
26
  if (stored) {
28
27
  return stored;
29
28
  }
30
-
31
29
  return tr.selectionSet || tr.docChanged ? null : prev;
32
30
  }
33
31
  },
@@ -36,28 +34,22 @@ export function createInputRulePlugin(pluginName, rules) {
36
34
  return tr.getMeta(pluginKey);
37
35
  });
38
36
  var pluginState = transactionWithInputRuleMeta === null || transactionWithInputRuleMeta === void 0 ? void 0 : transactionWithInputRuleMeta.getMeta(pluginKey);
39
-
40
37
  if (!pluginState || !transactionWithInputRuleMeta) {
41
38
  return null;
42
39
  }
43
-
44
40
  var matchedRule = pluginState.matchedRule,
45
- from = pluginState.from,
46
- to = pluginState.to;
41
+ from = pluginState.from,
42
+ to = pluginState.to;
47
43
  var result = matchedRule.result;
48
44
  var mappedTo = transactionWithInputRuleMeta.mapping.map(to);
49
45
  var tr = matchedRule.handler(newState, result, from, mappedTo);
50
-
51
46
  if (!tr) {
52
47
  return null;
53
48
  }
54
-
55
49
  tr.setMeta(TEXT_INPUT_RULE_TRANSACTION_KEY, true);
56
-
57
50
  if (matchedRule.onHandlerApply) {
58
51
  matchedRule.onHandlerApply(newState, tr, matchedRule.result);
59
52
  }
60
-
61
53
  return tr;
62
54
  },
63
55
  props: {
@@ -73,13 +65,10 @@ export function createInputRulePlugin(pluginName, rules) {
73
65
  compositionend: function compositionend(view) {
74
66
  setTimeout(function () {
75
67
  var selection = view.state.selection;
76
-
77
68
  if (!(selection instanceof TextSelection)) {
78
69
  return;
79
70
  }
80
-
81
71
  var $cursor = selection.$cursor;
82
-
83
72
  if ($cursor) {
84
73
  inputEvent({
85
74
  view: view,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/prosemirror-input-rules",
3
- "version": "2.1.9",
3
+ "version": "2.1.11",
4
4
  "sideEffects": false
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/prosemirror-input-rules",
3
- "version": "2.1.9",
3
+ "version": "2.1.11",
4
4
  "description": "A package that contains helpers to create autoformatting rules for ProseMirror",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -19,13 +19,13 @@
19
19
  "releaseModel": "scheduled"
20
20
  },
21
21
  "dependencies": {
22
- "@atlaskit/editor-common": "^71.0.0",
22
+ "@atlaskit/editor-common": "^72.8.0",
23
23
  "@babel/runtime": "^7.0.0",
24
24
  "prosemirror-state": "1.3.4"
25
25
  },
26
26
  "devDependencies": {
27
- "@atlaskit/adf-schema": "^24.0.0",
28
- "@atlaskit/editor-test-helpers": "^17.2.0",
27
+ "@atlaskit/adf-schema": "^25.5.0",
28
+ "@atlaskit/editor-test-helpers": "^18.2.0",
29
29
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
30
30
  "@types/prosemirror-history": "^1.0.1",
31
31
  "@types/prosemirror-model": "^1.11.0",
package/report.api.md CHANGED
@@ -1,4 +1,4 @@
1
- <!-- API Report Version: 2.2 -->
1
+ <!-- API Report Version: 2.3 -->
2
2
 
3
3
  ## API Report File for "@atlaskit/prosemirror-input-rules"
4
4
 
@@ -8,6 +8,7 @@
8
8
  ### Table of contents
9
9
 
10
10
  - [Main Entry Types](#main-entry-types)
11
+ - [Peer Dependencies](#peer-dependencies)
11
12
 
12
13
  ### Main Entry Types
13
14
 
@@ -80,3 +81,13 @@ export const TEXT_INPUT_RULE_TRANSACTION_KEY = 'input_rule_plugin_transaction';
80
81
  ```
81
82
 
82
83
  <!--SECTION END: Main Entry Types-->
84
+
85
+ ### Peer Dependencies
86
+
87
+ <!--SECTION START: Peer Dependencies-->
88
+
89
+ ```json
90
+ {}
91
+ ```
92
+
93
+ <!--SECTION END: Peer Dependencies-->