@atlaskit/editor-plugin-table 19.0.1 → 21.0.0

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 (131) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/dist/cjs/nodeviews/TableComponent.js +2 -2
  3. package/dist/cjs/nodeviews/TableResizer.js +2 -2
  4. package/dist/cjs/nodeviews/table.js +18 -2
  5. package/dist/cjs/nodeviews/toDOM.js +18 -4
  6. package/dist/cjs/pm-plugins/main.js +38 -4
  7. package/dist/cjs/pm-plugins/table-width.js +10 -0
  8. package/dist/cjs/pm-plugins/transforms/content-mode.js +48 -0
  9. package/dist/cjs/pm-plugins/transforms/fix-tables.js +4 -35
  10. package/dist/cjs/pm-plugins/transforms/table-transform-utils.js +62 -0
  11. package/dist/cjs/pm-plugins/utils/decoration.js +2 -2
  12. package/dist/cjs/pm-plugins/utils/tableMode.js +149 -0
  13. package/dist/cjs/pm-plugins/view-mode-sort/index.js +2 -2
  14. package/dist/cjs/ui/ColumnResizeWidget/index.js +2 -2
  15. package/dist/cjs/ui/DragHandle/index.js +2 -2
  16. package/dist/cjs/ui/FloatingContextualButton/index.js +2 -2
  17. package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +2 -2
  18. package/dist/cjs/ui/FloatingDeleteButton/DeleteButton.js +2 -2
  19. package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +2 -2
  20. package/dist/cjs/ui/FloatingInsertButton/InsertButton.js +3 -3
  21. package/dist/cjs/ui/FloatingInsertButton/index.js +2 -2
  22. package/dist/cjs/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +2 -2
  23. package/dist/cjs/ui/TableFloatingControls/CornerControls/DragCornerControls.js +3 -3
  24. package/dist/cjs/ui/TableFloatingControls/RowControls/ClassicControls.js +2 -2
  25. package/dist/cjs/ui/TableFullWidthLabel/index.js +2 -2
  26. package/dist/cjs/ui/event-handlers.js +3 -2
  27. package/dist/cjs/ui/toolbar.js +25 -2
  28. package/dist/es2019/nodeviews/TableComponent.js +1 -1
  29. package/dist/es2019/nodeviews/TableResizer.js +1 -1
  30. package/dist/es2019/nodeviews/table.js +18 -2
  31. package/dist/es2019/nodeviews/toDOM.js +18 -4
  32. package/dist/es2019/pm-plugins/main.js +38 -4
  33. package/dist/es2019/pm-plugins/table-width.js +10 -0
  34. package/dist/es2019/pm-plugins/transforms/content-mode.js +39 -0
  35. package/dist/es2019/pm-plugins/transforms/fix-tables.js +2 -33
  36. package/dist/es2019/pm-plugins/transforms/table-transform-utils.js +56 -0
  37. package/dist/es2019/pm-plugins/utils/decoration.js +1 -1
  38. package/dist/es2019/pm-plugins/utils/tableMode.js +148 -0
  39. package/dist/es2019/pm-plugins/view-mode-sort/index.js +1 -1
  40. package/dist/es2019/ui/ColumnResizeWidget/index.js +1 -1
  41. package/dist/es2019/ui/DragHandle/index.js +1 -1
  42. package/dist/es2019/ui/FloatingContextualButton/index.js +1 -1
  43. package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +1 -1
  44. package/dist/es2019/ui/FloatingDeleteButton/DeleteButton.js +1 -1
  45. package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +1 -1
  46. package/dist/es2019/ui/FloatingInsertButton/InsertButton.js +1 -1
  47. package/dist/es2019/ui/FloatingInsertButton/index.js +1 -1
  48. package/dist/es2019/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +1 -1
  49. package/dist/es2019/ui/TableFloatingControls/CornerControls/DragCornerControls.js +1 -1
  50. package/dist/es2019/ui/TableFloatingControls/RowControls/ClassicControls.js +1 -1
  51. package/dist/es2019/ui/TableFullWidthLabel/index.js +1 -1
  52. package/dist/es2019/ui/event-handlers.js +4 -3
  53. package/dist/es2019/ui/toolbar.js +23 -2
  54. package/dist/esm/nodeviews/TableComponent.js +1 -1
  55. package/dist/esm/nodeviews/TableResizer.js +1 -1
  56. package/dist/esm/nodeviews/table.js +18 -2
  57. package/dist/esm/nodeviews/toDOM.js +18 -4
  58. package/dist/esm/pm-plugins/main.js +38 -4
  59. package/dist/esm/pm-plugins/table-width.js +10 -0
  60. package/dist/esm/pm-plugins/transforms/content-mode.js +41 -0
  61. package/dist/esm/pm-plugins/transforms/fix-tables.js +2 -33
  62. package/dist/esm/pm-plugins/transforms/table-transform-utils.js +56 -0
  63. package/dist/esm/pm-plugins/utils/decoration.js +1 -1
  64. package/dist/esm/pm-plugins/utils/tableMode.js +143 -0
  65. package/dist/esm/pm-plugins/view-mode-sort/index.js +1 -1
  66. package/dist/esm/ui/ColumnResizeWidget/index.js +1 -1
  67. package/dist/esm/ui/DragHandle/index.js +1 -1
  68. package/dist/esm/ui/FloatingContextualButton/index.js +1 -1
  69. package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +1 -1
  70. package/dist/esm/ui/FloatingDeleteButton/DeleteButton.js +1 -1
  71. package/dist/esm/ui/FloatingDragMenu/DragMenu.js +1 -1
  72. package/dist/esm/ui/FloatingInsertButton/InsertButton.js +1 -1
  73. package/dist/esm/ui/FloatingInsertButton/index.js +1 -1
  74. package/dist/esm/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +1 -1
  75. package/dist/esm/ui/TableFloatingControls/CornerControls/DragCornerControls.js +1 -1
  76. package/dist/esm/ui/TableFloatingControls/RowControls/ClassicControls.js +1 -1
  77. package/dist/esm/ui/TableFullWidthLabel/index.js +1 -1
  78. package/dist/esm/ui/event-handlers.js +4 -3
  79. package/dist/esm/ui/toolbar.js +25 -2
  80. package/dist/types/nodeviews/TableComponent.d.ts +2 -2
  81. package/dist/types/pm-plugins/commands/column-resize.d.ts +1 -1
  82. package/dist/types/pm-plugins/commands/commands-with-analytics.d.ts +1 -1
  83. package/dist/types/pm-plugins/commands/go-to-next-cell.d.ts +1 -1
  84. package/dist/types/pm-plugins/commands/selection.d.ts +1 -1
  85. package/dist/types/pm-plugins/decorations/utils/column-resizing.d.ts +1 -1
  86. package/dist/types/pm-plugins/drag-and-drop/commands-with-analytics.d.ts +1 -1
  87. package/dist/types/pm-plugins/keymap.d.ts +1 -1
  88. package/dist/types/pm-plugins/main.d.ts +1 -1
  89. package/dist/types/pm-plugins/table-selection-keymap.d.ts +1 -1
  90. package/dist/types/pm-plugins/transforms/content-mode.d.ts +8 -0
  91. package/dist/types/pm-plugins/transforms/table-transform-utils.d.ts +11 -0
  92. package/dist/types/pm-plugins/utils/decoration.d.ts +1 -1
  93. package/dist/types/pm-plugins/utils/table.d.ts +1 -1
  94. package/dist/types/pm-plugins/utils/tableMode.d.ts +22 -0
  95. package/dist/types/types/index.d.ts +4 -1
  96. package/dist/types/ui/DragHandle/index.d.ts +2 -2
  97. package/dist/types/ui/FloatingContextualMenu/ContextualMenu.d.ts +2 -2
  98. package/dist/types/ui/FloatingDeleteButton/DeleteButton.d.ts +2 -2
  99. package/dist/types/ui/FloatingDragMenu/DragMenu.d.ts +2 -2
  100. package/dist/types/ui/FloatingInsertButton/InsertButton.d.ts +3 -3
  101. package/dist/types/ui/FloatingInsertButton/index.d.ts +2 -2
  102. package/dist/types/ui/TableFloatingControls/CornerControls/ClassicCornerControls.d.ts +2 -2
  103. package/dist/types/ui/TableFloatingControls/CornerControls/DragCornerControls.d.ts +3 -3
  104. package/dist/types/ui/TableFloatingControls/RowControls/ClassicControls.d.ts +2 -2
  105. package/dist/types-ts4.5/nodeviews/TableComponent.d.ts +2 -2
  106. package/dist/types-ts4.5/pm-plugins/commands/column-resize.d.ts +1 -1
  107. package/dist/types-ts4.5/pm-plugins/commands/commands-with-analytics.d.ts +1 -1
  108. package/dist/types-ts4.5/pm-plugins/commands/go-to-next-cell.d.ts +1 -1
  109. package/dist/types-ts4.5/pm-plugins/commands/selection.d.ts +1 -1
  110. package/dist/types-ts4.5/pm-plugins/decorations/utils/column-resizing.d.ts +1 -1
  111. package/dist/types-ts4.5/pm-plugins/drag-and-drop/commands-with-analytics.d.ts +1 -1
  112. package/dist/types-ts4.5/pm-plugins/keymap.d.ts +1 -1
  113. package/dist/types-ts4.5/pm-plugins/main.d.ts +1 -1
  114. package/dist/types-ts4.5/pm-plugins/table-selection-keymap.d.ts +1 -1
  115. package/dist/types-ts4.5/pm-plugins/transforms/content-mode.d.ts +8 -0
  116. package/dist/types-ts4.5/pm-plugins/transforms/table-transform-utils.d.ts +11 -0
  117. package/dist/types-ts4.5/pm-plugins/utils/decoration.d.ts +1 -1
  118. package/dist/types-ts4.5/pm-plugins/utils/table.d.ts +1 -1
  119. package/dist/types-ts4.5/pm-plugins/utils/tableMode.d.ts +22 -0
  120. package/dist/types-ts4.5/types/index.d.ts +4 -1
  121. package/dist/types-ts4.5/ui/DragHandle/index.d.ts +2 -2
  122. package/dist/types-ts4.5/ui/FloatingContextualMenu/ContextualMenu.d.ts +2 -2
  123. package/dist/types-ts4.5/ui/FloatingDeleteButton/DeleteButton.d.ts +2 -2
  124. package/dist/types-ts4.5/ui/FloatingDragMenu/DragMenu.d.ts +2 -2
  125. package/dist/types-ts4.5/ui/FloatingInsertButton/InsertButton.d.ts +3 -3
  126. package/dist/types-ts4.5/ui/FloatingInsertButton/index.d.ts +2 -2
  127. package/dist/types-ts4.5/ui/TableFloatingControls/CornerControls/ClassicCornerControls.d.ts +2 -2
  128. package/dist/types-ts4.5/ui/TableFloatingControls/CornerControls/DragCornerControls.d.ts +3 -3
  129. package/dist/types-ts4.5/ui/TableFloatingControls/RowControls/ClassicControls.d.ts +2 -2
  130. package/package.json +25 -21
  131. package/report.api.md +1 -1
@@ -8,7 +8,7 @@ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstruct
8
8
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
9
9
  import React, { Component } from 'react';
10
10
  import classnames from 'classnames';
11
- import { injectIntl } from 'react-intl-next';
11
+ import { injectIntl } from 'react-intl';
12
12
  import { tableMessages as messages } from '@atlaskit/editor-common/messages';
13
13
  import { TableMap } from '@atlaskit/editor-tables/table-map';
14
14
  import { findTable, isTableSelected, selectTable } from '@atlaskit/editor-tables/utils';
@@ -1,6 +1,6 @@
1
1
  import React, { useMemo } from 'react';
2
2
  import classnames from 'classnames';
3
- import { injectIntl } from 'react-intl-next';
3
+ import { injectIntl } from 'react-intl';
4
4
  import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
5
5
  import { tableMessages as messages } from '@atlaskit/editor-common/messages';
6
6
  import { findTable, isTableSelected, selectTable } from '@atlaskit/editor-tables/utils';
@@ -7,7 +7,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
7
7
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
8
8
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
9
9
  import React, { Component } from 'react';
10
- import { injectIntl } from 'react-intl-next';
10
+ import { injectIntl } from 'react-intl';
11
11
  import { tableMessages as messages } from '@atlaskit/editor-common/messages';
12
12
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
13
13
  import { clearHoverSelection } from '../../../pm-plugins/commands';
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { useIntl } from 'react-intl-next';
2
+ import { useIntl } from 'react-intl';
3
3
  import { tableMessages as messages } from '@atlaskit/editor-common/messages';
4
4
  // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
5
5
  import { Box, Inline, xcss } from '@atlaskit/primitives';
@@ -1,8 +1,9 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import rafSchedule from 'raf-schd';
3
3
  import { ACTION_SUBJECT, EVENT_TYPE, TABLE_ACTION } from '@atlaskit/editor-common/analytics';
4
+ import { getBrowserInfo } from '@atlaskit/editor-common/browser';
4
5
  import { getParentOfTypeCount } from '@atlaskit/editor-common/nesting';
5
- import { browser, closestElement, isElementInTableCell, isLastItemMediaGroup, setNodeSelection } from '@atlaskit/editor-common/utils';
6
+ import { closestElement, isElementInTableCell, isLastItemMediaGroup, setNodeSelection } from '@atlaskit/editor-common/utils';
6
7
  import { Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
7
8
  import { findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
8
9
  import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
@@ -39,7 +40,7 @@ export var handleBlur = function handleBlur(view, event) {
39
40
  dispatch = view.dispatch;
40
41
  // IE version check for ED-4665
41
42
  // Calendar focus check for ED-10466
42
- if (browser.ie_version !== 11 && !isFocusingCalendar(event) && !isFocusingModal(event) && !isFocusingFloatingToolbar(event) && !isFocusingDragHandles(event) && !isFocusingDragHandlesClickableZone(event)) {
43
+ if (getBrowserInfo().ie_version !== 11 && !isFocusingCalendar(event) && !isFocusingModal(event) && !isFocusingFloatingToolbar(event) && !isFocusingDragHandles(event) && !isFocusingDragHandlesClickableZone(event)) {
43
44
  setEditorFocus(false)(state, dispatch);
44
45
  }
45
46
  event.preventDefault();
@@ -349,7 +350,7 @@ export var handleMouseMove = function handleMouseMove(nodeViewPortalProviderAPI)
349
350
  // a reflow. So for now this will just grab the offsetX value immediately for gecko and chrome will calculate later
350
351
  // in the deferred callback handler.
351
352
  // Bug Tracking: https://bugzilla.mozilla.org/show_bug.cgi?id=1882903
352
- handleMouseMoveDebounce(nodeViewPortalProviderAPI)(view, event, browser.gecko ? event.offsetX : NaN);
353
+ handleMouseMoveDebounce(nodeViewPortalProviderAPI)(view, event, getBrowserInfo().gecko ? event.offsetX : NaN);
353
354
  return false;
354
355
  };
355
356
  };
@@ -32,6 +32,7 @@ import AlignImageLeftIcon from '@atlaskit/icon/core/align-image-left';
32
32
  import CopyIcon from '@atlaskit/icon/core/copy';
33
33
  import CustomizeIcon from '@atlaskit/icon/core/customize';
34
34
  import DeleteIcon from '@atlaskit/icon/core/delete';
35
+ import ShrinkHorizontalIcon from '@atlaskit/icon/core/shrink-horizontal';
35
36
  import TableColumnsDistributeIcon from '@atlaskit/icon/core/table-columns-distribute';
36
37
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
37
38
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
@@ -48,6 +49,7 @@ import { normaliseAlignment } from '../pm-plugins/utils/alignment';
48
49
  import { isTableNested } from '../pm-plugins/utils/nodes';
49
50
  import { getSelectedColumnIndexes, getSelectedRowIndexes } from '../pm-plugins/utils/selection';
50
51
  import { getMergedCellsPositions } from '../pm-plugins/utils/table';
52
+ import { applyMeasuredWidthToSelectedTable, isContentModeSupported } from '../pm-plugins/utils/tableMode';
51
53
  import { TableCssClassName } from '../types';
52
54
  import { FloatingAlignmentButtons } from './FloatingAlignmentButtons/FloatingAlignmentButtons';
53
55
  export var getToolbarMenuConfig = function getToolbarMenuConfig(config, state, _ref, editorAnalyticsAPI) {
@@ -441,7 +443,7 @@ export var getToolbarConfig = function getToolbarConfig(getEditorContainerWidth,
441
443
  // We don't want to show floating toolbar while resizing the table
442
444
  var isWidthResizing = tableWidthState === null || tableWidthState === void 0 ? void 0 : tableWidthState.resizing;
443
445
  if (tableObject && pluginState.editorHasFocus && !isWidthResizing) {
444
- var _api$limitedMode$shar, _api$limitedMode, _api$extension, _api$extension2;
446
+ var _api$limitedMode$shar, _api$limitedMode, _api$editorViewMode2, _api$extension, _api$extension2;
445
447
  var isNested = pluginState.tablePos && isTableNested(state, pluginState.tablePos);
446
448
  var isTableScalingWithFixedColumnWidthsOptionShown = isTableScalingEnabled && isTableFixedColumnWidthsOptionEnabled && !isNested;
447
449
  var areTableColumWidthsFixed = tableObject.node.attrs.displayMode === 'fixed';
@@ -471,6 +473,27 @@ export var getToolbarConfig = function getToolbarConfig(getEditorContainerWidth,
471
473
  var cellItems = pluginState.isDragAndDropEnabled ? [] : getCellItems(state, editorView, intl, getEditorContainerWidth, api, editorAnalyticsAPI, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, options === null || options === void 0 ? void 0 : options.isCommentEditor, isLimitedModeEnabled);
472
474
  var columnSettingsItems = pluginState.isDragAndDropEnabled ? getColumnSettingItems(state, editorView, intl, getEditorContainerWidth, api, editorAnalyticsAPI, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, options === null || options === void 0 ? void 0 : options.isCommentEditor, isLimitedModeEnabled) : [];
473
475
  var colorPicker = !areAnyNewToolbarFlagsEnabled ? getColorPicker(state, menu, intl, editorAnalyticsAPI, getEditorView) : [];
476
+ var fitToContentButton = isContentModeSupported({
477
+ allowColumnResizing: !!pluginState.pluginConfig.allowColumnResizing,
478
+ allowTableResizing: !!pluginState.pluginConfig.allowTableResizing,
479
+ isFullPageEditor: !pluginState.isChromelessEditor && !pluginState.isCommentEditor
480
+ }) && !isNested && (api === null || api === void 0 || (_api$editorViewMode2 = api.editorViewMode) === null || _api$editorViewMode2 === void 0 || (_api$editorViewMode2 = _api$editorViewMode2.sharedState.currentState()) === null || _api$editorViewMode2 === void 0 ? void 0 : _api$editorViewMode2.mode) !== 'view' && expValEquals('platform_editor_table_fit_to_content_on_demand', 'isEnabled', true) ? [{
481
+ id: 'editor.table.fitToContent',
482
+ type: 'button',
483
+ title: intl.formatMessage(messages.fitToContent),
484
+ icon: function icon() {
485
+ return jsx(ShrinkHorizontalIcon, {
486
+ spacing: 'spacious',
487
+ label: ''
488
+ });
489
+ },
490
+ onClick: function onClick(_state, _dispatch, view) {
491
+ if (view) {
492
+ applyMeasuredWidthToSelectedTable(view, api !== null && api !== void 0 ? api : undefined);
493
+ }
494
+ return true;
495
+ }
496
+ }] : [];
474
497
 
475
498
  // Check if we need to show confirm dialog for delete button
476
499
  var confirmDialog;
@@ -549,7 +572,7 @@ export var getToolbarConfig = function getToolbarConfig(getEditorContainerWidth,
549
572
  },
550
573
  zIndex: akEditorFloatingPanelZIndex + 1,
551
574
  // Place the context menu slightly above the others
552
- items: [menu].concat(_toConsumableArray(!areAnyNewToolbarFlagsEnabled ? [separator(menu.hidden)] : []), _toConsumableArray(alignmentMenu), _toConsumableArray(!areAnyNewToolbarFlagsEnabled ? [separator(alignmentMenu.length === 0)] : []), _toConsumableArray(cellItems), _toConsumableArray(columnSettingsItems), _toConsumableArray(colorPicker), _toConsumableArray(!areAnyNewToolbarFlagsEnabled ? [{
575
+ items: [menu].concat(_toConsumableArray(!areAnyNewToolbarFlagsEnabled ? [separator(menu.hidden)] : []), _toConsumableArray(alignmentMenu), _toConsumableArray(!areAnyNewToolbarFlagsEnabled ? [separator(alignmentMenu.length === 0)] : []), _toConsumableArray(cellItems), _toConsumableArray(columnSettingsItems), fitToContentButton, _toConsumableArray(colorPicker), _toConsumableArray(!areAnyNewToolbarFlagsEnabled ? [{
553
576
  type: 'extensions-placeholder',
554
577
  separator: 'end'
555
578
  }, copyButton, {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import type { IntlShape } from 'react-intl-next';
2
+ import type { IntlShape } from 'react-intl';
3
3
  import type { TableColumnOrdering } from '@atlaskit/custom-steps';
4
4
  import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
5
5
  import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
@@ -42,7 +42,7 @@ interface ComponentProps {
42
42
  tableActive: boolean;
43
43
  view: EditorView;
44
44
  }
45
- declare const _default: React.FC<import("react-intl-next").WithIntlProps<ComponentProps>> & {
45
+ declare const _default: React.FC<import("react-intl").WithIntlProps<ComponentProps>> & {
46
46
  WrappedComponent: React.ComponentType<ComponentProps>;
47
47
  };
48
48
  export default _default;
@@ -1,4 +1,4 @@
1
- import type { IntlShape } from 'react-intl-next/src/types';
1
+ import type { IntlShape } from 'react-intl/src/types';
2
2
  import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
3
3
  import type { Command, GetEditorContainerWidth } from '@atlaskit/editor-common/types';
4
4
  import type { AriaLiveElementAttributes } from '@atlaskit/editor-plugin-accessibility-utils';
@@ -1,4 +1,4 @@
1
- import type { IntlShape } from 'react-intl-next/src/types';
1
+ import type { IntlShape } from 'react-intl/src/types';
2
2
  import type { TableLayout } from '@atlaskit/adf-schema';
3
3
  import type { TableSortOrder as SortOrder } from '@atlaskit/custom-steps';
4
4
  import type { CHANGE_ALIGNMENT_REASON, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
@@ -1,4 +1,4 @@
1
- import type { IntlShape } from 'react-intl-next/src/types';
1
+ import type { IntlShape } from 'react-intl/src/types';
2
2
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
3
  import type { Command } from '@atlaskit/editor-common/types';
4
4
  import type { Direction } from '@atlaskit/editor-tables/types';
@@ -1,4 +1,4 @@
1
- import type { IntlShape } from 'react-intl-next/src/types';
1
+ import type { IntlShape } from 'react-intl/src/types';
2
2
  import type { Command, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
3
  import type { AriaLiveElementAttributes } from '@atlaskit/editor-plugin-accessibility-utils';
4
4
  import type tablePlugin from '../../tablePlugin';
@@ -1,4 +1,4 @@
1
- import type { IntlShape } from 'react-intl-next';
1
+ import type { IntlShape } from 'react-intl';
2
2
  import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
3
3
  import type { DecorationTransformer } from './types';
4
4
  export declare const buildColumnResizingDecorations: (rowEndIndex: number, columnEndIndex: number, includeTooltip: boolean, getIntl: () => IntlShape, nodeViewPortalProviderAPI: PortalProviderAPI) => DecorationTransformer;
@@ -1,4 +1,4 @@
1
- import type { IntlShape } from 'react-intl-next/src/types';
1
+ import type { IntlShape } from 'react-intl/src/types';
2
2
  import { INPUT_METHOD, TABLE_STATUS } from '@atlaskit/editor-common/analytics';
3
3
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
4
4
  import type { Command } from '@atlaskit/editor-common/types';
@@ -1,4 +1,4 @@
1
- import type { IntlShape } from 'react-intl-next/src/types';
1
+ import type { IntlShape } from 'react-intl/src/types';
2
2
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
3
  import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
4
4
  import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
@@ -1,4 +1,4 @@
1
- import type { IntlShape } from 'react-intl-next';
1
+ import type { IntlShape } from 'react-intl';
2
2
  import type { DispatchAnalyticsEvent, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
3
  import type { Dispatch, EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
4
4
  import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
@@ -1,4 +1,4 @@
1
- import type { IntlShape } from 'react-intl-next/src/types';
1
+ import type { IntlShape } from 'react-intl/src/types';
2
2
  import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
3
  import type { PluginInjectionAPI } from '../types';
4
4
  export declare function tableSelectionKeymapPlugin(pluginInjectionApi?: PluginInjectionAPI, getIntl?: () => IntlShape): SafePlugin;
@@ -0,0 +1,8 @@
1
+ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
+ import type { Transaction } from '@atlaskit/editor-prosemirror/state';
3
+ export type TableMeasurement = {
4
+ colWidths: Array<number>;
5
+ tableWidth: number;
6
+ };
7
+ export declare const getTableMeasurement: (tableRef: HTMLTableElement) => TableMeasurement;
8
+ export declare const applyTableMeasurement: (tr: Transaction, tableNode: PMNode, { colWidths, tableWidth }: TableMeasurement, tablePos: number) => Transaction;
@@ -0,0 +1,11 @@
1
+ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
+ import type { Transaction } from '@atlaskit/editor-prosemirror/state';
3
+ export declare const replaceCells: (tr: Transaction, table: PMNode, tablePos: number, modifyCell: (cell: PMNode, rowIndex: number, colIndex: number) => PMNode) => Transaction;
4
+ /**
5
+ * Position-preserving alternative to `replaceCells`.
6
+ *
7
+ * Uses `setNodeMarkup` per cell instead of rebuilding the whole table with
8
+ * `replaceWith`, so document positions inside cells are never invalidated.
9
+ * This preserves any existing selection through `tr.mapping`.
10
+ */
11
+ export declare const updateCellsMarkup: (tr: Transaction, table: PMNode, tablePos: number, modifyCell: (cell: PMNode, rowIndex: number, colIndex: number) => PMNode) => Transaction;
@@ -1,4 +1,4 @@
1
- import type { IntlShape } from 'react-intl-next';
1
+ import type { IntlShape } from 'react-intl';
2
2
  import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
3
3
  import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
4
4
  import type { ReadonlyTransaction, Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
@@ -1,4 +1,4 @@
1
- import type { IntlShape } from 'react-intl-next';
1
+ import type { IntlShape } from 'react-intl';
2
2
  import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
3
3
  import type { Transaction } from '@atlaskit/editor-prosemirror/state';
4
4
  export declare const getMergedCellsPositions: (tr: Transaction) => number[];
@@ -0,0 +1,22 @@
1
+ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
+ import type { PluginInjectionAPI } from '../../types';
4
+ type ContentModePluginOptions = {
5
+ allowColumnResizing: boolean;
6
+ allowTableResizing: boolean;
7
+ isFullPageEditor: boolean;
8
+ };
9
+ export declare const isTableInContentMode: ({ allowColumnResizing, allowTableResizing, isFullPageEditor, isTableNested, node, }: ContentModePluginOptions & {
10
+ isTableNested?: boolean;
11
+ node?: PMNode;
12
+ }) => boolean;
13
+ export declare const isContentModeSupported: ({ allowColumnResizing, allowTableResizing, isFullPageEditor, }: ContentModePluginOptions) => boolean;
14
+ export declare const hasTableBeenResized: (node: PMNode) => boolean;
15
+ /**
16
+ * Iterates all top-level tables in the document, and for those in content mode,
17
+ * measures rendered column widths and sets colwidth + table width attributes
18
+ * in a single batched transaction.
19
+ */
20
+ export declare const applyMeasuredWidthToAllTables: (view: EditorView, pluginInjectionApi?: PluginInjectionAPI) => void;
21
+ export declare const applyMeasuredWidthToSelectedTable: (view: EditorView, api?: PluginInjectionAPI) => void;
22
+ export {};
@@ -1,4 +1,4 @@
1
- import type { IntlShape } from 'react-intl-next';
1
+ import type { IntlShape } from 'react-intl';
2
2
  import type { TableLayout } from '@atlaskit/adf-schema';
3
3
  import type { TableColumnOrdering } from '@atlaskit/custom-steps';
4
4
  import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
@@ -95,6 +95,8 @@ export interface TablePluginState {
95
95
  insertColumnButtonIndex?: number;
96
96
  insertRowButtonIndex?: number;
97
97
  isCellMenuOpenByKeyboard?: boolean;
98
+ isChromelessEditor?: boolean;
99
+ isCommentEditor?: boolean;
98
100
  isContextualMenuOpen?: boolean;
99
101
  isDragAndDropEnabled?: boolean;
100
102
  isFullWidthModeEnabled?: boolean;
@@ -448,6 +450,7 @@ export declare const TableCssClassName: {
448
450
  TABLE_STICKY_SENTINEL_TOP: "pm-table-sticky-sentinel-top";
449
451
  TABLE_STICKY_SHADOW: "pm-table-sticky-shadow";
450
452
  TABLE_STICKY_WRAPPER: "pm-table-sticky-wrapper";
453
+ TABLE_VIEW_CONTENT_WRAP: "tableView-content-wrap";
451
454
  };
452
455
  export interface ToolbarMenuConfig {
453
456
  allowCollapse?: boolean;
@@ -1,6 +1,6 @@
1
1
  import type { MouseEventHandler, FocusEventHandler } from 'react';
2
2
  import React from 'react';
3
- import type { WrappedComponentProps } from 'react-intl-next';
3
+ import type { WrappedComponentProps } from 'react-intl';
4
4
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
5
5
  import type { TriggerType } from '../../pm-plugins/drag-and-drop/types';
6
6
  import type { CellHoverMeta, TableDirection } from '../../types';
@@ -23,7 +23,7 @@ type DragHandleProps = {
23
23
  tableLocalId: string;
24
24
  toggleDragMenu?: (trigger: TriggerType, event?: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
25
25
  };
26
- export declare const DragHandle: React.FC<import("react-intl-next").WithIntlProps<DragHandleProps & WrappedComponentProps>> & {
26
+ export declare const DragHandle: React.FC<import("react-intl").WithIntlProps<DragHandleProps & WrappedComponentProps>> & {
27
27
  WrappedComponent: React.ComponentType<DragHandleProps & WrappedComponentProps>;
28
28
  };
29
29
  export {};
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import React, { Component } from 'react';
6
6
  import { jsx } from '@emotion/react';
7
- import type { WrappedComponentProps } from 'react-intl-next';
7
+ import type { WrappedComponentProps } from 'react-intl';
8
8
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
9
9
  import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
10
10
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
@@ -64,7 +64,7 @@ export declare class ContextualMenu extends Component<Props & WrappedComponentPr
64
64
  private closeSubmenu;
65
65
  private setColor;
66
66
  }
67
- declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
67
+ declare const _default: React.FC<import("react-intl").WithIntlProps<Props & WrappedComponentProps>> & {
68
68
  WrappedComponent: React.ComponentType<Props & WrappedComponentProps>;
69
69
  };
70
70
  export default _default;
@@ -1,6 +1,6 @@
1
1
  import type { SyntheticEvent } from 'react';
2
2
  import React from 'react';
3
- import type { MessageDescriptor, WrappedComponentProps } from 'react-intl-next';
3
+ import type { MessageDescriptor, WrappedComponentProps } from 'react-intl';
4
4
  interface ButtonProps {
5
5
  onClick?: (event: SyntheticEvent) => void;
6
6
  onMouseEnter?: (event: SyntheticEvent) => void;
@@ -8,7 +8,7 @@ interface ButtonProps {
8
8
  removeLabel: MessageDescriptor;
9
9
  style?: object;
10
10
  }
11
- declare const _default: React.FC<import("react-intl-next").WithIntlProps<ButtonProps & WrappedComponentProps>> & {
11
+ declare const _default: React.FC<import("react-intl").WithIntlProps<ButtonProps & WrappedComponentProps>> & {
12
12
  WrappedComponent: React.ComponentType<ButtonProps & WrappedComponentProps>;
13
13
  };
14
14
  export default _default;
@@ -4,7 +4,7 @@
4
4
  */
5
5
  /** @jsxFrag */
6
6
  import React from 'react';
7
- import type { WrappedComponentProps } from 'react-intl-next';
7
+ import type { WrappedComponentProps } from 'react-intl';
8
8
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
9
9
  import type { ExtractInjectionAPI, GetEditorContainerWidth } from '@atlaskit/editor-common/types';
10
10
  import type { AriaLiveElementAttributes } from '@atlaskit/editor-plugin-accessibility-utils';
@@ -35,7 +35,7 @@ type DragMenuProps = {
35
35
  target?: Element;
36
36
  targetCellPosition?: number;
37
37
  };
38
- declare const _default: React.FC<import("react-intl-next").WithIntlProps<DragMenuProps & WrappedComponentProps>> & {
38
+ declare const _default: React.FC<import("react-intl").WithIntlProps<DragMenuProps & WrappedComponentProps>> & {
39
39
  WrappedComponent: React.ComponentType<DragMenuProps & WrappedComponentProps>;
40
40
  };
41
41
  export default _default;
@@ -1,6 +1,6 @@
1
1
  import type { SyntheticEvent } from 'react';
2
2
  import React from 'react';
3
- import type { WrappedComponentProps } from 'react-intl-next';
3
+ import type { WrappedComponentProps } from 'react-intl';
4
4
  import type { TableDirection } from '../../types';
5
5
  interface ButtonProps {
6
6
  hasStickyHeaders: boolean;
@@ -9,10 +9,10 @@ interface ButtonProps {
9
9
  tableRef: HTMLElement;
10
10
  type: TableDirection;
11
11
  }
12
- export declare const DragAndDropInsertButton: React.FC<import("react-intl-next").WithIntlProps<ButtonProps & WrappedComponentProps>> & {
12
+ export declare const DragAndDropInsertButton: React.FC<import("react-intl").WithIntlProps<ButtonProps & WrappedComponentProps>> & {
13
13
  WrappedComponent: React.ComponentType<ButtonProps & WrappedComponentProps>;
14
14
  };
15
- declare const _default: React.FC<import("react-intl-next").WithIntlProps<ButtonProps & WrappedComponentProps>> & {
15
+ declare const _default: React.FC<import("react-intl").WithIntlProps<ButtonProps & WrappedComponentProps>> & {
16
16
  WrappedComponent: React.ComponentType<ButtonProps & WrappedComponentProps>;
17
17
  };
18
18
  export default _default;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import type { WrappedComponentProps } from 'react-intl-next';
2
+ import type { WrappedComponentProps } from 'react-intl';
3
3
  import type { DispatchAnalyticsEvent, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
4
4
  import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
5
5
  import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
@@ -35,7 +35,7 @@ export declare class FloatingInsertButton extends React.Component<Props & Wrappe
35
35
  private insertRow;
36
36
  private insertColumn;
37
37
  }
38
- declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
38
+ declare const _default: React.FC<import("react-intl").WithIntlProps<Props & WrappedComponentProps>> & {
39
39
  WrappedComponent: React.ComponentType<Props & WrappedComponentProps>;
40
40
  };
41
41
  export default _default;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import type { WrappedComponentProps } from 'react-intl-next';
2
+ import type { WrappedComponentProps } from 'react-intl';
3
3
  import type { CornerControlProps } from './types';
4
- export declare const CornerControls: React.FC<import("react-intl-next").WithIntlProps<CornerControlProps & WrappedComponentProps>> & {
4
+ export declare const CornerControls: React.FC<import("react-intl").WithIntlProps<CornerControlProps & WrappedComponentProps>> & {
5
5
  WrappedComponent: React.ComponentType<CornerControlProps & WrappedComponentProps>;
6
6
  };
@@ -1,15 +1,15 @@
1
1
  import React from 'react';
2
- import type { WrappedComponentProps } from 'react-intl-next';
2
+ import type { WrappedComponentProps } from 'react-intl';
3
3
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
4
4
  import type { TablePlugin } from '../../../tablePluginType';
5
5
  import type { CornerControlProps } from './types';
6
- export declare const DragCornerControlsWithSelection: React.FC<import("react-intl-next").WithIntlProps<CornerControlProps & WrappedComponentProps & {
6
+ export declare const DragCornerControlsWithSelection: React.FC<import("react-intl").WithIntlProps<CornerControlProps & WrappedComponentProps & {
7
7
  api?: ExtractInjectionAPI<TablePlugin>;
8
8
  }>> & {
9
9
  WrappedComponent: React.ComponentType<CornerControlProps & WrappedComponentProps & {
10
10
  api?: ExtractInjectionAPI<TablePlugin>;
11
11
  }>;
12
12
  };
13
- export declare const DragCornerControls: React.FC<import("react-intl-next").WithIntlProps<CornerControlProps & WrappedComponentProps>> & {
13
+ export declare const DragCornerControls: React.FC<import("react-intl").WithIntlProps<CornerControlProps & WrappedComponentProps>> & {
14
14
  WrappedComponent: React.ComponentType<CornerControlProps & WrappedComponentProps>;
15
15
  };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import type { WrappedComponentProps } from 'react-intl-next';
2
+ import type { WrappedComponentProps } from 'react-intl';
3
3
  import type { Selection } from '@atlaskit/editor-prosemirror/state';
4
4
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
5
5
  export interface Props {
@@ -14,6 +14,6 @@ export interface Props {
14
14
  stickyTop?: number;
15
15
  tableRef: HTMLTableElement;
16
16
  }
17
- export declare const RowControls: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
17
+ export declare const RowControls: React.FC<import("react-intl").WithIntlProps<Props & WrappedComponentProps>> & {
18
18
  WrappedComponent: React.ComponentType<Props & WrappedComponentProps>;
19
19
  };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import type { IntlShape } from 'react-intl-next';
2
+ import type { IntlShape } from 'react-intl';
3
3
  import type { TableColumnOrdering } from '@atlaskit/custom-steps';
4
4
  import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
5
5
  import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
@@ -42,7 +42,7 @@ interface ComponentProps {
42
42
  tableActive: boolean;
43
43
  view: EditorView;
44
44
  }
45
- declare const _default: React.FC<import("react-intl-next").WithIntlProps<ComponentProps>> & {
45
+ declare const _default: React.FC<import("react-intl").WithIntlProps<ComponentProps>> & {
46
46
  WrappedComponent: React.ComponentType<ComponentProps>;
47
47
  };
48
48
  export default _default;
@@ -1,4 +1,4 @@
1
- import type { IntlShape } from 'react-intl-next/src/types';
1
+ import type { IntlShape } from 'react-intl/src/types';
2
2
  import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
3
3
  import type { Command, GetEditorContainerWidth } from '@atlaskit/editor-common/types';
4
4
  import type { AriaLiveElementAttributes } from '@atlaskit/editor-plugin-accessibility-utils';
@@ -1,4 +1,4 @@
1
- import type { IntlShape } from 'react-intl-next/src/types';
1
+ import type { IntlShape } from 'react-intl/src/types';
2
2
  import type { TableLayout } from '@atlaskit/adf-schema';
3
3
  import type { TableSortOrder as SortOrder } from '@atlaskit/custom-steps';
4
4
  import type { CHANGE_ALIGNMENT_REASON, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
@@ -1,4 +1,4 @@
1
- import type { IntlShape } from 'react-intl-next/src/types';
1
+ import type { IntlShape } from 'react-intl/src/types';
2
2
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
3
  import type { Command } from '@atlaskit/editor-common/types';
4
4
  import type { Direction } from '@atlaskit/editor-tables/types';
@@ -1,4 +1,4 @@
1
- import type { IntlShape } from 'react-intl-next/src/types';
1
+ import type { IntlShape } from 'react-intl/src/types';
2
2
  import type { Command, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
3
  import type { AriaLiveElementAttributes } from '@atlaskit/editor-plugin-accessibility-utils';
4
4
  import type tablePlugin from '../../tablePlugin';
@@ -1,4 +1,4 @@
1
- import type { IntlShape } from 'react-intl-next';
1
+ import type { IntlShape } from 'react-intl';
2
2
  import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
3
3
  import type { DecorationTransformer } from './types';
4
4
  export declare const buildColumnResizingDecorations: (rowEndIndex: number, columnEndIndex: number, includeTooltip: boolean, getIntl: () => IntlShape, nodeViewPortalProviderAPI: PortalProviderAPI) => DecorationTransformer;
@@ -1,4 +1,4 @@
1
- import type { IntlShape } from 'react-intl-next/src/types';
1
+ import type { IntlShape } from 'react-intl/src/types';
2
2
  import { INPUT_METHOD, TABLE_STATUS } from '@atlaskit/editor-common/analytics';
3
3
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
4
4
  import type { Command } from '@atlaskit/editor-common/types';
@@ -1,4 +1,4 @@
1
- import type { IntlShape } from 'react-intl-next/src/types';
1
+ import type { IntlShape } from 'react-intl/src/types';
2
2
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
3
  import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
4
4
  import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
@@ -1,4 +1,4 @@
1
- import type { IntlShape } from 'react-intl-next';
1
+ import type { IntlShape } from 'react-intl';
2
2
  import type { DispatchAnalyticsEvent, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
3
  import type { Dispatch, EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
4
4
  import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
@@ -1,4 +1,4 @@
1
- import type { IntlShape } from 'react-intl-next/src/types';
1
+ import type { IntlShape } from 'react-intl/src/types';
2
2
  import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
3
  import type { PluginInjectionAPI } from '../types';
4
4
  export declare function tableSelectionKeymapPlugin(pluginInjectionApi?: PluginInjectionAPI, getIntl?: () => IntlShape): SafePlugin;
@@ -0,0 +1,8 @@
1
+ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
+ import type { Transaction } from '@atlaskit/editor-prosemirror/state';
3
+ export type TableMeasurement = {
4
+ colWidths: Array<number>;
5
+ tableWidth: number;
6
+ };
7
+ export declare const getTableMeasurement: (tableRef: HTMLTableElement) => TableMeasurement;
8
+ export declare const applyTableMeasurement: (tr: Transaction, tableNode: PMNode, { colWidths, tableWidth }: TableMeasurement, tablePos: number) => Transaction;
@@ -0,0 +1,11 @@
1
+ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
+ import type { Transaction } from '@atlaskit/editor-prosemirror/state';
3
+ export declare const replaceCells: (tr: Transaction, table: PMNode, tablePos: number, modifyCell: (cell: PMNode, rowIndex: number, colIndex: number) => PMNode) => Transaction;
4
+ /**
5
+ * Position-preserving alternative to `replaceCells`.
6
+ *
7
+ * Uses `setNodeMarkup` per cell instead of rebuilding the whole table with
8
+ * `replaceWith`, so document positions inside cells are never invalidated.
9
+ * This preserves any existing selection through `tr.mapping`.
10
+ */
11
+ export declare const updateCellsMarkup: (tr: Transaction, table: PMNode, tablePos: number, modifyCell: (cell: PMNode, rowIndex: number, colIndex: number) => PMNode) => Transaction;
@@ -1,4 +1,4 @@
1
- import type { IntlShape } from 'react-intl-next';
1
+ import type { IntlShape } from 'react-intl';
2
2
  import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
3
3
  import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
4
4
  import type { ReadonlyTransaction, Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
@@ -1,4 +1,4 @@
1
- import type { IntlShape } from 'react-intl-next';
1
+ import type { IntlShape } from 'react-intl';
2
2
  import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
3
3
  import type { Transaction } from '@atlaskit/editor-prosemirror/state';
4
4
  export declare const getMergedCellsPositions: (tr: Transaction) => number[];
@@ -0,0 +1,22 @@
1
+ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
+ import type { PluginInjectionAPI } from '../../types';
4
+ type ContentModePluginOptions = {
5
+ allowColumnResizing: boolean;
6
+ allowTableResizing: boolean;
7
+ isFullPageEditor: boolean;
8
+ };
9
+ export declare const isTableInContentMode: ({ allowColumnResizing, allowTableResizing, isFullPageEditor, isTableNested, node, }: ContentModePluginOptions & {
10
+ isTableNested?: boolean;
11
+ node?: PMNode;
12
+ }) => boolean;
13
+ export declare const isContentModeSupported: ({ allowColumnResizing, allowTableResizing, isFullPageEditor, }: ContentModePluginOptions) => boolean;
14
+ export declare const hasTableBeenResized: (node: PMNode) => boolean;
15
+ /**
16
+ * Iterates all top-level tables in the document, and for those in content mode,
17
+ * measures rendered column widths and sets colwidth + table width attributes
18
+ * in a single batched transaction.
19
+ */
20
+ export declare const applyMeasuredWidthToAllTables: (view: EditorView, pluginInjectionApi?: PluginInjectionAPI) => void;
21
+ export declare const applyMeasuredWidthToSelectedTable: (view: EditorView, api?: PluginInjectionAPI) => void;
22
+ export {};