@atlaskit/editor-plugin-table 5.4.0 → 5.4.2

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 (46) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/cjs/plugins/table/nodeviews/TableComponent.js +3 -2
  3. package/dist/cjs/plugins/table/types.js +2 -0
  4. package/dist/cjs/plugins/table/ui/DragHandle/index.js +25 -4
  5. package/dist/cjs/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.js +22 -2
  6. package/dist/cjs/plugins/table/ui/TableFloatingControls/RowControls/DragControls.js +6 -2
  7. package/dist/cjs/plugins/table/ui/common-styles.js +1 -1
  8. package/dist/cjs/plugins/table/ui/icons/DragHandleDisabledIcon.js +4 -8
  9. package/dist/cjs/plugins/table/ui/icons/MinimisedHandle.js +22 -0
  10. package/dist/cjs/plugins/table/ui/icons/index.js +7 -0
  11. package/dist/es2019/plugins/table/nodeviews/TableComponent.js +3 -2
  12. package/dist/es2019/plugins/table/types.js +2 -0
  13. package/dist/es2019/plugins/table/ui/DragHandle/index.js +25 -3
  14. package/dist/es2019/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.js +25 -3
  15. package/dist/es2019/plugins/table/ui/TableFloatingControls/RowControls/DragControls.js +6 -2
  16. package/dist/es2019/plugins/table/ui/common-styles.js +18 -4
  17. package/dist/es2019/plugins/table/ui/icons/DragHandleDisabledIcon.js +4 -8
  18. package/dist/es2019/plugins/table/ui/icons/MinimisedHandle.js +13 -0
  19. package/dist/es2019/plugins/table/ui/icons/index.js +1 -0
  20. package/dist/esm/plugins/table/nodeviews/TableComponent.js +3 -2
  21. package/dist/esm/plugins/table/types.js +2 -0
  22. package/dist/esm/plugins/table/ui/DragHandle/index.js +24 -3
  23. package/dist/esm/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.js +23 -3
  24. package/dist/esm/plugins/table/ui/TableFloatingControls/RowControls/DragControls.js +6 -2
  25. package/dist/esm/plugins/table/ui/common-styles.js +1 -1
  26. package/dist/esm/plugins/table/ui/icons/DragHandleDisabledIcon.js +4 -8
  27. package/dist/esm/plugins/table/ui/icons/MinimisedHandle.js +15 -0
  28. package/dist/esm/plugins/table/ui/icons/index.js +1 -0
  29. package/dist/types/plugins/table/types.d.ts +2 -0
  30. package/dist/types/plugins/table/ui/icons/MinimisedHandle.d.ts +2 -0
  31. package/dist/types/plugins/table/ui/icons/index.d.ts +1 -0
  32. package/dist/types-ts4.5/plugins/table/types.d.ts +2 -0
  33. package/dist/types-ts4.5/plugins/table/ui/icons/MinimisedHandle.d.ts +2 -0
  34. package/dist/types-ts4.5/plugins/table/ui/icons/index.d.ts +1 -0
  35. package/package.json +1 -1
  36. package/src/__tests__/unit/ui/RowDragControls.tsx +2 -2
  37. package/src/plugins/table/nodeviews/TableComponent.tsx +3 -2
  38. package/src/plugins/table/types.ts +3 -0
  39. package/src/plugins/table/ui/DragHandle/index.tsx +37 -3
  40. package/src/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.tsx +33 -2
  41. package/src/plugins/table/ui/TableFloatingControls/RowControls/DragControls.tsx +6 -1
  42. package/src/plugins/table/ui/common-styles.ts +18 -4
  43. package/src/plugins/table/ui/icons/DragHandleDisabledIcon.tsx +4 -32
  44. package/src/plugins/table/ui/icons/MinimisedHandle.tsx +14 -0
  45. package/src/plugins/table/ui/icons/index.ts +1 -0
  46. package/src/__tests__/integration/horizontal-scroll.ts +0 -491
@@ -8,6 +8,7 @@ import { getSelectionRect } from '@atlaskit/editor-tables/utils';
8
8
 
9
9
  import {
10
10
  clearHoverSelection,
11
+ hoverCell,
11
12
  hoverColumns,
12
13
  selectColumn,
13
14
  } from '../../../commands';
@@ -92,6 +93,29 @@ export const ColumnControls = ({
92
93
  hoverColumns([colIndex!])(state, dispatch);
93
94
  }, [colIndex, editorView]);
94
95
 
96
+ const handleMouseMove = useCallback(
97
+ (e: MouseEvent) => {
98
+ const isParentDragControls = (e.nativeEvent.target as Element).closest(
99
+ `.${ClassName.DRAG_COLUMN_CONTROLS}`,
100
+ );
101
+ const colIndex = (e.nativeEvent.target as Element).getAttribute(
102
+ 'data-start-index',
103
+ );
104
+
105
+ // avoid updating if event target is not related
106
+ if (!isParentDragControls || !colIndex) {
107
+ return;
108
+ }
109
+
110
+ // update hovered cell location
111
+ const { state, dispatch } = editorView;
112
+ if (tableActive && hoveredCell?.colIndex !== Number(colIndex)) {
113
+ hoverCell(hoveredCell?.rowIndex, Number(colIndex))(state, dispatch);
114
+ }
115
+ },
116
+ [editorView, hoveredCell?.colIndex, hoveredCell?.rowIndex, tableActive],
117
+ );
118
+
95
119
  const handleMouseOut = useCallback(() => {
96
120
  if (tableActive) {
97
121
  const { state, dispatch } = editorView;
@@ -104,8 +128,15 @@ export const ColumnControls = ({
104
128
  toggleDragMenu(undefined, 'column', colIndex)(state, dispatch);
105
129
  }, [editorView, colIndex]);
106
130
 
131
+ const colIndexes = useMemo(() => {
132
+ return [colIndex!];
133
+ }, [colIndex]);
134
+
107
135
  return (
108
- <div className={ClassName.DRAG_COLUMN_CONTROLS}>
136
+ <div
137
+ className={ClassName.DRAG_COLUMN_CONTROLS}
138
+ onMouseMove={handleMouseMove}
139
+ >
109
140
  <div
110
141
  className={ClassName.DRAG_COLUMN_CONTROLS_INNER}
111
142
  data-testid="table-floating-column-controls"
@@ -160,7 +191,7 @@ export const ColumnControls = ({
160
191
  <DragHandle
161
192
  direction="column"
162
193
  tableLocalId={localId || ''}
163
- indexes={[hoveredCell.colIndex!]}
194
+ indexes={colIndexes}
164
195
  previewWidth={hoveredCell.colWidth}
165
196
  previewHeight={hoveredCell.colHeight}
166
197
  appearance={
@@ -146,6 +146,10 @@ const DragControlsComponent = ({
146
146
  [updateCellHoverLocation],
147
147
  );
148
148
 
149
+ const rowIndexes = useMemo(() => {
150
+ return [rowIndex!];
151
+ }, [rowIndex]);
152
+
149
153
  const handleMouseOver = useCallback(() => {
150
154
  hoverRows([rowIndex!]);
151
155
  }, [hoverRows, rowIndex]);
@@ -167,6 +171,7 @@ const DragControlsComponent = ({
167
171
  : `${dropTargetExtendedWidth}px 24px`,
168
172
  }}
169
173
  onMouseMove={handleMouseMove}
174
+ contentEditable={false}
170
175
  >
171
176
  {!isResizing &&
172
177
  rowsParams.map(({ startIndex, endIndex }, index) => (
@@ -225,7 +230,7 @@ const DragControlsComponent = ({
225
230
  >
226
231
  <DragHandle
227
232
  tableLocalId={currentNodeLocalId}
228
- indexes={[rowIndex!]}
233
+ indexes={rowIndexes}
229
234
  previewWidth={tableWidth}
230
235
  previewHeight={rowHeights[rowIndex!]}
231
236
  appearance={
@@ -736,7 +736,7 @@ export const tableStyles = (
736
736
  display: grid;
737
737
  align-items: center;
738
738
  position: absolute;
739
- left: -${dropTargetExtendedWidth + 4}px;
739
+ left: -${dropTargetExtendedWidth}px;
740
740
  z-index: ${akEditorUnitZIndex};
741
741
 
742
742
  .${ClassName.DRAG_ROW_FLOATING_INSERT_DOT_WRAPPER} {
@@ -749,7 +749,7 @@ export const tableStyles = (
749
749
  .${ClassName.DRAG_ROW_FLOATING_INSERT_DOT} {
750
750
  position: absolute;
751
751
  bottom: -3px;
752
- left: 6px;
752
+ left: 2px;
753
753
  background-color: ${token(
754
754
  'color.background.accent.gray.subtler',
755
755
  '#C1C7D0',
@@ -800,13 +800,27 @@ export const tableStyles = (
800
800
  align-items: center;
801
801
  outline: none !important;
802
802
 
803
+ &.${ClassName.DRAG_HANDLE_DISABLED} {
804
+ & > svg {
805
+ & > rect.${ClassName.DRAG_HANDLE_MINIMISED} {
806
+ fill: ${token('color.background.accent.gray.subtler', '#DCDFE4')};
807
+ }
808
+ & > rect {
809
+ fill: ${token('color.background.accent.gray.subtlest', '#F4F5F7')};
810
+ }
811
+ & > g > rect {
812
+ fill: ${token('color.icon.disabled', '#BFDBF847')};
813
+ }
814
+ }
815
+ }
816
+
803
817
  &:not(.${ClassName.DRAG_HANDLE_DISABLED}) {
804
818
  & > svg {
805
819
  rect {
806
- fill: ${token('color.background.accent.gray.subtlest', '#F1F2F4')};
820
+ fill: ${token('color.background.accent.gray.subtler', '#DCDFE4')};
807
821
  }
808
822
  g {
809
- fill: ${token('color.icon.subtle', '#626F86')};
823
+ fill: ${token('color.icon.subtle', '#626f86')};
810
824
  }
811
825
  }
812
826
 
@@ -1,7 +1,5 @@
1
1
  import React from 'react';
2
2
 
3
- import { token } from '@atlaskit/tokens';
4
-
5
3
  interface DragHandleDisabledIconProps {
6
4
  style?: React.CSSProperties;
7
5
  }
@@ -17,37 +15,11 @@ export const DragHandleDisabledIcon = ({
17
15
  xmlns="http://www.w3.org/2000/svg"
18
16
  style={style}
19
17
  >
20
- <rect
21
- width="24"
22
- height="16"
23
- rx="4"
24
- fill={token('color.background.accent.gray.subtlest', 'Neutral200')}
25
- />
18
+ <rect width="24" height="16" rx="4" />
26
19
  <g>
27
- <rect
28
- x="7"
29
- y="4"
30
- width="2"
31
- height="8"
32
- rx="1"
33
- fill={token('color.icon.disabled', '#091E424F')}
34
- />
35
- <rect
36
- x="11"
37
- y="4"
38
- width="2"
39
- height="8"
40
- rx="1"
41
- fill={token('color.icon.disabled', '#091E424F')}
42
- />
43
- <rect
44
- x="15"
45
- y="4"
46
- width="2"
47
- height="8"
48
- rx="1"
49
- fill={token('color.icon.disabled', '#091E424F')}
50
- />
20
+ <rect x="7" y="4" width="2" height="8" rx="1" />
21
+ <rect x="11" y="4" width="2" height="8" rx="1" />
22
+ <rect x="15" y="4" width="2" height="8" rx="1" />
51
23
  </g>
52
24
  </svg>
53
25
  );
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+
3
+ import { TableCssClassName as ClassName } from '../../types';
4
+
5
+ export const MinimisedHandleIcon = () => (
6
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="5" fill="none">
7
+ <rect
8
+ className={ClassName.DRAG_HANDLE_MINIMISED}
9
+ width="24"
10
+ height="5"
11
+ rx="3"
12
+ />
13
+ </svg>
14
+ );
@@ -1,6 +1,7 @@
1
1
  export { DragHandleIcon } from './DragHandleIcon';
2
2
  export { DragInMotionIcon } from './DragInMotionIcon';
3
3
  export { DragHandleDisabledIcon } from './DragHandleDisabledIcon';
4
+ export { MinimisedHandleIcon } from './MinimisedHandle';
4
5
  export { AddRowAboveIcon } from './AddRowAboveIcon';
5
6
  export { AddRowBelowIcon } from './AddRowBelowIcon';
6
7
  export { AddColLeftIcon } from './AddColLeftIcon';
@@ -1,491 +0,0 @@
1
- // eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
2
- import {
3
- fullpage,
4
- resizeColumn,
5
- } from '@atlaskit/editor-test-helpers/integration/helpers';
6
- // eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
7
- import {
8
- insertColumn,
9
- insertTable,
10
- } from '@atlaskit/editor-test-helpers/page-objects/table';
11
- // eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
12
- import {
13
- goToEditorTestingWDExample,
14
- mountEditor,
15
- } from '@atlaskit/editor-test-helpers/testing-example-page';
16
- import { BrowserTestCase } from '@atlaskit/webdriver-runner/runner';
17
- import type WebdriverPage from '@atlaskit/webdriver-runner/wd-wrapper';
18
-
19
- import basicTableAdf from './__fixtures__/basic-table';
20
- import { emptyLayout } from './__fixtures__/empty-layout';
21
- import nestedInExpand from './__fixtures__/nested-in-expand';
22
- import { nestedInExtension } from './__fixtures__/nested-in-extension';
23
- import { table as tableInsideLayout } from './__fixtures__/table-inside-layout';
24
-
25
- // TODO - Add wider screen size here once editor-common fix is made ED-16647
26
- const screenWidths = [1920];
27
-
28
- const breakout = async (
29
- page: WebdriverPage,
30
- breakoutButton: WebdriverIO.Element,
31
- ) => {
32
- let tableContainer = await page.$('.pm-table-container');
33
-
34
- const currentWidth = await tableContainer.getCSSProperty('width');
35
- breakoutButton.click();
36
-
37
- await page.waitUntil(async () => {
38
- tableContainer = await page.$('.pm-table-container');
39
- const updatedWidth = await tableContainer.getCSSProperty('width');
40
- return updatedWidth.value !== currentWidth.value;
41
- });
42
- };
43
-
44
- const assertTableDoesNotScroll = async (page: WebdriverPage) => {
45
- const table = await page.$('.pm-table-wrapper');
46
-
47
- const tableScrollWidth = await table.getProperty('scrollWidth');
48
- const tableOffsetWidth = await table.getProperty('offsetWidth');
49
-
50
- expect(tableScrollWidth).toEqual(tableOffsetWidth);
51
- };
52
-
53
- const assertTableDoesScroll = async (page: WebdriverPage) => {
54
- const table = await page.$('.pm-table-wrapper');
55
-
56
- const tableScrollWidth = await table.getProperty('scrollWidth');
57
- const tableOffsetWidth = (await table.getProperty('offsetWidth')) as number;
58
-
59
- expect(tableScrollWidth).toBeGreaterThan(tableOffsetWidth);
60
- };
61
-
62
- BrowserTestCase(
63
- 'Table: Does not scroll when column is resized and a new column is inserted',
64
- { skip: [] },
65
- async (client: any, testName: string) => {
66
- for (const screenWidth of screenWidths) {
67
- const page = await goToEditorTestingWDExample(
68
- client,
69
- 'editor-plugin-table',
70
- { width: screenWidth, height: 1440 },
71
- );
72
-
73
- await mountEditor(page, {
74
- appearance: fullpage.appearance,
75
- defaultValue: basicTableAdf,
76
- allowTables: {
77
- advanced: true,
78
- allowDistributeColumns: true,
79
- },
80
- allowLayouts: true,
81
- });
82
-
83
- await resizeColumn(page, { cellHandlePos: 2, resizeWidth: -100 });
84
- await insertColumn(page, 0, 'right');
85
- await assertTableDoesNotScroll(page);
86
- }
87
- },
88
- );
89
-
90
- BrowserTestCase(
91
- 'Table: Does not scroll when column is resized and breakout button is clicked 3x',
92
- { skip: ['safari'] },
93
- async (client: any, testName: string) => {
94
- for (const screenWidth of screenWidths) {
95
- const page = await goToEditorTestingWDExample(
96
- client,
97
- 'editor-plugin-table',
98
- { width: screenWidth, height: 1440 },
99
- );
100
-
101
- await mountEditor(page, {
102
- appearance: fullpage.appearance,
103
- defaultValue: basicTableAdf,
104
- allowTables: {
105
- advanced: true,
106
- allowDistributeColumns: true,
107
- },
108
- allowLayouts: true,
109
- allowBreakout: true,
110
- });
111
-
112
- await resizeColumn(page, { cellHandlePos: 2, resizeWidth: -100 });
113
- await insertColumn(page, 0, 'right');
114
-
115
- const breakoutButton = await page.$('[aria-label="Go wide"]');
116
-
117
- await breakout(page, breakoutButton);
118
- await assertTableDoesNotScroll(page);
119
-
120
- await breakout(page, breakoutButton);
121
- await assertTableDoesNotScroll(page);
122
-
123
- await breakout(page, breakoutButton);
124
- await assertTableDoesNotScroll(page);
125
- }
126
- },
127
- );
128
-
129
- BrowserTestCase(
130
- 'Table: Does not scroll when nested in expand, column is resized and breakout button is clicked',
131
- { skip: [] },
132
- async (client: any, testName: string) => {
133
- for (const screenWidth of screenWidths) {
134
- const page = await goToEditorTestingWDExample(
135
- client,
136
- 'editor-plugin-table',
137
- { width: screenWidth, height: 1440 },
138
- );
139
-
140
- await mountEditor(page, {
141
- appearance: fullpage.appearance,
142
- defaultValue: nestedInExpand,
143
- allowTables: {
144
- advanced: true,
145
- allowDistributeColumns: true,
146
- },
147
- allowExpand: true,
148
- allowLayouts: true,
149
- allowBreakout: true,
150
- });
151
-
152
- const breakoutButton = await page.$('[aria-label="Go wide"]');
153
-
154
- await resizeColumn(page, { cellHandlePos: 3, resizeWidth: -100 });
155
- await breakout(page, breakoutButton);
156
- await assertTableDoesNotScroll(page);
157
- }
158
- },
159
- );
160
-
161
- BrowserTestCase(
162
- 'Table: Last column can be resized to remove scroll',
163
- { skip: [] },
164
- async (client: any, testName: string) => {
165
- for (const screenWidth of screenWidths) {
166
- const page = await goToEditorTestingWDExample(
167
- client,
168
- 'editor-plugin-table',
169
- { width: screenWidth, height: 1440 },
170
- );
171
-
172
- await mountEditor(page, {
173
- appearance: fullpage.appearance,
174
- defaultValue: basicTableAdf,
175
- allowTables: {
176
- advanced: true,
177
- allowDistributeColumns: true,
178
- },
179
- allowExpand: true,
180
- allowLayouts: true,
181
- allowBreakout: true,
182
- });
183
-
184
- await resizeColumn(page, { cellHandlePos: 2, resizeWidth: 1000 });
185
- await assertTableDoesScroll(page);
186
- await resizeColumn(page, { cellHandlePos: 10, resizeWidth: -1000 });
187
- await assertTableDoesNotScroll(page);
188
- }
189
- },
190
- );
191
-
192
- BrowserTestCase(
193
- 'Table: When nested in expand, last column can be resized to remove scroll',
194
- { skip: [] },
195
- async (client: any, testName: string) => {
196
- for (const screenWidth of screenWidths) {
197
- const page = await goToEditorTestingWDExample(
198
- client,
199
- 'editor-plugin-table',
200
- { width: screenWidth, height: 1440 },
201
- );
202
-
203
- await mountEditor(page, {
204
- appearance: fullpage.appearance,
205
- defaultValue: nestedInExpand,
206
- allowTables: {
207
- advanced: true,
208
- allowDistributeColumns: true,
209
- },
210
- allowExpand: true,
211
- allowLayouts: true,
212
- allowBreakout: true,
213
- });
214
-
215
- await resizeColumn(page, { cellHandlePos: 3, resizeWidth: 1000 });
216
- await assertTableDoesScroll(page);
217
- await resizeColumn(page, { cellHandlePos: 11, resizeWidth: -1000 });
218
- await assertTableDoesNotScroll(page);
219
- }
220
- },
221
- );
222
-
223
- BrowserTestCase(
224
- 'Table: When nested in layout, last column can be resized to remove scroll',
225
- { skip: [] },
226
- async (client: any, testName: string) => {
227
- for (const screenWidth of screenWidths) {
228
- const page = await goToEditorTestingWDExample(
229
- client,
230
- 'editor-plugin-table',
231
- { width: screenWidth, height: 1440 },
232
- );
233
-
234
- await mountEditor(page, {
235
- appearance: fullpage.appearance,
236
- defaultValue: tableInsideLayout,
237
- allowTables: {
238
- advanced: true,
239
- allowDistributeColumns: true,
240
- },
241
- allowExpand: true,
242
- allowLayouts: true,
243
- allowBreakout: true,
244
- });
245
-
246
- await resizeColumn(page, { cellHandlePos: 8, resizeWidth: 1000 });
247
- await assertTableDoesScroll(page);
248
- await resizeColumn(page, { cellHandlePos: 16, resizeWidth: -1000 });
249
- await assertTableDoesNotScroll(page);
250
- }
251
- },
252
- );
253
-
254
- BrowserTestCase(
255
- 'Table: When nested in bodied macro, last column can be resized to remove scroll',
256
- { skip: [] },
257
- async (client: any, testName: string) => {
258
- for (const screenWidth of screenWidths) {
259
- const page = await goToEditorTestingWDExample(
260
- client,
261
- 'editor-plugin-table',
262
- { width: screenWidth, height: 1440 },
263
- );
264
-
265
- await mountEditor(page, {
266
- appearance: fullpage.appearance,
267
- defaultValue: nestedInExtension,
268
- allowTables: {
269
- advanced: true,
270
- allowDistributeColumns: true,
271
- },
272
- allowExpand: true,
273
- allowLayouts: true,
274
- allowBreakout: true,
275
- allowExtension: true,
276
- });
277
-
278
- await resizeColumn(page, { cellHandlePos: 3, resizeWidth: 1000 });
279
- await assertTableDoesScroll(page);
280
- await resizeColumn(page, { cellHandlePos: 11, resizeWidth: -1000 });
281
- await assertTableDoesNotScroll(page);
282
- }
283
- },
284
- );
285
-
286
- BrowserTestCase(
287
- 'Table: Scrolls when there are more columns added than can fit the current width',
288
- { skip: [] },
289
- async (client: any, testName: string) => {
290
- for (const screenWidth of screenWidths) {
291
- const page = await goToEditorTestingWDExample(
292
- client,
293
- 'editor-plugin-table',
294
- { width: screenWidth, height: 1440 },
295
- );
296
-
297
- await mountEditor(page, {
298
- appearance: fullpage.appearance,
299
- defaultValue: basicTableAdf,
300
- allowTables: {
301
- advanced: true,
302
- allowDistributeColumns: true,
303
- },
304
- allowExpand: true,
305
- allowLayouts: true,
306
- allowBreakout: true,
307
- });
308
-
309
- const numberOfColumns = 14;
310
- for (const _column of [...Array(numberOfColumns).keys()]) {
311
- await insertColumn(page, 0, 'right');
312
- }
313
-
314
- await assertTableDoesScroll(page);
315
- }
316
- },
317
- );
318
-
319
- BrowserTestCase(
320
- 'Table: Does not scroll when nested in Bodied Macro, column is resized and breakout button is clicked',
321
- { skip: [] },
322
- async (client: any, testName: string) => {
323
- for (const screenWidth of screenWidths) {
324
- const page = await goToEditorTestingWDExample(
325
- client,
326
- 'editor-plugin-table',
327
- { width: screenWidth, height: 1440 },
328
- );
329
-
330
- await mountEditor(page, {
331
- appearance: fullpage.appearance,
332
- defaultValue: JSON.stringify(nestedInExtension),
333
- allowTables: {
334
- advanced: true,
335
- },
336
- allowExtension: true,
337
- });
338
-
339
- await resizeColumn(page, { cellHandlePos: 3, resizeWidth: -100 });
340
- await insertColumn(page, 0, 'right');
341
- await assertTableDoesNotScroll(page);
342
- }
343
- },
344
- );
345
-
346
- BrowserTestCase(
347
- 'Table: Does not scroll when nested in layout, column is resized and breakout button is clicked',
348
- { skip: [] },
349
- async (client: any, testName: string) => {
350
- for (const screenWidth of screenWidths) {
351
- const page = await goToEditorTestingWDExample(
352
- client,
353
- 'editor-plugin-table',
354
- { width: screenWidth, height: 1440 },
355
- );
356
-
357
- await mountEditor(page, {
358
- appearance: fullpage.appearance,
359
- defaultValue: JSON.stringify(tableInsideLayout),
360
- allowTables: {
361
- advanced: true,
362
- },
363
- allowLayouts: {
364
- allowBreakout: true,
365
- },
366
- allowBreakout: true,
367
- });
368
-
369
- const breakoutButton = await page.$('[aria-label="Go wide"]');
370
-
371
- await resizeColumn(page, { cellHandlePos: 8, resizeWidth: -100 });
372
- await breakout(page, breakoutButton);
373
- await assertTableDoesNotScroll(page);
374
- }
375
- },
376
- );
377
-
378
- BrowserTestCase(
379
- 'Table: Does not scroll when nested in single column layout, table column is resized and breakout button is clicked',
380
- { skip: [] },
381
- async (client: any, testName: string) => {
382
- for (const screenWidth of screenWidths) {
383
- const page = await goToEditorTestingWDExample(
384
- client,
385
- 'editor-plugin-table',
386
- { width: screenWidth, height: 1440 },
387
- );
388
-
389
- await mountEditor(page, {
390
- appearance: fullpage.appearance,
391
- defaultValue: JSON.stringify(tableInsideLayout),
392
- allowTables: {
393
- advanced: true,
394
- allowDistributeColumns: true,
395
- },
396
- allowLayouts: {
397
- allowBreakout: true,
398
- UNSAFE_allowSingleColumnLayout: true,
399
- },
400
- allowBreakout: true,
401
- });
402
-
403
- await resizeColumn(page, { cellHandlePos: 8, resizeWidth: -100 });
404
-
405
- const singleColumnButton = await page.$('[aria-label="Single column"]');
406
- singleColumnButton.click();
407
-
408
- const breakoutButton = await page.$('[aria-label="Go wide"]');
409
-
410
- await breakout(page, breakoutButton);
411
- await assertTableDoesNotScroll(page);
412
- }
413
- },
414
- );
415
-
416
- BrowserTestCase(
417
- 'Table: Does not scroll when nested in three columns layout, table column is resized and breakout button is clicked',
418
- { skip: [] },
419
- async (client: any, testName: string) => {
420
- for (const screenWidth of screenWidths) {
421
- const page = await goToEditorTestingWDExample(
422
- client,
423
- 'editor-plugin-table',
424
- { width: screenWidth, height: 1440 },
425
- );
426
-
427
- await mountEditor(page, {
428
- appearance: fullpage.appearance,
429
- defaultValue: JSON.stringify(tableInsideLayout),
430
- allowTables: {
431
- advanced: true,
432
- allowDistributeColumns: true,
433
- },
434
- allowLayouts: {
435
- allowBreakout: true,
436
- UNSAFE_allowSingleColumnLayout: true,
437
- },
438
- allowBreakout: true,
439
- });
440
-
441
- await resizeColumn(page, { cellHandlePos: 8, resizeWidth: -100 });
442
-
443
- const threeColumnButton = await page.$('[aria-label="Three columns"]');
444
- threeColumnButton.click();
445
-
446
- const breakoutButton = await page.$('[aria-label="Go wide"]');
447
-
448
- await breakout(page, breakoutButton);
449
- await assertTableDoesNotScroll(page);
450
- }
451
- },
452
- );
453
-
454
- // FIXME: This test was automatically skipped due to failure on 28/07/2023: https://product-fabric.atlassian.net/browse/ED-19288
455
- BrowserTestCase(
456
- 'Table: Does not scroll when nested in full-width layout, columns is resized and new column is inserted',
457
- {
458
- skip: ['*'],
459
- },
460
- async (client: any, testName: string) => {
461
- for (const screenWidth of screenWidths) {
462
- const page = await goToEditorTestingWDExample(
463
- client,
464
- 'editor-plugin-table',
465
- { width: screenWidth, height: 1440 },
466
- );
467
-
468
- await mountEditor(page, {
469
- appearance: fullpage.appearance,
470
- defaultValue: emptyLayout,
471
- allowTables: {
472
- advanced: true,
473
- },
474
- allowLayouts: {
475
- allowBreakout: true,
476
- },
477
- allowBreakout: true,
478
- });
479
-
480
- const goWideButton = await page.$('[aria-label="Go wide"]');
481
- goWideButton.click();
482
- goWideButton.click();
483
-
484
- insertTable(page);
485
- await assertTableDoesNotScroll(page);
486
- await resizeColumn(page, { cellHandlePos: 4, resizeWidth: -100 });
487
- await insertColumn(page, 0, 'right');
488
- await assertTableDoesNotScroll(page);
489
- }
490
- },
491
- );