@atlaskit/editor-plugin-table 7.16.9 → 7.16.10

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,13 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 7.16.10
4
+
5
+ ### Patch Changes
6
+
7
+ - [#103716](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/103716)
8
+ [`d691deb86b01`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d691deb86b01) -
9
+ Exclude breakout guides for full width appearance for tables
10
+
3
11
  ## 7.16.9
4
12
 
5
13
  ### Patch Changes
@@ -130,20 +130,26 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
130
130
  startMeasure = _useMeasureFramerate.startMeasure,
131
131
  endMeasure = _useMeasureFramerate.endMeasure,
132
132
  countFrames = _useMeasureFramerate.countFrames;
133
+ var excludeGuidelineConfig = (0, _react.useMemo)(function () {
134
+ return {
135
+ innerGuidelines: !!isTableAlignmentEnabled,
136
+ breakoutPoints: !!(isTableAlignmentEnabled && tableState !== null && tableState !== void 0 && tableState.isFullWidthModeEnabled)
137
+ };
138
+ }, [tableState, isTableAlignmentEnabled]);
133
139
  var updateActiveGuidelines = (0, _react.useCallback)(function (_ref3) {
134
140
  var gap = _ref3.gap,
135
141
  keys = _ref3.keys;
136
142
  if (gap !== currentGap.current) {
137
143
  currentGap.current = gap;
138
- var visibleGuidelines = getVisibleGuidelines(isTableScalingEnabled ? (0, _guidelines.defaultGuidelinesForPreserveTable)(containerWidth, isTableAlignmentEnabled) : _guidelines.defaultGuidelines, containerWidth);
144
+ var visibleGuidelines = getVisibleGuidelines(isTableScalingEnabled ? (0, _guidelines.defaultGuidelinesForPreserveTable)(containerWidth, excludeGuidelineConfig) : _guidelines.defaultGuidelines, containerWidth);
139
145
  displayGuideline((0, _guideline.getGuidelinesWithHighlights)(gap, _consts.TABLE_SNAP_GAP, keys, visibleGuidelines));
140
146
  }
141
- }, [isTableScalingEnabled, isTableAlignmentEnabled, containerWidth, displayGuideline]);
147
+ }, [isTableScalingEnabled, excludeGuidelineConfig, containerWidth, displayGuideline]);
142
148
  var guidelineSnaps = (0, _react.useMemo)(function () {
143
149
  return snappingEnabled ? {
144
- x: isTableScalingEnabled ? (0, _snapping.defaultTablePreserveSnappingWidths)(containerWidth, isTableAlignmentEnabled) : _snapping.defaultSnappingWidths
150
+ x: isTableScalingEnabled ? (0, _snapping.defaultTablePreserveSnappingWidths)(containerWidth, excludeGuidelineConfig) : _snapping.defaultSnappingWidths
145
151
  } : undefined;
146
- }, [snappingEnabled, isTableScalingEnabled, isTableAlignmentEnabled, containerWidth]);
152
+ }, [snappingEnabled, isTableScalingEnabled, excludeGuidelineConfig, containerWidth]);
147
153
  var switchToCenterAlignment = (0, _react.useCallback)(function (pos, node, newWidth, state, dispatch) {
148
154
  if (isTableAlignmentEnabled && node && node.attrs.layout === _alignment.ALIGN_START && newWidth > lineLength && lineLength < FULL_WIDTH_EDITOR_CONTENT_WIDTH &&
149
155
  // We don't want to switch alignment in Full-width editor
@@ -193,12 +199,12 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
193
199
  name: _analytics.TABLE_OVERFLOW_CHANGE_TRIGGER.RESIZED
194
200
  });
195
201
  dispatch(tr);
196
- var visibleGuidelines = getVisibleGuidelines(isTableScalingEnabled ? (0, _guidelines.defaultGuidelinesForPreserveTable)(containerWidth, isTableAlignmentEnabled) : _guidelines.defaultGuidelines, containerWidth);
202
+ var visibleGuidelines = getVisibleGuidelines(isTableScalingEnabled ? (0, _guidelines.defaultGuidelinesForPreserveTable)(containerWidth, excludeGuidelineConfig) : _guidelines.defaultGuidelines, containerWidth);
197
203
  setSnappingEnabled(displayGuideline(visibleGuidelines));
198
204
  if (onResizeStart) {
199
205
  onResizeStart();
200
206
  }
201
- }, [startMeasure, editorView, displayGapCursor, node.attrs.localId, tableRef, isTableScalingEnabled, isTableAlignmentEnabled, containerWidth, displayGuideline, onResizeStart]);
207
+ }, [startMeasure, editorView, displayGapCursor, node.attrs.localId, tableRef, isTableScalingEnabled, excludeGuidelineConfig, containerWidth, displayGuideline, onResizeStart]);
202
208
  var handleResize = (0, _react.useCallback)(function (originalState, delta) {
203
209
  var _node$attrs$localId, _node$attrs;
204
210
  countFrames();
@@ -218,14 +224,14 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
218
224
  start: pos + 1,
219
225
  parentWidth: newWidth
220
226
  }, editorView.domAtPos.bind(editorView), isTableScalingEnabled);
221
- var closestSnap = (0, _snapping.findClosestSnap)(newWidth, isTableScalingEnabled ? (0, _snapping.defaultTablePreserveSnappingWidths)(containerWidth, isTableAlignmentEnabled) : _snapping.defaultSnappingWidths, isTableScalingEnabled ? (0, _guidelines.defaultGuidelinesForPreserveTable)(containerWidth, isTableAlignmentEnabled) : _guidelines.defaultGuidelines, _consts.TABLE_HIGHLIGHT_GAP, _consts.TABLE_HIGHLIGHT_TOLERANCE);
227
+ var closestSnap = (0, _snapping.findClosestSnap)(newWidth, isTableScalingEnabled ? (0, _snapping.defaultTablePreserveSnappingWidths)(containerWidth, excludeGuidelineConfig) : _snapping.defaultSnappingWidths, isTableScalingEnabled ? (0, _guidelines.defaultGuidelinesForPreserveTable)(containerWidth, excludeGuidelineConfig) : _guidelines.defaultGuidelines, _consts.TABLE_HIGHLIGHT_GAP, _consts.TABLE_HIGHLIGHT_TOLERANCE);
222
228
  updateActiveGuidelines(closestSnap);
223
229
 
224
230
  // When snapping to the full width guideline, resize the table to be 1800px
225
231
  var state = editorView.state,
226
232
  dispatch = editorView.dispatch;
227
233
  var currentTableNodeLocalId = (_node$attrs$localId = node === null || node === 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 : '';
228
- var fullWidthGuideline = (0, _guidelines.defaultGuidelinesForPreserveTable)(containerWidth, isTableAlignmentEnabled).filter(function (guideline) {
234
+ var fullWidthGuideline = (0, _guidelines.defaultGuidelinesForPreserveTable)(containerWidth, excludeGuidelineConfig).filter(function (guideline) {
229
235
  return guideline.isFullWidth;
230
236
  })[0];
231
237
  var isFullWidthGuidelineActive = closestSnap.keys.includes(fullWidthGuideline.key);
@@ -235,7 +241,7 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
235
241
  }, (0, _misc.updateWidthToWidest)((0, _defineProperty2.default)({}, currentTableNodeLocalId, shouldUpdateWidthToWidest)))(state, dispatch);
236
242
  updateWidth(shouldUpdateWidthToWidest ? _utils3.TABLE_MAX_WIDTH : newWidth);
237
243
  return newWidth;
238
- }, [countFrames, isTableScalingEnabled, isTableAlignmentEnabled, tableRef, node, editorView, updateActiveGuidelines, containerWidth, updateWidth, getPos, switchToCenterAlignment]);
244
+ }, [countFrames, isTableScalingEnabled, excludeGuidelineConfig, tableRef, node, editorView, updateActiveGuidelines, containerWidth, updateWidth, getPos, switchToCenterAlignment]);
239
245
  var scheduleResize = (0, _react.useMemo)(function () {
240
246
  return (0, _rafSchd.default)(handleResize);
241
247
  }, [handleResize]);
@@ -12,7 +12,10 @@ var _snapping = require("./snapping");
12
12
  // If we don't do this then the guidelines will not align correctly to the edge of the table
13
13
  var defaultGuidelines = exports.defaultGuidelines = (0, _guideline.createFixedGuidelinesFromLengths)([0].concat((0, _toConsumableArray2.default)((0, _snapping.calculateDefaultSnappings)(-1))));
14
14
  var defaultGuidelinesForPreserveTable = exports.defaultGuidelinesForPreserveTable = function defaultGuidelinesForPreserveTable(editorContainerWidth) {
15
- var excludeInnerGuidelines = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
16
- var lengths = (0, _snapping.calculateDefaultTablePreserveSnappings)(-1, editorContainerWidth, excludeInnerGuidelines);
15
+ var exclude = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
16
+ innerGuidelines: false,
17
+ breakoutPoints: false
18
+ };
19
+ var lengths = (0, _snapping.calculateDefaultTablePreserveSnappings)(-1, editorContainerWidth, exclude);
17
20
  return (0, _guideline.createFixedGuidelinesFromLengths)(lengths, undefined, true);
18
21
  };
@@ -19,24 +19,33 @@ var calculateDefaultSnappings = exports.calculateDefaultSnappings = function cal
19
19
  var lengthOffset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
20
20
  return [].concat((0, _toConsumableArray2.default)(calculateSubSnappingWidths(numberOfLanesInDefaultLayoutWidth, _editorSharedStyles.akEditorDefaultLayoutWidth + lengthOffset)), [_editorSharedStyles.akEditorDefaultLayoutWidth + lengthOffset, _editorSharedStyles.akEditorCalculatedWideLayoutWidth + lengthOffset, _editorSharedStyles.akEditorFullWidthLayoutWidth + lengthOffset]);
21
21
  };
22
-
23
22
  // FF TablePreserve for calculateDefaultSnappings
24
23
  var calculateDefaultTablePreserveSnappings = exports.calculateDefaultTablePreserveSnappings = function calculateDefaultTablePreserveSnappings() {
25
24
  var lengthOffset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
26
25
  var editorContainerWith = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _editorSharedStyles.akEditorFullWidthLayoutWidth;
27
- var excludeInnerGuidelines = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
26
+ var exclude = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
27
+ innerGuidelines: false,
28
+ breakoutPoints: false
29
+ };
28
30
  var dynamicFullWidthLine = editorContainerWith - _editorSharedStyles.akEditorGutterPadding * 2 >= _editorSharedStyles.akEditorFullWidthLayoutWidth ? _editorSharedStyles.akEditorFullWidthLayoutWidth : editorContainerWith - _editorSharedStyles.akEditorGutterPadding * 2 - _consts.tableResizerWidth;
29
- if (excludeInnerGuidelines) {
30
- return [_editorSharedStyles.akEditorDefaultLayoutWidth + lengthOffset, _editorSharedStyles.akEditorCalculatedWideLayoutWidth + lengthOffset, dynamicFullWidthLine - lengthOffset];
31
+ var guides = [dynamicFullWidthLine - lengthOffset];
32
+ if (!exclude.breakoutPoints) {
33
+ guides.unshift(_editorSharedStyles.akEditorDefaultLayoutWidth + lengthOffset, _editorSharedStyles.akEditorCalculatedWideLayoutWidth + lengthOffset);
31
34
  }
32
- return [0].concat((0, _toConsumableArray2.default)(calculateSubSnappingWidths(numberOfLanesInDefaultLayoutWidth, _editorSharedStyles.akEditorDefaultLayoutWidth + lengthOffset)), [_editorSharedStyles.akEditorDefaultLayoutWidth + lengthOffset, _editorSharedStyles.akEditorCalculatedWideLayoutWidth + lengthOffset, dynamicFullWidthLine - lengthOffset]);
35
+ if (!exclude.innerGuidelines) {
36
+ guides.unshift.apply(guides, [0].concat((0, _toConsumableArray2.default)(calculateSubSnappingWidths(numberOfLanesInDefaultLayoutWidth, _editorSharedStyles.akEditorDefaultLayoutWidth + lengthOffset))));
37
+ }
38
+ return guides;
33
39
  };
34
40
  var defaultSnappingWidths = exports.defaultSnappingWidths = calculateDefaultSnappings();
35
41
 
36
42
  // FF TablePreserve for defaultSnappingWidths
37
43
  var defaultTablePreserveSnappingWidths = exports.defaultTablePreserveSnappingWidths = function defaultTablePreserveSnappingWidths(editorContainerWidth) {
38
- var excludeInnerGuidelines = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
39
- return editorContainerWidth - _editorSharedStyles.akEditorGutterPadding * 2 > _editorSharedStyles.akEditorFullWidthLayoutWidth ? calculateDefaultSnappings() : calculateDefaultTablePreserveSnappings(0, editorContainerWidth, excludeInnerGuidelines);
44
+ var exclude = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
45
+ innerGuidelines: false,
46
+ breakoutPoints: false
47
+ };
48
+ return editorContainerWidth - _editorSharedStyles.akEditorGutterPadding * 2 > _editorSharedStyles.akEditorFullWidthLayoutWidth ? calculateDefaultSnappings() : calculateDefaultTablePreserveSnappings(0, editorContainerWidth, exclude);
40
49
  };
41
50
 
42
51
  /**
@@ -118,19 +118,23 @@ export const TableResizer = ({
118
118
  endMeasure,
119
119
  countFrames
120
120
  } = useMeasureFramerate();
121
+ const excludeGuidelineConfig = useMemo(() => ({
122
+ innerGuidelines: !!isTableAlignmentEnabled,
123
+ breakoutPoints: !!(isTableAlignmentEnabled && tableState !== null && tableState !== void 0 && tableState.isFullWidthModeEnabled)
124
+ }), [tableState, isTableAlignmentEnabled]);
121
125
  const updateActiveGuidelines = useCallback(({
122
126
  gap,
123
127
  keys
124
128
  }) => {
125
129
  if (gap !== currentGap.current) {
126
130
  currentGap.current = gap;
127
- const visibleGuidelines = getVisibleGuidelines(isTableScalingEnabled ? defaultGuidelinesForPreserveTable(containerWidth, isTableAlignmentEnabled) : defaultGuidelines, containerWidth);
131
+ const visibleGuidelines = getVisibleGuidelines(isTableScalingEnabled ? defaultGuidelinesForPreserveTable(containerWidth, excludeGuidelineConfig) : defaultGuidelines, containerWidth);
128
132
  displayGuideline(getGuidelinesWithHighlights(gap, TABLE_SNAP_GAP, keys, visibleGuidelines));
129
133
  }
130
- }, [isTableScalingEnabled, isTableAlignmentEnabled, containerWidth, displayGuideline]);
134
+ }, [isTableScalingEnabled, excludeGuidelineConfig, containerWidth, displayGuideline]);
131
135
  const guidelineSnaps = useMemo(() => snappingEnabled ? {
132
- x: isTableScalingEnabled ? defaultTablePreserveSnappingWidths(containerWidth, isTableAlignmentEnabled) : defaultSnappingWidths
133
- } : undefined, [snappingEnabled, isTableScalingEnabled, isTableAlignmentEnabled, containerWidth]);
136
+ x: isTableScalingEnabled ? defaultTablePreserveSnappingWidths(containerWidth, excludeGuidelineConfig) : defaultSnappingWidths
137
+ } : undefined, [snappingEnabled, isTableScalingEnabled, excludeGuidelineConfig, containerWidth]);
134
138
  const switchToCenterAlignment = useCallback((pos, node, newWidth, state, dispatch) => {
135
139
  if (isTableAlignmentEnabled && node && node.attrs.layout === ALIGN_START && newWidth > lineLength && lineLength < FULL_WIDTH_EDITOR_CONTENT_WIDTH &&
136
140
  // We don't want to switch alignment in Full-width editor
@@ -188,12 +192,12 @@ export const TableResizer = ({
188
192
  name: TABLE_OVERFLOW_CHANGE_TRIGGER.RESIZED
189
193
  });
190
194
  dispatch(tr);
191
- const visibleGuidelines = getVisibleGuidelines(isTableScalingEnabled ? defaultGuidelinesForPreserveTable(containerWidth, isTableAlignmentEnabled) : defaultGuidelines, containerWidth);
195
+ const visibleGuidelines = getVisibleGuidelines(isTableScalingEnabled ? defaultGuidelinesForPreserveTable(containerWidth, excludeGuidelineConfig) : defaultGuidelines, containerWidth);
192
196
  setSnappingEnabled(displayGuideline(visibleGuidelines));
193
197
  if (onResizeStart) {
194
198
  onResizeStart();
195
199
  }
196
- }, [startMeasure, editorView, displayGapCursor, node.attrs.localId, tableRef, isTableScalingEnabled, isTableAlignmentEnabled, containerWidth, displayGuideline, onResizeStart]);
200
+ }, [startMeasure, editorView, displayGapCursor, node.attrs.localId, tableRef, isTableScalingEnabled, excludeGuidelineConfig, containerWidth, displayGuideline, onResizeStart]);
197
201
  const handleResize = useCallback((originalState, delta) => {
198
202
  var _node$attrs$localId, _node$attrs;
199
203
  countFrames();
@@ -213,7 +217,7 @@ export const TableResizer = ({
213
217
  start: pos + 1,
214
218
  parentWidth: newWidth
215
219
  }, editorView.domAtPos.bind(editorView), isTableScalingEnabled);
216
- const closestSnap = findClosestSnap(newWidth, isTableScalingEnabled ? defaultTablePreserveSnappingWidths(containerWidth, isTableAlignmentEnabled) : defaultSnappingWidths, isTableScalingEnabled ? defaultGuidelinesForPreserveTable(containerWidth, isTableAlignmentEnabled) : defaultGuidelines, TABLE_HIGHLIGHT_GAP, TABLE_HIGHLIGHT_TOLERANCE);
220
+ const closestSnap = findClosestSnap(newWidth, isTableScalingEnabled ? defaultTablePreserveSnappingWidths(containerWidth, excludeGuidelineConfig) : defaultSnappingWidths, isTableScalingEnabled ? defaultGuidelinesForPreserveTable(containerWidth, excludeGuidelineConfig) : defaultGuidelines, TABLE_HIGHLIGHT_GAP, TABLE_HIGHLIGHT_TOLERANCE);
217
221
  updateActiveGuidelines(closestSnap);
218
222
 
219
223
  // When snapping to the full width guideline, resize the table to be 1800px
@@ -222,7 +226,7 @@ export const TableResizer = ({
222
226
  dispatch
223
227
  } = editorView;
224
228
  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 : '';
225
- const fullWidthGuideline = defaultGuidelinesForPreserveTable(containerWidth, isTableAlignmentEnabled).filter(guideline => guideline.isFullWidth)[0];
229
+ const fullWidthGuideline = defaultGuidelinesForPreserveTable(containerWidth, excludeGuidelineConfig).filter(guideline => guideline.isFullWidth)[0];
226
230
  const isFullWidthGuidelineActive = closestSnap.keys.includes(fullWidthGuideline.key);
227
231
  const shouldUpdateWidthToWidest = !!isTableScalingEnabled && isFullWidthGuidelineActive;
228
232
  chainCommands((state, dispatch) => {
@@ -232,7 +236,7 @@ export const TableResizer = ({
232
236
  }))(state, dispatch);
233
237
  updateWidth(shouldUpdateWidthToWidest ? TABLE_MAX_WIDTH : newWidth);
234
238
  return newWidth;
235
- }, [countFrames, isTableScalingEnabled, isTableAlignmentEnabled, tableRef, node, editorView, updateActiveGuidelines, containerWidth, updateWidth, getPos, switchToCenterAlignment]);
239
+ }, [countFrames, isTableScalingEnabled, excludeGuidelineConfig, tableRef, node, editorView, updateActiveGuidelines, containerWidth, updateWidth, getPos, switchToCenterAlignment]);
236
240
  const scheduleResize = useMemo(() => rafSchd(handleResize), [handleResize]);
237
241
  const handleResizeStop = useCallback((originalState, delta) => {
238
242
  var _node$attrs$localId2, _node$attrs2;
@@ -4,7 +4,10 @@ import { calculateDefaultSnappings, calculateDefaultTablePreserveSnappings } fro
4
4
  // NOTE: We have to take 1 pixel off every length due to the fact that the tbody is 1px smaller then the table container.
5
5
  // If we don't do this then the guidelines will not align correctly to the edge of the table
6
6
  export const defaultGuidelines = createFixedGuidelinesFromLengths([0, ...calculateDefaultSnappings(-1)]);
7
- export const defaultGuidelinesForPreserveTable = (editorContainerWidth, excludeInnerGuidelines = false) => {
8
- const lengths = calculateDefaultTablePreserveSnappings(-1, editorContainerWidth, excludeInnerGuidelines);
7
+ export const defaultGuidelinesForPreserveTable = (editorContainerWidth, exclude = {
8
+ innerGuidelines: false,
9
+ breakoutPoints: false
10
+ }) => {
11
+ const lengths = calculateDefaultTablePreserveSnappings(-1, editorContainerWidth, exclude);
9
12
  return createFixedGuidelinesFromLengths(lengths, undefined, true);
10
13
  };
@@ -4,20 +4,29 @@ import { tableResizerWidth } from '../ui/consts';
4
4
  const numberOfLanesInDefaultLayoutWidth = 12;
5
5
  const calculateSubSnappingWidths = (totalLanes, totalWidth) => new Array(Math.round(totalLanes / 2) - 1).fill(totalWidth / totalLanes).map((v, i) => v * (i + 1) * 2);
6
6
  export const calculateDefaultSnappings = (lengthOffset = 0) => [...calculateSubSnappingWidths(numberOfLanesInDefaultLayoutWidth, akEditorDefaultLayoutWidth + lengthOffset), akEditorDefaultLayoutWidth + lengthOffset, akEditorCalculatedWideLayoutWidth + lengthOffset, akEditorFullWidthLayoutWidth + lengthOffset];
7
-
8
7
  // FF TablePreserve for calculateDefaultSnappings
9
- export const calculateDefaultTablePreserveSnappings = (lengthOffset = 0, editorContainerWith = akEditorFullWidthLayoutWidth, excludeInnerGuidelines = false) => {
8
+ export const calculateDefaultTablePreserveSnappings = (lengthOffset = 0, editorContainerWith = akEditorFullWidthLayoutWidth, exclude = {
9
+ innerGuidelines: false,
10
+ breakoutPoints: false
11
+ }) => {
10
12
  const dynamicFullWidthLine = editorContainerWith - akEditorGutterPadding * 2 >= akEditorFullWidthLayoutWidth ? akEditorFullWidthLayoutWidth : editorContainerWith - akEditorGutterPadding * 2 - tableResizerWidth;
11
- if (excludeInnerGuidelines) {
12
- return [akEditorDefaultLayoutWidth + lengthOffset, akEditorCalculatedWideLayoutWidth + lengthOffset, dynamicFullWidthLine - lengthOffset];
13
+ const guides = [dynamicFullWidthLine - lengthOffset];
14
+ if (!exclude.breakoutPoints) {
15
+ guides.unshift(akEditorDefaultLayoutWidth + lengthOffset, akEditorCalculatedWideLayoutWidth + lengthOffset);
16
+ }
17
+ if (!exclude.innerGuidelines) {
18
+ guides.unshift(0, ...calculateSubSnappingWidths(numberOfLanesInDefaultLayoutWidth, akEditorDefaultLayoutWidth + lengthOffset));
13
19
  }
14
- return [0, ...calculateSubSnappingWidths(numberOfLanesInDefaultLayoutWidth, akEditorDefaultLayoutWidth + lengthOffset), akEditorDefaultLayoutWidth + lengthOffset, akEditorCalculatedWideLayoutWidth + lengthOffset, dynamicFullWidthLine - lengthOffset];
20
+ return guides;
15
21
  };
16
22
  export const defaultSnappingWidths = calculateDefaultSnappings();
17
23
 
18
24
  // FF TablePreserve for defaultSnappingWidths
19
- export const defaultTablePreserveSnappingWidths = (editorContainerWidth, excludeInnerGuidelines = false) => {
20
- return editorContainerWidth - akEditorGutterPadding * 2 > akEditorFullWidthLayoutWidth ? calculateDefaultSnappings() : calculateDefaultTablePreserveSnappings(0, editorContainerWidth, excludeInnerGuidelines);
25
+ export const defaultTablePreserveSnappingWidths = (editorContainerWidth, exclude = {
26
+ innerGuidelines: false,
27
+ breakoutPoints: false
28
+ }) => {
29
+ return editorContainerWidth - akEditorGutterPadding * 2 > akEditorFullWidthLayoutWidth ? calculateDefaultSnappings() : calculateDefaultTablePreserveSnappings(0, editorContainerWidth, exclude);
21
30
  };
22
31
 
23
32
  /**
@@ -120,20 +120,26 @@ export var TableResizer = function TableResizer(_ref) {
120
120
  startMeasure = _useMeasureFramerate.startMeasure,
121
121
  endMeasure = _useMeasureFramerate.endMeasure,
122
122
  countFrames = _useMeasureFramerate.countFrames;
123
+ var excludeGuidelineConfig = useMemo(function () {
124
+ return {
125
+ innerGuidelines: !!isTableAlignmentEnabled,
126
+ breakoutPoints: !!(isTableAlignmentEnabled && tableState !== null && tableState !== void 0 && tableState.isFullWidthModeEnabled)
127
+ };
128
+ }, [tableState, isTableAlignmentEnabled]);
123
129
  var updateActiveGuidelines = useCallback(function (_ref3) {
124
130
  var gap = _ref3.gap,
125
131
  keys = _ref3.keys;
126
132
  if (gap !== currentGap.current) {
127
133
  currentGap.current = gap;
128
- var visibleGuidelines = getVisibleGuidelines(isTableScalingEnabled ? defaultGuidelinesForPreserveTable(containerWidth, isTableAlignmentEnabled) : defaultGuidelines, containerWidth);
134
+ var visibleGuidelines = getVisibleGuidelines(isTableScalingEnabled ? defaultGuidelinesForPreserveTable(containerWidth, excludeGuidelineConfig) : defaultGuidelines, containerWidth);
129
135
  displayGuideline(getGuidelinesWithHighlights(gap, TABLE_SNAP_GAP, keys, visibleGuidelines));
130
136
  }
131
- }, [isTableScalingEnabled, isTableAlignmentEnabled, containerWidth, displayGuideline]);
137
+ }, [isTableScalingEnabled, excludeGuidelineConfig, containerWidth, displayGuideline]);
132
138
  var guidelineSnaps = useMemo(function () {
133
139
  return snappingEnabled ? {
134
- x: isTableScalingEnabled ? defaultTablePreserveSnappingWidths(containerWidth, isTableAlignmentEnabled) : defaultSnappingWidths
140
+ x: isTableScalingEnabled ? defaultTablePreserveSnappingWidths(containerWidth, excludeGuidelineConfig) : defaultSnappingWidths
135
141
  } : undefined;
136
- }, [snappingEnabled, isTableScalingEnabled, isTableAlignmentEnabled, containerWidth]);
142
+ }, [snappingEnabled, isTableScalingEnabled, excludeGuidelineConfig, containerWidth]);
137
143
  var switchToCenterAlignment = useCallback(function (pos, node, newWidth, state, dispatch) {
138
144
  if (isTableAlignmentEnabled && node && node.attrs.layout === ALIGN_START && newWidth > lineLength && lineLength < FULL_WIDTH_EDITOR_CONTENT_WIDTH &&
139
145
  // We don't want to switch alignment in Full-width editor
@@ -183,12 +189,12 @@ export var TableResizer = function TableResizer(_ref) {
183
189
  name: TABLE_OVERFLOW_CHANGE_TRIGGER.RESIZED
184
190
  });
185
191
  dispatch(tr);
186
- var visibleGuidelines = getVisibleGuidelines(isTableScalingEnabled ? defaultGuidelinesForPreserveTable(containerWidth, isTableAlignmentEnabled) : defaultGuidelines, containerWidth);
192
+ var visibleGuidelines = getVisibleGuidelines(isTableScalingEnabled ? defaultGuidelinesForPreserveTable(containerWidth, excludeGuidelineConfig) : defaultGuidelines, containerWidth);
187
193
  setSnappingEnabled(displayGuideline(visibleGuidelines));
188
194
  if (onResizeStart) {
189
195
  onResizeStart();
190
196
  }
191
- }, [startMeasure, editorView, displayGapCursor, node.attrs.localId, tableRef, isTableScalingEnabled, isTableAlignmentEnabled, containerWidth, displayGuideline, onResizeStart]);
197
+ }, [startMeasure, editorView, displayGapCursor, node.attrs.localId, tableRef, isTableScalingEnabled, excludeGuidelineConfig, containerWidth, displayGuideline, onResizeStart]);
192
198
  var handleResize = useCallback(function (originalState, delta) {
193
199
  var _node$attrs$localId, _node$attrs;
194
200
  countFrames();
@@ -208,14 +214,14 @@ export var TableResizer = function TableResizer(_ref) {
208
214
  start: pos + 1,
209
215
  parentWidth: newWidth
210
216
  }, editorView.domAtPos.bind(editorView), isTableScalingEnabled);
211
- var closestSnap = findClosestSnap(newWidth, isTableScalingEnabled ? defaultTablePreserveSnappingWidths(containerWidth, isTableAlignmentEnabled) : defaultSnappingWidths, isTableScalingEnabled ? defaultGuidelinesForPreserveTable(containerWidth, isTableAlignmentEnabled) : defaultGuidelines, TABLE_HIGHLIGHT_GAP, TABLE_HIGHLIGHT_TOLERANCE);
217
+ var closestSnap = findClosestSnap(newWidth, isTableScalingEnabled ? defaultTablePreserveSnappingWidths(containerWidth, excludeGuidelineConfig) : defaultSnappingWidths, isTableScalingEnabled ? defaultGuidelinesForPreserveTable(containerWidth, excludeGuidelineConfig) : defaultGuidelines, TABLE_HIGHLIGHT_GAP, TABLE_HIGHLIGHT_TOLERANCE);
212
218
  updateActiveGuidelines(closestSnap);
213
219
 
214
220
  // When snapping to the full width guideline, resize the table to be 1800px
215
221
  var state = editorView.state,
216
222
  dispatch = editorView.dispatch;
217
223
  var currentTableNodeLocalId = (_node$attrs$localId = node === null || node === 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 : '';
218
- var fullWidthGuideline = defaultGuidelinesForPreserveTable(containerWidth, isTableAlignmentEnabled).filter(function (guideline) {
224
+ var fullWidthGuideline = defaultGuidelinesForPreserveTable(containerWidth, excludeGuidelineConfig).filter(function (guideline) {
219
225
  return guideline.isFullWidth;
220
226
  })[0];
221
227
  var isFullWidthGuidelineActive = closestSnap.keys.includes(fullWidthGuideline.key);
@@ -225,7 +231,7 @@ export var TableResizer = function TableResizer(_ref) {
225
231
  }, updateWidthToWidest(_defineProperty({}, currentTableNodeLocalId, shouldUpdateWidthToWidest)))(state, dispatch);
226
232
  updateWidth(shouldUpdateWidthToWidest ? TABLE_MAX_WIDTH : newWidth);
227
233
  return newWidth;
228
- }, [countFrames, isTableScalingEnabled, isTableAlignmentEnabled, tableRef, node, editorView, updateActiveGuidelines, containerWidth, updateWidth, getPos, switchToCenterAlignment]);
234
+ }, [countFrames, isTableScalingEnabled, excludeGuidelineConfig, tableRef, node, editorView, updateActiveGuidelines, containerWidth, updateWidth, getPos, switchToCenterAlignment]);
229
235
  var scheduleResize = useMemo(function () {
230
236
  return rafSchd(handleResize);
231
237
  }, [handleResize]);
@@ -6,7 +6,10 @@ import { calculateDefaultSnappings, calculateDefaultTablePreserveSnappings } fro
6
6
  // If we don't do this then the guidelines will not align correctly to the edge of the table
7
7
  export var defaultGuidelines = createFixedGuidelinesFromLengths([0].concat(_toConsumableArray(calculateDefaultSnappings(-1))));
8
8
  export var defaultGuidelinesForPreserveTable = function defaultGuidelinesForPreserveTable(editorContainerWidth) {
9
- var excludeInnerGuidelines = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
10
- var lengths = calculateDefaultTablePreserveSnappings(-1, editorContainerWidth, excludeInnerGuidelines);
9
+ var exclude = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
10
+ innerGuidelines: false,
11
+ breakoutPoints: false
12
+ };
13
+ var lengths = calculateDefaultTablePreserveSnappings(-1, editorContainerWidth, exclude);
11
14
  return createFixedGuidelinesFromLengths(lengths, undefined, true);
12
15
  };
@@ -12,24 +12,33 @@ export var calculateDefaultSnappings = function calculateDefaultSnappings() {
12
12
  var lengthOffset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
13
13
  return [].concat(_toConsumableArray(calculateSubSnappingWidths(numberOfLanesInDefaultLayoutWidth, akEditorDefaultLayoutWidth + lengthOffset)), [akEditorDefaultLayoutWidth + lengthOffset, akEditorCalculatedWideLayoutWidth + lengthOffset, akEditorFullWidthLayoutWidth + lengthOffset]);
14
14
  };
15
-
16
15
  // FF TablePreserve for calculateDefaultSnappings
17
16
  export var calculateDefaultTablePreserveSnappings = function calculateDefaultTablePreserveSnappings() {
18
17
  var lengthOffset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
19
18
  var editorContainerWith = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : akEditorFullWidthLayoutWidth;
20
- var excludeInnerGuidelines = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
19
+ var exclude = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
20
+ innerGuidelines: false,
21
+ breakoutPoints: false
22
+ };
21
23
  var dynamicFullWidthLine = editorContainerWith - akEditorGutterPadding * 2 >= akEditorFullWidthLayoutWidth ? akEditorFullWidthLayoutWidth : editorContainerWith - akEditorGutterPadding * 2 - tableResizerWidth;
22
- if (excludeInnerGuidelines) {
23
- return [akEditorDefaultLayoutWidth + lengthOffset, akEditorCalculatedWideLayoutWidth + lengthOffset, dynamicFullWidthLine - lengthOffset];
24
+ var guides = [dynamicFullWidthLine - lengthOffset];
25
+ if (!exclude.breakoutPoints) {
26
+ guides.unshift(akEditorDefaultLayoutWidth + lengthOffset, akEditorCalculatedWideLayoutWidth + lengthOffset);
24
27
  }
25
- return [0].concat(_toConsumableArray(calculateSubSnappingWidths(numberOfLanesInDefaultLayoutWidth, akEditorDefaultLayoutWidth + lengthOffset)), [akEditorDefaultLayoutWidth + lengthOffset, akEditorCalculatedWideLayoutWidth + lengthOffset, dynamicFullWidthLine - lengthOffset]);
28
+ if (!exclude.innerGuidelines) {
29
+ guides.unshift.apply(guides, [0].concat(_toConsumableArray(calculateSubSnappingWidths(numberOfLanesInDefaultLayoutWidth, akEditorDefaultLayoutWidth + lengthOffset))));
30
+ }
31
+ return guides;
26
32
  };
27
33
  export var defaultSnappingWidths = calculateDefaultSnappings();
28
34
 
29
35
  // FF TablePreserve for defaultSnappingWidths
30
36
  export var defaultTablePreserveSnappingWidths = function defaultTablePreserveSnappingWidths(editorContainerWidth) {
31
- var excludeInnerGuidelines = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
32
- return editorContainerWidth - akEditorGutterPadding * 2 > akEditorFullWidthLayoutWidth ? calculateDefaultSnappings() : calculateDefaultTablePreserveSnappings(0, editorContainerWidth, excludeInnerGuidelines);
37
+ var exclude = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
38
+ innerGuidelines: false,
39
+ breakoutPoints: false
40
+ };
41
+ return editorContainerWidth - akEditorGutterPadding * 2 > akEditorFullWidthLayoutWidth ? calculateDefaultSnappings() : calculateDefaultTablePreserveSnappings(0, editorContainerWidth, exclude);
33
42
  };
34
43
 
35
44
  /**
@@ -1,3 +1,4 @@
1
1
  import type { GuidelineConfig } from '@atlaskit/editor-common/guideline';
2
+ import type { GuidelineExcludeConfig } from './snapping';
2
3
  export declare const defaultGuidelines: GuidelineConfig[];
3
- export declare const defaultGuidelinesForPreserveTable: (editorContainerWidth: number, excludeInnerGuidelines?: boolean) => GuidelineConfig[];
4
+ export declare const defaultGuidelinesForPreserveTable: (editorContainerWidth: number, exclude?: GuidelineExcludeConfig) => GuidelineConfig[];
@@ -1,8 +1,12 @@
1
1
  import type { GuidelineConfig } from '@atlaskit/editor-common/guideline';
2
2
  export declare const calculateDefaultSnappings: (lengthOffset?: number) => number[];
3
- export declare const calculateDefaultTablePreserveSnappings: (lengthOffset?: number, editorContainerWith?: number, excludeInnerGuidelines?: boolean) => number[];
3
+ export type GuidelineExcludeConfig = {
4
+ innerGuidelines: boolean;
5
+ breakoutPoints: boolean;
6
+ };
7
+ export declare const calculateDefaultTablePreserveSnappings: (lengthOffset?: number, editorContainerWith?: number, exclude?: GuidelineExcludeConfig) => number[];
4
8
  export declare const defaultSnappingWidths: number[];
5
- export declare const defaultTablePreserveSnappingWidths: (editorContainerWidth: number, excludeInnerGuidelines?: boolean) => number[];
9
+ export declare const defaultTablePreserveSnappingWidths: (editorContainerWidth: number, exclude?: GuidelineExcludeConfig) => number[];
6
10
  /**
7
11
  * Returns keys of guidelines that are closest to the table and withthin the snapGap
8
12
  */
@@ -1,3 +1,4 @@
1
1
  import type { GuidelineConfig } from '@atlaskit/editor-common/guideline';
2
+ import type { GuidelineExcludeConfig } from './snapping';
2
3
  export declare const defaultGuidelines: GuidelineConfig[];
3
- export declare const defaultGuidelinesForPreserveTable: (editorContainerWidth: number, excludeInnerGuidelines?: boolean) => GuidelineConfig[];
4
+ export declare const defaultGuidelinesForPreserveTable: (editorContainerWidth: number, exclude?: GuidelineExcludeConfig) => GuidelineConfig[];
@@ -1,8 +1,12 @@
1
1
  import type { GuidelineConfig } from '@atlaskit/editor-common/guideline';
2
2
  export declare const calculateDefaultSnappings: (lengthOffset?: number) => number[];
3
- export declare const calculateDefaultTablePreserveSnappings: (lengthOffset?: number, editorContainerWith?: number, excludeInnerGuidelines?: boolean) => number[];
3
+ export type GuidelineExcludeConfig = {
4
+ innerGuidelines: boolean;
5
+ breakoutPoints: boolean;
6
+ };
7
+ export declare const calculateDefaultTablePreserveSnappings: (lengthOffset?: number, editorContainerWith?: number, exclude?: GuidelineExcludeConfig) => number[];
4
8
  export declare const defaultSnappingWidths: number[];
5
- export declare const defaultTablePreserveSnappingWidths: (editorContainerWidth: number, excludeInnerGuidelines?: boolean) => number[];
9
+ export declare const defaultTablePreserveSnappingWidths: (editorContainerWidth: number, exclude?: GuidelineExcludeConfig) => number[];
6
10
  /**
7
11
  * Returns keys of guidelines that are closest to the table and withthin the snapGap
8
12
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "7.16.9",
3
+ "version": "7.16.10",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -688,7 +688,7 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
688
688
  isDragAndDropEnabled,
689
689
  getEditorFeatureFlags,
690
690
  isTableScalingEnabled, // here we can use options.isTableScalingEnabled
691
- isTableAlignmentEnabled
691
+ isTableAlignmentEnabled,
692
692
  } = this.props;
693
693
 
694
694
  let {
@@ -209,6 +209,16 @@ export const TableResizer = ({
209
209
 
210
210
  const { startMeasure, endMeasure, countFrames } = useMeasureFramerate();
211
211
 
212
+ const excludeGuidelineConfig = useMemo(
213
+ () => ({
214
+ innerGuidelines: !!isTableAlignmentEnabled,
215
+ breakoutPoints: !!(
216
+ isTableAlignmentEnabled && tableState?.isFullWidthModeEnabled
217
+ ),
218
+ }),
219
+ [tableState, isTableAlignmentEnabled],
220
+ );
221
+
212
222
  const updateActiveGuidelines = useCallback(
213
223
  ({ gap, keys }: { gap: number; keys: string[] }) => {
214
224
  if (gap !== currentGap.current) {
@@ -217,7 +227,7 @@ export const TableResizer = ({
217
227
  isTableScalingEnabled
218
228
  ? defaultGuidelinesForPreserveTable(
219
229
  containerWidth,
220
- isTableAlignmentEnabled,
230
+ excludeGuidelineConfig,
221
231
  )
222
232
  : defaultGuidelines,
223
233
  containerWidth,
@@ -235,7 +245,7 @@ export const TableResizer = ({
235
245
  },
236
246
  [
237
247
  isTableScalingEnabled,
238
- isTableAlignmentEnabled,
248
+ excludeGuidelineConfig,
239
249
  containerWidth,
240
250
  displayGuideline,
241
251
  ],
@@ -248,7 +258,7 @@ export const TableResizer = ({
248
258
  x: isTableScalingEnabled
249
259
  ? defaultTablePreserveSnappingWidths(
250
260
  containerWidth,
251
- isTableAlignmentEnabled,
261
+ excludeGuidelineConfig,
252
262
  )
253
263
  : defaultSnappingWidths,
254
264
  }
@@ -256,7 +266,7 @@ export const TableResizer = ({
256
266
  [
257
267
  snappingEnabled,
258
268
  isTableScalingEnabled,
259
- isTableAlignmentEnabled,
269
+ excludeGuidelineConfig,
260
270
  containerWidth,
261
271
  ],
262
272
  );
@@ -334,7 +344,7 @@ export const TableResizer = ({
334
344
  isTableScalingEnabled
335
345
  ? defaultGuidelinesForPreserveTable(
336
346
  containerWidth,
337
- isTableAlignmentEnabled,
347
+ excludeGuidelineConfig,
338
348
  )
339
349
  : defaultGuidelines,
340
350
  containerWidth,
@@ -351,7 +361,7 @@ export const TableResizer = ({
351
361
  node.attrs.localId,
352
362
  tableRef,
353
363
  isTableScalingEnabled,
354
- isTableAlignmentEnabled,
364
+ excludeGuidelineConfig,
355
365
  containerWidth,
356
366
  displayGuideline,
357
367
  onResizeStart,
@@ -388,13 +398,13 @@ export const TableResizer = ({
388
398
  isTableScalingEnabled
389
399
  ? defaultTablePreserveSnappingWidths(
390
400
  containerWidth,
391
- isTableAlignmentEnabled,
401
+ excludeGuidelineConfig,
392
402
  )
393
403
  : defaultSnappingWidths,
394
404
  isTableScalingEnabled
395
405
  ? defaultGuidelinesForPreserveTable(
396
406
  containerWidth,
397
- isTableAlignmentEnabled,
407
+ excludeGuidelineConfig,
398
408
  )
399
409
  : defaultGuidelines,
400
410
  TABLE_HIGHLIGHT_GAP,
@@ -409,7 +419,7 @@ export const TableResizer = ({
409
419
 
410
420
  const fullWidthGuideline = defaultGuidelinesForPreserveTable(
411
421
  containerWidth,
412
- isTableAlignmentEnabled,
422
+ excludeGuidelineConfig,
413
423
  ).filter((guideline) => guideline.isFullWidth)[0];
414
424
 
415
425
  const isFullWidthGuidelineActive = closestSnap.keys.includes(
@@ -434,7 +444,7 @@ export const TableResizer = ({
434
444
  [
435
445
  countFrames,
436
446
  isTableScalingEnabled,
437
- isTableAlignmentEnabled,
447
+ excludeGuidelineConfig,
438
448
  tableRef,
439
449
  node,
440
450
  editorView,
@@ -1,6 +1,7 @@
1
1
  import { createFixedGuidelinesFromLengths } from '@atlaskit/editor-common/guideline';
2
2
  import type { GuidelineConfig } from '@atlaskit/editor-common/guideline';
3
3
 
4
+ import type { GuidelineExcludeConfig } from './snapping';
4
5
  import {
5
6
  calculateDefaultSnappings,
6
7
  calculateDefaultTablePreserveSnappings,
@@ -15,12 +16,15 @@ export const defaultGuidelines = createFixedGuidelinesFromLengths([
15
16
 
16
17
  export const defaultGuidelinesForPreserveTable = (
17
18
  editorContainerWidth: number,
18
- excludeInnerGuidelines = false,
19
+ exclude: GuidelineExcludeConfig = {
20
+ innerGuidelines: false,
21
+ breakoutPoints: false,
22
+ },
19
23
  ) => {
20
24
  const lengths = calculateDefaultTablePreserveSnappings(
21
25
  -1,
22
26
  editorContainerWidth,
23
- excludeInnerGuidelines,
27
+ exclude,
24
28
  );
25
29
 
26
30
  return createFixedGuidelinesFromLengths(
@@ -26,11 +26,19 @@ export const calculateDefaultSnappings = (lengthOffset: number = 0) => [
26
26
  akEditorFullWidthLayoutWidth + lengthOffset,
27
27
  ];
28
28
 
29
+ export type GuidelineExcludeConfig = {
30
+ innerGuidelines: boolean;
31
+ breakoutPoints: boolean;
32
+ };
33
+
29
34
  // FF TablePreserve for calculateDefaultSnappings
30
35
  export const calculateDefaultTablePreserveSnappings = (
31
- lengthOffset: number = 0,
32
- editorContainerWith: number = akEditorFullWidthLayoutWidth,
33
- excludeInnerGuidelines = false,
36
+ lengthOffset = 0,
37
+ editorContainerWith = akEditorFullWidthLayoutWidth,
38
+ exclude: GuidelineExcludeConfig = {
39
+ innerGuidelines: false,
40
+ breakoutPoints: false,
41
+ },
34
42
  ) => {
35
43
  const dynamicFullWidthLine =
36
44
  editorContainerWith - akEditorGutterPadding * 2 >=
@@ -38,24 +46,26 @@ export const calculateDefaultTablePreserveSnappings = (
38
46
  ? akEditorFullWidthLayoutWidth
39
47
  : editorContainerWith - akEditorGutterPadding * 2 - tableResizerWidth;
40
48
 
41
- if (excludeInnerGuidelines) {
42
- return [
49
+ const guides = [dynamicFullWidthLine - lengthOffset];
50
+
51
+ if (!exclude.breakoutPoints) {
52
+ guides.unshift(
43
53
  akEditorDefaultLayoutWidth + lengthOffset,
44
54
  akEditorCalculatedWideLayoutWidth + lengthOffset,
45
- dynamicFullWidthLine - lengthOffset,
46
- ];
55
+ );
47
56
  }
48
57
 
49
- return [
50
- 0,
51
- ...calculateSubSnappingWidths(
52
- numberOfLanesInDefaultLayoutWidth,
53
- akEditorDefaultLayoutWidth + lengthOffset,
54
- ),
55
- akEditorDefaultLayoutWidth + lengthOffset,
56
- akEditorCalculatedWideLayoutWidth + lengthOffset,
57
- dynamicFullWidthLine - lengthOffset,
58
- ];
58
+ if (!exclude.innerGuidelines) {
59
+ guides.unshift(
60
+ 0,
61
+ ...calculateSubSnappingWidths(
62
+ numberOfLanesInDefaultLayoutWidth,
63
+ akEditorDefaultLayoutWidth + lengthOffset,
64
+ ),
65
+ );
66
+ }
67
+
68
+ return guides;
59
69
  };
60
70
 
61
71
  export const defaultSnappingWidths = calculateDefaultSnappings();
@@ -63,7 +73,10 @@ export const defaultSnappingWidths = calculateDefaultSnappings();
63
73
  // FF TablePreserve for defaultSnappingWidths
64
74
  export const defaultTablePreserveSnappingWidths = (
65
75
  editorContainerWidth: number,
66
- excludeInnerGuidelines = false,
76
+ exclude: GuidelineExcludeConfig = {
77
+ innerGuidelines: false,
78
+ breakoutPoints: false,
79
+ },
67
80
  ) => {
68
81
  return editorContainerWidth - akEditorGutterPadding * 2 >
69
82
  akEditorFullWidthLayoutWidth
@@ -71,7 +84,7 @@ export const defaultTablePreserveSnappingWidths = (
71
84
  : calculateDefaultTablePreserveSnappings(
72
85
  0,
73
86
  editorContainerWidth,
74
- excludeInnerGuidelines,
87
+ exclude,
75
88
  );
76
89
  };
77
90