@atlaskit/editor-plugin-insert-block 2.6.2 → 2.7.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,24 @@
1
1
  # @atlaskit/editor-plugin-insert-block
2
2
 
3
+ ## 2.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#108974](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/108974)
8
+ [`2ed04755a098e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2ed04755a098e) -
9
+ ED-26233 Start activity session in metrics plugin when user starts dragging nodes and opens
10
+ element browser
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+
16
+ ## 2.6.3
17
+
18
+ ### Patch Changes
19
+
20
+ - Updated dependencies
21
+
3
22
  ## 2.6.2
4
23
 
5
24
  ### Patch Changes
@@ -129,12 +129,33 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
129
129
  });
130
130
  (0, _defineProperty2.default)(_this, "togglePlusMenuVisibility", function (event) {
131
131
  var isPlusMenuOpen = _this.state.isPlusMenuOpen;
132
+ var pluginInjectionApi = _this.props.pluginInjectionApi;
133
+ if (pluginInjectionApi && (0, _platformFeatureFlags.fg)('platform_editor_ease_of_use_metrics')) {
134
+ pluginInjectionApi.core.actions.execute(function (_ref2) {
135
+ var tr = _ref2.tr;
136
+ if (isPlusMenuOpen) {
137
+ var _pluginInjectionApi$m;
138
+ (_pluginInjectionApi$m = pluginInjectionApi.metrics) === null || _pluginInjectionApi$m === void 0 || _pluginInjectionApi$m.commands.startActiveSessionTimer()({
139
+ tr: tr
140
+ });
141
+ } else {
142
+ var _pluginInjectionApi$m2;
143
+ (_pluginInjectionApi$m2 = pluginInjectionApi.metrics) === null || _pluginInjectionApi$m2 === void 0 || _pluginInjectionApi$m2.commands.handleIntentToStartEdit({
144
+ shouldStartTimer: false,
145
+ shouldPersistActiveSession: true
146
+ })({
147
+ tr: tr
148
+ });
149
+ }
150
+ return tr;
151
+ });
152
+ }
132
153
  _this.onOpenChange({
133
154
  isPlusMenuOpen: !isPlusMenuOpen
134
155
  });
135
156
  if ((event === null || event === void 0 ? void 0 : event.key) === 'Escape') {
136
- var _ref2;
137
- (_ref2 = _this.plusButtonRef || _this.dropdownButtonRef) === null || _ref2 === void 0 || (_ref2 = _ref2.deref()) === null || _ref2 === void 0 || _ref2.focus();
157
+ var _ref3;
158
+ (_ref3 = _this.plusButtonRef || _this.dropdownButtonRef) === null || _ref3 === void 0 || (_ref3 = _ref3.deref()) === null || _ref3 === void 0 || _ref3.focus();
138
159
  }
139
160
  });
140
161
  (0, _defineProperty2.default)(_this, "toggleEmojiPicker", function () {
@@ -239,9 +260,9 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
239
260
  if (!pluginInjectionApi) {
240
261
  return;
241
262
  }
242
- pluginInjectionApi.core.actions.execute(function (_ref3) {
263
+ pluginInjectionApi.core.actions.execute(function (_ref4) {
243
264
  var _pluginInjectionApi$c, _pluginInjectionApi$a;
244
- var tr = _ref3.tr;
265
+ var tr = _ref4.tr;
245
266
  (0, _commands.toggleInsertMenuRightRail)(tr);
246
267
  (_pluginInjectionApi$c = pluginInjectionApi.contextPanel) === null || _pluginInjectionApi$c === void 0 || _pluginInjectionApi$c.actions.applyChange(tr);
247
268
  (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 || _pluginInjectionApi$a.actions.attachAnalyticsEvent({
@@ -269,9 +290,9 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
269
290
  exposure: true
270
291
  })) {
271
292
  var _this$props$pluginInj;
272
- (_this$props$pluginInj = _this.props.pluginInjectionApi) === null || _this$props$pluginInj === void 0 || _this$props$pluginInj.core.actions.execute(function (_ref4) {
293
+ (_this$props$pluginInj = _this.props.pluginInjectionApi) === null || _this$props$pluginInj === void 0 || _this$props$pluginInj.core.actions.execute(function (_ref5) {
273
294
  var _this$props$pluginInj2;
274
- var tr = _ref4.tr;
295
+ var tr = _ref5.tr;
275
296
  (0, _commands.toggleInsertMenuRightRail)(tr);
276
297
  (_this$props$pluginInj2 = _this.props.pluginInjectionApi) === null || _this$props$pluginInj2 === void 0 || (_this$props$pluginInj2 = _this$props$pluginInj2.contextPanel) === null || _this$props$pluginInj2 === void 0 || _this$props$pluginInj2.actions.applyChange(tr);
277
298
  return tr;
@@ -298,18 +319,18 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
298
319
  return (_pluginInjectionApi$c2 = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c3 = pluginInjectionApi.core) === null || _pluginInjectionApi$c3 === void 0 ? void 0 : _pluginInjectionApi$c3.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$h = pluginInjectionApi.hyperlink) === null || _pluginInjectionApi$h === void 0 ? void 0 : _pluginInjectionApi$h.commands.showLinkToolbar(inputMethod))) !== null && _pluginInjectionApi$c2 !== void 0 ? _pluginInjectionApi$c2 : false;
299
320
  });
300
321
  (0, _defineProperty2.default)(_this, "insertMention", function (inputMethod) {
301
- var _pluginInjectionApi$m, _pluginInjectionApi$m2;
322
+ var _pluginInjectionApi$m3, _pluginInjectionApi$m4;
302
323
  var _this$props = _this.props,
303
324
  editorView = _this$props.editorView,
304
325
  pluginInjectionApi = _this$props.pluginInjectionApi;
305
326
  if (!editorView) {
306
327
  return true;
307
328
  }
308
- var pluginState = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$m = pluginInjectionApi.mention) === null || _pluginInjectionApi$m === void 0 ? void 0 : _pluginInjectionApi$m.sharedState.currentState();
329
+ var pluginState = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$m3 = pluginInjectionApi.mention) === null || _pluginInjectionApi$m3 === void 0 ? void 0 : _pluginInjectionApi$m3.sharedState.currentState();
309
330
  if (pluginState && pluginState.canInsertMention === false) {
310
331
  return false;
311
332
  }
312
- return Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$m2 = pluginInjectionApi.mention) === null || _pluginInjectionApi$m2 === void 0 || (_pluginInjectionApi$m2 = _pluginInjectionApi$m2.actions) === null || _pluginInjectionApi$m2 === void 0 ? void 0 : _pluginInjectionApi$m2.openTypeAhead(inputMethod));
333
+ return Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$m4 = pluginInjectionApi.mention) === null || _pluginInjectionApi$m4 === void 0 || (_pluginInjectionApi$m4 = _pluginInjectionApi$m4.actions) === null || _pluginInjectionApi$m4 === void 0 ? void 0 : _pluginInjectionApi$m4.openTypeAhead(inputMethod));
313
334
  });
314
335
  (0, _defineProperty2.default)(_this, "insertTable", function (inputMethod) {
315
336
  var _this$props2 = _this.props,
@@ -455,9 +476,9 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
455
476
  var pluginInjectionApi = _this.props.pluginInjectionApi;
456
477
  pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c8 = pluginInjectionApi.core) === null || _pluginInjectionApi$c8 === void 0 || _pluginInjectionApi$c8.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$q = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q === void 0 ? void 0 : _pluginInjectionApi$q.commands.openElementBrowserModal);
457
478
  });
458
- (0, _defineProperty2.default)(_this, "onItemActivated", function (_ref5) {
459
- var item = _ref5.item,
460
- inputMethod = _ref5.inputMethod;
479
+ (0, _defineProperty2.default)(_this, "onItemActivated", function (_ref6) {
480
+ var item = _ref6.item,
481
+ inputMethod = _ref6.inputMethod;
461
482
  var _this$props10 = _this.props,
462
483
  editorView = _this$props10.editorView,
463
484
  handleImageUpload = _this$props10.handleImageUpload,
@@ -546,8 +567,8 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
546
567
  inputMethod: _analytics.INPUT_METHOD.TOOLBAR
547
568
  });
548
569
  });
549
- (0, _defineProperty2.default)(_this, "insertInsertMenuItem", function (_ref6) {
550
- var item = _ref6.item;
570
+ (0, _defineProperty2.default)(_this, "insertInsertMenuItem", function (_ref7) {
571
+ var item = _ref7.item;
551
572
  return _this.onItemActivated({
552
573
  item: item,
553
574
  inputMethod: _analytics.INPUT_METHOD.INSERT_MENU
@@ -599,8 +620,8 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
599
620
  popupsBoundariesElement = _this$props11.popupsBoundariesElement,
600
621
  popupsScrollableElement = _this$props11.popupsScrollableElement,
601
622
  emojiProvider = _this$props11.emojiProvider;
602
- var dropdownEmoji = this.state.dropdownItems.some(function (_ref7) {
603
- var name = _ref7.value.name;
623
+ var dropdownEmoji = this.state.dropdownItems.some(function (_ref8) {
624
+ var name = _ref8.value.name;
604
625
  return name === 'emoji';
605
626
  });
606
627
  var dropDownButtonRef = this.plusButtonRef;
@@ -699,12 +720,12 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
699
720
  isDisabled = _this$props13.isDisabled,
700
721
  isReducedSpacing = _this$props13.isReducedSpacing,
701
722
  editorAppearance = _this$props13.editorAppearance;
702
- var isTableButtonVisible = buttons.some(function (_ref8) {
703
- var value = _ref8.value;
723
+ var isTableButtonVisible = buttons.some(function (_ref9) {
724
+ var value = _ref9.value;
704
725
  return value.name === 'table';
705
726
  });
706
- var isTableSizeVisible = buttons.some(function (_ref9) {
707
- var value = _ref9.value;
727
+ var isTableSizeVisible = buttons.some(function (_ref10) {
728
+ var value = _ref10.value;
708
729
  return value.name === 'table selector';
709
730
  });
710
731
  if (buttons.length === 0 && dropdownItems.length === 0) {
@@ -137,6 +137,30 @@ export class ToolbarInsertBlock extends React.PureComponent {
137
137
  const {
138
138
  isPlusMenuOpen
139
139
  } = this.state;
140
+ const {
141
+ pluginInjectionApi
142
+ } = this.props;
143
+ if (pluginInjectionApi && fg('platform_editor_ease_of_use_metrics')) {
144
+ pluginInjectionApi.core.actions.execute(({
145
+ tr
146
+ }) => {
147
+ if (isPlusMenuOpen) {
148
+ var _pluginInjectionApi$m;
149
+ (_pluginInjectionApi$m = pluginInjectionApi.metrics) === null || _pluginInjectionApi$m === void 0 ? void 0 : _pluginInjectionApi$m.commands.startActiveSessionTimer()({
150
+ tr
151
+ });
152
+ } else {
153
+ var _pluginInjectionApi$m2;
154
+ (_pluginInjectionApi$m2 = pluginInjectionApi.metrics) === null || _pluginInjectionApi$m2 === void 0 ? void 0 : _pluginInjectionApi$m2.commands.handleIntentToStartEdit({
155
+ shouldStartTimer: false,
156
+ shouldPersistActiveSession: true
157
+ })({
158
+ tr
159
+ });
160
+ }
161
+ return tr;
162
+ });
163
+ }
140
164
  this.onOpenChange({
141
165
  isPlusMenuOpen: !isPlusMenuOpen
142
166
  });
@@ -307,7 +331,7 @@ export class ToolbarInsertBlock extends React.PureComponent {
307
331
  return (_pluginInjectionApi$c2 = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c3 = pluginInjectionApi.core) === null || _pluginInjectionApi$c3 === void 0 ? void 0 : _pluginInjectionApi$c3.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$h = pluginInjectionApi.hyperlink) === null || _pluginInjectionApi$h === void 0 ? void 0 : _pluginInjectionApi$h.commands.showLinkToolbar(inputMethod))) !== null && _pluginInjectionApi$c2 !== void 0 ? _pluginInjectionApi$c2 : false;
308
332
  });
309
333
  _defineProperty(this, "insertMention", inputMethod => {
310
- var _pluginInjectionApi$m, _pluginInjectionApi$m2, _pluginInjectionApi$m3;
334
+ var _pluginInjectionApi$m3, _pluginInjectionApi$m4, _pluginInjectionApi$m5;
311
335
  const {
312
336
  editorView,
313
337
  pluginInjectionApi
@@ -315,11 +339,11 @@ export class ToolbarInsertBlock extends React.PureComponent {
315
339
  if (!editorView) {
316
340
  return true;
317
341
  }
318
- const pluginState = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$m = pluginInjectionApi.mention) === null || _pluginInjectionApi$m === void 0 ? void 0 : _pluginInjectionApi$m.sharedState.currentState();
342
+ const pluginState = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$m3 = pluginInjectionApi.mention) === null || _pluginInjectionApi$m3 === void 0 ? void 0 : _pluginInjectionApi$m3.sharedState.currentState();
319
343
  if (pluginState && pluginState.canInsertMention === false) {
320
344
  return false;
321
345
  }
322
- return Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$m2 = pluginInjectionApi.mention) === null || _pluginInjectionApi$m2 === void 0 ? void 0 : (_pluginInjectionApi$m3 = _pluginInjectionApi$m2.actions) === null || _pluginInjectionApi$m3 === void 0 ? void 0 : _pluginInjectionApi$m3.openTypeAhead(inputMethod));
346
+ return Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$m4 = pluginInjectionApi.mention) === null || _pluginInjectionApi$m4 === void 0 ? void 0 : (_pluginInjectionApi$m5 = _pluginInjectionApi$m4.actions) === null || _pluginInjectionApi$m5 === void 0 ? void 0 : _pluginInjectionApi$m5.openTypeAhead(inputMethod));
323
347
  });
324
348
  _defineProperty(this, "insertTable", inputMethod => {
325
349
  const {
@@ -123,12 +123,33 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
123
123
  });
124
124
  _defineProperty(_this, "togglePlusMenuVisibility", function (event) {
125
125
  var isPlusMenuOpen = _this.state.isPlusMenuOpen;
126
+ var pluginInjectionApi = _this.props.pluginInjectionApi;
127
+ if (pluginInjectionApi && fg('platform_editor_ease_of_use_metrics')) {
128
+ pluginInjectionApi.core.actions.execute(function (_ref2) {
129
+ var tr = _ref2.tr;
130
+ if (isPlusMenuOpen) {
131
+ var _pluginInjectionApi$m;
132
+ (_pluginInjectionApi$m = pluginInjectionApi.metrics) === null || _pluginInjectionApi$m === void 0 || _pluginInjectionApi$m.commands.startActiveSessionTimer()({
133
+ tr: tr
134
+ });
135
+ } else {
136
+ var _pluginInjectionApi$m2;
137
+ (_pluginInjectionApi$m2 = pluginInjectionApi.metrics) === null || _pluginInjectionApi$m2 === void 0 || _pluginInjectionApi$m2.commands.handleIntentToStartEdit({
138
+ shouldStartTimer: false,
139
+ shouldPersistActiveSession: true
140
+ })({
141
+ tr: tr
142
+ });
143
+ }
144
+ return tr;
145
+ });
146
+ }
126
147
  _this.onOpenChange({
127
148
  isPlusMenuOpen: !isPlusMenuOpen
128
149
  });
129
150
  if ((event === null || event === void 0 ? void 0 : event.key) === 'Escape') {
130
- var _ref2;
131
- (_ref2 = _this.plusButtonRef || _this.dropdownButtonRef) === null || _ref2 === void 0 || (_ref2 = _ref2.deref()) === null || _ref2 === void 0 || _ref2.focus();
151
+ var _ref3;
152
+ (_ref3 = _this.plusButtonRef || _this.dropdownButtonRef) === null || _ref3 === void 0 || (_ref3 = _ref3.deref()) === null || _ref3 === void 0 || _ref3.focus();
132
153
  }
133
154
  });
134
155
  _defineProperty(_this, "toggleEmojiPicker", function () {
@@ -233,9 +254,9 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
233
254
  if (!pluginInjectionApi) {
234
255
  return;
235
256
  }
236
- pluginInjectionApi.core.actions.execute(function (_ref3) {
257
+ pluginInjectionApi.core.actions.execute(function (_ref4) {
237
258
  var _pluginInjectionApi$c, _pluginInjectionApi$a;
238
- var tr = _ref3.tr;
259
+ var tr = _ref4.tr;
239
260
  toggleInsertMenuRightRail(tr);
240
261
  (_pluginInjectionApi$c = pluginInjectionApi.contextPanel) === null || _pluginInjectionApi$c === void 0 || _pluginInjectionApi$c.actions.applyChange(tr);
241
262
  (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 || _pluginInjectionApi$a.actions.attachAnalyticsEvent({
@@ -263,9 +284,9 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
263
284
  exposure: true
264
285
  })) {
265
286
  var _this$props$pluginInj;
266
- (_this$props$pluginInj = _this.props.pluginInjectionApi) === null || _this$props$pluginInj === void 0 || _this$props$pluginInj.core.actions.execute(function (_ref4) {
287
+ (_this$props$pluginInj = _this.props.pluginInjectionApi) === null || _this$props$pluginInj === void 0 || _this$props$pluginInj.core.actions.execute(function (_ref5) {
267
288
  var _this$props$pluginInj2;
268
- var tr = _ref4.tr;
289
+ var tr = _ref5.tr;
269
290
  toggleInsertMenuRightRail(tr);
270
291
  (_this$props$pluginInj2 = _this.props.pluginInjectionApi) === null || _this$props$pluginInj2 === void 0 || (_this$props$pluginInj2 = _this$props$pluginInj2.contextPanel) === null || _this$props$pluginInj2 === void 0 || _this$props$pluginInj2.actions.applyChange(tr);
271
292
  return tr;
@@ -292,18 +313,18 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
292
313
  return (_pluginInjectionApi$c2 = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c3 = pluginInjectionApi.core) === null || _pluginInjectionApi$c3 === void 0 ? void 0 : _pluginInjectionApi$c3.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$h = pluginInjectionApi.hyperlink) === null || _pluginInjectionApi$h === void 0 ? void 0 : _pluginInjectionApi$h.commands.showLinkToolbar(inputMethod))) !== null && _pluginInjectionApi$c2 !== void 0 ? _pluginInjectionApi$c2 : false;
293
314
  });
294
315
  _defineProperty(_this, "insertMention", function (inputMethod) {
295
- var _pluginInjectionApi$m, _pluginInjectionApi$m2;
316
+ var _pluginInjectionApi$m3, _pluginInjectionApi$m4;
296
317
  var _this$props = _this.props,
297
318
  editorView = _this$props.editorView,
298
319
  pluginInjectionApi = _this$props.pluginInjectionApi;
299
320
  if (!editorView) {
300
321
  return true;
301
322
  }
302
- var pluginState = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$m = pluginInjectionApi.mention) === null || _pluginInjectionApi$m === void 0 ? void 0 : _pluginInjectionApi$m.sharedState.currentState();
323
+ var pluginState = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$m3 = pluginInjectionApi.mention) === null || _pluginInjectionApi$m3 === void 0 ? void 0 : _pluginInjectionApi$m3.sharedState.currentState();
303
324
  if (pluginState && pluginState.canInsertMention === false) {
304
325
  return false;
305
326
  }
306
- return Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$m2 = pluginInjectionApi.mention) === null || _pluginInjectionApi$m2 === void 0 || (_pluginInjectionApi$m2 = _pluginInjectionApi$m2.actions) === null || _pluginInjectionApi$m2 === void 0 ? void 0 : _pluginInjectionApi$m2.openTypeAhead(inputMethod));
327
+ return Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$m4 = pluginInjectionApi.mention) === null || _pluginInjectionApi$m4 === void 0 || (_pluginInjectionApi$m4 = _pluginInjectionApi$m4.actions) === null || _pluginInjectionApi$m4 === void 0 ? void 0 : _pluginInjectionApi$m4.openTypeAhead(inputMethod));
307
328
  });
308
329
  _defineProperty(_this, "insertTable", function (inputMethod) {
309
330
  var _this$props2 = _this.props,
@@ -449,9 +470,9 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
449
470
  var pluginInjectionApi = _this.props.pluginInjectionApi;
450
471
  pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c8 = pluginInjectionApi.core) === null || _pluginInjectionApi$c8 === void 0 || _pluginInjectionApi$c8.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$q = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q === void 0 ? void 0 : _pluginInjectionApi$q.commands.openElementBrowserModal);
451
472
  });
452
- _defineProperty(_this, "onItemActivated", function (_ref5) {
453
- var item = _ref5.item,
454
- inputMethod = _ref5.inputMethod;
473
+ _defineProperty(_this, "onItemActivated", function (_ref6) {
474
+ var item = _ref6.item,
475
+ inputMethod = _ref6.inputMethod;
455
476
  var _this$props10 = _this.props,
456
477
  editorView = _this$props10.editorView,
457
478
  handleImageUpload = _this$props10.handleImageUpload,
@@ -540,8 +561,8 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
540
561
  inputMethod: INPUT_METHOD.TOOLBAR
541
562
  });
542
563
  });
543
- _defineProperty(_this, "insertInsertMenuItem", function (_ref6) {
544
- var item = _ref6.item;
564
+ _defineProperty(_this, "insertInsertMenuItem", function (_ref7) {
565
+ var item = _ref7.item;
545
566
  return _this.onItemActivated({
546
567
  item: item,
547
568
  inputMethod: INPUT_METHOD.INSERT_MENU
@@ -593,8 +614,8 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
593
614
  popupsBoundariesElement = _this$props11.popupsBoundariesElement,
594
615
  popupsScrollableElement = _this$props11.popupsScrollableElement,
595
616
  emojiProvider = _this$props11.emojiProvider;
596
- var dropdownEmoji = this.state.dropdownItems.some(function (_ref7) {
597
- var name = _ref7.value.name;
617
+ var dropdownEmoji = this.state.dropdownItems.some(function (_ref8) {
618
+ var name = _ref8.value.name;
598
619
  return name === 'emoji';
599
620
  });
600
621
  var dropDownButtonRef = this.plusButtonRef;
@@ -693,12 +714,12 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
693
714
  isDisabled = _this$props13.isDisabled,
694
715
  isReducedSpacing = _this$props13.isReducedSpacing,
695
716
  editorAppearance = _this$props13.editorAppearance;
696
- var isTableButtonVisible = buttons.some(function (_ref8) {
697
- var value = _ref8.value;
717
+ var isTableButtonVisible = buttons.some(function (_ref9) {
718
+ var value = _ref9.value;
698
719
  return value.name === 'table';
699
720
  });
700
- var isTableSizeVisible = buttons.some(function (_ref9) {
701
- var value = _ref9.value;
721
+ var isTableSizeVisible = buttons.some(function (_ref10) {
722
+ var value = _ref10.value;
702
723
  return value.name === 'table selector';
703
724
  });
704
725
  if (buttons.length === 0 && dropdownItems.length === 0) {
@@ -15,6 +15,7 @@ import type { LayoutPlugin } from '@atlaskit/editor-plugin-layout';
15
15
  import type { MediaPlugin } from '@atlaskit/editor-plugin-media';
16
16
  import type { MediaInsertPlugin } from '@atlaskit/editor-plugin-media-insert';
17
17
  import type { MentionsPlugin } from '@atlaskit/editor-plugin-mentions';
18
+ import type { MetricsPlugin } from '@atlaskit/editor-plugin-metrics';
18
19
  import type { PanelPlugin } from '@atlaskit/editor-plugin-panel';
19
20
  import type { PlaceholderTextPlugin } from '@atlaskit/editor-plugin-placeholder-text';
20
21
  import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
@@ -40,6 +41,7 @@ export type InsertBlockPluginDependencies = [
40
41
  OptionalPlugin<MediaPlugin>,
41
42
  OptionalPlugin<MediaInsertPlugin>,
42
43
  OptionalPlugin<MentionsPlugin>,
44
+ OptionalPlugin<MetricsPlugin>,
43
45
  OptionalPlugin<StatusPlugin>,
44
46
  OptionalPlugin<LayoutPlugin>,
45
47
  OptionalPlugin<ExpandPlugin>,
@@ -15,6 +15,7 @@ import type { LayoutPlugin } from '@atlaskit/editor-plugin-layout';
15
15
  import type { MediaPlugin } from '@atlaskit/editor-plugin-media';
16
16
  import type { MediaInsertPlugin } from '@atlaskit/editor-plugin-media-insert';
17
17
  import type { MentionsPlugin } from '@atlaskit/editor-plugin-mentions';
18
+ import type { MetricsPlugin } from '@atlaskit/editor-plugin-metrics';
18
19
  import type { PanelPlugin } from '@atlaskit/editor-plugin-panel';
19
20
  import type { PlaceholderTextPlugin } from '@atlaskit/editor-plugin-placeholder-text';
20
21
  import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
@@ -40,6 +41,7 @@ export type InsertBlockPluginDependencies = [
40
41
  OptionalPlugin<MediaPlugin>,
41
42
  OptionalPlugin<MediaInsertPlugin>,
42
43
  OptionalPlugin<MentionsPlugin>,
44
+ OptionalPlugin<MetricsPlugin>,
43
45
  OptionalPlugin<StatusPlugin>,
44
46
  OptionalPlugin<LayoutPlugin>,
45
47
  OptionalPlugin<ExpandPlugin>,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-insert-block",
3
- "version": "2.6.2",
3
+ "version": "2.7.0",
4
4
  "description": "Insert block plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@atlaskit/button": "^20.5.0",
35
- "@atlaskit/editor-common": "^99.16.0",
35
+ "@atlaskit/editor-common": "^99.17.0",
36
36
  "@atlaskit/editor-plugin-analytics": "^1.12.0",
37
37
  "@atlaskit/editor-plugin-block-type": "^4.3.0",
38
38
  "@atlaskit/editor-plugin-code-block": "^3.7.0",
@@ -48,6 +48,7 @@
48
48
  "@atlaskit/editor-plugin-media": "^1.45.0",
49
49
  "@atlaskit/editor-plugin-media-insert": "^5.1.0",
50
50
  "@atlaskit/editor-plugin-mentions": "^2.15.0",
51
+ "@atlaskit/editor-plugin-metrics": "^3.2.0",
51
52
  "@atlaskit/editor-plugin-panel": "^3.3.0",
52
53
  "@atlaskit/editor-plugin-placeholder-text": "^1.11.0",
53
54
  "@atlaskit/editor-plugin-primary-toolbar": "^2.2.0",
@@ -58,17 +59,17 @@
58
59
  "@atlaskit/editor-plugin-tasks-and-decisions": "^2.14.0",
59
60
  "@atlaskit/editor-plugin-type-ahead": "^1.13.0",
60
61
  "@atlaskit/editor-prosemirror": "7.0.0",
61
- "@atlaskit/editor-shared-styles": "^3.2.0",
62
+ "@atlaskit/editor-shared-styles": "^3.3.0",
62
63
  "@atlaskit/emoji": "^67.14.0",
63
64
  "@atlaskit/heading": "4.1.0",
64
65
  "@atlaskit/icon": "^23.9.0",
65
66
  "@atlaskit/icon-lab": "^2.6.0",
66
- "@atlaskit/platform-feature-flags": "^1.0.0",
67
+ "@atlaskit/platform-feature-flags": "^1.1.0",
67
68
  "@atlaskit/primitives": "^13.5.0",
68
- "@atlaskit/theme": "^15.0.0",
69
+ "@atlaskit/theme": "^16.0.0",
69
70
  "@atlaskit/tmp-editor-statsig": "^2.46.0",
70
71
  "@atlaskit/tokens": "^3.3.0",
71
- "@atlaskit/tooltip": "19.1.3",
72
+ "@atlaskit/tooltip": "19.1.4",
72
73
  "@babel/runtime": "^7.0.0",
73
74
  "@emotion/react": "^11.7.1",
74
75
  "bind-event-listener": "^3.0.0",
@@ -132,6 +133,9 @@
132
133
  },
133
134
  "platform_editor_reduce_element_browser_padding": {
134
135
  "type": "boolean"
136
+ },
137
+ "platform_editor_ease_of_use_metrics": {
138
+ "type": "boolean"
135
139
  }
136
140
  }
137
141
  }