@atlaskit/editor-plugin-table 22.2.7 → 22.2.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,15 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 22.2.8
4
+
5
+ ### Patch Changes
6
+
7
+ - [`bc415f8eb86a9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bc415f8eb86a9) -
8
+ Add OR check with create_work_item_modernization_exp experiment to
9
+ platform_editor_fix_scrolling_popup_position, platform_editor_table_resize_chromeless, and
10
+ platform_editor_chromeless_akeditor_class usages
11
+ - Updated dependencies
12
+
3
13
  ## 22.2.7
4
14
 
5
15
  ### Patch Changes
@@ -238,7 +238,7 @@ var ResizableTableContainer = exports.ResizableTableContainer = /*#__PURE__*/_re
238
238
  }
239
239
  } else if (isCommentEditor) {
240
240
  responsiveContainerWidth = containerWidth - _consts.TABLE_OFFSET_IN_COMMENT_EDITOR;
241
- } else if (isChromelessEditor && (0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true)) {
241
+ } else if (isChromelessEditor && ((0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true) || (0, _expValEquals.expValEquals)('create_work_item_modernization_exp', 'isEnabled', true))) {
242
242
  // there's no padding included in chromeless appearance, so we need to reduce table
243
243
  // width to ensure all controls are visible.
244
244
  // use lineLength as the value is updated by scrollbar visibility changes
@@ -255,13 +255,13 @@ var ResizableTableContainer = exports.ResizableTableContainer = /*#__PURE__*/_re
255
255
  // For wide tables, ensure they don't exceed container width and can be scrolled
256
256
  var calculatedWidth =
257
257
  // remove isCommentEditor check if platform_editor_table_resize_chromeless is cleaned up
258
- !node.attrs.width && ((0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true) && !isFullPageAppearance || isCommentEditor) ? responsiveContainerWidth : Math.min(tableWidth, responsiveContainerWidth);
258
+ !node.attrs.width && (((0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true) || (0, _expValEquals.expValEquals)('create_work_item_modernization_exp', 'isEnabled', true)) && !isFullPageAppearance || isCommentEditor) ? responsiveContainerWidth : Math.min(tableWidth, responsiveContainerWidth);
259
259
 
260
260
  // Ensure minimum width for usability while respecting container constraints
261
261
  var width = Math.max(calculatedWidth, Math.min(responsiveContainerWidth * 0.5, 300));
262
262
 
263
263
  // remove isCommentEditor check if platform_editor_table_resize_chromeless is cleaned up
264
- var maxResizerWidth = (0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true) && !isFullPageAppearance || isCommentEditor ? responsiveContainerWidth : Math.min(responsiveContainerWidth, (0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true) || (0, _expValEquals.expValEquals)('confluence_max_width_content_appearance', 'isEnabled', true) ? _consts.TABLE_MAX_WIDTH : _consts.TABLE_FULL_WIDTH);
264
+ var maxResizerWidth = ((0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true) || (0, _expValEquals.expValEquals)('create_work_item_modernization_exp', 'isEnabled', true)) && !isFullPageAppearance || isCommentEditor ? responsiveContainerWidth : Math.min(responsiveContainerWidth, (0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true) || (0, _expValEquals.expValEquals)('confluence_max_width_content_appearance', 'isEnabled', true) ? _consts.TABLE_MAX_WIDTH : _consts.TABLE_FULL_WIDTH);
265
265
  return {
266
266
  width: width,
267
267
  maxResizerWidth: maxResizerWidth
@@ -305,7 +305,7 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
305
305
  var editorContainerWidth = isFullWidthModeEnabled ? lineLength + 2 * getPadding(containerWidth) : containerWidth;
306
306
  var closestSnap =
307
307
  // remove isCommentEditor check if platform_editor_table_resize_chromeless is cleaned up
308
- ((0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true) && isFullPageAppearance || !isCommentEditor) && (0, _snapping.findClosestSnap)(newWidth, isTableScalingEnabled ? (0, _snapping.defaultTablePreserveSnappingWidths)(_snapping.PRESERVE_TABLE_SNAPPING_LENGTH_OFFSET, editorContainerWidth, excludeGuidelineConfig) : _snapping.defaultSnappingWidths, isTableScalingEnabled ? (0, _guidelines.defaultGuidelinesForPreserveTable)(_guidelines.PRESERVE_TABLE_GUIDELINES_LENGTH_OFFSET, editorContainerWidth, excludeGuidelineConfig) : _guidelines.defaultGuidelines, _consts2.TABLE_HIGHLIGHT_GAP, _consts2.TABLE_HIGHLIGHT_TOLERANCE);
308
+ (((0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true) || (0, _expValEquals.expValEquals)('create_work_item_modernization_exp', 'isEnabled', true)) && isFullPageAppearance || !isCommentEditor) && (0, _snapping.findClosestSnap)(newWidth, isTableScalingEnabled ? (0, _snapping.defaultTablePreserveSnappingWidths)(_snapping.PRESERVE_TABLE_SNAPPING_LENGTH_OFFSET, editorContainerWidth, excludeGuidelineConfig) : _snapping.defaultSnappingWidths, isTableScalingEnabled ? (0, _guidelines.defaultGuidelinesForPreserveTable)(_guidelines.PRESERVE_TABLE_GUIDELINES_LENGTH_OFFSET, editorContainerWidth, excludeGuidelineConfig) : _guidelines.defaultGuidelines, _consts2.TABLE_HIGHLIGHT_GAP, _consts2.TABLE_HIGHLIGHT_TOLERANCE);
309
309
  closestSnap && updateActiveGuidelines(closestSnap);
310
310
 
311
311
  // When snapping to the full width guideline, resize the table to be 1800px
@@ -316,15 +316,15 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
316
316
  return guideline.isFullWidth;
317
317
  })[0];
318
318
  var isFullWidthGuidelineActive = (0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true) || (0, _expValEquals.expValEquals)('confluence_max_width_content_appearance', 'isEnabled', true) ? closestSnap && fullWidthGuideline && closestSnap.keys.includes(fullWidthGuideline.key) : closestSnap && closestSnap.keys.includes(fullWidthGuideline.key);
319
- var tableMaxWidth = (0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true) ? getTableMaxWidth(containerWidth, lineLength, isCommentEditor, isChromelessEditor) : isCommentEditor ? Math.floor(containerWidth - _consts.TABLE_OFFSET_IN_COMMENT_EDITOR) : (0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true) || (0, _expValEquals.expValEquals)('confluence_max_width_content_appearance', 'isEnabled', true) ? _consts.TABLE_MAX_WIDTH : _consts.TABLE_FULL_WIDTH;
320
- var shouldUpdateWidthToWidest = (0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true) && !isFullPageAppearance || isCommentEditor ? tableMaxWidth <= newWidth : !!isTableScalingEnabled && isFullWidthGuidelineActive;
321
- var previewParentWidth = ((0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true) && !isFullPageAppearance || isCommentEditor) && shouldUpdateWidthToWidest ? tableMaxWidth : newWidth;
319
+ var tableMaxWidth = (0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true) || (0, _expValEquals.expValEquals)('create_work_item_modernization_exp', 'isEnabled', true) ? getTableMaxWidth(containerWidth, lineLength, isCommentEditor, isChromelessEditor) : isCommentEditor ? Math.floor(containerWidth - _consts.TABLE_OFFSET_IN_COMMENT_EDITOR) : (0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true) || (0, _expValEquals.expValEquals)('confluence_max_width_content_appearance', 'isEnabled', true) ? _consts.TABLE_MAX_WIDTH : _consts.TABLE_FULL_WIDTH;
320
+ var shouldUpdateWidthToWidest = ((0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true) || (0, _expValEquals.expValEquals)('create_work_item_modernization_exp', 'isEnabled', true)) && !isFullPageAppearance || isCommentEditor ? tableMaxWidth <= newWidth : !!isTableScalingEnabled && isFullWidthGuidelineActive;
321
+ var previewParentWidth = (((0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true) || (0, _expValEquals.expValEquals)('create_work_item_modernization_exp', 'isEnabled', true)) && !isFullPageAppearance || isCommentEditor) && shouldUpdateWidthToWidest ? tableMaxWidth : newWidth;
322
322
  (0, _scaleTable.previewScaleTable)(tableRef, {
323
323
  node: node,
324
324
  prevNode: node,
325
325
  start: pos + 1,
326
326
  parentWidth: previewParentWidth
327
- }, editorView.domAtPos.bind(editorView), isTableScalingEnabled, allowFixedColumnWidthOption, (0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true) ? !isFullPageAppearance : isCommentEditor);
327
+ }, editorView.domAtPos.bind(editorView), isTableScalingEnabled, allowFixedColumnWidthOption, (0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true) || (0, _expValEquals.expValEquals)('create_work_item_modernization_exp', 'isEnabled', true) ? !isFullPageAppearance : isCommentEditor);
328
328
  (0, _commands.chainCommands)(function (state, dispatch) {
329
329
  return switchToCenterAlignment(pos, node, newWidth, state, dispatch);
330
330
  }, (0, _misc.updateWidthToWidest)((0, _defineProperty2.default)({}, currentTableNodeLocalId, shouldUpdateWidthToWidest)))(state, dispatch);
@@ -343,7 +343,7 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
343
343
  dispatch = editorView.dispatch;
344
344
  var pos = getPos();
345
345
  var currentTableNodeLocalId = (_node$attrs$localId2 = node === null || node === void 0 || (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.localId) !== null && _node$attrs$localId2 !== void 0 ? _node$attrs$localId2 : '';
346
- var tableMaxWidth = (0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true) && !isFullPageAppearance || isCommentEditor ? undefined // Table's full-width in comment appearance inherit the width of the Editor/Renderer
346
+ var tableMaxWidth = ((0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true) || (0, _expValEquals.expValEquals)('create_work_item_modernization_exp', 'isEnabled', true)) && !isFullPageAppearance || isCommentEditor ? undefined // Table's full-width in comment appearance inherit the width of the Editor/Renderer
347
347
  : (0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true) || (0, _expValEquals.expValEquals)('confluence_max_width_content_appearance', 'isEnabled', true) ? _consts.TABLE_MAX_WIDTH : _consts.TABLE_FULL_WIDTH;
348
348
  newWidth = widthToWidest && currentTableNodeLocalId && widthToWidest[currentTableNodeLocalId] ? tableMaxWidth : newWidth;
349
349
  var tr = state.tr.setMeta(_tableWidth.pluginKey, {
@@ -385,8 +385,8 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
385
385
  // newWidth can be underined when table is resized to 'full-width'
386
386
  // scaleTable function needs number value to work correctly.
387
387
  // remove isCommentEditor check when platform_editor_table_resize_chromeless is removed
388
- parentWidth: (0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true) && !isFullPageAppearance || isCommentEditor ? originalNewWidth : newWidth
389
- }, editorView.domAtPos.bind(editorView), pluginInjectionApi, isTableScalingEnabled, shouldUseIncreasedScalingPercent || false, (0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true) ? !isFullPageAppearance : isCommentEditor)(tr);
388
+ parentWidth: ((0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true) || (0, _expValEquals.expValEquals)('create_work_item_modernization_exp', 'isEnabled', true)) && !isFullPageAppearance || isCommentEditor ? originalNewWidth : newWidth
389
+ }, editorView.domAtPos.bind(editorView), pluginInjectionApi, isTableScalingEnabled, shouldUseIncreasedScalingPercent || false, (0, _expValEquals.expValEquals)('platform_editor_table_resize_chromeless', 'isEnabled', true) || (0, _expValEquals.expValEquals)('create_work_item_modernization_exp', 'isEnabled', true) ? !isFullPageAppearance : isCommentEditor)(tr);
390
390
 
391
391
  // Ignored via go/ees005
392
392
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
@@ -234,7 +234,7 @@ export const ResizableTableContainer = /*#__PURE__*/React.memo(({
234
234
  }
235
235
  } else if (isCommentEditor) {
236
236
  responsiveContainerWidth = containerWidth - TABLE_OFFSET_IN_COMMENT_EDITOR;
237
- } else if (isChromelessEditor && expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true)) {
237
+ } else if (isChromelessEditor && (expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true))) {
238
238
  // there's no padding included in chromeless appearance, so we need to reduce table
239
239
  // width to ensure all controls are visible.
240
240
  // use lineLength as the value is updated by scrollbar visibility changes
@@ -251,13 +251,13 @@ export const ResizableTableContainer = /*#__PURE__*/React.memo(({
251
251
  // For wide tables, ensure they don't exceed container width and can be scrolled
252
252
  const calculatedWidth =
253
253
  // remove isCommentEditor check if platform_editor_table_resize_chromeless is cleaned up
254
- !node.attrs.width && (expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) && !isFullPageAppearance || isCommentEditor) ? responsiveContainerWidth : Math.min(tableWidth, responsiveContainerWidth);
254
+ !node.attrs.width && ((expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true)) && !isFullPageAppearance || isCommentEditor) ? responsiveContainerWidth : Math.min(tableWidth, responsiveContainerWidth);
255
255
 
256
256
  // Ensure minimum width for usability while respecting container constraints
257
257
  const width = Math.max(calculatedWidth, Math.min(responsiveContainerWidth * 0.5, 300));
258
258
 
259
259
  // remove isCommentEditor check if platform_editor_table_resize_chromeless is cleaned up
260
- const maxResizerWidth = expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) && !isFullPageAppearance || isCommentEditor ? responsiveContainerWidth : Math.min(responsiveContainerWidth, expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true) ? TABLE_MAX_WIDTH : TABLE_FULL_WIDTH);
260
+ const maxResizerWidth = (expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true)) && !isFullPageAppearance || isCommentEditor ? responsiveContainerWidth : Math.min(responsiveContainerWidth, expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true) ? TABLE_MAX_WIDTH : TABLE_FULL_WIDTH);
261
261
  return {
262
262
  width,
263
263
  maxResizerWidth
@@ -298,7 +298,7 @@ export const TableResizer = ({
298
298
  const editorContainerWidth = isFullWidthModeEnabled ? lineLength + 2 * getPadding(containerWidth) : containerWidth;
299
299
  const closestSnap =
300
300
  // remove isCommentEditor check if platform_editor_table_resize_chromeless is cleaned up
301
- (expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) && isFullPageAppearance || !isCommentEditor) && findClosestSnap(newWidth, isTableScalingEnabled ? defaultTablePreserveSnappingWidths(PRESERVE_TABLE_SNAPPING_LENGTH_OFFSET, editorContainerWidth, excludeGuidelineConfig) : defaultSnappingWidths, isTableScalingEnabled ? defaultGuidelinesForPreserveTable(PRESERVE_TABLE_GUIDELINES_LENGTH_OFFSET, editorContainerWidth, excludeGuidelineConfig) : defaultGuidelines, TABLE_HIGHLIGHT_GAP, TABLE_HIGHLIGHT_TOLERANCE);
301
+ ((expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true)) && isFullPageAppearance || !isCommentEditor) && findClosestSnap(newWidth, isTableScalingEnabled ? defaultTablePreserveSnappingWidths(PRESERVE_TABLE_SNAPPING_LENGTH_OFFSET, editorContainerWidth, excludeGuidelineConfig) : defaultSnappingWidths, isTableScalingEnabled ? defaultGuidelinesForPreserveTable(PRESERVE_TABLE_GUIDELINES_LENGTH_OFFSET, editorContainerWidth, excludeGuidelineConfig) : defaultGuidelines, TABLE_HIGHLIGHT_GAP, TABLE_HIGHLIGHT_TOLERANCE);
302
302
  closestSnap && updateActiveGuidelines(closestSnap);
303
303
 
304
304
  // When snapping to the full width guideline, resize the table to be 1800px
@@ -309,15 +309,15 @@ export const TableResizer = ({
309
309
  const currentTableNodeLocalId = (_node$attrs$localId = node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId) !== null && _node$attrs$localId !== void 0 ? _node$attrs$localId : '';
310
310
  const fullWidthGuideline = defaultGuidelinesForPreserveTable(PRESERVE_TABLE_GUIDELINES_LENGTH_OFFSET, editorContainerWidth, excludeGuidelineConfig).filter(guideline => guideline.isFullWidth)[0];
311
311
  const isFullWidthGuidelineActive = expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true) ? closestSnap && fullWidthGuideline && closestSnap.keys.includes(fullWidthGuideline.key) : closestSnap && closestSnap.keys.includes(fullWidthGuideline.key);
312
- const tableMaxWidth = expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) ? getTableMaxWidth(containerWidth, lineLength, isCommentEditor, isChromelessEditor) : isCommentEditor ? Math.floor(containerWidth - TABLE_OFFSET_IN_COMMENT_EDITOR) : expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true) ? TABLE_MAX_WIDTH : TABLE_FULL_WIDTH;
313
- const shouldUpdateWidthToWidest = expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) && !isFullPageAppearance || isCommentEditor ? tableMaxWidth <= newWidth : !!isTableScalingEnabled && isFullWidthGuidelineActive;
314
- const previewParentWidth = (expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) && !isFullPageAppearance || isCommentEditor) && shouldUpdateWidthToWidest ? tableMaxWidth : newWidth;
312
+ const tableMaxWidth = expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true) ? getTableMaxWidth(containerWidth, lineLength, isCommentEditor, isChromelessEditor) : isCommentEditor ? Math.floor(containerWidth - TABLE_OFFSET_IN_COMMENT_EDITOR) : expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true) ? TABLE_MAX_WIDTH : TABLE_FULL_WIDTH;
313
+ const shouldUpdateWidthToWidest = (expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true)) && !isFullPageAppearance || isCommentEditor ? tableMaxWidth <= newWidth : !!isTableScalingEnabled && isFullWidthGuidelineActive;
314
+ const previewParentWidth = ((expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true)) && !isFullPageAppearance || isCommentEditor) && shouldUpdateWidthToWidest ? tableMaxWidth : newWidth;
315
315
  previewScaleTable(tableRef, {
316
316
  node,
317
317
  prevNode: node,
318
318
  start: pos + 1,
319
319
  parentWidth: previewParentWidth
320
- }, editorView.domAtPos.bind(editorView), isTableScalingEnabled, allowFixedColumnWidthOption, expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) ? !isFullPageAppearance : isCommentEditor);
320
+ }, editorView.domAtPos.bind(editorView), isTableScalingEnabled, allowFixedColumnWidthOption, expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true) ? !isFullPageAppearance : isCommentEditor);
321
321
  chainCommands((state, dispatch) => {
322
322
  return switchToCenterAlignment(pos, node, newWidth, state, dispatch);
323
323
  }, updateWidthToWidest({
@@ -338,7 +338,7 @@ export const TableResizer = ({
338
338
  } = editorView;
339
339
  const pos = getPos();
340
340
  const currentTableNodeLocalId = (_node$attrs$localId2 = node === null || node === void 0 ? void 0 : (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.localId) !== null && _node$attrs$localId2 !== void 0 ? _node$attrs$localId2 : '';
341
- const tableMaxWidth = expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) && !isFullPageAppearance || isCommentEditor ? undefined // Table's full-width in comment appearance inherit the width of the Editor/Renderer
341
+ const tableMaxWidth = (expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true)) && !isFullPageAppearance || isCommentEditor ? undefined // Table's full-width in comment appearance inherit the width of the Editor/Renderer
342
342
  : expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true) ? TABLE_MAX_WIDTH : TABLE_FULL_WIDTH;
343
343
  newWidth = widthToWidest && currentTableNodeLocalId && widthToWidest[currentTableNodeLocalId] ? tableMaxWidth : newWidth;
344
344
  let tr = state.tr.setMeta(tableWidthPluginKey, {
@@ -381,8 +381,8 @@ export const TableResizer = ({
381
381
  // newWidth can be underined when table is resized to 'full-width'
382
382
  // scaleTable function needs number value to work correctly.
383
383
  // remove isCommentEditor check when platform_editor_table_resize_chromeless is removed
384
- parentWidth: expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) && !isFullPageAppearance || isCommentEditor ? originalNewWidth : newWidth
385
- }, editorView.domAtPos.bind(editorView), pluginInjectionApi, isTableScalingEnabled, shouldUseIncreasedScalingPercent || false, expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) ? !isFullPageAppearance : isCommentEditor)(tr);
384
+ parentWidth: (expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true)) && !isFullPageAppearance || isCommentEditor ? originalNewWidth : newWidth
385
+ }, editorView.domAtPos.bind(editorView), pluginInjectionApi, isTableScalingEnabled, shouldUseIncreasedScalingPercent || false, expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true) ? !isFullPageAppearance : isCommentEditor)(tr);
386
386
 
387
387
  // Ignored via go/ees005
388
388
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
@@ -229,7 +229,7 @@ export var ResizableTableContainer = /*#__PURE__*/React.memo(function (_ref4) {
229
229
  }
230
230
  } else if (isCommentEditor) {
231
231
  responsiveContainerWidth = containerWidth - TABLE_OFFSET_IN_COMMENT_EDITOR;
232
- } else if (isChromelessEditor && expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true)) {
232
+ } else if (isChromelessEditor && (expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true))) {
233
233
  // there's no padding included in chromeless appearance, so we need to reduce table
234
234
  // width to ensure all controls are visible.
235
235
  // use lineLength as the value is updated by scrollbar visibility changes
@@ -246,13 +246,13 @@ export var ResizableTableContainer = /*#__PURE__*/React.memo(function (_ref4) {
246
246
  // For wide tables, ensure they don't exceed container width and can be scrolled
247
247
  var calculatedWidth =
248
248
  // remove isCommentEditor check if platform_editor_table_resize_chromeless is cleaned up
249
- !node.attrs.width && (expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) && !isFullPageAppearance || isCommentEditor) ? responsiveContainerWidth : Math.min(tableWidth, responsiveContainerWidth);
249
+ !node.attrs.width && ((expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true)) && !isFullPageAppearance || isCommentEditor) ? responsiveContainerWidth : Math.min(tableWidth, responsiveContainerWidth);
250
250
 
251
251
  // Ensure minimum width for usability while respecting container constraints
252
252
  var width = Math.max(calculatedWidth, Math.min(responsiveContainerWidth * 0.5, 300));
253
253
 
254
254
  // remove isCommentEditor check if platform_editor_table_resize_chromeless is cleaned up
255
- var maxResizerWidth = expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) && !isFullPageAppearance || isCommentEditor ? responsiveContainerWidth : Math.min(responsiveContainerWidth, expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true) ? TABLE_MAX_WIDTH : TABLE_FULL_WIDTH);
255
+ var maxResizerWidth = (expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true)) && !isFullPageAppearance || isCommentEditor ? responsiveContainerWidth : Math.min(responsiveContainerWidth, expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true) ? TABLE_MAX_WIDTH : TABLE_FULL_WIDTH);
256
256
  return {
257
257
  width: width,
258
258
  maxResizerWidth: maxResizerWidth
@@ -296,7 +296,7 @@ export var TableResizer = function TableResizer(_ref) {
296
296
  var editorContainerWidth = isFullWidthModeEnabled ? lineLength + 2 * getPadding(containerWidth) : containerWidth;
297
297
  var closestSnap =
298
298
  // remove isCommentEditor check if platform_editor_table_resize_chromeless is cleaned up
299
- (expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) && isFullPageAppearance || !isCommentEditor) && findClosestSnap(newWidth, isTableScalingEnabled ? defaultTablePreserveSnappingWidths(PRESERVE_TABLE_SNAPPING_LENGTH_OFFSET, editorContainerWidth, excludeGuidelineConfig) : defaultSnappingWidths, isTableScalingEnabled ? defaultGuidelinesForPreserveTable(PRESERVE_TABLE_GUIDELINES_LENGTH_OFFSET, editorContainerWidth, excludeGuidelineConfig) : defaultGuidelines, TABLE_HIGHLIGHT_GAP, TABLE_HIGHLIGHT_TOLERANCE);
299
+ ((expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true)) && isFullPageAppearance || !isCommentEditor) && findClosestSnap(newWidth, isTableScalingEnabled ? defaultTablePreserveSnappingWidths(PRESERVE_TABLE_SNAPPING_LENGTH_OFFSET, editorContainerWidth, excludeGuidelineConfig) : defaultSnappingWidths, isTableScalingEnabled ? defaultGuidelinesForPreserveTable(PRESERVE_TABLE_GUIDELINES_LENGTH_OFFSET, editorContainerWidth, excludeGuidelineConfig) : defaultGuidelines, TABLE_HIGHLIGHT_GAP, TABLE_HIGHLIGHT_TOLERANCE);
300
300
  closestSnap && updateActiveGuidelines(closestSnap);
301
301
 
302
302
  // When snapping to the full width guideline, resize the table to be 1800px
@@ -307,15 +307,15 @@ export var TableResizer = function TableResizer(_ref) {
307
307
  return guideline.isFullWidth;
308
308
  })[0];
309
309
  var isFullWidthGuidelineActive = expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true) ? closestSnap && fullWidthGuideline && closestSnap.keys.includes(fullWidthGuideline.key) : closestSnap && closestSnap.keys.includes(fullWidthGuideline.key);
310
- var tableMaxWidth = expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) ? getTableMaxWidth(containerWidth, lineLength, isCommentEditor, isChromelessEditor) : isCommentEditor ? Math.floor(containerWidth - TABLE_OFFSET_IN_COMMENT_EDITOR) : expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true) ? TABLE_MAX_WIDTH : TABLE_FULL_WIDTH;
311
- var shouldUpdateWidthToWidest = expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) && !isFullPageAppearance || isCommentEditor ? tableMaxWidth <= newWidth : !!isTableScalingEnabled && isFullWidthGuidelineActive;
312
- var previewParentWidth = (expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) && !isFullPageAppearance || isCommentEditor) && shouldUpdateWidthToWidest ? tableMaxWidth : newWidth;
310
+ var tableMaxWidth = expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true) ? getTableMaxWidth(containerWidth, lineLength, isCommentEditor, isChromelessEditor) : isCommentEditor ? Math.floor(containerWidth - TABLE_OFFSET_IN_COMMENT_EDITOR) : expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true) ? TABLE_MAX_WIDTH : TABLE_FULL_WIDTH;
311
+ var shouldUpdateWidthToWidest = (expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true)) && !isFullPageAppearance || isCommentEditor ? tableMaxWidth <= newWidth : !!isTableScalingEnabled && isFullWidthGuidelineActive;
312
+ var previewParentWidth = ((expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true)) && !isFullPageAppearance || isCommentEditor) && shouldUpdateWidthToWidest ? tableMaxWidth : newWidth;
313
313
  previewScaleTable(tableRef, {
314
314
  node: node,
315
315
  prevNode: node,
316
316
  start: pos + 1,
317
317
  parentWidth: previewParentWidth
318
- }, editorView.domAtPos.bind(editorView), isTableScalingEnabled, allowFixedColumnWidthOption, expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) ? !isFullPageAppearance : isCommentEditor);
318
+ }, editorView.domAtPos.bind(editorView), isTableScalingEnabled, allowFixedColumnWidthOption, expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true) ? !isFullPageAppearance : isCommentEditor);
319
319
  chainCommands(function (state, dispatch) {
320
320
  return switchToCenterAlignment(pos, node, newWidth, state, dispatch);
321
321
  }, updateWidthToWidest(_defineProperty({}, currentTableNodeLocalId, shouldUpdateWidthToWidest)))(state, dispatch);
@@ -334,7 +334,7 @@ export var TableResizer = function TableResizer(_ref) {
334
334
  dispatch = editorView.dispatch;
335
335
  var pos = getPos();
336
336
  var currentTableNodeLocalId = (_node$attrs$localId2 = node === null || node === void 0 || (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.localId) !== null && _node$attrs$localId2 !== void 0 ? _node$attrs$localId2 : '';
337
- var tableMaxWidth = expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) && !isFullPageAppearance || isCommentEditor ? undefined // Table's full-width in comment appearance inherit the width of the Editor/Renderer
337
+ var tableMaxWidth = (expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true)) && !isFullPageAppearance || isCommentEditor ? undefined // Table's full-width in comment appearance inherit the width of the Editor/Renderer
338
338
  : expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true) ? TABLE_MAX_WIDTH : TABLE_FULL_WIDTH;
339
339
  newWidth = widthToWidest && currentTableNodeLocalId && widthToWidest[currentTableNodeLocalId] ? tableMaxWidth : newWidth;
340
340
  var tr = state.tr.setMeta(tableWidthPluginKey, {
@@ -376,8 +376,8 @@ export var TableResizer = function TableResizer(_ref) {
376
376
  // newWidth can be underined when table is resized to 'full-width'
377
377
  // scaleTable function needs number value to work correctly.
378
378
  // remove isCommentEditor check when platform_editor_table_resize_chromeless is removed
379
- parentWidth: expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) && !isFullPageAppearance || isCommentEditor ? originalNewWidth : newWidth
380
- }, editorView.domAtPos.bind(editorView), pluginInjectionApi, isTableScalingEnabled, shouldUseIncreasedScalingPercent || false, expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) ? !isFullPageAppearance : isCommentEditor)(tr);
379
+ parentWidth: (expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true)) && !isFullPageAppearance || isCommentEditor ? originalNewWidth : newWidth
380
+ }, editorView.domAtPos.bind(editorView), pluginInjectionApi, isTableScalingEnabled, shouldUseIncreasedScalingPercent || false, expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) || expValEquals('create_work_item_modernization_exp', 'isEnabled', true) ? !isFullPageAppearance : isCommentEditor)(tr);
381
381
 
382
382
  // Ignored via go/ees005
383
383
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "22.2.7",
3
+ "version": "22.2.8",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -56,7 +56,7 @@
56
56
  "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
57
57
  "@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.1.0",
58
58
  "@atlaskit/primitives": "^19.0.0",
59
- "@atlaskit/tmp-editor-statsig": "^70.2.0",
59
+ "@atlaskit/tmp-editor-statsig": "^70.5.0",
60
60
  "@atlaskit/toggle": "^15.6.0",
61
61
  "@atlaskit/tokens": "^13.0.0",
62
62
  "@atlaskit/tooltip": "^21.2.0",
@@ -70,7 +70,7 @@
70
70
  "uuid": "^3.1.0"
71
71
  },
72
72
  "peerDependencies": {
73
- "@atlaskit/editor-common": "^114.11.0",
73
+ "@atlaskit/editor-common": "^114.12.0",
74
74
  "react": "^18.2.0",
75
75
  "react-dom": "^18.2.0",
76
76
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"