@atlaskit/editor-plugin-table 9.2.0 → 9.3.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.
- package/CHANGELOG.md +18 -0
- package/dist/cjs/nodeviews/TableCell.js +0 -2
- package/dist/cjs/nodeviews/TableContainer.js +13 -2
- package/dist/cjs/nodeviews/TableNodeViewBase.js +0 -2
- package/dist/cjs/nodeviews/TableResizer.js +5 -10
- package/dist/cjs/nodeviews/TableRow.js +0 -2
- package/dist/cjs/nodeviews/lazy-node-views.js +4 -16
- package/dist/cjs/nodeviews/table.js +2 -8
- package/dist/cjs/pm-plugins/commands/column-resize.js +1 -4
- package/dist/cjs/pm-plugins/commands/commands-with-analytics.js +4 -16
- package/dist/cjs/pm-plugins/commands/insert.js +4 -19
- package/dist/cjs/pm-plugins/commands/misc.js +3 -12
- package/dist/cjs/pm-plugins/decorations/plugin.js +1 -6
- package/dist/cjs/pm-plugins/decorations/utils/column-resizing.js +1 -4
- package/dist/cjs/pm-plugins/drag-and-drop/commands-with-analytics.js +3 -12
- package/dist/cjs/pm-plugins/drag-and-drop/commands.js +3 -12
- package/dist/cjs/pm-plugins/drag-and-drop/plugin.js +1 -4
- package/dist/cjs/pm-plugins/keymap.js +0 -2
- package/dist/cjs/pm-plugins/main.js +1 -6
- package/dist/cjs/pm-plugins/table-resizing/event-handlers.js +1 -4
- package/dist/cjs/pm-plugins/table-resizing/plugin.js +0 -2
- package/dist/cjs/pm-plugins/table-resizing/utils/colgroup.js +1 -7
- package/dist/cjs/pm-plugins/table-resizing/utils/column-state.js +1 -4
- package/dist/cjs/pm-plugins/table-resizing/utils/content-width.js +0 -8
- package/dist/cjs/pm-plugins/table-resizing/utils/resize-logic.js +2 -10
- package/dist/cjs/pm-plugins/table-resizing/utils/resize-state.js +1 -4
- package/dist/cjs/pm-plugins/table-width.js +1 -6
- package/dist/cjs/pm-plugins/transforms/column-width.js +1 -4
- package/dist/cjs/pm-plugins/transforms/fix-tables.js +3 -15
- package/dist/cjs/pm-plugins/transforms/replace-table.js +1 -4
- package/dist/cjs/pm-plugins/transforms/split.js +0 -2
- package/dist/cjs/pm-plugins/utils/alignment.js +1 -4
- package/dist/cjs/pm-plugins/utils/decoration.js +4 -16
- package/dist/cjs/pm-plugins/utils/drag-menu.js +1 -4
- package/dist/cjs/pm-plugins/utils/nodes.js +0 -3
- package/dist/cjs/pm-plugins/utils/paste.js +4 -0
- package/dist/cjs/pm-plugins/utils/row-controls.js +1 -4
- package/dist/cjs/tablePlugin.js +12 -10
- package/dist/cjs/ui/FloatingInsertButton/getPopupOptions.js +0 -6
- package/dist/cjs/ui/TableFloatingColumnControls/ColumnControls/index.js +1 -4
- package/dist/cjs/ui/TableFloatingControls/RowControls/DragControls.js +1 -4
- package/dist/cjs/ui/TableFloatingControls/index.js +1 -4
- package/dist/cjs/ui/toolbar.js +3 -12
- package/dist/es2019/nodeviews/TableCell.js +0 -2
- package/dist/es2019/nodeviews/TableContainer.js +13 -2
- package/dist/es2019/nodeviews/TableNodeViewBase.js +0 -2
- package/dist/es2019/nodeviews/TableResizer.js +5 -10
- package/dist/es2019/nodeviews/TableRow.js +0 -2
- package/dist/es2019/nodeviews/lazy-node-views.js +4 -16
- package/dist/es2019/nodeviews/table.js +2 -8
- package/dist/es2019/pm-plugins/commands/column-resize.js +1 -4
- package/dist/es2019/pm-plugins/commands/commands-with-analytics.js +6 -24
- package/dist/es2019/pm-plugins/commands/delete.js +1 -4
- package/dist/es2019/pm-plugins/commands/insert.js +5 -23
- package/dist/es2019/pm-plugins/commands/misc.js +3 -12
- package/dist/es2019/pm-plugins/decorations/plugin.js +1 -6
- package/dist/es2019/pm-plugins/decorations/utils/column-resizing.js +1 -4
- package/dist/es2019/pm-plugins/drag-and-drop/commands-with-analytics.js +3 -12
- package/dist/es2019/pm-plugins/drag-and-drop/commands.js +4 -16
- package/dist/es2019/pm-plugins/drag-and-drop/plugin.js +2 -8
- package/dist/es2019/pm-plugins/keymap.js +0 -3
- package/dist/es2019/pm-plugins/main.js +1 -6
- package/dist/es2019/pm-plugins/table-resizing/event-handlers.js +1 -4
- package/dist/es2019/pm-plugins/table-resizing/plugin.js +0 -3
- package/dist/es2019/pm-plugins/table-resizing/utils/colgroup.js +2 -11
- package/dist/es2019/pm-plugins/table-resizing/utils/column-state.js +1 -4
- package/dist/es2019/pm-plugins/table-resizing/utils/content-width.js +0 -8
- package/dist/es2019/pm-plugins/table-resizing/utils/resize-column.js +1 -4
- package/dist/es2019/pm-plugins/table-resizing/utils/resize-logic.js +2 -10
- package/dist/es2019/pm-plugins/table-resizing/utils/resize-state.js +2 -8
- package/dist/es2019/pm-plugins/table-resizing/utils/scale-table.js +4 -16
- package/dist/es2019/pm-plugins/table-width.js +1 -6
- package/dist/es2019/pm-plugins/transforms/column-width.js +2 -8
- package/dist/es2019/pm-plugins/transforms/delete-columns.js +1 -4
- package/dist/es2019/pm-plugins/transforms/fix-tables.js +3 -15
- package/dist/es2019/pm-plugins/transforms/replace-table.js +1 -4
- package/dist/es2019/pm-plugins/transforms/split.js +0 -2
- package/dist/es2019/pm-plugins/utils/alignment.js +1 -4
- package/dist/es2019/pm-plugins/utils/decoration.js +4 -16
- package/dist/es2019/pm-plugins/utils/drag-menu.js +2 -8
- package/dist/es2019/pm-plugins/utils/nodes.js +0 -3
- package/dist/es2019/pm-plugins/utils/paste.js +5 -4
- package/dist/es2019/pm-plugins/utils/row-controls.js +1 -4
- package/dist/es2019/pm-plugins/utils/snapping.js +1 -4
- package/dist/es2019/tablePlugin.js +12 -10
- package/dist/es2019/ui/FloatingInsertButton/getPopupOptions.js +0 -6
- package/dist/es2019/ui/TableFloatingColumnControls/ColumnControls/index.js +1 -4
- package/dist/es2019/ui/TableFloatingControls/RowControls/DragControls.js +1 -4
- package/dist/es2019/ui/TableFloatingControls/index.js +1 -5
- package/dist/es2019/ui/event-handlers.js +1 -4
- package/dist/es2019/ui/toolbar.js +9 -36
- package/dist/esm/nodeviews/TableCell.js +0 -2
- package/dist/esm/nodeviews/TableContainer.js +13 -2
- package/dist/esm/nodeviews/TableNodeViewBase.js +0 -2
- package/dist/esm/nodeviews/TableResizer.js +5 -10
- package/dist/esm/nodeviews/TableRow.js +0 -2
- package/dist/esm/nodeviews/lazy-node-views.js +4 -16
- package/dist/esm/nodeviews/table.js +2 -8
- package/dist/esm/pm-plugins/commands/column-resize.js +1 -4
- package/dist/esm/pm-plugins/commands/commands-with-analytics.js +4 -16
- package/dist/esm/pm-plugins/commands/insert.js +4 -19
- package/dist/esm/pm-plugins/commands/misc.js +3 -12
- package/dist/esm/pm-plugins/decorations/plugin.js +1 -6
- package/dist/esm/pm-plugins/decorations/utils/column-resizing.js +1 -4
- package/dist/esm/pm-plugins/drag-and-drop/commands-with-analytics.js +3 -12
- package/dist/esm/pm-plugins/drag-and-drop/commands.js +3 -12
- package/dist/esm/pm-plugins/drag-and-drop/plugin.js +1 -4
- package/dist/esm/pm-plugins/keymap.js +0 -3
- package/dist/esm/pm-plugins/main.js +1 -6
- package/dist/esm/pm-plugins/table-resizing/event-handlers.js +1 -4
- package/dist/esm/pm-plugins/table-resizing/plugin.js +0 -3
- package/dist/esm/pm-plugins/table-resizing/utils/colgroup.js +1 -7
- package/dist/esm/pm-plugins/table-resizing/utils/column-state.js +1 -4
- package/dist/esm/pm-plugins/table-resizing/utils/content-width.js +0 -8
- package/dist/esm/pm-plugins/table-resizing/utils/resize-logic.js +2 -10
- package/dist/esm/pm-plugins/table-resizing/utils/resize-state.js +1 -4
- package/dist/esm/pm-plugins/table-width.js +1 -6
- package/dist/esm/pm-plugins/transforms/column-width.js +1 -4
- package/dist/esm/pm-plugins/transforms/fix-tables.js +3 -15
- package/dist/esm/pm-plugins/transforms/replace-table.js +1 -4
- package/dist/esm/pm-plugins/transforms/split.js +0 -2
- package/dist/esm/pm-plugins/utils/alignment.js +1 -4
- package/dist/esm/pm-plugins/utils/decoration.js +4 -16
- package/dist/esm/pm-plugins/utils/drag-menu.js +1 -4
- package/dist/esm/pm-plugins/utils/nodes.js +0 -3
- package/dist/esm/pm-plugins/utils/paste.js +4 -0
- package/dist/esm/pm-plugins/utils/row-controls.js +1 -4
- package/dist/esm/tablePlugin.js +12 -10
- package/dist/esm/ui/FloatingInsertButton/getPopupOptions.js +0 -6
- package/dist/esm/ui/TableFloatingColumnControls/ColumnControls/index.js +1 -4
- package/dist/esm/ui/TableFloatingControls/RowControls/DragControls.js +1 -4
- package/dist/esm/ui/TableFloatingControls/index.js +1 -4
- package/dist/esm/ui/toolbar.js +3 -12
- package/dist/types/nodeviews/TableResizer.d.ts +2 -1
- package/dist/types-ts4.5/nodeviews/TableResizer.d.ts +2 -1
- package/package.json +11 -5
- package/src/nodeviews/TableCell.ts +0 -2
- package/src/nodeviews/TableComponent.tsx +1 -1
- package/src/nodeviews/TableContainer.tsx +12 -1
- package/src/nodeviews/TableNodeViewBase.ts +0 -2
- package/src/nodeviews/TableResizer.tsx +9 -5
- package/src/nodeviews/TableRow.ts +0 -2
- package/src/nodeviews/lazy-node-views.ts +0 -8
- package/src/nodeviews/table.tsx +0 -4
- package/src/pm-plugins/commands/column-resize.ts +0 -2
- package/src/pm-plugins/commands/commands-with-analytics.ts +0 -12
- package/src/pm-plugins/commands/delete.ts +0 -2
- package/src/pm-plugins/commands/insert.ts +0 -12
- package/src/pm-plugins/commands/misc.ts +0 -6
- package/src/pm-plugins/decorations/plugin.ts +0 -4
- package/src/pm-plugins/decorations/utils/column-resizing.ts +0 -2
- package/src/pm-plugins/drag-and-drop/commands-with-analytics.ts +0 -6
- package/src/pm-plugins/drag-and-drop/commands.ts +0 -8
- package/src/pm-plugins/drag-and-drop/plugin.ts +0 -4
- package/src/pm-plugins/keymap.ts +0 -2
- package/src/pm-plugins/main.ts +0 -4
- package/src/pm-plugins/table-resizing/event-handlers.ts +0 -2
- package/src/pm-plugins/table-resizing/plugin.ts +0 -2
- package/src/pm-plugins/table-resizing/utils/colgroup.ts +0 -6
- package/src/pm-plugins/table-resizing/utils/column-state.ts +0 -2
- package/src/pm-plugins/table-resizing/utils/content-width.ts +0 -6
- package/src/pm-plugins/table-resizing/utils/resize-column.ts +0 -2
- package/src/pm-plugins/table-resizing/utils/resize-logic.ts +0 -6
- package/src/pm-plugins/table-resizing/utils/resize-state.ts +0 -4
- package/src/pm-plugins/table-resizing/utils/scale-table.ts +0 -8
- package/src/pm-plugins/table-width.ts +0 -4
- package/src/pm-plugins/transforms/column-width.ts +0 -4
- package/src/pm-plugins/transforms/delete-columns.ts +0 -2
- package/src/pm-plugins/transforms/fix-tables.ts +0 -8
- package/src/pm-plugins/transforms/replace-table.ts +0 -2
- package/src/pm-plugins/transforms/split.ts +0 -2
- package/src/pm-plugins/utils/alignment.ts +0 -2
- package/src/pm-plugins/utils/decoration.ts +0 -8
- package/src/pm-plugins/utils/drag-menu.ts +0 -4
- package/src/pm-plugins/utils/nodes.ts +0 -2
- package/src/pm-plugins/utils/paste.ts +4 -2
- package/src/pm-plugins/utils/row-controls.ts +0 -2
- package/src/pm-plugins/utils/snapping.ts +0 -2
- package/src/tablePlugin.tsx +7 -2
- package/src/ui/FloatingInsertButton/getPopupOptions.ts +0 -4
- package/src/ui/TableFloatingColumnControls/ColumnControls/index.tsx +1 -3
- package/src/ui/TableFloatingColumnControls/index.tsx +1 -1
- package/src/ui/TableFloatingControls/RowControls/DragControls.tsx +0 -2
- package/src/ui/TableFloatingControls/index.tsx +1 -5
- package/src/ui/event-handlers.ts +0 -2
- package/src/ui/toolbar.tsx +0 -18
|
@@ -240,8 +240,6 @@ export const changeColumnWidthByStepWithAnalytics =
|
|
|
240
240
|
inputMethod: INPUT_METHOD.SHORTCUT,
|
|
241
241
|
ariaNotify?: (message: string) => void,
|
|
242
242
|
getIntl?: () => IntlShape,
|
|
243
|
-
// Ignored via go/ees005
|
|
244
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
245
243
|
) =>
|
|
246
244
|
withEditorAnalyticsAPI((state) => {
|
|
247
245
|
const { table, totalRowCount, totalColumnCount } = getSelectedTableInfo(state.selection);
|
|
@@ -284,8 +282,6 @@ export const insertColumnWithAnalytics =
|
|
|
284
282
|
isTableFixedColumnWidthsOptionEnabled = false,
|
|
285
283
|
shouldUseIncreasedScalingPercent = false,
|
|
286
284
|
isCommentEditor = false,
|
|
287
|
-
// Ignored via go/ees005
|
|
288
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
289
285
|
) =>
|
|
290
286
|
(
|
|
291
287
|
inputMethod:
|
|
@@ -363,8 +359,6 @@ export const deleteColumnsWithAnalytics =
|
|
|
363
359
|
isTableFixedColumnWidthsOptionEnabled = false,
|
|
364
360
|
shouldUseIncreasedScalingPercent = false,
|
|
365
361
|
isCommentEditor = false,
|
|
366
|
-
// Ignored via go/ees005
|
|
367
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
368
362
|
) =>
|
|
369
363
|
(
|
|
370
364
|
inputMethod:
|
|
@@ -409,8 +403,6 @@ export const deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut =
|
|
|
409
403
|
isTableScalingEnabled?: boolean,
|
|
410
404
|
isTableFixedColumnWidthsOptionEnabled?: boolean,
|
|
411
405
|
shouldUseIncreasedScalingPercent?: boolean,
|
|
412
|
-
// Ignored via go/ees005
|
|
413
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
414
406
|
): Command =>
|
|
415
407
|
(state, dispatch) => {
|
|
416
408
|
const { selection } = state;
|
|
@@ -659,8 +651,6 @@ export const setTableAlignmentWithAnalytics =
|
|
|
659
651
|
previousAlignment: TableLayout,
|
|
660
652
|
inputMethod: INPUT_METHOD.FLOATING_TB,
|
|
661
653
|
reason: CHANGE_ALIGNMENT_REASON,
|
|
662
|
-
// Ignored via go/ees005
|
|
663
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
664
654
|
) =>
|
|
665
655
|
withEditorAnalyticsAPI((state) => {
|
|
666
656
|
const { table, totalRowCount, totalColumnCount } = getSelectedTableInfo(state.selection);
|
|
@@ -695,8 +685,6 @@ export const setTableAlignmentWithTableContentWithPosWithAnalytics =
|
|
|
695
685
|
tableNodeWithPos: NodeWithPos,
|
|
696
686
|
inputMethod: INPUT_METHOD.AUTO,
|
|
697
687
|
reason: CHANGE_ALIGNMENT_REASON,
|
|
698
|
-
// Ignored via go/ees005
|
|
699
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
700
688
|
) =>
|
|
701
689
|
withEditorAnalyticsAPI(() => {
|
|
702
690
|
const map = TableMap.get(tableNodeWithPos.node);
|
|
@@ -13,8 +13,6 @@ export const deleteColumnsCommand =
|
|
|
13
13
|
isTableFixedColumnWidthsOptionEnabled = false,
|
|
14
14
|
shouldUseIncreasedScalingPercent = false,
|
|
15
15
|
isCommentEditor = false,
|
|
16
|
-
// Ignored via go/ees005
|
|
17
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
18
16
|
): Command =>
|
|
19
17
|
(state, dispatch, view) => {
|
|
20
18
|
const tr = deleteColumns(
|
|
@@ -64,8 +64,6 @@ function addColumnAtCustomStep(column: number) {
|
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
// Ignored via go/ees005
|
|
68
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
69
67
|
export function addColumnAt(
|
|
70
68
|
api: PluginInjectionAPI | undefined | null,
|
|
71
69
|
isTableScalingEnabled = false,
|
|
@@ -125,8 +123,6 @@ export const addColumnBefore =
|
|
|
125
123
|
isTableFixedColumnWidthsOptionEnabled = false,
|
|
126
124
|
shouldUseIncreasedScalingPercent = false,
|
|
127
125
|
isCommentEditor = false,
|
|
128
|
-
// Ignored via go/ees005
|
|
129
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
130
126
|
): Command =>
|
|
131
127
|
(state, dispatch, view) => {
|
|
132
128
|
const table = findTable(state.selection);
|
|
@@ -161,8 +157,6 @@ export const addColumnAfter =
|
|
|
161
157
|
isTableFixedColumnWidthsOptionEnabled?: boolean,
|
|
162
158
|
shouldUseIncreasedScalingPercent?: boolean,
|
|
163
159
|
isCommentEditor?: boolean,
|
|
164
|
-
// Ignored via go/ees005
|
|
165
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
166
160
|
): Command =>
|
|
167
161
|
(state, dispatch, view) => {
|
|
168
162
|
const table = findTable(state.selection);
|
|
@@ -196,8 +190,6 @@ export const insertColumn =
|
|
|
196
190
|
isTableFixedColumnWidthsOptionEnabled?: boolean,
|
|
197
191
|
shouldUseIncreasedScalingPercent?: boolean,
|
|
198
192
|
isCommentEditor?: boolean,
|
|
199
|
-
// Ignored via go/ees005
|
|
200
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
201
193
|
) =>
|
|
202
194
|
(column: number): Command =>
|
|
203
195
|
(state, dispatch, view) => {
|
|
@@ -282,8 +274,6 @@ export const createTable =
|
|
|
282
274
|
isCommentEditor?: boolean,
|
|
283
275
|
isChromelessEditor?: boolean,
|
|
284
276
|
isTableResizingEnabled?: boolean,
|
|
285
|
-
// Ignored via go/ees005
|
|
286
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
287
277
|
): Command =>
|
|
288
278
|
(state, dispatch) => {
|
|
289
279
|
const table = createTableWithWidth({
|
|
@@ -325,8 +315,6 @@ export const insertTableWithSize =
|
|
|
325
315
|
editorAnalyticsAPI?: EditorAnalyticsAPI,
|
|
326
316
|
isCommentEditor?: boolean,
|
|
327
317
|
isChromelessEditor?: boolean,
|
|
328
|
-
// Ignored via go/ees005
|
|
329
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
330
318
|
) =>
|
|
331
319
|
(rowsCount: number, colsCount: number, inputMethod?: INPUT_METHOD.PICKER): EditorCommand => {
|
|
332
320
|
return ({ tr }) => {
|
|
@@ -578,8 +578,6 @@ export const addResizeHandleDecorations = (
|
|
|
578
578
|
includeTooltip: boolean,
|
|
579
579
|
nodeViewPortalProviderAPI: PortalProviderAPI,
|
|
580
580
|
isKeyboardResize?: boolean,
|
|
581
|
-
// Ignored via go/ees005
|
|
582
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
583
581
|
) =>
|
|
584
582
|
createCommand(
|
|
585
583
|
(state) => {
|
|
@@ -621,8 +619,6 @@ export const updateResizeHandleDecorations = (
|
|
|
621
619
|
rowIndex?: number,
|
|
622
620
|
columnIndex?: number,
|
|
623
621
|
includeTooltip?: boolean,
|
|
624
|
-
// Ignored via go/ees005
|
|
625
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
626
622
|
) =>
|
|
627
623
|
createCommand(
|
|
628
624
|
(state) => {
|
|
@@ -693,8 +689,6 @@ export const autoSizeTable = (
|
|
|
693
689
|
table: HTMLTableElement,
|
|
694
690
|
basePos: number | undefined,
|
|
695
691
|
opts: { containerWidth: number },
|
|
696
|
-
// Ignored via go/ees005
|
|
697
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
698
692
|
) => {
|
|
699
693
|
if (typeof basePos !== 'number') {
|
|
700
694
|
return false;
|
|
@@ -26,8 +26,6 @@ export const handleDocOrSelectionChanged = (
|
|
|
26
26
|
decorationSet: DecorationSet,
|
|
27
27
|
oldState: EditorState,
|
|
28
28
|
newState: EditorState,
|
|
29
|
-
// Ignored via go/ees005
|
|
30
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
31
29
|
): DecorationSet => {
|
|
32
30
|
const isResizing = tableWidthPluginKey.getState(newState)?.resizing;
|
|
33
31
|
const wasResizing = tableWidthPluginKey.getState(oldState)?.resizing;
|
|
@@ -64,8 +62,6 @@ export const createPlugin = () => {
|
|
|
64
62
|
state: {
|
|
65
63
|
init: () => DecorationSet.empty,
|
|
66
64
|
|
|
67
|
-
// Ignored via go/ees005
|
|
68
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
69
65
|
apply: (tr, decorationSet, oldState, newState) => {
|
|
70
66
|
let pluginState = decorationSet;
|
|
71
67
|
// main table plugin --->
|
|
@@ -38,8 +38,6 @@ export const buildColumnResizingDecorations =
|
|
|
38
38
|
includeTooltip: boolean,
|
|
39
39
|
getIntl: () => IntlShape,
|
|
40
40
|
nodeViewPortalProviderAPI: PortalProviderAPI,
|
|
41
|
-
// Ignored via go/ees005
|
|
42
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
43
41
|
): DecorationTransformer =>
|
|
44
42
|
({ tr, decorationSet }): DecorationSet => {
|
|
45
43
|
const [columnResizesDecorations, lastCellElementsDecorations] =
|
|
@@ -30,8 +30,6 @@ export const clearDropTargetWithAnalytics =
|
|
|
30
30
|
sourceIndexes: number[] | undefined,
|
|
31
31
|
status: TABLE_STATUS.CANCELLED | TABLE_STATUS.INVALID,
|
|
32
32
|
tr?: Transaction,
|
|
33
|
-
// Ignored via go/ees005
|
|
34
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
35
33
|
) => {
|
|
36
34
|
return withEditorAnalyticsAPI(({ selection }: EditorState) => {
|
|
37
35
|
const { totalRowCount, totalColumnCount } = getSelectedTableInfo(selection);
|
|
@@ -72,8 +70,6 @@ export const moveSourceWithAnalytics =
|
|
|
72
70
|
sourceIndexes: number[],
|
|
73
71
|
targetIndex: number,
|
|
74
72
|
tr?: Transaction,
|
|
75
|
-
// Ignored via go/ees005
|
|
76
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
77
73
|
) => {
|
|
78
74
|
return withEditorAnalyticsAPI(({ selection }: EditorState) => {
|
|
79
75
|
const direction = sourceIndexes[0] > targetIndex ? -1 : 1;
|
|
@@ -194,8 +190,6 @@ export const cloneSourceWithAnalytics =
|
|
|
194
190
|
targetIndex: number,
|
|
195
191
|
targetDirection: 'start' | 'end',
|
|
196
192
|
tr?: Transaction,
|
|
197
|
-
// Ignored via go/ees005
|
|
198
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
199
193
|
) => {
|
|
200
194
|
return withEditorAnalyticsAPI(({ selection }: EditorState) => {
|
|
201
195
|
const direction = sourceIndexes[0] > targetIndex ? -1 : 1;
|
|
@@ -33,8 +33,6 @@ export const setDropTarget = (
|
|
|
33
33
|
index: number,
|
|
34
34
|
hasMergedCells: boolean,
|
|
35
35
|
tr?: Transaction,
|
|
36
|
-
// Ignored via go/ees005
|
|
37
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
38
36
|
) =>
|
|
39
37
|
createCommand(
|
|
40
38
|
(state) => {
|
|
@@ -92,8 +90,6 @@ export const moveSource = (
|
|
|
92
90
|
sourceIndexes: number[],
|
|
93
91
|
targetIndex: number,
|
|
94
92
|
tr?: Transaction,
|
|
95
|
-
// Ignored via go/ees005
|
|
96
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
97
93
|
) =>
|
|
98
94
|
createCommand(
|
|
99
95
|
(state) => {
|
|
@@ -121,8 +117,6 @@ export const toggleDragMenu = (
|
|
|
121
117
|
direction?: TableDirection,
|
|
122
118
|
index?: number,
|
|
123
119
|
trigger: TriggerType = 'mouse',
|
|
124
|
-
// Ignored via go/ees005
|
|
125
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
126
120
|
) =>
|
|
127
121
|
createCommand(
|
|
128
122
|
(state) => {
|
|
@@ -180,8 +174,6 @@ export const cloneSource = (
|
|
|
180
174
|
targetIndex: number,
|
|
181
175
|
targetDirection: 'start' | 'end',
|
|
182
176
|
tr?: Transaction,
|
|
183
|
-
// Ignored via go/ees005
|
|
184
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
185
177
|
) =>
|
|
186
178
|
createCommand(
|
|
187
179
|
(state) => {
|
|
@@ -37,8 +37,6 @@ const destroyFn = (
|
|
|
37
37
|
isTableScalingEnabled: boolean,
|
|
38
38
|
isTableFixedColumnWidthsOptionEnabled: boolean,
|
|
39
39
|
isCommentEditor: boolean,
|
|
40
|
-
// Ignored via go/ees005
|
|
41
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
42
40
|
) => {
|
|
43
41
|
const editorPageScrollContainer = document.querySelector('.fabric-editor-popup-scroll-parent');
|
|
44
42
|
|
|
@@ -265,8 +263,6 @@ export const createPlugin = (
|
|
|
265
263
|
isTableScalingEnabled = false,
|
|
266
264
|
isTableFixedColumnWidthsOptionEnabled = false,
|
|
267
265
|
isCommentEditor = false,
|
|
268
|
-
// Ignored via go/ees005
|
|
269
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
270
266
|
) => {
|
|
271
267
|
return new SafePlugin({
|
|
272
268
|
state: createPluginState(dispatch, (state) => ({
|
package/src/pm-plugins/keymap.ts
CHANGED
|
@@ -67,8 +67,6 @@ import {
|
|
|
67
67
|
insertTableWithNestingSupport,
|
|
68
68
|
} from './commands/insert';
|
|
69
69
|
|
|
70
|
-
// Ignored via go/ees005
|
|
71
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
72
70
|
export function keymapPlugin(
|
|
73
71
|
getEditorContainerWidth: GetEditorContainerWidth,
|
|
74
72
|
api: PluginInjectionAPI | undefined | null,
|
package/src/pm-plugins/main.ts
CHANGED
|
@@ -98,8 +98,6 @@ export const createPlugin = (
|
|
|
98
98
|
shouldUseIncreasedScalingPercent?: boolean,
|
|
99
99
|
isCommentEditor?: boolean,
|
|
100
100
|
isChromelessEditor?: boolean,
|
|
101
|
-
// Ignored via go/ees005
|
|
102
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
103
101
|
) => {
|
|
104
102
|
const state = createPluginState(dispatch, {
|
|
105
103
|
pluginConfig,
|
|
@@ -355,8 +353,6 @@ export const createPlugin = (
|
|
|
355
353
|
const maybeTr = closestElement(domRef as HTMLElement | undefined, 'tr');
|
|
356
354
|
return maybeTr ? maybeTr.classList.contains('sticky') : false;
|
|
357
355
|
},
|
|
358
|
-
// Ignored via go/ees005
|
|
359
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
360
356
|
handleTextInput: (view, _from, _to, text) => {
|
|
361
357
|
const { state, dispatch } = view;
|
|
362
358
|
const { isKeyboardResize } = getPluginState(state);
|
|
@@ -47,8 +47,6 @@ export const handleMouseDown = (
|
|
|
47
47
|
nodeViewPortalProviderAPI: PortalProviderAPI,
|
|
48
48
|
editorAnalyticsAPI?: EditorAnalyticsAPI,
|
|
49
49
|
isCommentEditor?: boolean,
|
|
50
|
-
// Ignored via go/ees005
|
|
51
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
52
50
|
): boolean => {
|
|
53
51
|
const { state, dispatch } = view;
|
|
54
52
|
const editorDisabled = !view.editable;
|
|
@@ -16,8 +16,6 @@ import { createPluginState, getPluginState } from './plugin-factory';
|
|
|
16
16
|
import { pluginKey } from './plugin-key';
|
|
17
17
|
import { getResizeCellPos } from './utils/dom';
|
|
18
18
|
|
|
19
|
-
// Ignored via go/ees005
|
|
20
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
21
19
|
export function createPlugin(
|
|
22
20
|
dispatch: Dispatch<ColumnResizingPluginState>,
|
|
23
21
|
{ lastColumnResizable = true }: ColumnResizingPluginState,
|
|
@@ -23,8 +23,6 @@ export const generateColgroup = (
|
|
|
23
23
|
tableRef?: HTMLElement,
|
|
24
24
|
shouldUseIncreasedScalingPercent?: boolean,
|
|
25
25
|
isCommentEditor?: boolean,
|
|
26
|
-
// Ignored via go/ees005
|
|
27
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
28
26
|
) => {
|
|
29
27
|
const cols: Col[] = [];
|
|
30
28
|
const map = TableMap.get(table);
|
|
@@ -93,8 +91,6 @@ export const insertColgroupFromNode = (
|
|
|
93
91
|
shouldRemove = true,
|
|
94
92
|
shouldUseIncreasedScalingPercent = false,
|
|
95
93
|
isCommentEditor = false,
|
|
96
|
-
// Ignored via go/ees005
|
|
97
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
98
94
|
): HTMLCollection => {
|
|
99
95
|
// Ignored via go/ees005
|
|
100
96
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
@@ -146,8 +142,6 @@ export const isMinCellWidthTable = (table: PmNode) => {
|
|
|
146
142
|
return isTableMinCellWidth;
|
|
147
143
|
};
|
|
148
144
|
|
|
149
|
-
// Ignored via go/ees005
|
|
150
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
151
145
|
function renderColgroupFromNode(
|
|
152
146
|
table: PmNode,
|
|
153
147
|
maybeTableRef: HTMLElement | undefined,
|
|
@@ -43,8 +43,6 @@ export const getCellsRefsInColumn = (
|
|
|
43
43
|
table: PMNode,
|
|
44
44
|
tableStart: number,
|
|
45
45
|
domAtPos: (pos: number) => { node: Node; offset: number },
|
|
46
|
-
// Ignored via go/ees005
|
|
47
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
48
46
|
): HTMLElement[] => {
|
|
49
47
|
const map = TableMap.get(table);
|
|
50
48
|
const cellsPositions = map.cellsInRect({
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { unitToNumber } from './unit-to-number';
|
|
2
2
|
|
|
3
3
|
// calculates content width of a cell
|
|
4
|
-
// Ignored via go/ees005
|
|
5
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
6
4
|
export function contentWidth(
|
|
7
5
|
elem: HTMLElement,
|
|
8
6
|
container: HTMLElement,
|
|
@@ -12,8 +10,6 @@ export function contentWidth(
|
|
|
12
10
|
return calcContentWidth(elem, container || elem, canvas, colWidths);
|
|
13
11
|
}
|
|
14
12
|
|
|
15
|
-
// Ignored via go/ees005
|
|
16
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
17
13
|
function calcContentWidth(
|
|
18
14
|
elem: HTMLElement,
|
|
19
15
|
container: HTMLElement,
|
|
@@ -95,8 +91,6 @@ function measureText(canvas: HTMLCanvasElement, text: string | null, font: strin
|
|
|
95
91
|
return Math.round(ctx.measureText(text || '').width);
|
|
96
92
|
}
|
|
97
93
|
|
|
98
|
-
// Ignored via go/ees005
|
|
99
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
100
94
|
function handlePreText(
|
|
101
95
|
canvas: HTMLCanvasElement,
|
|
102
96
|
node: HTMLElement,
|
|
@@ -14,8 +14,6 @@ export const resizeColumn = (
|
|
|
14
14
|
selectedColumns?: number[],
|
|
15
15
|
isTableScalingEnabled = false,
|
|
16
16
|
scalePercent = 1,
|
|
17
|
-
// Ignored via go/ees005
|
|
18
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
19
17
|
): ResizeState => {
|
|
20
18
|
let resizeAmount = amount;
|
|
21
19
|
|
|
@@ -8,8 +8,6 @@ export const growColumn = (
|
|
|
8
8
|
colIndex: number,
|
|
9
9
|
amount: number,
|
|
10
10
|
selectedColumns?: number[],
|
|
11
|
-
// Ignored via go/ees005
|
|
12
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
13
11
|
): ResizeState => {
|
|
14
12
|
// can't grow if columns don't exist or it's the last column
|
|
15
13
|
if (!state.cols[colIndex] || !state.cols[colIndex + 1]) {
|
|
@@ -34,8 +32,6 @@ export const shrinkColumn = (
|
|
|
34
32
|
colIndex: number,
|
|
35
33
|
amount: number,
|
|
36
34
|
selectedColumns?: number[],
|
|
37
|
-
// Ignored via go/ees005
|
|
38
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
39
35
|
): ResizeState => {
|
|
40
36
|
// can't shrink if columns don't exist
|
|
41
37
|
if (!state.cols[colIndex]) {
|
|
@@ -119,8 +115,6 @@ enum ColType {
|
|
|
119
115
|
|
|
120
116
|
// TODO: should handle when destIdx:
|
|
121
117
|
// - is beyond the range, and then not give it back
|
|
122
|
-
// Ignored via go/ees005
|
|
123
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
124
118
|
function moveSpaceFrom(
|
|
125
119
|
state: ResizeState,
|
|
126
120
|
srcIdx: number,
|
|
@@ -117,8 +117,6 @@ export const updateColgroup = (
|
|
|
117
117
|
tableNode?: PMNode,
|
|
118
118
|
isTableScalingEnabled?: boolean,
|
|
119
119
|
scalePercent?: number,
|
|
120
|
-
// Ignored via go/ees005
|
|
121
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
122
120
|
): void => {
|
|
123
121
|
const cols = tableRef?.querySelectorAll('col');
|
|
124
122
|
const columnsCount = cols?.length;
|
|
@@ -328,8 +326,6 @@ export const getNewResizeStateFromSelectedColumns = (
|
|
|
328
326
|
isTableScalingEnabled = false,
|
|
329
327
|
isTableFixedColumnWidthsOptionEnabled = false,
|
|
330
328
|
isCommentEditor = false,
|
|
331
|
-
// Ignored via go/ees005
|
|
332
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
333
329
|
): ResizeStateWithAnalytics | undefined => {
|
|
334
330
|
// Fail early so that we don't do complex calculations for no reason
|
|
335
331
|
const numColumnsSelected = rect.right - rect.left;
|
|
@@ -42,8 +42,6 @@ const scale = (
|
|
|
42
42
|
isTableScalingEnabledOnCurrentTable = false,
|
|
43
43
|
shouldUseIncreasedScalingPercent = false,
|
|
44
44
|
isCommentEditor = false,
|
|
45
|
-
// Ignored via go/ees005
|
|
46
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
47
45
|
): ResizeState | undefined => {
|
|
48
46
|
const {
|
|
49
47
|
node,
|
|
@@ -109,8 +107,6 @@ const scaleWithParent = (
|
|
|
109
107
|
isTableScalingEnabledOnCurrentTable = false,
|
|
110
108
|
shouldUseIncreasedScalingPercent = false,
|
|
111
109
|
isCommentEditor = false,
|
|
112
|
-
// Ignored via go/ees005
|
|
113
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
114
110
|
) => {
|
|
115
111
|
const resizeState = getResizeState({
|
|
116
112
|
minWidth: tableCellMinWidth,
|
|
@@ -163,8 +159,6 @@ export const previewScaleTable = (
|
|
|
163
159
|
isTableScalingEnabled: boolean = false,
|
|
164
160
|
isTableWithFixedColumnWidthsOptionEnabled: boolean = false,
|
|
165
161
|
isCommentEditor: boolean = false,
|
|
166
|
-
// Ignored via go/ees005
|
|
167
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
168
162
|
) => {
|
|
169
163
|
const { node, start, parentWidth } = options;
|
|
170
164
|
|
|
@@ -225,8 +219,6 @@ export const scaleTable =
|
|
|
225
219
|
isTableScalingEnabledOnCurrentTable = false,
|
|
226
220
|
shouldUseIncreasedScalingPercent = false,
|
|
227
221
|
isCommentEditor = false,
|
|
228
|
-
// Ignored via go/ees005
|
|
229
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
230
222
|
) =>
|
|
231
223
|
(tr: Transaction) => {
|
|
232
224
|
if (!tableRef) {
|
|
@@ -40,8 +40,6 @@ const createPlugin = (
|
|
|
40
40
|
isTableScalingEnabled: boolean,
|
|
41
41
|
isTableAlignmentEnabled: boolean,
|
|
42
42
|
isCommentEditor: boolean,
|
|
43
|
-
// Ignored via go/ees005
|
|
44
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
45
43
|
) => {
|
|
46
44
|
return new SafePlugin({
|
|
47
45
|
key: pluginKey,
|
|
@@ -159,8 +157,6 @@ const createPlugin = (
|
|
|
159
157
|
|
|
160
158
|
if (referentialityTr) {
|
|
161
159
|
referentialityTr.steps.forEach((step) => {
|
|
162
|
-
// Ignored via go/ees005
|
|
163
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
164
160
|
step.getMap().forEach((_, __, newStart, newEnd) => {
|
|
165
161
|
newState.doc.nodesBetween(newStart, newEnd, (node, pos) => {
|
|
166
162
|
if (node.type === table) {
|
|
@@ -28,8 +28,6 @@ export const updateColumnWidths =
|
|
|
28
28
|
table: PMNode,
|
|
29
29
|
start: number,
|
|
30
30
|
api: PluginInjectionAPI | undefined | null,
|
|
31
|
-
// Ignored via go/ees005
|
|
32
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
33
31
|
) =>
|
|
34
32
|
(tr: Transaction): Transaction => {
|
|
35
33
|
const map = TableMap.get(table);
|
|
@@ -134,8 +132,6 @@ export const rescaleColumns =
|
|
|
134
132
|
shouldUseIncreasedScalingPercent = false,
|
|
135
133
|
api: PluginInjectionAPI | undefined | null,
|
|
136
134
|
isCommentEditor = false,
|
|
137
|
-
// Ignored via go/ees005
|
|
138
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
139
135
|
) =>
|
|
140
136
|
(table: ContentNodeWithPos, view: EditorView | undefined) =>
|
|
141
137
|
(tr: Transaction): Transaction => {
|
|
@@ -252,8 +252,6 @@ export const deleteColumns =
|
|
|
252
252
|
isTableFixedColumnWidthsOptionEnabled = false,
|
|
253
253
|
shouldUseIncreasedScalingPercent = false,
|
|
254
254
|
isCommentEditor = false,
|
|
255
|
-
// Ignored via go/ees005
|
|
256
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
257
255
|
) =>
|
|
258
256
|
(tr: Transaction) => {
|
|
259
257
|
let updatedTr = tr;
|
|
@@ -50,8 +50,6 @@ export const removeExtraneousColumnWidths = (
|
|
|
50
50
|
basePos: number,
|
|
51
51
|
tr: Transaction,
|
|
52
52
|
reportInvalidTableCellSpanAttrs?: ReportInvalidNodeAttrs,
|
|
53
|
-
// Ignored via go/ees005
|
|
54
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
55
53
|
): boolean => {
|
|
56
54
|
let hasProblems = false;
|
|
57
55
|
|
|
@@ -126,8 +124,6 @@ export const fixAutoSizedTable = (
|
|
|
126
124
|
tableRef: HTMLTableElement,
|
|
127
125
|
tablePos: number,
|
|
128
126
|
opts: { containerWidth: number },
|
|
129
|
-
// Ignored via go/ees005
|
|
130
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
131
127
|
): Transaction => {
|
|
132
128
|
let { tr } = view.state;
|
|
133
129
|
const domAtPos = view.domAtPos.bind(view);
|
|
@@ -179,8 +175,6 @@ const getLayoutBasedOnWidth = (totalWidth: number) => {
|
|
|
179
175
|
}
|
|
180
176
|
};
|
|
181
177
|
|
|
182
|
-
// Ignored via go/ees005
|
|
183
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
184
178
|
function parseDOMColumnWidths(
|
|
185
179
|
domAtPos: (pos: number) => { node: Node; offset: number },
|
|
186
180
|
tableNode: PMNode,
|
|
@@ -220,8 +214,6 @@ const replaceCells = (
|
|
|
220
214
|
table: PMNode,
|
|
221
215
|
tablePos: number,
|
|
222
216
|
modifyCell: (cell: PMNode, rowIndex: number, colIndex: number) => PMNode,
|
|
223
|
-
// Ignored via go/ees005
|
|
224
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
225
217
|
): Transaction => {
|
|
226
218
|
const rows: PMNode[] = [];
|
|
227
219
|
let modifiedCells = 0;
|
|
@@ -12,8 +12,6 @@ export const replaceSelectedTable = (
|
|
|
12
12
|
content: string | Slice,
|
|
13
13
|
inputMethod: INPUT_METHOD.KEYBOARD | INPUT_METHOD.CLIPBOARD,
|
|
14
14
|
editorAnalyticsAPI?: EditorAnalyticsAPI,
|
|
15
|
-
// Ignored via go/ees005
|
|
16
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
17
15
|
): Transaction => {
|
|
18
16
|
if (isTableSelected(state.selection)) {
|
|
19
17
|
const table = findTable(state.selection);
|
|
@@ -10,8 +10,6 @@ import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
|
10
10
|
* @param columnStart - Start of the rect included (rect.left)
|
|
11
11
|
* @param columnEnd - End of the rect not included (rect.right)
|
|
12
12
|
*/
|
|
13
|
-
// Ignored via go/ees005
|
|
14
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
15
13
|
export function splitCellsInColumns(
|
|
16
14
|
tr: Transaction,
|
|
17
15
|
tablePos: number,
|
|
@@ -22,8 +22,6 @@ export const shouldChangeAlignmentToCenterResized = (
|
|
|
22
22
|
tableNode: PmNode,
|
|
23
23
|
lineLength: number | undefined,
|
|
24
24
|
updatedTableWidth: number,
|
|
25
|
-
// Ignored via go/ees005
|
|
26
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
27
25
|
) =>
|
|
28
26
|
Boolean(
|
|
29
27
|
isTableAlignmentEnabled &&
|
|
@@ -57,8 +57,6 @@ export const createControlsHoverDecoration = (
|
|
|
57
57
|
hoveredIndexes: number[],
|
|
58
58
|
danger?: boolean,
|
|
59
59
|
selected?: boolean,
|
|
60
|
-
// Ignored via go/ees005
|
|
61
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
62
60
|
): Decoration[] => {
|
|
63
61
|
const table = findTable(tr.selection);
|
|
64
62
|
if (!table) {
|
|
@@ -224,8 +222,6 @@ export const updateDecorations = (
|
|
|
224
222
|
decorationSet: DecorationSet,
|
|
225
223
|
decorations: Decoration[],
|
|
226
224
|
key: TableDecorations,
|
|
227
|
-
// Ignored via go/ees005
|
|
228
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
229
225
|
): DecorationSet => {
|
|
230
226
|
const filteredDecorations = filterDecorationByKey(key, decorationSet);
|
|
231
227
|
const decorationSetFiltered = decorationSet.remove(filteredDecorations);
|
|
@@ -320,8 +316,6 @@ export const createResizeHandleDecoration = (
|
|
|
320
316
|
includeTooltip: boolean = false,
|
|
321
317
|
getIntl: () => IntlShape,
|
|
322
318
|
nodeViewPortalProviderAPI: PortalProviderAPI,
|
|
323
|
-
// Ignored via go/ees005
|
|
324
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
325
319
|
): [Decoration[], Decoration[]] => {
|
|
326
320
|
const emptyResult: [Decoration[], Decoration[]] = [[], []];
|
|
327
321
|
const table = findTable(tr.selection);
|
|
@@ -340,8 +334,6 @@ export const createResizeHandleDecoration = (
|
|
|
340
334
|
rowIndex: number,
|
|
341
335
|
cellPos: number,
|
|
342
336
|
cellNode: PmNode,
|
|
343
|
-
// Ignored via go/ees005
|
|
344
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
345
337
|
): Decoration => {
|
|
346
338
|
const decorationRenderKey = uuid();
|
|
347
339
|
const position = cellPos + cellNode.nodeSize - 1;
|
|
@@ -85,8 +85,6 @@ export const canMove = (
|
|
|
85
85
|
totalItemsOfSourceTypeCount: number,
|
|
86
86
|
selection: Selection,
|
|
87
87
|
selectionRect?: Rect,
|
|
88
|
-
// Ignored via go/ees005
|
|
89
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
90
88
|
) => {
|
|
91
89
|
if (!selectionRect) {
|
|
92
90
|
return false;
|
|
@@ -174,8 +172,6 @@ export const getDragMenuConfig = (
|
|
|
174
172
|
ariaLiveElementAttributes?: AriaLiveElementAttributes,
|
|
175
173
|
) => void,
|
|
176
174
|
isCommentEditor = false,
|
|
177
|
-
// Ignored via go/ees005
|
|
178
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
179
175
|
): DragMenuConfig[] => {
|
|
180
176
|
const { selection } = editorView.state;
|
|
181
177
|
const { getIntl } = getTablePluginState(editorView.state);
|
|
@@ -94,8 +94,6 @@ export const tablesHaveDifferentNoOfRows = (
|
|
|
94
94
|
return prevMap.height !== currentMap.height;
|
|
95
95
|
};
|
|
96
96
|
|
|
97
|
-
// Ignored via go/ees005
|
|
98
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
99
97
|
function filterNearSelection<T, U>(
|
|
100
98
|
selection: Selection,
|
|
101
99
|
findNode: (selection: Selection) => { pos: number; node: PmNode } | undefined,
|
|
@@ -4,6 +4,7 @@ import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
|
4
4
|
import { Slice, Fragment, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
5
|
import type { EditorState, Selection } from '@atlaskit/editor-prosemirror/state';
|
|
6
6
|
import { flatten, hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
7
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
8
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
8
9
|
|
|
9
10
|
import { getPluginState } from '../plugin-factory';
|
|
@@ -17,6 +18,9 @@ export const unwrapContentFromTable = (maybeTable: PMNode): PMNode | PMNode[] =>
|
|
|
17
18
|
maybeTable.descendants((maybeCell) => {
|
|
18
19
|
if (maybeCell.type === tableCell || maybeCell.type === tableHeader) {
|
|
19
20
|
content.push(...flatten(maybeCell, false).map((child) => child.node));
|
|
21
|
+
if (fg('platform_editor_nested_tables_paste_dupe_fix')) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
20
24
|
}
|
|
21
25
|
return true;
|
|
22
26
|
});
|
|
@@ -33,8 +37,6 @@ const unwrapNestedTables = (
|
|
|
33
37
|
schema: Schema,
|
|
34
38
|
unwrapNestDepth: number,
|
|
35
39
|
currentNestDepth = 0,
|
|
36
|
-
// Ignored via go/ees005
|
|
37
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
38
40
|
): PMNode[] => {
|
|
39
41
|
const flattenNested = (node: PMNode, tableDepth: number) => {
|
|
40
42
|
if (node.type === schema.nodes.table) {
|