@atlaskit/editor-plugin-table 24.0.4 → 24.2.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,29 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 24.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`298f9a506cb5f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/298f9a506cb5f) -
8
+ [EDITOR-6790] Allow inserting a column to the left of the first column, behind the
9
+ platform_editor_table_col_insert experiment
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
15
+ ## 24.1.0
16
+
17
+ ### Minor Changes
18
+
19
+ - [`377a4234587d1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/377a4234587d1) -
20
+ Promote `tableCell` and `tableHeader` `valign` attribute from stage-0 to the full ADF schema, and
21
+ remove the now-redundant stage-0 node-spec selection in the table plugin.
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies
26
+
3
27
  ## 24.0.4
4
28
 
5
29
  ### Patch Changes
@@ -22,7 +22,6 @@ var _utils = require("@atlaskit/editor-prosemirror/utils");
22
22
  var _pmPlugins = require("@atlaskit/editor-tables/pm-plugins");
23
23
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
24
24
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
25
- var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
26
25
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
27
26
  var _toDOM = require("./nodeviews/toDOM");
28
27
  var _plugin = require("./pm-plugins/active-cell-highlight/plugin");
@@ -259,13 +258,13 @@ var tablePlugin = function tablePlugin(_ref) {
259
258
  })
260
259
  }, {
261
260
  name: 'tableHeader',
262
- node: (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_table_menu_updates', 'isEnabled', true) ? _adfSchema.tableHeaderWithNestedTableStage0 : (0, _platformFeatureFlags.fg)('platform_editor_adf_with_localid') ? _adfSchema.tableHeaderWithNestedTableWithLocalId : _adfSchema.tableHeaderWithNestedTable
261
+ node: (0, _platformFeatureFlags.fg)('platform_editor_adf_with_localid') ? _adfSchema.tableHeaderWithNestedTableWithLocalId : _adfSchema.tableHeaderWithNestedTable
263
262
  }, {
264
263
  name: 'tableRow',
265
264
  node: (0, _platformFeatureFlags.fg)('platform_editor_adf_with_localid') ? _adfSchema.tableRowWithNestedTableWithLocalId : _adfSchema.tableRowWithNestedTable
266
265
  }, {
267
266
  name: 'tableCell',
268
- node: (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_table_menu_updates', 'isEnabled', true) ? _adfSchema.tableCellWithNestedTableStage0 : (0, _platformFeatureFlags.fg)('platform_editor_adf_with_localid') ? _adfSchema.tableCellWithNestedTableWithLocalId : _adfSchema.tableCellWithNestedTable
267
+ node: (0, _platformFeatureFlags.fg)('platform_editor_adf_with_localid') ? _adfSchema.tableCellWithNestedTableWithLocalId : _adfSchema.tableCellWithNestedTable
269
268
  }] : [{
270
269
  name: 'table',
271
270
  node: (0, _toDOM.tableNodeSpecWithFixedToDOM)({
@@ -280,13 +279,13 @@ var tablePlugin = function tablePlugin(_ref) {
280
279
  })
281
280
  }, {
282
281
  name: 'tableHeader',
283
- node: (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_table_menu_updates', 'isEnabled', true) ? _adfSchema.tableHeaderStage0 : (0, _platformFeatureFlags.fg)('platform_editor_adf_with_localid') ? _adfSchema.tableHeaderWithLocalId : _adfSchema.tableHeader
282
+ node: (0, _platformFeatureFlags.fg)('platform_editor_adf_with_localid') ? _adfSchema.tableHeaderWithLocalId : _adfSchema.tableHeader
284
283
  }, {
285
284
  name: 'tableRow',
286
285
  node: (0, _platformFeatureFlags.fg)('platform_editor_adf_with_localid') ? _adfSchema.tableRowWithLocalId : _adfSchema.tableRow
287
286
  }, {
288
287
  name: 'tableCell',
289
- node: (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_table_menu_updates', 'isEnabled', true) ? _adfSchema.tableCellStage0 : (0, _platformFeatureFlags.fg)('platform_editor_adf_with_localid') ? _adfSchema.tableCellWithLocalId : _adfSchema.tableCell
288
+ node: (0, _platformFeatureFlags.fg)('platform_editor_adf_with_localid') ? _adfSchema.tableCellWithLocalId : _adfSchema.tableCell
290
289
  }];
291
290
  },
292
291
  pmPlugins: function pmPlugins() {
@@ -58,8 +58,13 @@ var FloatingInsertButton = exports.FloatingInsertButton = /*#__PURE__*/function
58
58
  dispatchAnalyticsEvent = _this$props.dispatchAnalyticsEvent,
59
59
  isChromelessEditor = _this$props.isChromelessEditor;
60
60
 
61
- // ED-26961 - disable insert button for first column and row
62
- if (insertColumnButtonIndex === 0 || insertRowButtonIndex === 0) {
61
+ // EDITOR-6790 - when platform_editor_table_col_insert is enabled, allow the first column
62
+ // (index 0) insert button so a column can be inserted to the left of the first column.
63
+ var isFirstColumnInsertEnabled = (0, _expValEquals.expValEquals)('platform_editor_table_col_insert', 'isEnabled', true);
64
+
65
+ // ED-26961 - disable insert button for first row, and keep first-column behavior
66
+ // disabled until platform_editor_table_col_insert is enabled.
67
+ if (insertColumnButtonIndex === 0 && !isFirstColumnInsertEnabled || insertRowButtonIndex === 0) {
63
68
  return null;
64
69
  }
65
70
  var type = typeof insertColumnButtonIndex !== 'undefined' ? 'column' : typeof insertRowButtonIndex !== 'undefined' ? 'row' : null;
@@ -68,8 +73,10 @@ var FloatingInsertButton = exports.FloatingInsertButton = /*#__PURE__*/function
68
73
  }
69
74
 
70
75
  // We can’t display the insert button for row|colum index 0
71
- // when the header row|colum is enabled, this feature will be change on the future
72
- if (type === 'column' && isHeaderColumnEnabled && insertColumnButtonIndex === 0 || type === 'row' && isHeaderRowEnabled && insertRowButtonIndex === 0) {
76
+ // when the header row|colum is enabled, this feature will be change on the future.
77
+ // EDITOR-6790 - when platform_editor_table_col_insert is enabled, still allow the first
78
+ // column (index 0) insert button even when the header column is enabled.
79
+ if (type === 'column' && isHeaderColumnEnabled && insertColumnButtonIndex === 0 && !isFirstColumnInsertEnabled || type === 'row' && isHeaderRowEnabled && insertRowButtonIndex === 0) {
73
80
  return null;
74
81
  }
75
82
  var tr = editorView.state.tr;
@@ -182,6 +182,10 @@ var ColumnControls = exports.ColumnControls = function ColumnControls(_ref) {
182
182
  var _getScrollOffset;
183
183
  columnControlsRef.current.scrollLeft = (_getScrollOffset = getScrollOffset === null || getScrollOffset === void 0 ? void 0 : getScrollOffset()) !== null && _getScrollOffset !== void 0 ? _getScrollOffset : 0;
184
184
  }
185
+
186
+ // EDITOR-6790 - render a dot on the left edge of the first column so users have a visible
187
+ // affordance to insert a column to the left of the first column.
188
+ var isFirstColumnInsertEnabled = (0, _expValEquals.expValEquals)('platform_editor_table_col_insert', 'isEnabled', true);
185
189
  var generateHandleByType = function generateHandleByType(type, appearance, gridColumn, indexes) {
186
190
  var _rowHeights$reduce, _colWidths$reduce;
187
191
  var isHover = type === 'hover';
@@ -214,7 +218,8 @@ var ColumnControls = exports.ColumnControls = function ColumnControls(_ref) {
214
218
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
215
219
  width: '100%',
216
220
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
217
- position: 'relative'
221
+ position: 'relative',
222
+ pointerEvents: isPlaceholder && isFirstColumnInsertEnabled ? 'none' : undefined
218
223
  },
219
224
  "data-testid": "table-floating-column-".concat(isHover ? colIndex : isPlaceholder ? appearance : selectedColIndexes[0], "-drag-handle")
220
225
  }, /*#__PURE__*/_react.default.createElement(_DragHandle.DragHandle, {
@@ -296,7 +301,16 @@ var ColumnControls = exports.ColumnControls = function ColumnControls(_ref) {
296
301
  // eslint-disable-next-line react/no-array-index-key
297
302
  ,
298
303
  key: index
299
- }, /*#__PURE__*/_react.default.createElement("div", {
304
+ }, isFirstColumnInsertEnabled && index === 0 && /*#__PURE__*/_react.default.createElement("div", {
305
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
306
+ className: _types.TableCssClassName.DRAG_COLUMN_FLOATING_INSERT_DOT
307
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
308
+ ,
309
+ style: {
310
+ left: '0',
311
+ right: 'auto'
312
+ }
313
+ }), /*#__PURE__*/_react.default.createElement("div", {
300
314
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
301
315
  className: _types.TableCssClassName.DRAG_COLUMN_FLOATING_INSERT_DOT
302
316
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
@@ -1,5 +1,5 @@
1
1
  import React, { useEffect } from 'react';
2
- import { tableCell, tableCellStage0, tableCellWithNestedTable, tableCellWithNestedTableStage0, tableHeader, tableHeaderStage0, tableHeaderWithLocalId, tableHeaderWithNestedTable, tableHeaderWithNestedTableStage0, tableRow, tableRowWithNestedTable, tableRowWithLocalId, tableCellWithLocalId, tableCellWithNestedTableWithLocalId, tableRowWithNestedTableWithLocalId, tableHeaderWithNestedTableWithLocalId } from '@atlaskit/adf-schema';
2
+ import { tableCell, tableCellWithNestedTable, tableHeader, tableHeaderWithLocalId, tableHeaderWithNestedTable, tableRow, tableRowWithNestedTable, tableRowWithLocalId, tableCellWithLocalId, tableCellWithNestedTableWithLocalId, tableRowWithNestedTableWithLocalId, tableHeaderWithNestedTableWithLocalId } from '@atlaskit/adf-schema';
3
3
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD, TABLE_ACTION } from '@atlaskit/editor-common/analytics';
4
4
  import { getBrowserInfo } from '@atlaskit/editor-common/browser';
5
5
  import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
@@ -13,7 +13,6 @@ import { hasParentNodeOfType, safeInsert } from '@atlaskit/editor-prosemirror/ut
13
13
  import { tableEditing } from '@atlaskit/editor-tables/pm-plugins';
14
14
  import { fg } from '@atlaskit/platform-feature-flags';
15
15
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
16
- import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
17
16
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
18
17
  import { tableNodeSpecWithFixedToDOM } from './nodeviews/toDOM';
19
18
  import { createPlugin as createActiveCellHighlightPlugin } from './pm-plugins/active-cell-highlight/plugin';
@@ -246,13 +245,13 @@ const tablePlugin = ({
246
245
  })
247
246
  }, {
248
247
  name: 'tableHeader',
249
- node: expValEqualsNoExposure('platform_editor_table_menu_updates', 'isEnabled', true) ? tableHeaderWithNestedTableStage0 : fg('platform_editor_adf_with_localid') ? tableHeaderWithNestedTableWithLocalId : tableHeaderWithNestedTable
248
+ node: fg('platform_editor_adf_with_localid') ? tableHeaderWithNestedTableWithLocalId : tableHeaderWithNestedTable
250
249
  }, {
251
250
  name: 'tableRow',
252
251
  node: fg('platform_editor_adf_with_localid') ? tableRowWithNestedTableWithLocalId : tableRowWithNestedTable
253
252
  }, {
254
253
  name: 'tableCell',
255
- node: expValEqualsNoExposure('platform_editor_table_menu_updates', 'isEnabled', true) ? tableCellWithNestedTableStage0 : fg('platform_editor_adf_with_localid') ? tableCellWithNestedTableWithLocalId : tableCellWithNestedTable
254
+ node: fg('platform_editor_adf_with_localid') ? tableCellWithNestedTableWithLocalId : tableCellWithNestedTable
256
255
  }] : [{
257
256
  name: 'table',
258
257
  node: tableNodeSpecWithFixedToDOM({
@@ -267,13 +266,13 @@ const tablePlugin = ({
267
266
  })
268
267
  }, {
269
268
  name: 'tableHeader',
270
- node: expValEqualsNoExposure('platform_editor_table_menu_updates', 'isEnabled', true) ? tableHeaderStage0 : fg('platform_editor_adf_with_localid') ? tableHeaderWithLocalId : tableHeader
269
+ node: fg('platform_editor_adf_with_localid') ? tableHeaderWithLocalId : tableHeader
271
270
  }, {
272
271
  name: 'tableRow',
273
272
  node: fg('platform_editor_adf_with_localid') ? tableRowWithLocalId : tableRow
274
273
  }, {
275
274
  name: 'tableCell',
276
- node: expValEqualsNoExposure('platform_editor_table_menu_updates', 'isEnabled', true) ? tableCellStage0 : fg('platform_editor_adf_with_localid') ? tableCellWithLocalId : tableCell
275
+ node: fg('platform_editor_adf_with_localid') ? tableCellWithLocalId : tableCell
277
276
  }];
278
277
  },
279
278
  pmPlugins() {
@@ -39,8 +39,13 @@ export class FloatingInsertButton extends React.Component {
39
39
  isChromelessEditor
40
40
  } = this.props;
41
41
 
42
- // ED-26961 - disable insert button for first column and row
43
- if (insertColumnButtonIndex === 0 || insertRowButtonIndex === 0) {
42
+ // EDITOR-6790 - when platform_editor_table_col_insert is enabled, allow the first column
43
+ // (index 0) insert button so a column can be inserted to the left of the first column.
44
+ const isFirstColumnInsertEnabled = expValEquals('platform_editor_table_col_insert', 'isEnabled', true);
45
+
46
+ // ED-26961 - disable insert button for first row, and keep first-column behavior
47
+ // disabled until platform_editor_table_col_insert is enabled.
48
+ if (insertColumnButtonIndex === 0 && !isFirstColumnInsertEnabled || insertRowButtonIndex === 0) {
44
49
  return null;
45
50
  }
46
51
  const type = typeof insertColumnButtonIndex !== 'undefined' ? 'column' : typeof insertRowButtonIndex !== 'undefined' ? 'row' : null;
@@ -49,8 +54,10 @@ export class FloatingInsertButton extends React.Component {
49
54
  }
50
55
 
51
56
  // We can’t display the insert button for row|colum index 0
52
- // when the header row|colum is enabled, this feature will be change on the future
53
- if (type === 'column' && isHeaderColumnEnabled && insertColumnButtonIndex === 0 || type === 'row' && isHeaderRowEnabled && insertRowButtonIndex === 0) {
57
+ // when the header row|colum is enabled, this feature will be change on the future.
58
+ // EDITOR-6790 - when platform_editor_table_col_insert is enabled, still allow the first
59
+ // column (index 0) insert button even when the header column is enabled.
60
+ if (type === 'column' && isHeaderColumnEnabled && insertColumnButtonIndex === 0 && !isFirstColumnInsertEnabled || type === 'row' && isHeaderRowEnabled && insertRowButtonIndex === 0) {
54
61
  return null;
55
62
  }
56
63
  const {
@@ -185,6 +185,10 @@ export const ColumnControls = ({
185
185
  var _getScrollOffset;
186
186
  columnControlsRef.current.scrollLeft = (_getScrollOffset = getScrollOffset === null || getScrollOffset === void 0 ? void 0 : getScrollOffset()) !== null && _getScrollOffset !== void 0 ? _getScrollOffset : 0;
187
187
  }
188
+
189
+ // EDITOR-6790 - render a dot on the left edge of the first column so users have a visible
190
+ // affordance to insert a column to the left of the first column.
191
+ const isFirstColumnInsertEnabled = expValEquals('platform_editor_table_col_insert', 'isEnabled', true);
188
192
  const generateHandleByType = (type, appearance, gridColumn, indexes) => {
189
193
  var _rowHeights$reduce, _colWidths$reduce;
190
194
  const isHover = type === 'hover';
@@ -213,7 +217,8 @@ export const ColumnControls = ({
213
217
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
214
218
  width: '100%',
215
219
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
216
- position: 'relative'
220
+ position: 'relative',
221
+ pointerEvents: isPlaceholder && isFirstColumnInsertEnabled ? 'none' : undefined
217
222
  },
218
223
  "data-testid": `table-floating-column-${isHover ? colIndex : isPlaceholder ? appearance : selectedColIndexes[0]}-drag-handle`
219
224
  }, /*#__PURE__*/React.createElement(DragHandle, {
@@ -295,7 +300,16 @@ export const ColumnControls = ({
295
300
  // eslint-disable-next-line react/no-array-index-key
296
301
  ,
297
302
  key: index
298
- }, /*#__PURE__*/React.createElement("div", {
303
+ }, isFirstColumnInsertEnabled && index === 0 && /*#__PURE__*/React.createElement("div", {
304
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
305
+ className: ClassName.DRAG_COLUMN_FLOATING_INSERT_DOT
306
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
307
+ ,
308
+ style: {
309
+ left: '0',
310
+ right: 'auto'
311
+ }
312
+ }), /*#__PURE__*/React.createElement("div", {
299
313
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
300
314
  className: ClassName.DRAG_COLUMN_FLOATING_INSERT_DOT
301
315
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
@@ -2,7 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  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; }
3
3
  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; }
4
4
  import React, { useEffect } from 'react';
5
- import { tableCell, tableCellStage0, tableCellWithNestedTable, tableCellWithNestedTableStage0, tableHeader, tableHeaderStage0, tableHeaderWithLocalId, tableHeaderWithNestedTable, tableHeaderWithNestedTableStage0, tableRow, tableRowWithNestedTable, tableRowWithLocalId, tableCellWithLocalId, tableCellWithNestedTableWithLocalId, tableRowWithNestedTableWithLocalId, tableHeaderWithNestedTableWithLocalId } from '@atlaskit/adf-schema';
5
+ import { tableCell, tableCellWithNestedTable, tableHeader, tableHeaderWithLocalId, tableHeaderWithNestedTable, tableRow, tableRowWithNestedTable, tableRowWithLocalId, tableCellWithLocalId, tableCellWithNestedTableWithLocalId, tableRowWithNestedTableWithLocalId, tableHeaderWithNestedTableWithLocalId } from '@atlaskit/adf-schema';
6
6
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD, TABLE_ACTION } from '@atlaskit/editor-common/analytics';
7
7
  import { getBrowserInfo } from '@atlaskit/editor-common/browser';
8
8
  import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
@@ -16,7 +16,6 @@ import { hasParentNodeOfType, safeInsert } from '@atlaskit/editor-prosemirror/ut
16
16
  import { tableEditing } from '@atlaskit/editor-tables/pm-plugins';
17
17
  import { fg } from '@atlaskit/platform-feature-flags';
18
18
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
19
- import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
20
19
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
21
20
  import { tableNodeSpecWithFixedToDOM } from './nodeviews/toDOM';
22
21
  import { createPlugin as createActiveCellHighlightPlugin } from './pm-plugins/active-cell-highlight/plugin';
@@ -250,13 +249,13 @@ var tablePlugin = function tablePlugin(_ref) {
250
249
  })
251
250
  }, {
252
251
  name: 'tableHeader',
253
- node: expValEqualsNoExposure('platform_editor_table_menu_updates', 'isEnabled', true) ? tableHeaderWithNestedTableStage0 : fg('platform_editor_adf_with_localid') ? tableHeaderWithNestedTableWithLocalId : tableHeaderWithNestedTable
252
+ node: fg('platform_editor_adf_with_localid') ? tableHeaderWithNestedTableWithLocalId : tableHeaderWithNestedTable
254
253
  }, {
255
254
  name: 'tableRow',
256
255
  node: fg('platform_editor_adf_with_localid') ? tableRowWithNestedTableWithLocalId : tableRowWithNestedTable
257
256
  }, {
258
257
  name: 'tableCell',
259
- node: expValEqualsNoExposure('platform_editor_table_menu_updates', 'isEnabled', true) ? tableCellWithNestedTableStage0 : fg('platform_editor_adf_with_localid') ? tableCellWithNestedTableWithLocalId : tableCellWithNestedTable
258
+ node: fg('platform_editor_adf_with_localid') ? tableCellWithNestedTableWithLocalId : tableCellWithNestedTable
260
259
  }] : [{
261
260
  name: 'table',
262
261
  node: tableNodeSpecWithFixedToDOM({
@@ -271,13 +270,13 @@ var tablePlugin = function tablePlugin(_ref) {
271
270
  })
272
271
  }, {
273
272
  name: 'tableHeader',
274
- node: expValEqualsNoExposure('platform_editor_table_menu_updates', 'isEnabled', true) ? tableHeaderStage0 : fg('platform_editor_adf_with_localid') ? tableHeaderWithLocalId : tableHeader
273
+ node: fg('platform_editor_adf_with_localid') ? tableHeaderWithLocalId : tableHeader
275
274
  }, {
276
275
  name: 'tableRow',
277
276
  node: fg('platform_editor_adf_with_localid') ? tableRowWithLocalId : tableRow
278
277
  }, {
279
278
  name: 'tableCell',
280
- node: expValEqualsNoExposure('platform_editor_table_menu_updates', 'isEnabled', true) ? tableCellStage0 : fg('platform_editor_adf_with_localid') ? tableCellWithLocalId : tableCell
279
+ node: fg('platform_editor_adf_with_localid') ? tableCellWithLocalId : tableCell
281
280
  }];
282
281
  },
283
282
  pmPlugins: function pmPlugins() {
@@ -51,8 +51,13 @@ export var FloatingInsertButton = /*#__PURE__*/function (_React$Component) {
51
51
  dispatchAnalyticsEvent = _this$props.dispatchAnalyticsEvent,
52
52
  isChromelessEditor = _this$props.isChromelessEditor;
53
53
 
54
- // ED-26961 - disable insert button for first column and row
55
- if (insertColumnButtonIndex === 0 || insertRowButtonIndex === 0) {
54
+ // EDITOR-6790 - when platform_editor_table_col_insert is enabled, allow the first column
55
+ // (index 0) insert button so a column can be inserted to the left of the first column.
56
+ var isFirstColumnInsertEnabled = expValEquals('platform_editor_table_col_insert', 'isEnabled', true);
57
+
58
+ // ED-26961 - disable insert button for first row, and keep first-column behavior
59
+ // disabled until platform_editor_table_col_insert is enabled.
60
+ if (insertColumnButtonIndex === 0 && !isFirstColumnInsertEnabled || insertRowButtonIndex === 0) {
56
61
  return null;
57
62
  }
58
63
  var type = typeof insertColumnButtonIndex !== 'undefined' ? 'column' : typeof insertRowButtonIndex !== 'undefined' ? 'row' : null;
@@ -61,8 +66,10 @@ export var FloatingInsertButton = /*#__PURE__*/function (_React$Component) {
61
66
  }
62
67
 
63
68
  // We can’t display the insert button for row|colum index 0
64
- // when the header row|colum is enabled, this feature will be change on the future
65
- if (type === 'column' && isHeaderColumnEnabled && insertColumnButtonIndex === 0 || type === 'row' && isHeaderRowEnabled && insertRowButtonIndex === 0) {
69
+ // when the header row|colum is enabled, this feature will be change on the future.
70
+ // EDITOR-6790 - when platform_editor_table_col_insert is enabled, still allow the first
71
+ // column (index 0) insert button even when the header column is enabled.
72
+ if (type === 'column' && isHeaderColumnEnabled && insertColumnButtonIndex === 0 && !isFirstColumnInsertEnabled || type === 'row' && isHeaderRowEnabled && insertRowButtonIndex === 0) {
66
73
  return null;
67
74
  }
68
75
  var tr = editorView.state.tr;
@@ -174,6 +174,10 @@ export var ColumnControls = function ColumnControls(_ref) {
174
174
  var _getScrollOffset;
175
175
  columnControlsRef.current.scrollLeft = (_getScrollOffset = getScrollOffset === null || getScrollOffset === void 0 ? void 0 : getScrollOffset()) !== null && _getScrollOffset !== void 0 ? _getScrollOffset : 0;
176
176
  }
177
+
178
+ // EDITOR-6790 - render a dot on the left edge of the first column so users have a visible
179
+ // affordance to insert a column to the left of the first column.
180
+ var isFirstColumnInsertEnabled = expValEquals('platform_editor_table_col_insert', 'isEnabled', true);
177
181
  var generateHandleByType = function generateHandleByType(type, appearance, gridColumn, indexes) {
178
182
  var _rowHeights$reduce, _colWidths$reduce;
179
183
  var isHover = type === 'hover';
@@ -206,7 +210,8 @@ export var ColumnControls = function ColumnControls(_ref) {
206
210
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
207
211
  width: '100%',
208
212
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
209
- position: 'relative'
213
+ position: 'relative',
214
+ pointerEvents: isPlaceholder && isFirstColumnInsertEnabled ? 'none' : undefined
210
215
  },
211
216
  "data-testid": "table-floating-column-".concat(isHover ? colIndex : isPlaceholder ? appearance : selectedColIndexes[0], "-drag-handle")
212
217
  }, /*#__PURE__*/React.createElement(DragHandle, {
@@ -288,7 +293,16 @@ export var ColumnControls = function ColumnControls(_ref) {
288
293
  // eslint-disable-next-line react/no-array-index-key
289
294
  ,
290
295
  key: index
291
- }, /*#__PURE__*/React.createElement("div", {
296
+ }, isFirstColumnInsertEnabled && index === 0 && /*#__PURE__*/React.createElement("div", {
297
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
298
+ className: ClassName.DRAG_COLUMN_FLOATING_INSERT_DOT
299
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
300
+ ,
301
+ style: {
302
+ left: '0',
303
+ right: 'auto'
304
+ }
305
+ }), /*#__PURE__*/React.createElement("div", {
292
306
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
293
307
  className: ClassName.DRAG_COLUMN_FLOATING_INSERT_DOT
294
308
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "24.0.4",
3
+ "version": "24.2.0",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -20,8 +20,8 @@
20
20
  "singleton": true
21
21
  },
22
22
  "dependencies": {
23
- "@atlaskit/adf-schema": "^55.2.0",
24
- "@atlaskit/button": "^24.0.0",
23
+ "@atlaskit/adf-schema": "^56.0.0",
24
+ "@atlaskit/button": "^24.1.0",
25
25
  "@atlaskit/custom-steps": "^1.0.0",
26
26
  "@atlaskit/editor-palette": "^3.1.0",
27
27
  "@atlaskit/editor-plugin-accessibility-utils": "^12.0.0",
@@ -29,7 +29,7 @@
29
29
  "@atlaskit/editor-plugin-batch-attribute-updates": "^12.0.0",
30
30
  "@atlaskit/editor-plugin-content-insertion": "^12.0.0",
31
31
  "@atlaskit/editor-plugin-editor-viewmode": "^14.0.0",
32
- "@atlaskit/editor-plugin-extension": "15.0.4",
32
+ "@atlaskit/editor-plugin-extension": "15.0.5",
33
33
  "@atlaskit/editor-plugin-guideline": "^12.0.0",
34
34
  "@atlaskit/editor-plugin-interaction": "^21.0.0",
35
35
  "@atlaskit/editor-plugin-limited-mode": "^9.0.0",
@@ -52,7 +52,7 @@
52
52
  "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^3.0.0",
53
53
  "@atlaskit/pragmatic-drag-and-drop-hitbox": "^2.0.0",
54
54
  "@atlaskit/primitives": "^20.0.0",
55
- "@atlaskit/tmp-editor-statsig": "^108.0.0",
55
+ "@atlaskit/tmp-editor-statsig": "^108.4.0",
56
56
  "@atlaskit/toggle": "^17.0.0",
57
57
  "@atlaskit/tokens": "^14.0.0",
58
58
  "@atlaskit/tooltip": "^23.0.0",
@@ -67,7 +67,7 @@
67
67
  "uuid": "^3.1.0"
68
68
  },
69
69
  "peerDependencies": {
70
- "@atlaskit/editor-common": "^116.3.0",
70
+ "@atlaskit/editor-common": "^116.4.0",
71
71
  "react": "^18.2.0",
72
72
  "react-dom": "^18.2.0",
73
73
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"