@atlaskit/editor-plugin-table 11.1.2 → 11.1.4

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.
Files changed (46) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/afm-rovo-extension/tsconfig.json +108 -0
  3. package/dist/cjs/nodeviews/TableContainer.js +8 -3
  4. package/dist/cjs/nodeviews/TableResizer.js +10 -5
  5. package/dist/cjs/nodeviews/toDOM.js +10 -3
  6. package/dist/cjs/pm-plugins/table-resizing/utils/misc.js +6 -1
  7. package/dist/cjs/pm-plugins/utils/snapping.js +9 -2
  8. package/dist/cjs/ui/DragPreview/index.js +2 -0
  9. package/dist/cjs/ui/FloatingAlignmentButtons/FloatingAlignmentButtons.js +2 -0
  10. package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +1 -0
  11. package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +2 -0
  12. package/dist/cjs/ui/TableFullWidthLabel/index.js +2 -0
  13. package/dist/es2019/nodeviews/TableContainer.js +9 -4
  14. package/dist/es2019/nodeviews/TableResizer.js +11 -6
  15. package/dist/es2019/nodeviews/toDOM.js +10 -3
  16. package/dist/es2019/pm-plugins/table-resizing/utils/misc.js +7 -2
  17. package/dist/es2019/pm-plugins/utils/snapping.js +10 -3
  18. package/dist/es2019/ui/DragPreview/index.js +2 -0
  19. package/dist/es2019/ui/FloatingAlignmentButtons/FloatingAlignmentButtons.js +1 -0
  20. package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +1 -0
  21. package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +1 -0
  22. package/dist/es2019/ui/TableFullWidthLabel/index.js +1 -0
  23. package/dist/es2019/ui/toolbar.js +1 -1
  24. package/dist/esm/nodeviews/TableContainer.js +9 -4
  25. package/dist/esm/nodeviews/TableResizer.js +11 -6
  26. package/dist/esm/nodeviews/toDOM.js +10 -3
  27. package/dist/esm/pm-plugins/table-resizing/utils/misc.js +7 -2
  28. package/dist/esm/pm-plugins/utils/snapping.js +10 -3
  29. package/dist/esm/ui/DragPreview/index.js +2 -0
  30. package/dist/esm/ui/FloatingAlignmentButtons/FloatingAlignmentButtons.js +1 -0
  31. package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +1 -0
  32. package/dist/esm/ui/FloatingDragMenu/DragMenu.js +1 -0
  33. package/dist/esm/ui/TableFullWidthLabel/index.js +1 -0
  34. package/dist/esm/ui/toolbar.js +1 -1
  35. package/package.json +4 -4
  36. package/src/nodeviews/TableContainer.tsx +15 -5
  37. package/src/nodeviews/TableResizer.tsx +20 -9
  38. package/src/nodeviews/toDOM.ts +10 -3
  39. package/src/pm-plugins/table-resizing/utils/misc.ts +12 -1
  40. package/src/pm-plugins/utils/snapping.ts +15 -3
  41. package/src/ui/DragPreview/index.tsx +1 -0
  42. package/src/ui/FloatingAlignmentButtons/FloatingAlignmentButtons.tsx +1 -0
  43. package/src/ui/FloatingContextualMenu/ContextualMenu.tsx +1 -0
  44. package/src/ui/FloatingDragMenu/DragMenu.tsx +1 -0
  45. package/src/ui/TableFullWidthLabel/index.tsx +1 -0
  46. package/src/ui/toolbar.tsx +2 -2
@@ -1,14 +1,20 @@
1
1
  import { isVerticalPosition } from '@atlaskit/editor-common/guideline';
2
- import { akEditorCalculatedWideLayoutWidth, akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPaddingDynamic } from '@atlaskit/editor-shared-styles';
2
+ import { akEditorCalculatedWideLayoutWidth, akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPaddingDynamic, akEditorGutterPaddingReduced, akEditorFullPageNarrowBreakout } from '@atlaskit/editor-shared-styles';
3
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
3
4
  const numberOfLanesInDefaultLayoutWidth = 12;
4
5
  const calculateSubSnappingWidths = (totalLanes, totalWidth) => new Array(Math.round(totalLanes / 2) - 1).fill(totalWidth / totalLanes).map((v, i) => v * (i + 1) * 2);
5
6
  export const calculateDefaultSnappings = (lengthOffset = 0) => [...calculateSubSnappingWidths(numberOfLanesInDefaultLayoutWidth, akEditorDefaultLayoutWidth + lengthOffset), akEditorDefaultLayoutWidth + lengthOffset, akEditorCalculatedWideLayoutWidth + lengthOffset, akEditorFullWidthLayoutWidth + lengthOffset];
7
+ const getPadding = editorContainerWith => {
8
+ return editorContainerWith <= akEditorFullPageNarrowBreakout && expValEquals('platform_editor_preview_panel_responsiveness', 'isEnabled', true) ? akEditorGutterPaddingReduced : akEditorGutterPaddingDynamic();
9
+ };
10
+
6
11
  // FF TablePreserve for calculateDefaultSnappings
7
12
  export const calculateDefaultTablePreserveSnappings = (lengthOffset = 0, editorContainerWith = akEditorFullWidthLayoutWidth, exclude = {
8
13
  innerGuidelines: false,
9
14
  breakoutPoints: false
10
15
  }) => {
11
- const dynamicFullWidthLine = editorContainerWith - akEditorGutterPaddingDynamic() * 2 >= akEditorFullWidthLayoutWidth ? akEditorFullWidthLayoutWidth : editorContainerWith - akEditorGutterPaddingDynamic() * 2;
16
+ const padding = getPadding(editorContainerWith);
17
+ const dynamicFullWidthLine = editorContainerWith - padding * 2 >= akEditorFullWidthLayoutWidth ? akEditorFullWidthLayoutWidth : editorContainerWith - padding * 2;
12
18
  const guides = [dynamicFullWidthLine - lengthOffset];
13
19
  if (!exclude.breakoutPoints) {
14
20
  guides.unshift(akEditorDefaultLayoutWidth + lengthOffset, akEditorCalculatedWideLayoutWidth + lengthOffset);
@@ -25,7 +31,8 @@ export const defaultTablePreserveSnappingWidths = (lengthOffset, editorContainer
25
31
  innerGuidelines: false,
26
32
  breakoutPoints: false
27
33
  }) => {
28
- return editorContainerWidth - akEditorGutterPaddingDynamic() * 2 > akEditorFullWidthLayoutWidth ? calculateDefaultSnappings() : calculateDefaultTablePreserveSnappings(lengthOffset, editorContainerWidth, exclude); // lengthOffset was hardcoded 0 here, created PRESERVE_TABLE_SNAPPING_LENGTH_OFFSET instead.
34
+ const padding = getPadding(editorContainerWidth);
35
+ return editorContainerWidth - padding * 2 > akEditorFullWidthLayoutWidth ? calculateDefaultSnappings() : calculateDefaultTablePreserveSnappings(lengthOffset, editorContainerWidth, exclude); // lengthOffset was hardcoded 0 here, created PRESERVE_TABLE_SNAPPING_LENGTH_OFFSET instead.
29
36
  };
30
37
 
31
38
  /**
@@ -1,4 +1,6 @@
1
1
  import React from 'react';
2
+
3
+ // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
2
4
  import { Box, xcss } from '@atlaskit/primitives';
3
5
  import { DragInMotionIcon } from '../icons/DragInMotionIcon';
4
6
  const boxStyles = xcss({
@@ -6,6 +6,7 @@
6
6
  import { jsx } from '@emotion/react';
7
7
  import { ButtonGroup } from '@atlaskit/button';
8
8
  import { FloatingToolbarButton as Button, FloatingToolbarSeparator } from '@atlaskit/editor-common/ui';
9
+ // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
9
10
  import { Box, xcss } from '@atlaskit/primitives';
10
11
  const containerStyles = xcss({
11
12
  marginLeft: 'space.100'
@@ -30,6 +30,7 @@ import TableRowAddBelowIcon from '@atlaskit/icon/core/table-row-add-below';
30
30
  import TableRowDeleteIcon from '@atlaskit/icon/core/table-row-delete';
31
31
  import CrossCircleIcon from '@atlaskit/icon/glyph/cross-circle';
32
32
  import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
33
+ // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
33
34
  import { Box, xcss } from '@atlaskit/primitives';
34
35
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
35
36
  import { clearHoverSelection, hoverColumns, hoverMergedCells, hoverRows, setFocusToCellMenu, toggleContextualMenu } from '../../pm-plugins/commands';
@@ -20,6 +20,7 @@ import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
20
20
  import { TableMap } from '@atlaskit/editor-tables/table-map';
21
21
  import { findCellRectClosestToPos, getSelectionRect, isSelectionType } from '@atlaskit/editor-tables/utils';
22
22
  import PaintBucketIcon from '@atlaskit/icon/core/migration/paint-bucket--editor-background-color';
23
+ // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
23
24
  import { Box, xcss } from '@atlaskit/primitives';
24
25
  import Toggle from '@atlaskit/toggle';
25
26
  import { clearHoverSelection, hoverColumns, hoverRows } from '../../pm-plugins/commands';
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { useIntl } from 'react-intl-next';
3
3
  import { tableMessages as messages } from '@atlaskit/editor-common/messages';
4
+ // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
4
5
  import { Box, Inline, xcss } from '@atlaskit/primitives';
5
6
  const tableFullWidthLabelWrapperStyles = xcss({
6
7
  height: "var(--ds-space-400, 32px)",
@@ -12,7 +12,7 @@ import { addColumnAfter, addRowAfter, backspace, tooltip } from '@atlaskit/edito
12
12
  import commonMessages, { tableMessages as messages } from '@atlaskit/editor-common/messages';
13
13
  import { isSelectionTableNestedInTable } from '@atlaskit/editor-common/nesting';
14
14
  import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
15
- import { cellBackgroundColorPalette, DEFAULT_BORDER_COLOR } from '@atlaskit/editor-common/ui-color';
15
+ import { DEFAULT_BORDER_COLOR, cellBackgroundColorPalette } from '@atlaskit/editor-common/ui-color';
16
16
  import { closestElement, getChildrenInfo, getNodeName, isReferencedSource } from '@atlaskit/editor-common/utils';
17
17
  import { findParentDomRefOfType } from '@atlaskit/editor-prosemirror/utils';
18
18
  import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
@@ -5,8 +5,9 @@ import classNames from 'classnames';
5
5
  import { CHANGE_ALIGNMENT_REASON, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
6
6
  import { sharedPluginStateHookMigratorFactory, useSharedPluginState, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
7
7
  import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
8
- import { akEditorDefaultLayoutWidth, akEditorGutterPaddingDynamic, akEditorMobileBreakoutPoint } from '@atlaskit/editor-shared-styles';
8
+ import { akEditorDefaultLayoutWidth, akEditorGutterPaddingDynamic, akEditorGutterPaddingReduced, akEditorFullPageNarrowBreakout, akEditorMobileBreakoutPoint } from '@atlaskit/editor-shared-styles';
9
9
  import { fg } from '@atlaskit/platform-feature-flags';
10
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
10
11
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
11
12
  import { setTableAlignmentWithTableContentWithPosWithAnalytics } from '../pm-plugins/commands/commands-with-analytics';
12
13
  import { getPluginState } from '../pm-plugins/plugin-factory';
@@ -149,6 +150,9 @@ var useSharedState = sharedPluginStateHookMigratorFactory(function (api) {
149
150
  editorViewModeState: editorViewModeState
150
151
  };
151
152
  });
153
+ var getPadding = function getPadding(containerWidth) {
154
+ return containerWidth <= akEditorFullPageNarrowBreakout && expValEquals('platform_editor_preview_panel_responsiveness', 'isEnabled', true) ? akEditorGutterPaddingReduced : akEditorGutterPaddingDynamic();
155
+ };
152
156
  export var ResizableTableContainer = /*#__PURE__*/React.memo(function (_ref4) {
153
157
  var children = _ref4.children,
154
158
  className = _ref4.className,
@@ -233,6 +237,7 @@ export var ResizableTableContainer = /*#__PURE__*/React.memo(function (_ref4) {
233
237
  var tableWidth = getTableContainerWidth(node);
234
238
  var responsiveContainerWidth = 0;
235
239
  var resizeHandleSpacing = 12;
240
+ var padding = getPadding(containerWidth);
236
241
  // When Full width editor enabled, a Mac OS user can change "ak-editor-content-area" width by
237
242
  // updating Settings -> Appearance -> Show scroll bars from "When scrolling" to "Always". It causes
238
243
  // issues when viwport width is less than full width Editor's width. To detect avoid them
@@ -242,7 +247,7 @@ export var ResizableTableContainer = /*#__PURE__*/React.memo(function (_ref4) {
242
247
  // When: Show scroll bars -> containerWidth = akEditorGutterPadding * 2 + lineLength;
243
248
  // When: Always -> containerWidth = akEditorGutterPadding * 2 + lineLength + scrollbarWidth;
244
249
  // scrollbarWidth can vary. Values can be 14, 15, 16 and up to 20px;
245
- responsiveContainerWidth = isTableScalingEnabled ? lineLength : containerWidth - akEditorGutterPaddingDynamic() * 2 - resizeHandleSpacing;
250
+ responsiveContainerWidth = isTableScalingEnabled ? lineLength : containerWidth - padding * 2 - resizeHandleSpacing;
246
251
 
247
252
  // platform_editor_table_fw_numcol_overflow_fix:
248
253
  // lineLength is undefined on first paint → width: NaN → wrapper expands to page
@@ -256,7 +261,7 @@ export var ResizableTableContainer = /*#__PURE__*/React.memo(function (_ref4) {
256
261
  // 2) TODO: widen lineLength to `number|undefined` and remove this block.
257
262
  if (fg('platform_editor_table_fw_numcol_overflow_fix')) {
258
263
  if (isTableScalingEnabled && !Number.isFinite(responsiveContainerWidth)) {
259
- responsiveContainerWidth = containerWidth - akEditorGutterPaddingDynamic() * 2 - resizeHandleSpacing;
264
+ responsiveContainerWidth = containerWidth - padding * 2 - resizeHandleSpacing;
260
265
  }
261
266
  }
262
267
  } else if (isCommentEditor) {
@@ -266,7 +271,7 @@ export var ResizableTableContainer = /*#__PURE__*/React.memo(function (_ref4) {
266
271
  // containerWidth = width of a DIV with test id="ak-editor-fp-content-area". It is a parent of
267
272
  // a DIV with className="ak-editor-content-area". This DIV has padding left and padding right.
268
273
  // padding left = padding right = akEditorGutterPadding = 32
269
- responsiveContainerWidth = isTableScalingEnabled ? containerWidth - akEditorGutterPaddingDynamic() * 2 : containerWidth - akEditorGutterPaddingDynamic() * 2 - resizeHandleSpacing;
274
+ responsiveContainerWidth = isTableScalingEnabled ? containerWidth - padding * 2 : containerWidth - padding * 2 - resizeHandleSpacing;
270
275
  }
271
276
  var width = !node.attrs.width && isCommentEditor ? responsiveContainerWidth : Math.min(tableWidth, responsiveContainerWidth);
272
277
  if (!isResizing) {
@@ -15,9 +15,10 @@ import { logException } from '@atlaskit/editor-common/monitoring';
15
15
  import { ResizerNext } from '@atlaskit/editor-common/resizer';
16
16
  import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
17
17
  import { chainCommands } from '@atlaskit/editor-prosemirror/commands';
18
- import { akEditorGutterPaddingDynamic } from '@atlaskit/editor-shared-styles';
18
+ import { akEditorGutterPaddingDynamic, akEditorGutterPaddingReduced, akEditorFullPageNarrowBreakout } from '@atlaskit/editor-shared-styles';
19
19
  import { findTable } from '@atlaskit/editor-tables/utils';
20
20
  import { fg } from '@atlaskit/platform-feature-flags';
21
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
21
22
  import { setTableAlignmentWithTableContentWithPosWithAnalytics } from '../pm-plugins/commands/commands-with-analytics';
22
23
  import { updateWidthToWidest } from '../pm-plugins/commands/misc';
23
24
  import { META_KEYS } from '../pm-plugins/table-analytics';
@@ -67,6 +68,9 @@ var getResizerMinWidth = function getResizerMinWidth(node) {
67
68
  // the table can't scale past its min-width, so instead restrict table container min width to avoid that situation
68
69
  return minColumnWidth + 1;
69
70
  };
71
+ var getPadding = function getPadding(containerWidth) {
72
+ return containerWidth <= akEditorFullPageNarrowBreakout && expValEquals('platform_editor_preview_panel_responsiveness', 'isEnabled', true) ? akEditorGutterPaddingReduced : akEditorGutterPaddingDynamic();
73
+ };
70
74
 
71
75
  /**
72
76
  * When guidelines are outside the viewport, filter them out, do not show
@@ -87,8 +91,9 @@ var getVisibleGuidelines = function getVisibleGuidelines(guidelines, containerWi
87
91
  // For PTW we need to ensure that dynamic guideline never gets excluded: 1181 should be > width + guidelineVisibleAdjustment
88
92
  // guidelineVisibleAdjustment is set as a negative value, so we making it positive and adding + 1
89
93
  var preserve_table_widths_adjustment = -1 * PRESERVE_TABLE_GUIDELINES_LENGTH_OFFSET + 1;
94
+ var padding = getPadding(containerWidth);
90
95
  guidelineVisibleAdjustment = isFullWidthModeEnabled ? preserve_table_widths_adjustment // guidelineVisibleAdjustment = -2, if lineLength = 1180, 1181 < 1180 + 2 is true.
91
- : -2 * akEditorGutterPaddingDynamic() + preserve_table_widths_adjustment; // guidelineVisibleAdjustment = -62, if containerWidth is 1244, 1181 < 1244 - 62 = 1182 is true.
96
+ : -2 * padding + preserve_table_widths_adjustment; // guidelineVisibleAdjustment = -62, if containerWidth is 1244, 1181 < 1244 - 62 = 1182 is true.
92
97
  }
93
98
  var width = isTableScalingEnabled && isFullWidthModeEnabled ? lineLength : containerWidth;
94
99
  return guidelines.filter(function (guideline) {
@@ -200,7 +205,7 @@ export var TableResizer = function TableResizer(_ref) {
200
205
  keys = _ref2.keys;
201
206
  if (gap !== currentGap.current) {
202
207
  currentGap.current = gap;
203
- var visibleGuidelines = getVisibleGuidelines(isTableScalingEnabled ? defaultGuidelinesForPreserveTable(PRESERVE_TABLE_GUIDELINES_LENGTH_OFFSET, isFullWidthModeEnabled ? lineLength + 2 * akEditorGutterPaddingDynamic() : containerWidth, excludeGuidelineConfig) : defaultGuidelines, containerWidth, lineLength, Boolean(isTableScalingEnabled), Boolean(isFullWidthModeEnabled));
208
+ var visibleGuidelines = getVisibleGuidelines(isTableScalingEnabled ? defaultGuidelinesForPreserveTable(PRESERVE_TABLE_GUIDELINES_LENGTH_OFFSET, isFullWidthModeEnabled ? lineLength + 2 * getPadding(containerWidth) : containerWidth, excludeGuidelineConfig) : defaultGuidelines, containerWidth, lineLength, Boolean(isTableScalingEnabled), Boolean(isFullWidthModeEnabled));
204
209
  displayGuideline(getGuidelinesWithHighlights(gap, TABLE_SNAP_GAP, keys, visibleGuidelines));
205
210
  }
206
211
  }, [isTableScalingEnabled, excludeGuidelineConfig, containerWidth, displayGuideline, lineLength, isFullWidthModeEnabled]);
@@ -208,7 +213,7 @@ export var TableResizer = function TableResizer(_ref) {
208
213
  return snappingEnabled ? {
209
214
  x: isTableScalingEnabled ? defaultTablePreserveSnappingWidths(PRESERVE_TABLE_SNAPPING_LENGTH_OFFSET,
210
215
  // was hardcoded to 0, using PRESERVE_TABLE_SNAPPING_LENGTH_OFFSET instead.
211
- isFullWidthModeEnabled ? lineLength + 2 * akEditorGutterPaddingDynamic() : containerWidth, excludeGuidelineConfig) : defaultSnappingWidths
216
+ isFullWidthModeEnabled ? lineLength + 2 * getPadding(containerWidth) : containerWidth, excludeGuidelineConfig) : defaultSnappingWidths
212
217
  } : undefined;
213
218
  }, [snappingEnabled, isTableScalingEnabled, excludeGuidelineConfig, containerWidth, lineLength, isFullWidthModeEnabled]);
214
219
  var switchToCenterAlignment = useCallback(function (pos, node, newWidth, state, dispatch) {
@@ -257,7 +262,7 @@ export var TableResizer = function TableResizer(_ref) {
257
262
  name: TABLE_OVERFLOW_CHANGE_TRIGGER.RESIZED
258
263
  });
259
264
  dispatch(tr);
260
- var visibleGuidelines = getVisibleGuidelines(isTableScalingEnabled ? defaultGuidelinesForPreserveTable(PRESERVE_TABLE_GUIDELINES_LENGTH_OFFSET, isFullWidthModeEnabled ? lineLength + 2 * akEditorGutterPaddingDynamic() : containerWidth, excludeGuidelineConfig) : defaultGuidelines, containerWidth, lineLength, Boolean(isTableScalingEnabled), Boolean(isFullWidthModeEnabled));
265
+ var visibleGuidelines = getVisibleGuidelines(isTableScalingEnabled ? defaultGuidelinesForPreserveTable(PRESERVE_TABLE_GUIDELINES_LENGTH_OFFSET, isFullWidthModeEnabled ? lineLength + 2 * getPadding(containerWidth) : containerWidth, excludeGuidelineConfig) : defaultGuidelines, containerWidth, lineLength, Boolean(isTableScalingEnabled), Boolean(isFullWidthModeEnabled));
261
266
  setSnappingEnabled(displayGuideline(visibleGuidelines));
262
267
  if (onResizeStart) {
263
268
  onResizeStart();
@@ -279,7 +284,7 @@ export var TableResizer = function TableResizer(_ref) {
279
284
  if (typeof pos !== 'number') {
280
285
  return;
281
286
  }
282
- var editorContainerWidth = isFullWidthModeEnabled ? lineLength + 2 * akEditorGutterPaddingDynamic() : containerWidth;
287
+ var editorContainerWidth = isFullWidthModeEnabled ? lineLength + 2 * getPadding(containerWidth) : containerWidth;
283
288
  var closestSnap = !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);
284
289
  closestSnap && updateActiveGuidelines(closestSnap);
285
290
 
@@ -7,6 +7,7 @@ import kebabCase from 'lodash/kebabCase';
7
7
  import { table, tableWithNestedTable } from '@atlaskit/adf-schema';
8
8
  import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
9
9
  import { akEditorGutterPaddingDynamic } from '@atlaskit/editor-shared-styles';
10
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
10
11
  import { generateColgroup, getResizerMinWidth } from '../pm-plugins/table-resizing/utils/colgroup';
11
12
  import { TABLE_MAX_WIDTH } from '../pm-plugins/table-resizing/utils/consts';
12
13
  import { getAlignmentStyle } from './table-container-styles';
@@ -14,7 +15,13 @@ export var tableNodeSpecWithFixedToDOM = function tableNodeSpecWithFixedToDOM(co
14
15
  var tableNode = config.isNestingSupported ? tableWithNestedTable : table;
15
16
  return _objectSpread(_objectSpread({}, tableNode), {}, {
16
17
  toDOM: function toDOM(node) {
17
- var gutterPadding = akEditorGutterPaddingDynamic() * 2;
18
+ var gutterPadding = function gutterPadding() {
19
+ if (expValEquals('platform_editor_preview_panel_responsiveness', 'isEnabled', true)) {
20
+ return 'calc(var(--ak-editor--large-gutter-padding) * 2)';
21
+ } else {
22
+ return "".concat(akEditorGutterPaddingDynamic() * 2, "px");
23
+ }
24
+ };
18
25
  var alignmentStyle = Object.entries(getAlignmentStyle(node.attrs.layout)).map(function (_ref) {
19
26
  var _ref2 = _slicedToArray(_ref, 2),
20
27
  k = _ref2[0],
@@ -71,14 +78,14 @@ export var tableNodeSpecWithFixedToDOM = function tableNodeSpecWithFixedToDOM(co
71
78
  style: alignmentStyle
72
79
  }, ['div', {
73
80
  class: 'pm-table-resizer-container',
74
- style: "width: min(calc(100cqw - ".concat(gutterPadding, "px), ").concat(tableWidthAttribute, ");")
81
+ style: "width: min(calc(100cqw - ".concat(gutterPadding(), "), ").concat(tableWidthAttribute, ");")
75
82
  }, ['div', {
76
83
  class: 'resizer-item display-handle',
77
84
  style: convertToInlineCss({
78
85
  position: 'relative',
79
86
  userSelect: 'auto',
80
87
  boxSizing: 'border-box',
81
- '--ak-editor-table-gutter-padding': "".concat(gutterPadding, "px"),
88
+ '--ak-editor-table-gutter-padding': "".concat(gutterPadding()),
82
89
  '--ak-editor-table-max-width': "".concat(TABLE_MAX_WIDTH, "px"),
83
90
  '--ak-editor-table-min-width': "".concat(tableMinWidth, "px"),
84
91
  minWidth: 'var(--ak-editor-table-min-width)',
@@ -1,7 +1,8 @@
1
1
  import { getParentNodeWidth, getTableContainerWidth, layoutToWidth } from '@atlaskit/editor-common/node-width';
2
2
  import { calcTableWidth } from '@atlaskit/editor-common/styles';
3
3
  import { calcTableColumnWidths } from '@atlaskit/editor-common/utils';
4
- import { akEditorFullWidthLayoutWidth, akEditorGutterPaddingDynamic, akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
4
+ import { akEditorFullWidthLayoutWidth, akEditorGutterPaddingDynamic, akEditorTableNumberColumnWidth, akEditorGutterPaddingReduced, akEditorFullPageNarrowBreakout } from '@atlaskit/editor-shared-styles';
5
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
5
6
  import { hasTableBeenResized, hasTableColumnBeenResized } from './colgroup';
6
7
  import { MAX_SCALING_PERCENT, MAX_SCALING_PERCENT_TABLES_WITH_FIXED_COLUMN_WIDTHS_OPTION } from './consts';
7
8
 
@@ -11,7 +12,11 @@ export function getLayoutSize(tableLayout) {
11
12
  var options = arguments.length > 2 ? arguments[2] : undefined;
12
13
  var isFullWidthModeEnabled = options.isFullWidthModeEnabled;
13
14
  if (isFullWidthModeEnabled) {
14
- return containerWidth ? Math.min(containerWidth - akEditorGutterPaddingDynamic() * 2, akEditorFullWidthLayoutWidth) : akEditorFullWidthLayoutWidth;
15
+ var padding = akEditorGutterPaddingDynamic();
16
+ if (containerWidth <= akEditorFullPageNarrowBreakout && expValEquals('platform_editor_preview_panel_responsiveness', 'isEnabled', true)) {
17
+ padding = akEditorGutterPaddingReduced;
18
+ }
19
+ return containerWidth ? Math.min(containerWidth - padding * 2, akEditorFullWidthLayoutWidth) : akEditorFullWidthLayoutWidth;
15
20
  }
16
21
  var calculatedTableWidth = calcTableWidth(tableLayout, containerWidth, true);
17
22
  if (calculatedTableWidth !== 'inherit') {
@@ -1,6 +1,7 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
2
  import { isVerticalPosition } from '@atlaskit/editor-common/guideline';
3
- import { akEditorCalculatedWideLayoutWidth, akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPaddingDynamic } from '@atlaskit/editor-shared-styles';
3
+ import { akEditorCalculatedWideLayoutWidth, akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPaddingDynamic, akEditorGutterPaddingReduced, akEditorFullPageNarrowBreakout } from '@atlaskit/editor-shared-styles';
4
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
4
5
  var numberOfLanesInDefaultLayoutWidth = 12;
5
6
  var calculateSubSnappingWidths = function calculateSubSnappingWidths(totalLanes, totalWidth) {
6
7
  return new Array(Math.round(totalLanes / 2) - 1).fill(totalWidth / totalLanes).map(function (v, i) {
@@ -11,6 +12,10 @@ export var calculateDefaultSnappings = function calculateDefaultSnappings() {
11
12
  var lengthOffset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
12
13
  return [].concat(_toConsumableArray(calculateSubSnappingWidths(numberOfLanesInDefaultLayoutWidth, akEditorDefaultLayoutWidth + lengthOffset)), [akEditorDefaultLayoutWidth + lengthOffset, akEditorCalculatedWideLayoutWidth + lengthOffset, akEditorFullWidthLayoutWidth + lengthOffset]);
13
14
  };
15
+ var getPadding = function getPadding(editorContainerWith) {
16
+ return editorContainerWith <= akEditorFullPageNarrowBreakout && expValEquals('platform_editor_preview_panel_responsiveness', 'isEnabled', true) ? akEditorGutterPaddingReduced : akEditorGutterPaddingDynamic();
17
+ };
18
+
14
19
  // FF TablePreserve for calculateDefaultSnappings
15
20
  export var calculateDefaultTablePreserveSnappings = function calculateDefaultTablePreserveSnappings() {
16
21
  var lengthOffset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
@@ -19,7 +24,8 @@ export var calculateDefaultTablePreserveSnappings = function calculateDefaultTab
19
24
  innerGuidelines: false,
20
25
  breakoutPoints: false
21
26
  };
22
- var dynamicFullWidthLine = editorContainerWith - akEditorGutterPaddingDynamic() * 2 >= akEditorFullWidthLayoutWidth ? akEditorFullWidthLayoutWidth : editorContainerWith - akEditorGutterPaddingDynamic() * 2;
27
+ var padding = getPadding(editorContainerWith);
28
+ var dynamicFullWidthLine = editorContainerWith - padding * 2 >= akEditorFullWidthLayoutWidth ? akEditorFullWidthLayoutWidth : editorContainerWith - padding * 2;
23
29
  var guides = [dynamicFullWidthLine - lengthOffset];
24
30
  if (!exclude.breakoutPoints) {
25
31
  guides.unshift(akEditorDefaultLayoutWidth + lengthOffset, akEditorCalculatedWideLayoutWidth + lengthOffset);
@@ -37,7 +43,8 @@ export var defaultTablePreserveSnappingWidths = function defaultTablePreserveSna
37
43
  innerGuidelines: false,
38
44
  breakoutPoints: false
39
45
  };
40
- return editorContainerWidth - akEditorGutterPaddingDynamic() * 2 > akEditorFullWidthLayoutWidth ? calculateDefaultSnappings() : calculateDefaultTablePreserveSnappings(lengthOffset, editorContainerWidth, exclude); // lengthOffset was hardcoded 0 here, created PRESERVE_TABLE_SNAPPING_LENGTH_OFFSET instead.
46
+ var padding = getPadding(editorContainerWidth);
47
+ return editorContainerWidth - padding * 2 > akEditorFullWidthLayoutWidth ? calculateDefaultSnappings() : calculateDefaultTablePreserveSnappings(lengthOffset, editorContainerWidth, exclude); // lengthOffset was hardcoded 0 here, created PRESERVE_TABLE_SNAPPING_LENGTH_OFFSET instead.
41
48
  };
42
49
 
43
50
  /**
@@ -1,4 +1,6 @@
1
1
  import React from 'react';
2
+
3
+ // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
2
4
  import { Box, xcss } from '@atlaskit/primitives';
3
5
  import { DragInMotionIcon } from '../icons/DragInMotionIcon';
4
6
  var boxStyles = xcss({
@@ -6,6 +6,7 @@
6
6
  import { jsx } from '@emotion/react';
7
7
  import { ButtonGroup } from '@atlaskit/button';
8
8
  import { FloatingToolbarButton as Button, FloatingToolbarSeparator } from '@atlaskit/editor-common/ui';
9
+ // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
9
10
  import { Box, xcss } from '@atlaskit/primitives';
10
11
  var containerStyles = xcss({
11
12
  marginLeft: 'space.100'
@@ -40,6 +40,7 @@ import TableRowAddBelowIcon from '@atlaskit/icon/core/table-row-add-below';
40
40
  import TableRowDeleteIcon from '@atlaskit/icon/core/table-row-delete';
41
41
  import CrossCircleIcon from '@atlaskit/icon/glyph/cross-circle';
42
42
  import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
43
+ // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
43
44
  import { Box, xcss } from '@atlaskit/primitives';
44
45
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
45
46
  import { clearHoverSelection, hoverColumns, hoverMergedCells, hoverRows, setFocusToCellMenu, toggleContextualMenu } from '../../pm-plugins/commands';
@@ -22,6 +22,7 @@ import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
22
22
  import { TableMap } from '@atlaskit/editor-tables/table-map';
23
23
  import { findCellRectClosestToPos, getSelectionRect, isSelectionType } from '@atlaskit/editor-tables/utils';
24
24
  import PaintBucketIcon from '@atlaskit/icon/core/migration/paint-bucket--editor-background-color';
25
+ // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
25
26
  import { Box, xcss } from '@atlaskit/primitives';
26
27
  import Toggle from '@atlaskit/toggle';
27
28
  import { clearHoverSelection, hoverColumns, hoverRows } from '../../pm-plugins/commands';
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { useIntl } from 'react-intl-next';
3
3
  import { tableMessages as messages } from '@atlaskit/editor-common/messages';
4
+ // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
4
5
  import { Box, Inline, xcss } from '@atlaskit/primitives';
5
6
  var tableFullWidthLabelWrapperStyles = xcss({
6
7
  height: "var(--ds-space-400, 32px)",
@@ -16,7 +16,7 @@ import { addColumnAfter, addRowAfter, backspace, tooltip } from '@atlaskit/edito
16
16
  import commonMessages, { tableMessages as messages } from '@atlaskit/editor-common/messages';
17
17
  import { isSelectionTableNestedInTable } from '@atlaskit/editor-common/nesting';
18
18
  import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
19
- import { cellBackgroundColorPalette, DEFAULT_BORDER_COLOR } from '@atlaskit/editor-common/ui-color';
19
+ import { DEFAULT_BORDER_COLOR, cellBackgroundColorPalette } from '@atlaskit/editor-common/ui-color';
20
20
  import { closestElement, getChildrenInfo as _getChildrenInfo, getNodeName, isReferencedSource } from '@atlaskit/editor-common/utils';
21
21
  import { findParentDomRefOfType } from '@atlaskit/editor-prosemirror/utils';
22
22
  import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "11.1.2",
3
+ "version": "11.1.4",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -37,13 +37,13 @@
37
37
  "@atlaskit/editor-plugin-batch-attribute-updates": "^3.0.0",
38
38
  "@atlaskit/editor-plugin-content-insertion": "^3.0.0",
39
39
  "@atlaskit/editor-plugin-editor-viewmode": "^5.0.0",
40
- "@atlaskit/editor-plugin-extension": "6.0.3",
40
+ "@atlaskit/editor-plugin-extension": "6.0.4",
41
41
  "@atlaskit/editor-plugin-guideline": "^3.0.0",
42
42
  "@atlaskit/editor-plugin-interaction": "^4.0.0",
43
43
  "@atlaskit/editor-plugin-selection": "^3.0.0",
44
44
  "@atlaskit/editor-plugin-width": "^4.0.0",
45
45
  "@atlaskit/editor-prosemirror": "7.0.0",
46
- "@atlaskit/editor-shared-styles": "^3.4.0",
46
+ "@atlaskit/editor-shared-styles": "^3.5.0",
47
47
  "@atlaskit/editor-tables": "^2.9.0",
48
48
  "@atlaskit/icon": "^27.3.0",
49
49
  "@atlaskit/menu": "^8.0.0",
@@ -54,7 +54,7 @@
54
54
  "@atlaskit/primitives": "^14.10.0",
55
55
  "@atlaskit/react-ufo": "^4.0.0",
56
56
  "@atlaskit/theme": "^19.0.0",
57
- "@atlaskit/tmp-editor-statsig": "^9.6.0",
57
+ "@atlaskit/tmp-editor-statsig": "^9.8.0",
58
58
  "@atlaskit/toggle": "^15.0.0",
59
59
  "@atlaskit/tokens": "^5.5.0",
60
60
  "@atlaskit/tooltip": "^20.3.0",
@@ -22,9 +22,12 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
22
22
  import {
23
23
  akEditorDefaultLayoutWidth,
24
24
  akEditorGutterPaddingDynamic,
25
+ akEditorGutterPaddingReduced,
26
+ akEditorFullPageNarrowBreakout,
25
27
  akEditorMobileBreakoutPoint,
26
28
  } from '@atlaskit/editor-shared-styles';
27
29
  import { fg } from '@atlaskit/platform-feature-flags';
30
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
28
31
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
29
32
 
30
33
  import { setTableAlignmentWithTableContentWithPosWithAnalytics } from '../pm-plugins/commands/commands-with-analytics';
@@ -252,6 +255,13 @@ const useSharedState = sharedPluginStateHookMigratorFactory(
252
255
  },
253
256
  );
254
257
 
258
+ const getPadding = (containerWidth: number) => {
259
+ return containerWidth <= akEditorFullPageNarrowBreakout &&
260
+ expValEquals('platform_editor_preview_panel_responsiveness', 'isEnabled', true)
261
+ ? akEditorGutterPaddingReduced
262
+ : akEditorGutterPaddingDynamic();
263
+ };
264
+
255
265
  export const ResizableTableContainer = React.memo(
256
266
  ({
257
267
  children,
@@ -355,6 +365,7 @@ export const ResizableTableContainer = React.memo(
355
365
 
356
366
  let responsiveContainerWidth = 0;
357
367
  const resizeHandleSpacing = 12;
368
+ const padding = getPadding(containerWidth);
358
369
  // When Full width editor enabled, a Mac OS user can change "ak-editor-content-area" width by
359
370
  // updating Settings -> Appearance -> Show scroll bars from "When scrolling" to "Always". It causes
360
371
  // issues when viwport width is less than full width Editor's width. To detect avoid them
@@ -366,7 +377,7 @@ export const ResizableTableContainer = React.memo(
366
377
  // scrollbarWidth can vary. Values can be 14, 15, 16 and up to 20px;
367
378
  responsiveContainerWidth = isTableScalingEnabled
368
379
  ? lineLength
369
- : containerWidth - akEditorGutterPaddingDynamic() * 2 - resizeHandleSpacing;
380
+ : containerWidth - padding * 2 - resizeHandleSpacing;
370
381
 
371
382
  // platform_editor_table_fw_numcol_overflow_fix:
372
383
  // lineLength is undefined on first paint → width: NaN → wrapper expands to page
@@ -380,8 +391,7 @@ export const ResizableTableContainer = React.memo(
380
391
  // 2) TODO: widen lineLength to `number|undefined` and remove this block.
381
392
  if (fg('platform_editor_table_fw_numcol_overflow_fix')) {
382
393
  if (isTableScalingEnabled && !Number.isFinite(responsiveContainerWidth)) {
383
- responsiveContainerWidth =
384
- containerWidth - akEditorGutterPaddingDynamic() * 2 - resizeHandleSpacing;
394
+ responsiveContainerWidth = containerWidth - padding * 2 - resizeHandleSpacing;
385
395
  }
386
396
  }
387
397
  } else if (isCommentEditor) {
@@ -392,8 +402,8 @@ export const ResizableTableContainer = React.memo(
392
402
  // a DIV with className="ak-editor-content-area". This DIV has padding left and padding right.
393
403
  // padding left = padding right = akEditorGutterPadding = 32
394
404
  responsiveContainerWidth = isTableScalingEnabled
395
- ? containerWidth - akEditorGutterPaddingDynamic() * 2
396
- : containerWidth - akEditorGutterPaddingDynamic() * 2 - resizeHandleSpacing;
405
+ ? containerWidth - padding * 2
406
+ : containerWidth - padding * 2 - resizeHandleSpacing;
397
407
  }
398
408
  const width =
399
409
  !node.attrs.width && isCommentEditor
@@ -28,9 +28,14 @@ import { chainCommands } from '@atlaskit/editor-prosemirror/commands';
28
28
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
29
29
  import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
30
30
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
31
- import { akEditorGutterPaddingDynamic } from '@atlaskit/editor-shared-styles';
31
+ import {
32
+ akEditorGutterPaddingDynamic,
33
+ akEditorGutterPaddingReduced,
34
+ akEditorFullPageNarrowBreakout,
35
+ } from '@atlaskit/editor-shared-styles';
32
36
  import { findTable } from '@atlaskit/editor-tables/utils';
33
37
  import { fg } from '@atlaskit/platform-feature-flags';
38
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
34
39
  import { token } from '@atlaskit/tokens';
35
40
 
36
41
  import { setTableAlignmentWithTableContentWithPosWithAnalytics } from '../pm-plugins/commands/commands-with-analytics';
@@ -143,6 +148,13 @@ const getResizerMinWidth = (node: PMNode) => {
143
148
  return minColumnWidth + 1;
144
149
  };
145
150
 
151
+ const getPadding = (containerWidth: number) => {
152
+ return containerWidth <= akEditorFullPageNarrowBreakout &&
153
+ expValEquals('platform_editor_preview_panel_responsiveness', 'isEnabled', true)
154
+ ? akEditorGutterPaddingReduced
155
+ : akEditorGutterPaddingDynamic();
156
+ };
157
+
146
158
  /**
147
159
  * When guidelines are outside the viewport, filter them out, do not show
148
160
  * So the guideline container won't make the fabric-editor-popup-scroll-parent overflow
@@ -168,10 +180,10 @@ const getVisibleGuidelines = (
168
180
  // For PTW we need to ensure that dynamic guideline never gets excluded: 1181 should be > width + guidelineVisibleAdjustment
169
181
  // guidelineVisibleAdjustment is set as a negative value, so we making it positive and adding + 1
170
182
  const preserve_table_widths_adjustment = -1 * PRESERVE_TABLE_GUIDELINES_LENGTH_OFFSET + 1;
171
-
183
+ const padding = getPadding(containerWidth);
172
184
  guidelineVisibleAdjustment = isFullWidthModeEnabled
173
185
  ? preserve_table_widths_adjustment // guidelineVisibleAdjustment = -2, if lineLength = 1180, 1181 < 1180 + 2 is true.
174
- : -2 * akEditorGutterPaddingDynamic() + preserve_table_widths_adjustment; // guidelineVisibleAdjustment = -62, if containerWidth is 1244, 1181 < 1244 - 62 = 1182 is true.
186
+ : -2 * padding + preserve_table_widths_adjustment; // guidelineVisibleAdjustment = -62, if containerWidth is 1244, 1181 < 1244 - 62 = 1182 is true.
175
187
  }
176
188
  const width = isTableScalingEnabled && isFullWidthModeEnabled ? lineLength : containerWidth;
177
189
 
@@ -296,12 +308,13 @@ export const TableResizer = ({
296
308
  ({ gap, keys }: { gap: number; keys: string[] }) => {
297
309
  if (gap !== currentGap.current) {
298
310
  currentGap.current = gap;
311
+
299
312
  const visibleGuidelines = getVisibleGuidelines(
300
313
  isTableScalingEnabled
301
314
  ? defaultGuidelinesForPreserveTable(
302
315
  PRESERVE_TABLE_GUIDELINES_LENGTH_OFFSET,
303
316
  isFullWidthModeEnabled
304
- ? lineLength + 2 * akEditorGutterPaddingDynamic()
317
+ ? lineLength + 2 * getPadding(containerWidth)
305
318
  : containerWidth,
306
319
  excludeGuidelineConfig,
307
320
  )
@@ -332,7 +345,7 @@ export const TableResizer = ({
332
345
  ? defaultTablePreserveSnappingWidths(
333
346
  PRESERVE_TABLE_SNAPPING_LENGTH_OFFSET, // was hardcoded to 0, using PRESERVE_TABLE_SNAPPING_LENGTH_OFFSET instead.
334
347
  isFullWidthModeEnabled
335
- ? lineLength + 2 * akEditorGutterPaddingDynamic()
348
+ ? lineLength + 2 * getPadding(containerWidth)
336
349
  : containerWidth,
337
350
  excludeGuidelineConfig,
338
351
  )
@@ -428,9 +441,7 @@ export const TableResizer = ({
428
441
  isTableScalingEnabled
429
442
  ? defaultGuidelinesForPreserveTable(
430
443
  PRESERVE_TABLE_GUIDELINES_LENGTH_OFFSET,
431
- isFullWidthModeEnabled
432
- ? lineLength + 2 * akEditorGutterPaddingDynamic()
433
- : containerWidth,
444
+ isFullWidthModeEnabled ? lineLength + 2 * getPadding(containerWidth) : containerWidth,
434
445
  excludeGuidelineConfig,
435
446
  )
436
447
  : defaultGuidelines,
@@ -476,7 +487,7 @@ export const TableResizer = ({
476
487
  }
477
488
 
478
489
  const editorContainerWidth = isFullWidthModeEnabled
479
- ? lineLength + 2 * akEditorGutterPaddingDynamic()
490
+ ? lineLength + 2 * getPadding(containerWidth)
480
491
  : containerWidth;
481
492
 
482
493
  const closestSnap =
@@ -5,6 +5,7 @@ import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
5
5
  import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
6
6
  import type { DOMOutputSpec, NodeSpec, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
7
7
  import { akEditorGutterPaddingDynamic } from '@atlaskit/editor-shared-styles';
8
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
8
9
 
9
10
  import { generateColgroup, getResizerMinWidth } from '../pm-plugins/table-resizing/utils/colgroup';
10
11
  import { TABLE_MAX_WIDTH } from '../pm-plugins/table-resizing/utils/consts';
@@ -25,7 +26,13 @@ export const tableNodeSpecWithFixedToDOM = (
25
26
  return {
26
27
  ...tableNode,
27
28
  toDOM: (node: PMNode): DOMOutputSpec => {
28
- const gutterPadding = akEditorGutterPaddingDynamic() * 2;
29
+ const gutterPadding = () => {
30
+ if (expValEquals('platform_editor_preview_panel_responsiveness', 'isEnabled', true)) {
31
+ return 'calc(var(--ak-editor--large-gutter-padding) * 2)';
32
+ } else {
33
+ return `${akEditorGutterPaddingDynamic() * 2}px`;
34
+ }
35
+ };
29
36
 
30
37
  const alignmentStyle = Object.entries(getAlignmentStyle(node.attrs.layout))
31
38
  .map(([k, v]) => `${kebabCase(k)}: ${kebabCase(v)}`)
@@ -129,7 +136,7 @@ export const tableNodeSpecWithFixedToDOM = (
129
136
  'div',
130
137
  {
131
138
  class: 'pm-table-resizer-container',
132
- style: `width: min(calc(100cqw - ${gutterPadding}px), ${tableWidthAttribute});`,
139
+ style: `width: min(calc(100cqw - ${gutterPadding()}), ${tableWidthAttribute});`,
133
140
  },
134
141
  [
135
142
  'div',
@@ -139,7 +146,7 @@ export const tableNodeSpecWithFixedToDOM = (
139
146
  position: 'relative',
140
147
  userSelect: 'auto',
141
148
  boxSizing: 'border-box',
142
- '--ak-editor-table-gutter-padding': `${gutterPadding}px`,
149
+ '--ak-editor-table-gutter-padding': `${gutterPadding()}`,
143
150
  '--ak-editor-table-max-width': `${TABLE_MAX_WIDTH}px`,
144
151
  '--ak-editor-table-min-width': `${tableMinWidth}px`,
145
152
  minWidth: 'var(--ak-editor-table-min-width)',