@atlaskit/editor-plugin-table 9.3.2 → 9.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cjs/nodeviews/toDOM.js +2 -1
  3. package/dist/cjs/pm-plugins/table-resizing/event-handlers.js +9 -4
  4. package/dist/cjs/pm-plugins/table-resizing/utils/scale-table.js +6 -0
  5. package/dist/es2019/nodeviews/toDOM.js +2 -1
  6. package/dist/es2019/pm-plugins/table-resizing/event-handlers.js +9 -4
  7. package/dist/es2019/pm-plugins/table-resizing/utils/scale-table.js +6 -0
  8. package/dist/esm/nodeviews/toDOM.js +2 -1
  9. package/dist/esm/pm-plugins/table-resizing/event-handlers.js +9 -4
  10. package/dist/esm/pm-plugins/table-resizing/utils/scale-table.js +6 -0
  11. package/dist/types/nodeviews/ExternalDropTargets.d.ts +2 -2
  12. package/dist/types/nodeviews/TableComponentWithSharedState.d.ts +2 -2
  13. package/dist/types/nodeviews/TableContainer.d.ts +2 -2
  14. package/dist/types/nodeviews/TableResizer.d.ts +2 -1
  15. package/dist/types/nodeviews/table.d.ts +2 -2
  16. package/dist/types/ui/DragHandle/HandleIconComponent.d.ts +2 -2
  17. package/dist/types/ui/DragPreview/index.d.ts +2 -2
  18. package/dist/types/ui/FloatingDeleteButton/index.d.ts +2 -2
  19. package/dist/types/ui/FloatingDragMenu/DropdownMenu.d.ts +2 -2
  20. package/dist/types/ui/FloatingDragMenu/index.d.ts +2 -2
  21. package/dist/types/ui/FloatingInsertButton/index.d.ts +1 -1
  22. package/dist/types/ui/FloatingToolbarLabel/FloatingToolbarLabel.d.ts +1 -1
  23. package/dist/types/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +2 -2
  24. package/dist/types/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.d.ts +2 -2
  25. package/dist/types/ui/TableFloatingColumnControls/ColumnDropTargets/index.d.ts +2 -2
  26. package/dist/types/ui/TableFloatingColumnControls/index.d.ts +2 -2
  27. package/dist/types/ui/TableFloatingControls/FloatingControlsWithSelection.d.ts +2 -2
  28. package/dist/types/ui/TableFloatingControls/NumberColumn/index.d.ts +2 -2
  29. package/dist/types/ui/TableFloatingControls/RowControls/DragControls.d.ts +3 -3
  30. package/dist/types/ui/TableFloatingControls/RowDropTarget/index.d.ts +1 -1
  31. package/dist/types/ui/TableFloatingControls/index.d.ts +2 -2
  32. package/dist/types/ui/TableFullWidthLabel/index.d.ts +2 -2
  33. package/dist/types/ui/icons/AddColLeftIcon.d.ts +2 -2
  34. package/dist/types/ui/icons/AddColRightIcon.d.ts +2 -2
  35. package/dist/types/ui/icons/AddRowAboveIcon.d.ts +2 -2
  36. package/dist/types/ui/icons/AddRowBelowIcon.d.ts +2 -2
  37. package/dist/types/ui/icons/DragHandleDisabledIcon.d.ts +1 -1
  38. package/dist/types/ui/icons/DragHandleIcon.d.ts +2 -2
  39. package/dist/types/ui/icons/DragInMotionIcon.d.ts +1 -1
  40. package/dist/types/ui/icons/MergeCellsIcon.d.ts +2 -2
  41. package/dist/types/ui/icons/MinimisedHandle.d.ts +2 -2
  42. package/dist/types/ui/icons/SortingIconWrapper.d.ts +1 -1
  43. package/dist/types/ui/icons/SplitCellIcon.d.ts +2 -2
  44. package/dist/types-ts4.5/nodeviews/ExternalDropTargets.d.ts +2 -2
  45. package/dist/types-ts4.5/nodeviews/TableComponentWithSharedState.d.ts +2 -2
  46. package/dist/types-ts4.5/nodeviews/TableContainer.d.ts +2 -2
  47. package/dist/types-ts4.5/nodeviews/TableResizer.d.ts +2 -1
  48. package/dist/types-ts4.5/nodeviews/table.d.ts +2 -2
  49. package/dist/types-ts4.5/ui/DragHandle/HandleIconComponent.d.ts +2 -2
  50. package/dist/types-ts4.5/ui/DragPreview/index.d.ts +2 -2
  51. package/dist/types-ts4.5/ui/FloatingDeleteButton/index.d.ts +2 -2
  52. package/dist/types-ts4.5/ui/FloatingDragMenu/DropdownMenu.d.ts +2 -2
  53. package/dist/types-ts4.5/ui/FloatingDragMenu/index.d.ts +2 -2
  54. package/dist/types-ts4.5/ui/FloatingInsertButton/index.d.ts +1 -1
  55. package/dist/types-ts4.5/ui/FloatingToolbarLabel/FloatingToolbarLabel.d.ts +1 -1
  56. package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +2 -2
  57. package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.d.ts +2 -2
  58. package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnDropTargets/index.d.ts +2 -2
  59. package/dist/types-ts4.5/ui/TableFloatingColumnControls/index.d.ts +2 -2
  60. package/dist/types-ts4.5/ui/TableFloatingControls/FloatingControlsWithSelection.d.ts +2 -2
  61. package/dist/types-ts4.5/ui/TableFloatingControls/NumberColumn/index.d.ts +2 -2
  62. package/dist/types-ts4.5/ui/TableFloatingControls/RowControls/DragControls.d.ts +3 -3
  63. package/dist/types-ts4.5/ui/TableFloatingControls/RowDropTarget/index.d.ts +1 -1
  64. package/dist/types-ts4.5/ui/TableFloatingControls/index.d.ts +2 -2
  65. package/dist/types-ts4.5/ui/TableFullWidthLabel/index.d.ts +2 -2
  66. package/dist/types-ts4.5/ui/icons/AddColLeftIcon.d.ts +2 -2
  67. package/dist/types-ts4.5/ui/icons/AddColRightIcon.d.ts +2 -2
  68. package/dist/types-ts4.5/ui/icons/AddRowAboveIcon.d.ts +2 -2
  69. package/dist/types-ts4.5/ui/icons/AddRowBelowIcon.d.ts +2 -2
  70. package/dist/types-ts4.5/ui/icons/DragHandleDisabledIcon.d.ts +1 -1
  71. package/dist/types-ts4.5/ui/icons/DragHandleIcon.d.ts +2 -2
  72. package/dist/types-ts4.5/ui/icons/DragInMotionIcon.d.ts +1 -1
  73. package/dist/types-ts4.5/ui/icons/MergeCellsIcon.d.ts +2 -2
  74. package/dist/types-ts4.5/ui/icons/MinimisedHandle.d.ts +2 -2
  75. package/dist/types-ts4.5/ui/icons/SortingIconWrapper.d.ts +1 -1
  76. package/dist/types-ts4.5/ui/icons/SplitCellIcon.d.ts +2 -2
  77. package/package.json +12 -6
  78. package/src/nodeviews/toDOM.ts +11 -10
  79. package/src/pm-plugins/table-resizing/event-handlers.ts +13 -4
  80. package/src/pm-plugins/table-resizing/utils/scale-table.ts +6 -0
  81. package/src/ui/TableFloatingColumnControls/index.tsx +1 -4
  82. package/src/ui/TableFloatingControls/CornerControls/ClassicCornerControls.tsx +1 -3
  83. package/src/ui/TableFloatingControls/RowControls/ClassicControls.tsx +1 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 9.3.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#110015](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/110015)
8
+ [`92048a44fc3f6`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/92048a44fc3f6) -
9
+ fix table layout shift issue
10
+ - Updated dependencies
11
+
12
+ ## 9.3.3
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies
17
+
3
18
  ## 9.3.2
4
19
 
5
20
  ### Patch Changes
@@ -12,6 +12,7 @@ var _kebabCase = _interopRequireDefault(require("lodash/kebabCase"));
12
12
  var _adfSchema = require("@atlaskit/adf-schema");
13
13
  var _lazyNodeView = require("@atlaskit/editor-common/lazy-node-view");
14
14
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
15
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
15
16
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
16
17
  var _colgroup = require("../pm-plugins/table-resizing/utils/colgroup");
17
18
  var _consts = require("../pm-plugins/table-resizing/utils/consts");
@@ -92,7 +93,7 @@ var tableNodeSpecWithFixedToDOM = exports.tableNodeSpecWithFixedToDOM = function
92
93
  '--ak-editor-table-min-width': "".concat(tableMinWidth, "px"),
93
94
  minWidth: 'var(--ak-editor-table-min-width)',
94
95
  maxWidth: "min(calc(100cqw - var(--ak-editor-table-gutter-padding)), var(--ak-editor-table-max-width))",
95
- width: "min(calc(100cqw - var(--ak-editor-table-gutter-padding)), ".concat(node.attrs.width, ")")
96
+ width: (0, _platformFeatureFlags.fg)('platform_editor_table_layout_shift_fix') ? "min(calc(100cqw - var(--ak-editor-table-gutter-padding)), ".concat(node.attrs.width, "px)") : "min(calc(100cqw - var(--ak-editor-table-gutter-padding)), ".concat(node.attrs.width, ")")
96
97
  })
97
98
  }, ['span', {
98
99
  class: 'resizer-hover-zone'
@@ -8,11 +8,13 @@ var _analytics = require("@atlaskit/editor-common/analytics");
8
8
  var _styles = require("@atlaskit/editor-common/styles");
9
9
  var _tableMap = require("@atlaskit/editor-tables/table-map");
10
10
  var _utils = require("@atlaskit/editor-tables/utils");
11
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
11
12
  var _columnResize = require("../commands/column-resize");
12
13
  var _misc = require("../commands/misc");
13
14
  var _pluginFactory = require("../plugin-factory");
14
15
  var _tableAnalytics = require("../table-analytics");
15
16
  var _columnWidth = require("../transforms/column-width");
17
+ var _nodes = require("../utils/nodes");
16
18
  var _selection = require("../utils/selection");
17
19
  var _commands = require("./commands");
18
20
  var _pluginFactory2 = require("./plugin-factory");
@@ -153,10 +155,13 @@ var handleMouseDown = exports.handleMouseDown = function handleMouseDown(view, e
153
155
  if (dragging) {
154
156
  var startX = dragging.startX;
155
157
 
156
- // If the table has changed (via collab for example) don't apply column widths
157
- // For example, if a table col is deleted we won't be able to reliably remap the new widths
158
- // There may be a more elegant solution to this, to avoid a jarring experience.
159
- if (table.eq(originalTable)) {
158
+ // If the dimensions of the table have changed through a remote modification by another
159
+ // person for example don't persist the new column widths as we couldn't reliably remap them
160
+ // For example, if a table col is deleted
161
+ // There may be a more elegant solution to this, to avoid a jarring experience. This used to
162
+ // be an equality check but that caused issues when a nested table would change (eg. when it
163
+ // dynamically updates its width on resize)
164
+ if ((0, _platformFeatureFlags.fg)('platform_editor_nested_tables_resizing') ? !(0, _nodes.tablesHaveDifferentNoOfColumns)(originalTable, table) : table.eq(originalTable)) {
160
165
  var _table$attrs;
161
166
  var map = _tableMap.TableMap.get(table);
162
167
  var colIndex = map.colCount($cell.pos - start) + ($cell.nodeAfter ? $cell.nodeAfter.attrs.colspan : 1) - 1;
@@ -10,6 +10,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
10
10
  var _nodeWidth = require("@atlaskit/editor-common/node-width");
11
11
  var _styles = require("@atlaskit/editor-common/styles");
12
12
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
13
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
13
14
  var _columnWidth = require("../../transforms/column-width");
14
15
  var _nodes = require("../../utils/nodes");
15
16
  var _misc = require("../utils/misc");
@@ -177,6 +178,11 @@ var scaleTable = exports.scaleTable = function scaleTable(tableRef, options, dom
177
178
  }
178
179
  if (resizeState) {
179
180
  tr = (0, _columnWidth.updateColumnWidths)(resizeState, node, start, api)(tr);
181
+ if ((0, _platformFeatureFlags.fg)('platform_editor_nested_tables_resizing')) {
182
+ // Avoid adding this transaction separately to the history as these are automatic updates
183
+ // as a consequence of another action
184
+ tr.setMeta('addToHistory', false);
185
+ }
180
186
  if (tr.docChanged) {
181
187
  tr.setMeta('scrollIntoView', false);
182
188
  // TODO: ED-8995
@@ -2,6 +2,7 @@ import kebabCase from 'lodash/kebabCase';
2
2
  import { table, tableWithNestedTable } from '@atlaskit/adf-schema';
3
3
  import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
4
4
  import { akEditorGutterPaddingDynamic } from '@atlaskit/editor-shared-styles';
5
+ import { fg } from '@atlaskit/platform-feature-flags';
5
6
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
6
7
  import { generateColgroup, getResizerMinWidth } from '../pm-plugins/table-resizing/utils/colgroup';
7
8
  import { TABLE_MAX_WIDTH } from '../pm-plugins/table-resizing/utils/consts';
@@ -76,7 +77,7 @@ export const tableNodeSpecWithFixedToDOM = config => {
76
77
  '--ak-editor-table-min-width': `${tableMinWidth}px`,
77
78
  minWidth: 'var(--ak-editor-table-min-width)',
78
79
  maxWidth: `min(calc(100cqw - var(--ak-editor-table-gutter-padding)), var(--ak-editor-table-max-width))`,
79
- width: `min(calc(100cqw - var(--ak-editor-table-gutter-padding)), ${node.attrs.width})`
80
+ width: fg('platform_editor_table_layout_shift_fix') ? `min(calc(100cqw - var(--ak-editor-table-gutter-padding)), ${node.attrs.width}px)` : `min(calc(100cqw - var(--ak-editor-table-gutter-padding)), ${node.attrs.width})`
80
81
  })
81
82
  }, ['span', {
82
83
  class: 'resizer-hover-zone'
@@ -2,11 +2,13 @@ import { ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD, TABLE_ACTION, TABLE_OVERFLOW_
2
2
  import { tableCellMinWidth } from '@atlaskit/editor-common/styles';
3
3
  import { TableMap } from '@atlaskit/editor-tables/table-map';
4
4
  import { getSelectionRect } from '@atlaskit/editor-tables/utils';
5
+ import { fg } from '@atlaskit/platform-feature-flags';
5
6
  import { stopKeyboardColumnResizing } from '../commands/column-resize';
6
7
  import { updateResizeHandleDecorations } from '../commands/misc';
7
8
  import { getPluginState as getTablePluginState } from '../plugin-factory';
8
9
  import { META_KEYS } from '../table-analytics';
9
10
  import { updateColumnWidths } from '../transforms/column-width';
11
+ import { tablesHaveDifferentNoOfColumns } from '../utils/nodes';
10
12
  import { getSelectedColumnIndexes } from '../utils/selection';
11
13
  import { evenColumns, setDragging, stopResizing } from './commands';
12
14
  import { getPluginState } from './plugin-factory';
@@ -161,10 +163,13 @@ export const handleMouseDown = (view, event, localResizeHandlePos, getEditorCont
161
163
  startX
162
164
  } = dragging;
163
165
 
164
- // If the table has changed (via collab for example) don't apply column widths
165
- // For example, if a table col is deleted we won't be able to reliably remap the new widths
166
- // There may be a more elegant solution to this, to avoid a jarring experience.
167
- if (table.eq(originalTable)) {
166
+ // If the dimensions of the table have changed through a remote modification by another
167
+ // person for example don't persist the new column widths as we couldn't reliably remap them
168
+ // For example, if a table col is deleted
169
+ // There may be a more elegant solution to this, to avoid a jarring experience. This used to
170
+ // be an equality check but that caused issues when a nested table would change (eg. when it
171
+ // dynamically updates its width on resize)
172
+ if (fg('platform_editor_nested_tables_resizing') ? !tablesHaveDifferentNoOfColumns(originalTable, table) : table.eq(originalTable)) {
168
173
  var _table$attrs;
169
174
  const map = TableMap.get(table);
170
175
  const colIndex = map.colCount($cell.pos - start) + ($cell.nodeAfter ? $cell.nodeAfter.attrs.colspan : 1) - 1;
@@ -1,6 +1,7 @@
1
1
  import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
2
2
  import { tableCellMinWidth } from '@atlaskit/editor-common/styles';
3
3
  import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
4
+ import { fg } from '@atlaskit/platform-feature-flags';
4
5
  import { updateColumnWidths } from '../../transforms/column-width';
5
6
  import { getTableWidth } from '../../utils/nodes';
6
7
  import { getLayoutSize } from '../utils/misc';
@@ -163,6 +164,11 @@ export const scaleTable = (tableRef, options, domAtPos, api, isTableScalingEnabl
163
164
  }
164
165
  if (resizeState) {
165
166
  tr = updateColumnWidths(resizeState, node, start, api)(tr);
167
+ if (fg('platform_editor_nested_tables_resizing')) {
168
+ // Avoid adding this transaction separately to the history as these are automatic updates
169
+ // as a consequence of another action
170
+ tr.setMeta('addToHistory', false);
171
+ }
166
172
  if (tr.docChanged) {
167
173
  tr.setMeta('scrollIntoView', false);
168
174
  // TODO: ED-8995
@@ -7,6 +7,7 @@ import kebabCase from 'lodash/kebabCase';
7
7
  import { table, tableWithNestedTable } from '@atlaskit/adf-schema';
8
8
  import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
9
9
  import { akEditorGutterPaddingDynamic } from '@atlaskit/editor-shared-styles';
10
+ import { fg } from '@atlaskit/platform-feature-flags';
10
11
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
11
12
  import { generateColgroup, getResizerMinWidth } from '../pm-plugins/table-resizing/utils/colgroup';
12
13
  import { TABLE_MAX_WIDTH } from '../pm-plugins/table-resizing/utils/consts';
@@ -85,7 +86,7 @@ export var tableNodeSpecWithFixedToDOM = function tableNodeSpecWithFixedToDOM(co
85
86
  '--ak-editor-table-min-width': "".concat(tableMinWidth, "px"),
86
87
  minWidth: 'var(--ak-editor-table-min-width)',
87
88
  maxWidth: "min(calc(100cqw - var(--ak-editor-table-gutter-padding)), var(--ak-editor-table-max-width))",
88
- width: "min(calc(100cqw - var(--ak-editor-table-gutter-padding)), ".concat(node.attrs.width, ")")
89
+ width: fg('platform_editor_table_layout_shift_fix') ? "min(calc(100cqw - var(--ak-editor-table-gutter-padding)), ".concat(node.attrs.width, "px)") : "min(calc(100cqw - var(--ak-editor-table-gutter-padding)), ".concat(node.attrs.width, ")")
89
90
  })
90
91
  }, ['span', {
91
92
  class: 'resizer-hover-zone'
@@ -2,11 +2,13 @@ import { ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD, TABLE_ACTION, TABLE_OVERFLOW_
2
2
  import { tableCellMinWidth } from '@atlaskit/editor-common/styles';
3
3
  import { TableMap } from '@atlaskit/editor-tables/table-map';
4
4
  import { getSelectionRect } from '@atlaskit/editor-tables/utils';
5
+ import { fg } from '@atlaskit/platform-feature-flags';
5
6
  import { stopKeyboardColumnResizing } from '../commands/column-resize';
6
7
  import { updateResizeHandleDecorations } from '../commands/misc';
7
8
  import { getPluginState as getTablePluginState } from '../plugin-factory';
8
9
  import { META_KEYS } from '../table-analytics';
9
10
  import { updateColumnWidths } from '../transforms/column-width';
11
+ import { tablesHaveDifferentNoOfColumns } from '../utils/nodes';
10
12
  import { getSelectedColumnIndexes } from '../utils/selection';
11
13
  import { evenColumns, setDragging, stopResizing } from './commands';
12
14
  import { getPluginState } from './plugin-factory';
@@ -147,10 +149,13 @@ export var handleMouseDown = function handleMouseDown(view, event, localResizeHa
147
149
  if (dragging) {
148
150
  var startX = dragging.startX;
149
151
 
150
- // If the table has changed (via collab for example) don't apply column widths
151
- // For example, if a table col is deleted we won't be able to reliably remap the new widths
152
- // There may be a more elegant solution to this, to avoid a jarring experience.
153
- if (table.eq(originalTable)) {
152
+ // If the dimensions of the table have changed through a remote modification by another
153
+ // person for example don't persist the new column widths as we couldn't reliably remap them
154
+ // For example, if a table col is deleted
155
+ // There may be a more elegant solution to this, to avoid a jarring experience. This used to
156
+ // be an equality check but that caused issues when a nested table would change (eg. when it
157
+ // dynamically updates its width on resize)
158
+ if (fg('platform_editor_nested_tables_resizing') ? !tablesHaveDifferentNoOfColumns(originalTable, table) : table.eq(originalTable)) {
154
159
  var _table$attrs;
155
160
  var map = TableMap.get(table);
156
161
  var colIndex = map.colCount($cell.pos - start) + ($cell.nodeAfter ? $cell.nodeAfter.attrs.colspan : 1) - 1;
@@ -4,6 +4,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
4
4
  import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
5
5
  import { tableCellMinWidth } from '@atlaskit/editor-common/styles';
6
6
  import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
7
+ import { fg } from '@atlaskit/platform-feature-flags';
7
8
  import { updateColumnWidths } from '../../transforms/column-width';
8
9
  import { getTableWidth } from '../../utils/nodes';
9
10
  import { getLayoutSize } from '../utils/misc';
@@ -169,6 +170,11 @@ export var scaleTable = function scaleTable(tableRef, options, domAtPos, api) {
169
170
  }
170
171
  if (resizeState) {
171
172
  tr = updateColumnWidths(resizeState, node, start, api)(tr);
173
+ if (fg('platform_editor_nested_tables_resizing')) {
174
+ // Avoid adding this transaction separately to the history as these are automatic updates
175
+ // as a consequence of another action
176
+ tr.setMeta('addToHistory', false);
177
+ }
172
178
  if (tr.docChanged) {
173
179
  tr.setMeta('scrollIntoView', false);
174
180
  // TODO: ED-8995
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
3
3
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
4
  export declare const ExternalDropTargets: ({ editorView, node, getScrollOffset, getTableWrapperWidth, }: {
@@ -6,4 +6,4 @@ export declare const ExternalDropTargets: ({ editorView, node, getScrollOffset,
6
6
  node?: PMNode | undefined;
7
7
  getScrollOffset: () => number;
8
8
  getTableWrapperWidth: () => number;
9
- }) => JSX.Element | null;
9
+ }) => React.JSX.Element | null;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
3
3
  import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
4
4
  import type { GetEditorFeatureFlags, getPosHandlerNode } from '@atlaskit/editor-common/types';
@@ -25,5 +25,5 @@ type TableComponentWithSharedStateProps = {
25
25
  /**
26
26
  * Use useSharedPluginState to control re-renders from plugin dependencies
27
27
  */
28
- export declare const TableComponentWithSharedState: ({ view, options, getNode, dispatchAnalyticsEvent, api, getEditorFeatureFlags, eventDispatcher, allowColumnResizing, allowControls, getPos, forwardRef, allowTableAlignment, allowTableResizing, }: TableComponentWithSharedStateProps) => JSX.Element | null;
28
+ export declare const TableComponentWithSharedState: ({ view, options, getNode, dispatchAnalyticsEvent, api, getEditorFeatureFlags, eventDispatcher, allowColumnResizing, allowControls, getPos, forwardRef, allowTableAlignment, allowTableResizing, }: TableComponentWithSharedStateProps) => React.JSX.Element | null;
29
29
  export {};
@@ -22,7 +22,7 @@ type ResizableTableContainerProps = {
22
22
  shouldUseIncreasedScalingPercent?: boolean;
23
23
  isCommentEditor?: boolean;
24
24
  };
25
- export declare const ResizableTableContainer: React.MemoExoticComponent<({ children, className, node, containerWidth, lineLength, editorView, getPos, tableRef, isResizing, pluginInjectionApi, tableWrapperHeight, isWholeTableInDanger, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, }: PropsWithChildren<ResizableTableContainerProps>) => JSX.Element>;
25
+ export declare const ResizableTableContainer: React.MemoExoticComponent<({ children, className, node, containerWidth, lineLength, editorView, getPos, tableRef, isResizing, pluginInjectionApi, tableWrapperHeight, isWholeTableInDanger, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, }: PropsWithChildren<ResizableTableContainerProps>) => React.JSX.Element>;
26
26
  type TableContainerProps = {
27
27
  node: PMNode;
28
28
  className: string;
@@ -43,5 +43,5 @@ type TableContainerProps = {
43
43
  isCommentEditor?: boolean;
44
44
  isChromelessEditor?: boolean;
45
45
  };
46
- export declare const TableContainer: ({ children, node, className, containerWidth: { width: editorWidth, lineLength }, editorView, getPos, tableRef, isNested, tableWrapperHeight, isResizing, pluginInjectionApi, isWholeTableInDanger, isTableResizingEnabled, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor, }: PropsWithChildren<TableContainerProps>) => JSX.Element;
46
+ export declare const TableContainer: ({ children, node, className, containerWidth: { width: editorWidth, lineLength }, editorView, getPos, tableRef, isNested, tableWrapperHeight, isResizing, pluginInjectionApi, isWholeTableInDanger, isTableResizingEnabled, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor, }: PropsWithChildren<TableContainerProps>) => React.JSX.Element;
47
47
  export {};
@@ -1,4 +1,5 @@
1
1
  import type { PropsWithChildren } from 'react';
2
+ import React from 'react';
2
3
  import type { TableEventPayload } from '@atlaskit/editor-common/analytics';
3
4
  import type { GuidelineConfig } from '@atlaskit/editor-common/guideline';
4
5
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
@@ -30,5 +31,5 @@ interface TableResizerProps {
30
31
  onResizeStart?: () => void;
31
32
  disabled?: boolean;
32
33
  }
33
- export declare const TableResizer: ({ children, width, maxWidth, containerWidth, lineLength, updateWidth, onResizeStop, onResizeStart, editorView, getPos, node, tableRef, displayGuideline, attachAnalyticsEvent, displayGapCursor, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, isWholeTableInDanger, shouldUseIncreasedScalingPercent, pluginInjectionApi, isFullWidthModeEnabled, isCommentEditor, disabled, }: PropsWithChildren<TableResizerProps>) => JSX.Element;
34
+ export declare const TableResizer: ({ children, width, maxWidth, containerWidth, lineLength, updateWidth, onResizeStop, onResizeStart, editorView, getPos, node, tableRef, displayGuideline, attachAnalyticsEvent, displayGapCursor, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, isWholeTableInDanger, shouldUseIncreasedScalingPercent, pluginInjectionApi, isFullWidthModeEnabled, isCommentEditor, disabled, }: PropsWithChildren<TableResizerProps>) => React.JSX.Element;
34
35
  export {};
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
3
3
  import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
4
4
  import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
@@ -23,7 +23,7 @@ export default class TableView extends ReactNodeView<Props> {
23
23
  };
24
24
  setDomAttrs(node: PmNode): void;
25
25
  getNode: () => PmNode;
26
- render(props: Props, forwardRef: ForwardRef): JSX.Element;
26
+ render(props: Props, forwardRef: ForwardRef): React.JSX.Element;
27
27
  private hasHoveredRows;
28
28
  viewShouldUpdate(nextNode: PmNode): boolean;
29
29
  ignoreMutation(mutation: MutationRecord | {
@@ -1,8 +1,8 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  type HandleIconProps = {
3
3
  forceDefaultHandle: boolean;
4
4
  isHandleHovered: boolean;
5
5
  hasMergedCells: boolean;
6
6
  };
7
- export declare const HandleIconComponent: (props: HandleIconProps) => JSX.Element;
7
+ export declare const HandleIconComponent: (props: HandleIconProps) => React.JSX.Element;
8
8
  export {};
@@ -1,7 +1,7 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import type { TableDirection } from '../../types';
3
3
  export declare const DragPreview: ({ direction, width, height, }: {
4
4
  direction: TableDirection;
5
5
  width: number;
6
6
  height: number;
7
- }) => JSX.Element;
7
+ }) => React.JSX.Element;
@@ -1,4 +1,4 @@
1
- import { Component } from 'react';
1
+ import React, { Component } from 'react';
2
2
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
3
  import type { Selection } from '@atlaskit/editor-prosemirror/state';
4
4
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
@@ -50,6 +50,6 @@ declare class FloatingDeleteButton extends Component<Props, State> {
50
50
  * @memberof FloatingDeleteButton
51
51
  */
52
52
  private handleClick;
53
- render(): JSX.Element | null;
53
+ render(): React.JSX.Element | null;
54
54
  }
55
55
  export default FloatingDeleteButton;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
3
3
  type DropdownMenuProps = {
4
4
  items: Array<{
@@ -32,5 +32,5 @@ type DropdownMenuProps = {
32
32
  boundariesElement?: HTMLElement;
33
33
  scrollableElement?: HTMLElement;
34
34
  };
35
- export declare const DropdownMenu: ({ items, section, disableKeyboardHandling, onItemActivated, handleClose, onMouseEnter, onMouseLeave, fitWidth, fitHeight, direction, mountPoint, boundariesElement, scrollableElement, }: DropdownMenuProps) => JSX.Element;
35
+ export declare const DropdownMenu: ({ items, section, disableKeyboardHandling, onItemActivated, handleClose, onMouseEnter, onMouseLeave, fitWidth, fitHeight, direction, mountPoint, boundariesElement, scrollableElement, }: DropdownMenuProps) => React.JSX.Element;
36
36
  export {};
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
3
  import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
4
4
  import type { AriaLiveElementAttributes } from '@atlaskit/editor-plugin-accessibility-utils';
@@ -28,7 +28,7 @@ interface Props {
28
28
  isCommentEditor?: boolean;
29
29
  }
30
30
  declare const FloatingDragMenu: {
31
- ({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, tableNode, direction, index, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, stickyHeaders, pluginConfig, isTableScalingEnabled, getEditorFeatureFlags, ariaNotifyPlugin, api, isCommentEditor, }: Props): JSX.Element | null;
31
+ ({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, tableNode, direction, index, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, stickyHeaders, pluginConfig, isTableScalingEnabled, getEditorFeatureFlags, ariaNotifyPlugin, api, isCommentEditor, }: Props): React.JSX.Element | null;
32
32
  displayName: string;
33
33
  };
34
34
  export default FloatingDragMenu;
@@ -30,7 +30,7 @@ export interface Props {
30
30
  export declare class FloatingInsertButton extends React.Component<Props & WrappedComponentProps, any> {
31
31
  static displayName: string;
32
32
  constructor(props: Props & WrappedComponentProps);
33
- render(): JSX.Element | null;
33
+ render(): React.JSX.Element | null;
34
34
  private getCellPosition;
35
35
  private insertRow;
36
36
  private insertColumn;
@@ -9,5 +9,5 @@ interface Props {
9
9
  stick?: boolean;
10
10
  offset?: [number, number];
11
11
  }
12
- export declare const FloatingToolbarLabel: React.MemoExoticComponent<(props: Props) => JSX.Element>;
12
+ export declare const FloatingToolbarLabel: React.MemoExoticComponent<(props: Props) => React.JSX.Element>;
13
13
  export {};
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
3
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
4
  import type { TablePlugin } from '../../../tablePluginType';
@@ -28,5 +28,5 @@ export declare const ColumnControls: ({ editorView, tableActive, tableRef, hover
28
28
  commands: import("../../../tablePluginType").TablePluginCommands;
29
29
  dependencies: import("../../../tablePluginType").TablePluginDependencies;
30
30
  }> | undefined;
31
- }) => JSX.Element;
31
+ }) => React.JSX.Element;
32
32
  export {};
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  interface Props {
3
3
  index: number;
4
4
  localId?: string;
@@ -6,5 +6,5 @@ interface Props {
6
6
  height?: number;
7
7
  marginTop?: number;
8
8
  }
9
- export declare const ColumnDropTarget: ({ index, localId, width, height, marginTop }: Props) => JSX.Element;
9
+ export declare const ColumnDropTarget: ({ index, localId, width, height, marginTop }: Props) => React.JSX.Element;
10
10
  export {};
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  interface Props {
3
3
  tableRef: HTMLTableElement;
4
4
  tableHeight?: number;
@@ -7,5 +7,5 @@ interface Props {
7
7
  isHeaderSticky?: boolean;
8
8
  getScrollOffset?: () => number;
9
9
  }
10
- export declare const ColumnDropTargets: ({ tableRef, tableHeight, localId, colWidths, isHeaderSticky, getScrollOffset, }: Props) => JSX.Element | null;
10
+ export declare const ColumnDropTargets: ({ tableRef, tableHeight, localId, colWidths, isHeaderSticky, getScrollOffset, }: Props) => React.JSX.Element | null;
11
11
  export {};
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import type { TableColumnOrdering } from '@atlaskit/custom-steps';
3
3
  import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
4
4
  import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
@@ -29,5 +29,5 @@ interface Props {
29
29
  api?: PluginInjectionAPI;
30
30
  isChromelessEditor?: boolean;
31
31
  }
32
- declare const TableFloatingColumnControls: ({ editorView, tableRef, getNode, tableActive, hasHeaderRow, hoveredCell, isResizing, stickyHeader, selection, isInDanger, isTableHovered, tableContainerWidth, isNumberColumnEnabled, getScrollOffset, tableWrapperHeight, api, isChromelessEditor, }: Props) => JSX.Element | null;
32
+ declare const TableFloatingColumnControls: ({ editorView, tableRef, getNode, tableActive, hasHeaderRow, hoveredCell, isResizing, stickyHeader, selection, isInDanger, isTableHovered, tableContainerWidth, isNumberColumnEnabled, getScrollOffset, tableWrapperHeight, api, isChromelessEditor, }: Props) => React.JSX.Element | null;
33
33
  export default TableFloatingColumnControls;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
3
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
4
  import type { TablePlugin } from '../../tablePluginType';
@@ -16,5 +16,5 @@ type FloatingControlsWithSelectionProps = {
16
16
  tableActive: boolean;
17
17
  api?: ExtractInjectionAPI<TablePlugin>;
18
18
  };
19
- export declare const FloatingControlsWithSelection: ({ editorView, tableRef, isInDanger, isResizing, isHeaderRowEnabled, isHeaderColumnEnabled, hoveredRows, stickyTop, hoverRows, selectRow, tableActive, api, }: FloatingControlsWithSelectionProps) => JSX.Element;
19
+ export declare const FloatingControlsWithSelection: ({ editorView, tableRef, isInDanger, isResizing, isHeaderRowEnabled, isHeaderColumnEnabled, hoveredRows, stickyTop, hoverRows, selectRow, tableActive, api, }: FloatingControlsWithSelectionProps) => React.JSX.Element;
20
20
  export {};
@@ -1,4 +1,4 @@
1
- import { Component } from 'react';
1
+ import React, { Component } from 'react';
2
2
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
3
  interface Props {
4
4
  editorView: EditorView;
@@ -15,7 +15,7 @@ interface Props {
15
15
  isDragAndDropEnabled?: boolean;
16
16
  }
17
17
  export default class NumberColumn extends Component<Props, any> {
18
- render(): JSX.Element;
18
+ render(): React.JSX.Element;
19
19
  private hoverRows;
20
20
  private selectRow;
21
21
  private clearHoverSelection;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
3
  import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
4
4
  import type { Selection } from '@atlaskit/editor-prosemirror/state';
@@ -22,6 +22,6 @@ type DragControlsProps = {
22
22
  api?: ExtractInjectionAPI<TablePlugin>;
23
23
  selection?: Selection;
24
24
  };
25
- export declare const DragControls: ({ tableRef, tableNode, tableWidth, hoveredCell, tableActive, editorView, isInDanger, isResizing, isTableHovered, hoverRows, selectRow, selectRows, updateCellHoverLocation, api, selection, }: DragControlsProps) => JSX.Element | null;
26
- export declare const DragControlsWithSelection: ({ editorView, tableRef, tableNode, tableWidth, tableActive, hoveredCell, isInDanger, isTableHovered, isResizing, hoverRows, selectRow, selectRows, updateCellHoverLocation, api, }: Exclude<DragControlsProps, 'selection'>) => JSX.Element;
25
+ export declare const DragControls: ({ tableRef, tableNode, tableWidth, hoveredCell, tableActive, editorView, isInDanger, isResizing, isTableHovered, hoverRows, selectRow, selectRows, updateCellHoverLocation, api, selection, }: DragControlsProps) => React.JSX.Element | null;
26
+ export declare const DragControlsWithSelection: ({ editorView, tableRef, tableNode, tableWidth, tableActive, hoveredCell, isInDanger, isTableHovered, isResizing, hoverRows, selectRow, selectRows, updateCellHoverLocation, api, }: Exclude<DragControlsProps, 'selection'>) => React.JSX.Element;
27
27
  export {};
@@ -4,5 +4,5 @@ type RowDropTargetProps = {
4
4
  localId?: string;
5
5
  style?: React.CSSProperties;
6
6
  };
7
- declare const RowDropTarget: ({ index, localId, style }: RowDropTargetProps) => JSX.Element;
7
+ declare const RowDropTarget: ({ index, localId, style }: RowDropTargetProps) => React.JSX.Element;
8
8
  export default RowDropTarget;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import type { TableColumnOrdering } from '@atlaskit/custom-steps';
3
3
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
4
4
  import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
@@ -38,5 +38,5 @@ export declare const TableFloatingControls: ({ editorView, tableRef, tableNode,
38
38
  commands: import("../../tablePluginType").TablePluginCommands;
39
39
  dependencies: import("../../tablePluginType").TablePluginDependencies;
40
40
  }> | undefined;
41
- }) => JSX.Element | null;
41
+ }) => React.JSX.Element | null;
42
42
  export default TableFloatingControls;
@@ -1,2 +1,2 @@
1
- /// <reference types="react" />
2
- export declare const FullWidthDisplay: () => JSX.Element;
1
+ import React from 'react';
2
+ export declare const FullWidthDisplay: () => React.JSX.Element;
@@ -1,2 +1,2 @@
1
- /// <reference types="react" />
2
- export declare const AddColLeftIcon: () => JSX.Element;
1
+ import React from 'react';
2
+ export declare const AddColLeftIcon: () => React.JSX.Element;
@@ -1,2 +1,2 @@
1
- /// <reference types="react" />
2
- export declare const AddColRightIcon: () => JSX.Element;
1
+ import React from 'react';
2
+ export declare const AddColRightIcon: () => React.JSX.Element;
@@ -1,2 +1,2 @@
1
- /// <reference types="react" />
2
- export declare const AddRowAboveIcon: () => JSX.Element;
1
+ import React from 'react';
2
+ export declare const AddRowAboveIcon: () => React.JSX.Element;
@@ -1,2 +1,2 @@
1
- /// <reference types="react" />
2
- export declare const AddRowBelowIcon: () => JSX.Element;
1
+ import React from 'react';
2
+ export declare const AddRowBelowIcon: () => React.JSX.Element;
@@ -2,5 +2,5 @@ import React from 'react';
2
2
  interface DragHandleDisabledIconProps {
3
3
  style?: React.CSSProperties;
4
4
  }
5
- export declare const DragHandleDisabledIcon: ({ style }: DragHandleDisabledIconProps) => JSX.Element;
5
+ export declare const DragHandleDisabledIcon: ({ style }: DragHandleDisabledIconProps) => React.JSX.Element;
6
6
  export {};
@@ -1,2 +1,2 @@
1
- /// <reference types="react" />
2
- export declare const DragHandleIcon: () => JSX.Element;
1
+ import React from 'react';
2
+ export declare const DragHandleIcon: () => React.JSX.Element;
@@ -2,5 +2,5 @@ import React from 'react';
2
2
  interface DragInMotionIconProps {
3
3
  style?: React.CSSProperties;
4
4
  }
5
- export declare const DragInMotionIcon: ({ style }: DragInMotionIconProps) => JSX.Element;
5
+ export declare const DragInMotionIcon: ({ style }: DragInMotionIconProps) => React.JSX.Element;
6
6
  export {};
@@ -1,2 +1,2 @@
1
- /// <reference types="react" />
2
- export declare const MergeCellsIcon: () => JSX.Element;
1
+ import React from 'react';
2
+ export declare const MergeCellsIcon: () => React.JSX.Element;
@@ -1,2 +1,2 @@
1
- /// <reference types="react" />
2
- export declare const MinimisedHandleIcon: () => JSX.Element;
1
+ import React from 'react';
2
+ export declare const MinimisedHandleIcon: () => React.JSX.Element;
@@ -6,5 +6,5 @@ type SortingIconProps = React.ComponentProps<typeof SortingIcon>;
6
6
  type SortingIconWrapperProps = SortingIconProps & {
7
7
  api: ExtractInjectionAPI<TablePlugin>;
8
8
  };
9
- export declare const SortingIconWrapper: (props: SortingIconWrapperProps) => JSX.Element | null;
9
+ export declare const SortingIconWrapper: (props: SortingIconWrapperProps) => React.JSX.Element | null;
10
10
  export {};
@@ -1,2 +1,2 @@
1
- /// <reference types="react" />
2
- export declare const SplitCellIcon: () => JSX.Element;
1
+ import React from 'react';
2
+ export declare const SplitCellIcon: () => React.JSX.Element;