@atlaskit/editor-plugin-quick-insert 2.6.3 → 2.6.4

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,14 @@
1
1
  # @atlaskit/editor-plugin-quick-insert
2
2
 
3
+ ## 2.6.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#175339](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/175339)
8
+ [`d4115e4055a0a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d4115e4055a0a) -
9
+ ED-28314 Cleanup platform_editor_controls_patch_12
10
+ - Updated dependencies
11
+
3
12
  ## 2.6.3
4
13
 
5
14
  ### Patch Changes
@@ -54,31 +54,8 @@ var quickInsertPlugin = exports.quickInsertPlugin = function quickInsertPlugin(_
54
54
  }
55
55
  return result;
56
56
  },
57
- // @ts-ignore
58
- // This is used by typeahead plugin to trigger element browser modal without introducing circular dependency.
59
- // Given it's only temporarily needed to roll out toolbar&menus separate to quick insert/right rail change
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
62
- openElementBrowserModal: options !== null && options !== void 0 && options.enableElementBrowser ? function () {
63
- api === null || api === void 0 || api.core.actions.execute(function (_ref3) {
64
- var tr = _ref3.tr;
65
- if ((0, _platformFeatureFlags.fg)('platform_editor_ease_of_use_metrics')) {
66
- var _api$metrics;
67
- api === null || api === void 0 || (_api$metrics = api.metrics) === null || _api$metrics === void 0 || _api$metrics.commands.handleIntentToStartEdit({
68
- shouldStartTimer: false,
69
- shouldPersistActiveSession: true
70
- })({
71
- tr: tr
72
- });
73
- }
74
- (0, _commands.openElementBrowserModal)({
75
- tr: tr
76
- });
77
- return tr;
78
- });
79
- } : undefined,
80
- getMoreOptionsButtonConfig: function getMoreOptionsButtonConfig(_ref4) {
81
- var formatMessage = _ref4.formatMessage;
57
+ getMoreOptionsButtonConfig: function getMoreOptionsButtonConfig(_ref3) {
58
+ var formatMessage = _ref3.formatMessage;
82
59
  return {
83
60
  title: formatMessage(_messages.toolbarInsertBlockMessages.viewMore),
84
61
  ariaLabel: formatMessage(_messages.toolbarInsertBlockMessages.viewMoreAriaLabel),
@@ -96,10 +73,10 @@ var quickInsertPlugin = exports.quickInsertPlugin = function quickInsertPlugin(_
96
73
  return [{
97
74
  name: 'quickInsert',
98
75
  // It's important that this plugin is above TypeAheadPlugin
99
- plugin: function plugin(_ref5) {
100
- var providerFactory = _ref5.providerFactory,
101
- getIntl = _ref5.getIntl,
102
- dispatch = _ref5.dispatch;
76
+ plugin: function plugin(_ref4) {
77
+ var providerFactory = _ref4.providerFactory,
78
+ getIntl = _ref4.getIntl,
79
+ dispatch = _ref4.dispatch;
103
80
  return quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispatch, options === null || options === void 0 ? void 0 : options.emptyStateHandler);
104
81
  }
105
82
  }];
@@ -107,8 +84,8 @@ var quickInsertPlugin = exports.quickInsertPlugin = function quickInsertPlugin(_
107
84
  pluginsOptions: {
108
85
  typeAhead: typeAhead
109
86
  },
110
- contentComponent: function contentComponent(_ref6) {
111
- var editorView = _ref6.editorView;
87
+ contentComponent: function contentComponent(_ref5) {
88
+ var editorView = _ref5.editorView;
112
89
  if (options !== null && options !== void 0 && options.enableElementBrowser) {
113
90
  return /*#__PURE__*/_react.default.createElement(_ModalElementBrowser.default, {
114
91
  editorView: editorView,
@@ -146,9 +123,9 @@ var quickInsertPlugin = exports.quickInsertPlugin = function quickInsertPlugin(_
146
123
  },
147
124
  getSuggestions: function getSuggestions(searchOptions) {
148
125
  var _api$quickInsert$shar, _api$quickInsert;
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;
126
+ 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 : {},
127
+ lazyDefaultItems = _ref6.lazyDefaultItems,
128
+ providedItems = _ref6.providedItems;
152
129
  if (options !== null && options !== void 0 && options.prioritySortingFn) {
153
130
  searchOptions = _objectSpread(_objectSpread({}, searchOptions), {}, {
154
131
  prioritySortingFn: options.prioritySortingFn
@@ -158,11 +135,11 @@ var quickInsertPlugin = exports.quickInsertPlugin = function quickInsertPlugin(_
158
135
  }
159
136
  },
160
137
  commands: {
161
- openElementBrowserModal: function openElementBrowserModal(_ref8) {
162
- var tr = _ref8.tr;
138
+ openElementBrowserModal: function openElementBrowserModal(_ref7) {
139
+ var tr = _ref7.tr;
163
140
  if ((0, _platformFeatureFlags.fg)('platform_editor_ease_of_use_metrics')) {
164
- var _api$metrics2;
165
- api === null || api === void 0 || (_api$metrics2 = api.metrics) === null || _api$metrics2 === void 0 || _api$metrics2.commands.handleIntentToStartEdit({
141
+ var _api$metrics;
142
+ api === null || api === void 0 || (_api$metrics = api.metrics) === null || _api$metrics === void 0 || _api$metrics.commands.handleIntentToStartEdit({
166
143
  shouldStartTimer: false,
167
144
  shouldPersistActiveSession: true
168
145
  })({
@@ -174,11 +151,11 @@ var quickInsertPlugin = exports.quickInsertPlugin = function quickInsertPlugin(_
174
151
  });
175
152
  },
176
153
  addQuickInsertItem: function addQuickInsertItem(item) {
177
- return function (_ref9) {
154
+ return function (_ref8) {
178
155
  var _api$quickInsert$shar2, _api$quickInsert2;
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;
156
+ var tr = _ref8.tr;
157
+ 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 : {},
158
+ lazyDefaultItems = _ref9.lazyDefaultItems;
182
159
  var defaultItems = lazyDefaultItems ? lazyDefaultItems() : [];
183
160
  var memoisedNewItems = (0, _quickInsert.memoProcessQuickInsertItems)([item], intl);
184
161
  return tr.setMeta(_pluginKey.pluginKey, {
@@ -236,7 +213,7 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
236
213
  },
237
214
  view: function view(editorView) {
238
215
  var providerHandler = /*#__PURE__*/function () {
239
- var _ref1 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_name, providerPromise) {
216
+ var _ref0 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_name, providerPromise) {
240
217
  var provider, providedItems;
241
218
  return _regenerator.default.wrap(function _callee$(_context) {
242
219
  while (1) switch (_context.prev = _context.next) {
@@ -272,7 +249,7 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
272
249
  }, _callee, null, [[1, 11]]);
273
250
  }));
274
251
  return function providerHandler(_x, _x2) {
275
- return _ref1.apply(this, arguments);
252
+ return _ref0.apply(this, arguments);
276
253
  };
277
254
  }();
278
255
  providerFactory.subscribe('quickInsertProvider', providerHandler);
@@ -43,30 +43,6 @@ export const quickInsertPlugin = ({
43
43
  }
44
44
  return result;
45
45
  },
46
- // @ts-ignore
47
- // This is used by typeahead plugin to trigger element browser modal without introducing circular dependency.
48
- // Given it's only temporarily needed to roll out toolbar&menus separate to quick insert/right rail change
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
51
- openElementBrowserModal: options !== null && options !== void 0 && options.enableElementBrowser ? () => {
52
- api === null || api === void 0 ? void 0 : api.core.actions.execute(({
53
- tr
54
- }) => {
55
- if (fg('platform_editor_ease_of_use_metrics')) {
56
- var _api$metrics;
57
- api === null || api === void 0 ? void 0 : (_api$metrics = api.metrics) === null || _api$metrics === void 0 ? void 0 : _api$metrics.commands.handleIntentToStartEdit({
58
- shouldStartTimer: false,
59
- shouldPersistActiveSession: true
60
- })({
61
- tr
62
- });
63
- }
64
- openElementBrowserModal({
65
- tr
66
- });
67
- return tr;
68
- });
69
- } : undefined,
70
46
  getMoreOptionsButtonConfig: ({
71
47
  formatMessage
72
48
  }) => {
@@ -155,8 +131,8 @@ export const quickInsertPlugin = ({
155
131
  tr
156
132
  }) => {
157
133
  if (fg('platform_editor_ease_of_use_metrics')) {
158
- var _api$metrics2;
159
- api === null || api === void 0 ? void 0 : (_api$metrics2 = api.metrics) === null || _api$metrics2 === void 0 ? void 0 : _api$metrics2.commands.handleIntentToStartEdit({
134
+ var _api$metrics;
135
+ api === null || api === void 0 ? void 0 : (_api$metrics = api.metrics) === null || _api$metrics === void 0 ? void 0 : _api$metrics.commands.handleIntentToStartEdit({
160
136
  shouldStartTimer: false,
161
137
  shouldPersistActiveSession: true
162
138
  })({
@@ -47,31 +47,8 @@ export var quickInsertPlugin = function quickInsertPlugin(_ref) {
47
47
  }
48
48
  return result;
49
49
  },
50
- // @ts-ignore
51
- // This is used by typeahead plugin to trigger element browser modal without introducing circular dependency.
52
- // Given it's only temporarily needed to roll out toolbar&menus separate to quick insert/right rail change
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
55
- openElementBrowserModal: options !== null && options !== void 0 && options.enableElementBrowser ? function () {
56
- api === null || api === void 0 || api.core.actions.execute(function (_ref3) {
57
- var tr = _ref3.tr;
58
- if (fg('platform_editor_ease_of_use_metrics')) {
59
- var _api$metrics;
60
- api === null || api === void 0 || (_api$metrics = api.metrics) === null || _api$metrics === void 0 || _api$metrics.commands.handleIntentToStartEdit({
61
- shouldStartTimer: false,
62
- shouldPersistActiveSession: true
63
- })({
64
- tr: tr
65
- });
66
- }
67
- _openElementBrowserModal({
68
- tr: tr
69
- });
70
- return tr;
71
- });
72
- } : undefined,
73
- getMoreOptionsButtonConfig: function getMoreOptionsButtonConfig(_ref4) {
74
- var formatMessage = _ref4.formatMessage;
50
+ getMoreOptionsButtonConfig: function getMoreOptionsButtonConfig(_ref3) {
51
+ var formatMessage = _ref3.formatMessage;
75
52
  return {
76
53
  title: formatMessage(messages.viewMore),
77
54
  ariaLabel: formatMessage(messages.viewMoreAriaLabel),
@@ -89,10 +66,10 @@ export var quickInsertPlugin = function quickInsertPlugin(_ref) {
89
66
  return [{
90
67
  name: 'quickInsert',
91
68
  // It's important that this plugin is above TypeAheadPlugin
92
- plugin: function plugin(_ref5) {
93
- var providerFactory = _ref5.providerFactory,
94
- getIntl = _ref5.getIntl,
95
- dispatch = _ref5.dispatch;
69
+ plugin: function plugin(_ref4) {
70
+ var providerFactory = _ref4.providerFactory,
71
+ getIntl = _ref4.getIntl,
72
+ dispatch = _ref4.dispatch;
96
73
  return quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispatch, options === null || options === void 0 ? void 0 : options.emptyStateHandler);
97
74
  }
98
75
  }];
@@ -100,8 +77,8 @@ export var quickInsertPlugin = function quickInsertPlugin(_ref) {
100
77
  pluginsOptions: {
101
78
  typeAhead: typeAhead
102
79
  },
103
- contentComponent: function contentComponent(_ref6) {
104
- var editorView = _ref6.editorView;
80
+ contentComponent: function contentComponent(_ref5) {
81
+ var editorView = _ref5.editorView;
105
82
  if (options !== null && options !== void 0 && options.enableElementBrowser) {
106
83
  return /*#__PURE__*/React.createElement(ModalElementBrowser, {
107
84
  editorView: editorView,
@@ -139,9 +116,9 @@ export var quickInsertPlugin = function quickInsertPlugin(_ref) {
139
116
  },
140
117
  getSuggestions: function getSuggestions(searchOptions) {
141
118
  var _api$quickInsert$shar, _api$quickInsert;
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;
119
+ 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 : {},
120
+ lazyDefaultItems = _ref6.lazyDefaultItems,
121
+ providedItems = _ref6.providedItems;
145
122
  if (options !== null && options !== void 0 && options.prioritySortingFn) {
146
123
  searchOptions = _objectSpread(_objectSpread({}, searchOptions), {}, {
147
124
  prioritySortingFn: options.prioritySortingFn
@@ -151,11 +128,11 @@ export var quickInsertPlugin = function quickInsertPlugin(_ref) {
151
128
  }
152
129
  },
153
130
  commands: {
154
- openElementBrowserModal: function openElementBrowserModal(_ref8) {
155
- var tr = _ref8.tr;
131
+ openElementBrowserModal: function openElementBrowserModal(_ref7) {
132
+ var tr = _ref7.tr;
156
133
  if (fg('platform_editor_ease_of_use_metrics')) {
157
- var _api$metrics2;
158
- api === null || api === void 0 || (_api$metrics2 = api.metrics) === null || _api$metrics2 === void 0 || _api$metrics2.commands.handleIntentToStartEdit({
134
+ var _api$metrics;
135
+ api === null || api === void 0 || (_api$metrics = api.metrics) === null || _api$metrics === void 0 || _api$metrics.commands.handleIntentToStartEdit({
159
136
  shouldStartTimer: false,
160
137
  shouldPersistActiveSession: true
161
138
  })({
@@ -167,11 +144,11 @@ export var quickInsertPlugin = function quickInsertPlugin(_ref) {
167
144
  });
168
145
  },
169
146
  addQuickInsertItem: function addQuickInsertItem(item) {
170
- return function (_ref9) {
147
+ return function (_ref8) {
171
148
  var _api$quickInsert$shar2, _api$quickInsert2;
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;
149
+ var tr = _ref8.tr;
150
+ 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 : {},
151
+ lazyDefaultItems = _ref9.lazyDefaultItems;
175
152
  var defaultItems = lazyDefaultItems ? lazyDefaultItems() : [];
176
153
  var memoisedNewItems = memoProcessQuickInsertItems([item], intl);
177
154
  return tr.setMeta(pluginKey, {
@@ -229,7 +206,7 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
229
206
  },
230
207
  view: function view(editorView) {
231
208
  var providerHandler = /*#__PURE__*/function () {
232
- var _ref1 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_name, providerPromise) {
209
+ var _ref0 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_name, providerPromise) {
233
210
  var provider, providedItems;
234
211
  return _regeneratorRuntime.wrap(function _callee$(_context) {
235
212
  while (1) switch (_context.prev = _context.next) {
@@ -265,7 +242,7 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
265
242
  }, _callee, null, [[1, 11]]);
266
243
  }));
267
244
  return function providerHandler(_x, _x2) {
268
- return _ref1.apply(this, arguments);
245
+ return _ref0.apply(this, arguments);
269
246
  };
270
247
  }();
271
248
  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.6.3",
3
+ "version": "2.6.4",
4
4
  "description": "Quick insert plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -34,17 +34,17 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@atlaskit/button": "^23.2.0",
37
- "@atlaskit/editor-common": "^107.0.0",
37
+ "@atlaskit/editor-common": "^107.2.0",
38
38
  "@atlaskit/editor-plugin-connectivity": "^2.0.0",
39
39
  "@atlaskit/editor-plugin-metrics": "^3.5.0",
40
40
  "@atlaskit/editor-plugin-type-ahead": "^2.7.0",
41
41
  "@atlaskit/editor-prosemirror": "7.0.0",
42
- "@atlaskit/icon": "^27.0.0",
42
+ "@atlaskit/icon": "^27.2.0",
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": "^8.0.0",
47
- "@atlaskit/tokens": "^5.3.0",
46
+ "@atlaskit/tmp-editor-statsig": "^8.2.0",
47
+ "@atlaskit/tokens": "^5.4.0",
48
48
  "@babel/runtime": "^7.0.0",
49
49
  "@emotion/react": "^11.7.1"
50
50
  },