@atlaskit/editor-plugin-type-ahead 11.1.4 → 11.2.0

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,22 @@
1
1
  # @atlaskit/editor-plugin-type-ahead
2
2
 
3
+ ## 11.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`31c4f99dfaafa`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/31c4f99dfaafa) -
8
+ fix(editor): fix wide slash trigger opening menu for ASCII '/' on macOS IME
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies
13
+
14
+ ## 11.1.5
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies
19
+
3
20
  ## 11.1.4
4
21
 
5
22
  ### Patch Changes
@@ -30,6 +30,7 @@ var hasValidTypeAheadStep = function hasValidTypeAheadStep(tr) {
30
30
  }
31
31
  return null;
32
32
  };
33
+ /** Creates the type-ahead ProseMirror plugin. */
33
34
  function createPlugin(_ref) {
34
35
  var reactDispatch = _ref.reactDispatch,
35
36
  popupMountRef = _ref.popupMountRef,
@@ -146,7 +147,18 @@ function createPlugin(_ref) {
146
147
  if (!handler.customRegex) {
147
148
  return false;
148
149
  }
149
- // Only match if the entire composition is a trigger character
150
+ // Only match if the composition is a NON-ASCII trigger character.
151
+ // ASCII triggers (e.g. '/') are handled by the normal input rule
152
+ // path and must NOT be intercepted here — otherwise typing '/' on
153
+ // a macOS Japanese IME (which briefly fires compositionupdate with
154
+ // data='/') would cause the Enter-confirm to open the typeahead.
155
+ // Matches any single ASCII character (U+0000–U+007F).
156
+ // No 'u' flag needed for ASCII-only ranges.
157
+ // Ignored via go/ees005
158
+ // eslint-disable-next-line require-unicode-regexp
159
+ if (/^[\x00-\x7F]$/.test(pendingData)) {
160
+ return false;
161
+ }
150
162
  var pattern = new RegExp("^(".concat(handler.customRegex, ")$"), 'u');
151
163
  return pattern.test(pendingData);
152
164
  })) !== null && _typeAheadHandlers$fi !== void 0 ? _typeAheadHandlers$fi : null;
@@ -22,6 +22,7 @@ const hasValidTypeAheadStep = tr => {
22
22
  }
23
23
  return null;
24
24
  };
25
+ /** Creates the type-ahead ProseMirror plugin. */
25
26
  export function createPlugin({
26
27
  reactDispatch,
27
28
  popupMountRef,
@@ -140,7 +141,18 @@ export function createPlugin({
140
141
  if (!handler.customRegex) {
141
142
  return false;
142
143
  }
143
- // Only match if the entire composition is a trigger character
144
+ // Only match if the composition is a NON-ASCII trigger character.
145
+ // ASCII triggers (e.g. '/') are handled by the normal input rule
146
+ // path and must NOT be intercepted here — otherwise typing '/' on
147
+ // a macOS Japanese IME (which briefly fires compositionupdate with
148
+ // data='/') would cause the Enter-confirm to open the typeahead.
149
+ // Matches any single ASCII character (U+0000–U+007F).
150
+ // No 'u' flag needed for ASCII-only ranges.
151
+ // Ignored via go/ees005
152
+ // eslint-disable-next-line require-unicode-regexp
153
+ if (/^[\x00-\x7F]$/.test(pendingData)) {
154
+ return false;
155
+ }
144
156
  const pattern = new RegExp(`^(${handler.customRegex})$`, 'u');
145
157
  return pattern.test(pendingData);
146
158
  })) !== null && _typeAheadHandlers$fi !== void 0 ? _typeAheadHandlers$fi : null;
@@ -24,6 +24,7 @@ var hasValidTypeAheadStep = function hasValidTypeAheadStep(tr) {
24
24
  }
25
25
  return null;
26
26
  };
27
+ /** Creates the type-ahead ProseMirror plugin. */
27
28
  export function createPlugin(_ref) {
28
29
  var reactDispatch = _ref.reactDispatch,
29
30
  popupMountRef = _ref.popupMountRef,
@@ -140,7 +141,18 @@ export function createPlugin(_ref) {
140
141
  if (!handler.customRegex) {
141
142
  return false;
142
143
  }
143
- // Only match if the entire composition is a trigger character
144
+ // Only match if the composition is a NON-ASCII trigger character.
145
+ // ASCII triggers (e.g. '/') are handled by the normal input rule
146
+ // path and must NOT be intercepted here — otherwise typing '/' on
147
+ // a macOS Japanese IME (which briefly fires compositionupdate with
148
+ // data='/') would cause the Enter-confirm to open the typeahead.
149
+ // Matches any single ASCII character (U+0000–U+007F).
150
+ // No 'u' flag needed for ASCII-only ranges.
151
+ // Ignored via go/ees005
152
+ // eslint-disable-next-line require-unicode-regexp
153
+ if (/^[\x00-\x7F]$/.test(pendingData)) {
154
+ return false;
155
+ }
144
156
  var pattern = new RegExp("^(".concat(handler.customRegex, ")$"), 'u');
145
157
  return pattern.test(pendingData);
146
158
  })) !== null && _typeAheadHandlers$fi !== void 0 ? _typeAheadHandlers$fi : null;
@@ -13,5 +13,6 @@ type Props = {
13
13
  reactDispatch: Dispatch;
14
14
  typeAheadHandlers: Array<TypeAheadHandler>;
15
15
  };
16
+ /** Creates the type-ahead ProseMirror plugin. */
16
17
  export declare function createPlugin({ reactDispatch, popupMountRef, typeAheadHandlers, getIntl, nodeViewPortalProviderAPI, api, }: Props): SafePlugin;
17
18
  export {};
@@ -13,5 +13,6 @@ type Props = {
13
13
  reactDispatch: Dispatch;
14
14
  typeAheadHandlers: Array<TypeAheadHandler>;
15
15
  };
16
+ /** Creates the type-ahead ProseMirror plugin. */
16
17
  export declare function createPlugin({ reactDispatch, popupMountRef, typeAheadHandlers, getIntl, nodeViewPortalProviderAPI, api, }: Props): SafePlugin;
17
18
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-type-ahead",
3
- "version": "11.1.4",
3
+ "version": "11.2.0",
4
4
  "description": "Type-ahead plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -44,7 +44,7 @@
44
44
  "@atlaskit/primitives": "^19.0.0",
45
45
  "@atlaskit/prosemirror-history": "^0.2.0",
46
46
  "@atlaskit/prosemirror-input-rules": "^3.7.0",
47
- "@atlaskit/tmp-editor-statsig": "^92.0.0",
47
+ "@atlaskit/tmp-editor-statsig": "^93.0.0",
48
48
  "@atlaskit/tokens": "^13.3.0",
49
49
  "@atlaskit/visually-hidden": "^3.1.0",
50
50
  "@babel/runtime": "^7.0.0",