@atlaskit/editor-plugin-table 7.5.1 → 7.5.3
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 +12 -0
- package/dist/cjs/commands-with-analytics.js +65 -38
- package/dist/cjs/nodeviews/ExternalDropTargets.js +2 -2
- package/dist/cjs/nodeviews/TableCell.js +1 -1
- package/dist/cjs/nodeviews/TableComponent.js +1 -1
- package/dist/cjs/nodeviews/TableContainer.js +2 -2
- package/dist/cjs/nodeviews/TableResizer.js +2 -2
- package/dist/cjs/nodeviews/TableRow.js +1 -1
- package/dist/cjs/nodeviews/table.js +1 -1
- package/dist/cjs/pm-plugins/keymap.js +2 -2
- package/dist/cjs/pm-plugins/table-analytics.js +2 -2
- package/dist/cjs/pm-plugins/table-local-id.js +11 -11
- package/dist/cjs/pm-plugins/table-resizing/event-handlers.js +16 -1
- package/dist/cjs/pm-plugins/table-resizing/utils/resize-state.js +0 -1
- package/dist/cjs/reducer.js +0 -2
- package/dist/cjs/toolbar.js +2 -2
- package/dist/cjs/ui/DragHandle/index.js +2 -2
- package/dist/cjs/ui/FloatingContextualButton/FixedButton.js +2 -2
- package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +1 -1
- package/dist/cjs/ui/FloatingDeleteButton/index.js +3 -3
- package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +2 -2
- package/dist/cjs/ui/FloatingDragMenu/DropdownMenu.js +2 -2
- package/dist/cjs/ui/FloatingInsertButton/index.js +3 -3
- package/dist/cjs/ui/LayoutButton/index.js +3 -3
- package/dist/cjs/ui/TableFloatingColumnControls/ColumnControls/index.js +2 -2
- package/dist/cjs/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.js +2 -2
- package/dist/cjs/ui/TableFloatingColumnControls/ColumnDropTargets/index.js +2 -2
- package/dist/cjs/ui/TableFloatingColumnControls/index.js +2 -2
- package/dist/cjs/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +3 -3
- package/dist/cjs/ui/TableFloatingControls/CornerControls/DragCornerControls.js +2 -2
- package/dist/cjs/ui/TableFloatingControls/NumberColumn/index.js +3 -3
- package/dist/cjs/ui/TableFloatingControls/RowControls/ClassicControls.js +3 -3
- package/dist/cjs/ui/TableFloatingControls/RowControls/DragControls.js +2 -2
- package/dist/cjs/ui/TableFloatingControls/RowDropTarget/index.js +2 -2
- package/dist/cjs/ui/TableFloatingControls/index.js +3 -3
- package/dist/cjs/utils/decoration.js +0 -4
- package/dist/cjs/utils/merged-cells.js +7 -3
- package/dist/es2019/commands-with-analytics.js +27 -0
- package/dist/es2019/pm-plugins/keymap.js +4 -4
- package/dist/es2019/pm-plugins/table-resizing/event-handlers.js +17 -2
- package/dist/es2019/pm-plugins/table-resizing/utils/resize-state.js +0 -1
- package/dist/es2019/reducer.js +0 -2
- package/dist/es2019/utils/decoration.js +0 -4
- package/dist/es2019/utils/merged-cells.js +7 -3
- package/dist/esm/commands-with-analytics.js +64 -37
- package/dist/esm/nodeviews/TableCell.js +1 -1
- package/dist/esm/nodeviews/TableComponent.js +1 -1
- package/dist/esm/nodeviews/TableRow.js +1 -1
- package/dist/esm/nodeviews/table.js +1 -1
- package/dist/esm/pm-plugins/keymap.js +4 -4
- package/dist/esm/pm-plugins/table-resizing/event-handlers.js +17 -2
- package/dist/esm/pm-plugins/table-resizing/utils/resize-state.js +0 -1
- package/dist/esm/reducer.js +0 -2
- package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +1 -1
- package/dist/esm/ui/FloatingDeleteButton/index.js +1 -1
- package/dist/esm/ui/FloatingInsertButton/index.js +1 -1
- package/dist/esm/ui/LayoutButton/index.js +1 -1
- package/dist/esm/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +1 -1
- package/dist/esm/ui/TableFloatingControls/NumberColumn/index.js +1 -1
- package/dist/esm/ui/TableFloatingControls/RowControls/ClassicControls.js +1 -1
- package/dist/esm/ui/TableFloatingControls/index.js +1 -1
- package/dist/esm/utils/decoration.js +0 -4
- package/dist/esm/utils/merged-cells.js +7 -3
- package/dist/types/commands-with-analytics.d.ts +1 -0
- package/dist/types-ts4.5/commands-with-analytics.d.ts +1 -0
- package/package.json +2 -2
- package/src/commands-with-analytics.ts +39 -0
- package/src/pm-plugins/keymap.ts +13 -3
- package/src/pm-plugins/table-resizing/event-handlers.ts +20 -1
- package/src/utils/merged-cells.ts +7 -3
|
@@ -2,6 +2,7 @@ import type { CellAttributes, TableLayout } from '@atlaskit/adf-schema';
|
|
|
2
2
|
import {
|
|
3
3
|
ACTION_SUBJECT,
|
|
4
4
|
EVENT_TYPE,
|
|
5
|
+
INPUT_METHOD,
|
|
5
6
|
TABLE_ACTION,
|
|
6
7
|
TABLE_OVERFLOW_CHANGE_TRIGGER,
|
|
7
8
|
} from '@atlaskit/editor-common/analytics';
|
|
@@ -211,6 +212,9 @@ export const handleMouseDown = (
|
|
|
211
212
|
resizingSelectedColumns ? selectedColumns : undefined,
|
|
212
213
|
tablePreserveWidth,
|
|
213
214
|
);
|
|
215
|
+
|
|
216
|
+
const resizedDelta = clientX - startX;
|
|
217
|
+
|
|
214
218
|
tr = updateColumnWidths(newResizeState, table, start)(tr);
|
|
215
219
|
if (colIndex === map.width - 1) {
|
|
216
220
|
const mouseUpTime = event.timeStamp;
|
|
@@ -223,11 +227,26 @@ export const handleMouseDown = (
|
|
|
223
227
|
type: 'table-border',
|
|
224
228
|
position: 'right',
|
|
225
229
|
duration: mouseUpTime - mouseDownTime,
|
|
226
|
-
delta: Math.abs(
|
|
230
|
+
delta: Math.abs(resizedDelta),
|
|
227
231
|
},
|
|
228
232
|
eventType: EVENT_TYPE.UI,
|
|
229
233
|
})(tr);
|
|
230
234
|
}
|
|
235
|
+
|
|
236
|
+
editorAnalyticsAPI?.attachAnalyticsEvent({
|
|
237
|
+
action: TABLE_ACTION.COLUMN_RESIZED,
|
|
238
|
+
actionSubject: ACTION_SUBJECT.TABLE,
|
|
239
|
+
eventType: EVENT_TYPE.TRACK,
|
|
240
|
+
attributes: {
|
|
241
|
+
colIndex: colIndex,
|
|
242
|
+
resizedDelta,
|
|
243
|
+
isLastColumn: colIndex === map.width - 1,
|
|
244
|
+
tableWidth: table.attrs.width,
|
|
245
|
+
inputMethod: INPUT_METHOD.MOUSE,
|
|
246
|
+
totalRowCount: map.height,
|
|
247
|
+
totalColumnCount: map.width,
|
|
248
|
+
},
|
|
249
|
+
})(tr);
|
|
231
250
|
}
|
|
232
251
|
if (getBooleanFF('platform.editor.a11y-column-resizing_emcvz')) {
|
|
233
252
|
if (isKeyboardResize || !isTableHovered) {
|
|
@@ -259,13 +259,17 @@ export const checkEdgeHasMergedCells = (
|
|
|
259
259
|
const { mapByRow, mapByColumn } = tableMap;
|
|
260
260
|
const map = 'row' === direction ? mapByRow : mapByColumn;
|
|
261
261
|
const lengthLimiter = direction === 'row' ? tableMap.width : tableMap.height;
|
|
262
|
-
|
|
263
262
|
let minIndex = Math.min(...indexes);
|
|
264
263
|
let maxIndex = Math.max(...indexes);
|
|
265
264
|
let isTopSideHaveMergedCells = false;
|
|
266
265
|
let isBottomSideHaveMergedCells = false;
|
|
267
|
-
|
|
268
|
-
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* this is to check if the cell position from last focused table is overflow. since if you selection from a cell in 6th row and 7th column cell in a 7x8 table to 3x3 table, the cell position will be overflow because new table dont have this cell at all.
|
|
269
|
+
TODO: ED-22335 this should better called only when hover over the drag handle.
|
|
270
|
+
*/
|
|
271
|
+
let isOldMinIndex = !map[minIndex - 1] || !map[minIndex];
|
|
272
|
+
let isOldMaxIndex = !map[maxIndex + 1] || !map[maxIndex];
|
|
269
273
|
|
|
270
274
|
if (minIndex > 0 && !isOldMinIndex) {
|
|
271
275
|
const prevSelectionSet = map[minIndex - 1];
|