@atlaskit/editor-plugin-quick-insert 2.5.3 → 2.5.5

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,21 @@
1
1
  # @atlaskit/editor-plugin-quick-insert
2
2
 
3
+ ## 2.5.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#164625](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/164625)
8
+ [`aac10c2d4c08d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/aac10c2d4c08d) -
9
+ [ED-26900] Add a new config, getMoreOptionsButtonConfig, to TypeAheadHandler so that it can
10
+ support adding a more option button to typeahead list
11
+ - Updated dependencies
12
+
13
+ ## 2.5.4
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies
18
+
3
19
  ## 2.5.3
4
20
 
5
21
  ### Patch Changes
@@ -11,9 +11,11 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
11
11
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
12
12
  var _react = _interopRequireDefault(require("react"));
13
13
  var _reactIntlNext = require("react-intl-next");
14
+ var _messages = require("@atlaskit/editor-common/messages");
14
15
  var _quickInsert = require("@atlaskit/editor-common/quick-insert");
15
16
  var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
16
17
  var _typeAhead = require("@atlaskit/editor-common/type-ahead");
18
+ var _showMoreHorizontalEditorMore = _interopRequireDefault(require("@atlaskit/icon/core/migration/show-more-horizontal--editor-more"));
17
19
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
18
20
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
19
21
  var _commands = require("./pm-plugins/commands");
@@ -56,6 +58,7 @@ var quickInsertPlugin = exports.quickInsertPlugin = function quickInsertPlugin(_
56
58
  // This is used by typeahead plugin to trigger element browser modal without introducing circular dependency.
57
59
  // Given it's only temporarily needed to roll out toolbar&menus separate to quick insert/right rail change
58
60
  // skip updating `TypeAheadHandler` to avoid unnecessary breaking change.
61
+ // Remove this when clean up platform_editor_controls_patch_12 as it's replaced by getMoreOptionsButtonConfig
59
62
  openElementBrowserModal: options !== null && options !== void 0 && options.enableElementBrowser ? function () {
60
63
  api === null || api === void 0 || api.core.actions.execute(function (_ref3) {
61
64
  var tr = _ref3.tr;
@@ -73,7 +76,18 @@ var quickInsertPlugin = exports.quickInsertPlugin = function quickInsertPlugin(_
73
76
  });
74
77
  return tr;
75
78
  });
76
- } : undefined
79
+ } : undefined,
80
+ getMoreOptionsButtonConfig: function getMoreOptionsButtonConfig(_ref4) {
81
+ var formatMessage = _ref4.formatMessage;
82
+ return {
83
+ title: formatMessage(_messages.toolbarInsertBlockMessages.viewMore),
84
+ ariaLabel: formatMessage(_messages.toolbarInsertBlockMessages.viewMoreAriaLabel),
85
+ onClick: _commands.openElementBrowserModal,
86
+ iconBefore: /*#__PURE__*/_react.default.createElement(_showMoreHorizontalEditorMore.default, {
87
+ label: ""
88
+ })
89
+ };
90
+ }
77
91
  };
78
92
  var intl;
79
93
  return {
@@ -82,10 +96,10 @@ var quickInsertPlugin = exports.quickInsertPlugin = function quickInsertPlugin(_
82
96
  return [{
83
97
  name: 'quickInsert',
84
98
  // It's important that this plugin is above TypeAheadPlugin
85
- plugin: function plugin(_ref4) {
86
- var providerFactory = _ref4.providerFactory,
87
- getIntl = _ref4.getIntl,
88
- dispatch = _ref4.dispatch;
99
+ plugin: function plugin(_ref5) {
100
+ var providerFactory = _ref5.providerFactory,
101
+ getIntl = _ref5.getIntl,
102
+ dispatch = _ref5.dispatch;
89
103
  return quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispatch, options === null || options === void 0 ? void 0 : options.emptyStateHandler);
90
104
  }
91
105
  }];
@@ -93,8 +107,8 @@ var quickInsertPlugin = exports.quickInsertPlugin = function quickInsertPlugin(_
93
107
  pluginsOptions: {
94
108
  typeAhead: typeAhead
95
109
  },
96
- contentComponent: function contentComponent(_ref5) {
97
- var editorView = _ref5.editorView;
110
+ contentComponent: function contentComponent(_ref6) {
111
+ var editorView = _ref6.editorView;
98
112
  if (options !== null && options !== void 0 && options.enableElementBrowser) {
99
113
  return /*#__PURE__*/_react.default.createElement(_ModalElementBrowser.default, {
100
114
  editorView: editorView,
@@ -132,9 +146,9 @@ var quickInsertPlugin = exports.quickInsertPlugin = function quickInsertPlugin(_
132
146
  },
133
147
  getSuggestions: function getSuggestions(searchOptions) {
134
148
  var _api$quickInsert$shar, _api$quickInsert;
135
- var _ref6 = (_api$quickInsert$shar = api === null || api === void 0 || (_api$quickInsert = api.quickInsert) === null || _api$quickInsert === void 0 ? void 0 : _api$quickInsert.sharedState.currentState()) !== null && _api$quickInsert$shar !== void 0 ? _api$quickInsert$shar : {},
136
- lazyDefaultItems = _ref6.lazyDefaultItems,
137
- providedItems = _ref6.providedItems;
149
+ var _ref7 = (_api$quickInsert$shar = api === null || api === void 0 || (_api$quickInsert = api.quickInsert) === null || _api$quickInsert === void 0 ? void 0 : _api$quickInsert.sharedState.currentState()) !== null && _api$quickInsert$shar !== void 0 ? _api$quickInsert$shar : {},
150
+ lazyDefaultItems = _ref7.lazyDefaultItems,
151
+ providedItems = _ref7.providedItems;
138
152
  if (options !== null && options !== void 0 && options.prioritySortingFn) {
139
153
  searchOptions = _objectSpread(_objectSpread({}, searchOptions), {}, {
140
154
  prioritySortingFn: options.prioritySortingFn
@@ -144,8 +158,8 @@ var quickInsertPlugin = exports.quickInsertPlugin = function quickInsertPlugin(_
144
158
  }
145
159
  },
146
160
  commands: {
147
- openElementBrowserModal: function openElementBrowserModal(_ref7) {
148
- var tr = _ref7.tr;
161
+ openElementBrowserModal: function openElementBrowserModal(_ref8) {
162
+ var tr = _ref8.tr;
149
163
  if ((0, _platformFeatureFlags.fg)('platform_editor_ease_of_use_metrics')) {
150
164
  var _api$metrics2;
151
165
  api === null || api === void 0 || (_api$metrics2 = api.metrics) === null || _api$metrics2 === void 0 || _api$metrics2.commands.handleIntentToStartEdit({
@@ -160,11 +174,11 @@ var quickInsertPlugin = exports.quickInsertPlugin = function quickInsertPlugin(_
160
174
  });
161
175
  },
162
176
  addQuickInsertItem: function addQuickInsertItem(item) {
163
- return function (_ref8) {
177
+ return function (_ref9) {
164
178
  var _api$quickInsert$shar2, _api$quickInsert2;
165
- var tr = _ref8.tr;
166
- var _ref9 = (_api$quickInsert$shar2 = api === null || api === void 0 || (_api$quickInsert2 = api.quickInsert) === null || _api$quickInsert2 === void 0 ? void 0 : _api$quickInsert2.sharedState.currentState()) !== null && _api$quickInsert$shar2 !== void 0 ? _api$quickInsert$shar2 : {},
167
- lazyDefaultItems = _ref9.lazyDefaultItems;
179
+ var tr = _ref9.tr;
180
+ var _ref0 = (_api$quickInsert$shar2 = api === null || api === void 0 || (_api$quickInsert2 = api.quickInsert) === null || _api$quickInsert2 === void 0 ? void 0 : _api$quickInsert2.sharedState.currentState()) !== null && _api$quickInsert$shar2 !== void 0 ? _api$quickInsert$shar2 : {},
181
+ lazyDefaultItems = _ref0.lazyDefaultItems;
168
182
  var defaultItems = lazyDefaultItems ? lazyDefaultItems() : [];
169
183
  var memoisedNewItems = (0, _quickInsert.memoProcessQuickInsertItems)([item], intl);
170
184
  return tr.setMeta(_pluginKey.pluginKey, {
@@ -222,7 +236,7 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
222
236
  },
223
237
  view: function view(editorView) {
224
238
  var providerHandler = /*#__PURE__*/function () {
225
- var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_name, providerPromise) {
239
+ var _ref1 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_name, providerPromise) {
226
240
  var provider, providedItems;
227
241
  return _regenerator.default.wrap(function _callee$(_context) {
228
242
  while (1) switch (_context.prev = _context.next) {
@@ -258,7 +272,7 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
258
272
  }, _callee, null, [[1, 11]]);
259
273
  }));
260
274
  return function providerHandler(_x, _x2) {
261
- return _ref10.apply(this, arguments);
275
+ return _ref1.apply(this, arguments);
262
276
  };
263
277
  }();
264
278
  providerFactory.subscribe('quickInsertProvider', providerHandler);
@@ -17,8 +17,7 @@ var _questionCircle = _interopRequireDefault(require("@atlaskit/icon/core/migrat
17
17
  var _modalDialog = _interopRequireWildcard(require("@atlaskit/modal-dialog"));
18
18
  var _colors = require("@atlaskit/theme/colors");
19
19
  var _categories = require("./categories");
20
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
21
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
20
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
22
21
  /**
23
22
  * @jsxRuntime classic
24
23
  * @jsx jsx
@@ -13,8 +13,7 @@ var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-
13
13
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
14
14
  var _commands = require("../../pm-plugins/commands");
15
15
  var _ModalElementBrowser = _interopRequireDefault(require("./ModalElementBrowser"));
16
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
17
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
16
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
18
17
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
19
18
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
20
19
  var Modal = function Modal(_ref) {
@@ -1,8 +1,10 @@
1
1
  import React from 'react';
2
2
  import { useIntl } from 'react-intl-next';
3
+ import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
3
4
  import { memoProcessQuickInsertItems } from '@atlaskit/editor-common/quick-insert';
4
5
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
5
6
  import { TypeAheadAvailableNodes } from '@atlaskit/editor-common/type-ahead';
7
+ import ShowMoreHorizontalIcon from '@atlaskit/icon/core/migration/show-more-horizontal--editor-more';
6
8
  import { fg } from '@atlaskit/platform-feature-flags';
7
9
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
8
10
  import { createInsertItem, openElementBrowserModal } from './pm-plugins/commands';
@@ -45,6 +47,7 @@ export const quickInsertPlugin = ({
45
47
  // This is used by typeahead plugin to trigger element browser modal without introducing circular dependency.
46
48
  // Given it's only temporarily needed to roll out toolbar&menus separate to quick insert/right rail change
47
49
  // skip updating `TypeAheadHandler` to avoid unnecessary breaking change.
50
+ // Remove this when clean up platform_editor_controls_patch_12 as it's replaced by getMoreOptionsButtonConfig
48
51
  openElementBrowserModal: options !== null && options !== void 0 && options.enableElementBrowser ? () => {
49
52
  api === null || api === void 0 ? void 0 : api.core.actions.execute(({
50
53
  tr
@@ -63,7 +66,19 @@ export const quickInsertPlugin = ({
63
66
  });
64
67
  return tr;
65
68
  });
66
- } : undefined
69
+ } : undefined,
70
+ getMoreOptionsButtonConfig: ({
71
+ formatMessage
72
+ }) => {
73
+ return {
74
+ title: formatMessage(messages.viewMore),
75
+ ariaLabel: formatMessage(messages.viewMoreAriaLabel),
76
+ onClick: openElementBrowserModal,
77
+ iconBefore: /*#__PURE__*/React.createElement(ShowMoreHorizontalIcon, {
78
+ label: ""
79
+ })
80
+ };
81
+ }
67
82
  };
68
83
  let intl;
69
84
  return {
@@ -6,9 +6,11 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
6
6
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
7
7
  import React from 'react';
8
8
  import { useIntl } from 'react-intl-next';
9
+ import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
9
10
  import { memoProcessQuickInsertItems } from '@atlaskit/editor-common/quick-insert';
10
11
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
11
12
  import { TypeAheadAvailableNodes } from '@atlaskit/editor-common/type-ahead';
13
+ import ShowMoreHorizontalIcon from '@atlaskit/icon/core/migration/show-more-horizontal--editor-more';
12
14
  import { fg } from '@atlaskit/platform-feature-flags';
13
15
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
14
16
  import { createInsertItem, openElementBrowserModal as _openElementBrowserModal } from './pm-plugins/commands';
@@ -49,6 +51,7 @@ export var quickInsertPlugin = function quickInsertPlugin(_ref) {
49
51
  // This is used by typeahead plugin to trigger element browser modal without introducing circular dependency.
50
52
  // Given it's only temporarily needed to roll out toolbar&menus separate to quick insert/right rail change
51
53
  // skip updating `TypeAheadHandler` to avoid unnecessary breaking change.
54
+ // Remove this when clean up platform_editor_controls_patch_12 as it's replaced by getMoreOptionsButtonConfig
52
55
  openElementBrowserModal: options !== null && options !== void 0 && options.enableElementBrowser ? function () {
53
56
  api === null || api === void 0 || api.core.actions.execute(function (_ref3) {
54
57
  var tr = _ref3.tr;
@@ -66,7 +69,18 @@ export var quickInsertPlugin = function quickInsertPlugin(_ref) {
66
69
  });
67
70
  return tr;
68
71
  });
69
- } : undefined
72
+ } : undefined,
73
+ getMoreOptionsButtonConfig: function getMoreOptionsButtonConfig(_ref4) {
74
+ var formatMessage = _ref4.formatMessage;
75
+ return {
76
+ title: formatMessage(messages.viewMore),
77
+ ariaLabel: formatMessage(messages.viewMoreAriaLabel),
78
+ onClick: _openElementBrowserModal,
79
+ iconBefore: /*#__PURE__*/React.createElement(ShowMoreHorizontalIcon, {
80
+ label: ""
81
+ })
82
+ };
83
+ }
70
84
  };
71
85
  var intl;
72
86
  return {
@@ -75,10 +89,10 @@ export var quickInsertPlugin = function quickInsertPlugin(_ref) {
75
89
  return [{
76
90
  name: 'quickInsert',
77
91
  // It's important that this plugin is above TypeAheadPlugin
78
- plugin: function plugin(_ref4) {
79
- var providerFactory = _ref4.providerFactory,
80
- getIntl = _ref4.getIntl,
81
- dispatch = _ref4.dispatch;
92
+ plugin: function plugin(_ref5) {
93
+ var providerFactory = _ref5.providerFactory,
94
+ getIntl = _ref5.getIntl,
95
+ dispatch = _ref5.dispatch;
82
96
  return quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispatch, options === null || options === void 0 ? void 0 : options.emptyStateHandler);
83
97
  }
84
98
  }];
@@ -86,8 +100,8 @@ export var quickInsertPlugin = function quickInsertPlugin(_ref) {
86
100
  pluginsOptions: {
87
101
  typeAhead: typeAhead
88
102
  },
89
- contentComponent: function contentComponent(_ref5) {
90
- var editorView = _ref5.editorView;
103
+ contentComponent: function contentComponent(_ref6) {
104
+ var editorView = _ref6.editorView;
91
105
  if (options !== null && options !== void 0 && options.enableElementBrowser) {
92
106
  return /*#__PURE__*/React.createElement(ModalElementBrowser, {
93
107
  editorView: editorView,
@@ -125,9 +139,9 @@ export var quickInsertPlugin = function quickInsertPlugin(_ref) {
125
139
  },
126
140
  getSuggestions: function getSuggestions(searchOptions) {
127
141
  var _api$quickInsert$shar, _api$quickInsert;
128
- var _ref6 = (_api$quickInsert$shar = api === null || api === void 0 || (_api$quickInsert = api.quickInsert) === null || _api$quickInsert === void 0 ? void 0 : _api$quickInsert.sharedState.currentState()) !== null && _api$quickInsert$shar !== void 0 ? _api$quickInsert$shar : {},
129
- lazyDefaultItems = _ref6.lazyDefaultItems,
130
- providedItems = _ref6.providedItems;
142
+ var _ref7 = (_api$quickInsert$shar = api === null || api === void 0 || (_api$quickInsert = api.quickInsert) === null || _api$quickInsert === void 0 ? void 0 : _api$quickInsert.sharedState.currentState()) !== null && _api$quickInsert$shar !== void 0 ? _api$quickInsert$shar : {},
143
+ lazyDefaultItems = _ref7.lazyDefaultItems,
144
+ providedItems = _ref7.providedItems;
131
145
  if (options !== null && options !== void 0 && options.prioritySortingFn) {
132
146
  searchOptions = _objectSpread(_objectSpread({}, searchOptions), {}, {
133
147
  prioritySortingFn: options.prioritySortingFn
@@ -137,8 +151,8 @@ export var quickInsertPlugin = function quickInsertPlugin(_ref) {
137
151
  }
138
152
  },
139
153
  commands: {
140
- openElementBrowserModal: function openElementBrowserModal(_ref7) {
141
- var tr = _ref7.tr;
154
+ openElementBrowserModal: function openElementBrowserModal(_ref8) {
155
+ var tr = _ref8.tr;
142
156
  if (fg('platform_editor_ease_of_use_metrics')) {
143
157
  var _api$metrics2;
144
158
  api === null || api === void 0 || (_api$metrics2 = api.metrics) === null || _api$metrics2 === void 0 || _api$metrics2.commands.handleIntentToStartEdit({
@@ -153,11 +167,11 @@ export var quickInsertPlugin = function quickInsertPlugin(_ref) {
153
167
  });
154
168
  },
155
169
  addQuickInsertItem: function addQuickInsertItem(item) {
156
- return function (_ref8) {
170
+ return function (_ref9) {
157
171
  var _api$quickInsert$shar2, _api$quickInsert2;
158
- var tr = _ref8.tr;
159
- var _ref9 = (_api$quickInsert$shar2 = api === null || api === void 0 || (_api$quickInsert2 = api.quickInsert) === null || _api$quickInsert2 === void 0 ? void 0 : _api$quickInsert2.sharedState.currentState()) !== null && _api$quickInsert$shar2 !== void 0 ? _api$quickInsert$shar2 : {},
160
- lazyDefaultItems = _ref9.lazyDefaultItems;
172
+ var tr = _ref9.tr;
173
+ var _ref0 = (_api$quickInsert$shar2 = api === null || api === void 0 || (_api$quickInsert2 = api.quickInsert) === null || _api$quickInsert2 === void 0 ? void 0 : _api$quickInsert2.sharedState.currentState()) !== null && _api$quickInsert$shar2 !== void 0 ? _api$quickInsert$shar2 : {},
174
+ lazyDefaultItems = _ref0.lazyDefaultItems;
161
175
  var defaultItems = lazyDefaultItems ? lazyDefaultItems() : [];
162
176
  var memoisedNewItems = memoProcessQuickInsertItems([item], intl);
163
177
  return tr.setMeta(pluginKey, {
@@ -215,7 +229,7 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
215
229
  },
216
230
  view: function view(editorView) {
217
231
  var providerHandler = /*#__PURE__*/function () {
218
- var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_name, providerPromise) {
232
+ var _ref1 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_name, providerPromise) {
219
233
  var provider, providedItems;
220
234
  return _regeneratorRuntime.wrap(function _callee$(_context) {
221
235
  while (1) switch (_context.prev = _context.next) {
@@ -251,7 +265,7 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
251
265
  }, _callee, null, [[1, 11]]);
252
266
  }));
253
267
  return function providerHandler(_x, _x2) {
254
- return _ref10.apply(this, arguments);
268
+ return _ref1.apply(this, arguments);
255
269
  };
256
270
  }();
257
271
  providerFactory.subscribe('quickInsertProvider', providerHandler);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-quick-insert",
3
- "version": "2.5.3",
3
+ "version": "2.5.5",
4
4
  "description": "Quick insert plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -34,7 +34,7 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@atlaskit/button": "^23.2.0",
37
- "@atlaskit/editor-common": "^106.0.0",
37
+ "@atlaskit/editor-common": "^106.3.0",
38
38
  "@atlaskit/editor-plugin-connectivity": "^2.0.0",
39
39
  "@atlaskit/editor-plugin-metrics": "^3.4.0",
40
40
  "@atlaskit/editor-plugin-type-ahead": "^2.7.0",
@@ -43,8 +43,8 @@
43
43
  "@atlaskit/modal-dialog": "^14.2.0",
44
44
  "@atlaskit/platform-feature-flags": "^1.1.0",
45
45
  "@atlaskit/theme": "^18.0.0",
46
- "@atlaskit/tmp-editor-statsig": "^5.2.0",
47
- "@atlaskit/tokens": "^4.9.0",
46
+ "@atlaskit/tmp-editor-statsig": "^5.13.0",
47
+ "@atlaskit/tokens": "^5.0.0",
48
48
  "@babel/runtime": "^7.0.0",
49
49
  "@emotion/react": "^11.7.1"
50
50
  },