@atlaskit/editor-plugin-table 7.16.17 → 7.16.19
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.
- package/CHANGELOG.md +21 -0
- package/dist/cjs/commands/column-resize.js +4 -3
- package/dist/cjs/commands/delete.js +3 -2
- package/dist/cjs/commands/insert.js +12 -8
- package/dist/cjs/commands-with-analytics.js +10 -7
- package/dist/cjs/event-handlers.js +3 -2
- package/dist/cjs/nodeviews/TableComponent.js +32 -19
- package/dist/cjs/nodeviews/TableContainer.js +4 -0
- package/dist/cjs/nodeviews/TableResizer.js +8 -7
- package/dist/cjs/nodeviews/table.js +6 -4
- package/dist/cjs/plugin.js +9 -6
- package/dist/cjs/pm-plugins/drag-and-drop/plugin.js +12 -13
- package/dist/cjs/pm-plugins/keymap.js +11 -9
- package/dist/cjs/pm-plugins/main.js +4 -1
- package/dist/cjs/pm-plugins/table-resizing/event-handlers.js +10 -9
- package/dist/cjs/pm-plugins/table-resizing/utils/resize-state.js +4 -3
- package/dist/cjs/pm-plugins/table-resizing/utils/scale-table.js +4 -3
- package/dist/cjs/toolbar.js +54 -37
- package/dist/cjs/transforms/column-width.js +3 -3
- package/dist/cjs/transforms/delete-columns.js +3 -2
- package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +21 -15
- package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +3 -2
- package/dist/cjs/ui/FloatingDragMenu/index.js +6 -3
- package/dist/cjs/ui/FloatingInsertButton/index.js +7 -8
- package/dist/cjs/utils/drag-menu.js +5 -4
- package/dist/es2019/commands/column-resize.js +4 -3
- package/dist/es2019/commands/delete.js +2 -2
- package/dist/es2019/commands/insert.js +8 -8
- package/dist/es2019/commands-with-analytics.js +9 -8
- package/dist/es2019/event-handlers.js +2 -2
- package/dist/es2019/nodeviews/TableComponent.js +28 -17
- package/dist/es2019/nodeviews/TableContainer.js +4 -0
- package/dist/es2019/nodeviews/TableResizer.js +9 -8
- package/dist/es2019/nodeviews/table.js +5 -4
- package/dist/es2019/plugin.js +9 -6
- package/dist/es2019/pm-plugins/drag-and-drop/plugin.js +7 -10
- package/dist/es2019/pm-plugins/keymap.js +9 -9
- package/dist/es2019/pm-plugins/main.js +4 -1
- package/dist/es2019/pm-plugins/table-resizing/event-handlers.js +10 -9
- package/dist/es2019/pm-plugins/table-resizing/utils/resize-state.js +4 -4
- package/dist/es2019/pm-plugins/table-resizing/utils/scale-table.js +4 -4
- package/dist/es2019/toolbar.js +51 -39
- package/dist/es2019/transforms/column-width.js +2 -3
- package/dist/es2019/transforms/delete-columns.js +2 -2
- package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +12 -7
- package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +3 -2
- package/dist/es2019/ui/FloatingDragMenu/index.js +5 -3
- package/dist/es2019/ui/FloatingInsertButton/index.js +6 -8
- package/dist/es2019/utils/drag-menu.js +4 -4
- package/dist/esm/commands/column-resize.js +4 -3
- package/dist/esm/commands/delete.js +3 -2
- package/dist/esm/commands/insert.js +12 -8
- package/dist/esm/commands-with-analytics.js +10 -7
- package/dist/esm/event-handlers.js +3 -2
- package/dist/esm/nodeviews/TableComponent.js +32 -19
- package/dist/esm/nodeviews/TableContainer.js +4 -0
- package/dist/esm/nodeviews/TableResizer.js +9 -8
- package/dist/esm/nodeviews/table.js +6 -4
- package/dist/esm/plugin.js +9 -6
- package/dist/esm/pm-plugins/drag-and-drop/plugin.js +12 -13
- package/dist/esm/pm-plugins/keymap.js +11 -9
- package/dist/esm/pm-plugins/main.js +4 -1
- package/dist/esm/pm-plugins/table-resizing/event-handlers.js +10 -9
- package/dist/esm/pm-plugins/table-resizing/utils/resize-state.js +4 -3
- package/dist/esm/pm-plugins/table-resizing/utils/scale-table.js +4 -3
- package/dist/esm/toolbar.js +54 -37
- package/dist/esm/transforms/column-width.js +3 -3
- package/dist/esm/transforms/delete-columns.js +3 -2
- package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +21 -15
- package/dist/esm/ui/FloatingDragMenu/DragMenu.js +3 -2
- package/dist/esm/ui/FloatingDragMenu/index.js +6 -3
- package/dist/esm/ui/FloatingInsertButton/index.js +7 -8
- package/dist/esm/utils/drag-menu.js +5 -4
- package/dist/types/commands/column-resize.d.ts +2 -1
- package/dist/types/commands/delete.d.ts +1 -1
- package/dist/types/commands/insert.d.ts +4 -4
- package/dist/types/commands-with-analytics.d.ts +4 -4
- package/dist/types/event-handlers.d.ts +1 -1
- package/dist/types/nodeviews/TableContainer.d.ts +4 -2
- package/dist/types/nodeviews/TableResizer.d.ts +2 -1
- package/dist/types/nodeviews/table.d.ts +1 -0
- package/dist/types/pm-plugins/drag-and-drop/plugin.d.ts +1 -1
- package/dist/types/pm-plugins/keymap.d.ts +1 -1
- package/dist/types/pm-plugins/table-resizing/utils/resize-state.d.ts +1 -1
- package/dist/types/pm-plugins/table-resizing/utils/scale-table.d.ts +1 -1
- package/dist/types/toolbar.d.ts +5 -5
- package/dist/types/transforms/column-width.d.ts +1 -1
- package/dist/types/transforms/delete-columns.d.ts +1 -1
- package/dist/types/ui/FloatingDragMenu/DragMenu.d.ts +2 -1
- package/dist/types/ui/FloatingInsertButton/index.d.ts +1 -0
- package/dist/types/utils/drag-menu.d.ts +1 -1
- package/dist/types-ts4.5/commands/column-resize.d.ts +2 -1
- package/dist/types-ts4.5/commands/delete.d.ts +1 -1
- package/dist/types-ts4.5/commands/insert.d.ts +4 -4
- package/dist/types-ts4.5/commands-with-analytics.d.ts +4 -4
- package/dist/types-ts4.5/event-handlers.d.ts +1 -1
- package/dist/types-ts4.5/nodeviews/TableContainer.d.ts +4 -2
- package/dist/types-ts4.5/nodeviews/TableResizer.d.ts +2 -1
- package/dist/types-ts4.5/nodeviews/table.d.ts +1 -0
- package/dist/types-ts4.5/pm-plugins/drag-and-drop/plugin.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/keymap.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/resize-state.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/scale-table.d.ts +1 -1
- package/dist/types-ts4.5/toolbar.d.ts +5 -5
- package/dist/types-ts4.5/transforms/column-width.d.ts +1 -1
- package/dist/types-ts4.5/transforms/delete-columns.d.ts +1 -1
- package/dist/types-ts4.5/ui/FloatingDragMenu/DragMenu.d.ts +2 -1
- package/dist/types-ts4.5/ui/FloatingInsertButton/index.d.ts +1 -0
- package/dist/types-ts4.5/utils/drag-menu.d.ts +1 -1
- package/package.json +5 -8
- package/src/commands/column-resize.ts +6 -6
- package/src/commands/delete.ts +7 -1
- package/src/commands/insert.ts +33 -5
- package/src/commands-with-analytics.ts +14 -2
- package/src/event-handlers.ts +2 -0
- package/src/nodeviews/TableComponent.tsx +28 -28
- package/src/nodeviews/TableContainer.tsx +6 -0
- package/src/nodeviews/TableResizer.tsx +16 -6
- package/src/nodeviews/table.tsx +4 -2
- package/src/plugin.tsx +17 -7
- package/src/pm-plugins/drag-and-drop/plugin.ts +26 -13
- package/src/pm-plugins/keymap.ts +30 -4
- package/src/pm-plugins/main.ts +2 -0
- package/src/pm-plugins/table-resizing/event-handlers.ts +12 -14
- package/src/pm-plugins/table-resizing/utils/resize-state.ts +5 -5
- package/src/pm-plugins/table-resizing/utils/scale-table.ts +6 -4
- package/src/toolbar.tsx +97 -40
- package/src/transforms/column-width.ts +7 -3
- package/src/transforms/delete-columns.ts +6 -2
- package/src/ui/FloatingContextualMenu/ContextualMenu.tsx +12 -4
- package/src/ui/FloatingDragMenu/DragMenu.tsx +3 -0
- package/src/ui/FloatingDragMenu/index.tsx +4 -4
- package/src/ui/FloatingInsertButton/index.tsx +12 -9
- package/src/utils/drag-menu.ts +13 -4
|
@@ -13,4 +13,4 @@ export interface DragMenuConfig extends DropdownOptionT<Command> {
|
|
|
13
13
|
icon?: React.ComponentType<React.PropsWithChildren<IconProps>>;
|
|
14
14
|
keymap?: string;
|
|
15
15
|
}
|
|
16
|
-
export declare const getDragMenuConfig: (direction: TableDirection, getEditorContainerWidth: GetEditorContainerWidth, canDrag: boolean, hasMergedCellsInTable: boolean, editorView: EditorView, tableMap?: TableMap, index?: number, targetCellPosition?: number, selectionRect?: Rect, editorAnalyticsAPI?: EditorAnalyticsAPI, isHeaderRowRequired?: boolean, isTableScalingEnabled?: boolean, tableDuplicateCellColouring?: boolean, shouldUseIncreasedScalingPercent?: boolean) => DragMenuConfig[];
|
|
16
|
+
export declare const getDragMenuConfig: (direction: TableDirection, getEditorContainerWidth: GetEditorContainerWidth, canDrag: boolean, hasMergedCellsInTable: boolean, editorView: EditorView, tableMap?: TableMap, index?: number, targetCellPosition?: number, selectionRect?: Rect, editorAnalyticsAPI?: EditorAnalyticsAPI, isHeaderRowRequired?: boolean, isTableScalingEnabled?: boolean, tableDuplicateCellColouring?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => DragMenuConfig[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "7.16.
|
|
3
|
+
"version": "7.16.19",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@atlaskit/adf-schema": "^36.10.7",
|
|
32
32
|
"@atlaskit/button": "^17.17.0",
|
|
33
33
|
"@atlaskit/custom-steps": "^0.2.0",
|
|
34
|
-
"@atlaskit/editor-common": "^82.
|
|
34
|
+
"@atlaskit/editor-common": "^82.2.0",
|
|
35
35
|
"@atlaskit/editor-palette": "1.6.0",
|
|
36
36
|
"@atlaskit/editor-plugin-accessibility-utils": "^1.1.0",
|
|
37
37
|
"@atlaskit/editor-plugin-analytics": "^1.2.0",
|
|
@@ -44,13 +44,13 @@
|
|
|
44
44
|
"@atlaskit/editor-shared-styles": "^2.12.0",
|
|
45
45
|
"@atlaskit/editor-tables": "^2.7.0",
|
|
46
46
|
"@atlaskit/icon": "^22.3.0",
|
|
47
|
-
"@atlaskit/menu": "^2.
|
|
47
|
+
"@atlaskit/menu": "^2.4.0",
|
|
48
48
|
"@atlaskit/platform-feature-flags": "^0.2.1",
|
|
49
49
|
"@atlaskit/pragmatic-drag-and-drop": "^1.1.0",
|
|
50
50
|
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^1.3.0",
|
|
51
51
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.0.0",
|
|
52
|
-
"@atlaskit/primitives": "^
|
|
53
|
-
"@atlaskit/theme": "^12.
|
|
52
|
+
"@atlaskit/primitives": "^7.0.0",
|
|
53
|
+
"@atlaskit/theme": "^12.9.0",
|
|
54
54
|
"@atlaskit/toggle": "^13.1.0",
|
|
55
55
|
"@atlaskit/tokens": "^1.49.0",
|
|
56
56
|
"@atlaskit/tooltip": "^18.4.0",
|
|
@@ -123,9 +123,6 @@
|
|
|
123
123
|
"platform.editor.table.cmd-a-select-table": {
|
|
124
124
|
"type": "boolean"
|
|
125
125
|
},
|
|
126
|
-
"platform.editor.table.preserve-widths-with-lock-button": {
|
|
127
|
-
"type": "boolean"
|
|
128
|
-
},
|
|
129
126
|
"platform.editor.table.use-shared-state-hook": {
|
|
130
127
|
"type": "boolean"
|
|
131
128
|
},
|
|
@@ -257,12 +257,14 @@ export const changeColumnWidthByStep =
|
|
|
257
257
|
stepSize,
|
|
258
258
|
getEditorContainerWidth,
|
|
259
259
|
isTableScalingEnabled,
|
|
260
|
+
isTableFixedColumnWidthsOptionEnabled,
|
|
260
261
|
ariaNotify,
|
|
261
262
|
getIntl,
|
|
262
263
|
}: {
|
|
263
264
|
stepSize: number;
|
|
264
265
|
getEditorContainerWidth: GetEditorContainerWidth;
|
|
265
266
|
isTableScalingEnabled: boolean;
|
|
267
|
+
isTableFixedColumnWidthsOptionEnabled: boolean;
|
|
266
268
|
ariaNotify?: (message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void;
|
|
267
269
|
getIntl?: () => IntlShape;
|
|
268
270
|
originalTr?: Transaction;
|
|
@@ -326,15 +328,13 @@ export const changeColumnWidthByStep =
|
|
|
326
328
|
});
|
|
327
329
|
|
|
328
330
|
let isTableScalingEnabledOnCurrentTable = isTableScalingEnabled;
|
|
329
|
-
const
|
|
330
|
-
isTableScalingEnabled &&
|
|
331
|
-
|
|
332
|
-
if (isTableScalingEnabledWithLockButton) {
|
|
331
|
+
const isTableScalingWithFixedColumnWidthsOptionEnabled =
|
|
332
|
+
isTableScalingEnabled && isTableFixedColumnWidthsOptionEnabled;
|
|
333
|
+
if (isTableScalingWithFixedColumnWidthsOptionEnabled) {
|
|
333
334
|
isTableScalingEnabledOnCurrentTable = originalTable.attrs.displayMode !== 'fixed';
|
|
334
335
|
}
|
|
335
|
-
|
|
336
336
|
const shouldUseIncreasedScalingPercent =
|
|
337
|
-
|
|
337
|
+
isTableScalingWithFixedColumnWidthsOptionEnabled &&
|
|
338
338
|
getBooleanFF('platform.editor.table.use-increased-scaling-percent');
|
|
339
339
|
|
|
340
340
|
const initialResizeState = getResizeState({
|
package/src/commands/delete.ts
CHANGED
|
@@ -5,13 +5,19 @@ import { deleteColumns } from '../transforms/delete-columns';
|
|
|
5
5
|
import { getAllowAddColumnCustomStep } from '../utils/get-allow-add-column-custom-step';
|
|
6
6
|
|
|
7
7
|
export const deleteColumnsCommand =
|
|
8
|
-
(
|
|
8
|
+
(
|
|
9
|
+
rect: Rect,
|
|
10
|
+
isTableScalingEnabled = false,
|
|
11
|
+
isTableFixedColumnWidthsOptionEnabled = false,
|
|
12
|
+
shouldUseIncreasedScalingPercent = false,
|
|
13
|
+
): Command =>
|
|
9
14
|
(state, dispatch, view) => {
|
|
10
15
|
const tr = deleteColumns(
|
|
11
16
|
rect,
|
|
12
17
|
getAllowAddColumnCustomStep(state),
|
|
13
18
|
view,
|
|
14
19
|
isTableScalingEnabled,
|
|
20
|
+
isTableFixedColumnWidthsOptionEnabled,
|
|
15
21
|
shouldUseIncreasedScalingPercent,
|
|
16
22
|
)(state.tr);
|
|
17
23
|
if (dispatch) {
|
package/src/commands/insert.ts
CHANGED
|
@@ -41,6 +41,7 @@ function addColumnAtCustomStep(column: number) {
|
|
|
41
41
|
export function addColumnAt(
|
|
42
42
|
isTableScalingEnabled = false,
|
|
43
43
|
isCellBackgroundDuplicated?: boolean,
|
|
44
|
+
isTableFixedColumnWidthsOptionEnabled?: boolean,
|
|
44
45
|
shouldUseIncreasedScalingPercent?: boolean,
|
|
45
46
|
) {
|
|
46
47
|
return (
|
|
@@ -58,7 +59,11 @@ export function addColumnAt(
|
|
|
58
59
|
const table = findTable(updatedTr.selection);
|
|
59
60
|
if (table) {
|
|
60
61
|
// [ED-8288] Update colwidths manually to avoid multiple dispatch in TableComponent
|
|
61
|
-
updatedTr = rescaleColumns(
|
|
62
|
+
updatedTr = rescaleColumns(
|
|
63
|
+
isTableScalingEnabled,
|
|
64
|
+
isTableFixedColumnWidthsOptionEnabled,
|
|
65
|
+
shouldUseIncreasedScalingPercent,
|
|
66
|
+
)(
|
|
62
67
|
table,
|
|
63
68
|
view,
|
|
64
69
|
)(updatedTr);
|
|
@@ -83,7 +88,12 @@ export function addColumnAt(
|
|
|
83
88
|
// :: (EditorState, dispatch: ?(tr: Transaction)) → bool
|
|
84
89
|
// Command to add a column before the column with the selection.
|
|
85
90
|
export const addColumnBefore =
|
|
86
|
-
(
|
|
91
|
+
(
|
|
92
|
+
isTableScalingEnabled = false,
|
|
93
|
+
isCellBackgroundDuplicated = false,
|
|
94
|
+
isTableFixedColumnWidthsOptionEnabled = false,
|
|
95
|
+
shouldUseIncreasedScalingPercent = false,
|
|
96
|
+
): Command =>
|
|
87
97
|
(state, dispatch, view) => {
|
|
88
98
|
const table = findTable(state.selection);
|
|
89
99
|
if (!table) {
|
|
@@ -92,7 +102,12 @@ export const addColumnBefore =
|
|
|
92
102
|
if (dispatch) {
|
|
93
103
|
let rect = selectedRect(state);
|
|
94
104
|
dispatch(
|
|
95
|
-
addColumnAt(
|
|
105
|
+
addColumnAt(
|
|
106
|
+
isTableScalingEnabled,
|
|
107
|
+
isCellBackgroundDuplicated,
|
|
108
|
+
isTableFixedColumnWidthsOptionEnabled,
|
|
109
|
+
shouldUseIncreasedScalingPercent,
|
|
110
|
+
)(
|
|
96
111
|
rect.left,
|
|
97
112
|
getAllowAddColumnCustomStep(state),
|
|
98
113
|
view,
|
|
@@ -105,16 +120,27 @@ export const addColumnBefore =
|
|
|
105
120
|
// :: (EditorState, dispatch: ?(tr: Transaction)) → bool
|
|
106
121
|
// Command to add a column after the column with the selection.
|
|
107
122
|
export const addColumnAfter =
|
|
108
|
-
(
|
|
123
|
+
(
|
|
124
|
+
isTableScalingEnabled?: boolean,
|
|
125
|
+
isCellBackgroundDuplicated?: boolean,
|
|
126
|
+
isTableFixedColumnWidthsOptionEnabled?: boolean,
|
|
127
|
+
shouldUseIncreasedScalingPercent?: boolean,
|
|
128
|
+
): Command =>
|
|
109
129
|
(state, dispatch, view) => {
|
|
110
130
|
const table = findTable(state.selection);
|
|
111
131
|
if (!table) {
|
|
112
132
|
return false;
|
|
113
133
|
}
|
|
134
|
+
|
|
114
135
|
if (dispatch) {
|
|
115
136
|
let rect = selectedRect(state);
|
|
116
137
|
dispatch(
|
|
117
|
-
addColumnAt(
|
|
138
|
+
addColumnAt(
|
|
139
|
+
isTableScalingEnabled,
|
|
140
|
+
isCellBackgroundDuplicated,
|
|
141
|
+
isTableFixedColumnWidthsOptionEnabled,
|
|
142
|
+
shouldUseIncreasedScalingPercent,
|
|
143
|
+
)(
|
|
118
144
|
rect.right,
|
|
119
145
|
getAllowAddColumnCustomStep(state),
|
|
120
146
|
view,
|
|
@@ -128,6 +154,7 @@ export const insertColumn =
|
|
|
128
154
|
(
|
|
129
155
|
isTableScalingEnabled = false,
|
|
130
156
|
isCellBackgroundDuplicated?: boolean,
|
|
157
|
+
isTableFixedColumnWidthsOptionEnabled?: boolean,
|
|
131
158
|
shouldUseIncreasedScalingPercent?: boolean,
|
|
132
159
|
) =>
|
|
133
160
|
(column: number): Command =>
|
|
@@ -135,6 +162,7 @@ export const insertColumn =
|
|
|
135
162
|
let tr = addColumnAt(
|
|
136
163
|
isTableScalingEnabled,
|
|
137
164
|
isCellBackgroundDuplicated,
|
|
165
|
+
isTableFixedColumnWidthsOptionEnabled,
|
|
138
166
|
shouldUseIncreasedScalingPercent,
|
|
139
167
|
)(
|
|
140
168
|
column,
|
|
@@ -240,6 +240,7 @@ export const changeColumnWidthByStepWithAnalytics =
|
|
|
240
240
|
stepSize: number,
|
|
241
241
|
getEditorContainerWidth: GetEditorContainerWidth,
|
|
242
242
|
isTableScalingEnabled: boolean,
|
|
243
|
+
isTableFixedColumnWidthsOptionEnabled: boolean,
|
|
243
244
|
inputMethod: INPUT_METHOD.SHORTCUT,
|
|
244
245
|
ariaNotify?: (message: string) => void,
|
|
245
246
|
getIntl?: () => IntlShape,
|
|
@@ -268,7 +269,8 @@ export const changeColumnWidthByStepWithAnalytics =
|
|
|
268
269
|
changeColumnWidthByStep({
|
|
269
270
|
stepSize: stepSize,
|
|
270
271
|
getEditorContainerWidth: getEditorContainerWidth,
|
|
271
|
-
isTableScalingEnabled
|
|
272
|
+
isTableScalingEnabled,
|
|
273
|
+
isTableFixedColumnWidthsOptionEnabled,
|
|
272
274
|
ariaNotify: ariaNotify,
|
|
273
275
|
getIntl: getIntl,
|
|
274
276
|
}),
|
|
@@ -279,6 +281,7 @@ export const insertColumnWithAnalytics =
|
|
|
279
281
|
editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null,
|
|
280
282
|
isTableScalingEnabled = false,
|
|
281
283
|
isCellbackgroundDuplicated = false,
|
|
284
|
+
isTableFixedColumnWidthsOptionEnabled = false,
|
|
282
285
|
shouldUseIncreasedScalingPercent = false,
|
|
283
286
|
) =>
|
|
284
287
|
(
|
|
@@ -308,6 +311,7 @@ export const insertColumnWithAnalytics =
|
|
|
308
311
|
insertColumn(
|
|
309
312
|
isTableScalingEnabled,
|
|
310
313
|
isCellbackgroundDuplicated,
|
|
314
|
+
isTableFixedColumnWidthsOptionEnabled,
|
|
311
315
|
shouldUseIncreasedScalingPercent,
|
|
312
316
|
)(position),
|
|
313
317
|
);
|
|
@@ -351,6 +355,7 @@ export const deleteColumnsWithAnalytics =
|
|
|
351
355
|
(
|
|
352
356
|
editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null,
|
|
353
357
|
isTableScalingEnabled = false,
|
|
358
|
+
isTableFixedColumnWidthsOptionEnabled = false,
|
|
354
359
|
shouldUseIncreasedScalingPercent = false,
|
|
355
360
|
) =>
|
|
356
361
|
(
|
|
@@ -379,13 +384,19 @@ export const deleteColumnsWithAnalytics =
|
|
|
379
384
|
eventType: EVENT_TYPE.TRACK,
|
|
380
385
|
};
|
|
381
386
|
})(editorAnalyticsAPI)(
|
|
382
|
-
deleteColumnsCommand(
|
|
387
|
+
deleteColumnsCommand(
|
|
388
|
+
rect,
|
|
389
|
+
isTableScalingEnabled,
|
|
390
|
+
isTableFixedColumnWidthsOptionEnabled,
|
|
391
|
+
shouldUseIncreasedScalingPercent,
|
|
392
|
+
),
|
|
383
393
|
);
|
|
384
394
|
|
|
385
395
|
export const deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut =
|
|
386
396
|
(
|
|
387
397
|
editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null,
|
|
388
398
|
isTableScalingEnabled?: boolean,
|
|
399
|
+
isTableFixedColumnWidthsOptionEnabled?: boolean,
|
|
389
400
|
shouldUseIncreasedScalingPercent?: boolean,
|
|
390
401
|
): Command =>
|
|
391
402
|
(state, dispatch) => {
|
|
@@ -414,6 +425,7 @@ export const deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut =
|
|
|
414
425
|
return deleteColumnsWithAnalytics(
|
|
415
426
|
editorAnalyticsAPI,
|
|
416
427
|
isTableScalingEnabled,
|
|
428
|
+
isTableFixedColumnWidthsOptionEnabled,
|
|
417
429
|
shouldUseIncreasedScalingPercent,
|
|
418
430
|
)(INPUT_METHOD.SHORTCUT, rect)(state, dispatch);
|
|
419
431
|
} else {
|
package/src/event-handlers.ts
CHANGED
|
@@ -477,6 +477,7 @@ export const handleCut = (
|
|
|
477
477
|
editorAnalyticsAPI?: EditorAnalyticsAPI,
|
|
478
478
|
editorView?: EditorView,
|
|
479
479
|
isTableScalingEnabled = false,
|
|
480
|
+
isTableFixedColumnWidthsOptionEnabled = false,
|
|
480
481
|
shouldUseIncreasedScalingPercent = false,
|
|
481
482
|
): Transaction => {
|
|
482
483
|
const oldSelection = oldState.tr.selection;
|
|
@@ -525,6 +526,7 @@ export const handleCut = (
|
|
|
525
526
|
getAllowAddColumnCustomStep(oldState),
|
|
526
527
|
editorView,
|
|
527
528
|
isTableScalingEnabled,
|
|
529
|
+
isTableFixedColumnWidthsOptionEnabled,
|
|
528
530
|
shouldUseIncreasedScalingPercent,
|
|
529
531
|
)(tr);
|
|
530
532
|
}
|
|
@@ -204,16 +204,15 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
) {
|
|
207
|
+
const { tableWithFixedColumnWidthsOption = false, stickyScrollbar } = getEditorFeatureFlags();
|
|
208
|
+
|
|
209
|
+
if (isTableScalingEnabled && !tableWithFixedColumnWidthsOption) {
|
|
211
210
|
this.handleColgroupUpdates(true);
|
|
212
211
|
}
|
|
213
212
|
|
|
214
213
|
if (
|
|
215
214
|
isTableScalingEnabled &&
|
|
216
|
-
|
|
215
|
+
tableWithFixedColumnWidthsOption &&
|
|
217
216
|
getNode().attrs.displayMode !== 'fixed'
|
|
218
217
|
) {
|
|
219
218
|
this.handleColgroupUpdates(true);
|
|
@@ -224,8 +223,6 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
224
223
|
passive: true,
|
|
225
224
|
});
|
|
226
225
|
|
|
227
|
-
const { stickyScrollbar } = getEditorFeatureFlags();
|
|
228
|
-
|
|
229
226
|
if (stickyScrollbar) {
|
|
230
227
|
if (this.table) {
|
|
231
228
|
this.stickyScrollbar = new TableStickyScrollbar(this.wrapper, this.props.view);
|
|
@@ -332,7 +329,7 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
332
329
|
};
|
|
333
330
|
|
|
334
331
|
handleColgroupUpdates(force = false) {
|
|
335
|
-
const { getNode, containerWidth, isResizing, view, getPos } = this.props;
|
|
332
|
+
const { getNode, containerWidth, isResizing, view, getPos, getEditorFeatureFlags } = this.props;
|
|
336
333
|
|
|
337
334
|
if (!this.table) {
|
|
338
335
|
return;
|
|
@@ -383,12 +380,13 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
383
380
|
isNumberColumnChanged ||
|
|
384
381
|
isNumberOfColumnsChanged;
|
|
385
382
|
|
|
386
|
-
const
|
|
387
|
-
|
|
388
|
-
|
|
383
|
+
const { tableWithFixedColumnWidthsOption = false } = getEditorFeatureFlags();
|
|
384
|
+
|
|
385
|
+
const isTableScalingWithFixedColumnWidthsOptionEnabled =
|
|
386
|
+
this.props.options?.isTableScalingEnabled && tableWithFixedColumnWidthsOption;
|
|
389
387
|
|
|
390
388
|
const shouldUseIncreasedScalingPercent =
|
|
391
|
-
(
|
|
389
|
+
(isTableScalingWithFixedColumnWidthsOptionEnabled &&
|
|
392
390
|
getBooleanFF('platform.editor.table.use-increased-scaling-percent')) ||
|
|
393
391
|
false;
|
|
394
392
|
|
|
@@ -405,14 +403,14 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
405
403
|
});
|
|
406
404
|
|
|
407
405
|
let shouldScaleOnColgroupUpdate = false;
|
|
408
|
-
if (
|
|
409
|
-
this.props.options?.isTableScalingEnabled &&
|
|
410
|
-
!getBooleanFF('platform.editor.table.preserve-widths-with-lock-button')
|
|
411
|
-
) {
|
|
406
|
+
if (this.props.options?.isTableScalingEnabled && !tableWithFixedColumnWidthsOption) {
|
|
412
407
|
shouldScaleOnColgroupUpdate = true;
|
|
413
408
|
}
|
|
414
409
|
|
|
415
|
-
if (
|
|
410
|
+
if (
|
|
411
|
+
isTableScalingWithFixedColumnWidthsOptionEnabled &&
|
|
412
|
+
tableNode.attrs.displayMode !== 'fixed'
|
|
413
|
+
) {
|
|
416
414
|
shouldScaleOnColgroupUpdate = true;
|
|
417
415
|
}
|
|
418
416
|
|
|
@@ -443,6 +441,7 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
443
441
|
options,
|
|
444
442
|
isTableScalingEnabled, // we could use options.isTableScalingEnabled here
|
|
445
443
|
getPos,
|
|
444
|
+
getEditorFeatureFlags,
|
|
446
445
|
} = this.props;
|
|
447
446
|
let { isInDanger } = this.props;
|
|
448
447
|
|
|
@@ -455,23 +454,23 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
455
454
|
|
|
456
455
|
let shouldScale = false;
|
|
457
456
|
let shouldHandleColgroupUpdates = false;
|
|
457
|
+
const { tableWithFixedColumnWidthsOption = false } = getEditorFeatureFlags();
|
|
458
458
|
|
|
459
|
-
if (
|
|
460
|
-
isTableScalingEnabled &&
|
|
461
|
-
!getBooleanFF('platform.editor.table.preserve-widths-with-lock-button')
|
|
462
|
-
) {
|
|
459
|
+
if (isTableScalingEnabled && !tableWithFixedColumnWidthsOption) {
|
|
463
460
|
shouldScale = true;
|
|
464
461
|
shouldHandleColgroupUpdates = true;
|
|
465
462
|
}
|
|
466
463
|
|
|
467
|
-
const
|
|
468
|
-
isTableScalingEnabled &&
|
|
469
|
-
getBooleanFF('platform.editor.table.preserve-widths-with-lock-button');
|
|
464
|
+
const isTableScalingWithFixedColumnWidthsOptionEnabled =
|
|
465
|
+
isTableScalingEnabled && tableWithFixedColumnWidthsOption;
|
|
470
466
|
const shouldUseIncreasedScalingPercent =
|
|
471
|
-
|
|
467
|
+
isTableScalingWithFixedColumnWidthsOptionEnabled &&
|
|
472
468
|
getBooleanFF('platform.editor.table.use-increased-scaling-percent');
|
|
473
469
|
|
|
474
|
-
if (
|
|
470
|
+
if (
|
|
471
|
+
isTableScalingWithFixedColumnWidthsOptionEnabled &&
|
|
472
|
+
getNode().attrs.displayMode !== 'fixed'
|
|
473
|
+
) {
|
|
475
474
|
shouldScale = true;
|
|
476
475
|
shouldHandleColgroupUpdates = true;
|
|
477
476
|
}
|
|
@@ -743,11 +742,11 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
743
742
|
: this.state.stickyHeader &&
|
|
744
743
|
this.state.stickyHeader.top + this.state.stickyHeader.padding + shadowPadding + 2;
|
|
745
744
|
|
|
746
|
-
const { stickyScrollbar } = getEditorFeatureFlags();
|
|
745
|
+
const { stickyScrollbar, tableWithFixedColumnWidthsOption = false } = getEditorFeatureFlags();
|
|
747
746
|
|
|
748
747
|
const shouldUseIncreasedScalingPercent =
|
|
749
748
|
isTableScalingEnabled &&
|
|
750
|
-
|
|
749
|
+
tableWithFixedColumnWidthsOption &&
|
|
751
750
|
getBooleanFF('platform.editor.table.use-increased-scaling-percent');
|
|
752
751
|
|
|
753
752
|
return (
|
|
@@ -770,6 +769,7 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
770
769
|
isTableResizingEnabled={options?.isTableResizingEnabled}
|
|
771
770
|
isResizing={isResizing}
|
|
772
771
|
isTableScalingEnabled={isTableScalingEnabled}
|
|
772
|
+
isTableWithFixedColumnWidthsOptionEnabled={tableWithFixedColumnWidthsOption}
|
|
773
773
|
isWholeTableInDanger={isWholeTableInDanger}
|
|
774
774
|
isTableAlignmentEnabled={isTableAlignmentEnabled}
|
|
775
775
|
shouldUseIncreasedScalingPercent={shouldUseIncreasedScalingPercent}
|
|
@@ -171,6 +171,7 @@ type ResizableTableContainerProps = {
|
|
|
171
171
|
isWholeTableInDanger?: boolean;
|
|
172
172
|
|
|
173
173
|
isTableScalingEnabled?: boolean;
|
|
174
|
+
isTableWithFixedColumnWidthsOptionEnabled?: boolean;
|
|
174
175
|
isTableAlignmentEnabled?: boolean;
|
|
175
176
|
shouldUseIncreasedScalingPercent?: boolean;
|
|
176
177
|
};
|
|
@@ -190,6 +191,7 @@ export const ResizableTableContainer = React.memo(
|
|
|
190
191
|
tableWrapperHeight,
|
|
191
192
|
isWholeTableInDanger,
|
|
192
193
|
isTableScalingEnabled,
|
|
194
|
+
isTableWithFixedColumnWidthsOptionEnabled,
|
|
193
195
|
isTableAlignmentEnabled,
|
|
194
196
|
shouldUseIncreasedScalingPercent,
|
|
195
197
|
}: PropsWithChildren<ResizableTableContainerProps>) => {
|
|
@@ -319,6 +321,7 @@ export const ResizableTableContainer = React.memo(
|
|
|
319
321
|
isTableAlignmentEnabled,
|
|
320
322
|
isFullWidthModeEnabled,
|
|
321
323
|
isTableScalingEnabled,
|
|
324
|
+
isTableWithFixedColumnWidthsOptionEnabled,
|
|
322
325
|
isWholeTableInDanger,
|
|
323
326
|
shouldUseIncreasedScalingPercent,
|
|
324
327
|
pluginInjectionApi,
|
|
@@ -385,6 +388,7 @@ type TableContainerProps = {
|
|
|
385
388
|
|
|
386
389
|
isTableResizingEnabled: boolean | undefined;
|
|
387
390
|
isTableScalingEnabled?: boolean;
|
|
391
|
+
isTableWithFixedColumnWidthsOptionEnabled?: boolean;
|
|
388
392
|
isTableAlignmentEnabled?: boolean;
|
|
389
393
|
shouldUseIncreasedScalingPercent?: boolean;
|
|
390
394
|
};
|
|
@@ -404,6 +408,7 @@ export const TableContainer = ({
|
|
|
404
408
|
isWholeTableInDanger,
|
|
405
409
|
isTableResizingEnabled,
|
|
406
410
|
isTableScalingEnabled,
|
|
411
|
+
isTableWithFixedColumnWidthsOptionEnabled,
|
|
407
412
|
isTableAlignmentEnabled,
|
|
408
413
|
shouldUseIncreasedScalingPercent,
|
|
409
414
|
}: PropsWithChildren<TableContainerProps>) => {
|
|
@@ -422,6 +427,7 @@ export const TableContainer = ({
|
|
|
422
427
|
isResizing={isResizing}
|
|
423
428
|
pluginInjectionApi={pluginInjectionApi}
|
|
424
429
|
isTableScalingEnabled={isTableScalingEnabled}
|
|
430
|
+
isTableWithFixedColumnWidthsOptionEnabled={isTableWithFixedColumnWidthsOptionEnabled}
|
|
425
431
|
isWholeTableInDanger={isWholeTableInDanger}
|
|
426
432
|
isTableAlignmentEnabled={isTableAlignmentEnabled}
|
|
427
433
|
shouldUseIncreasedScalingPercent={shouldUseIncreasedScalingPercent}
|
|
@@ -22,7 +22,7 @@ import { chainCommands } from '@atlaskit/editor-prosemirror/commands';
|
|
|
22
22
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
23
23
|
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
24
24
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
25
|
-
import {
|
|
25
|
+
import { akEditorGutterPaddingDynamic } from '@atlaskit/editor-shared-styles';
|
|
26
26
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
27
27
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
28
28
|
import { token } from '@atlaskit/tokens';
|
|
@@ -78,6 +78,7 @@ interface TableResizerProps {
|
|
|
78
78
|
displayGapCursor: (toggle: boolean) => boolean;
|
|
79
79
|
pluginInjectionApi?: PluginInjectionAPI;
|
|
80
80
|
isTableScalingEnabled?: boolean;
|
|
81
|
+
isTableWithFixedColumnWidthsOptionEnabled?: boolean;
|
|
81
82
|
isTableAlignmentEnabled?: boolean;
|
|
82
83
|
isWholeTableInDanger?: boolean;
|
|
83
84
|
isFullWidthModeEnabled?: boolean;
|
|
@@ -162,7 +163,7 @@ const getVisibleGuidelines = (
|
|
|
162
163
|
|
|
163
164
|
guidelineVisibleAdjustment = isFullWidthModeEnabled
|
|
164
165
|
? preserve_table_widths_adjustment // guidelineVisibleAdjustment = -2, if lineLength = 1180, 1181 < 1180 + 2 is true.
|
|
165
|
-
: -2 *
|
|
166
|
+
: -2 * akEditorGutterPaddingDynamic() + preserve_table_widths_adjustment; // guidelineVisibleAdjustment = -62, if containerWidth is 1244, 1181 < 1244 - 62 = 1182 is true.
|
|
166
167
|
}
|
|
167
168
|
const width = isTableScalingEnabled && isFullWidthModeEnabled ? lineLength : containerWidth;
|
|
168
169
|
|
|
@@ -193,6 +194,7 @@ export const TableResizer = ({
|
|
|
193
194
|
attachAnalyticsEvent,
|
|
194
195
|
displayGapCursor,
|
|
195
196
|
isTableScalingEnabled,
|
|
197
|
+
isTableWithFixedColumnWidthsOptionEnabled,
|
|
196
198
|
isTableAlignmentEnabled,
|
|
197
199
|
isWholeTableInDanger,
|
|
198
200
|
shouldUseIncreasedScalingPercent,
|
|
@@ -236,7 +238,9 @@ export const TableResizer = ({
|
|
|
236
238
|
isTableScalingEnabled
|
|
237
239
|
? defaultGuidelinesForPreserveTable(
|
|
238
240
|
PRESERVE_TABLE_GUIDELINES_LENGTH_OFFSET,
|
|
239
|
-
isFullWidthModeEnabled
|
|
241
|
+
isFullWidthModeEnabled
|
|
242
|
+
? lineLength + 2 * akEditorGutterPaddingDynamic()
|
|
243
|
+
: containerWidth,
|
|
240
244
|
excludeGuidelineConfig,
|
|
241
245
|
)
|
|
242
246
|
: defaultGuidelines,
|
|
@@ -265,7 +269,9 @@ export const TableResizer = ({
|
|
|
265
269
|
x: isTableScalingEnabled
|
|
266
270
|
? defaultTablePreserveSnappingWidths(
|
|
267
271
|
PRESERVE_TABLE_SNAPPING_LENGTH_OFFSET, // was hardcoded to 0, using PRESERVE_TABLE_SNAPPING_LENGTH_OFFSET instead.
|
|
268
|
-
isFullWidthModeEnabled
|
|
272
|
+
isFullWidthModeEnabled
|
|
273
|
+
? lineLength + 2 * akEditorGutterPaddingDynamic()
|
|
274
|
+
: containerWidth,
|
|
269
275
|
excludeGuidelineConfig,
|
|
270
276
|
)
|
|
271
277
|
: defaultSnappingWidths,
|
|
@@ -354,7 +360,9 @@ export const TableResizer = ({
|
|
|
354
360
|
isTableScalingEnabled
|
|
355
361
|
? defaultGuidelinesForPreserveTable(
|
|
356
362
|
PRESERVE_TABLE_GUIDELINES_LENGTH_OFFSET,
|
|
357
|
-
isFullWidthModeEnabled
|
|
363
|
+
isFullWidthModeEnabled
|
|
364
|
+
? lineLength + 2 * akEditorGutterPaddingDynamic()
|
|
365
|
+
: containerWidth,
|
|
358
366
|
excludeGuidelineConfig,
|
|
359
367
|
)
|
|
360
368
|
: defaultGuidelines,
|
|
@@ -407,10 +415,11 @@ export const TableResizer = ({
|
|
|
407
415
|
},
|
|
408
416
|
editorView.domAtPos.bind(editorView),
|
|
409
417
|
isTableScalingEnabled,
|
|
418
|
+
isTableWithFixedColumnWidthsOptionEnabled,
|
|
410
419
|
);
|
|
411
420
|
|
|
412
421
|
const editorContainerWidth = isFullWidthModeEnabled
|
|
413
|
-
? lineLength + 2 *
|
|
422
|
+
? lineLength + 2 * akEditorGutterPaddingDynamic()
|
|
414
423
|
: containerWidth;
|
|
415
424
|
|
|
416
425
|
const closestSnap = findClosestSnap(
|
|
@@ -464,6 +473,7 @@ export const TableResizer = ({
|
|
|
464
473
|
[
|
|
465
474
|
countFrames,
|
|
466
475
|
isTableScalingEnabled,
|
|
476
|
+
isTableWithFixedColumnWidthsOptionEnabled,
|
|
467
477
|
isFullWidthModeEnabled,
|
|
468
478
|
excludeGuidelineConfig,
|
|
469
479
|
tableRef,
|
package/src/nodeviews/table.tsx
CHANGED
|
@@ -92,6 +92,7 @@ export default class TableView extends ReactNodeView<Props> {
|
|
|
92
92
|
eventDispatcher?: EventDispatcher;
|
|
93
93
|
getPos: getPosHandlerNode;
|
|
94
94
|
options;
|
|
95
|
+
getEditorFeatureFlags;
|
|
95
96
|
|
|
96
97
|
constructor(props: Props) {
|
|
97
98
|
super(
|
|
@@ -109,6 +110,7 @@ export default class TableView extends ReactNodeView<Props> {
|
|
|
109
110
|
this.getPos = props.getPos;
|
|
110
111
|
this.eventDispatcher = props.eventDispatcher;
|
|
111
112
|
this.options = props.options;
|
|
113
|
+
this.getEditorFeatureFlags = props.getEditorFeatureFlags;
|
|
112
114
|
}
|
|
113
115
|
|
|
114
116
|
getContentDOM() {
|
|
@@ -126,7 +128,7 @@ export default class TableView extends ReactNodeView<Props> {
|
|
|
126
128
|
if (
|
|
127
129
|
!this.options?.isTableScalingEnabled ||
|
|
128
130
|
(this.options?.isTableScalingEnabled &&
|
|
129
|
-
|
|
131
|
+
this.getEditorFeatureFlags?.().tableWithFixedColumnWidthsOption &&
|
|
130
132
|
this.node.attrs.displayMode === 'fixed')
|
|
131
133
|
) {
|
|
132
134
|
const tableInlineWidth = getInlineWidth(
|
|
@@ -157,7 +159,7 @@ export default class TableView extends ReactNodeView<Props> {
|
|
|
157
159
|
if (
|
|
158
160
|
!this.options?.isTableScalingEnabled ||
|
|
159
161
|
(this.options?.isTableScalingEnabled &&
|
|
160
|
-
|
|
162
|
+
this.getEditorFeatureFlags?.().tableWithFixedColumnWidthsOption &&
|
|
161
163
|
node.attrs.displayMode === 'fixed')
|
|
162
164
|
) {
|
|
163
165
|
// handle inline style when table been resized
|
package/src/plugin.tsx
CHANGED
|
@@ -153,13 +153,15 @@ const tablesPlugin: TablePlugin = ({ config: options, api }) => {
|
|
|
153
153
|
};
|
|
154
154
|
const editorAnalyticsAPI = api?.analytics?.actions;
|
|
155
155
|
|
|
156
|
-
const
|
|
157
|
-
options?.
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
isTableScalingWithFixedColumnWidthsOptionEnabled &&
|
|
156
|
+
const isTableFixedColumnWidthsOptionEnabled =
|
|
157
|
+
options?.getEditorFeatureFlags?.().tableWithFixedColumnWidthsOption || false;
|
|
158
|
+
const shouldUseIncreasedScalingPercent = options?.isTableScalingEnabled;
|
|
159
|
+
isTableFixedColumnWidthsOptionEnabled &&
|
|
161
160
|
getBooleanFF('platform.editor.table.use-increased-scaling-percent');
|
|
162
161
|
|
|
162
|
+
const isCellBackgroundDuplicated =
|
|
163
|
+
options?.getEditorFeatureFlags?.().tableDuplicateCellColouring || false;
|
|
164
|
+
|
|
163
165
|
return {
|
|
164
166
|
name: 'table',
|
|
165
167
|
|
|
@@ -331,6 +333,8 @@ const tablesPlugin: TablePlugin = ({ config: options, api }) => {
|
|
|
331
333
|
fullWidthEnabled,
|
|
332
334
|
api,
|
|
333
335
|
getIntl,
|
|
336
|
+
isCellBackgroundDuplicated,
|
|
337
|
+
isTableFixedColumnWidthsOptionEnabled,
|
|
334
338
|
shouldUseIncreasedScalingPercent,
|
|
335
339
|
);
|
|
336
340
|
},
|
|
@@ -371,7 +375,12 @@ const tablesPlugin: TablePlugin = ({ config: options, api }) => {
|
|
|
371
375
|
name: 'tableDragAndDrop',
|
|
372
376
|
plugin: ({ dispatch }) => {
|
|
373
377
|
return options?.dragAndDropEnabled
|
|
374
|
-
? createDragAndDropPlugin(
|
|
378
|
+
? createDragAndDropPlugin(
|
|
379
|
+
dispatch,
|
|
380
|
+
editorAnalyticsAPI,
|
|
381
|
+
options?.isTableScalingEnabled,
|
|
382
|
+
isTableFixedColumnWidthsOptionEnabled,
|
|
383
|
+
)
|
|
375
384
|
: undefined;
|
|
376
385
|
},
|
|
377
386
|
},
|
|
@@ -533,6 +542,7 @@ const tablesPlugin: TablePlugin = ({ config: options, api }) => {
|
|
|
533
542
|
isHeaderColumnEnabled={isHeaderColumnEnabled}
|
|
534
543
|
isHeaderRowEnabled={isHeaderRowEnabled}
|
|
535
544
|
isDragAndDropEnabled={isDragAndDropEnabled}
|
|
545
|
+
isTableScalingEnabled={options?.isTableScalingEnabled}
|
|
536
546
|
editorView={editorView}
|
|
537
547
|
mountPoint={popupsMountPoint}
|
|
538
548
|
boundariesElement={popupsBoundariesElement}
|
|
@@ -662,7 +672,7 @@ const tablesPlugin: TablePlugin = ({ config: options, api }) => {
|
|
|
662
672
|
options?.getEditorFeatureFlags || defaultGetEditorFeatureFlags,
|
|
663
673
|
() => editorViewRef.current,
|
|
664
674
|
options,
|
|
665
|
-
|
|
675
|
+
isTableFixedColumnWidthsOptionEnabled,
|
|
666
676
|
shouldUseIncreasedScalingPercent,
|
|
667
677
|
)(pluginConfig(options?.tableOptions)),
|
|
668
678
|
},
|