@atlaskit/editor-plugin-quick-insert 10.4.5 → 10.4.7

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,23 @@
1
1
  # @atlaskit/editor-plugin-quick-insert
2
2
 
3
+ ## 10.4.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [`cf6977530a136`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cf6977530a136) -
8
+ Support fullwidth slash / (U+FF0F) as a quick insert trigger for Japanese/CJK keyboard users.
9
+ Japanese keyboards produce the fullwidth slash when pressing the / key, which previously did not
10
+ open the quick insert menu. The fix adds a `customRegex` to the quick-insert typeahead handler
11
+ that matches both ASCII slash `/` and fullwidth slash `/`, and extends the trigger cleanup logic
12
+ in `openTypeAheadAtCursor` to handle `customRegex` alternatives.
13
+ - Updated dependencies
14
+
15
+ ## 10.4.6
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies
20
+
3
21
  ## 10.4.5
4
22
 
5
23
  ### Patch Changes
@@ -38,6 +38,8 @@ var quickInsertPlugin = exports.quickInsertPlugin = function quickInsertPlugin(_
38
38
  var typeAhead = {
39
39
  id: _typeAhead.TypeAheadAvailableNodes.QUICK_INSERT,
40
40
  trigger: '/',
41
+ // Support fullwidth slash (U+FF0F) used by Japanese/CJK keyboards (e.g. typing / on a Japanese keyboard layout)
42
+ customRegex: (0, _expValEquals.expValEquals)('platform_editor_wide_slash_trigger', 'isEnabled', true) ? '\\(?([//])' : undefined,
41
43
  headless: options === null || options === void 0 ? void 0 : options.headless,
42
44
  getItems: function getItems(_ref2) {
43
45
  var query = _ref2.query,
@@ -322,39 +324,39 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
322
324
  view: function view(editorView) {
323
325
  var providerHandler = /*#__PURE__*/function () {
324
326
  var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_name, providerPromise) {
325
- var provider, providedItems;
326
- return _regenerator.default.wrap(function _callee$(_context) {
327
+ var provider, providedItems, _t;
328
+ return _regenerator.default.wrap(function (_context) {
327
329
  while (1) switch (_context.prev = _context.next) {
328
330
  case 0:
329
331
  if (!providerPromise) {
330
- _context.next = 14;
332
+ _context.next = 5;
331
333
  break;
332
334
  }
333
335
  _context.prev = 1;
334
- _context.next = 4;
336
+ _context.next = 2;
335
337
  return providerPromise;
336
- case 4:
338
+ case 2:
337
339
  provider = _context.sent;
338
- _context.next = 7;
340
+ _context.next = 3;
339
341
  return provider.getItems();
340
- case 7:
342
+ case 3:
341
343
  providedItems = _context.sent;
342
344
  setProviderState({
343
345
  provider: provider,
344
346
  providedItems: providedItems
345
347
  })(editorView.state, editorView.dispatch);
346
- _context.next = 14;
348
+ _context.next = 5;
347
349
  break;
348
- case 11:
349
- _context.prev = 11;
350
- _context.t0 = _context["catch"](1);
350
+ case 4:
351
+ _context.prev = 4;
352
+ _t = _context["catch"](1);
351
353
  // eslint-disable-next-line no-console
352
- console.error('Error getting items from quick insert provider', _context.t0);
353
- case 14:
354
+ console.error('Error getting items from quick insert provider', _t);
355
+ case 5:
354
356
  case "end":
355
357
  return _context.stop();
356
358
  }
357
- }, _callee, null, [[1, 11]]);
359
+ }, _callee, null, [[1, 4]]);
358
360
  }));
359
361
  return function providerHandler(_x, _x2) {
360
362
  return _ref13.apply(this, arguments);
@@ -26,6 +26,8 @@ export const quickInsertPlugin = ({
26
26
  const typeAhead = {
27
27
  id: TypeAheadAvailableNodes.QUICK_INSERT,
28
28
  trigger: '/',
29
+ // Support fullwidth slash (U+FF0F) used by Japanese/CJK keyboards (e.g. typing / on a Japanese keyboard layout)
30
+ customRegex: expValEquals('platform_editor_wide_slash_trigger', 'isEnabled', true) ? '\\(?([//])' : undefined,
29
31
  headless: options === null || options === void 0 ? void 0 : options.headless,
30
32
  getItems({
31
33
  query,
@@ -31,6 +31,8 @@ export var quickInsertPlugin = function quickInsertPlugin(_ref) {
31
31
  var typeAhead = {
32
32
  id: TypeAheadAvailableNodes.QUICK_INSERT,
33
33
  trigger: '/',
34
+ // Support fullwidth slash (U+FF0F) used by Japanese/CJK keyboards (e.g. typing / on a Japanese keyboard layout)
35
+ customRegex: expValEquals('platform_editor_wide_slash_trigger', 'isEnabled', true) ? '\\(?([//])' : undefined,
34
36
  headless: options === null || options === void 0 ? void 0 : options.headless,
35
37
  getItems: function getItems(_ref2) {
36
38
  var query = _ref2.query,
@@ -315,39 +317,39 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
315
317
  view: function view(editorView) {
316
318
  var providerHandler = /*#__PURE__*/function () {
317
319
  var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_name, providerPromise) {
318
- var provider, providedItems;
319
- return _regeneratorRuntime.wrap(function _callee$(_context) {
320
+ var provider, providedItems, _t;
321
+ return _regeneratorRuntime.wrap(function (_context) {
320
322
  while (1) switch (_context.prev = _context.next) {
321
323
  case 0:
322
324
  if (!providerPromise) {
323
- _context.next = 14;
325
+ _context.next = 5;
324
326
  break;
325
327
  }
326
328
  _context.prev = 1;
327
- _context.next = 4;
329
+ _context.next = 2;
328
330
  return providerPromise;
329
- case 4:
331
+ case 2:
330
332
  provider = _context.sent;
331
- _context.next = 7;
333
+ _context.next = 3;
332
334
  return provider.getItems();
333
- case 7:
335
+ case 3:
334
336
  providedItems = _context.sent;
335
337
  setProviderState({
336
338
  provider: provider,
337
339
  providedItems: providedItems
338
340
  })(editorView.state, editorView.dispatch);
339
- _context.next = 14;
341
+ _context.next = 5;
340
342
  break;
341
- case 11:
342
- _context.prev = 11;
343
- _context.t0 = _context["catch"](1);
343
+ case 4:
344
+ _context.prev = 4;
345
+ _t = _context["catch"](1);
344
346
  // eslint-disable-next-line no-console
345
- console.error('Error getting items from quick insert provider', _context.t0);
346
- case 14:
347
+ console.error('Error getting items from quick insert provider', _t);
348
+ case 5:
347
349
  case "end":
348
350
  return _context.stop();
349
351
  }
350
- }, _callee, null, [[1, 11]]);
352
+ }, _callee, null, [[1, 4]]);
351
353
  }));
352
354
  return function providerHandler(_x, _x2) {
353
355
  return _ref13.apply(this, arguments);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-quick-insert",
3
- "version": "10.4.5",
3
+ "version": "10.4.7",
4
4
  "description": "Quick insert plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -33,18 +33,18 @@
33
33
  "@atlaskit/editor-plugin-analytics": "^10.1.0",
34
34
  "@atlaskit/editor-plugin-connectivity": "^10.1.0",
35
35
  "@atlaskit/editor-plugin-metrics": "^11.1.0",
36
- "@atlaskit/editor-plugin-type-ahead": "^10.2.0",
36
+ "@atlaskit/editor-plugin-type-ahead": "^10.3.0",
37
37
  "@atlaskit/editor-prosemirror": "^7.3.0",
38
- "@atlaskit/icon": "^35.1.0",
38
+ "@atlaskit/icon": "^35.3.0",
39
39
  "@atlaskit/modal-dialog": "^15.2.0",
40
40
  "@atlaskit/platform-feature-flags": "^1.1.0",
41
- "@atlaskit/tmp-editor-statsig": "^83.0.0",
42
- "@atlaskit/tokens": "^13.0.0",
41
+ "@atlaskit/tmp-editor-statsig": "^84.3.0",
42
+ "@atlaskit/tokens": "^13.1.0",
43
43
  "@babel/runtime": "^7.0.0",
44
44
  "@emotion/react": "^11.7.1"
45
45
  },
46
46
  "peerDependencies": {
47
- "@atlaskit/editor-common": "^114.46.0",
47
+ "@atlaskit/editor-common": "^114.50.0",
48
48
  "react": "^18.2.0",
49
49
  "react-dom": "^18.2.0",
50
50
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"