@atlaskit/editor-plugin-table 22.2.5 → 22.2.7

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 (33) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cjs/nodeviews/TableContainer.js +16 -7
  3. package/dist/cjs/nodeviews/TableResizer.js +30 -16
  4. package/dist/cjs/pm-plugins/table-resizing/utils/colgroup.js +6 -6
  5. package/dist/cjs/pm-plugins/table-resizing/utils/consts.js +3 -2
  6. package/dist/cjs/pm-plugins/table-resizing/utils/scale-table.js +4 -4
  7. package/dist/es2019/nodeviews/TableContainer.js +17 -8
  8. package/dist/es2019/nodeviews/TableResizer.js +31 -17
  9. package/dist/es2019/pm-plugins/table-resizing/utils/colgroup.js +6 -6
  10. package/dist/es2019/pm-plugins/table-resizing/utils/consts.js +2 -1
  11. package/dist/es2019/pm-plugins/table-resizing/utils/scale-table.js +4 -4
  12. package/dist/esm/nodeviews/TableContainer.js +17 -8
  13. package/dist/esm/nodeviews/TableResizer.js +31 -17
  14. package/dist/esm/pm-plugins/table-resizing/utils/colgroup.js +6 -6
  15. package/dist/esm/pm-plugins/table-resizing/utils/consts.js +2 -1
  16. package/dist/esm/pm-plugins/table-resizing/utils/scale-table.js +4 -4
  17. package/dist/types/nodeviews/TableResizer.d.ts +2 -1
  18. package/dist/types/pm-plugins/drag-and-drop/utils/autoscrollers.d.ts +1 -1
  19. package/dist/types/pm-plugins/table-resizing/utils/colgroup.d.ts +2 -2
  20. package/dist/types/pm-plugins/table-resizing/utils/consts.d.ts +1 -0
  21. package/dist/types/pm-plugins/table-resizing/utils/scale-table.d.ts +2 -2
  22. package/dist/types/types/index.d.ts +26 -26
  23. package/dist/types/ui/ColumnResizeWidget/index.d.ts +1 -1
  24. package/dist/types/ui/consts.d.ts +17 -17
  25. package/dist/types-ts4.5/nodeviews/TableResizer.d.ts +2 -1
  26. package/dist/types-ts4.5/pm-plugins/drag-and-drop/utils/autoscrollers.d.ts +1 -1
  27. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/colgroup.d.ts +2 -2
  28. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/consts.d.ts +1 -0
  29. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/scale-table.d.ts +2 -2
  30. package/dist/types-ts4.5/types/index.d.ts +26 -26
  31. package/dist/types-ts4.5/ui/ColumnResizeWidget/index.d.ts +1 -1
  32. package/dist/types-ts4.5/ui/consts.d.ts +17 -17
  33. package/package.json +4 -4
@@ -11,7 +11,7 @@ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
11
11
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
12
12
  import { setTableAlignmentWithTableContentWithPosWithAnalytics } from '../pm-plugins/commands/commands-with-analytics';
13
13
  import { getPluginState } from '../pm-plugins/plugin-factory';
14
- import { TABLE_MAX_WIDTH, TABLE_FULL_WIDTH, TABLE_OFFSET_IN_COMMENT_EDITOR } from '../pm-plugins/table-resizing/utils/consts';
14
+ import { TABLE_MAX_WIDTH, TABLE_FULL_WIDTH, TABLE_OFFSET_IN_COMMENT_EDITOR, RESIZE_HANDLE_SPACING } from '../pm-plugins/table-resizing/utils/consts';
15
15
  import { getTableResizerContainerMaxWidthInCSS, getTableResizerContainerForFullPageWidthInCSS } from '../pm-plugins/table-resizing/utils/misc';
16
16
  import { ALIGN_CENTER, ALIGN_START } from '../pm-plugins/utils/alignment';
17
17
  import { TableCssClassName as ClassName } from '../types';
@@ -208,7 +208,6 @@ export var ResizableTableContainer = /*#__PURE__*/React.memo(function (_ref4) {
208
208
  var isFullPageAppearance = !isCommentEditor && !isChromelessEditor;
209
209
  var _useMemo = useMemo(function () {
210
210
  var responsiveContainerWidth = 0;
211
- var resizeHandleSpacing = 12;
212
211
  var padding = getPadding(containerWidth);
213
212
  // When Full width or Max width editor enabled, a Mac OS user can change "ak-editor-content-area" width by
214
213
  // updating Settings -> Appearance -> Show scroll bars from "When scrolling" to "Always". It causes
@@ -226,30 +225,39 @@ export var ResizableTableContainer = /*#__PURE__*/React.memo(function (_ref4) {
226
225
  if (isTableScalingEnabled && Number.isFinite(lineLength) && lineLength !== undefined) {
227
226
  responsiveContainerWidth = lineLength;
228
227
  } else {
229
- responsiveContainerWidth = containerWidth - padding * 2 - resizeHandleSpacing;
228
+ responsiveContainerWidth = containerWidth - padding * 2 - RESIZE_HANDLE_SPACING;
230
229
  }
231
230
  } else if (isCommentEditor) {
232
231
  responsiveContainerWidth = containerWidth - TABLE_OFFSET_IN_COMMENT_EDITOR;
232
+ } else if (isChromelessEditor && expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true)) {
233
+ // there's no padding included in chromeless appearance, so we need to reduce table
234
+ // width to ensure all controls are visible.
235
+ // use lineLength as the value is updated by scrollbar visibility changes
236
+ responsiveContainerWidth = Number.isFinite(lineLength) && lineLength !== undefined ? lineLength : containerWidth - RESIZE_HANDLE_SPACING;
233
237
  } else {
234
238
  // 76 is currently an accepted padding value considering the spacing for resizer handle
235
239
  // containerWidth = width of a DIV with test id="ak-editor-fp-content-area". It is a parent of
236
240
  // a DIV with className="ak-editor-content-area". This DIV has padding left and padding right.
237
241
  // padding left = padding right = akEditorGutterPadding = 32
238
- responsiveContainerWidth = isTableScalingEnabled ? containerWidth - padding * 2 : containerWidth - padding * 2 - resizeHandleSpacing;
242
+ responsiveContainerWidth = isTableScalingEnabled ? containerWidth - padding * 2 : containerWidth - padding * 2 - RESIZE_HANDLE_SPACING;
239
243
  }
240
244
 
241
245
  // Fix for HOT-119925: Ensure table width is properly constrained and responsive
242
246
  // For wide tables, ensure they don't exceed container width and can be scrolled
243
- var calculatedWidth = !node.attrs.width && isCommentEditor ? responsiveContainerWidth : Math.min(tableWidth, responsiveContainerWidth);
247
+ var calculatedWidth =
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);
244
250
 
245
251
  // Ensure minimum width for usability while respecting container constraints
246
252
  var width = Math.max(calculatedWidth, Math.min(responsiveContainerWidth * 0.5, 300));
247
- var maxResizerWidth = 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);
253
+
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);
248
256
  return {
249
257
  width: width,
250
258
  maxResizerWidth: maxResizerWidth
251
259
  };
252
- }, [containerWidth, isCommentEditor, isFullWidthModeEnabled, isMaxWidthModeEnabled, isTableScalingEnabled, lineLength, node.attrs.width, tableWidth]),
260
+ }, [containerWidth, isCommentEditor, isChromelessEditor, isFullWidthModeEnabled, isMaxWidthModeEnabled, isFullPageAppearance, isTableScalingEnabled, lineLength, node.attrs.width, tableWidth]),
253
261
  width = _useMemo.width,
254
262
  maxResizerWidth = _useMemo.maxResizerWidth;
255
263
  useEffect(function () {
@@ -299,7 +307,8 @@ export var ResizableTableContainer = /*#__PURE__*/React.memo(function (_ref4) {
299
307
  pluginInjectionApi: pluginInjectionApi,
300
308
  onResizeStart: onResizeStart,
301
309
  onResizeStop: onResizeStop,
302
- isCommentEditor: isCommentEditor
310
+ isCommentEditor: isCommentEditor,
311
+ isChromelessEditor: isChromelessEditor
303
312
  };
304
313
  var isLivePageViewMode = mode === 'view';
305
314
  return /*#__PURE__*/React.createElement(AlignmentTableContainerWrapper, {
@@ -24,7 +24,7 @@ import { setTableAlignmentWithTableContentWithPosWithAnalytics } from '../pm-plu
24
24
  import { updateWidthToWidest } from '../pm-plugins/commands/misc';
25
25
  import { META_KEYS } from '../pm-plugins/table-analytics';
26
26
  import { getColgroupChildrenLength } from '../pm-plugins/table-resizing/utils/colgroup';
27
- import { COLUMN_MIN_WIDTH, TABLE_MAX_WIDTH, TABLE_FULL_WIDTH, TABLE_OFFSET_IN_COMMENT_EDITOR } from '../pm-plugins/table-resizing/utils/consts';
27
+ import { COLUMN_MIN_WIDTH, TABLE_MAX_WIDTH, TABLE_FULL_WIDTH, TABLE_OFFSET_IN_COMMENT_EDITOR, RESIZE_HANDLE_SPACING } from '../pm-plugins/table-resizing/utils/consts';
28
28
  import { previewScaleTable, scaleTable } from '../pm-plugins/table-resizing/utils/scale-table';
29
29
  import { pluginKey as tableWidthPluginKey } from '../pm-plugins/table-width';
30
30
  import { ALIGN_CENTER, ALIGN_START, normaliseAlignment, shouldChangeAlignmentToCenterResized } from '../pm-plugins/utils/alignment';
@@ -47,12 +47,12 @@ var getResizerHandleHeight = function getResizerHandleHeight(tableRef) {
47
47
  var _tableRef$clientHeigh;
48
48
  var tableHeight = (_tableRef$clientHeigh = tableRef === null || tableRef === void 0 ? void 0 : tableRef.clientHeight) !== null && _tableRef$clientHeigh !== void 0 ? _tableRef$clientHeigh : 0;
49
49
  /*
50
- - One row table height (minimum possible table height) ~ 45px
51
- - Two row table height ~ 90px
52
- - Three row table height ~ 134px
53
- In the if below we need to use:
54
- - > 46 because the height of the table can be a float number like 45.44.
55
- - < 96 is the height of large resize handle.
50
+ - One row table height (minimum possible table height) ~ 45px
51
+ - Two row table height ~ 90px
52
+ - Three row table height ~ 134px
53
+ In the if below we need to use:
54
+ - > 46 because the height of the table can be a float number like 45.44.
55
+ - < 96 is the height of large resize handle.
56
56
  */
57
57
  if (tableHeight >= 96) {
58
58
  return 'large';
@@ -74,6 +74,15 @@ var getPadding = function getPadding(containerWidth) {
74
74
  exposure: true
75
75
  }) ? akEditorGutterPaddingReduced : akEditorGutterPaddingDynamic();
76
76
  };
77
+ var getTableMaxWidth = function getTableMaxWidth(containerWidth, lineLength, isCommentEditor, isChromelessEditor) {
78
+ if (isCommentEditor) {
79
+ return Math.floor(containerWidth - TABLE_OFFSET_IN_COMMENT_EDITOR);
80
+ } else if (isChromelessEditor) {
81
+ return Number.isFinite(lineLength) && lineLength !== undefined ? lineLength : Math.floor(containerWidth - RESIZE_HANDLE_SPACING);
82
+ } else {
83
+ return expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true) ? TABLE_MAX_WIDTH : TABLE_FULL_WIDTH;
84
+ }
85
+ };
77
86
 
78
87
  /**
79
88
  * When guidelines are outside the viewport, filter them out, do not show
@@ -134,6 +143,7 @@ export var TableResizer = function TableResizer(_ref) {
134
143
  pluginInjectionApi = _ref.pluginInjectionApi,
135
144
  isFullWidthModeEnabled = _ref.isFullWidthModeEnabled,
136
145
  isCommentEditor = _ref.isCommentEditor,
146
+ isChromelessEditor = _ref.isChromelessEditor,
137
147
  disabled = _ref.disabled;
138
148
  var currentGap = useRef(0);
139
149
  // track resizing state - use ref over state to avoid re-render
@@ -152,6 +162,7 @@ export var TableResizer = function TableResizer(_ref) {
152
162
  setSnappingEnabled = _useState2[1];
153
163
  var _useIntl = useIntl(),
154
164
  formatMessage = _useIntl.formatMessage;
165
+ var isFullPageAppearance = !isCommentEditor && !isChromelessEditor;
155
166
  var currentSelection = (_editorView$state = editorView.state) === null || _editorView$state === void 0 ? void 0 : _editorView$state.selection;
156
167
  var tableFromSelection = useMemo(function () {
157
168
  return findTable(currentSelection);
@@ -283,7 +294,9 @@ export var TableResizer = function TableResizer(_ref) {
283
294
  return;
284
295
  }
285
296
  var editorContainerWidth = isFullWidthModeEnabled ? lineLength + 2 * getPadding(containerWidth) : containerWidth;
286
- 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);
297
+ var closestSnap =
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);
287
300
  closestSnap && updateActiveGuidelines(closestSnap);
288
301
 
289
302
  // When snapping to the full width guideline, resize the table to be 1800px
@@ -294,21 +307,21 @@ export var TableResizer = function TableResizer(_ref) {
294
307
  return guideline.isFullWidth;
295
308
  })[0];
296
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);
297
- var tableMaxWidth = 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;
298
- var shouldUpdateWidthToWidest = isCommentEditor ? tableMaxWidth <= newWidth : !!isTableScalingEnabled && isFullWidthGuidelineActive;
299
- var previewParentWidth = isCommentEditor && shouldUpdateWidthToWidest ? tableMaxWidth : newWidth;
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;
300
313
  previewScaleTable(tableRef, {
301
314
  node: node,
302
315
  prevNode: node,
303
316
  start: pos + 1,
304
317
  parentWidth: previewParentWidth
305
- }, editorView.domAtPos.bind(editorView), isTableScalingEnabled, allowFixedColumnWidthOption, isCommentEditor);
318
+ }, editorView.domAtPos.bind(editorView), isTableScalingEnabled, allowFixedColumnWidthOption, expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) ? !isFullPageAppearance : isCommentEditor);
306
319
  chainCommands(function (state, dispatch) {
307
320
  return switchToCenterAlignment(pos, node, newWidth, state, dispatch);
308
321
  }, updateWidthToWidest(_defineProperty({}, currentTableNodeLocalId, shouldUpdateWidthToWidest)))(state, dispatch);
309
322
  updateWidth(shouldUpdateWidthToWidest ? tableMaxWidth : newWidth);
310
323
  return newWidth;
311
- }, [countFrames, isCommentEditor, isTableScalingEnabled, allowFixedColumnWidthOption, isFullWidthModeEnabled, excludeGuidelineConfig, tableRef, node, editorView, updateActiveGuidelines, containerWidth, lineLength, updateWidth, getPos, switchToCenterAlignment]);
324
+ }, [countFrames, isCommentEditor, isChromelessEditor, isFullPageAppearance, isTableScalingEnabled, allowFixedColumnWidthOption, isFullWidthModeEnabled, excludeGuidelineConfig, tableRef, node, editorView, updateActiveGuidelines, containerWidth, lineLength, updateWidth, getPos, switchToCenterAlignment]);
312
325
  var scheduleResize = useMemo(function () {
313
326
  return rafSchd(handleResize);
314
327
  }, [handleResize]);
@@ -321,7 +334,7 @@ export var TableResizer = function TableResizer(_ref) {
321
334
  dispatch = editorView.dispatch;
322
335
  var pos = getPos();
323
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 : '';
324
- var tableMaxWidth = 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) && !isFullPageAppearance || isCommentEditor ? undefined // Table's full-width in comment appearance inherit the width of the Editor/Renderer
325
338
  : expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true) ? TABLE_MAX_WIDTH : TABLE_FULL_WIDTH;
326
339
  newWidth = widthToWidest && currentTableNodeLocalId && widthToWidest[currentTableNodeLocalId] ? tableMaxWidth : newWidth;
327
340
  var tr = state.tr.setMeta(tableWidthPluginKey, {
@@ -362,8 +375,9 @@ export var TableResizer = function TableResizer(_ref) {
362
375
  // We use originalNewWidth in comment editor, because in comment editor
363
376
  // newWidth can be underined when table is resized to 'full-width'
364
377
  // scaleTable function needs number value to work correctly.
365
- parentWidth: isCommentEditor ? originalNewWidth : newWidth
366
- }, editorView.domAtPos.bind(editorView), pluginInjectionApi, isTableScalingEnabled, shouldUseIncreasedScalingPercent || false, isCommentEditor)(tr);
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);
367
381
 
368
382
  // Ignored via go/ees005
369
383
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
@@ -399,7 +413,7 @@ export var TableResizer = function TableResizer(_ref) {
399
413
  (_insm$session2 = insm.session) === null || _insm$session2 === void 0 || _insm$session2.endFeature('tableResize');
400
414
  }
401
415
  return newWidth;
402
- }, [editorView, getPos, node, isCommentEditor, widthToWidest, endMeasure, displayGapCursor, displayGuideline, updateWidth, scheduleResize, onResizeStop, pluginInjectionApi, attachAnalyticsEvent, tableRef, isTableScalingEnabled, shouldUseIncreasedScalingPercent, formatMessage]);
416
+ }, [editorView, getPos, node, isCommentEditor, widthToWidest, endMeasure, displayGapCursor, displayGuideline, updateWidth, scheduleResize, onResizeStop, pluginInjectionApi, attachAnalyticsEvent, tableRef, isTableScalingEnabled, shouldUseIncreasedScalingPercent, formatMessage, isFullPageAppearance]);
403
417
  var handleTableSizeChangeOnKeypress = useCallback(function (step) {
404
418
  var newWidth = width + step;
405
419
  if (newWidth < resizerMinWidth) {
@@ -94,7 +94,7 @@ export var generateColgroupFromNode = function generateColgroupFromNode(table, i
94
94
  });
95
95
  return cols;
96
96
  };
97
- export var generateColgroup = function generateColgroup(table, tableRef, shouldUseIncreasedScalingPercent, isCommentEditor) {
97
+ export var generateColgroup = function generateColgroup(table, tableRef, shouldUseIncreasedScalingPercent, isCommentOrChromelessEditor) {
98
98
  var cols = [];
99
99
  var map = TableMap.get(table);
100
100
 
@@ -109,7 +109,7 @@ export var generateColgroup = function generateColgroup(table, tableRef, shouldU
109
109
  var _table$attrs;
110
110
  // if we have tableRef here, isTableScalingEnabled is true
111
111
  var scalePercent = 1;
112
- if (isCommentEditor && !((_table$attrs = table.attrs) !== null && _table$attrs !== void 0 && _table$attrs.width)) {
112
+ if (isCommentOrChromelessEditor && !((_table$attrs = table.attrs) !== null && _table$attrs !== void 0 && _table$attrs.width)) {
113
113
  scalePercent = getScalingPercentForTableWithoutWidth(table, tableRef);
114
114
  } else {
115
115
  scalePercent = getTableScalingPercent(table, tableRef, shouldUseIncreasedScalingPercent);
@@ -149,14 +149,14 @@ export var insertColgroupFromNode = function insertColgroupFromNode(tableRef, ta
149
149
  var isTableScalingEnabled = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
150
150
  var shouldRemove = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
151
151
  var shouldUseIncreasedScalingPercent = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
152
- var isCommentEditor = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
152
+ var isCommentOrChromelessEditor = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
153
153
  // Ignored via go/ees005
154
154
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
155
155
  var colgroup = tableRef === null || tableRef === void 0 ? void 0 : tableRef.querySelector('colgroup');
156
156
  if (colgroup && shouldRemove) {
157
157
  tableRef === null || tableRef === void 0 || tableRef.removeChild(colgroup);
158
158
  }
159
- colgroup = renderColgroupFromNode(table, isTableScalingEnabled ? tableRef !== null && tableRef !== void 0 ? tableRef : undefined : undefined, shouldUseIncreasedScalingPercent, isCommentEditor);
159
+ colgroup = renderColgroupFromNode(table, isTableScalingEnabled ? tableRef !== null && tableRef !== void 0 ? tableRef : undefined : undefined, shouldUseIncreasedScalingPercent, isCommentOrChromelessEditor);
160
160
  if (shouldRemove) {
161
161
  tableRef === null || tableRef === void 0 || tableRef.insertBefore(colgroup, tableRef === null || tableRef === void 0 ? void 0 : tableRef.firstChild);
162
162
  }
@@ -186,8 +186,8 @@ export var isMinCellWidthTable = function isMinCellWidthTable(table) {
186
186
  });
187
187
  return isTableMinCellWidth;
188
188
  };
189
- function renderColgroupFromNode(table, maybeTableRef, shouldUseIncreasedScalingPercent, isCommentEditor) {
190
- var rendered = DOMSerializer.renderSpec(document, ['colgroup', {}].concat(_toConsumableArray(generateColgroup(table, maybeTableRef, shouldUseIncreasedScalingPercent, isCommentEditor))));
189
+ function renderColgroupFromNode(table, maybeTableRef, shouldUseIncreasedScalingPercent, isCommentOrChromelessEditor) {
190
+ var rendered = DOMSerializer.renderSpec(document, ['colgroup', {}].concat(_toConsumableArray(generateColgroup(table, maybeTableRef, shouldUseIncreasedScalingPercent, isCommentOrChromelessEditor))));
191
191
 
192
192
  // Ignored via go/ees005
193
193
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
@@ -8,4 +8,5 @@ export var MAX_SCALING_PERCENT_TABLES_WITH_FIXED_COLUMN_WIDTHS_OPTION = 0.4;
8
8
  export var TABLE_EDITOR_MARGIN = 76;
9
9
  var COMMENT_AK_EDITOR_CONTENT_AREA_PADDING = 20;
10
10
  var COMMENT_PM_TABLE_RESIZING_PLUGIN_MARGIN = 12;
11
- export var TABLE_OFFSET_IN_COMMENT_EDITOR = 2 * (COMMENT_AK_EDITOR_CONTENT_AREA_PADDING + COMMENT_PM_TABLE_RESIZING_PLUGIN_MARGIN);
11
+ export var TABLE_OFFSET_IN_COMMENT_EDITOR = 2 * (COMMENT_AK_EDITOR_CONTENT_AREA_PADDING + COMMENT_PM_TABLE_RESIZING_PLUGIN_MARGIN);
12
+ export var RESIZE_HANDLE_SPACING = 12;
@@ -107,7 +107,7 @@ export function scaleTableTo(state, maxSize) {
107
107
  export var previewScaleTable = function previewScaleTable(tableRef, options, domAtPos) {
108
108
  var isTableScalingEnabled = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
109
109
  var allowFixedColumnWidthOption = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
110
- var isCommentEditor = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
110
+ var isCommentOrChromelessEditor = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
111
111
  var node = options.node,
112
112
  start = options.start,
113
113
  parentWidth = options.parentWidth;
@@ -130,7 +130,7 @@ export var previewScaleTable = function previewScaleTable(tableRef, options, dom
130
130
  syncStickyRowToTable(tableRef);
131
131
  return;
132
132
  }
133
- var shouldUseIncreasedScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled || isTableScalingEnabled && isCommentEditor;
133
+ var shouldUseIncreasedScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled || isTableScalingEnabled && isCommentOrChromelessEditor;
134
134
  var resizeState = parentWidth ? scaleWithParent(tableRef, parentWidth, node, start, domAtPos, false,
135
135
  // Here isTableScalingEnabled = false
136
136
  shouldUseIncreasedScalingPercent) : scale(tableRef, options, domAtPos, false, shouldUseIncreasedScalingPercent);
@@ -143,7 +143,7 @@ export var previewScaleTable = function previewScaleTable(tableRef, options, dom
143
143
  export var scaleTable = function scaleTable(tableRef, options, domAtPos, api) {
144
144
  var isTableScalingEnabledOnCurrentTable = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
145
145
  var shouldUseIncreasedScalingPercent = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
146
- var isCommentEditor = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
146
+ var isCommentOrChromelessEditor = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
147
147
  return function (tr) {
148
148
  if (!tableRef) {
149
149
  return tr;
@@ -158,7 +158,7 @@ export var scaleTable = function scaleTable(tableRef, options, domAtPos, api) {
158
158
  // To force reflow of columns upon delete.
159
159
  if (!isTableScalingEnabledOnCurrentTable) {
160
160
  var isTableScalingEnabled = false;
161
- insertColgroupFromNode(tableRef, node, isTableScalingEnabled, undefined, shouldUseIncreasedScalingPercent, isCommentEditor);
161
+ insertColgroupFromNode(tableRef, node, isTableScalingEnabled, undefined, shouldUseIncreasedScalingPercent, isCommentOrChromelessEditor);
162
162
  }
163
163
  tr.setMeta('scrollIntoView', false);
164
164
  return tr;
@@ -15,6 +15,7 @@ interface TableResizerProps {
15
15
  displayGuideline: (guideline: GuidelineConfig[]) => boolean;
16
16
  editorView: EditorView;
17
17
  getPos: () => number | undefined;
18
+ isChromelessEditor?: boolean;
18
19
  isCommentEditor?: boolean;
19
20
  isFullWidthModeEnabled?: boolean;
20
21
  isTableAlignmentEnabled?: boolean;
@@ -31,5 +32,5 @@ interface TableResizerProps {
31
32
  updateWidth: (width: number) => void;
32
33
  width: number;
33
34
  }
34
- export declare const TableResizer: ({ children, width, maxWidth, containerWidth, lineLength, updateWidth, onResizeStop, onResizeStart, editorView, getPos, node, tableRef, displayGuideline, attachAnalyticsEvent, displayGapCursor, isTableScalingEnabled, allowFixedColumnWidthOption, isTableAlignmentEnabled, isWholeTableInDanger, shouldUseIncreasedScalingPercent, pluginInjectionApi, isFullWidthModeEnabled, isCommentEditor, disabled, }: PropsWithChildren<TableResizerProps>) => React.JSX.Element;
35
+ export declare const TableResizer: ({ children, width, maxWidth, containerWidth, lineLength, updateWidth, onResizeStop, onResizeStart, editorView, getPos, node, tableRef, displayGuideline, attachAnalyticsEvent, displayGapCursor, isTableScalingEnabled, allowFixedColumnWidthOption, isTableAlignmentEnabled, isWholeTableInDanger, shouldUseIncreasedScalingPercent, pluginInjectionApi, isFullWidthModeEnabled, isCommentEditor, isChromelessEditor, disabled, }: PropsWithChildren<TableResizerProps>) => React.JSX.Element;
35
36
  export {};
@@ -4,5 +4,5 @@ type AutoScrollerFactory = {
4
4
  getNode: () => PmNode;
5
5
  tableWrapper: HTMLElement;
6
6
  };
7
- export declare const autoScrollerFactory: ({ tableWrapper, getNode }: AutoScrollerFactory) => CleanupFn[];
7
+ export declare const autoScrollerFactory: ({ tableWrapper, getNode, }: AutoScrollerFactory) => CleanupFn[];
8
8
  export {};
@@ -10,8 +10,8 @@ type Col = Array<string | {
10
10
  */
11
11
  export declare const getColWidthFix: (colwidth: number, tableColumnCount: number) => number;
12
12
  export declare const generateColgroupFromNode: (table: PmNode, isCommentEditor?: boolean, isChromelessEditor?: boolean, isNested?: boolean, isTableScalingEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Col[];
13
- export declare const generateColgroup: (table: PmNode, tableRef?: HTMLElement, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean) => Col[];
14
- export declare const insertColgroupFromNode: (tableRef: HTMLTableElement | null, table: PmNode, isTableScalingEnabled?: boolean, shouldRemove?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean) => HTMLCollection;
13
+ export declare const generateColgroup: (table: PmNode, tableRef?: HTMLElement, shouldUseIncreasedScalingPercent?: boolean, isCommentOrChromelessEditor?: boolean) => Col[];
14
+ export declare const insertColgroupFromNode: (tableRef: HTMLTableElement | null, table: PmNode, isTableScalingEnabled?: boolean, shouldRemove?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentOrChromelessEditor?: boolean) => HTMLCollection;
15
15
  export declare const hasTableBeenResized: (table: PmNode) => boolean;
16
16
  export declare const hasTableColumnBeenResized: (table: PmNode) => boolean;
17
17
  /**
@@ -6,3 +6,4 @@ export declare const MAX_SCALING_PERCENT = 0.3;
6
6
  export declare const MAX_SCALING_PERCENT_TABLES_WITH_FIXED_COLUMN_WIDTHS_OPTION = 0.4;
7
7
  export declare const TABLE_EDITOR_MARGIN = 76;
8
8
  export declare const TABLE_OFFSET_IN_COMMENT_EDITOR: number;
9
+ export declare const RESIZE_HANDLE_SPACING = 12;
@@ -15,6 +15,6 @@ interface ScaleOptions {
15
15
  start: number;
16
16
  }
17
17
  export declare function scaleTableTo(state: ResizeState, maxSize: number): ResizeState;
18
- export declare const previewScaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos, isTableScalingEnabled?: boolean, allowFixedColumnWidthOption?: boolean, isCommentEditor?: boolean) => void;
19
- export declare const scaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos, api: PluginInjectionAPI | undefined | null, isTableScalingEnabledOnCurrentTable?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean) => (tr: Transaction) => Transaction;
18
+ export declare const previewScaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos, isTableScalingEnabled?: boolean, allowFixedColumnWidthOption?: boolean, isCommentOrChromelessEditor?: boolean) => void;
19
+ export declare const scaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos, api: PluginInjectionAPI | undefined | null, isTableScalingEnabledOnCurrentTable?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentOrChromelessEditor?: boolean) => (tr: Transaction) => Transaction;
20
20
  export {};
@@ -404,8 +404,8 @@ export declare const TableCssClassName: {
404
404
  SELECTED_CELL: string;
405
405
  NODEVIEW_WRAPPER: string;
406
406
  TABLE_SELECTED: string;
407
- TABLE_CELL: "pm-table-cell-content-wrap";
408
- TABLE_HEADER_CELL: "pm-table-header-content-wrap";
407
+ TABLE_CELL: 'pm-table-cell-content-wrap';
408
+ TABLE_HEADER_CELL: 'pm-table-header-content-wrap';
409
409
  TABLE_STICKY: string;
410
410
  TABLE_CHROMELESS: string;
411
411
  TOP_LEFT_CELL: string;
@@ -427,30 +427,30 @@ export declare const TableCssClassName: {
427
427
  NATIVE_STICKY: string;
428
428
  NATIVE_STICKY_ACTIVE: string;
429
429
  NO_OVERFLOW: string;
430
- TABLE_CELL_NODEVIEW_CONTENT_DOM: "pm-table-cell-nodeview-content-dom";
431
- TABLE_CELL_WRAPPER: "pm-table-cell-content-wrap";
432
- TABLE_COLUMN_CONTROLS_DECORATIONS: "pm-table-column-controls-decoration";
433
- TABLE_CONTAINER: "pm-table-container";
434
- TABLE_HEADER_CELL_WRAPPER: "pm-table-header-content-wrap";
435
- TABLE_LEFT_BORDER: "pm-table-left-border";
436
- TABLE_LEFT_SHADOW: "pm-table-with-left-shadow";
437
- TABLE_NODE_WRAPPER: "pm-table-wrapper";
438
- TABLE_NODE_WRAPPER_NO_OVERFLOW: "pm-table-wrapper-no-overflow";
439
- TABLE_RESIZER_CONTAINER: "pm-table-resizer-container";
440
- TABLE_RIGHT_BORDER: "pm-table-right-border";
441
- TABLE_RIGHT_SHADOW: "pm-table-with-right-shadow";
442
- TABLE_ROW_CONTROLS_WRAPPER: "pm-table-row-controls-wrapper";
443
- TABLE_SCROLL_INLINE_SHADOW: "pm-table-scroll-inline-shadow";
444
- TABLE_SHADOW_SENTINEL_LEFT: "pm-table-shadow-sentinel-left";
445
- TABLE_SHADOW_SENTINEL_RIGHT: "pm-table-shadow-sentinel-right";
446
- TABLE_STICKY_SCROLLBAR_CONTAINER: "pm-table-sticky-scrollbar-container";
447
- TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM: "pm-table-sticky-scrollbar-sentinel-bottom";
448
- TABLE_STICKY_SCROLLBAR_SENTINEL_TOP: "pm-table-sticky-scrollbar-sentinel-top";
449
- TABLE_STICKY_SENTINEL_BOTTOM: "pm-table-sticky-sentinel-bottom";
450
- TABLE_STICKY_SENTINEL_TOP: "pm-table-sticky-sentinel-top";
451
- TABLE_STICKY_SHADOW: "pm-table-sticky-shadow";
452
- TABLE_STICKY_WRAPPER: "pm-table-sticky-wrapper";
453
- TABLE_VIEW_CONTENT_WRAP: "tableView-content-wrap";
430
+ TABLE_CELL_NODEVIEW_CONTENT_DOM: 'pm-table-cell-nodeview-content-dom';
431
+ TABLE_CELL_WRAPPER: 'pm-table-cell-content-wrap';
432
+ TABLE_COLUMN_CONTROLS_DECORATIONS: 'pm-table-column-controls-decoration';
433
+ TABLE_CONTAINER: 'pm-table-container';
434
+ TABLE_HEADER_CELL_WRAPPER: 'pm-table-header-content-wrap';
435
+ TABLE_LEFT_BORDER: 'pm-table-left-border';
436
+ TABLE_LEFT_SHADOW: 'pm-table-with-left-shadow';
437
+ TABLE_NODE_WRAPPER: 'pm-table-wrapper';
438
+ TABLE_NODE_WRAPPER_NO_OVERFLOW: 'pm-table-wrapper-no-overflow';
439
+ TABLE_RESIZER_CONTAINER: 'pm-table-resizer-container';
440
+ TABLE_RIGHT_BORDER: 'pm-table-right-border';
441
+ TABLE_RIGHT_SHADOW: 'pm-table-with-right-shadow';
442
+ TABLE_ROW_CONTROLS_WRAPPER: 'pm-table-row-controls-wrapper';
443
+ TABLE_SCROLL_INLINE_SHADOW: 'pm-table-scroll-inline-shadow';
444
+ TABLE_SHADOW_SENTINEL_LEFT: 'pm-table-shadow-sentinel-left';
445
+ TABLE_SHADOW_SENTINEL_RIGHT: 'pm-table-shadow-sentinel-right';
446
+ TABLE_STICKY_SCROLLBAR_CONTAINER: 'pm-table-sticky-scrollbar-container';
447
+ TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM: 'pm-table-sticky-scrollbar-sentinel-bottom';
448
+ TABLE_STICKY_SCROLLBAR_SENTINEL_TOP: 'pm-table-sticky-scrollbar-sentinel-top';
449
+ TABLE_STICKY_SENTINEL_BOTTOM: 'pm-table-sticky-sentinel-bottom';
450
+ TABLE_STICKY_SENTINEL_TOP: 'pm-table-sticky-sentinel-top';
451
+ TABLE_STICKY_SHADOW: 'pm-table-sticky-shadow';
452
+ TABLE_STICKY_WRAPPER: 'pm-table-sticky-wrapper';
453
+ TABLE_VIEW_CONTENT_WRAP: 'tableView-content-wrap';
454
454
  };
455
455
  export interface ToolbarMenuConfig {
456
456
  allowCollapse?: boolean;
@@ -8,5 +8,5 @@ type Props = {
8
8
  includeTooltip?: boolean;
9
9
  startIndex: number;
10
10
  };
11
- export declare const ColumnResizeWidget: ({ startIndex, endIndex, includeTooltip }: Props) => jsx.JSX.Element;
11
+ export declare const ColumnResizeWidget: ({ startIndex, endIndex, includeTooltip, }: Props) => jsx.JSX.Element;
12
12
  export {};
@@ -1,23 +1,23 @@
1
1
  /**
2
2
  * Basic colors added to prevent content overflow in table cells.
3
3
  */
4
- export declare const tableCellBackgroundColor: "var(--ds-surface)";
5
- export declare const tableHeaderCellBackgroundColor: "var(--ds-background-accent-gray-subtlest)";
6
- export declare const tableToolbarColor: "var(--ds-background-neutral-subtle)";
7
- export declare const tableTextColor: "var(--ds-text-subtlest)";
8
- export declare const tableBorderColor: "var(--ds-background-accent-gray-subtler)";
9
- export declare const tableFloatingControlsColor: "var(--ds-background-neutral)";
10
- export declare const tableCellSelectedColor: "var(--ds-blanket-selected)";
11
- export declare const tableHeaderCellSelectedColor: "var(--ds-background-selected-pressed)";
12
- export declare const tableToolbarSelectedColor: "var(--ds-background-selected-pressed)";
13
- export declare const tableBorderSelectedColor: "var(--ds-border-focused)";
14
- export declare const tableCellSelectedDeleteIconColor: "var(--ds-icon-subtle)";
15
- export declare const tableCellSelectedDeleteIconBackground: "var(--ds-background-accent-gray-subtlest)";
16
- export declare const tableCellDeleteColor: "var(--ds-blanket-danger)";
17
- export declare const tableBorderDeleteColor: "var(--ds-border-danger)";
18
- export declare const tableToolbarDeleteColor: "var(--ds-background-danger-pressed)";
19
- export declare const tableCellHoverDeleteIconColor: "var(--ds-icon-inverse)";
20
- export declare const tableCellHoverDeleteIconBackground: "var(--ds-background-danger-bold)";
4
+ export declare const tableCellBackgroundColor: 'var(--ds-surface)';
5
+ export declare const tableHeaderCellBackgroundColor: 'var(--ds-background-accent-gray-subtlest)';
6
+ export declare const tableToolbarColor: 'var(--ds-background-neutral-subtle)';
7
+ export declare const tableTextColor: 'var(--ds-text-subtlest)';
8
+ export declare const tableBorderColor: 'var(--ds-background-accent-gray-subtler)';
9
+ export declare const tableFloatingControlsColor: 'var(--ds-background-neutral)';
10
+ export declare const tableCellSelectedColor: 'var(--ds-blanket-selected)';
11
+ export declare const tableHeaderCellSelectedColor: 'var(--ds-background-selected-pressed)';
12
+ export declare const tableToolbarSelectedColor: 'var(--ds-background-selected-pressed)';
13
+ export declare const tableBorderSelectedColor: 'var(--ds-border-focused)';
14
+ export declare const tableCellSelectedDeleteIconColor: 'var(--ds-icon-subtle)';
15
+ export declare const tableCellSelectedDeleteIconBackground: 'var(--ds-background-accent-gray-subtlest)';
16
+ export declare const tableCellDeleteColor: 'var(--ds-blanket-danger)';
17
+ export declare const tableBorderDeleteColor: 'var(--ds-border-danger)';
18
+ export declare const tableToolbarDeleteColor: 'var(--ds-background-danger-pressed)';
19
+ export declare const tableCellHoverDeleteIconColor: 'var(--ds-icon-inverse)';
20
+ export declare const tableCellHoverDeleteIconBackground: 'var(--ds-background-danger-bold)';
21
21
  export declare const tableBorderRadiusSize = 3;
22
22
  export declare const tablePadding = 8;
23
23
  export declare const tableScrollbarOffset = 15;
@@ -15,6 +15,7 @@ interface TableResizerProps {
15
15
  displayGuideline: (guideline: GuidelineConfig[]) => boolean;
16
16
  editorView: EditorView;
17
17
  getPos: () => number | undefined;
18
+ isChromelessEditor?: boolean;
18
19
  isCommentEditor?: boolean;
19
20
  isFullWidthModeEnabled?: boolean;
20
21
  isTableAlignmentEnabled?: boolean;
@@ -31,5 +32,5 @@ interface TableResizerProps {
31
32
  updateWidth: (width: number) => void;
32
33
  width: number;
33
34
  }
34
- export declare const TableResizer: ({ children, width, maxWidth, containerWidth, lineLength, updateWidth, onResizeStop, onResizeStart, editorView, getPos, node, tableRef, displayGuideline, attachAnalyticsEvent, displayGapCursor, isTableScalingEnabled, allowFixedColumnWidthOption, isTableAlignmentEnabled, isWholeTableInDanger, shouldUseIncreasedScalingPercent, pluginInjectionApi, isFullWidthModeEnabled, isCommentEditor, disabled, }: PropsWithChildren<TableResizerProps>) => React.JSX.Element;
35
+ export declare const TableResizer: ({ children, width, maxWidth, containerWidth, lineLength, updateWidth, onResizeStop, onResizeStart, editorView, getPos, node, tableRef, displayGuideline, attachAnalyticsEvent, displayGapCursor, isTableScalingEnabled, allowFixedColumnWidthOption, isTableAlignmentEnabled, isWholeTableInDanger, shouldUseIncreasedScalingPercent, pluginInjectionApi, isFullWidthModeEnabled, isCommentEditor, isChromelessEditor, disabled, }: PropsWithChildren<TableResizerProps>) => React.JSX.Element;
35
36
  export {};
@@ -4,5 +4,5 @@ type AutoScrollerFactory = {
4
4
  getNode: () => PmNode;
5
5
  tableWrapper: HTMLElement;
6
6
  };
7
- export declare const autoScrollerFactory: ({ tableWrapper, getNode }: AutoScrollerFactory) => CleanupFn[];
7
+ export declare const autoScrollerFactory: ({ tableWrapper, getNode, }: AutoScrollerFactory) => CleanupFn[];
8
8
  export {};
@@ -10,8 +10,8 @@ type Col = Array<string | {
10
10
  */
11
11
  export declare const getColWidthFix: (colwidth: number, tableColumnCount: number) => number;
12
12
  export declare const generateColgroupFromNode: (table: PmNode, isCommentEditor?: boolean, isChromelessEditor?: boolean, isNested?: boolean, isTableScalingEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Col[];
13
- export declare const generateColgroup: (table: PmNode, tableRef?: HTMLElement, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean) => Col[];
14
- export declare const insertColgroupFromNode: (tableRef: HTMLTableElement | null, table: PmNode, isTableScalingEnabled?: boolean, shouldRemove?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean) => HTMLCollection;
13
+ export declare const generateColgroup: (table: PmNode, tableRef?: HTMLElement, shouldUseIncreasedScalingPercent?: boolean, isCommentOrChromelessEditor?: boolean) => Col[];
14
+ export declare const insertColgroupFromNode: (tableRef: HTMLTableElement | null, table: PmNode, isTableScalingEnabled?: boolean, shouldRemove?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentOrChromelessEditor?: boolean) => HTMLCollection;
15
15
  export declare const hasTableBeenResized: (table: PmNode) => boolean;
16
16
  export declare const hasTableColumnBeenResized: (table: PmNode) => boolean;
17
17
  /**
@@ -6,3 +6,4 @@ export declare const MAX_SCALING_PERCENT = 0.3;
6
6
  export declare const MAX_SCALING_PERCENT_TABLES_WITH_FIXED_COLUMN_WIDTHS_OPTION = 0.4;
7
7
  export declare const TABLE_EDITOR_MARGIN = 76;
8
8
  export declare const TABLE_OFFSET_IN_COMMENT_EDITOR: number;
9
+ export declare const RESIZE_HANDLE_SPACING = 12;
@@ -15,6 +15,6 @@ interface ScaleOptions {
15
15
  start: number;
16
16
  }
17
17
  export declare function scaleTableTo(state: ResizeState, maxSize: number): ResizeState;
18
- export declare const previewScaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos, isTableScalingEnabled?: boolean, allowFixedColumnWidthOption?: boolean, isCommentEditor?: boolean) => void;
19
- export declare const scaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos, api: PluginInjectionAPI | undefined | null, isTableScalingEnabledOnCurrentTable?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean) => (tr: Transaction) => Transaction;
18
+ export declare const previewScaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos, isTableScalingEnabled?: boolean, allowFixedColumnWidthOption?: boolean, isCommentOrChromelessEditor?: boolean) => void;
19
+ export declare const scaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos, api: PluginInjectionAPI | undefined | null, isTableScalingEnabledOnCurrentTable?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentOrChromelessEditor?: boolean) => (tr: Transaction) => Transaction;
20
20
  export {};
@@ -404,8 +404,8 @@ export declare const TableCssClassName: {
404
404
  SELECTED_CELL: string;
405
405
  NODEVIEW_WRAPPER: string;
406
406
  TABLE_SELECTED: string;
407
- TABLE_CELL: "pm-table-cell-content-wrap";
408
- TABLE_HEADER_CELL: "pm-table-header-content-wrap";
407
+ TABLE_CELL: 'pm-table-cell-content-wrap';
408
+ TABLE_HEADER_CELL: 'pm-table-header-content-wrap';
409
409
  TABLE_STICKY: string;
410
410
  TABLE_CHROMELESS: string;
411
411
  TOP_LEFT_CELL: string;
@@ -427,30 +427,30 @@ export declare const TableCssClassName: {
427
427
  NATIVE_STICKY: string;
428
428
  NATIVE_STICKY_ACTIVE: string;
429
429
  NO_OVERFLOW: string;
430
- TABLE_CELL_NODEVIEW_CONTENT_DOM: "pm-table-cell-nodeview-content-dom";
431
- TABLE_CELL_WRAPPER: "pm-table-cell-content-wrap";
432
- TABLE_COLUMN_CONTROLS_DECORATIONS: "pm-table-column-controls-decoration";
433
- TABLE_CONTAINER: "pm-table-container";
434
- TABLE_HEADER_CELL_WRAPPER: "pm-table-header-content-wrap";
435
- TABLE_LEFT_BORDER: "pm-table-left-border";
436
- TABLE_LEFT_SHADOW: "pm-table-with-left-shadow";
437
- TABLE_NODE_WRAPPER: "pm-table-wrapper";
438
- TABLE_NODE_WRAPPER_NO_OVERFLOW: "pm-table-wrapper-no-overflow";
439
- TABLE_RESIZER_CONTAINER: "pm-table-resizer-container";
440
- TABLE_RIGHT_BORDER: "pm-table-right-border";
441
- TABLE_RIGHT_SHADOW: "pm-table-with-right-shadow";
442
- TABLE_ROW_CONTROLS_WRAPPER: "pm-table-row-controls-wrapper";
443
- TABLE_SCROLL_INLINE_SHADOW: "pm-table-scroll-inline-shadow";
444
- TABLE_SHADOW_SENTINEL_LEFT: "pm-table-shadow-sentinel-left";
445
- TABLE_SHADOW_SENTINEL_RIGHT: "pm-table-shadow-sentinel-right";
446
- TABLE_STICKY_SCROLLBAR_CONTAINER: "pm-table-sticky-scrollbar-container";
447
- TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM: "pm-table-sticky-scrollbar-sentinel-bottom";
448
- TABLE_STICKY_SCROLLBAR_SENTINEL_TOP: "pm-table-sticky-scrollbar-sentinel-top";
449
- TABLE_STICKY_SENTINEL_BOTTOM: "pm-table-sticky-sentinel-bottom";
450
- TABLE_STICKY_SENTINEL_TOP: "pm-table-sticky-sentinel-top";
451
- TABLE_STICKY_SHADOW: "pm-table-sticky-shadow";
452
- TABLE_STICKY_WRAPPER: "pm-table-sticky-wrapper";
453
- TABLE_VIEW_CONTENT_WRAP: "tableView-content-wrap";
430
+ TABLE_CELL_NODEVIEW_CONTENT_DOM: 'pm-table-cell-nodeview-content-dom';
431
+ TABLE_CELL_WRAPPER: 'pm-table-cell-content-wrap';
432
+ TABLE_COLUMN_CONTROLS_DECORATIONS: 'pm-table-column-controls-decoration';
433
+ TABLE_CONTAINER: 'pm-table-container';
434
+ TABLE_HEADER_CELL_WRAPPER: 'pm-table-header-content-wrap';
435
+ TABLE_LEFT_BORDER: 'pm-table-left-border';
436
+ TABLE_LEFT_SHADOW: 'pm-table-with-left-shadow';
437
+ TABLE_NODE_WRAPPER: 'pm-table-wrapper';
438
+ TABLE_NODE_WRAPPER_NO_OVERFLOW: 'pm-table-wrapper-no-overflow';
439
+ TABLE_RESIZER_CONTAINER: 'pm-table-resizer-container';
440
+ TABLE_RIGHT_BORDER: 'pm-table-right-border';
441
+ TABLE_RIGHT_SHADOW: 'pm-table-with-right-shadow';
442
+ TABLE_ROW_CONTROLS_WRAPPER: 'pm-table-row-controls-wrapper';
443
+ TABLE_SCROLL_INLINE_SHADOW: 'pm-table-scroll-inline-shadow';
444
+ TABLE_SHADOW_SENTINEL_LEFT: 'pm-table-shadow-sentinel-left';
445
+ TABLE_SHADOW_SENTINEL_RIGHT: 'pm-table-shadow-sentinel-right';
446
+ TABLE_STICKY_SCROLLBAR_CONTAINER: 'pm-table-sticky-scrollbar-container';
447
+ TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM: 'pm-table-sticky-scrollbar-sentinel-bottom';
448
+ TABLE_STICKY_SCROLLBAR_SENTINEL_TOP: 'pm-table-sticky-scrollbar-sentinel-top';
449
+ TABLE_STICKY_SENTINEL_BOTTOM: 'pm-table-sticky-sentinel-bottom';
450
+ TABLE_STICKY_SENTINEL_TOP: 'pm-table-sticky-sentinel-top';
451
+ TABLE_STICKY_SHADOW: 'pm-table-sticky-shadow';
452
+ TABLE_STICKY_WRAPPER: 'pm-table-sticky-wrapper';
453
+ TABLE_VIEW_CONTENT_WRAP: 'tableView-content-wrap';
454
454
  };
455
455
  export interface ToolbarMenuConfig {
456
456
  allowCollapse?: boolean;
@@ -8,5 +8,5 @@ type Props = {
8
8
  includeTooltip?: boolean;
9
9
  startIndex: number;
10
10
  };
11
- export declare const ColumnResizeWidget: ({ startIndex, endIndex, includeTooltip }: Props) => jsx.JSX.Element;
11
+ export declare const ColumnResizeWidget: ({ startIndex, endIndex, includeTooltip, }: Props) => jsx.JSX.Element;
12
12
  export {};