@atlaskit/editor-plugin-table 9.2.0 → 9.2.1
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 +10 -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/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/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/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/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
|
@@ -183,10 +183,7 @@ export var insertRowWithAnalytics = function insertRowWithAnalytics(editorAnalyt
|
|
|
183
183
|
};
|
|
184
184
|
};
|
|
185
185
|
export var changeColumnWidthByStepWithAnalytics = function changeColumnWidthByStepWithAnalytics(editorAnalyticsAPI, api) {
|
|
186
|
-
return function (stepSize, getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, isCommentEditor, inputMethod, ariaNotify, getIntl
|
|
187
|
-
// Ignored via go/ees005
|
|
188
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
189
|
-
) {
|
|
186
|
+
return function (stepSize, getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, isCommentEditor, inputMethod, ariaNotify, getIntl) {
|
|
190
187
|
return withEditorAnalyticsAPI(function (state) {
|
|
191
188
|
var _getSelectedTableInfo2 = getSelectedTableInfo(state.selection),
|
|
192
189
|
table = _getSelectedTableInfo2.table,
|
|
@@ -300,10 +297,7 @@ export var deleteColumnsWithAnalytics = function deleteColumnsWithAnalytics(edit
|
|
|
300
297
|
})(editorAnalyticsAPI)(deleteColumnsCommand(rect, api, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor));
|
|
301
298
|
};
|
|
302
299
|
};
|
|
303
|
-
export var deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut = function deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut(editorAnalyticsAPI, api, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent
|
|
304
|
-
// Ignored via go/ees005
|
|
305
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
306
|
-
) {
|
|
300
|
+
export var deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut = function deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut(editorAnalyticsAPI, api, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent) {
|
|
307
301
|
return function (state, dispatch) {
|
|
308
302
|
var selection = state.selection;
|
|
309
303
|
var isCellSelection = selection instanceof CellSelection;
|
|
@@ -514,10 +508,7 @@ export var toggleFixedColumnWidthsOptionAnalytics = function toggleFixedColumnWi
|
|
|
514
508
|
})(editorAnalyticsAPI)(editorCommandToPMCommand(setTableDisplayMode));
|
|
515
509
|
};
|
|
516
510
|
export var setTableAlignmentWithAnalytics = function setTableAlignmentWithAnalytics(editorAnalyticsAPI, isCommentEditor) {
|
|
517
|
-
return function (newAlignment, previousAlignment, inputMethod, reason
|
|
518
|
-
// Ignored via go/ees005
|
|
519
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
520
|
-
) {
|
|
511
|
+
return function (newAlignment, previousAlignment, inputMethod, reason) {
|
|
521
512
|
return withEditorAnalyticsAPI(function (state) {
|
|
522
513
|
var _getSelectedTableInfo13 = getSelectedTableInfo(state.selection),
|
|
523
514
|
table = _getSelectedTableInfo13.table,
|
|
@@ -542,10 +533,7 @@ export var setTableAlignmentWithAnalytics = function setTableAlignmentWithAnalyt
|
|
|
542
533
|
};
|
|
543
534
|
};
|
|
544
535
|
export var setTableAlignmentWithTableContentWithPosWithAnalytics = function setTableAlignmentWithTableContentWithPosWithAnalytics(editorAnalyticsAPI) {
|
|
545
|
-
return function (newAlignment, previousAlignment, tableNodeWithPos, inputMethod, reason
|
|
546
|
-
// Ignored via go/ees005
|
|
547
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
548
|
-
) {
|
|
536
|
+
return function (newAlignment, previousAlignment, tableNodeWithPos, inputMethod, reason) {
|
|
549
537
|
return withEditorAnalyticsAPI(function () {
|
|
550
538
|
var map = TableMap.get(tableNodeWithPos.node);
|
|
551
539
|
var totalRowCount = map.height;
|
|
@@ -27,9 +27,6 @@ function addColumnAtCustomStep(column) {
|
|
|
27
27
|
return tr;
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
|
|
31
|
-
// Ignored via go/ees005
|
|
32
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
33
30
|
export function addColumnAt(api) {
|
|
34
31
|
var isTableScalingEnabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
35
32
|
var isTableFixedColumnWidthsOptionEnabled = arguments.length > 2 ? arguments[2] : undefined;
|
|
@@ -85,10 +82,7 @@ export var addColumnBefore = function addColumnBefore(api) {
|
|
|
85
82
|
|
|
86
83
|
// :: (EditorState, dispatch: ?(tr: Transaction)) → bool
|
|
87
84
|
// Command to add a column after the column with the selection.
|
|
88
|
-
export var addColumnAfter = function addColumnAfter(api, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor
|
|
89
|
-
// Ignored via go/ees005
|
|
90
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
91
|
-
) {
|
|
85
|
+
export var addColumnAfter = function addColumnAfter(api, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor) {
|
|
92
86
|
return function (state, dispatch, view) {
|
|
93
87
|
var table = findTable(state.selection);
|
|
94
88
|
if (!table) {
|
|
@@ -105,10 +99,7 @@ export var insertColumn = function insertColumn(api) {
|
|
|
105
99
|
var isTableScalingEnabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
106
100
|
var isTableFixedColumnWidthsOptionEnabled = arguments.length > 2 ? arguments[2] : undefined;
|
|
107
101
|
var shouldUseIncreasedScalingPercent = arguments.length > 3 ? arguments[3] : undefined;
|
|
108
|
-
var isCommentEditor
|
|
109
|
-
// Ignored via go/ees005
|
|
110
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
111
|
-
= arguments.length > 4 ? arguments[4] : undefined;
|
|
102
|
+
var isCommentEditor = arguments.length > 4 ? arguments[4] : undefined;
|
|
112
103
|
return function (column) {
|
|
113
104
|
return function (state, dispatch, view) {
|
|
114
105
|
var tr = addColumnAt(api, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor)(column, getAllowAddColumnCustomStep(state), view)(state.tr);
|
|
@@ -164,10 +155,7 @@ export var insertRow = function insertRow(row, moveCursorToTheNewRow) {
|
|
|
164
155
|
* @deprecated This function is deprecated - please use insertTableWithNestingSupport instead.
|
|
165
156
|
* (To be removed with feature gate: `platform_editor_use_nested_table_pm_nodes`)
|
|
166
157
|
*/
|
|
167
|
-
export var createTable = function createTable(isTableScalingEnabled, isTableAlignmentEnabled, isFullWidthModeEnabled, editorAnalyticsAPI, isCommentEditor, isChromelessEditor, isTableResizingEnabled
|
|
168
|
-
// Ignored via go/ees005
|
|
169
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
170
|
-
) {
|
|
158
|
+
export var createTable = function createTable(isTableScalingEnabled, isTableAlignmentEnabled, isFullWidthModeEnabled, editorAnalyticsAPI, isCommentEditor, isChromelessEditor, isTableResizingEnabled) {
|
|
171
159
|
return function (state, dispatch) {
|
|
172
160
|
var table = createTableWithWidth({
|
|
173
161
|
isTableScalingEnabled: isTableScalingEnabled,
|
|
@@ -201,10 +189,7 @@ export var createTable = function createTable(isTableScalingEnabled, isTableAlig
|
|
|
201
189
|
* @deprecated This function is deprecated - please use insertTableWithNestingSupport instead.
|
|
202
190
|
* (To be removed with feature gate: `platform_editor_use_nested_table_pm_nodes`)
|
|
203
191
|
*/
|
|
204
|
-
export var insertTableWithSize = function insertTableWithSize(isFullWidthModeEnabled, isTableScalingEnabled, isTableAlignmentEnabled, editorAnalyticsAPI, isCommentEditor, isChromelessEditor
|
|
205
|
-
// Ignored via go/ees005
|
|
206
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
207
|
-
) {
|
|
192
|
+
export var insertTableWithSize = function insertTableWithSize(isFullWidthModeEnabled, isTableScalingEnabled, isTableAlignmentEnabled, editorAnalyticsAPI, isCommentEditor, isChromelessEditor) {
|
|
208
193
|
return function (rowsCount, colsCount, inputMethod) {
|
|
209
194
|
return function (_ref) {
|
|
210
195
|
var tr = _ref.tr;
|
|
@@ -473,10 +473,7 @@ export var hideInsertColumnOrRowButton = function hideInsertColumnOrRowButton()
|
|
|
473
473
|
return tr.setMeta('addToHistory', false);
|
|
474
474
|
});
|
|
475
475
|
};
|
|
476
|
-
export var addResizeHandleDecorations = function addResizeHandleDecorations(rowIndex, columnIndex, includeTooltip, nodeViewPortalProviderAPI, isKeyboardResize
|
|
477
|
-
// Ignored via go/ees005
|
|
478
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
479
|
-
) {
|
|
476
|
+
export var addResizeHandleDecorations = function addResizeHandleDecorations(rowIndex, columnIndex, includeTooltip, nodeViewPortalProviderAPI, isKeyboardResize) {
|
|
480
477
|
return createCommand(function (state) {
|
|
481
478
|
var tableNode = findTable(state.selection);
|
|
482
479
|
var _getPluginState3 = getPluginState(state),
|
|
@@ -502,10 +499,7 @@ export var addResizeHandleDecorations = function addResizeHandleDecorations(rowI
|
|
|
502
499
|
return tr.setMeta('addToHistory', false);
|
|
503
500
|
});
|
|
504
501
|
};
|
|
505
|
-
export var updateResizeHandleDecorations = function updateResizeHandleDecorations(nodeViewPortalProviderAPI, rowIndex, columnIndex, includeTooltip
|
|
506
|
-
// Ignored via go/ees005
|
|
507
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
508
|
-
) {
|
|
502
|
+
export var updateResizeHandleDecorations = function updateResizeHandleDecorations(nodeViewPortalProviderAPI, rowIndex, columnIndex, includeTooltip) {
|
|
509
503
|
return createCommand(function (state) {
|
|
510
504
|
var tableNode = findTable(state.selection);
|
|
511
505
|
var _getPluginState4 = getPluginState(state),
|
|
@@ -554,10 +548,7 @@ export var removeResizeHandleDecorations = function removeResizeHandleDecoration
|
|
|
554
548
|
return tr.setMeta('addToHistory', false);
|
|
555
549
|
});
|
|
556
550
|
};
|
|
557
|
-
export var autoSizeTable = function autoSizeTable(view, node, table, basePos, opts
|
|
558
|
-
// Ignored via go/ees005
|
|
559
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
560
|
-
) {
|
|
551
|
+
export var autoSizeTable = function autoSizeTable(view, node, table, basePos, opts) {
|
|
561
552
|
if (typeof basePos !== 'number') {
|
|
562
553
|
return false;
|
|
563
554
|
}
|
|
@@ -9,10 +9,7 @@ export var pluginKey = new PluginKey('tableDecorationsPlugin');
|
|
|
9
9
|
export var getDecorations = function getDecorations(state) {
|
|
10
10
|
return pluginKey.getState(state);
|
|
11
11
|
};
|
|
12
|
-
export var handleDocOrSelectionChanged = function handleDocOrSelectionChanged(tr, decorationSet, oldState, newState
|
|
13
|
-
// Ignored via go/ees005
|
|
14
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
15
|
-
) {
|
|
12
|
+
export var handleDocOrSelectionChanged = function handleDocOrSelectionChanged(tr, decorationSet, oldState, newState) {
|
|
16
13
|
var _tableWidthPluginKey$, _tableWidthPluginKey$2;
|
|
17
14
|
var isResizing = (_tableWidthPluginKey$ = tableWidthPluginKey.getState(newState)) === null || _tableWidthPluginKey$ === void 0 ? void 0 : _tableWidthPluginKey$.resizing;
|
|
18
15
|
var wasResizing = (_tableWidthPluginKey$2 = tableWidthPluginKey.getState(oldState)) === null || _tableWidthPluginKey$2 === void 0 ? void 0 : _tableWidthPluginKey$2.resizing;
|
|
@@ -49,8 +46,6 @@ export var createPlugin = function createPlugin() {
|
|
|
49
46
|
init: function init() {
|
|
50
47
|
return DecorationSet.empty;
|
|
51
48
|
},
|
|
52
|
-
// Ignored via go/ees005
|
|
53
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
54
49
|
apply: function apply(tr, decorationSet, oldState, newState) {
|
|
55
50
|
var pluginState = decorationSet;
|
|
56
51
|
// main table plugin --->
|
|
@@ -17,10 +17,7 @@ var updateLastCellElement = function updateLastCellElement(lastCellElementsDecor
|
|
|
17
17
|
return updateDecorations(tr.doc, decorationSet, lastCellElementsDecorations, TableDecorations.LAST_CELL_ELEMENT);
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
|
-
export var buildColumnResizingDecorations = function buildColumnResizingDecorations(rowEndIndex, columnEndIndex, includeTooltip, getIntl, nodeViewPortalProviderAPI
|
|
21
|
-
// Ignored via go/ees005
|
|
22
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
23
|
-
) {
|
|
20
|
+
export var buildColumnResizingDecorations = function buildColumnResizingDecorations(rowEndIndex, columnEndIndex, includeTooltip, getIntl, nodeViewPortalProviderAPI) {
|
|
24
21
|
return function (_ref3) {
|
|
25
22
|
var tr = _ref3.tr,
|
|
26
23
|
decorationSet = _ref3.decorationSet;
|
|
@@ -8,10 +8,7 @@ import { canMove, getTargetIndex } from '../utils/drag-menu';
|
|
|
8
8
|
import { getSelectedColumnIndexes, getSelectedRowIndexes } from '../utils/selection';
|
|
9
9
|
import { clearDropTarget, cloneSource, moveSource } from './commands';
|
|
10
10
|
export var clearDropTargetWithAnalytics = function clearDropTargetWithAnalytics(editorAnalyticsAPI) {
|
|
11
|
-
return function (inputMethod, sourceType, sourceIndexes, status, tr
|
|
12
|
-
// Ignored via go/ees005
|
|
13
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
14
|
-
) {
|
|
11
|
+
return function (inputMethod, sourceType, sourceIndexes, status, tr) {
|
|
15
12
|
return withEditorAnalyticsAPI(function (_ref) {
|
|
16
13
|
var _sourceIndexes$length;
|
|
17
14
|
var selection = _ref.selection;
|
|
@@ -41,10 +38,7 @@ export var clearDropTargetWithAnalytics = function clearDropTargetWithAnalytics(
|
|
|
41
38
|
};
|
|
42
39
|
};
|
|
43
40
|
export var moveSourceWithAnalytics = function moveSourceWithAnalytics(editorAnalyticsAPI, ariaNotify, getIntl) {
|
|
44
|
-
return function (inputMethod, sourceType, sourceIndexes, targetIndex, tr
|
|
45
|
-
// Ignored via go/ees005
|
|
46
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
47
|
-
) {
|
|
41
|
+
return function (inputMethod, sourceType, sourceIndexes, targetIndex, tr) {
|
|
48
42
|
return withEditorAnalyticsAPI(function (_ref2) {
|
|
49
43
|
var selection = _ref2.selection;
|
|
50
44
|
var direction = sourceIndexes[0] > targetIndex ? -1 : 1;
|
|
@@ -117,10 +111,7 @@ export var moveSourceWithAnalyticsViaShortcut = function moveSourceWithAnalytics
|
|
|
117
111
|
};
|
|
118
112
|
};
|
|
119
113
|
export var cloneSourceWithAnalytics = function cloneSourceWithAnalytics(editorAnalyticsAPI) {
|
|
120
|
-
return function (inputMethod, sourceType, sourceIndexes, targetIndex, targetDirection, tr
|
|
121
|
-
// Ignored via go/ees005
|
|
122
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
123
|
-
) {
|
|
114
|
+
return function (inputMethod, sourceType, sourceIndexes, targetIndex, targetDirection, tr) {
|
|
124
115
|
return withEditorAnalyticsAPI(function (_ref3) {
|
|
125
116
|
var selection = _ref3.selection;
|
|
126
117
|
var direction = sourceIndexes[0] > targetIndex ? -1 : 1;
|
|
@@ -14,10 +14,7 @@ var getDecorations = function getDecorations(state) {
|
|
|
14
14
|
var updatePluginStateDecorations = function updatePluginStateDecorations(state, decorations, key) {
|
|
15
15
|
return updateDecorations(state.doc, getDecorations(state), decorations, key);
|
|
16
16
|
};
|
|
17
|
-
export var setDropTarget = function setDropTarget(type, index, hasMergedCells, tr
|
|
18
|
-
// Ignored via go/ees005
|
|
19
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
20
|
-
) {
|
|
17
|
+
export var setDropTarget = function setDropTarget(type, index, hasMergedCells, tr) {
|
|
21
18
|
return createCommand(function (state) {
|
|
22
19
|
var _getPluginState = getPluginState(state),
|
|
23
20
|
dropTargetType = _getPluginState.dropTargetType,
|
|
@@ -61,10 +58,7 @@ export var clearDropTarget = function clearDropTarget(tr) {
|
|
|
61
58
|
return (tr || originalTr).setMeta('addToHistory', false);
|
|
62
59
|
});
|
|
63
60
|
};
|
|
64
|
-
export var moveSource = function moveSource(sourceType, sourceIndexes, targetIndex, tr
|
|
65
|
-
// Ignored via go/ees005
|
|
66
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
67
|
-
) {
|
|
61
|
+
export var moveSource = function moveSource(sourceType, sourceIndexes, targetIndex, tr) {
|
|
68
62
|
return createCommand(function (state) {
|
|
69
63
|
return {
|
|
70
64
|
type: DragAndDropActionType.CLEAR_DROP_TARGET,
|
|
@@ -119,10 +113,7 @@ export var toggleDragMenu = function toggleDragMenu(isDragMenuOpen, direction, i
|
|
|
119
113
|
return tr.setMeta('addToHistory', false);
|
|
120
114
|
});
|
|
121
115
|
};
|
|
122
|
-
export var cloneSource = function cloneSource(sourceType, sourceIndexes, targetIndex, targetDirection, tr
|
|
123
|
-
// Ignored via go/ees005
|
|
124
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
125
|
-
) {
|
|
116
|
+
export var cloneSource = function cloneSource(sourceType, sourceIndexes, targetIndex, targetDirection, tr) {
|
|
126
117
|
return createCommand(function (state) {
|
|
127
118
|
return {
|
|
128
119
|
type: DragAndDropActionType.CLEAR_DROP_TARGET,
|
|
@@ -18,10 +18,7 @@ import { DropTargetType } from './consts';
|
|
|
18
18
|
import { createPluginState, getPluginState } from './plugin-factory';
|
|
19
19
|
import { pluginKey } from './plugin-key';
|
|
20
20
|
import { getDraggableDataFromEvent } from './utils/monitor';
|
|
21
|
-
var destroyFn = function destroyFn(editorView, editorAnalyticsAPI, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, isCommentEditor
|
|
22
|
-
// Ignored via go/ees005
|
|
23
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
24
|
-
) {
|
|
21
|
+
var destroyFn = function destroyFn(editorView, editorAnalyticsAPI, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, isCommentEditor) {
|
|
25
22
|
var editorPageScrollContainer = document.querySelector('.fabric-editor-popup-scroll-parent');
|
|
26
23
|
var rowAutoScrollers = editorPageScrollContainer ? [monitorForElements({
|
|
27
24
|
canMonitor: function canMonitor(_ref) {
|
|
@@ -9,9 +9,6 @@ import { goToNextCell, moveCursorBackward, setFocusToCellMenu } from './commands
|
|
|
9
9
|
import { activateNextResizeArea, initiateKeyboardColumnResizing, stopKeyboardColumnResizing } from './commands/column-resize';
|
|
10
10
|
import { addRowAroundSelection, changeColumnWidthByStepWithAnalytics, deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut, deleteTableIfSelectedWithAnalytics, emptyMultipleCellsWithAnalytics } from './commands/commands-with-analytics';
|
|
11
11
|
import { addColumnAfter as addColumnAfterCommand, addColumnBefore as addColumnBeforeCommand, createTable, insertTableWithNestingSupport } from './commands/insert';
|
|
12
|
-
|
|
13
|
-
// Ignored via go/ees005
|
|
14
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
15
12
|
export function keymapPlugin(getEditorContainerWidth, api, nodeViewPortalProviderAPI, editorAnalyticsAPI, dragAndDropEnabled) {
|
|
16
13
|
var _pluginInjectionApi$a;
|
|
17
14
|
var isTableScalingEnabled = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
|
|
@@ -24,10 +24,7 @@ import { fixTables } from './transforms/fix-tables';
|
|
|
24
24
|
import { replaceSelectedTable } from './transforms/replace-table';
|
|
25
25
|
import { findControlsHoverDecoration } from './utils/decoration';
|
|
26
26
|
import { transformSliceToCorrectEmptyTableCells, transformSliceToFixHardBreakProblemOnCopyFromCell, transformSliceToRemoveOpenTable, transformSliceToRemoveNestedTables, isHeaderRowRequired, transformSliceTableLayoutDefaultToCenter } from './utils/paste';
|
|
27
|
-
export var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, nodeViewPortalProviderAPI, eventDispatcher, pluginConfig, getEditorContainerWidth, getEditorFeatureFlags, getIntl, fullWidthModeEnabled, previousFullWidthModeEnabled, dragAndDropEnabled, editorAnalyticsAPI, pluginInjectionApi, isTableScalingEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor
|
|
28
|
-
// Ignored via go/ees005
|
|
29
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
30
|
-
) {
|
|
27
|
+
export var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, nodeViewPortalProviderAPI, eventDispatcher, pluginConfig, getEditorContainerWidth, getEditorFeatureFlags, getIntl, fullWidthModeEnabled, previousFullWidthModeEnabled, dragAndDropEnabled, editorAnalyticsAPI, pluginInjectionApi, isTableScalingEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor) {
|
|
31
28
|
var _accessibilityUtils;
|
|
32
29
|
var state = createPluginState(dispatch, _objectSpread(_objectSpread(_objectSpread({
|
|
33
30
|
pluginConfig: pluginConfig,
|
|
@@ -242,8 +239,6 @@ export var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch
|
|
|
242
239
|
var maybeTr = closestElement(domRef, 'tr');
|
|
243
240
|
return maybeTr ? maybeTr.classList.contains('sticky') : false;
|
|
244
241
|
},
|
|
245
|
-
// Ignored via go/ees005
|
|
246
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
247
242
|
handleTextInput: function handleTextInput(view, _from, _to, text) {
|
|
248
243
|
var state = view.state,
|
|
249
244
|
dispatch = view.dispatch;
|
|
@@ -15,10 +15,7 @@ import { updateControls } from './utils/dom';
|
|
|
15
15
|
import { currentColWidth, getTableMaxWidth, pointsAtCell, getScalingPercentForTableWithoutWidth, getTableScalingPercent } from './utils/misc';
|
|
16
16
|
import { resizeColumn } from './utils/resize-column';
|
|
17
17
|
import { getResizeState } from './utils/resize-state';
|
|
18
|
-
export var handleMouseDown = function handleMouseDown(view, event, localResizeHandlePos, getEditorContainerWidth, getEditorFeatureFlags, isTableScalingEnabled, api, nodeViewPortalProviderAPI, editorAnalyticsAPI, isCommentEditor
|
|
19
|
-
// Ignored via go/ees005
|
|
20
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
21
|
-
) {
|
|
18
|
+
export var handleMouseDown = function handleMouseDown(view, event, localResizeHandlePos, getEditorContainerWidth, getEditorFeatureFlags, isTableScalingEnabled, api, nodeViewPortalProviderAPI, editorAnalyticsAPI, isCommentEditor) {
|
|
22
19
|
var _originalTable$attrs;
|
|
23
20
|
var state = view.state,
|
|
24
21
|
dispatch = view.dispatch;
|
|
@@ -8,9 +8,6 @@ import { handleMouseDown } from './event-handlers';
|
|
|
8
8
|
import { createPluginState, getPluginState } from './plugin-factory';
|
|
9
9
|
import { pluginKey } from './plugin-key';
|
|
10
10
|
import { getResizeCellPos } from './utils/dom';
|
|
11
|
-
|
|
12
|
-
// Ignored via go/ees005
|
|
13
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
14
11
|
export function createPlugin(dispatch, _ref, getEditorContainerWidth, getEditorFeatureFlags, api, nodeViewPortalProviderAPI, editorAnalyticsAPI, isTableScalingEnabled, isCommentEditor) {
|
|
15
12
|
var _ref$lastColumnResiza = _ref.lastColumnResizable,
|
|
16
13
|
lastColumnResizable = _ref$lastColumnResiza === void 0 ? true : _ref$lastColumnResiza;
|
|
@@ -14,10 +14,7 @@ import { getScalingPercentForTableWithoutWidth, getTableScalingPercent } from '.
|
|
|
14
14
|
export var getColWidthFix = function getColWidthFix(colwidth, tableColumnCount) {
|
|
15
15
|
return colwidth - 1 / tableColumnCount;
|
|
16
16
|
};
|
|
17
|
-
export var generateColgroup = function generateColgroup(table, tableRef, shouldUseIncreasedScalingPercent, isCommentEditor
|
|
18
|
-
// Ignored via go/ees005
|
|
19
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
20
|
-
) {
|
|
17
|
+
export var generateColgroup = function generateColgroup(table, tableRef, shouldUseIncreasedScalingPercent, isCommentEditor) {
|
|
21
18
|
var cols = [];
|
|
22
19
|
var map = TableMap.get(table);
|
|
23
20
|
|
|
@@ -108,9 +105,6 @@ export var isMinCellWidthTable = function isMinCellWidthTable(table) {
|
|
|
108
105
|
});
|
|
109
106
|
return isTableMinCellWidth;
|
|
110
107
|
};
|
|
111
|
-
|
|
112
|
-
// Ignored via go/ees005
|
|
113
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
114
108
|
function renderColgroupFromNode(table, maybeTableRef, shouldUseIncreasedScalingPercent, isCommentEditor) {
|
|
115
109
|
var rendered = DOMSerializer.renderSpec(document, ['colgroup', {}].concat(_toConsumableArray(generateColgroup(table, maybeTableRef, shouldUseIncreasedScalingPercent, isCommentEditor))));
|
|
116
110
|
|
|
@@ -20,10 +20,7 @@ export var getFreeSpace = function getFreeSpace(state) {
|
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
// Returns DOM refs of all cells in a column by `columnIndex`
|
|
23
|
-
export var getCellsRefsInColumn = function getCellsRefsInColumn(columnIndex, table, tableStart, domAtPos
|
|
24
|
-
// Ignored via go/ees005
|
|
25
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
26
|
-
) {
|
|
23
|
+
export var getCellsRefsInColumn = function getCellsRefsInColumn(columnIndex, table, tableStart, domAtPos) {
|
|
27
24
|
var map = TableMap.get(table);
|
|
28
25
|
var cellsPositions = map.cellsInRect({
|
|
29
26
|
left: columnIndex,
|
|
@@ -1,16 +1,11 @@
|
|
|
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(elem, container) {
|
|
7
5
|
var colWidths = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
8
6
|
var canvas = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : document.createElement('canvas');
|
|
9
7
|
return calcContentWidth(elem, container || elem, canvas, colWidths);
|
|
10
8
|
}
|
|
11
|
-
|
|
12
|
-
// Ignored via go/ees005
|
|
13
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
14
9
|
function calcContentWidth(elem, container, canvas, colWidths) {
|
|
15
10
|
var flowWidths = [];
|
|
16
11
|
var curWidth = 0;
|
|
@@ -80,9 +75,6 @@ function measureText(canvas, text, font) {
|
|
|
80
75
|
}
|
|
81
76
|
return Math.round(ctx.measureText(text || '').width);
|
|
82
77
|
}
|
|
83
|
-
|
|
84
|
-
// Ignored via go/ees005
|
|
85
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
86
78
|
function handlePreText(canvas, node, textContent, font) {
|
|
87
79
|
var parent = node;
|
|
88
80
|
if (node.nodeName === 'CODE') {
|
|
@@ -4,10 +4,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
5
|
import { getFreeSpace } from './column-state';
|
|
6
6
|
import { bulkColumnsResize, getTotalWidth } from './resize-state';
|
|
7
|
-
export var growColumn = function growColumn(state, colIndex, amount, selectedColumns
|
|
8
|
-
// Ignored via go/ees005
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
10
|
-
) {
|
|
7
|
+
export var growColumn = function growColumn(state, colIndex, amount, selectedColumns) {
|
|
11
8
|
// can't grow if columns don't exist or it's the last column
|
|
12
9
|
if (!state.cols[colIndex] || !state.cols[colIndex + 1]) {
|
|
13
10
|
return state;
|
|
@@ -23,10 +20,7 @@ export var growColumn = function growColumn(state, colIndex, amount, selectedCol
|
|
|
23
20
|
}
|
|
24
21
|
return newState;
|
|
25
22
|
};
|
|
26
|
-
export var shrinkColumn = function shrinkColumn(state, colIndex, amount, selectedColumns
|
|
27
|
-
// Ignored via go/ees005
|
|
28
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
29
|
-
) {
|
|
23
|
+
export var shrinkColumn = function shrinkColumn(state, colIndex, amount, selectedColumns) {
|
|
30
24
|
// can't shrink if columns don't exist
|
|
31
25
|
if (!state.cols[colIndex]) {
|
|
32
26
|
return state;
|
|
@@ -99,8 +93,6 @@ var ColType = /*#__PURE__*/function (ColType) {
|
|
|
99
93
|
return ColType;
|
|
100
94
|
}(ColType || {}); // TODO: should handle when destIdx:
|
|
101
95
|
// - is beyond the range, and then not give it back
|
|
102
|
-
// Ignored via go/ees005
|
|
103
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
104
96
|
function moveSpaceFrom(state, srcIdx, destIdx, amount) {
|
|
105
97
|
var useFreeSpace = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
|
|
106
98
|
var srcCol = state.cols[srcIdx];
|
|
@@ -93,10 +93,7 @@ export var getResizeState = function getResizeState(_ref) {
|
|
|
93
93
|
};
|
|
94
94
|
|
|
95
95
|
// updates Colgroup DOM node with new widths
|
|
96
|
-
export var updateColgroup = function updateColgroup(state, tableRef, tableNode, isTableScalingEnabled, scalePercent
|
|
97
|
-
// Ignored via go/ees005
|
|
98
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
99
|
-
) {
|
|
96
|
+
export var updateColgroup = function updateColgroup(state, tableRef, tableNode, isTableScalingEnabled, scalePercent) {
|
|
100
97
|
var cols = tableRef === null || tableRef === void 0 ? void 0 : tableRef.querySelectorAll('col');
|
|
101
98
|
var columnsCount = cols === null || cols === void 0 ? void 0 : cols.length;
|
|
102
99
|
/**
|
|
@@ -17,10 +17,7 @@ import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorWideL
|
|
|
17
17
|
import { TABLE_MAX_WIDTH } from './table-resizing/utils/consts';
|
|
18
18
|
import { ALIGN_START } from './utils/alignment';
|
|
19
19
|
export var pluginKey = new PluginKey('tableWidthPlugin');
|
|
20
|
-
var createPlugin = function createPlugin(dispatch, dispatchAnalyticsEvent, fullWidthEnabled, isTableScalingEnabled, isTableAlignmentEnabled, isCommentEditor
|
|
21
|
-
// Ignored via go/ees005
|
|
22
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
23
|
-
) {
|
|
20
|
+
var createPlugin = function createPlugin(dispatch, dispatchAnalyticsEvent, fullWidthEnabled, isTableScalingEnabled, isTableAlignmentEnabled, isCommentEditor) {
|
|
24
21
|
return new SafePlugin({
|
|
25
22
|
key: pluginKey,
|
|
26
23
|
state: {
|
|
@@ -117,8 +114,6 @@ var createPlugin = function createPlugin(dispatch, dispatchAnalyticsEvent, fullW
|
|
|
117
114
|
}
|
|
118
115
|
if (referentialityTr) {
|
|
119
116
|
referentialityTr.steps.forEach(function (step) {
|
|
120
|
-
// Ignored via go/ees005
|
|
121
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
122
117
|
step.getMap().forEach(function (_, __, newStart, newEnd) {
|
|
123
118
|
newState.doc.nodesBetween(newStart, newEnd, function (node, pos) {
|
|
124
119
|
if (node.type === table) {
|
|
@@ -16,10 +16,7 @@ import { scaleTableTo } from '../table-resizing/utils/scale-table';
|
|
|
16
16
|
* @param start
|
|
17
17
|
* @returns
|
|
18
18
|
*/
|
|
19
|
-
export var updateColumnWidths = function updateColumnWidths(resizeState, table, start, api
|
|
20
|
-
// Ignored via go/ees005
|
|
21
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
22
|
-
) {
|
|
19
|
+
export var updateColumnWidths = function updateColumnWidths(resizeState, table, start, api) {
|
|
23
20
|
return function (tr) {
|
|
24
21
|
var map = TableMap.get(table);
|
|
25
22
|
var updatedCellsAttrs = {};
|
|
@@ -38,10 +38,7 @@ var validateTableCellNodeAttrs = function validateTableCellNodeAttrs(_ref, repor
|
|
|
38
38
|
//
|
|
39
39
|
// This row only spans two columns, yet it contains widths for 3.
|
|
40
40
|
// We remove the third width here, assumed duplicate content.
|
|
41
|
-
export var removeExtraneousColumnWidths = function removeExtraneousColumnWidths(node, basePos, tr, reportInvalidTableCellSpanAttrs
|
|
42
|
-
// Ignored via go/ees005
|
|
43
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
44
|
-
) {
|
|
41
|
+
export var removeExtraneousColumnWidths = function removeExtraneousColumnWidths(node, basePos, tr, reportInvalidTableCellSpanAttrs) {
|
|
45
42
|
var hasProblems = false;
|
|
46
43
|
tr = replaceCells(tr, node, basePos, function (cell) {
|
|
47
44
|
var _cell$attrs = cell.attrs,
|
|
@@ -92,10 +89,7 @@ export var fixTables = function fixTables(tr, reportInvalidTableCellSpanAttrs) {
|
|
|
92
89
|
//
|
|
93
90
|
// We use this when migrating TinyMCE tables for Confluence, for example:
|
|
94
91
|
// https://pug.jira-dev.com/wiki/spaces/AEC/pages/3362882215/How+do+we+map+TinyMCE+tables+to+Fabric+tables
|
|
95
|
-
export var fixAutoSizedTable = function fixAutoSizedTable(view, tableNode, tableRef, tablePos, opts
|
|
96
|
-
// Ignored via go/ees005
|
|
97
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
98
|
-
) {
|
|
92
|
+
export var fixAutoSizedTable = function fixAutoSizedTable(view, tableNode, tableRef, tablePos, opts) {
|
|
99
93
|
var tr = view.state.tr;
|
|
100
94
|
var domAtPos = view.domAtPos.bind(view);
|
|
101
95
|
var tableStart = tablePos + 1;
|
|
@@ -138,9 +132,6 @@ var getLayoutBasedOnWidth = function getLayoutBasedOnWidth(totalWidth) {
|
|
|
138
132
|
return 'default';
|
|
139
133
|
}
|
|
140
134
|
};
|
|
141
|
-
|
|
142
|
-
// Ignored via go/ees005
|
|
143
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
144
135
|
function parseDOMColumnWidths(domAtPos, tableNode, tableStart, tableRef) {
|
|
145
136
|
var row = tableRef.querySelector('tr');
|
|
146
137
|
if (!row) {
|
|
@@ -165,10 +156,7 @@ function parseDOMColumnWidths(domAtPos, tableNode, tableStart, tableRef) {
|
|
|
165
156
|
}
|
|
166
157
|
|
|
167
158
|
// TODO: move to prosemirror-utils
|
|
168
|
-
var replaceCells = function replaceCells(tr, table, tablePos, modifyCell
|
|
169
|
-
// Ignored via go/ees005
|
|
170
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
171
|
-
) {
|
|
159
|
+
var replaceCells = function replaceCells(tr, table, tablePos, modifyCell) {
|
|
172
160
|
var rows = [];
|
|
173
161
|
var modifiedCells = 0;
|
|
174
162
|
for (var rowIndex = 0; rowIndex < table.childCount; rowIndex++) {
|
|
@@ -3,10 +3,7 @@ import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
|
3
3
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
4
4
|
import { findTable, isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
5
5
|
import { getSelectedTableInfo } from '../utils/analytics';
|
|
6
|
-
export var replaceSelectedTable = function replaceSelectedTable(state, content, inputMethod, editorAnalyticsAPI
|
|
7
|
-
// Ignored via go/ees005
|
|
8
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
9
|
-
) {
|
|
6
|
+
export var replaceSelectedTable = function replaceSelectedTable(state, content, inputMethod, editorAnalyticsAPI) {
|
|
10
7
|
if (isTableSelected(state.selection)) {
|
|
11
8
|
var table = findTable(state.selection);
|
|
12
9
|
if (table) {
|
|
@@ -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(tr, tablePos, columnStart, columnEnd) {
|
|
16
14
|
var mapStart = tr.mapping.maps.length;
|
|
17
15
|
var table = tr.doc.nodeAt(tablePos);
|
|
@@ -13,9 +13,6 @@ export var normaliseAlignment = function normaliseAlignment(layout) {
|
|
|
13
13
|
/**
|
|
14
14
|
* We don't want to switch alignment in Full-width editor
|
|
15
15
|
*/
|
|
16
|
-
export var shouldChangeAlignmentToCenterResized = function shouldChangeAlignmentToCenterResized(isTableAlignmentEnabled, tableNode, lineLength, updatedTableWidth
|
|
17
|
-
// Ignored via go/ees005
|
|
18
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
19
|
-
) {
|
|
16
|
+
export var shouldChangeAlignmentToCenterResized = function shouldChangeAlignmentToCenterResized(isTableAlignmentEnabled, tableNode, lineLength, updatedTableWidth) {
|
|
20
17
|
return Boolean(isTableAlignmentEnabled && tableNode && tableNode.attrs.layout === ALIGN_START && lineLength && updatedTableWidth > lineLength && lineLength < FULL_WIDTH_EDITOR_CONTENT_WIDTH);
|
|
21
18
|
};
|
|
@@ -33,10 +33,7 @@ export var createCellHoverDecoration = function createCellHoverDecoration(cells)
|
|
|
33
33
|
});
|
|
34
34
|
});
|
|
35
35
|
};
|
|
36
|
-
export var createControlsHoverDecoration = function createControlsHoverDecoration(cells, type, tr, isDragAndDropEnable, hoveredIndexes, danger, selected
|
|
37
|
-
// Ignored via go/ees005
|
|
38
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
39
|
-
) {
|
|
36
|
+
export var createControlsHoverDecoration = function createControlsHoverDecoration(cells, type, tr, isDragAndDropEnable, hoveredIndexes, danger, selected) {
|
|
40
37
|
var table = findTable(tr.selection);
|
|
41
38
|
if (!table) {
|
|
42
39
|
return [];
|
|
@@ -165,10 +162,7 @@ export var createColumnControlsDecoration = function createColumnControlsDecorat
|
|
|
165
162
|
});
|
|
166
163
|
});
|
|
167
164
|
};
|
|
168
|
-
export var updateDecorations = function updateDecorations(node, decorationSet, decorations, key
|
|
169
|
-
// Ignored via go/ees005
|
|
170
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
171
|
-
) {
|
|
165
|
+
export var updateDecorations = function updateDecorations(node, decorationSet, decorations, key) {
|
|
172
166
|
var filteredDecorations = filterDecorationByKey(key, decorationSet);
|
|
173
167
|
var decorationSetFiltered = decorationSet.remove(filteredDecorations);
|
|
174
168
|
return decorationSetFiltered.add(node, decorations);
|
|
@@ -259,10 +253,7 @@ var makeArray = function makeArray(n) {
|
|
|
259
253
|
export var createResizeHandleDecoration = function createResizeHandleDecoration(tr, rowIndexTarget, columnEndIndexTarget) {
|
|
260
254
|
var includeTooltip = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
261
255
|
var getIntl = arguments.length > 4 ? arguments[4] : undefined;
|
|
262
|
-
var nodeViewPortalProviderAPI
|
|
263
|
-
// Ignored via go/ees005
|
|
264
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
265
|
-
= arguments.length > 5 ? arguments[5] : undefined;
|
|
256
|
+
var nodeViewPortalProviderAPI = arguments.length > 5 ? arguments[5] : undefined;
|
|
266
257
|
var emptyResult = [[], []];
|
|
267
258
|
var table = findTable(tr.selection);
|
|
268
259
|
if (!table || !table.node) {
|
|
@@ -272,10 +263,7 @@ export var createResizeHandleDecoration = function createResizeHandleDecoration(
|
|
|
272
263
|
if (!map.width) {
|
|
273
264
|
return emptyResult;
|
|
274
265
|
}
|
|
275
|
-
var createResizerHandleDecoration = function createResizerHandleDecoration(cellColumnPositioning, columnIndex, rowIndex, cellPos, cellNode
|
|
276
|
-
// Ignored via go/ees005
|
|
277
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
278
|
-
) {
|
|
266
|
+
var createResizerHandleDecoration = function createResizerHandleDecoration(cellColumnPositioning, columnIndex, rowIndex, cellPos, cellNode) {
|
|
279
267
|
var decorationRenderKey = uuid();
|
|
280
268
|
var position = cellPos + cellNode.nodeSize - 1;
|
|
281
269
|
return Decoration.widget(position, function () {
|
|
@@ -39,10 +39,7 @@ import { getSelectedColumnIndexes, getSelectedRowIndexes } from './selection';
|
|
|
39
39
|
export var getTargetIndex = function getTargetIndex(selectedIndexes, direction) {
|
|
40
40
|
return Math[direction < 0 ? 'min' : 'max'].apply(Math, _toConsumableArray(selectedIndexes)) + direction;
|
|
41
41
|
};
|
|
42
|
-
export var canMove = function canMove(sourceType, direction, totalItemsOfSourceTypeCount, selection, selectionRect
|
|
43
|
-
// Ignored via go/ees005
|
|
44
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
45
|
-
) {
|
|
42
|
+
export var canMove = function canMove(sourceType, direction, totalItemsOfSourceTypeCount, selection, selectionRect) {
|
|
46
43
|
if (!selectionRect) {
|
|
47
44
|
return false;
|
|
48
45
|
}
|
|
@@ -73,9 +73,6 @@ export var tablesHaveDifferentNoOfRows = function tablesHaveDifferentNoOfRows(cu
|
|
|
73
73
|
var currentMap = TableMap.get(currentTable);
|
|
74
74
|
return prevMap.height !== currentMap.height;
|
|
75
75
|
};
|
|
76
|
-
|
|
77
|
-
// Ignored via go/ees005
|
|
78
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
79
76
|
function filterNearSelection(selection, findNode, predicate, defaultValue) {
|
|
80
77
|
var found = findNode(selection);
|
|
81
78
|
if (!found) {
|