@atlaskit/editor-plugin-table 8.4.14 → 9.0.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 +13 -0
- package/dist/cjs/pm-plugins/table-resizing/event-handlers.js +9 -84
- package/dist/cjs/pm-plugins/table-resizing/plugin.js +2 -2
- package/dist/cjs/pm-plugins/table-resizing/utils/resize-column.js +3 -144
- package/dist/cjs/pm-plugins/table-resizing/utils/resize-state.js +1 -2
- package/dist/cjs/pm-plugins/view-mode-sort/utils.js +3 -0
- package/dist/cjs/tablePlugin.js +3 -5
- package/dist/cjs/ui/DragPreview/index.js +1 -0
- package/dist/cjs/ui/FloatingContextualButton/index.js +1 -2
- package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +2 -4
- package/dist/cjs/ui/toolbar.js +1 -4
- package/dist/es2019/nodeviews/TableContainer.js +1 -1
- package/dist/es2019/pm-plugins/commands/column-resize.js +1 -1
- package/dist/es2019/pm-plugins/commands/insert.js +3 -3
- package/dist/es2019/pm-plugins/commands/misc.js +1 -1
- package/dist/es2019/pm-plugins/drag-and-drop/commands.js +1 -1
- package/dist/es2019/pm-plugins/table-analytics.js +1 -1
- package/dist/es2019/pm-plugins/table-resizing/event-handlers.js +12 -84
- package/dist/es2019/pm-plugins/table-resizing/plugin.js +2 -2
- package/dist/es2019/pm-plugins/table-resizing/utils/misc.js +2 -2
- package/dist/es2019/pm-plugins/table-resizing/utils/resize-column.js +2 -139
- package/dist/es2019/pm-plugins/table-resizing/utils/resize-logic.js +1 -1
- package/dist/es2019/pm-plugins/table-resizing/utils/resize-state.js +1 -2
- package/dist/es2019/pm-plugins/table-resizing/utils/scale-table.js +1 -1
- package/dist/es2019/pm-plugins/transforms/delete-columns.js +1 -1
- package/dist/es2019/pm-plugins/transforms/fix-tables.js +1 -1
- package/dist/es2019/pm-plugins/transforms/replace-table.js +1 -1
- package/dist/es2019/pm-plugins/transforms/split.js +2 -2
- package/dist/es2019/pm-plugins/utils/analytics.js +4 -4
- package/dist/es2019/pm-plugins/utils/column-controls.js +1 -1
- package/dist/es2019/pm-plugins/utils/drag-menu.js +1 -1
- package/dist/es2019/pm-plugins/utils/merged-cells.js +4 -4
- package/dist/es2019/pm-plugins/utils/nodes.js +3 -3
- package/dist/es2019/pm-plugins/utils/row-controls.js +2 -2
- package/dist/es2019/pm-plugins/view-mode-sort/index.js +2 -2
- package/dist/es2019/pm-plugins/view-mode-sort/utils.js +4 -1
- package/dist/es2019/tablePlugin.js +3 -5
- package/dist/es2019/ui/DragPreview/index.js +4 -3
- package/dist/es2019/ui/FloatingContextualButton/index.js +1 -2
- package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +4 -6
- package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +4 -4
- package/dist/es2019/ui/FloatingDragMenu/DropdownMenu.js +2 -2
- package/dist/es2019/ui/toolbar.js +1 -4
- package/dist/esm/pm-plugins/table-resizing/event-handlers.js +11 -85
- package/dist/esm/pm-plugins/table-resizing/plugin.js +2 -2
- package/dist/esm/pm-plugins/table-resizing/utils/resize-column.js +2 -143
- package/dist/esm/pm-plugins/table-resizing/utils/resize-state.js +1 -2
- package/dist/esm/pm-plugins/view-mode-sort/utils.js +3 -0
- package/dist/esm/tablePlugin.js +3 -5
- package/dist/esm/ui/DragPreview/index.js +1 -0
- package/dist/esm/ui/FloatingContextualButton/index.js +1 -2
- package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +2 -4
- package/dist/esm/ui/toolbar.js +1 -4
- package/dist/types/pm-plugins/table-resizing/event-handlers.d.ts +1 -1
- package/dist/types/pm-plugins/table-resizing/plugin.d.ts +1 -1
- package/dist/types/pm-plugins/table-resizing/utils/resize-column.d.ts +0 -24
- package/dist/types/tablePluginType.d.ts +0 -1
- package/dist/types-ts4.5/pm-plugins/table-resizing/event-handlers.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/table-resizing/plugin.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/resize-column.d.ts +0 -24
- package/dist/types-ts4.5/tablePluginType.d.ts +0 -1
- package/package.json +4 -4
- package/src/nodeviews/TableContainer.tsx +1 -1
- package/src/pm-plugins/commands/column-resize.ts +1 -1
- package/src/pm-plugins/commands/insert.ts +3 -3
- package/src/pm-plugins/commands/misc.ts +1 -1
- package/src/pm-plugins/drag-and-drop/commands.ts +1 -1
- package/src/pm-plugins/table-analytics.ts +1 -1
- package/src/pm-plugins/table-resizing/event-handlers.ts +35 -121
- package/src/pm-plugins/table-resizing/plugin.ts +0 -4
- package/src/pm-plugins/table-resizing/utils/misc.ts +2 -2
- package/src/pm-plugins/table-resizing/utils/resize-column.ts +1 -219
- package/src/pm-plugins/table-resizing/utils/resize-logic.ts +1 -1
- package/src/pm-plugins/table-resizing/utils/resize-state.ts +1 -3
- package/src/pm-plugins/table-resizing/utils/scale-table.ts +1 -1
- package/src/pm-plugins/transforms/delete-columns.ts +1 -1
- package/src/pm-plugins/transforms/fix-tables.ts +1 -1
- package/src/pm-plugins/transforms/replace-table.ts +1 -1
- package/src/pm-plugins/transforms/split.ts +2 -2
- package/src/pm-plugins/utils/analytics.ts +4 -4
- package/src/pm-plugins/utils/column-controls.ts +1 -1
- package/src/pm-plugins/utils/drag-menu.ts +1 -1
- package/src/pm-plugins/utils/merged-cells.ts +4 -4
- package/src/pm-plugins/utils/nodes.ts +3 -3
- package/src/pm-plugins/utils/row-controls.ts +2 -2
- package/src/pm-plugins/view-mode-sort/index.ts +2 -2
- package/src/pm-plugins/view-mode-sort/utils.ts +3 -1
- package/src/tablePlugin.tsx +3 -10
- package/src/tablePluginType.ts +0 -1
- package/src/ui/DragPreview/index.tsx +4 -3
- package/src/ui/FloatingContextualButton/index.tsx +1 -2
- package/src/ui/FloatingContextualMenu/ContextualMenu.tsx +4 -6
- package/src/ui/FloatingDragMenu/DragMenu.tsx +4 -4
- package/src/ui/FloatingDragMenu/DropdownMenu.tsx +2 -2
- package/src/ui/toolbar.tsx +1 -11
- package/tsconfig.app.json +0 -1
- package/tsconfig.dev.json +0 -1
|
@@ -148,7 +148,7 @@ export function scaleTableTo(state: ResizeState, maxSize: number): ResizeState {
|
|
|
148
148
|
}),
|
|
149
149
|
};
|
|
150
150
|
|
|
151
|
-
|
|
151
|
+
const newTotalWidth = getTotalWidth(newState);
|
|
152
152
|
if (newTotalWidth > maxSize) {
|
|
153
153
|
newState = reduceSpace(newState, newTotalWidth - maxSize);
|
|
154
154
|
}
|
|
@@ -29,7 +29,7 @@ const deleteColumnsCustomStep =
|
|
|
29
29
|
splitCellsInColumns(tr, table.pos, rect.left, rect.right);
|
|
30
30
|
|
|
31
31
|
// Delete the columns
|
|
32
|
-
|
|
32
|
+
const mapStart = tr.mapping.maps.length;
|
|
33
33
|
const originalDoc = tr.doc;
|
|
34
34
|
const deletedColumns: number[] = [];
|
|
35
35
|
for (let i = rect.left; i < rect.right; i++) {
|
|
@@ -22,7 +22,7 @@ export const replaceSelectedTable = (
|
|
|
22
22
|
typeof content === 'string'
|
|
23
23
|
? new Slice(Fragment.from(state.schema.text(content)), 0, 0)
|
|
24
24
|
: content;
|
|
25
|
-
|
|
25
|
+
const tr = state.tr.replace(table.pos, table.pos + table.node.nodeSize, slice);
|
|
26
26
|
tr.setSelection(TextSelection.create(tr.doc, table.pos + slice.size + 1));
|
|
27
27
|
|
|
28
28
|
const { totalRowCount, totalColumnCount } = getSelectedTableInfo(state.selection);
|
|
@@ -18,7 +18,7 @@ export function splitCellsInColumns(
|
|
|
18
18
|
columnStart: number,
|
|
19
19
|
columnEnd: number,
|
|
20
20
|
): Transaction {
|
|
21
|
-
|
|
21
|
+
const mapStart = tr.mapping.maps.length;
|
|
22
22
|
const table = tr.doc.nodeAt(tablePos);
|
|
23
23
|
if (!table) {
|
|
24
24
|
return tr;
|
|
@@ -59,7 +59,7 @@ export function splitCellsInColumns(
|
|
|
59
59
|
// Add the new cells
|
|
60
60
|
for (let cellRowIndex = rowIndex; cellRowIndex < rowIndex + rowspan; cellRowIndex++) {
|
|
61
61
|
for (let i = 0; i < colspan; i++) {
|
|
62
|
-
|
|
62
|
+
const mapping = tr.mapping.slice(mapStart);
|
|
63
63
|
const cellPos = map.positionAt(cellRowIndex, column + i, table);
|
|
64
64
|
tr.insert(
|
|
65
65
|
mapping.map(cellPos + tableStart),
|
|
@@ -167,10 +167,10 @@ export const useMeasureFramerate = (config: UseMeasureFramerateConfig = {}) => {
|
|
|
167
167
|
timeoutMs = 200,
|
|
168
168
|
} = config;
|
|
169
169
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
170
|
+
const frameCount = useRef(0);
|
|
171
|
+
const lastTime = useRef(0);
|
|
172
|
+
const timeoutId = useRef<NodeJS.Timeout | undefined>();
|
|
173
|
+
const frameRateSamples = useRef<number[]>([]);
|
|
174
174
|
|
|
175
175
|
useEffect(() => {
|
|
176
176
|
return () => {
|
|
@@ -148,7 +148,7 @@ export const colWidthsForRow = (tr: HTMLTableRowElement) => {
|
|
|
148
148
|
}));
|
|
149
149
|
|
|
150
150
|
// reverse engineer cell widths from table widths
|
|
151
|
-
|
|
151
|
+
const domBasedCellWidths: number[] = [];
|
|
152
152
|
cellInfos.map((cell) => {
|
|
153
153
|
domBasedCellWidths.push(...getRelativeDomCellWidths(cell));
|
|
154
154
|
});
|
|
@@ -188,8 +188,8 @@ export const checkEdgeHasMergedCells = (
|
|
|
188
188
|
const { mapByRow, mapByColumn } = tableMap;
|
|
189
189
|
const map = 'row' === direction ? mapByRow : mapByColumn;
|
|
190
190
|
const lengthLimiter = direction === 'row' ? tableMap.width : tableMap.height;
|
|
191
|
-
|
|
192
|
-
|
|
191
|
+
const minIndex = Math.min(...indexes);
|
|
192
|
+
const maxIndex = Math.max(...indexes);
|
|
193
193
|
let isTopSideHaveMergedCells = false;
|
|
194
194
|
let isBottomSideHaveMergedCells = false;
|
|
195
195
|
|
|
@@ -197,8 +197,8 @@ export const checkEdgeHasMergedCells = (
|
|
|
197
197
|
* 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.
|
|
198
198
|
TODO: ED-22335 this should better called only when hover over the drag handle.
|
|
199
199
|
*/
|
|
200
|
-
|
|
201
|
-
|
|
200
|
+
const isOldMinIndex = !map[minIndex - 1] || !map[minIndex];
|
|
201
|
+
const isOldMaxIndex = !map[maxIndex + 1] || !map[maxIndex];
|
|
202
202
|
|
|
203
203
|
if (minIndex > 0 && !isOldMinIndex) {
|
|
204
204
|
const prevSelectionSet = map[minIndex - 1];
|
|
@@ -60,8 +60,8 @@ export const tablesHaveDifferentColumnWidths = (
|
|
|
60
60
|
currentTable: PmNode,
|
|
61
61
|
previousTable: PmNode,
|
|
62
62
|
): boolean => {
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
const currentTableWidths = getTableWidths(currentTable);
|
|
64
|
+
const previousTableWidths = getTableWidths(previousTable);
|
|
65
65
|
|
|
66
66
|
if (currentTableWidths.length !== previousTableWidths.length) {
|
|
67
67
|
return true;
|
|
@@ -115,7 +115,7 @@ function getTableWidths(node: PmNode): number[] {
|
|
|
115
115
|
return [];
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
|
|
118
|
+
const tableWidths: Array<number> = [];
|
|
119
119
|
node.content.firstChild.content.forEach((cell) => {
|
|
120
120
|
if (Array.isArray(cell.attrs.colwidth)) {
|
|
121
121
|
const colspan = cell.attrs.colspan || 1;
|
|
@@ -148,8 +148,8 @@ export const copyPreviousRow =
|
|
|
148
148
|
offsetNextLineIndexPosition + map.width,
|
|
149
149
|
);
|
|
150
150
|
|
|
151
|
-
|
|
152
|
-
|
|
151
|
+
const cells = [] as PMNode[];
|
|
152
|
+
const fixRowspans: { pos: number; node: PMNode }[] = [];
|
|
153
153
|
for (let i = 0; i < cellsPositionsInOriginalRow.length; ) {
|
|
154
154
|
const pos = cellsPositionsInOriginalRow[i];
|
|
155
155
|
const documentCellPos = pos + table.start;
|
|
@@ -53,8 +53,8 @@ export const createPlugin = (
|
|
|
53
53
|
|
|
54
54
|
const sortMeta = tr.getMeta('tableSortMeta');
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
const hoverTableMeta = tr.getMeta('mouseEnterTable');
|
|
57
|
+
const removeTableMeta = tr.getMeta('removeTable');
|
|
58
58
|
let tableId = '';
|
|
59
59
|
|
|
60
60
|
// Remove the table from the state
|
|
@@ -66,7 +66,7 @@ export const toggleSort = (view: EditorView, event: Event, pluginState: TableSor
|
|
|
66
66
|
if (widget?.classList.contains(IS_DISABLED_CLASS_NAME) || !widget) {
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
|
-
|
|
69
|
+
const dataSortIndex = target
|
|
70
70
|
?.closest('.ProseMirror-widget')
|
|
71
71
|
?.getAttribute(SORT_INDEX_DATA_ATTRIBUTE);
|
|
72
72
|
const tr = view.state.tr;
|
|
@@ -82,6 +82,8 @@ export const toggleSort = (view: EditorView, event: Event, pluginState: TableSor
|
|
|
82
82
|
return;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
+
// Ignored via go/ees005
|
|
86
|
+
// eslint-disable-next-line prefer-const
|
|
85
87
|
let { index, direction, order: oldOrder } = pluginState?.[tableId] || {};
|
|
86
88
|
|
|
87
89
|
// Unsort if there was already a sort
|
package/src/tablePlugin.tsx
CHANGED
|
@@ -315,14 +315,9 @@ const tablesPlugin: TablePlugin = ({ config: options, api }) => {
|
|
|
315
315
|
{
|
|
316
316
|
name: 'tablePMColResizing',
|
|
317
317
|
plugin: ({ dispatch, nodeViewPortalProviderAPI }) => {
|
|
318
|
-
const {
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
getEditorFeatureFlags,
|
|
322
|
-
isTableScalingEnabled,
|
|
323
|
-
isNewColumnResizingEnabled,
|
|
324
|
-
} = options || ({} as TablePluginOptions);
|
|
325
|
-
const { allowColumnResizing, allowTableAlignment } = pluginConfig(tableOptions);
|
|
318
|
+
const { fullWidthEnabled, tableOptions, getEditorFeatureFlags, isTableScalingEnabled } =
|
|
319
|
+
options || ({} as TablePluginOptions);
|
|
320
|
+
const { allowColumnResizing } = pluginConfig(tableOptions);
|
|
326
321
|
return allowColumnResizing
|
|
327
322
|
? createFlexiResizingPlugin(
|
|
328
323
|
dispatch,
|
|
@@ -335,8 +330,6 @@ const tablesPlugin: TablePlugin = ({ config: options, api }) => {
|
|
|
335
330
|
nodeViewPortalProviderAPI,
|
|
336
331
|
editorAnalyticsAPI,
|
|
337
332
|
isTableScalingEnabled || false,
|
|
338
|
-
isNewColumnResizingEnabled,
|
|
339
|
-
allowTableAlignment,
|
|
340
333
|
!!options?.isCommentEditor,
|
|
341
334
|
)
|
|
342
335
|
: undefined;
|
package/src/tablePluginType.ts
CHANGED
|
@@ -22,9 +22,9 @@ export const DragPreview = ({
|
|
|
22
22
|
width: number;
|
|
23
23
|
height: number;
|
|
24
24
|
}) => {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
const marginLeft = direction === 'row' ? -14 : width / 2 - 14;
|
|
26
|
+
const marginTop = direction === 'row' ? height / 2 - 14 : -10;
|
|
27
|
+
const transform = direction === 'row' ? 'rotate(90deg)' : 'none';
|
|
28
28
|
return (
|
|
29
29
|
<Box
|
|
30
30
|
xcss={boxStyles}
|
|
@@ -41,6 +41,7 @@ export const DragPreview = ({
|
|
|
41
41
|
marginLeft: `${marginLeft}px`,
|
|
42
42
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
43
43
|
marginTop: `${marginTop}px`,
|
|
44
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
44
45
|
transform: transform,
|
|
45
46
|
}}
|
|
46
47
|
/>
|
|
@@ -74,8 +74,7 @@ const FloatingContextualButtonInner = React.memo((props: Props & WrappedComponen
|
|
|
74
74
|
};
|
|
75
75
|
|
|
76
76
|
const domAtPos = editorView.domAtPos.bind(editorView);
|
|
77
|
-
|
|
78
|
-
targetCellRef = findDomRefAtPos(targetCellPosition, domAtPos);
|
|
77
|
+
const targetCellRef: Node | undefined = findDomRefAtPos(targetCellPosition, domAtPos);
|
|
79
78
|
|
|
80
79
|
useEffect(() => {
|
|
81
80
|
if (isCellMenuOpenByKeyboard && !isContextualMenuOpen) {
|
|
@@ -230,8 +230,6 @@ export class ContextualMenu extends Component<Props & WrappedComponentProps, Sta
|
|
|
230
230
|
if (allowBackgroundColor) {
|
|
231
231
|
const node = isOpen && targetCellPosition ? state.doc.nodeAt(targetCellPosition) : null;
|
|
232
232
|
const background = hexToEditorBackgroundPaletteColor(node?.attrs?.background || '#ffffff');
|
|
233
|
-
let selectedRowIndex;
|
|
234
|
-
let selectedColumnIndex;
|
|
235
233
|
|
|
236
234
|
const selectedRowAndColumnFromPalette = getSelectedRowAndColumnFromPalette(
|
|
237
235
|
cellBackgroundColorPalette,
|
|
@@ -240,8 +238,8 @@ export class ContextualMenu extends Component<Props & WrappedComponentProps, Sta
|
|
|
240
238
|
background!,
|
|
241
239
|
colorPalletteColumns,
|
|
242
240
|
);
|
|
243
|
-
selectedRowIndex = selectedRowAndColumnFromPalette.selectedRowIndex;
|
|
244
|
-
selectedColumnIndex = selectedRowAndColumnFromPalette.selectedColumnIndex;
|
|
241
|
+
const selectedRowIndex = selectedRowAndColumnFromPalette.selectedRowIndex;
|
|
242
|
+
const selectedColumnIndex = selectedRowAndColumnFromPalette.selectedColumnIndex;
|
|
245
243
|
return {
|
|
246
244
|
content: isDragAndDropEnabled
|
|
247
245
|
? formatMessage(messages.backgroundColor)
|
|
@@ -590,7 +588,7 @@ export class ContextualMenu extends Component<Props & WrappedComponentProps, Sta
|
|
|
590
588
|
};
|
|
591
589
|
|
|
592
590
|
private createOriginalContextMenuItems = () => {
|
|
593
|
-
|
|
591
|
+
const items: MenuItem[] = [];
|
|
594
592
|
const sortColumnItems = this.createSortColumnItems();
|
|
595
593
|
const backgroundColorItem = this.createBackgroundColorItem();
|
|
596
594
|
const distributeColumnsItem = this.createDistributeColumnsItem();
|
|
@@ -626,7 +624,7 @@ export class ContextualMenu extends Component<Props & WrappedComponentProps, Sta
|
|
|
626
624
|
const deleteRowItem = this.createDeleteRowItem();
|
|
627
625
|
|
|
628
626
|
// Group items so when table.menu.group-items FF is enabled, a divider shows under split cell, above add column
|
|
629
|
-
|
|
627
|
+
const items: { items: MenuItem[] }[] = [
|
|
630
628
|
{
|
|
631
629
|
items: [],
|
|
632
630
|
},
|
|
@@ -165,7 +165,7 @@ const MapDragMenuOptionIdToMessage: Record<DragMenuOptionIdType, MessageType> =
|
|
|
165
165
|
};
|
|
166
166
|
|
|
167
167
|
const getGroupedDragMenuConfig = () => {
|
|
168
|
-
|
|
168
|
+
const groupedDragMenuConfig: DragMenuOptionIdType[][] = [
|
|
169
169
|
[
|
|
170
170
|
'add_row_above',
|
|
171
171
|
'add_row_below',
|
|
@@ -195,8 +195,8 @@ const convertToDropdownItems = (
|
|
|
195
195
|
selectionRect?: Rect,
|
|
196
196
|
) => {
|
|
197
197
|
const groupedDragMenuConfig = getGroupedDragMenuConfig();
|
|
198
|
-
|
|
199
|
-
|
|
198
|
+
const menuItemsArr: MenuItem[][] = [...Array(groupedDragMenuConfig.length)].map(() => []);
|
|
199
|
+
const menuCallback: { [key: string]: Command } = {};
|
|
200
200
|
dragMenuConfig.forEach((item) => {
|
|
201
201
|
const menuGroupIndex = groupedDragMenuConfig.findIndex((group) => group.includes(item.id));
|
|
202
202
|
|
|
@@ -497,7 +497,7 @@ const DragMenu = React.memo(
|
|
|
497
497
|
* @returns true when the menu should be closed, false otherwise
|
|
498
498
|
*/
|
|
499
499
|
const shouldCloseMenu = (state: EditorState) => {
|
|
500
|
-
|
|
500
|
+
const {
|
|
501
501
|
isDragMenuOpen: previousOpenState,
|
|
502
502
|
dragMenuDirection: previousDragMenuDirection,
|
|
503
503
|
dragMenuIndex: previousDragMenuIndex,
|
|
@@ -72,8 +72,8 @@ export const DropdownMenu = ({
|
|
|
72
72
|
};
|
|
73
73
|
|
|
74
74
|
// more offsets calculation as offsets depend on the direction and updated placement here
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
const offsetY = direction === 'row' ? (popupPlacement[0] === 'bottom' ? -8 : -34) : 0;
|
|
76
|
+
const offsetX = direction === 'column' ? (popupPlacement[1] === 'left' ? 0 : -7) : 0;
|
|
77
77
|
|
|
78
78
|
const innerMenu = () => {
|
|
79
79
|
return (
|
package/src/ui/toolbar.tsx
CHANGED
|
@@ -501,17 +501,7 @@ export const getToolbarConfig =
|
|
|
501
501
|
// We don't want to show floating toolbar while resizing the table
|
|
502
502
|
const isWidthResizing = tableWidthState?.resizing;
|
|
503
503
|
|
|
504
|
-
|
|
505
|
-
const shouldHideToolbarForInternalColumnWidth = Boolean(
|
|
506
|
-
options?.isNewColumnResizingEnabled && resizeState && resizeState.dragging,
|
|
507
|
-
);
|
|
508
|
-
|
|
509
|
-
if (
|
|
510
|
-
tableObject &&
|
|
511
|
-
pluginState.editorHasFocus &&
|
|
512
|
-
!isWidthResizing &&
|
|
513
|
-
!shouldHideToolbarForInternalColumnWidth
|
|
514
|
-
) {
|
|
504
|
+
if (tableObject && pluginState.editorHasFocus && !isWidthResizing) {
|
|
515
505
|
const nodeType = state.schema.nodes.table;
|
|
516
506
|
const isNested = pluginState.tablePos && isTableNested(state, pluginState.tablePos);
|
|
517
507
|
const isTableScalingWithFixedColumnWidthsOptionShown =
|
package/tsconfig.app.json
CHANGED