@atlaskit/editor-plugin-table 13.0.6 → 13.0.8

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-table
2
2
 
3
+ ## 13.0.8
4
+
5
+ ### Patch Changes
6
+
7
+ - [`a8630c1107c3d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a8630c1107c3d) -
8
+ [ED-28781] Hide inline text toolbar when other popups are open
9
+ - Updated dependencies
10
+
11
+ ## 13.0.7
12
+
13
+ ### Patch Changes
14
+
15
+ - [`5be5ab89fb72d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5be5ab89fb72d) -
16
+ Add tableDragAndDrop insm feature tracking
17
+ - [`790dacebab86f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/790dacebab86f) -
18
+ fix table resize issue when table scailing experiment is on
19
+ - Updated dependencies
20
+
3
21
  ## 13.0.6
4
22
 
5
23
  ### Patch Changes
@@ -461,6 +461,10 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
461
461
  }
462
462
  }
463
463
  });
464
+ if ((0, _expValEquals.expValEquals)('platform_editor_tables_scaling_css', 'isEnabled', true)) {
465
+ // eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
466
+ window.addEventListener('resize', this.handleWindowResizeNewDebounced);
467
+ }
464
468
  }
465
469
  }
466
470
  }, {
@@ -551,8 +555,6 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
551
555
  // eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
552
556
  window.addEventListener('resize', this.handleWindowResizeDebounced);
553
557
  }
554
- // eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
555
- window.addEventListener('resize', this.handleWindowResizeNewDebounced);
556
558
  this.handleTableResizingDebounced();
557
559
  }
558
560
  var currentStickyState = _pluginKey.pluginKey.getState(this.props.view.state);
@@ -606,7 +608,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
606
608
  // eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
607
609
  window.removeEventListener('resize', this.handleWindowResizeDebounced);
608
610
  }
609
- if (allowColumnResizing) {
611
+ if ((0, _expValEquals.expValEquals)('platform_editor_tables_scaling_css', 'isEnabled', true)) {
610
612
  // eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
611
613
  window.removeEventListener('resize', this.handleWindowResizeNewDebounced);
612
614
  }
@@ -26,6 +26,7 @@ var _utils = require("@atlaskit/editor-tables/utils");
26
26
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
27
27
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
28
28
  var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
29
+ var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
29
30
  var _commandsWithAnalytics = require("../pm-plugins/commands/commands-with-analytics");
30
31
  var _misc = require("../pm-plugins/commands/misc");
31
32
  var _tableAnalytics = require("../pm-plugins/table-analytics");
@@ -258,7 +259,7 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
258
259
  tr.setMeta(_tableAnalytics.META_KEYS.OVERFLOW_TRIGGER, {
259
260
  name: _analytics.TABLE_OVERFLOW_CHANGE_TRIGGER.RESIZED
260
261
  });
261
- if ((0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true)) {
262
+ if ((0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true) || (0, _experiments.editorExperiment)('platform_editor_toolbar_aifc', true) && (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_2', 'isEnabled', true)) {
262
263
  var _pluginInjectionApi$u;
263
264
  pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$u = pluginInjectionApi.userIntent) === null || _pluginInjectionApi$u === void 0 || _pluginInjectionApi$u.commands.setCurrentUserIntent('resizing')({
264
265
  tr: tr
@@ -335,7 +336,7 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
335
336
  tableRef: null
336
337
  });
337
338
  tr.setMeta('is-resizer-resizing', false);
338
- if ((0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true)) {
339
+ if ((0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true) || (0, _experiments.editorExperiment)('platform_editor_toolbar_aifc', true) && (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_2', 'isEnabled', true)) {
339
340
  var _pluginInjectionApi$u2;
340
341
  pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$u2 = pluginInjectionApi.userIntent) === null || _pluginInjectionApi$u2 === void 0 || _pluginInjectionApi$u2.commands.setCurrentUserIntent('default')({
341
342
  tr: tr
@@ -9,9 +9,11 @@ var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
9
9
  var _view = require("@atlaskit/editor-prosemirror/view");
10
10
  var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
11
11
  var _utils = require("@atlaskit/editor-tables/utils");
12
+ var _insm = require("@atlaskit/insm");
12
13
  var _element = require("@atlaskit/pragmatic-drag-and-drop-auto-scroll/element");
13
14
  var _combine = require("@atlaskit/pragmatic-drag-and-drop/combine");
14
15
  var _adapter = require("@atlaskit/pragmatic-drag-and-drop/element/adapter");
16
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
15
17
  var _pluginFactory = require("../plugin-factory");
16
18
  var _pluginKey = require("../plugin-key");
17
19
  var _colgroup = require("../table-resizing/utils/colgroup");
@@ -34,12 +36,20 @@ var destroyFn = function destroyFn(editorView, editorAnalyticsAPI, isTableScalin
34
36
  return type === 'table-row';
35
37
  },
36
38
  onDragStart: function onDragStart() {
39
+ if ((0, _expValEquals.expValEquals)('cc_editor_interactivity_monitoring', 'isEnabled', true)) {
40
+ var _insm$session;
41
+ (_insm$session = _insm.insm.session) === null || _insm$session === void 0 || _insm$session.startFeature('tableDragAndDrop');
42
+ }
37
43
  // auto scroller doesn't work when scroll-behavior: smooth is set, this monitor temporarily removes it via inline styles
38
44
  // Ignored via go/ees005
39
45
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
40
46
  editorPageScrollContainer.style.setProperty('scroll-behavior', 'unset');
41
47
  },
42
48
  onDrop: function onDrop() {
49
+ if ((0, _expValEquals.expValEquals)('cc_editor_interactivity_monitoring', 'isEnabled', true)) {
50
+ var _insm$session2;
51
+ (_insm$session2 = _insm.insm.session) === null || _insm$session2 === void 0 || _insm$session2.endFeature('tableDragAndDrop');
52
+ }
43
53
  // 'null' will remove the inline style
44
54
  // Ignored via go/ees005
45
55
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
@@ -76,6 +86,10 @@ var destroyFn = function destroyFn(editorView, editorAnalyticsAPI, isTableScalin
76
86
  },
77
87
  onDragStart: function onDragStart(_ref7) {
78
88
  var location = _ref7.location;
89
+ if ((0, _expValEquals.expValEquals)('cc_editor_interactivity_monitoring', 'isEnabled', true)) {
90
+ var _insm$session3;
91
+ (_insm$session3 = _insm.insm.session) === null || _insm$session3 === void 0 || _insm$session3.startFeature('tableDragAndDrop');
92
+ }
79
93
  (0, _commands.toggleDragMenu)(false)(editorView.state, editorView.dispatch);
80
94
  },
81
95
  onDrag: function onDrag(event) {
@@ -124,6 +138,10 @@ var destroyFn = function destroyFn(editorView, editorAnalyticsAPI, isTableScalin
124
138
  var _event$source, _event$source2;
125
139
  // If we're able to determine the source type of the dropped element then we should report to analytics that
126
140
  // the drop event was cancelled. Otherwise we will cancel silently.
141
+ if ((0, _expValEquals.expValEquals)('cc_editor_interactivity_monitoring', 'isEnabled', true)) {
142
+ var _insm$session4;
143
+ (_insm$session4 = _insm.insm.session) === null || _insm$session4 === void 0 || _insm$session4.endFeature('tableDragAndDrop');
144
+ }
127
145
  if ((event === null || event === void 0 || (_event$source = event.source) === null || _event$source === void 0 || (_event$source = _event$source.data) === null || _event$source === void 0 ? void 0 : _event$source.type) === 'table-row' || (event === null || event === void 0 || (_event$source2 = event.source) === null || _event$source2 === void 0 || (_event$source2 = _event$source2.data) === null || _event$source2 === void 0 ? void 0 : _event$source2.type) === 'table-column') {
128
146
  var _event$source$data;
129
147
  return (0, _commandsWithAnalytics.clearDropTargetWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.DRAG_AND_DROP, event.source.data.type, (_event$source$data = event.source.data) === null || _event$source$data === void 0 ? void 0 : _event$source$data.indexes, _analytics.TABLE_STATUS.CANCELLED, tr)(editorView.state, editorView.dispatch);
@@ -150,6 +168,10 @@ var destroyFn = function destroyFn(editorView, editorAnalyticsAPI, isTableScalin
150
168
  (0, _commandsWithAnalytics.clearDropTargetWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.DRAG_AND_DROP, sourceType, sourceIndexes,
151
169
  // This event is mrked as invalid because the user is attempting to drop an element in an area which has merged cells.
152
170
  _analytics.TABLE_STATUS.INVALID, tr)(editorView.state, editorView.dispatch);
171
+ if ((0, _expValEquals.expValEquals)('cc_editor_interactivity_monitoring', 'isEnabled', true)) {
172
+ var _insm$session5;
173
+ (_insm$session5 = _insm.insm.session) === null || _insm$session5 === void 0 || _insm$session5.endFeature('tableDragAndDrop');
174
+ }
153
175
  return;
154
176
  }
155
177
  requestAnimationFrame(function () {
@@ -179,6 +201,10 @@ var destroyFn = function destroyFn(editorView, editorAnalyticsAPI, isTableScalin
179
201
  }
180
202
  }
181
203
  editorView.focus();
204
+ if ((0, _expValEquals.expValEquals)('cc_editor_interactivity_monitoring', 'isEnabled', true)) {
205
+ var _insm$session6;
206
+ (_insm$session6 = _insm.insm.session) === null || _insm$session6 === void 0 || _insm$session6.endFeature('tableDragAndDrop');
207
+ }
182
208
  });
183
209
  }
184
210
  })]));
@@ -16,6 +16,7 @@ var _messages = require("@atlaskit/editor-common/messages");
16
16
  var _styles = require("@atlaskit/editor-common/styles");
17
17
  var _uiColor = require("@atlaskit/editor-common/ui-color");
18
18
  var _uiMenu = require("@atlaskit/editor-common/ui-menu");
19
+ var _userIntent = require("@atlaskit/editor-common/user-intent");
19
20
  var _utils = require("@atlaskit/editor-common/utils");
20
21
  var _editorPalette = require("@atlaskit/editor-palette");
21
22
  var _shortcut = require("@atlaskit/editor-shared-styles/shortcut");
@@ -24,6 +25,7 @@ var _utils2 = require("@atlaskit/editor-tables/utils");
24
25
  var _paintBucketEditorBackgroundColor = _interopRequireDefault(require("@atlaskit/icon/core/migration/paint-bucket--editor-background-color"));
25
26
  var _primitives = require("@atlaskit/primitives");
26
27
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
28
+ var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
27
29
  var _toggle = _interopRequireDefault(require("@atlaskit/toggle"));
28
30
  var _commands = require("../../pm-plugins/commands");
29
31
  var _commandsWithAnalytics = require("../../pm-plugins/commands/commands-with-analytics");
@@ -508,7 +510,7 @@ var DragMenu = /*#__PURE__*/_react.default.memo(function (_ref) {
508
510
  items: [createRowNumbersMenuItem()]
509
511
  });
510
512
  }
511
- return (0, _react2.jsx)(_DropdownMenu.DropdownMenu, {
513
+ var Menu = (0, _react2.jsx)(_DropdownMenu.DropdownMenu, {
512
514
  disableKeyboardHandling: isSubmenuOpen,
513
515
  section: {
514
516
  hasSeparator: true
@@ -524,5 +526,8 @@ var DragMenu = /*#__PURE__*/_react.default.memo(function (_ref) {
524
526
  boundariesElement: boundariesElement,
525
527
  scrollableElement: scrollableElement
526
528
  });
529
+ return (0, _experiments.editorExperiment)('platform_editor_toolbar_aifc', true) && (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_2', 'isEnabled', true) ? (0, _react2.jsx)(_userIntent.UserIntentPopupWrapper, {
530
+ api: api
531
+ }, Menu) : Menu;
527
532
  });
528
533
  var _default = exports.default = (0, _reactIntlNext.injectIntl)(DragMenu);
@@ -448,6 +448,10 @@ class TableComponent extends React.Component {
448
448
  }
449
449
  }
450
450
  });
451
+ if (expValEquals('platform_editor_tables_scaling_css', 'isEnabled', true)) {
452
+ // eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
453
+ window.addEventListener('resize', this.handleWindowResizeNewDebounced);
454
+ }
451
455
  }
452
456
  }
453
457
  initialiseEventListenersAfterMount() {
@@ -525,8 +529,6 @@ class TableComponent extends React.Component {
525
529
  // eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
526
530
  window.addEventListener('resize', this.handleWindowResizeDebounced);
527
531
  }
528
- // eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
529
- window.addEventListener('resize', this.handleWindowResizeNewDebounced);
530
532
  this.handleTableResizingDebounced();
531
533
  }
532
534
  const currentStickyState = stickyHeadersPluginKey.getState(this.props.view.state);
@@ -579,7 +581,7 @@ class TableComponent extends React.Component {
579
581
  // eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
580
582
  window.removeEventListener('resize', this.handleWindowResizeDebounced);
581
583
  }
582
- if (allowColumnResizing) {
584
+ if (expValEquals('platform_editor_tables_scaling_css', 'isEnabled', true)) {
583
585
  // eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
584
586
  window.removeEventListener('resize', this.handleWindowResizeNewDebounced);
585
587
  }
@@ -16,6 +16,7 @@ import { findTable } from '@atlaskit/editor-tables/utils';
16
16
  import { fg } from '@atlaskit/platform-feature-flags';
17
17
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
18
18
  import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
19
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
19
20
  import { setTableAlignmentWithTableContentWithPosWithAnalytics } from '../pm-plugins/commands/commands-with-analytics';
20
21
  import { updateWidthToWidest } from '../pm-plugins/commands/misc';
21
22
  import { META_KEYS } from '../pm-plugins/table-analytics';
@@ -251,7 +252,7 @@ export const TableResizer = ({
251
252
  tr.setMeta(META_KEYS.OVERFLOW_TRIGGER, {
252
253
  name: TABLE_OVERFLOW_CHANGE_TRIGGER.RESIZED
253
254
  });
254
- if (expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
255
+ if (expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) || editorExperiment('platform_editor_toolbar_aifc', true) && expValEquals('platform_editor_toolbar_aifc_patch_2', 'isEnabled', true)) {
255
256
  var _pluginInjectionApi$u;
256
257
  pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$u = pluginInjectionApi.userIntent) === null || _pluginInjectionApi$u === void 0 ? void 0 : _pluginInjectionApi$u.commands.setCurrentUserIntent('resizing')({
257
258
  tr
@@ -330,7 +331,7 @@ export const TableResizer = ({
330
331
  tableRef: null
331
332
  });
332
333
  tr.setMeta('is-resizer-resizing', false);
333
- if (expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
334
+ if (expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) || editorExperiment('platform_editor_toolbar_aifc', true) && expValEquals('platform_editor_toolbar_aifc_patch_2', 'isEnabled', true)) {
334
335
  var _pluginInjectionApi$u2;
335
336
  pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$u2 = pluginInjectionApi.userIntent) === null || _pluginInjectionApi$u2 === void 0 ? void 0 : _pluginInjectionApi$u2.commands.setCurrentUserIntent('default')({
336
337
  tr
@@ -3,9 +3,11 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
3
  import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
4
4
  import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
5
5
  import { getCellsInRow, getSelectedCellInfo } from '@atlaskit/editor-tables/utils';
6
+ import { insm } from '@atlaskit/insm';
6
7
  import { autoScrollForElements } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/element';
7
8
  import { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';
8
9
  import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
10
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
9
11
  import { getPluginState as getTablePluginState } from '../plugin-factory';
10
12
  import { pluginKey as tablePluginKey } from '../plugin-key';
11
13
  import { insertColgroupFromNode } from '../table-resizing/utils/colgroup';
@@ -30,12 +32,20 @@ const destroyFn = (editorView, editorAnalyticsAPI, isTableScalingEnabled, isTabl
30
32
  return type === 'table-row';
31
33
  },
32
34
  onDragStart() {
35
+ if (expValEquals('cc_editor_interactivity_monitoring', 'isEnabled', true)) {
36
+ var _insm$session;
37
+ (_insm$session = insm.session) === null || _insm$session === void 0 ? void 0 : _insm$session.startFeature('tableDragAndDrop');
38
+ }
33
39
  // auto scroller doesn't work when scroll-behavior: smooth is set, this monitor temporarily removes it via inline styles
34
40
  // Ignored via go/ees005
35
41
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
36
42
  editorPageScrollContainer.style.setProperty('scroll-behavior', 'unset');
37
43
  },
38
44
  onDrop() {
45
+ if (expValEquals('cc_editor_interactivity_monitoring', 'isEnabled', true)) {
46
+ var _insm$session2;
47
+ (_insm$session2 = insm.session) === null || _insm$session2 === void 0 ? void 0 : _insm$session2.endFeature('tableDragAndDrop');
48
+ }
39
49
  // 'null' will remove the inline style
40
50
  // Ignored via go/ees005
41
51
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
@@ -78,6 +88,10 @@ const destroyFn = (editorView, editorAnalyticsAPI, isTableScalingEnabled, isTabl
78
88
  onDragStart: ({
79
89
  location
80
90
  }) => {
91
+ if (expValEquals('cc_editor_interactivity_monitoring', 'isEnabled', true)) {
92
+ var _insm$session3;
93
+ (_insm$session3 = insm.session) === null || _insm$session3 === void 0 ? void 0 : _insm$session3.startFeature('tableDragAndDrop');
94
+ }
81
95
  toggleDragMenu(false)(editorView.state, editorView.dispatch);
82
96
  },
83
97
  onDrag(event) {
@@ -129,6 +143,10 @@ const destroyFn = (editorView, editorAnalyticsAPI, isTableScalingEnabled, isTabl
129
143
  var _event$source, _event$source$data, _event$source2, _event$source2$data;
130
144
  // If we're able to determine the source type of the dropped element then we should report to analytics that
131
145
  // the drop event was cancelled. Otherwise we will cancel silently.
146
+ if (expValEquals('cc_editor_interactivity_monitoring', 'isEnabled', true)) {
147
+ var _insm$session4;
148
+ (_insm$session4 = insm.session) === null || _insm$session4 === void 0 ? void 0 : _insm$session4.endFeature('tableDragAndDrop');
149
+ }
132
150
  if ((event === null || event === void 0 ? void 0 : (_event$source = event.source) === null || _event$source === void 0 ? void 0 : (_event$source$data = _event$source.data) === null || _event$source$data === void 0 ? void 0 : _event$source$data.type) === 'table-row' || (event === null || event === void 0 ? void 0 : (_event$source2 = event.source) === null || _event$source2 === void 0 ? void 0 : (_event$source2$data = _event$source2.data) === null || _event$source2$data === void 0 ? void 0 : _event$source2$data.type) === 'table-column') {
133
151
  var _event$source$data2;
134
152
  return clearDropTargetWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.DRAG_AND_DROP, event.source.data.type, (_event$source$data2 = event.source.data) === null || _event$source$data2 === void 0 ? void 0 : _event$source$data2.indexes, TABLE_STATUS.CANCELLED, tr)(editorView.state, editorView.dispatch);
@@ -157,6 +175,10 @@ const destroyFn = (editorView, editorAnalyticsAPI, isTableScalingEnabled, isTabl
157
175
  clearDropTargetWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.DRAG_AND_DROP, sourceType, sourceIndexes,
158
176
  // This event is mrked as invalid because the user is attempting to drop an element in an area which has merged cells.
159
177
  TABLE_STATUS.INVALID, tr)(editorView.state, editorView.dispatch);
178
+ if (expValEquals('cc_editor_interactivity_monitoring', 'isEnabled', true)) {
179
+ var _insm$session5;
180
+ (_insm$session5 = insm.session) === null || _insm$session5 === void 0 ? void 0 : _insm$session5.endFeature('tableDragAndDrop');
181
+ }
160
182
  return;
161
183
  }
162
184
  requestAnimationFrame(() => {
@@ -187,6 +209,10 @@ const destroyFn = (editorView, editorAnalyticsAPI, isTableScalingEnabled, isTabl
187
209
  }
188
210
  }
189
211
  editorView.focus();
212
+ if (expValEquals('cc_editor_interactivity_monitoring', 'isEnabled', true)) {
213
+ var _insm$session6;
214
+ (_insm$session6 = insm.session) === null || _insm$session6 === void 0 ? void 0 : _insm$session6.endFeature('tableDragAndDrop');
215
+ }
190
216
  });
191
217
  }
192
218
  }));
@@ -14,6 +14,7 @@ import { tableMessages as messages } from '@atlaskit/editor-common/messages';
14
14
  import { DropdownMenuSharedCssClassName } from '@atlaskit/editor-common/styles';
15
15
  import { backgroundPaletteTooltipMessages, cellBackgroundColorPalette, ColorPalette, getSelectedRowAndColumnFromPalette } from '@atlaskit/editor-common/ui-color';
16
16
  import { ArrowKeyNavigationProvider, ArrowKeyNavigationType } from '@atlaskit/editor-common/ui-menu';
17
+ import { UserIntentPopupWrapper } from '@atlaskit/editor-common/user-intent';
17
18
  import { closestElement } from '@atlaskit/editor-common/utils';
18
19
  import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
19
20
  import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
@@ -23,6 +24,7 @@ import PaintBucketIcon from '@atlaskit/icon/core/migration/paint-bucket--editor-
23
24
  // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
24
25
  import { Box, xcss } from '@atlaskit/primitives';
25
26
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
27
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
26
28
  import Toggle from '@atlaskit/toggle';
27
29
  import { clearHoverSelection, hoverColumns, hoverRows } from '../../pm-plugins/commands';
28
30
  import { setColorWithAnalytics, toggleHeaderColumnWithAnalytics, toggleHeaderRowWithAnalytics, toggleNumberColumnWithAnalytics } from '../../pm-plugins/commands/commands-with-analytics';
@@ -507,7 +509,7 @@ const DragMenu = /*#__PURE__*/React.memo(({
507
509
  items: [createRowNumbersMenuItem()]
508
510
  });
509
511
  }
510
- return jsx(DropdownMenu, {
512
+ const Menu = jsx(DropdownMenu, {
511
513
  disableKeyboardHandling: isSubmenuOpen,
512
514
  section: {
513
515
  hasSeparator: true
@@ -523,5 +525,8 @@ const DragMenu = /*#__PURE__*/React.memo(({
523
525
  boundariesElement: boundariesElement,
524
526
  scrollableElement: scrollableElement
525
527
  });
528
+ return editorExperiment('platform_editor_toolbar_aifc', true) && expValEquals('platform_editor_toolbar_aifc_patch_2', 'isEnabled', true) ? jsx(UserIntentPopupWrapper, {
529
+ api: api
530
+ }, Menu) : Menu;
526
531
  });
527
532
  export default injectIntl(DragMenu);
@@ -455,6 +455,10 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
455
455
  }
456
456
  }
457
457
  });
458
+ if (expValEquals('platform_editor_tables_scaling_css', 'isEnabled', true)) {
459
+ // eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
460
+ window.addEventListener('resize', this.handleWindowResizeNewDebounced);
461
+ }
458
462
  }
459
463
  }
460
464
  }, {
@@ -545,8 +549,6 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
545
549
  // eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
546
550
  window.addEventListener('resize', this.handleWindowResizeDebounced);
547
551
  }
548
- // eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
549
- window.addEventListener('resize', this.handleWindowResizeNewDebounced);
550
552
  this.handleTableResizingDebounced();
551
553
  }
552
554
  var currentStickyState = stickyHeadersPluginKey.getState(this.props.view.state);
@@ -600,7 +602,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
600
602
  // eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
601
603
  window.removeEventListener('resize', this.handleWindowResizeDebounced);
602
604
  }
603
- if (allowColumnResizing) {
605
+ if (expValEquals('platform_editor_tables_scaling_css', 'isEnabled', true)) {
604
606
  // eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
605
607
  window.removeEventListener('resize', this.handleWindowResizeNewDebounced);
606
608
  }
@@ -20,6 +20,7 @@ import { findTable } from '@atlaskit/editor-tables/utils';
20
20
  import { fg } from '@atlaskit/platform-feature-flags';
21
21
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
22
22
  import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
23
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
23
24
  import { setTableAlignmentWithTableContentWithPosWithAnalytics } from '../pm-plugins/commands/commands-with-analytics';
24
25
  import { updateWidthToWidest } from '../pm-plugins/commands/misc';
25
26
  import { META_KEYS } from '../pm-plugins/table-analytics';
@@ -249,7 +250,7 @@ export var TableResizer = function TableResizer(_ref) {
249
250
  tr.setMeta(META_KEYS.OVERFLOW_TRIGGER, {
250
251
  name: TABLE_OVERFLOW_CHANGE_TRIGGER.RESIZED
251
252
  });
252
- if (expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
253
+ if (expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) || editorExperiment('platform_editor_toolbar_aifc', true) && expValEquals('platform_editor_toolbar_aifc_patch_2', 'isEnabled', true)) {
253
254
  var _pluginInjectionApi$u;
254
255
  pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$u = pluginInjectionApi.userIntent) === null || _pluginInjectionApi$u === void 0 || _pluginInjectionApi$u.commands.setCurrentUserIntent('resizing')({
255
256
  tr: tr
@@ -326,7 +327,7 @@ export var TableResizer = function TableResizer(_ref) {
326
327
  tableRef: null
327
328
  });
328
329
  tr.setMeta('is-resizer-resizing', false);
329
- if (expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
330
+ if (expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) || editorExperiment('platform_editor_toolbar_aifc', true) && expValEquals('platform_editor_toolbar_aifc_patch_2', 'isEnabled', true)) {
330
331
  var _pluginInjectionApi$u2;
331
332
  pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$u2 = pluginInjectionApi.userIntent) === null || _pluginInjectionApi$u2 === void 0 || _pluginInjectionApi$u2.commands.setCurrentUserIntent('default')({
332
333
  tr: tr
@@ -3,9 +3,11 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
3
  import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
4
4
  import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
5
5
  import { getCellsInRow, getSelectedCellInfo } from '@atlaskit/editor-tables/utils';
6
+ import { insm } from '@atlaskit/insm';
6
7
  import { autoScrollForElements } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/element';
7
8
  import { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';
8
9
  import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
10
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
9
11
  import { getPluginState as getTablePluginState } from '../plugin-factory';
10
12
  import { pluginKey as tablePluginKey } from '../plugin-key';
11
13
  import { insertColgroupFromNode } from '../table-resizing/utils/colgroup';
@@ -28,12 +30,20 @@ var destroyFn = function destroyFn(editorView, editorAnalyticsAPI, isTableScalin
28
30
  return type === 'table-row';
29
31
  },
30
32
  onDragStart: function onDragStart() {
33
+ if (expValEquals('cc_editor_interactivity_monitoring', 'isEnabled', true)) {
34
+ var _insm$session;
35
+ (_insm$session = insm.session) === null || _insm$session === void 0 || _insm$session.startFeature('tableDragAndDrop');
36
+ }
31
37
  // auto scroller doesn't work when scroll-behavior: smooth is set, this monitor temporarily removes it via inline styles
32
38
  // Ignored via go/ees005
33
39
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
34
40
  editorPageScrollContainer.style.setProperty('scroll-behavior', 'unset');
35
41
  },
36
42
  onDrop: function onDrop() {
43
+ if (expValEquals('cc_editor_interactivity_monitoring', 'isEnabled', true)) {
44
+ var _insm$session2;
45
+ (_insm$session2 = insm.session) === null || _insm$session2 === void 0 || _insm$session2.endFeature('tableDragAndDrop');
46
+ }
37
47
  // 'null' will remove the inline style
38
48
  // Ignored via go/ees005
39
49
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
@@ -70,6 +80,10 @@ var destroyFn = function destroyFn(editorView, editorAnalyticsAPI, isTableScalin
70
80
  },
71
81
  onDragStart: function onDragStart(_ref7) {
72
82
  var location = _ref7.location;
83
+ if (expValEquals('cc_editor_interactivity_monitoring', 'isEnabled', true)) {
84
+ var _insm$session3;
85
+ (_insm$session3 = insm.session) === null || _insm$session3 === void 0 || _insm$session3.startFeature('tableDragAndDrop');
86
+ }
73
87
  toggleDragMenu(false)(editorView.state, editorView.dispatch);
74
88
  },
75
89
  onDrag: function onDrag(event) {
@@ -118,6 +132,10 @@ var destroyFn = function destroyFn(editorView, editorAnalyticsAPI, isTableScalin
118
132
  var _event$source, _event$source2;
119
133
  // If we're able to determine the source type of the dropped element then we should report to analytics that
120
134
  // the drop event was cancelled. Otherwise we will cancel silently.
135
+ if (expValEquals('cc_editor_interactivity_monitoring', 'isEnabled', true)) {
136
+ var _insm$session4;
137
+ (_insm$session4 = insm.session) === null || _insm$session4 === void 0 || _insm$session4.endFeature('tableDragAndDrop');
138
+ }
121
139
  if ((event === null || event === void 0 || (_event$source = event.source) === null || _event$source === void 0 || (_event$source = _event$source.data) === null || _event$source === void 0 ? void 0 : _event$source.type) === 'table-row' || (event === null || event === void 0 || (_event$source2 = event.source) === null || _event$source2 === void 0 || (_event$source2 = _event$source2.data) === null || _event$source2 === void 0 ? void 0 : _event$source2.type) === 'table-column') {
122
140
  var _event$source$data;
123
141
  return clearDropTargetWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.DRAG_AND_DROP, event.source.data.type, (_event$source$data = event.source.data) === null || _event$source$data === void 0 ? void 0 : _event$source$data.indexes, TABLE_STATUS.CANCELLED, tr)(editorView.state, editorView.dispatch);
@@ -144,6 +162,10 @@ var destroyFn = function destroyFn(editorView, editorAnalyticsAPI, isTableScalin
144
162
  clearDropTargetWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.DRAG_AND_DROP, sourceType, sourceIndexes,
145
163
  // This event is mrked as invalid because the user is attempting to drop an element in an area which has merged cells.
146
164
  TABLE_STATUS.INVALID, tr)(editorView.state, editorView.dispatch);
165
+ if (expValEquals('cc_editor_interactivity_monitoring', 'isEnabled', true)) {
166
+ var _insm$session5;
167
+ (_insm$session5 = insm.session) === null || _insm$session5 === void 0 || _insm$session5.endFeature('tableDragAndDrop');
168
+ }
147
169
  return;
148
170
  }
149
171
  requestAnimationFrame(function () {
@@ -173,6 +195,10 @@ var destroyFn = function destroyFn(editorView, editorAnalyticsAPI, isTableScalin
173
195
  }
174
196
  }
175
197
  editorView.focus();
198
+ if (expValEquals('cc_editor_interactivity_monitoring', 'isEnabled', true)) {
199
+ var _insm$session6;
200
+ (_insm$session6 = insm.session) === null || _insm$session6 === void 0 || _insm$session6.endFeature('tableDragAndDrop');
201
+ }
176
202
  });
177
203
  }
178
204
  })]));
@@ -16,6 +16,7 @@ import { tableMessages as messages } from '@atlaskit/editor-common/messages';
16
16
  import { DropdownMenuSharedCssClassName } from '@atlaskit/editor-common/styles';
17
17
  import { backgroundPaletteTooltipMessages, cellBackgroundColorPalette, ColorPalette, getSelectedRowAndColumnFromPalette } from '@atlaskit/editor-common/ui-color';
18
18
  import { ArrowKeyNavigationProvider, ArrowKeyNavigationType } from '@atlaskit/editor-common/ui-menu';
19
+ import { UserIntentPopupWrapper } from '@atlaskit/editor-common/user-intent';
19
20
  import { closestElement } from '@atlaskit/editor-common/utils';
20
21
  import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
21
22
  import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
@@ -25,6 +26,7 @@ import PaintBucketIcon from '@atlaskit/icon/core/migration/paint-bucket--editor-
25
26
  // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
26
27
  import { Box, xcss } from '@atlaskit/primitives';
27
28
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
29
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
28
30
  import Toggle from '@atlaskit/toggle';
29
31
  import { clearHoverSelection, hoverColumns, hoverRows } from '../../pm-plugins/commands';
30
32
  import { setColorWithAnalytics, toggleHeaderColumnWithAnalytics, toggleHeaderRowWithAnalytics, toggleNumberColumnWithAnalytics } from '../../pm-plugins/commands/commands-with-analytics';
@@ -497,7 +499,7 @@ var DragMenu = /*#__PURE__*/React.memo(function (_ref) {
497
499
  items: [createRowNumbersMenuItem()]
498
500
  });
499
501
  }
500
- return jsx(DropdownMenu, {
502
+ var Menu = jsx(DropdownMenu, {
501
503
  disableKeyboardHandling: isSubmenuOpen,
502
504
  section: {
503
505
  hasSeparator: true
@@ -513,5 +515,8 @@ var DragMenu = /*#__PURE__*/React.memo(function (_ref) {
513
515
  boundariesElement: boundariesElement,
514
516
  scrollableElement: scrollableElement
515
517
  });
518
+ return editorExperiment('platform_editor_toolbar_aifc', true) && expValEquals('platform_editor_toolbar_aifc_patch_2', 'isEnabled', true) ? jsx(UserIntentPopupWrapper, {
519
+ api: api
520
+ }, Menu) : Menu;
516
521
  });
517
522
  export default injectIntl(DragMenu);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "13.0.6",
3
+ "version": "13.0.8",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -48,18 +48,19 @@
48
48
  "@atlaskit/editor-shared-styles": "^3.6.0",
49
49
  "@atlaskit/editor-tables": "^2.9.0",
50
50
  "@atlaskit/icon": "^28.1.0",
51
- "@atlaskit/menu": "^8.3.0",
51
+ "@atlaskit/insm": "^0.1.0",
52
+ "@atlaskit/menu": "^8.4.0",
52
53
  "@atlaskit/platform-feature-flags": "^1.1.0",
53
54
  "@atlaskit/platform-feature-flags-react": "^0.3.0",
54
55
  "@atlaskit/pragmatic-drag-and-drop": "^1.7.0",
55
56
  "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
56
57
  "@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.1.0",
57
- "@atlaskit/primitives": "^14.12.0",
58
+ "@atlaskit/primitives": "^14.13.0",
58
59
  "@atlaskit/react-ufo": "^4.5.0",
59
60
  "@atlaskit/theme": "^20.0.0",
60
- "@atlaskit/tmp-editor-statsig": "^12.3.0",
61
+ "@atlaskit/tmp-editor-statsig": "^12.5.0",
61
62
  "@atlaskit/toggle": "^15.1.0",
62
- "@atlaskit/tokens": "^6.1.0",
63
+ "@atlaskit/tokens": "^6.2.0",
63
64
  "@atlaskit/tooltip": "^20.4.0",
64
65
  "@babel/runtime": "^7.0.0",
65
66
  "@emotion/react": "^11.7.1",
@@ -70,7 +71,7 @@
70
71
  "uuid": "^3.1.0"
71
72
  },
72
73
  "peerDependencies": {
73
- "@atlaskit/editor-common": "^108.1.0",
74
+ "@atlaskit/editor-common": "^108.5.0",
74
75
  "react": "^18.2.0",
75
76
  "react-dom": "^18.2.0",
76
77
  "react-intl-next": "npm:react-intl@^5.18.1"