@atlaskit/editor-plugin-table 12.1.14 → 12.2.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 (137) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/afm-cc/tsconfig.json +6 -0
  3. package/afm-dev-agents/tsconfig.json +6 -0
  4. package/afm-jira/tsconfig.json +6 -0
  5. package/afm-passionfruit/tsconfig.json +120 -0
  6. package/afm-post-office/tsconfig.json +6 -0
  7. package/afm-rovo-extension/tsconfig.json +6 -0
  8. package/afm-townsquare/tsconfig.json +6 -0
  9. package/afm-volt/tsconfig.json +13 -4
  10. package/dist/cjs/nodeviews/TableComponent.js +77 -26
  11. package/dist/cjs/nodeviews/TableContainer.js +270 -10
  12. package/dist/cjs/nodeviews/TableResizer.js +9 -2
  13. package/dist/cjs/nodeviews/TableRow.js +24 -1
  14. package/dist/cjs/nodeviews/table-node-views.js +1 -1
  15. package/dist/cjs/nodeviews/table.js +22 -7
  16. package/dist/cjs/nodeviews/toDOM.js +23 -7
  17. package/dist/cjs/pm-plugins/main.js +57 -22
  18. package/dist/cjs/pm-plugins/table-resizing/utils/colgroup.js +72 -1
  19. package/dist/cjs/pm-plugins/table-resizing/utils/misc.js +70 -1
  20. package/dist/cjs/tablePlugin.js +17 -3
  21. package/dist/cjs/ui/TableFloatingControls/NumberColumn/index.js +2 -7
  22. package/dist/es2019/nodeviews/TableComponent.js +80 -26
  23. package/dist/es2019/nodeviews/TableContainer.js +256 -2
  24. package/dist/es2019/nodeviews/TableResizer.js +9 -2
  25. package/dist/es2019/nodeviews/TableRow.js +24 -1
  26. package/dist/es2019/nodeviews/table-node-views.js +1 -1
  27. package/dist/es2019/nodeviews/table.js +21 -6
  28. package/dist/es2019/nodeviews/toDOM.js +24 -8
  29. package/dist/es2019/pm-plugins/main.js +57 -22
  30. package/dist/es2019/pm-plugins/table-resizing/utils/colgroup.js +72 -3
  31. package/dist/es2019/pm-plugins/table-resizing/utils/misc.js +70 -1
  32. package/dist/es2019/tablePlugin.js +17 -3
  33. package/dist/es2019/ui/TableFloatingControls/NumberColumn/index.js +5 -14
  34. package/dist/esm/nodeviews/TableComponent.js +77 -26
  35. package/dist/esm/nodeviews/TableContainer.js +270 -10
  36. package/dist/esm/nodeviews/TableResizer.js +9 -2
  37. package/dist/esm/nodeviews/TableRow.js +24 -1
  38. package/dist/esm/nodeviews/table-node-views.js +1 -1
  39. package/dist/esm/nodeviews/table.js +22 -7
  40. package/dist/esm/nodeviews/toDOM.js +24 -8
  41. package/dist/esm/pm-plugins/main.js +57 -22
  42. package/dist/esm/pm-plugins/table-resizing/utils/colgroup.js +74 -3
  43. package/dist/esm/pm-plugins/table-resizing/utils/misc.js +70 -1
  44. package/dist/esm/tablePlugin.js +17 -3
  45. package/dist/esm/ui/TableFloatingControls/NumberColumn/index.js +1 -6
  46. package/dist/types/nodeviews/ExternalDropTargets.d.ts +1 -1
  47. package/dist/types/nodeviews/TableComponent.d.ts +1 -0
  48. package/dist/types/nodeviews/TableContainer.d.ts +7 -2
  49. package/dist/types/nodeviews/TableResizer.d.ts +1 -1
  50. package/dist/types/nodeviews/TableRow.d.ts +3 -1
  51. package/dist/types/nodeviews/table.d.ts +1 -1
  52. package/dist/types/nodeviews/toDOM.d.ts +5 -0
  53. package/dist/types/nodeviews/types.d.ts +1 -0
  54. package/dist/types/pm-plugins/analytics/commands.d.ts +2 -2
  55. package/dist/types/pm-plugins/analytics/plugin-factory.d.ts +1 -1
  56. package/dist/types/pm-plugins/analytics/utils/moved-event.d.ts +1 -1
  57. package/dist/types/pm-plugins/commands/column-resize.d.ts +10 -10
  58. package/dist/types/pm-plugins/commands/commands-with-analytics.d.ts +1 -1
  59. package/dist/types/pm-plugins/commands/go-to-next-cell.d.ts +1 -1
  60. package/dist/types/pm-plugins/commands/misc.d.ts +2 -2
  61. package/dist/types/pm-plugins/commands/selection.d.ts +6 -6
  62. package/dist/types/pm-plugins/drag-and-drop/commands-with-analytics.d.ts +3 -3
  63. package/dist/types/pm-plugins/drag-and-drop/commands.d.ts +1 -1
  64. package/dist/types/pm-plugins/drag-and-drop/plugin-factory.d.ts +1 -1
  65. package/dist/types/pm-plugins/plugin-factory.d.ts +1 -1
  66. package/dist/types/pm-plugins/sticky-headers/plugin-state.d.ts +1 -1
  67. package/dist/types/pm-plugins/table-resizing/plugin-factory.d.ts +1 -1
  68. package/dist/types/pm-plugins/table-resizing/utils/colgroup.d.ts +1 -0
  69. package/dist/types/pm-plugins/table-resizing/utils/misc.d.ts +41 -0
  70. package/dist/types/pm-plugins/utils/create.d.ts +10 -10
  71. package/dist/types/pm-plugins/utils/decoration.d.ts +3 -3
  72. package/dist/types/pm-plugins/utils/dom.d.ts +2 -2
  73. package/dist/types/pm-plugins/utils/drag-menu.d.ts +3 -3
  74. package/dist/types/pm-plugins/utils/merged-cells.d.ts +3 -2
  75. package/dist/types/tablePluginType.d.ts +2 -0
  76. package/dist/types/ui/DragHandle/index.d.ts +4 -14
  77. package/dist/types/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +1 -7
  78. package/dist/types/ui/TableFloatingControls/CornerControls/DragCornerControls.d.ts +4 -14
  79. package/dist/types/ui/TableFloatingControls/RowControls/DragControls.d.ts +1 -1
  80. package/dist/types/ui/TableFloatingControls/index.d.ts +1 -7
  81. package/dist/types/ui/global-styles.d.ts +2 -8
  82. package/dist/types/ui/hooks/useInternalTablePluginStateSelector.d.ts +1 -1
  83. package/dist/types-ts4.5/nodeviews/ExternalDropTargets.d.ts +1 -1
  84. package/dist/types-ts4.5/nodeviews/TableComponent.d.ts +1 -0
  85. package/dist/types-ts4.5/nodeviews/TableContainer.d.ts +7 -2
  86. package/dist/types-ts4.5/nodeviews/TableResizer.d.ts +1 -1
  87. package/dist/types-ts4.5/nodeviews/TableRow.d.ts +3 -1
  88. package/dist/types-ts4.5/nodeviews/table.d.ts +1 -1
  89. package/dist/types-ts4.5/nodeviews/toDOM.d.ts +5 -0
  90. package/dist/types-ts4.5/nodeviews/types.d.ts +1 -0
  91. package/dist/types-ts4.5/pm-plugins/analytics/commands.d.ts +2 -2
  92. package/dist/types-ts4.5/pm-plugins/analytics/plugin-factory.d.ts +1 -1
  93. package/dist/types-ts4.5/pm-plugins/analytics/utils/moved-event.d.ts +1 -1
  94. package/dist/types-ts4.5/pm-plugins/commands/column-resize.d.ts +10 -10
  95. package/dist/types-ts4.5/pm-plugins/commands/commands-with-analytics.d.ts +1 -1
  96. package/dist/types-ts4.5/pm-plugins/commands/go-to-next-cell.d.ts +1 -1
  97. package/dist/types-ts4.5/pm-plugins/commands/misc.d.ts +2 -2
  98. package/dist/types-ts4.5/pm-plugins/commands/selection.d.ts +6 -6
  99. package/dist/types-ts4.5/pm-plugins/drag-and-drop/commands-with-analytics.d.ts +3 -3
  100. package/dist/types-ts4.5/pm-plugins/drag-and-drop/commands.d.ts +1 -1
  101. package/dist/types-ts4.5/pm-plugins/drag-and-drop/plugin-factory.d.ts +1 -1
  102. package/dist/types-ts4.5/pm-plugins/plugin-factory.d.ts +1 -1
  103. package/dist/types-ts4.5/pm-plugins/sticky-headers/plugin-state.d.ts +1 -1
  104. package/dist/types-ts4.5/pm-plugins/table-resizing/plugin-factory.d.ts +1 -1
  105. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/colgroup.d.ts +1 -0
  106. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/misc.d.ts +41 -0
  107. package/dist/types-ts4.5/pm-plugins/utils/create.d.ts +10 -10
  108. package/dist/types-ts4.5/pm-plugins/utils/decoration.d.ts +3 -3
  109. package/dist/types-ts4.5/pm-plugins/utils/dom.d.ts +2 -2
  110. package/dist/types-ts4.5/pm-plugins/utils/drag-menu.d.ts +3 -3
  111. package/dist/types-ts4.5/pm-plugins/utils/merged-cells.d.ts +3 -2
  112. package/dist/types-ts4.5/tablePluginType.d.ts +2 -0
  113. package/dist/types-ts4.5/ui/DragHandle/index.d.ts +4 -14
  114. package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +1 -7
  115. package/dist/types-ts4.5/ui/TableFloatingControls/CornerControls/DragCornerControls.d.ts +4 -14
  116. package/dist/types-ts4.5/ui/TableFloatingControls/RowControls/DragControls.d.ts +1 -1
  117. package/dist/types-ts4.5/ui/TableFloatingControls/index.d.ts +1 -7
  118. package/dist/types-ts4.5/ui/global-styles.d.ts +2 -8
  119. package/dist/types-ts4.5/ui/hooks/useInternalTablePluginStateSelector.d.ts +1 -1
  120. package/package.json +10 -11
  121. package/src/nodeviews/TableComponent.tsx +113 -23
  122. package/src/nodeviews/TableContainer.tsx +331 -2
  123. package/src/nodeviews/TableResizer.tsx +10 -5
  124. package/src/nodeviews/TableRow.ts +38 -1
  125. package/src/nodeviews/table-node-views.ts +1 -1
  126. package/src/nodeviews/table.tsx +23 -0
  127. package/src/nodeviews/toDOM.ts +75 -9
  128. package/src/nodeviews/types.ts +1 -0
  129. package/src/pm-plugins/main.ts +41 -18
  130. package/src/pm-plugins/table-resizing/utils/colgroup.ts +139 -6
  131. package/src/pm-plugins/table-resizing/utils/misc.ts +87 -0
  132. package/src/tablePlugin.tsx +21 -0
  133. package/src/tablePluginType.ts +2 -0
  134. package/src/ui/TableFloatingControls/NumberColumn/index.tsx +5 -14
  135. package/tsconfig.app.json +6 -0
  136. package/types/package.json +1 -1
  137. package/ui/common-styles/package.json +1 -1
@@ -10,6 +10,7 @@ import { findParentDomRefOfType, findParentNodeOfType } from '@atlaskit/editor-p
10
10
  import { TableMap } from '@atlaskit/editor-tables';
11
11
  import { findTable } from '@atlaskit/editor-tables/utils';
12
12
  import { fg } from '@atlaskit/platform-feature-flags';
13
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
13
14
  import { tableCellView, tableHeaderView, tableRowView, tableView } from '../nodeviews/table-node-views';
14
15
  import { pluginKey as decorationsPluginKey } from '../pm-plugins/decorations/plugin';
15
16
  import { TableCssClassName as ClassName } from '../types';
@@ -52,29 +53,63 @@ export var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch
52
53
  }
53
54
  return editorView.state;
54
55
  };
55
- var nodeViews = isSSR() && fg('platform_editor_table_fallback_to_dom_on_ssr') ? undefined : {
56
- table: tableView({
57
- portalProviderAPI: portalProviderAPI,
58
- eventDispatcher: eventDispatcher,
59
- getEditorContainerWidth: getEditorContainerWidth,
60
- getEditorFeatureFlags: getEditorFeatureFlags,
61
- dispatchAnalyticsEvent: dispatchAnalyticsEvent,
62
- pluginInjectionApi: pluginInjectionApi,
63
- isCommentEditor: isCommentEditor,
64
- isChromelessEditor: isChromelessEditor
65
- }),
66
- tableRow: tableRowView({
67
- eventDispatcher: eventDispatcher
68
- }),
69
- tableCell: tableCellView({
70
- eventDispatcher: eventDispatcher,
71
- pluginInjectionApi: pluginInjectionApi
72
- }),
73
- tableHeader: tableHeaderView({
74
- eventDispatcher: eventDispatcher,
75
- pluginInjectionApi: pluginInjectionApi
76
- })
56
+ var getNodeView = function getNodeView() {
57
+ // Because the layout shift issues has been fixed under experiment platform_editor_tables_scaling_css, so still want to load nodeview on SSR if experiment is enabled
58
+ if (expValEquals('platform_editor_tables_scaling_css', 'isEnabled', true)) {
59
+ return {
60
+ table: tableView({
61
+ portalProviderAPI: portalProviderAPI,
62
+ eventDispatcher: eventDispatcher,
63
+ getEditorContainerWidth: getEditorContainerWidth,
64
+ getEditorFeatureFlags: getEditorFeatureFlags,
65
+ dispatchAnalyticsEvent: dispatchAnalyticsEvent,
66
+ pluginInjectionApi: pluginInjectionApi,
67
+ isCommentEditor: isCommentEditor,
68
+ isChromelessEditor: isChromelessEditor
69
+ }),
70
+ tableRow: tableRowView({
71
+ eventDispatcher: eventDispatcher,
72
+ pluginInjectionApi: pluginInjectionApi
73
+ }),
74
+ tableCell: tableCellView({
75
+ eventDispatcher: eventDispatcher,
76
+ pluginInjectionApi: pluginInjectionApi
77
+ }),
78
+ tableHeader: tableHeaderView({
79
+ eventDispatcher: eventDispatcher,
80
+ pluginInjectionApi: pluginInjectionApi
81
+ })
82
+ };
83
+ }
84
+ if (isSSR() && fg('platform_editor_table_fallback_to_dom_on_ssr')) {
85
+ return undefined;
86
+ }
87
+ return {
88
+ table: tableView({
89
+ portalProviderAPI: portalProviderAPI,
90
+ eventDispatcher: eventDispatcher,
91
+ getEditorContainerWidth: getEditorContainerWidth,
92
+ getEditorFeatureFlags: getEditorFeatureFlags,
93
+ dispatchAnalyticsEvent: dispatchAnalyticsEvent,
94
+ pluginInjectionApi: pluginInjectionApi,
95
+ isCommentEditor: isCommentEditor,
96
+ isChromelessEditor: isChromelessEditor
97
+ }),
98
+ tableRow: tableRowView({
99
+ eventDispatcher: eventDispatcher,
100
+ pluginInjectionApi: pluginInjectionApi
101
+ }),
102
+ tableCell: tableCellView({
103
+ eventDispatcher: eventDispatcher,
104
+ pluginInjectionApi: pluginInjectionApi
105
+ }),
106
+ tableHeader: tableHeaderView({
107
+ eventDispatcher: eventDispatcher,
108
+ pluginInjectionApi: pluginInjectionApi
109
+ })
110
+ };
77
111
  };
112
+ var nodeViews = getNodeView();
78
113
  return new SafePlugin({
79
114
  state: state,
80
115
  key: pluginKey,
@@ -1,10 +1,11 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
2
  import { tableCellMinWidth } from '@atlaskit/editor-common/styles';
3
- import { getFragmentBackingArray } from '@atlaskit/editor-common/utils';
3
+ import { calcTableColumnWidths, getFragmentBackingArray } from '@atlaskit/editor-common/utils';
4
4
  import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
5
+ import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
5
6
  import { TableMap } from '@atlaskit/editor-tables/table-map';
6
- import { COLUMN_MIN_WIDTH } from './consts';
7
- import { getScalingPercentForTableWithoutWidth, getTableScalingPercent } from './misc';
7
+ import { COLUMN_MIN_WIDTH, MAX_SCALING_PERCENT, MAX_SCALING_PERCENT_TABLES_WITH_FIXED_COLUMN_WIDTHS_OPTION } from './consts';
8
+ import { getScalingPercentForTableWithoutWidth, getTableContainerElementWidth, getTableScalingPercent } from './misc';
8
9
  /**
9
10
  * This ensures the combined width of the columns (and tbody) of table is always smaller or equal
10
11
  * than the table and table wrapper elements. This is necessary as there is no longer
@@ -14,6 +15,75 @@ import { getScalingPercentForTableWithoutWidth, getTableScalingPercent } from '.
14
15
  export var getColWidthFix = function getColWidthFix(colwidth, tableColumnCount) {
15
16
  return colwidth - 1 / tableColumnCount;
16
17
  };
18
+ var generateColStyle = function generateColStyle(fixedColWidth, tableWidth, isCommentEditor, isChromelessEditor, isNested, shouldUseIncreasedScalingPercent, isNumberColumnEnabled, isTableHasWidth, hasTableBeenResized) {
19
+ var maxScalingPercent = shouldUseIncreasedScalingPercent ? MAX_SCALING_PERCENT_TABLES_WITH_FIXED_COLUMN_WIDTHS_OPTION : MAX_SCALING_PERCENT;
20
+ var maxScaledRatio = 1 - maxScalingPercent;
21
+ var isFullPageEditor = !isChromelessEditor && !isCommentEditor;
22
+
23
+ // for nested tables, or chromeless editor, which used non resizable table container
24
+ if (isNested || isChromelessEditor) {
25
+ if (hasTableBeenResized) {
26
+ return "width: max(".concat(fixedColWidth, "px, ").concat(tableCellMinWidth, "px)");
27
+ }
28
+ return "width: ".concat(tableCellMinWidth, "px)");
29
+ }
30
+ if (isFullPageEditor || !isFullPageEditor && isTableHasWidth) {
31
+ var scaledPercent = isNumberColumnEnabled ? "calc(calc(var(--ak-editor-table-width) - ".concat(akEditorTableNumberColumnWidth, "px - 1px)/").concat(tableWidth, ")") : "calc(calc(var(--ak-editor-table-width) - 1px)/".concat(tableWidth, ")");
32
+ return "width: max(calc(".concat(fixedColWidth, "px * ").concat(maxScaledRatio, "), calc(").concat(fixedColWidth, " * ").concat(scaledPercent, "), ").concat(tableCellMinWidth, "px)");
33
+ }
34
+ // table resized to full-width in comment editor
35
+ // it doesn't have a width attribute, and cols has been resized
36
+ if (hasTableBeenResized) {
37
+ var _scaledPercent = isNumberColumnEnabled ? "calc(calc(var(--ak-editor-table-width) - ".concat(akEditorTableNumberColumnWidth, "px - 1px)/").concat(tableWidth, ")") : "calc(calc(var(--ak-editor-table-width) - 1px)/".concat(tableWidth, ")");
38
+ return "width: max(calc(".concat(fixedColWidth, " * ").concat(_scaledPercent, "), ").concat(tableCellMinWidth, "px)");
39
+ }
40
+ return "width: ".concat(tableCellMinWidth, "px");
41
+ };
42
+ export var generateColgroupFromNode = function generateColgroupFromNode(table, isCommentEditor, isChromelessEditor, isNested, isTableScalingEnabled, shouldUseIncreasedScalingPercent) {
43
+ var cols = [];
44
+ var map = TableMap.get(table);
45
+ var isTableHasWidth = !!table.attrs.width;
46
+ var isNumberColumnEnabled = table.attrs.isNumberColumnEnabled || false;
47
+ var isFullPageEditor = !isChromelessEditor && !isCommentEditor;
48
+
49
+ // Ignored via go/ees005
50
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
51
+ table.content.firstChild.content.forEach(function (cell) {
52
+ var colspan = cell.attrs.colspan || 1;
53
+ // if the table has been resized
54
+ if (Array.isArray(cell.attrs.colwidth)) {
55
+ cell.attrs.colwidth.slice(0, colspan).forEach(function (width) {
56
+ // existing logic for calculating the width of the column
57
+ var fixedColWidth = getColWidthFix(width, map.width);
58
+ var tableWidth = isFullPageEditor || !isFullPageEditor && isTableHasWidth ? getTableContainerElementWidth(table) : calcTableColumnWidths(table).reduce(function (sum, width) {
59
+ return sum + width;
60
+ }, 0);
61
+ if (isTableScalingEnabled) {
62
+ cols.push(['col', {
63
+ style: generateColStyle(fixedColWidth, tableWidth, isCommentEditor, isChromelessEditor, isNested, shouldUseIncreasedScalingPercent, isNumberColumnEnabled, isTableHasWidth, true)
64
+ }]);
65
+ } else {
66
+ cols.push(['col', {
67
+ style: "width: max(".concat(fixedColWidth, "px, ").concat(tableCellMinWidth, "px)")
68
+ }]);
69
+ }
70
+ });
71
+ } else {
72
+ // columns has not been resized, so distribute the width evenly
73
+ cols.push.apply(cols, _toConsumableArray(Array.from({
74
+ length: colspan
75
+ }, function (_) {
76
+ var tableWidth = getTableContainerElementWidth(table);
77
+ var columnWidth = tableWidth / map.width || 0;
78
+ var fixedColWidth = getColWidthFix(columnWidth, map.width || 0);
79
+ return ['col', {
80
+ style: generateColStyle(fixedColWidth, tableWidth, isCommentEditor, isChromelessEditor, isNested, shouldUseIncreasedScalingPercent, isNumberColumnEnabled, isTableHasWidth)
81
+ }];
82
+ })));
83
+ }
84
+ });
85
+ return cols;
86
+ };
17
87
  export var generateColgroup = function generateColgroup(table, tableRef, shouldUseIncreasedScalingPercent, isCommentEditor) {
18
88
  var cols = [];
19
89
  var map = TableMap.get(table);
@@ -35,6 +105,7 @@ export var generateColgroup = function generateColgroup(table, tableRef, shouldU
35
105
  scalePercent = getTableScalingPercent(table, tableRef, shouldUseIncreasedScalingPercent);
36
106
  }
37
107
  cell.attrs.colwidth.slice(0, colspan).forEach(function (width) {
108
+ // existing logic for calculating the width of the column
38
109
  var fixedColWidth = getColWidthFix(width, map.width);
39
110
  var scaledWidth = fixedColWidth * scalePercent;
40
111
  var finalWidth = Math.max(scaledWidth, tableCellMinWidth);
@@ -4,7 +4,7 @@ import { calcTableColumnWidths } from '@atlaskit/editor-common/utils';
4
4
  import { akEditorFullWidthLayoutWidth, akEditorGutterPaddingDynamic, akEditorTableNumberColumnWidth, akEditorGutterPaddingReduced, akEditorFullPageNarrowBreakout } from '@atlaskit/editor-shared-styles';
5
5
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
6
6
  import { hasTableBeenResized, hasTableColumnBeenResized } from './colgroup';
7
- import { MAX_SCALING_PERCENT, MAX_SCALING_PERCENT_TABLES_WITH_FIXED_COLUMN_WIDTHS_OPTION } from './consts';
7
+ import { MAX_SCALING_PERCENT, MAX_SCALING_PERCENT_TABLES_WITH_FIXED_COLUMN_WIDTHS_OPTION, TABLE_MAX_WIDTH } from './consts';
8
8
 
9
9
  // Translates named layouts in number values.
10
10
  export function getLayoutSize(tableLayout) {
@@ -85,6 +85,75 @@ export var getTableElementWidth = function getTableElementWidth(table) {
85
85
  export var getTableContainerElementWidth = function getTableContainerElementWidth(table) {
86
86
  return getTableContainerWidth(table);
87
87
  };
88
+
89
+ // eslint-disable-next-line jsdoc/require-example
90
+ /**
91
+ * This function is used to set the max width for table resizer container.
92
+ * @param isCommentEditor Whether the editor is in comment mode.
93
+ * @param isChromelessEditor Whether the editor is chromeless.
94
+ * @param isTableScalingEnabled Whether table scaling is enabled.
95
+ * @returns The CSS max-width value
96
+ */
97
+ export var getTableResizerContainerMaxWidthInCSS = function getTableResizerContainerMaxWidthInCSS(isCommentEditor, isChromelessEditor, isTableScalingEnabled) {
98
+ var maxResizerWidthForNonCommentEditor = isTableScalingEnabled ? "min(calc(100cqw - calc(var(--ak-editor--large-gutter-padding) * 2)), ".concat(TABLE_MAX_WIDTH, "px)") : "min(calc(100cqw - calc(var(--ak-editor--large-gutter-padding) * 2) - var(--ak-editor--resizer-handle-spacing)), ".concat(TABLE_MAX_WIDTH, "px)");
99
+ return isCommentEditor || isChromelessEditor ? '100%' : maxResizerWidthForNonCommentEditor;
100
+ };
101
+
102
+ // eslint-disable-next-line jsdoc/require-example
103
+ /**
104
+ * This function is used in NodeView for TableResizer to set the max width for table resizer container
105
+ * @param node The ProseMirror node representing the table.
106
+ * @param isCommentEditor Whether the editor is in comment mode.
107
+ * @param isChromelessEditor Whether the editor is chromeless.
108
+ * @returns The CSS max-width value for the table resizer container.
109
+ */
110
+ export var getTableResizerItemWidth = function getTableResizerItemWidth(node, isCommentEditor, isChromelessEditor) {
111
+ var tableWidthAttribute = getTableContainerWidth(node);
112
+ if (!node.attrs.width && (isCommentEditor || isChromelessEditor)) {
113
+ // width undefined would make .resizer-item width to be `auto`
114
+ return undefined;
115
+ }
116
+ return tableWidthAttribute;
117
+ };
118
+
119
+ // eslint-disable-next-line jsdoc/require-example
120
+ /**
121
+ * This function is used to set the CSS width value for the table resizer-item.
122
+ * Because comment and chromeless editors don't have container-type: inline-size set,
123
+ * we need to calculate the width based on the table node width.
124
+ * If the table node width is not set, it will return 'auto'.
125
+ * This is used in table toDOM
126
+ * @param node The ProseMirror node representing the table.
127
+ * @param isCommentEditor Whether the editor is in comment mode.
128
+ * @param isChromelessEditor Whether the editor is chromeless.
129
+ * @returns The CSS width value for the table container.
130
+ */
131
+ export var getTableResizerItemWidthInCSS = function getTableResizerItemWidthInCSS(node, isCommentEditor, isChromelessEditor) {
132
+ var tableWidthAttribute = getTableResizerItemWidth(node, isCommentEditor, isChromelessEditor);
133
+ return tableWidthAttribute ? "".concat(tableWidthAttribute, "px") : 'auto';
134
+ };
135
+
136
+ // eslint-disable-next-line jsdoc/require-example
137
+ /**
138
+ * This function is used to set the table width --ak-editor-table-width CSS property for full page editor.
139
+ * Which is applied to the table resizer container.
140
+ * For Full page appearance, we don't need to use containerWidth from JS, as we can use cqw value.
141
+ * So we set dynamic containerWidth from JS to CSS property.
142
+ * @param node The ProseMirror node representing the table.
143
+ * @param isCommentEditor Whether the editor is in comment mode.
144
+ * @param isChromelessEditor Whether the editor is chromeless.
145
+ * @param isTableScalingEnabled Whether table scaling is enabled.
146
+ * @param tableWidthFromJS The width of the container element. In toDOM it'd be undefined, but will have a value from nodeView.
147
+ * @returns The CSS width value for the table.
148
+ */
149
+ export var getTableResizerContainerForFullPageWidthInCSS = function getTableResizerContainerForFullPageWidthInCSS(node, isTableScalingEnabled) {
150
+ var tableWidth = getTableContainerElementWidth(node);
151
+ // for full page appearance
152
+ if (isTableScalingEnabled) {
153
+ return "min(calc(100cqw - calc(var(--ak-editor--large-gutter-padding) * 2)), ".concat(tableWidth, "px)");
154
+ }
155
+ return "min(calc(100cqw - calc(var(--ak-editor--large-gutter-padding) * 2) - var(--ak-editor--resizer-handle-spacing)), ".concat(tableWidth, "px)");
156
+ };
88
157
  export var getTableScalingPercent = function getTableScalingPercent(table, tableRef, shouldUseIncreasedScalingPercent) {
89
158
  var _tableRef$parentEleme;
90
159
  var maxScalingPercent = shouldUseIncreasedScalingPercent ? MAX_SCALING_PERCENT_TABLES_WITH_FIXED_COLUMN_WIDTHS_OPTION : MAX_SCALING_PERCENT;
@@ -232,18 +232,28 @@ var tablePlugin = function tablePlugin(_ref) {
232
232
  } : insertTableWithSize(options === null || options === void 0 ? void 0 : options.fullWidthEnabled, options === null || options === void 0 ? void 0 : options.isTableScalingEnabled, options === null || options === void 0 ? void 0 : options.tableOptions.allowTableAlignment, api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions, options === null || options === void 0 ? void 0 : options.isCommentEditor)
233
233
  },
234
234
  nodes: function nodes() {
235
- var _options$tableOptions2;
235
+ var _options$tableOptions2, _options$getEditorFea3;
236
236
  var _pluginConfig = pluginConfig(options === null || options === void 0 ? void 0 : options.tableOptions),
237
237
  allowColumnResizing = _pluginConfig.allowColumnResizing;
238
238
  // TODO: ED-25901 - We need to move this into a plugin config option so we don't accidentally enable nested nodes in Jira
239
239
  var isNestingSupported = Boolean(options === null || options === void 0 || (_options$tableOptions2 = options.tableOptions) === null || _options$tableOptions2 === void 0 ? void 0 : _options$tableOptions2.allowNestedTables);
240
+ var isTableFixedColumnWidthsOptionEnabled = (options === null || options === void 0 || (_options$getEditorFea3 = options.getEditorFeatureFlags) === null || _options$getEditorFea3 === void 0 ? void 0 : _options$getEditorFea3.call(options).tableWithFixedColumnWidthsOption) || false;
241
+ var shouldUseIncreasedScalingPercent = (options === null || options === void 0 ? void 0 : options.isTableScalingEnabled) && (isTableFixedColumnWidthsOptionEnabled || ( // When in comment editor, we need the scaling percent to be 40% while tableWithFixedColumnWidthsOption is not visible
242
+ options === null || options === void 0 ? void 0 : options.isCommentEditor));
243
+ var isTableScalingEnabled = options === null || options === void 0 ? void 0 : options.isTableScalingEnabled;
244
+ var isCommentEditor = options === null || options === void 0 ? void 0 : options.isCommentEditor;
245
+ var isChromelessEditor = options === null || options === void 0 ? void 0 : options.isChromelessEditor;
240
246
  return isNestingSupported ? [{
241
247
  name: 'table',
242
248
  node: tableNodeSpecWithFixedToDOM({
243
249
  allowColumnResizing: Boolean(allowColumnResizing),
244
250
  tableResizingEnabled: Boolean(options === null || options === void 0 ? void 0 : options.tableOptions.allowTableResizing),
245
251
  getEditorContainerWidth: defaultGetEditorContainerWidth,
246
- isNestingSupported: isNestingSupported
252
+ isNestingSupported: isNestingSupported,
253
+ isTableScalingEnabled: isTableScalingEnabled,
254
+ shouldUseIncreasedScalingPercent: shouldUseIncreasedScalingPercent,
255
+ isCommentEditor: isCommentEditor,
256
+ isChromelessEditor: isChromelessEditor
247
257
  })
248
258
  }, {
249
259
  name: 'tableHeader',
@@ -260,7 +270,11 @@ var tablePlugin = function tablePlugin(_ref) {
260
270
  allowColumnResizing: Boolean(allowColumnResizing),
261
271
  tableResizingEnabled: Boolean(options === null || options === void 0 ? void 0 : options.tableOptions.allowTableResizing),
262
272
  getEditorContainerWidth: defaultGetEditorContainerWidth,
263
- isNestingSupported: isNestingSupported
273
+ isNestingSupported: isNestingSupported,
274
+ isTableScalingEnabled: isTableScalingEnabled,
275
+ shouldUseIncreasedScalingPercent: shouldUseIncreasedScalingPercent,
276
+ isCommentEditor: isCommentEditor,
277
+ isChromelessEditor: isChromelessEditor
264
278
  })
265
279
  }, {
266
280
  name: 'tableHeader',
@@ -10,7 +10,6 @@ import React, { Component } from 'react';
10
10
  import classnames from 'classnames';
11
11
  import { Selection } from '@atlaskit/editor-prosemirror/state';
12
12
  import { isRowSelected } from '@atlaskit/editor-tables/utils';
13
- import { fg } from '@atlaskit/platform-feature-flags';
14
13
  import { clearHoverSelection } from '../../../pm-plugins/commands';
15
14
  import { getRowHeights } from '../../../pm-plugins/utils/row-controls';
16
15
  import { TableCssClassName as ClassName } from '../../../types';
@@ -85,11 +84,7 @@ var NumberColumn = /*#__PURE__*/function (_Component) {
85
84
  isResizing = _this$props4.isResizing,
86
85
  tableActive = _this$props4.tableActive;
87
86
  var isActive = isRowSelected(index)(editorView.state.selection) || (hoveredRows || []).indexOf(index) !== -1 && !isResizing;
88
- if (fg('platform_editor_nested_tables_number_column_fixes')) {
89
- return classnames(ClassName.NUMBERED_COLUMN_BUTTON, _defineProperty(_defineProperty(_defineProperty({}, ClassName.NUMBERED_COLUMN_BUTTON_DISABLED, isButtonDisabled), ClassName.HOVERED_CELL_IN_DANGER, tableActive && isActive && isInDanger), ClassName.HOVERED_CELL_ACTIVE, tableActive && isActive));
90
- } else {
91
- return classnames(ClassName.NUMBERED_COLUMN_BUTTON, _defineProperty(_defineProperty(_defineProperty({}, ClassName.NUMBERED_COLUMN_BUTTON_DISABLED, isButtonDisabled), ClassName.HOVERED_CELL_IN_DANGER, isActive && isInDanger), ClassName.HOVERED_CELL_ACTIVE, isActive));
92
- }
87
+ return classnames(ClassName.NUMBERED_COLUMN_BUTTON, _defineProperty(_defineProperty(_defineProperty({}, ClassName.NUMBERED_COLUMN_BUTTON_DISABLED, isButtonDisabled), ClassName.HOVERED_CELL_IN_DANGER, tableActive && isActive && isInDanger), ClassName.HOVERED_CELL_ACTIVE, tableActive && isActive));
93
88
  });
94
89
  return _this;
95
90
  }
@@ -3,7 +3,7 @@ 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, }: {
5
5
  editorView: EditorView;
6
- node?: PMNode | undefined;
6
+ node?: PMNode;
7
7
  getScrollOffset: () => number;
8
8
  getTableWrapperWidth: () => number;
9
9
  }) => React.JSX.Element | null;
@@ -39,6 +39,7 @@ interface ComponentProps {
39
39
  isTableHovered?: boolean;
40
40
  isWholeTableInDanger?: boolean;
41
41
  selection?: Selection;
42
+ limitedMode?: boolean;
42
43
  }
43
44
  declare const _default: React.FC<import("react-intl-next").WithIntlProps<ComponentProps>> & {
44
45
  WrappedComponent: React.ComponentType<ComponentProps>;
@@ -13,6 +13,7 @@ type ResizableTableContainerProps = {
13
13
  getPos: () => number | undefined;
14
14
  tableRef: HTMLTableElement;
15
15
  isResizing?: boolean;
16
+ isWindowResized?: boolean;
16
17
  pluginInjectionApi?: PluginInjectionAPI;
17
18
  tableWrapperHeight?: number;
18
19
  isWholeTableInDanger?: boolean;
@@ -21,8 +22,11 @@ type ResizableTableContainerProps = {
21
22
  isTableAlignmentEnabled?: boolean;
22
23
  shouldUseIncreasedScalingPercent?: boolean;
23
24
  isCommentEditor?: boolean;
25
+ isChromelessEditor?: boolean;
24
26
  };
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>;
27
+ export declare const ResizableTableContainer: React.FC<ResizableTableContainerProps & {
28
+ children?: React.ReactNode | undefined;
29
+ }>;
26
30
  type TableContainerProps = {
27
31
  node: PMNode;
28
32
  className: string;
@@ -32,6 +36,7 @@ type TableContainerProps = {
32
36
  tableRef: HTMLTableElement;
33
37
  isNested: boolean;
34
38
  isResizing?: boolean;
39
+ isWindowResized?: boolean;
35
40
  pluginInjectionApi?: PluginInjectionAPI;
36
41
  tableWrapperHeight?: number;
37
42
  isWholeTableInDanger?: boolean;
@@ -43,5 +48,5 @@ type TableContainerProps = {
43
48
  isCommentEditor?: boolean;
44
49
  isChromelessEditor?: boolean;
45
50
  };
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;
51
+ export declare const TableContainer: ({ children, node, className, containerWidth: { width: editorWidth, lineLength }, editorView, getPos, tableRef, isNested, tableWrapperHeight, isResizing, isWindowResized, pluginInjectionApi, isWholeTableInDanger, isTableResizingEnabled, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor, }: PropsWithChildren<TableContainerProps>) => React.JSX.Element;
47
52
  export {};
@@ -8,7 +8,7 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
8
8
  import type { PluginInjectionAPI } from '../types';
9
9
  interface TableResizerProps {
10
10
  width: number;
11
- maxWidth: number;
11
+ maxWidth: number | string;
12
12
  containerWidth: number;
13
13
  lineLength: number;
14
14
  updateWidth: (width: number) => void;
@@ -1,10 +1,12 @@
1
1
  import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
2
2
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
3
3
  import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
4
+ import { type PluginInjectionAPI } from '../types';
4
5
  import TableNodeView from './TableNodeViewBase';
5
6
  export default class TableRow extends TableNodeView<HTMLTableRowElement> implements NodeView {
6
7
  private nodeVisibilityObserverCleanupFn?;
7
- constructor(node: PMNode, view: EditorView, getPos: () => number | undefined, eventDispatcher: EventDispatcher);
8
+ cleanup: () => void;
9
+ constructor(node: PMNode, view: EditorView, getPos: () => number | undefined, eventDispatcher: EventDispatcher, api?: PluginInjectionAPI);
8
10
  subscribeWhenRowVisible(): void;
9
11
  /**
10
12
  * Variables
@@ -20,7 +20,7 @@ export default class TableView extends ReactNodeView<Props> {
20
20
  constructor(props: Props);
21
21
  getContentDOM(): {
22
22
  dom: HTMLElement;
23
- contentDOM?: HTMLElement | undefined;
23
+ contentDOM?: HTMLElement;
24
24
  };
25
25
  /**
26
26
  * Handles moving the table from ProseMirror's DOM structure into a React-rendered table node.
@@ -5,6 +5,11 @@ type Config = {
5
5
  tableResizingEnabled: boolean;
6
6
  getEditorContainerWidth: GetEditorContainerWidth;
7
7
  isNestingSupported?: boolean;
8
+ isTableScalingEnabled?: boolean;
9
+ shouldUseIncreasedScalingPercent?: boolean;
10
+ isCommentEditor?: boolean;
11
+ isChromelessEditor?: boolean;
12
+ isNested?: boolean;
8
13
  };
9
14
  export declare const tableNodeSpecWithFixedToDOM: (config: Config) => NodeSpec & {
10
15
  toDOM: (node: PMNode) => DOMOutputSpec;
@@ -12,6 +12,7 @@ export type TableOptions = {
12
12
  isTableScalingEnabled?: boolean;
13
13
  isCommentEditor?: boolean;
14
14
  isChromelessEditor?: boolean;
15
+ shouldUseIncreasedScalingPercent?: boolean;
15
16
  };
16
17
  export interface Props {
17
18
  node: PmNode;
@@ -1,5 +1,5 @@
1
1
  import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
2
2
  import type { ActionType, RowOrColumnMovedState } from './types';
3
- export declare const updateRowOrColumnMoved: (nextState: Omit<RowOrColumnMovedState, 'currentActions'>, nextAction: ActionType) => import("@atlaskit/editor-common/types").Command;
3
+ export declare const updateRowOrColumnMoved: (nextState: Omit<RowOrColumnMovedState, "currentActions">, nextAction: ActionType) => import("@atlaskit/editor-common/types").Command;
4
4
  export declare const resetRowOrColumnMovedTransform: () => (tr: Transaction) => Transaction;
5
- export declare const updateRowOrColumnMovedTransform: (nextState: Omit<RowOrColumnMovedState, 'currentActions'>, nextAction: ActionType) => (state: EditorState, tr: Transaction) => Transaction;
5
+ export declare const updateRowOrColumnMovedTransform: (nextState: Omit<RowOrColumnMovedState, "currentActions">, nextAction: ActionType) => (state: EditorState, tr: Transaction) => Transaction;
@@ -1 +1 @@
1
- export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch, initialState: import("./types").AnalyticPluginState | ((state: import("prosemirror-state").EditorState) => import("./types").AnalyticPluginState)) => import("prosemirror-state").SafeStateField<import("./types").AnalyticPluginState>, createCommand: <A = import("./actions").AnalyticPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("./types").AnalyticPluginState;
1
+ export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch, initialState: import("./types").AnalyticPluginState | ((state: import("prosemirror-state").EditorState) => import("./types").AnalyticPluginState)) => import("prosemirror-state").SafeStateField<import("./types").AnalyticPluginState>, createCommand: <A = import("./actions").AnalyticPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: (tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("./types").AnalyticPluginState;
@@ -1,5 +1,5 @@
1
1
  import type { ActionType, RowOrColumnMovedState } from '../types';
2
- export declare const getMovedPayload: (nextState: Omit<RowOrColumnMovedState, 'currentActions'>, nextAction: ActionType, prevState: RowOrColumnMovedState) => RowOrColumnMovedState | {
2
+ export declare const getMovedPayload: (nextState: Omit<RowOrColumnMovedState, "currentActions">, nextAction: ActionType, prevState: RowOrColumnMovedState) => RowOrColumnMovedState | {
3
3
  currentActions: string[];
4
4
  numberOfCells: number | undefined;
5
5
  type: "row" | "column" | undefined;
@@ -6,14 +6,14 @@ import type { Transaction } from '@atlaskit/editor-prosemirror/state';
6
6
  import type { Direction } from '@atlaskit/editor-tables/types';
7
7
  import type { PluginInjectionAPI } from '../../types';
8
8
  export declare const initiateKeyboardColumnResizing: ({ ariaNotify, getIntl, nodeViewPortalProviderAPI, }: {
9
- ariaNotify?: ((message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void) | undefined;
10
- getIntl?: (() => IntlShape) | undefined;
9
+ ariaNotify?: (message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void;
10
+ getIntl?: () => IntlShape;
11
11
  nodeViewPortalProviderAPI: PortalProviderAPI;
12
12
  }) => Command;
13
13
  export declare const activateNextResizeArea: ({ direction, ariaNotify, getIntl, nodeViewPortalProviderAPI, }: {
14
14
  direction: Direction;
15
- ariaNotify?: ((message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void) | undefined;
16
- getIntl?: (() => IntlShape) | undefined;
15
+ ariaNotify?: (message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void;
16
+ getIntl?: () => IntlShape;
17
17
  nodeViewPortalProviderAPI: PortalProviderAPI;
18
18
  }) => Command;
19
19
  export declare const changeColumnWidthByStep: ({ stepSize, getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, isCommentEditor, ariaNotify, api, getIntl, }: {
@@ -23,12 +23,12 @@ export declare const changeColumnWidthByStep: ({ stepSize, getEditorContainerWid
23
23
  isTableFixedColumnWidthsOptionEnabled: boolean;
24
24
  isCommentEditor: boolean;
25
25
  api: PluginInjectionAPI | undefined | null;
26
- ariaNotify?: ((message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void) | undefined;
27
- getIntl?: (() => IntlShape) | undefined;
28
- originalTr?: Transaction | undefined;
26
+ ariaNotify?: (message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void;
27
+ getIntl?: () => IntlShape;
28
+ originalTr?: Transaction;
29
29
  }) => Command;
30
30
  export declare const stopKeyboardColumnResizing: ({ ariaNotify, getIntl, originalTr, }: {
31
- ariaNotify?: ((message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void) | undefined;
32
- getIntl?: (() => IntlShape) | undefined;
33
- originalTr?: Transaction | undefined;
31
+ ariaNotify?: (message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void;
32
+ getIntl?: () => IntlShape;
33
+ originalTr?: Transaction;
34
34
  }) => Command;
@@ -15,7 +15,7 @@ export declare const splitCellWithAnalytics: (editorAnalyticsAPI: EditorAnalytic
15
15
  export declare const setColorWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, cellColor: string, editorView?: EditorView | null) => Command;
16
16
  export declare const addRowAroundSelection: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (side: RowInsertPosition) => Command;
17
17
  export declare const insertRowWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: InsertRowMethods, options: InsertRowOptions) => Command;
18
- export declare const changeColumnWidthByStepWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, api: PluginInjectionAPI | undefined | null) => (stepSize: number, getEditorContainerWidth: GetEditorContainerWidth, isTableScalingEnabled: boolean, isTableFixedColumnWidthsOptionEnabled: boolean, isCommentEditor: boolean, inputMethod: INPUT_METHOD.SHORTCUT, ariaNotify?: ((message: string) => void) | undefined, getIntl?: () => IntlShape) => Command;
18
+ export declare const changeColumnWidthByStepWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, api: PluginInjectionAPI | undefined | null) => (stepSize: number, getEditorContainerWidth: GetEditorContainerWidth, isTableScalingEnabled: boolean, isTableFixedColumnWidthsOptionEnabled: boolean, isCommentEditor: boolean, inputMethod: INPUT_METHOD.SHORTCUT, ariaNotify?: (message: string) => void, getIntl?: () => IntlShape) => Command;
19
19
  export declare const insertColumnWithAnalytics: (api: PluginInjectionAPI | undefined | null, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.SHORTCUT | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, position: number) => Command;
20
20
  export declare const deleteRowsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.SHORTCUT | INPUT_METHOD.TABLE_CONTEXT_MENU, rect: Rect, isHeaderRowRequired: boolean) => Command;
21
21
  export declare const deleteColumnsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, api: PluginInjectionAPI | undefined | null, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.SHORTCUT | INPUT_METHOD.TABLE_CONTEXT_MENU, rect: Rect) => Command;
@@ -2,7 +2,7 @@ import type { IntlShape } from 'react-intl-next/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';
5
- export declare const goToNextCell: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, ariaNotify?: ((message: string) => void) | undefined, getIntl?: () => IntlShape) => (direction: Direction) => Command;
5
+ export declare const goToNextCell: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, ariaNotify?: (message: string) => void, getIntl?: () => IntlShape) => (direction: Direction) => Command;
6
6
  /**
7
7
  * Moves the cursor vertically from a NodeSelection within a table cell.
8
8
  * - If content exists above/below within the cell, lets ProseMirror handle it.
@@ -13,10 +13,10 @@ export declare const triggerUnlessTableHeader: (command: Command) => Command;
13
13
  export declare const transformSliceRemoveCellBackgroundColor: (slice: Slice, schema: Schema) => Slice;
14
14
  export declare const transformSliceToAddTableHeaders: (slice: Slice, schema: Schema) => Slice;
15
15
  export declare const transformSliceToRemoveColumnsWidths: (slice: Slice, schema: Schema) => Slice;
16
- export declare const countCellsInSlice: (slice: Slice, schema: Schema, type?: 'row' | 'column') => number;
16
+ export declare const countCellsInSlice: (slice: Slice, schema: Schema, type?: "row" | "column") => number;
17
17
  export declare const getTableSelectionType: (selection: Selection) => "row" | "column" | undefined;
18
18
  export declare const getTableElementMoveTypeBySlice: (slice: Slice, state: EditorState) => "row" | "column" | undefined;
19
- export declare const isInsideFirstCellOfRowOrColumn: (selection: Selection, type?: 'row' | 'column') => boolean;
19
+ export declare const isInsideFirstCellOfRowOrColumn: (selection: Selection, type?: "row" | "column") => boolean;
20
20
  export declare const deleteTable: Command;
21
21
  export declare const deleteTableIfSelected: Command;
22
22
  export declare const convertFirstRowToHeader: (schema: Schema) => (tr: Transaction) => Transaction;
@@ -2,9 +2,9 @@ import { type IntlShape } from 'react-intl-next/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';
5
- export declare const arrowLeftFromTable: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => () => Command;
6
- export declare const arrowRightFromTable: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => () => Command;
7
- export declare const selectColumns: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined, ariaNotify?: ((message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void) | undefined, getIntl?: () => IntlShape) => (triggeredByKeyboard?: boolean) => Command;
8
- export declare const selectRows: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined, ariaNotify?: ((message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void) | undefined, getIntl?: () => IntlShape) => (triggeredByKeyboard?: boolean) => Command;
9
- export declare const shiftArrowUpFromTable: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => () => Command;
10
- export declare const modASelectTable: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => () => Command;
5
+ export declare const arrowLeftFromTable: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>["selection"] | undefined) => () => Command;
6
+ export declare const arrowRightFromTable: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>["selection"] | undefined) => () => Command;
7
+ export declare const selectColumns: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>["selection"] | undefined, ariaNotify?: (message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void, getIntl?: () => IntlShape) => (triggeredByKeyboard?: boolean) => Command;
8
+ export declare const selectRows: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>["selection"] | undefined, ariaNotify?: (message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void, getIntl?: () => IntlShape) => (triggeredByKeyboard?: boolean) => Command;
9
+ export declare const shiftArrowUpFromTable: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>["selection"] | undefined) => () => Command;
10
+ export declare const modASelectTable: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>["selection"] | undefined) => () => Command;
@@ -6,6 +6,6 @@ import type { AriaLiveElementAttributes } from '@atlaskit/editor-plugin-accessib
6
6
  import type { Transaction } from '@atlaskit/editor-prosemirror/state';
7
7
  import type { DraggableData, DraggableType } from '../../types';
8
8
  export declare const clearDropTargetWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.TABLE_CONTEXT_MENU | INPUT_METHOD.DRAG_AND_DROP, sourceType: DraggableType, sourceIndexes: number[] | undefined, status: TABLE_STATUS.CANCELLED | TABLE_STATUS.INVALID, tr?: Transaction) => Command;
9
- export declare const moveSourceWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, ariaNotify?: ((message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void) | undefined, getIntl?: () => IntlShape) => (inputMethod: INPUT_METHOD.TABLE_CONTEXT_MENU | INPUT_METHOD.DRAG_AND_DROP | INPUT_METHOD.SHORTCUT, sourceType: DraggableType, sourceIndexes: number[], targetIndex: number, tr?: Transaction) => Command;
10
- export declare const moveSourceWithAnalyticsViaShortcut: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, ariaNotify?: ((message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void) | undefined, getIntl?: () => IntlShape) => (sourceType: DraggableType, direction: DraggableData['direction']) => Command;
11
- export declare const cloneSourceWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.TABLE_CONTEXT_MENU | INPUT_METHOD.DRAG_AND_DROP | INPUT_METHOD.SHORTCUT, sourceType: DraggableType, sourceIndexes: number[], targetIndex: number, targetDirection: 'start' | 'end', tr?: Transaction) => Command;
9
+ export declare const moveSourceWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, ariaNotify?: (message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void, getIntl?: () => IntlShape) => (inputMethod: INPUT_METHOD.TABLE_CONTEXT_MENU | INPUT_METHOD.DRAG_AND_DROP | INPUT_METHOD.SHORTCUT, sourceType: DraggableType, sourceIndexes: number[], targetIndex: number, tr?: Transaction) => Command;
10
+ export declare const moveSourceWithAnalyticsViaShortcut: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, ariaNotify?: (message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void, getIntl?: () => IntlShape) => (sourceType: DraggableType, direction: DraggableData["direction"]) => Command;
11
+ export declare const cloneSourceWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.TABLE_CONTEXT_MENU | INPUT_METHOD.DRAG_AND_DROP | INPUT_METHOD.SHORTCUT, sourceType: DraggableType, sourceIndexes: number[], targetIndex: number, targetDirection: "start" | "end", tr?: Transaction) => Command;
@@ -6,4 +6,4 @@ export declare const setDropTarget: (type: DropTargetType, index: number, hasMer
6
6
  export declare const clearDropTarget: (tr?: Transaction) => import("@atlaskit/editor-common/types").Command;
7
7
  export declare const moveSource: (sourceType: DraggableType, sourceIndexes: number[], targetIndex: number, tr?: Transaction) => import("@atlaskit/editor-common/types").Command;
8
8
  export declare const toggleDragMenu: (isDragMenuOpen: boolean | undefined, direction?: TableDirection, index?: number, trigger?: TriggerType) => import("@atlaskit/editor-common/types").Command;
9
- export declare const cloneSource: (sourceType: DraggableType, sourceIndexes: number[], targetIndex: number, targetDirection: 'start' | 'end', tr?: Transaction) => import("@atlaskit/editor-common/types").Command;
9
+ export declare const cloneSource: (sourceType: DraggableType, sourceIndexes: number[], targetIndex: number, targetDirection: "start" | "end", tr?: Transaction) => import("@atlaskit/editor-common/types").Command;
@@ -1 +1 @@
1
- export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch, initialState: import("./types").DragAndDropPluginState | ((state: import("prosemirror-state").EditorState) => import("./types").DragAndDropPluginState)) => import("prosemirror-state").SafeStateField<import("./types").DragAndDropPluginState>, createCommand: <A = import("./actions").DragAndDropPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("./types").DragAndDropPluginState;
1
+ export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch, initialState: import("./types").DragAndDropPluginState | ((state: import("prosemirror-state").EditorState) => import("./types").DragAndDropPluginState)) => import("prosemirror-state").SafeStateField<import("./types").DragAndDropPluginState>, createCommand: <A = import("./actions").DragAndDropPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: (tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("./types").DragAndDropPluginState;