@atlaskit/editor-plugin-table 7.17.1 → 7.17.2

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-table
2
2
 
3
+ ## 7.17.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#110390](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/110390)
8
+ [`bead123202369`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/bead123202369) -
9
+ [ux] [ED-23642] Reordering the typeahead so that date, status, code block & info panel are above
10
+ the fold (in the top 5 results)
11
+ - [#111045](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/111045)
12
+ [`2f693993423ec`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2f693993423ec) -
13
+ improve input latency of drag and drop experience and hide drag handle during resizing
14
+ - [#111428](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/111428)
15
+ [`5679a3e527073`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5679a3e527073) -
16
+ ED-23129: Disabled internal column resizing for nested tables
17
+ - [#111254](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/111254)
18
+ [`c76f505dccf41`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c76f505dccf41) -
19
+ [ux] Fixed resizeAmount for left-aligned tables when internal column resizing is enabled.
20
+ - Updated dependencies
21
+
3
22
  ## 7.17.1
4
23
 
5
24
  ### Patch Changes
@@ -216,6 +216,7 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
216
216
  tableLocalId: node.attrs.localId,
217
217
  tableRef: tableRef
218
218
  });
219
+ tr.setMeta('is-resizer-resizing', true);
219
220
  tr.setMeta(_tableAnalytics.META_KEYS.OVERFLOW_TRIGGER, {
220
221
  name: _analytics.TABLE_OVERFLOW_CHANGE_TRIGGER.RESIZED
221
222
  });
@@ -281,6 +282,7 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
281
282
  tableLocalId: '',
282
283
  tableRef: null
283
284
  });
285
+ tr.setMeta('is-resizer-resizing', false);
284
286
  var frameRateSamples = endMeasure();
285
287
  if (frameRateSamples.length > 0) {
286
288
  var resizeFrameRatePayloads = (0, _analytics2.generateResizeFrameRatePayloads)({
@@ -438,13 +438,14 @@ var tablesPlugin = function tablesPlugin(_ref) {
438
438
  },
439
439
  pluginsOptions: {
440
440
  quickInsert: function quickInsert(_ref19) {
441
+ var _options$getEditorFea3;
441
442
  var formatMessage = _ref19.formatMessage;
442
443
  return [{
443
444
  id: 'table',
444
445
  title: formatMessage(_messages.toolbarInsertBlockMessages.table),
445
446
  description: formatMessage(_messages.toolbarInsertBlockMessages.tableDescription),
446
447
  keywords: ['cell', 'table'],
447
- priority: 600,
448
+ priority: options !== null && options !== void 0 && (_options$getEditorFea3 = options.getEditorFeatureFlags) !== null && _options$getEditorFea3 !== void 0 && _options$getEditorFea3.call(options).platformEditorTypeaheadImprovedRelevancy ? 800 : 600,
448
449
  keyshortcut: (0, _keymaps.tooltip)(_keymaps.toggleTable),
449
450
  icon: function icon() {
450
451
  return /*#__PURE__*/_react.default.createElement(_icons.IconTable, null);
@@ -147,7 +147,7 @@ var handleMouseDown = exports.handleMouseDown = function handleMouseDown(view, e
147
147
  _shouldScale = _shouldScale && originalTable.attrs.displayMode !== 'fixed';
148
148
  }
149
149
  var resizedDelta = clientX - startX;
150
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.colum-resizing-improvements')) {
150
+ if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.colum-resizing-improvements') && !(0, _utils2.isTableNested)(state, tablePos)) {
151
151
  var newResizeState = (0, _utils3.resizeColumnAndTable)(resizeState, colIndex, clientX - startX, dom, originalTable, resizingSelectedColumns ? selectedColumns : undefined, _shouldScale);
152
152
  tr = (0, _transforms.updateColumnWidths)(newResizeState, table, start)(tr);
153
153
  tr.setNodeAttribute(start - 1, 'width', newResizeState.tableWidth);
@@ -224,7 +224,7 @@ var handleMouseDown = exports.handleMouseDown = function handleMouseDown(view, e
224
224
  if (isTableScalingWithFixedColumnWidthsOptionEnabled) {
225
225
  shouldScale = shouldScale && originalTable.attrs.displayMode !== 'fixed';
226
226
  }
227
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.colum-resizing-improvements')) {
227
+ if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.colum-resizing-improvements') && !(0, _utils2.isTableNested)(state, tablePos)) {
228
228
  (0, _utils3.resizeColumnAndTable)(resizeState, colIndex, clientX - dragging.startX, dom, table, undefined, shouldScale, undefined, shouldUseIncreasedScalingPercent);
229
229
  } else {
230
230
  (0, _utils3.resizeColumn)(resizeState, colIndex, clientX - dragging.startX, dom, table, undefined, shouldScale, shouldUseIncreasedScalingPercent);
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.resizeColumnAndTable = exports.resizeColumn = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  var _types = require("../../../types");
10
+ var _alignment = require("../../../utils/alignment");
10
11
  var _misc = require("./misc");
11
12
  var _resizeLogic = require("./resize-logic");
12
13
  var _resizeState = require("./resize-state");
@@ -36,7 +37,7 @@ var resizeColumnAndTable = exports.resizeColumnAndTable = function resizeColumnA
36
37
  var tableWidth = tableRef.clientWidth;
37
38
  var tableContainerWidth = (_tableRef$closest = tableRef.closest('.pm-table-container')) === null || _tableRef$closest === void 0 ? void 0 : _tableRef$closest.clientWidth;
38
39
  var isOverflowed = !!(tableWidth && tableContainerWidth && tableWidth > tableContainerWidth);
39
- var resizeAmount = amount * 2;
40
+ var resizeAmount = tableNode.attrs.layout === _alignment.ALIGN_START && !isOverflowed ? amount : amount * 2;
40
41
 
41
42
  // todo: reimplement - use getTableScalingPercentFrozen to get scaled percent before table width changes dynamically
42
43
  // let scalePercent = 1;
@@ -209,6 +209,7 @@ export const TableResizer = ({
209
209
  tableLocalId: node.attrs.localId,
210
210
  tableRef: tableRef
211
211
  });
212
+ tr.setMeta('is-resizer-resizing', true);
212
213
  tr.setMeta(META_KEYS.OVERFLOW_TRIGGER, {
213
214
  name: TABLE_OVERFLOW_CHANGE_TRIGGER.RESIZED
214
215
  });
@@ -276,6 +277,7 @@ export const TableResizer = ({
276
277
  tableLocalId: '',
277
278
  tableRef: null
278
279
  });
280
+ tr.setMeta('is-resizer-resizing', false);
279
281
  const frameRateSamples = endMeasure();
280
282
  if (frameRateSamples.length > 0) {
281
283
  const resizeFrameRatePayloads = generateResizeFrameRatePayloads({
@@ -433,37 +433,40 @@ const tablesPlugin = ({
433
433
  pluginsOptions: {
434
434
  quickInsert: ({
435
435
  formatMessage
436
- }) => [{
437
- id: 'table',
438
- title: formatMessage(messages.table),
439
- description: formatMessage(messages.tableDescription),
440
- keywords: ['cell', 'table'],
441
- priority: 600,
442
- keyshortcut: tooltip(toggleTable),
443
- icon: () => /*#__PURE__*/React.createElement(IconTable, null),
444
- action(insert, state) {
445
- var _api$table;
446
- // see comment on tablesPlugin.getSharedState on usage
447
- const tableState = api === null || api === void 0 ? void 0 : (_api$table = api.table) === null || _api$table === void 0 ? void 0 : _api$table.sharedState.currentState();
448
- const tableNode = createTableWithWidth({
449
- isTableScalingEnabled: options === null || options === void 0 ? void 0 : options.isTableScalingEnabled,
450
- isTableAlignmentEnabled: options === null || options === void 0 ? void 0 : options.isTableAlignmentEnabled,
451
- isFullWidthModeEnabled: tableState === null || tableState === void 0 ? void 0 : tableState.isFullWidthModeEnabled
452
- })(state.schema);
453
- const tr = insert(tableNode);
454
- editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent({
455
- action: ACTION.INSERTED,
456
- actionSubject: ACTION_SUBJECT.DOCUMENT,
457
- actionSubjectId: ACTION_SUBJECT_ID.TABLE,
458
- attributes: {
459
- inputMethod: INPUT_METHOD.QUICK_INSERT,
460
- localId: tableNode.attrs.localId
461
- },
462
- eventType: EVENT_TYPE.TRACK
463
- })(tr);
464
- return tr;
465
- }
466
- }],
436
+ }) => {
437
+ var _options$getEditorFea3;
438
+ return [{
439
+ id: 'table',
440
+ title: formatMessage(messages.table),
441
+ description: formatMessage(messages.tableDescription),
442
+ keywords: ['cell', 'table'],
443
+ priority: options !== null && options !== void 0 && (_options$getEditorFea3 = options.getEditorFeatureFlags) !== null && _options$getEditorFea3 !== void 0 && _options$getEditorFea3.call(options).platformEditorTypeaheadImprovedRelevancy ? 800 : 600,
444
+ keyshortcut: tooltip(toggleTable),
445
+ icon: () => /*#__PURE__*/React.createElement(IconTable, null),
446
+ action(insert, state) {
447
+ var _api$table;
448
+ // see comment on tablesPlugin.getSharedState on usage
449
+ const tableState = api === null || api === void 0 ? void 0 : (_api$table = api.table) === null || _api$table === void 0 ? void 0 : _api$table.sharedState.currentState();
450
+ const tableNode = createTableWithWidth({
451
+ isTableScalingEnabled: options === null || options === void 0 ? void 0 : options.isTableScalingEnabled,
452
+ isTableAlignmentEnabled: options === null || options === void 0 ? void 0 : options.isTableAlignmentEnabled,
453
+ isFullWidthModeEnabled: tableState === null || tableState === void 0 ? void 0 : tableState.isFullWidthModeEnabled
454
+ })(state.schema);
455
+ const tr = insert(tableNode);
456
+ editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent({
457
+ action: ACTION.INSERTED,
458
+ actionSubject: ACTION_SUBJECT.DOCUMENT,
459
+ actionSubjectId: ACTION_SUBJECT_ID.TABLE,
460
+ attributes: {
461
+ inputMethod: INPUT_METHOD.QUICK_INSERT,
462
+ localId: tableNode.attrs.localId
463
+ },
464
+ eventType: EVENT_TYPE.TRACK
465
+ })(tr);
466
+ return tr;
467
+ }
468
+ }];
469
+ },
467
470
  floatingToolbar: getToolbarConfig(defaultGetEditorContainerWidth, editorAnalyticsAPI, (options === null || options === void 0 ? void 0 : options.getEditorFeatureFlags) || defaultGetEditorFeatureFlags, () => editorViewRef.current, options, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent)(pluginConfig(options === null || options === void 0 ? void 0 : options.tableOptions))
468
471
  }
469
472
  };
@@ -6,7 +6,7 @@ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
6
6
  import { stopKeyboardColumnResizing } from '../../commands/column-resize';
7
7
  import { updateResizeHandleDecorations } from '../../commands/misc';
8
8
  import { updateColumnWidths } from '../../transforms';
9
- import { getSelectedColumnIndexes } from '../../utils';
9
+ import { getSelectedColumnIndexes, isTableNested } from '../../utils';
10
10
  import { getPluginState as getTablePluginState } from '../plugin-factory';
11
11
  import { META_KEYS } from '../table-analytics';
12
12
  import { evenColumns, setDragging, stopResizing } from './commands';
@@ -154,7 +154,7 @@ export const handleMouseDown = (view, event, localResizeHandlePos, getEditorCont
154
154
  shouldScale = shouldScale && originalTable.attrs.displayMode !== 'fixed';
155
155
  }
156
156
  const resizedDelta = clientX - startX;
157
- if (getBooleanFF('platform.editor.table.colum-resizing-improvements')) {
157
+ if (getBooleanFF('platform.editor.table.colum-resizing-improvements') && !isTableNested(state, tablePos)) {
158
158
  const newResizeState = resizeColumnAndTable(resizeState, colIndex, clientX - startX, dom, originalTable, resizingSelectedColumns ? selectedColumns : undefined, shouldScale);
159
159
  tr = updateColumnWidths(newResizeState, table, start)(tr);
160
160
  tr.setNodeAttribute(start - 1, 'width', newResizeState.tableWidth);
@@ -237,7 +237,7 @@ export const handleMouseDown = (view, event, localResizeHandlePos, getEditorCont
237
237
  if (isTableScalingWithFixedColumnWidthsOptionEnabled) {
238
238
  shouldScale = shouldScale && originalTable.attrs.displayMode !== 'fixed';
239
239
  }
240
- if (getBooleanFF('platform.editor.table.colum-resizing-improvements')) {
240
+ if (getBooleanFF('platform.editor.table.colum-resizing-improvements') && !isTableNested(state, tablePos)) {
241
241
  resizeColumnAndTable(resizeState, colIndex, clientX - dragging.startX, dom, table, undefined, shouldScale, undefined, shouldUseIncreasedScalingPercent);
242
242
  } else {
243
243
  resizeColumn(resizeState, colIndex, clientX - dragging.startX, dom, table, undefined, shouldScale, shouldUseIncreasedScalingPercent);
@@ -1,6 +1,7 @@
1
1
  // Resize a given column by an amount from the current state
2
2
 
3
3
  import { TableCssClassName as ClassName } from '../../../types';
4
+ import { ALIGN_START } from '../../../utils/alignment';
4
5
  import { getTableContainerElementWidth, getTableScalingPercent } from './misc';
5
6
  import { growColumn, shrinkColumn, updateAffectedColumn } from './resize-logic';
6
7
  import { updateColgroup } from './resize-state';
@@ -23,7 +24,7 @@ export const resizeColumnAndTable = (resizeState, colIndex, amount, tableRef, ta
23
24
  const tableWidth = tableRef.clientWidth;
24
25
  const tableContainerWidth = (_tableRef$closest = tableRef.closest('.pm-table-container')) === null || _tableRef$closest === void 0 ? void 0 : _tableRef$closest.clientWidth;
25
26
  const isOverflowed = !!(tableWidth && tableContainerWidth && tableWidth > tableContainerWidth);
26
- let resizeAmount = amount * 2;
27
+ let resizeAmount = tableNode.attrs.layout === ALIGN_START && !isOverflowed ? amount : amount * 2;
27
28
 
28
29
  // todo: reimplement - use getTableScalingPercentFrozen to get scaled percent before table width changes dynamically
29
30
  // let scalePercent = 1;
@@ -206,6 +206,7 @@ export var TableResizer = function TableResizer(_ref) {
206
206
  tableLocalId: node.attrs.localId,
207
207
  tableRef: tableRef
208
208
  });
209
+ tr.setMeta('is-resizer-resizing', true);
209
210
  tr.setMeta(META_KEYS.OVERFLOW_TRIGGER, {
210
211
  name: TABLE_OVERFLOW_CHANGE_TRIGGER.RESIZED
211
212
  });
@@ -271,6 +272,7 @@ export var TableResizer = function TableResizer(_ref) {
271
272
  tableLocalId: '',
272
273
  tableRef: null
273
274
  });
275
+ tr.setMeta('is-resizer-resizing', false);
274
276
  var frameRateSamples = endMeasure();
275
277
  if (frameRateSamples.length > 0) {
276
278
  var resizeFrameRatePayloads = generateResizeFrameRatePayloads({
@@ -431,13 +431,14 @@ var tablesPlugin = function tablesPlugin(_ref) {
431
431
  },
432
432
  pluginsOptions: {
433
433
  quickInsert: function quickInsert(_ref19) {
434
+ var _options$getEditorFea3;
434
435
  var formatMessage = _ref19.formatMessage;
435
436
  return [{
436
437
  id: 'table',
437
438
  title: formatMessage(messages.table),
438
439
  description: formatMessage(messages.tableDescription),
439
440
  keywords: ['cell', 'table'],
440
- priority: 600,
441
+ priority: options !== null && options !== void 0 && (_options$getEditorFea3 = options.getEditorFeatureFlags) !== null && _options$getEditorFea3 !== void 0 && _options$getEditorFea3.call(options).platformEditorTypeaheadImprovedRelevancy ? 800 : 600,
441
442
  keyshortcut: tooltip(toggleTable),
442
443
  icon: function icon() {
443
444
  return /*#__PURE__*/React.createElement(IconTable, null);
@@ -6,7 +6,7 @@ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
6
6
  import { stopKeyboardColumnResizing } from '../../commands/column-resize';
7
7
  import { updateResizeHandleDecorations } from '../../commands/misc';
8
8
  import { updateColumnWidths } from '../../transforms';
9
- import { getSelectedColumnIndexes } from '../../utils';
9
+ import { getSelectedColumnIndexes, isTableNested } from '../../utils';
10
10
  import { getPluginState as getTablePluginState } from '../plugin-factory';
11
11
  import { META_KEYS } from '../table-analytics';
12
12
  import { evenColumns, setDragging, stopResizing } from './commands';
@@ -141,7 +141,7 @@ export var handleMouseDown = function handleMouseDown(view, event, localResizeHa
141
141
  _shouldScale = _shouldScale && originalTable.attrs.displayMode !== 'fixed';
142
142
  }
143
143
  var resizedDelta = clientX - startX;
144
- if (getBooleanFF('platform.editor.table.colum-resizing-improvements')) {
144
+ if (getBooleanFF('platform.editor.table.colum-resizing-improvements') && !isTableNested(state, tablePos)) {
145
145
  var newResizeState = resizeColumnAndTable(resizeState, colIndex, clientX - startX, dom, originalTable, resizingSelectedColumns ? selectedColumns : undefined, _shouldScale);
146
146
  tr = updateColumnWidths(newResizeState, table, start)(tr);
147
147
  tr.setNodeAttribute(start - 1, 'width', newResizeState.tableWidth);
@@ -218,7 +218,7 @@ export var handleMouseDown = function handleMouseDown(view, event, localResizeHa
218
218
  if (isTableScalingWithFixedColumnWidthsOptionEnabled) {
219
219
  shouldScale = shouldScale && originalTable.attrs.displayMode !== 'fixed';
220
220
  }
221
- if (getBooleanFF('platform.editor.table.colum-resizing-improvements')) {
221
+ if (getBooleanFF('platform.editor.table.colum-resizing-improvements') && !isTableNested(state, tablePos)) {
222
222
  resizeColumnAndTable(resizeState, colIndex, clientX - dragging.startX, dom, table, undefined, shouldScale, undefined, shouldUseIncreasedScalingPercent);
223
223
  } else {
224
224
  resizeColumn(resizeState, colIndex, clientX - dragging.startX, dom, table, undefined, shouldScale, shouldUseIncreasedScalingPercent);
@@ -4,6 +4,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
4
4
  // Resize a given column by an amount from the current state
5
5
 
6
6
  import { TableCssClassName as ClassName } from '../../../types';
7
+ import { ALIGN_START } from '../../../utils/alignment';
7
8
  import { getTableContainerElementWidth, getTableScalingPercent } from './misc';
8
9
  import { growColumn, shrinkColumn, updateAffectedColumn } from './resize-logic';
9
10
  import { updateColgroup } from './resize-state';
@@ -31,7 +32,7 @@ export var resizeColumnAndTable = function resizeColumnAndTable(resizeState, col
31
32
  var tableWidth = tableRef.clientWidth;
32
33
  var tableContainerWidth = (_tableRef$closest = tableRef.closest('.pm-table-container')) === null || _tableRef$closest === void 0 ? void 0 : _tableRef$closest.clientWidth;
33
34
  var isOverflowed = !!(tableWidth && tableContainerWidth && tableWidth > tableContainerWidth);
34
- var resizeAmount = amount * 2;
35
+ var resizeAmount = tableNode.attrs.layout === ALIGN_START && !isOverflowed ? amount : amount * 2;
35
36
 
36
37
  // todo: reimplement - use getTableScalingPercentFrozen to get scaled percent before table width changes dynamically
37
38
  // let scalePercent = 1;
@@ -116,6 +116,10 @@ export declare const ColumnControls: ({ editorView, tableActive, tableRef, hover
116
116
  to: number;
117
117
  mark: import("prosemirror-model").Mark;
118
118
  }) => boolean;
119
+ addInlineCommentNodeMark: (props: {
120
+ pos: number;
121
+ mark: import("prosemirror-model").Mark;
122
+ }) => boolean;
119
123
  isRemoteReplaceDocumentTransaction: (tr: import("prosemirror-state").Transaction) => boolean;
120
124
  };
121
125
  }, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>];
@@ -220,6 +224,10 @@ export declare const ColumnControls: ({ editorView, tableActive, tableRef, hover
220
224
  to: number;
221
225
  mark: import("prosemirror-model").Mark;
222
226
  }) => boolean;
227
+ addInlineCommentNodeMark: (props: {
228
+ pos: number;
229
+ mark: import("prosemirror-model").Mark;
230
+ }) => boolean;
223
231
  isRemoteReplaceDocumentTransaction: (tr: import("prosemirror-state").Transaction) => boolean;
224
232
  };
225
233
  }, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>];
@@ -97,6 +97,10 @@ export declare const DragCornerControlsWithSelection: React.FC<import("react-int
97
97
  to: number;
98
98
  mark: import("prosemirror-model").Mark;
99
99
  }) => boolean;
100
+ addInlineCommentNodeMark: (props: {
101
+ pos: number;
102
+ mark: import("prosemirror-model").Mark;
103
+ }) => boolean;
100
104
  isRemoteReplaceDocumentTransaction: (tr: import("prosemirror-state").Transaction) => boolean;
101
105
  };
102
106
  }, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>];
@@ -201,6 +205,10 @@ export declare const DragCornerControlsWithSelection: React.FC<import("react-int
201
205
  to: number;
202
206
  mark: import("prosemirror-model").Mark;
203
207
  }) => boolean;
208
+ addInlineCommentNodeMark: (props: {
209
+ pos: number;
210
+ mark: import("prosemirror-model").Mark;
211
+ }) => boolean;
204
212
  isRemoteReplaceDocumentTransaction: (tr: import("prosemirror-state").Transaction) => boolean;
205
213
  };
206
214
  }, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>];
@@ -316,6 +324,10 @@ export declare const DragCornerControlsWithSelection: React.FC<import("react-int
316
324
  to: number;
317
325
  mark: import("prosemirror-model").Mark;
318
326
  }) => boolean;
327
+ addInlineCommentNodeMark: (props: {
328
+ pos: number;
329
+ mark: import("prosemirror-model").Mark;
330
+ }) => boolean;
319
331
  isRemoteReplaceDocumentTransaction: (tr: import("prosemirror-state").Transaction) => boolean;
320
332
  };
321
333
  }, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>];
@@ -420,6 +432,10 @@ export declare const DragCornerControlsWithSelection: React.FC<import("react-int
420
432
  to: number;
421
433
  mark: import("prosemirror-model").Mark;
422
434
  }) => boolean;
435
+ addInlineCommentNodeMark: (props: {
436
+ pos: number;
437
+ mark: import("prosemirror-model").Mark;
438
+ }) => boolean;
423
439
  isRemoteReplaceDocumentTransaction: (tr: import("prosemirror-state").Transaction) => boolean;
424
440
  };
425
441
  }, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>];
@@ -125,6 +125,10 @@ export declare const TableFloatingControls: ({ editorView, tableRef, tableNode,
125
125
  to: number;
126
126
  mark: import("prosemirror-model").Mark;
127
127
  }) => boolean;
128
+ addInlineCommentNodeMark: (props: {
129
+ pos: number;
130
+ mark: import("prosemirror-model").Mark;
131
+ }) => boolean;
128
132
  isRemoteReplaceDocumentTransaction: (tr: import("prosemirror-state").Transaction) => boolean;
129
133
  };
130
134
  }, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>];
@@ -229,6 +233,10 @@ export declare const TableFloatingControls: ({ editorView, tableRef, tableNode,
229
233
  to: number;
230
234
  mark: import("prosemirror-model").Mark;
231
235
  }) => boolean;
236
+ addInlineCommentNodeMark: (props: {
237
+ pos: number;
238
+ mark: import("prosemirror-model").Mark;
239
+ }) => boolean;
232
240
  isRemoteReplaceDocumentTransaction: (tr: import("prosemirror-state").Transaction) => boolean;
233
241
  };
234
242
  }, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>];
@@ -140,6 +140,10 @@ export declare const ColumnControls: ({ editorView, tableActive, tableRef, hover
140
140
  to: number;
141
141
  mark: import("prosemirror-model").Mark;
142
142
  }) => boolean;
143
+ addInlineCommentNodeMark: (props: {
144
+ pos: number;
145
+ mark: import("prosemirror-model").Mark;
146
+ }) => boolean;
143
147
  isRemoteReplaceDocumentTransaction: (tr: import("prosemirror-state").Transaction) => boolean;
144
148
  };
145
149
  }, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>
@@ -270,6 +274,10 @@ export declare const ColumnControls: ({ editorView, tableActive, tableRef, hover
270
274
  to: number;
271
275
  mark: import("prosemirror-model").Mark;
272
276
  }) => boolean;
277
+ addInlineCommentNodeMark: (props: {
278
+ pos: number;
279
+ mark: import("prosemirror-model").Mark;
280
+ }) => boolean;
273
281
  isRemoteReplaceDocumentTransaction: (tr: import("prosemirror-state").Transaction) => boolean;
274
282
  };
275
283
  }, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>
@@ -121,6 +121,10 @@ export declare const DragCornerControlsWithSelection: React.FC<import("react-int
121
121
  to: number;
122
122
  mark: import("prosemirror-model").Mark;
123
123
  }) => boolean;
124
+ addInlineCommentNodeMark: (props: {
125
+ pos: number;
126
+ mark: import("prosemirror-model").Mark;
127
+ }) => boolean;
124
128
  isRemoteReplaceDocumentTransaction: (tr: import("prosemirror-state").Transaction) => boolean;
125
129
  };
126
130
  }, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>
@@ -251,6 +255,10 @@ export declare const DragCornerControlsWithSelection: React.FC<import("react-int
251
255
  to: number;
252
256
  mark: import("prosemirror-model").Mark;
253
257
  }) => boolean;
258
+ addInlineCommentNodeMark: (props: {
259
+ pos: number;
260
+ mark: import("prosemirror-model").Mark;
261
+ }) => boolean;
254
262
  isRemoteReplaceDocumentTransaction: (tr: import("prosemirror-state").Transaction) => boolean;
255
263
  };
256
264
  }, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>
@@ -393,6 +401,10 @@ export declare const DragCornerControlsWithSelection: React.FC<import("react-int
393
401
  to: number;
394
402
  mark: import("prosemirror-model").Mark;
395
403
  }) => boolean;
404
+ addInlineCommentNodeMark: (props: {
405
+ pos: number;
406
+ mark: import("prosemirror-model").Mark;
407
+ }) => boolean;
396
408
  isRemoteReplaceDocumentTransaction: (tr: import("prosemirror-state").Transaction) => boolean;
397
409
  };
398
410
  }, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>
@@ -523,6 +535,10 @@ export declare const DragCornerControlsWithSelection: React.FC<import("react-int
523
535
  to: number;
524
536
  mark: import("prosemirror-model").Mark;
525
537
  }) => boolean;
538
+ addInlineCommentNodeMark: (props: {
539
+ pos: number;
540
+ mark: import("prosemirror-model").Mark;
541
+ }) => boolean;
526
542
  isRemoteReplaceDocumentTransaction: (tr: import("prosemirror-state").Transaction) => boolean;
527
543
  };
528
544
  }, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>
@@ -149,6 +149,10 @@ export declare const TableFloatingControls: ({ editorView, tableRef, tableNode,
149
149
  to: number;
150
150
  mark: import("prosemirror-model").Mark;
151
151
  }) => boolean;
152
+ addInlineCommentNodeMark: (props: {
153
+ pos: number;
154
+ mark: import("prosemirror-model").Mark;
155
+ }) => boolean;
152
156
  isRemoteReplaceDocumentTransaction: (tr: import("prosemirror-state").Transaction) => boolean;
153
157
  };
154
158
  }, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>
@@ -279,6 +283,10 @@ export declare const TableFloatingControls: ({ editorView, tableRef, tableNode,
279
283
  to: number;
280
284
  mark: import("prosemirror-model").Mark;
281
285
  }) => boolean;
286
+ addInlineCommentNodeMark: (props: {
287
+ pos: number;
288
+ mark: import("prosemirror-model").Mark;
289
+ }) => boolean;
282
290
  isRemoteReplaceDocumentTransaction: (tr: import("prosemirror-state").Transaction) => boolean;
283
291
  };
284
292
  }, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>
package/package.json CHANGED
@@ -1,148 +1,137 @@
1
1
  {
2
- "name": "@atlaskit/editor-plugin-table",
3
- "version": "7.17.1",
4
- "description": "Table plugin for the @atlaskit/editor",
5
- "publishConfig": {
6
- "registry": "https://registry.npmjs.org/"
7
- },
8
- "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
9
- "author": "Atlassian Pty Ltd",
10
- "main": "dist/cjs/index.js",
11
- "module": "dist/esm/index.js",
12
- "module:es2019": "dist/es2019/index.js",
13
- "types": "dist/types/index.d.ts",
14
- "typesVersions": {
15
- ">=4.5 <4.9": {
16
- "*": [
17
- "dist/types-ts4.5/*",
18
- "dist/types-ts4.5/index.d.ts"
19
- ]
20
- }
21
- },
22
- "sideEffects": false,
23
- "atlaskit:src": "src/index.ts",
24
- "atlassian": {
25
- "team": "Editor: Jenga",
26
- "singleton": true,
27
- "releaseModel": "continuous",
28
- "runReact18": false
29
- },
30
- "dependencies": {
31
- "@atlaskit/adf-schema": "^36.10.7",
32
- "@atlaskit/button": "^17.17.0",
33
- "@atlaskit/custom-steps": "^0.2.0",
34
- "@atlaskit/editor-common": "^82.4.0",
35
- "@atlaskit/editor-palette": "1.6.0",
36
- "@atlaskit/editor-plugin-accessibility-utils": "^1.1.0",
37
- "@atlaskit/editor-plugin-analytics": "^1.2.0",
38
- "@atlaskit/editor-plugin-content-insertion": "^1.2.0",
39
- "@atlaskit/editor-plugin-editor-viewmode": "^1.1.0",
40
- "@atlaskit/editor-plugin-guideline": "^1.1.0",
41
- "@atlaskit/editor-plugin-selection": "^1.2.0",
42
- "@atlaskit/editor-plugin-width": "^1.1.0",
43
- "@atlaskit/editor-prosemirror": "4.0.1",
44
- "@atlaskit/editor-shared-styles": "^2.12.0",
45
- "@atlaskit/editor-tables": "^2.7.0",
46
- "@atlaskit/icon": "^22.3.0",
47
- "@atlaskit/menu": "^2.4.0",
48
- "@atlaskit/platform-feature-flags": "^0.2.1",
49
- "@atlaskit/pragmatic-drag-and-drop": "^1.1.0",
50
- "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^1.3.0",
51
- "@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.0.0",
52
- "@atlaskit/primitives": "^7.0.0",
53
- "@atlaskit/theme": "^12.9.0",
54
- "@atlaskit/toggle": "^13.1.0",
55
- "@atlaskit/tokens": "^1.50.0",
56
- "@atlaskit/tooltip": "^18.4.0",
57
- "@babel/runtime": "^7.0.0",
58
- "@emotion/react": "^11.7.1",
59
- "classnames": "^2.2.5",
60
- "lodash": "^4.17.21",
61
- "memoize-one": "^6.0.0",
62
- "raf-schd": "^4.0.3"
63
- },
64
- "peerDependencies": {
65
- "react": "^16.8.0",
66
- "react-dom": "^16.8.0",
67
- "react-intl-next": "npm:react-intl@^5.18.1"
68
- },
69
- "devDependencies": {
70
- "typescript": "~5.4.2"
71
- },
72
- "af:exports": {
73
- "./types": "./src/types.ts",
74
- ".": "./src/index.ts",
75
- "./ui/common-styles": "./src/ui/common-styles.ts",
76
- "./ui/consts": "./src/ui/consts.ts",
77
- "./plugin-key": "./src/pm-plugins/plugin-key.ts",
78
- "./commands": "./src/commands/index.ts"
79
- },
80
- "techstack": {
81
- "@atlassian/frontend": {
82
- "import-structure": [
83
- "atlassian-conventions"
84
- ],
85
- "circular-dependencies": [
86
- "file-and-folder-level"
87
- ]
88
- },
89
- "@repo/internal": {
90
- "design-tokens": [
91
- "color"
92
- ],
93
- "deprecation": "no-deprecated-imports",
94
- "styling": [
95
- "emotion"
96
- ]
97
- }
98
- },
99
- "stricter": {
100
- "no-unused-dependencies": {
101
- "checkDevDependencies": true
102
- }
103
- },
104
- "platform-feature-flags": {
105
- "platform.editor.table.insert-last-column-btn-stays-in-place": {
106
- "type": "boolean"
107
- },
108
- "platform.editor.table.drag-move-options-logic-update_fp7xw": {
109
- "type": "boolean"
110
- },
111
- "platform.editor.a11y-table-resizing_uapcv": {
112
- "type": "boolean"
113
- },
114
- "platform.editor.a11y-column-resizing_emcvz": {
115
- "type": "boolean"
116
- },
117
- "platform.editor.a11y-help-dialog-shortcut-keys-position_aghfg": {
118
- "type": "boolean"
119
- },
120
- "platform.editor.transform-slice-for-nested-expand": {
121
- "type": "boolean"
122
- },
123
- "platform.editor.table.cmd-a-select-table": {
124
- "type": "boolean"
125
- },
126
- "platform.editor.table.use-shared-state-hook": {
127
- "type": "boolean"
128
- },
129
- "platform.editor.a11y-table-floating-toolbar-dropdown-menu_zkb33": {
130
- "type": "boolean"
131
- },
132
- "platform.editor.table.colum-resizing-improvements": {
133
- "type": "boolean"
134
- },
135
- "platform.editor.table.use-increased-scaling-percent": {
136
- "type": "boolean"
137
- },
138
- "platform.editor.explicit-html-element-check": {
139
- "type": "boolean"
140
- },
141
- "platform.editor.table.live-pages-sorting_4malx": {
142
- "type": "boolean"
143
- },
144
- "platform.editor.table.editor-num-col-style-changes": {
145
- "type": "boolean"
146
- }
147
- }
148
- }
2
+ "name": "@atlaskit/editor-plugin-table",
3
+ "version": "7.17.2",
4
+ "description": "Table plugin for the @atlaskit/editor",
5
+ "publishConfig": {
6
+ "registry": "https://registry.npmjs.org/"
7
+ },
8
+ "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
9
+ "author": "Atlassian Pty Ltd",
10
+ "main": "dist/cjs/index.js",
11
+ "module": "dist/esm/index.js",
12
+ "module:es2019": "dist/es2019/index.js",
13
+ "types": "dist/types/index.d.ts",
14
+ "typesVersions": {
15
+ ">=4.5 <4.9": {
16
+ "*": ["dist/types-ts4.5/*", "dist/types-ts4.5/index.d.ts"]
17
+ }
18
+ },
19
+ "sideEffects": false,
20
+ "atlaskit:src": "src/index.ts",
21
+ "atlassian": {
22
+ "team": "Editor: Jenga",
23
+ "singleton": true,
24
+ "releaseModel": "continuous",
25
+ "runReact18": false
26
+ },
27
+ "dependencies": {
28
+ "@atlaskit/adf-schema": "^36.10.7",
29
+ "@atlaskit/button": "^17.17.0",
30
+ "@atlaskit/custom-steps": "^0.2.0",
31
+ "@atlaskit/editor-common": "^82.6.0",
32
+ "@atlaskit/editor-palette": "1.6.0",
33
+ "@atlaskit/editor-plugin-accessibility-utils": "^1.1.0",
34
+ "@atlaskit/editor-plugin-analytics": "^1.2.0",
35
+ "@atlaskit/editor-plugin-content-insertion": "^1.2.0",
36
+ "@atlaskit/editor-plugin-editor-viewmode": "^1.2.0",
37
+ "@atlaskit/editor-plugin-guideline": "^1.1.0",
38
+ "@atlaskit/editor-plugin-selection": "^1.2.0",
39
+ "@atlaskit/editor-plugin-width": "^1.1.0",
40
+ "@atlaskit/editor-prosemirror": "4.0.1",
41
+ "@atlaskit/editor-shared-styles": "^2.12.0",
42
+ "@atlaskit/editor-tables": "^2.7.0",
43
+ "@atlaskit/icon": "^22.3.0",
44
+ "@atlaskit/menu": "^2.4.0",
45
+ "@atlaskit/platform-feature-flags": "^0.2.1",
46
+ "@atlaskit/pragmatic-drag-and-drop": "^1.1.0",
47
+ "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^1.3.0",
48
+ "@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.0.0",
49
+ "@atlaskit/primitives": "^7.2.0",
50
+ "@atlaskit/theme": "^12.9.0",
51
+ "@atlaskit/toggle": "^13.1.0",
52
+ "@atlaskit/tokens": "^1.50.0",
53
+ "@atlaskit/tooltip": "^18.4.0",
54
+ "@babel/runtime": "^7.0.0",
55
+ "@emotion/react": "^11.7.1",
56
+ "classnames": "^2.2.5",
57
+ "lodash": "^4.17.21",
58
+ "memoize-one": "^6.0.0",
59
+ "raf-schd": "^4.0.3"
60
+ },
61
+ "peerDependencies": {
62
+ "react": "^16.8.0",
63
+ "react-dom": "^16.8.0",
64
+ "react-intl-next": "npm:react-intl@^5.18.1"
65
+ },
66
+ "devDependencies": {
67
+ "typescript": "~5.4.2"
68
+ },
69
+ "af:exports": {
70
+ "./types": "./src/types.ts",
71
+ ".": "./src/index.ts",
72
+ "./ui/common-styles": "./src/ui/common-styles.ts",
73
+ "./ui/consts": "./src/ui/consts.ts",
74
+ "./plugin-key": "./src/pm-plugins/plugin-key.ts",
75
+ "./commands": "./src/commands/index.ts"
76
+ },
77
+ "techstack": {
78
+ "@atlassian/frontend": {
79
+ "import-structure": ["atlassian-conventions"],
80
+ "circular-dependencies": ["file-and-folder-level"]
81
+ },
82
+ "@repo/internal": {
83
+ "design-tokens": ["color"],
84
+ "deprecation": "no-deprecated-imports",
85
+ "styling": ["emotion"]
86
+ }
87
+ },
88
+ "stricter": {
89
+ "no-unused-dependencies": {
90
+ "checkDevDependencies": true
91
+ }
92
+ },
93
+ "platform-feature-flags": {
94
+ "platform.editor.table.insert-last-column-btn-stays-in-place": {
95
+ "type": "boolean"
96
+ },
97
+ "platform.editor.table.drag-move-options-logic-update_fp7xw": {
98
+ "type": "boolean"
99
+ },
100
+ "platform.editor.a11y-table-resizing_uapcv": {
101
+ "type": "boolean"
102
+ },
103
+ "platform.editor.a11y-column-resizing_emcvz": {
104
+ "type": "boolean"
105
+ },
106
+ "platform.editor.a11y-help-dialog-shortcut-keys-position_aghfg": {
107
+ "type": "boolean"
108
+ },
109
+ "platform.editor.transform-slice-for-nested-expand": {
110
+ "type": "boolean"
111
+ },
112
+ "platform.editor.table.cmd-a-select-table": {
113
+ "type": "boolean"
114
+ },
115
+ "platform.editor.table.use-shared-state-hook": {
116
+ "type": "boolean"
117
+ },
118
+ "platform.editor.a11y-table-floating-toolbar-dropdown-menu_zkb33": {
119
+ "type": "boolean"
120
+ },
121
+ "platform.editor.table.colum-resizing-improvements": {
122
+ "type": "boolean"
123
+ },
124
+ "platform.editor.table.use-increased-scaling-percent": {
125
+ "type": "boolean"
126
+ },
127
+ "platform.editor.explicit-html-element-check": {
128
+ "type": "boolean"
129
+ },
130
+ "platform.editor.table.live-pages-sorting_4malx": {
131
+ "type": "boolean"
132
+ },
133
+ "platform.editor.table.editor-num-col-style-changes": {
134
+ "type": "boolean"
135
+ }
136
+ }
137
+ }
@@ -350,6 +350,8 @@ export const TableResizer = ({
350
350
  tableLocalId: node.attrs.localId,
351
351
  tableRef: tableRef,
352
352
  });
353
+ tr.setMeta('is-resizer-resizing', true);
354
+
353
355
  tr.setMeta(META_KEYS.OVERFLOW_TRIGGER, {
354
356
  name: TABLE_OVERFLOW_CHANGE_TRIGGER.RESIZED,
355
357
  });
@@ -507,6 +509,7 @@ export const TableResizer = ({
507
509
  tableLocalId: '',
508
510
  tableRef: null,
509
511
  });
512
+ tr.setMeta('is-resizer-resizing', false);
510
513
  const frameRateSamples = endMeasure();
511
514
 
512
515
  if (frameRateSamples.length > 0) {
package/src/plugin.tsx CHANGED
@@ -639,7 +639,9 @@ const tablesPlugin: TablePlugin = ({ config: options, api }) => {
639
639
  title: formatMessage(messages.table),
640
640
  description: formatMessage(messages.tableDescription),
641
641
  keywords: ['cell', 'table'],
642
- priority: 600,
642
+ priority: options?.getEditorFeatureFlags?.().platformEditorTypeaheadImprovedRelevancy
643
+ ? 800
644
+ : 600,
643
645
  keyshortcut: tooltip(toggleTable),
644
646
  icon: () => <IconTable />,
645
647
  action(insert, state) {
@@ -17,7 +17,7 @@ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
17
17
  import { stopKeyboardColumnResizing } from '../../commands/column-resize';
18
18
  import { updateResizeHandleDecorations } from '../../commands/misc';
19
19
  import { updateColumnWidths } from '../../transforms';
20
- import { getSelectedColumnIndexes } from '../../utils';
20
+ import { getSelectedColumnIndexes, isTableNested } from '../../utils';
21
21
  import { getPluginState as getTablePluginState } from '../plugin-factory';
22
22
  import { META_KEYS } from '../table-analytics';
23
23
 
@@ -192,7 +192,10 @@ export const handleMouseDown = (
192
192
 
193
193
  const resizedDelta = clientX - startX;
194
194
 
195
- if (getBooleanFF('platform.editor.table.colum-resizing-improvements')) {
195
+ if (
196
+ getBooleanFF('platform.editor.table.colum-resizing-improvements') &&
197
+ !isTableNested(state, tablePos)
198
+ ) {
196
199
  const newResizeState = resizeColumnAndTable(
197
200
  resizeState,
198
201
  colIndex,
@@ -297,7 +300,10 @@ export const handleMouseDown = (
297
300
  shouldScale = shouldScale && originalTable.attrs.displayMode !== 'fixed';
298
301
  }
299
302
 
300
- if (getBooleanFF('platform.editor.table.colum-resizing-improvements')) {
303
+ if (
304
+ getBooleanFF('platform.editor.table.colum-resizing-improvements') &&
305
+ !isTableNested(state, tablePos)
306
+ ) {
301
307
  resizeColumnAndTable(
302
308
  resizeState,
303
309
  colIndex,
@@ -2,6 +2,7 @@
2
2
  import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
3
3
 
4
4
  import { TableCssClassName as ClassName } from '../../../types';
5
+ import { ALIGN_START } from '../../../utils/alignment';
5
6
 
6
7
  import { getTableContainerElementWidth, getTableScalingPercent } from './misc';
7
8
  import { growColumn, shrinkColumn, updateAffectedColumn } from './resize-logic';
@@ -61,7 +62,7 @@ export const resizeColumnAndTable = (
61
62
  const tableContainerWidth = tableRef.closest('.pm-table-container')?.clientWidth;
62
63
 
63
64
  const isOverflowed = !!(tableWidth && tableContainerWidth && tableWidth > tableContainerWidth);
64
- let resizeAmount = amount * 2;
65
+ let resizeAmount = tableNode.attrs.layout === ALIGN_START && !isOverflowed ? amount : amount * 2;
65
66
 
66
67
  // todo: reimplement - use getTableScalingPercentFrozen to get scaled percent before table width changes dynamically
67
68
  // let scalePercent = 1;