@atlaskit/editor-plugin-table 2.10.7 → 2.11.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 +41 -0
- package/dist/cjs/plugins/table/commands/misc.js +58 -5
- package/dist/cjs/plugins/table/event-handlers.js +3 -6
- package/dist/cjs/plugins/table/index.js +66 -63
- package/dist/cjs/plugins/table/nodeviews/TableContainer.js +5 -5
- package/dist/cjs/plugins/table/nodeviews/TableResizer.js +13 -19
- package/dist/cjs/plugins/table/pm-plugins/decorations/utils/column-resizing.js +18 -5
- package/dist/cjs/plugins/table/pm-plugins/decorations/utils/index.js +6 -0
- package/dist/cjs/plugins/table/pm-plugins/main.js +7 -3
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/event-handlers.js +5 -0
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +2 -0
- package/dist/cjs/plugins/table/reducer.js +26 -2
- package/dist/cjs/plugins/table/types.js +1 -0
- package/dist/cjs/plugins/table/ui/ColumnResizeWidget/index.js +44 -0
- package/dist/cjs/plugins/table/ui/messages.js +5 -0
- package/dist/cjs/plugins/table/utils/decoration.js +17 -4
- package/dist/es2019/plugins/table/commands/misc.js +49 -5
- package/dist/es2019/plugins/table/event-handlers.js +3 -6
- package/dist/es2019/plugins/table/index.js +14 -10
- package/dist/es2019/plugins/table/nodeviews/TableContainer.js +5 -5
- package/dist/es2019/plugins/table/nodeviews/TableResizer.js +14 -17
- package/dist/es2019/plugins/table/pm-plugins/decorations/utils/column-resizing.js +12 -2
- package/dist/es2019/plugins/table/pm-plugins/decorations/utils/index.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/main.js +6 -3
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/event-handlers.js +5 -0
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +2 -0
- package/dist/es2019/plugins/table/reducer.js +29 -2
- package/dist/es2019/plugins/table/types.js +1 -0
- package/dist/es2019/plugins/table/ui/ColumnResizeWidget/index.js +35 -0
- package/dist/es2019/plugins/table/ui/messages.js +5 -0
- package/dist/es2019/plugins/table/utils/decoration.js +16 -5
- package/dist/esm/plugins/table/commands/misc.js +56 -5
- package/dist/esm/plugins/table/event-handlers.js +3 -6
- package/dist/esm/plugins/table/index.js +66 -63
- package/dist/esm/plugins/table/nodeviews/TableContainer.js +5 -5
- package/dist/esm/plugins/table/nodeviews/TableResizer.js +13 -19
- package/dist/esm/plugins/table/pm-plugins/decorations/utils/column-resizing.js +15 -3
- package/dist/esm/plugins/table/pm-plugins/decorations/utils/index.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/main.js +8 -4
- package/dist/esm/plugins/table/pm-plugins/table-resizing/event-handlers.js +5 -0
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +2 -0
- package/dist/esm/plugins/table/reducer.js +26 -2
- package/dist/esm/plugins/table/types.js +1 -0
- package/dist/esm/plugins/table/ui/ColumnResizeWidget/index.js +35 -0
- package/dist/esm/plugins/table/ui/messages.js +5 -0
- package/dist/esm/plugins/table/utils/decoration.js +17 -4
- package/dist/types/plugins/table/commands/misc.d.ts +8 -6
- package/dist/types/plugins/table/event-handlers.d.ts +3 -3
- package/dist/types/plugins/table/pm-plugins/decorations/utils/column-resizing.d.ts +4 -2
- package/dist/types/plugins/table/pm-plugins/decorations/utils/index.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/main.d.ts +2 -1
- package/dist/types/plugins/table/pm-plugins/table-resizing/plugin.d.ts +2 -2
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/scale-table.d.ts +3 -3
- package/dist/types/plugins/table/reducer.d.ts +1 -1
- package/dist/types/plugins/table/types.d.ts +18 -0
- package/dist/types/plugins/table/ui/ColumnResizeWidget/index.d.ts +9 -0
- package/dist/types/plugins/table/ui/messages.d.ts +5 -0
- package/dist/types/plugins/table/utils/decoration.d.ts +2 -1
- package/dist/types-ts4.5/plugins/table/commands/misc.d.ts +8 -6
- package/dist/types-ts4.5/plugins/table/event-handlers.d.ts +3 -3
- package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/utils/column-resizing.d.ts +4 -2
- package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/utils/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/main.d.ts +2 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/plugin.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/scale-table.d.ts +3 -3
- package/dist/types-ts4.5/plugins/table/reducer.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/types.d.ts +18 -0
- package/dist/types-ts4.5/plugins/table/ui/ColumnResizeWidget/index.d.ts +9 -0
- package/dist/types-ts4.5/plugins/table/ui/messages.d.ts +5 -0
- package/dist/types-ts4.5/plugins/table/utils/decoration.d.ts +2 -1
- package/package.json +4 -4
- package/src/__tests__/unit/event-handlers.ts +1 -1
- package/src/__tests__/unit/nodeviews/TableComponent.tsx +6 -8
- package/src/__tests__/unit/nodeviews/TableContainer.tsx +22 -15
- package/src/__tests__/unit/pm-plugins/decorations/column-resizing.ts +2 -0
- package/src/__tests__/unit/ui/FloatingDeleteButton.tsx +9 -10
- package/src/__tests__/unit/ui/FloatingInsertButton.tsx +9 -9
- package/src/plugins/table/commands/misc.ts +84 -7
- package/src/plugins/table/event-handlers.ts +11 -16
- package/src/plugins/table/index.tsx +6 -4
- package/src/plugins/table/nodeviews/TableContainer.tsx +4 -4
- package/src/plugins/table/nodeviews/TableResizer.tsx +12 -20
- package/src/plugins/table/pm-plugins/decorations/utils/column-resizing.ts +34 -7
- package/src/plugins/table/pm-plugins/decorations/utils/index.ts +4 -1
- package/src/plugins/table/pm-plugins/main.ts +7 -1
- package/src/plugins/table/pm-plugins/table-resizing/event-handlers.ts +5 -0
- package/src/plugins/table/pm-plugins/table-resizing/plugin.ts +3 -5
- package/src/plugins/table/pm-plugins/table-resizing/utils/scale-table.ts +5 -3
- package/src/plugins/table/reducer.ts +51 -3
- package/src/plugins/table/types.ts +19 -0
- package/src/plugins/table/ui/ColumnResizeWidget/index.tsx +53 -0
- package/src/plugins/table/ui/messages.ts +5 -0
- package/src/plugins/table/utils/decoration.ts +27 -5
- package/tmp/api-report-tmp.d.ts +111 -0
|
@@ -17,6 +17,7 @@ import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
|
17
17
|
import { getSelectionRect } from '@atlaskit/editor-tables/utils';
|
|
18
18
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
19
19
|
|
|
20
|
+
import { updateResizeHandleDecorations } from '../../commands/misc';
|
|
20
21
|
import { updateColumnWidths } from '../../transforms';
|
|
21
22
|
import { getSelectedColumnIndexes, updateResizeHandles } from '../../utils';
|
|
22
23
|
|
|
@@ -115,6 +116,10 @@ export const handleMouseDown = (
|
|
|
115
116
|
|
|
116
117
|
setDragging({ startX: event.clientX, startWidth: width })(state, dispatch);
|
|
117
118
|
|
|
119
|
+
// When we start resizing a column we need to ensure the underlying tooltip is removed from the decoration to avoid
|
|
120
|
+
// unnecessary tooltips being displayed during drag.
|
|
121
|
+
updateResizeHandleDecorations(undefined, undefined, false)(state, dispatch);
|
|
122
|
+
|
|
118
123
|
function finish(event: MouseEvent) {
|
|
119
124
|
window.removeEventListener('mouseup', finish);
|
|
120
125
|
window.removeEventListener('mousemove', move);
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import classnames from 'classnames';
|
|
2
2
|
|
|
3
3
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
4
|
+
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
5
5
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
6
6
|
import type {
|
|
7
7
|
GetEditorContainerWidth,
|
|
8
8
|
GetEditorFeatureFlags,
|
|
9
9
|
} from '@atlaskit/editor-common/types';
|
|
10
10
|
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
ColumnResizingPluginState,
|
|
14
|
-
} from '../../types';
|
|
11
|
+
import { TableCssClassName as ClassName } from '../../types';
|
|
12
|
+
import type { ColumnResizingPluginState } from '../../types';
|
|
15
13
|
|
|
16
14
|
import { setResizeHandlePos } from './commands';
|
|
17
15
|
import { handleMouseDown } from './event-handlers';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
2
2
|
import { tableCellMinWidth } from '@atlaskit/editor-common/styles';
|
|
3
|
-
import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
-
import { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import type { DomAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
6
6
|
import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
|
|
7
7
|
|
|
@@ -15,9 +15,10 @@ import {
|
|
|
15
15
|
getTotalWidth,
|
|
16
16
|
updateColgroup,
|
|
17
17
|
} from '../utils/resize-state';
|
|
18
|
-
import { ResizeState } from '../utils/types';
|
|
18
|
+
import type { ResizeState } from '../utils/types';
|
|
19
19
|
|
|
20
20
|
import { hasTableBeenResized, insertColgroupFromNode } from './colgroup';
|
|
21
|
+
import { syncStickyRowToTable } from './dom';
|
|
21
22
|
|
|
22
23
|
export interface ScaleOptions {
|
|
23
24
|
node: PMNode;
|
|
@@ -169,6 +170,7 @@ export const previewScaleTable = (
|
|
|
169
170
|
}
|
|
170
171
|
|
|
171
172
|
if (!hasTableBeenResized(node)) {
|
|
173
|
+
syncStickyRowToTable(tableRef);
|
|
172
174
|
return;
|
|
173
175
|
}
|
|
174
176
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defaultTableSelection } from './pm-plugins/default-table-selection';
|
|
2
|
-
import { TablePluginAction, TablePluginState } from './types';
|
|
2
|
+
import type { TablePluginAction, TablePluginState } from './types';
|
|
3
3
|
|
|
4
4
|
export default (
|
|
5
5
|
pluginState: TablePluginState,
|
|
@@ -87,11 +87,59 @@ export default (
|
|
|
87
87
|
if (
|
|
88
88
|
action.data.resizeHandleColumnIndex ===
|
|
89
89
|
pluginState.resizeHandleColumnIndex &&
|
|
90
|
-
action.data.resizeHandleRowIndex === pluginState.resizeHandleRowIndex
|
|
90
|
+
action.data.resizeHandleRowIndex === pluginState.resizeHandleRowIndex &&
|
|
91
|
+
action.data.resizeHandleIncludeTooltip ===
|
|
92
|
+
pluginState.resizeHandleIncludeTooltip
|
|
91
93
|
) {
|
|
92
94
|
return pluginState;
|
|
93
95
|
}
|
|
94
|
-
return {
|
|
96
|
+
return {
|
|
97
|
+
...pluginState,
|
|
98
|
+
...action.data,
|
|
99
|
+
isResizeHandleWidgetAdded: true,
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
case 'UPDATE_RESIZE_HANDLE_DECORATIONS':
|
|
103
|
+
const {
|
|
104
|
+
resizeHandleColumnIndex,
|
|
105
|
+
resizeHandleRowIndex,
|
|
106
|
+
resizeHandleIncludeTooltip,
|
|
107
|
+
} = action.data;
|
|
108
|
+
|
|
109
|
+
if (
|
|
110
|
+
(resizeHandleColumnIndex === pluginState.resizeHandleColumnIndex ||
|
|
111
|
+
!Number.isFinite(resizeHandleColumnIndex)) &&
|
|
112
|
+
(resizeHandleRowIndex === pluginState.resizeHandleRowIndex ||
|
|
113
|
+
!Number.isFinite(resizeHandleRowIndex)) &&
|
|
114
|
+
(resizeHandleIncludeTooltip ===
|
|
115
|
+
pluginState.resizeHandleIncludeTooltip ||
|
|
116
|
+
resizeHandleIncludeTooltip === undefined)
|
|
117
|
+
) {
|
|
118
|
+
return pluginState;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return {
|
|
122
|
+
...pluginState,
|
|
123
|
+
resizeHandleColumnIndex:
|
|
124
|
+
resizeHandleColumnIndex ?? pluginState.resizeHandleColumnIndex,
|
|
125
|
+
resizeHandleRowIndex:
|
|
126
|
+
resizeHandleRowIndex ?? pluginState.resizeHandleRowIndex,
|
|
127
|
+
resizeHandleIncludeTooltip:
|
|
128
|
+
resizeHandleIncludeTooltip ?? pluginState.resizeHandleIncludeTooltip,
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
case 'REMOVE_RESIZE_HANDLE_DECORATIONS':
|
|
132
|
+
if (!pluginState.isResizeHandleWidgetAdded) {
|
|
133
|
+
return pluginState;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return {
|
|
137
|
+
...pluginState,
|
|
138
|
+
...action.data,
|
|
139
|
+
resizeHandleColumnIndex: undefined,
|
|
140
|
+
resizeHandleRowIndex: undefined,
|
|
141
|
+
isResizeHandleWidgetAdded: false,
|
|
142
|
+
};
|
|
95
143
|
|
|
96
144
|
case 'SET_TABLE_REF':
|
|
97
145
|
case 'HOVER_ROWS':
|
|
@@ -115,11 +115,15 @@ export interface TablePluginState {
|
|
|
115
115
|
isFullWidthModeEnabled?: boolean;
|
|
116
116
|
layout?: TableLayout;
|
|
117
117
|
ordering?: TableColumnOrdering;
|
|
118
|
+
isResizeHandleWidgetAdded?: boolean;
|
|
118
119
|
resizeHandleRowIndex?: number;
|
|
119
120
|
resizeHandleColumnIndex?: number;
|
|
121
|
+
resizeHandleIncludeTooltip?: boolean;
|
|
120
122
|
// for table wrap/collapse
|
|
121
123
|
isTableCollapsed?: boolean; // is the current table already in an expand?
|
|
122
124
|
canCollapseTable?: boolean; // enabled/disabled state of collapse option
|
|
125
|
+
|
|
126
|
+
getIntl: () => IntlShape;
|
|
123
127
|
}
|
|
124
128
|
|
|
125
129
|
export type TablePluginAction =
|
|
@@ -175,8 +179,22 @@ export type TablePluginAction =
|
|
|
175
179
|
decorationSet: DecorationSet;
|
|
176
180
|
resizeHandleRowIndex: number;
|
|
177
181
|
resizeHandleColumnIndex: number;
|
|
182
|
+
resizeHandleIncludeTooltip: boolean;
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
| {
|
|
186
|
+
type: 'UPDATE_RESIZE_HANDLE_DECORATIONS';
|
|
187
|
+
data: {
|
|
188
|
+
decorationSet: DecorationSet;
|
|
189
|
+
resizeHandleRowIndex: number | undefined;
|
|
190
|
+
resizeHandleColumnIndex: number | undefined;
|
|
191
|
+
resizeHandleIncludeTooltip: boolean | undefined;
|
|
178
192
|
};
|
|
179
193
|
}
|
|
194
|
+
| {
|
|
195
|
+
type: 'REMOVE_RESIZE_HANDLE_DECORATIONS';
|
|
196
|
+
data: { decorationSet: DecorationSet };
|
|
197
|
+
}
|
|
180
198
|
| { type: 'CLEAR_HOVER_SELECTION'; data: { decorationSet: DecorationSet } }
|
|
181
199
|
| { type: 'SHOW_RESIZE_HANDLE_LINE'; data: { decorationSet: DecorationSet } }
|
|
182
200
|
| { type: 'HIDE_RESIZE_HANDLE_LINE'; data: { decorationSet: DecorationSet } }
|
|
@@ -224,6 +242,7 @@ export enum TableDecorations {
|
|
|
224
242
|
COLUMN_CONTROLS_DECORATIONS = 'COLUMN_CONTROLS_DECORATIONS',
|
|
225
243
|
COLUMN_SELECTED = 'COLUMN_SELECTED',
|
|
226
244
|
COLUMN_RESIZING_HANDLE = 'COLUMN_RESIZING_HANDLE',
|
|
245
|
+
COLUMN_RESIZING_HANDLE_WIDGET = 'COLUMN_RESIZING_HANDLE_WIDGET',
|
|
227
246
|
COLUMN_RESIZING_HANDLE_LINE = 'COLUMN_RESIZING_HANDLE_LINE',
|
|
228
247
|
|
|
229
248
|
LAST_CELL_ELEMENT = 'LAST_CELL_ELEMENT',
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
import { jsx } from '@emotion/react';
|
|
5
|
+
import { useIntl } from 'react-intl-next';
|
|
6
|
+
|
|
7
|
+
import Tooltip from '@atlaskit/tooltip';
|
|
8
|
+
|
|
9
|
+
import { TableCssClassName } from '../../types';
|
|
10
|
+
import messages from '../messages';
|
|
11
|
+
|
|
12
|
+
type Props = {
|
|
13
|
+
startIndex: number;
|
|
14
|
+
endIndex: number;
|
|
15
|
+
includeTooltip?: boolean;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const ColumnResizeWidget: React.FC<Props> = ({
|
|
19
|
+
startIndex,
|
|
20
|
+
endIndex,
|
|
21
|
+
includeTooltip,
|
|
22
|
+
}) => {
|
|
23
|
+
const { formatMessage } = useIntl();
|
|
24
|
+
|
|
25
|
+
if (!includeTooltip) {
|
|
26
|
+
return (
|
|
27
|
+
<div
|
|
28
|
+
className={TableCssClassName.RESIZE_HANDLE_DECORATION}
|
|
29
|
+
data-start-index={startIndex}
|
|
30
|
+
data-end-index={endIndex}
|
|
31
|
+
/>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<Tooltip
|
|
37
|
+
content={formatMessage(messages.adjustColumns)}
|
|
38
|
+
hideTooltipOnClick
|
|
39
|
+
hideTooltipOnMouseDown
|
|
40
|
+
position="mouse"
|
|
41
|
+
mousePosition="auto-start"
|
|
42
|
+
>
|
|
43
|
+
{(tooltipProps) => (
|
|
44
|
+
<div
|
|
45
|
+
className={TableCssClassName.RESIZE_HANDLE_DECORATION}
|
|
46
|
+
data-start-index={startIndex}
|
|
47
|
+
data-end-index={endIndex}
|
|
48
|
+
{...tooltipProps}
|
|
49
|
+
/>
|
|
50
|
+
)}
|
|
51
|
+
</Tooltip>
|
|
52
|
+
);
|
|
53
|
+
};
|
|
@@ -60,4 +60,9 @@ export default defineMessages({
|
|
|
60
60
|
defaultMessage: 'this element',
|
|
61
61
|
description: 'The current element without preset name been selected',
|
|
62
62
|
},
|
|
63
|
+
adjustColumns: {
|
|
64
|
+
id: 'fabric.editor.tables.adjustColumn',
|
|
65
|
+
defaultMessage: 'Adjust column',
|
|
66
|
+
description: 'Tooltip displayed on table column resize handle',
|
|
67
|
+
},
|
|
63
68
|
});
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import { createElement } from 'react';
|
|
2
|
+
|
|
3
|
+
import ReactDOM from 'react-dom';
|
|
4
|
+
import { RawIntlProvider } from 'react-intl-next';
|
|
5
|
+
import type { IntlShape } from 'react-intl-next';
|
|
6
|
+
|
|
1
7
|
import type { CellAttributes } from '@atlaskit/adf-schema';
|
|
2
8
|
import { nonNullable } from '@atlaskit/editor-common/utils';
|
|
3
9
|
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
@@ -19,6 +25,7 @@ import {
|
|
|
19
25
|
|
|
20
26
|
import type { Cell, CellColumnPositioning } from '../types';
|
|
21
27
|
import { TableCssClassName as ClassName, TableDecorations } from '../types';
|
|
28
|
+
import { ColumnResizeWidget } from '../ui/ColumnResizeWidget';
|
|
22
29
|
|
|
23
30
|
const filterDecorationByKey = (
|
|
24
31
|
key: TableDecorations,
|
|
@@ -238,7 +245,6 @@ export const updateDecorations = (
|
|
|
238
245
|
): DecorationSet => {
|
|
239
246
|
const filteredDecorations = filterDecorationByKey(key, decorationSet);
|
|
240
247
|
const decorationSetFiltered = decorationSet.remove(filteredDecorations);
|
|
241
|
-
|
|
242
248
|
return decorationSetFiltered.add(node, decorations);
|
|
243
249
|
};
|
|
244
250
|
|
|
@@ -327,6 +333,8 @@ export const createResizeHandleDecoration = (
|
|
|
327
333
|
tr: Transaction | ReadonlyTransaction,
|
|
328
334
|
rowIndexTarget: number,
|
|
329
335
|
columnEndIndexTarget: Omit<CellColumnPositioning, 'left'>,
|
|
336
|
+
includeTooltip: boolean = false,
|
|
337
|
+
getIntl: () => IntlShape,
|
|
330
338
|
): [Decoration[], Decoration[]] => {
|
|
331
339
|
const emptyResult: [Decoration[], Decoration[]] = [[], []];
|
|
332
340
|
const table = findTable(tr.selection);
|
|
@@ -351,13 +359,27 @@ export const createResizeHandleDecoration = (
|
|
|
351
359
|
position,
|
|
352
360
|
() => {
|
|
353
361
|
const element = document.createElement('div');
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
362
|
+
ReactDOM.render(
|
|
363
|
+
createElement(
|
|
364
|
+
RawIntlProvider,
|
|
365
|
+
{ value: getIntl() },
|
|
366
|
+
createElement(ColumnResizeWidget, {
|
|
367
|
+
startIndex: cellColumnPositioning.left,
|
|
368
|
+
endIndex: cellColumnPositioning.right,
|
|
369
|
+
includeTooltip,
|
|
370
|
+
}),
|
|
371
|
+
),
|
|
372
|
+
element,
|
|
373
|
+
);
|
|
357
374
|
return element;
|
|
358
375
|
},
|
|
359
376
|
{
|
|
360
|
-
key: `${
|
|
377
|
+
key: `${
|
|
378
|
+
TableDecorations.COLUMN_RESIZING_HANDLE_WIDGET
|
|
379
|
+
}_${rowIndex}_${columnIndex}_${includeTooltip ? 'with' : 'no'}-tooltip`,
|
|
380
|
+
destroy: (node) => {
|
|
381
|
+
ReactDOM.unmountComponentAtNode(node as HTMLDivElement);
|
|
382
|
+
},
|
|
361
383
|
},
|
|
362
384
|
);
|
|
363
385
|
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
## API Report File for "@atlaskit/editor-plugin-table"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
|
|
7
|
+
import type { AnalyticsEventPayload } from '@atlaskit/editor-common/analytics';
|
|
8
|
+
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
9
|
+
import type { Command } from '@atlaskit/editor-common/types';
|
|
10
|
+
import type { ContentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
11
|
+
import type { EditorSelectionAPI } from '@atlaskit/editor-common/selection';
|
|
12
|
+
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
13
|
+
import type { GuidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
14
|
+
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
15
|
+
import type { TableLayout } from '@atlaskit/adf-schema';
|
|
16
|
+
import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
|
|
17
|
+
|
|
18
|
+
// @public (undocumented)
|
|
19
|
+
type InsertTableAction = (analyticsPayload: AnalyticsEventPayload) => Command;
|
|
20
|
+
|
|
21
|
+
// @public (undocumented)
|
|
22
|
+
type PermittedLayoutsDescriptor = 'all' | TableLayout[];
|
|
23
|
+
|
|
24
|
+
// @public (undocumented)
|
|
25
|
+
interface PluginConfig {
|
|
26
|
+
// (undocumented)
|
|
27
|
+
advanced?: boolean;
|
|
28
|
+
// (undocumented)
|
|
29
|
+
allowAddColumnWithCustomStep?: boolean;
|
|
30
|
+
// (undocumented)
|
|
31
|
+
allowBackgroundColor?: boolean;
|
|
32
|
+
// (undocumented)
|
|
33
|
+
allowCellOptionsInFloatingToolbar?: boolean;
|
|
34
|
+
// (undocumented)
|
|
35
|
+
allowCollapse?: boolean;
|
|
36
|
+
// (undocumented)
|
|
37
|
+
allowColumnResizing?: boolean;
|
|
38
|
+
// (undocumented)
|
|
39
|
+
allowColumnSorting?: boolean;
|
|
40
|
+
// (undocumented)
|
|
41
|
+
allowControls?: boolean;
|
|
42
|
+
// (undocumented)
|
|
43
|
+
allowDistributeColumns?: boolean;
|
|
44
|
+
// (undocumented)
|
|
45
|
+
allowHeaderColumn?: boolean;
|
|
46
|
+
// (undocumented)
|
|
47
|
+
allowHeaderRow?: boolean;
|
|
48
|
+
// (undocumented)
|
|
49
|
+
allowMergeCells?: boolean;
|
|
50
|
+
// (undocumented)
|
|
51
|
+
allowNumberColumn?: boolean;
|
|
52
|
+
// (undocumented)
|
|
53
|
+
initialRenderOptimization?: boolean;
|
|
54
|
+
// (undocumented)
|
|
55
|
+
isHeaderRowRequired?: boolean;
|
|
56
|
+
// (undocumented)
|
|
57
|
+
mouseMoveOptimization?: boolean;
|
|
58
|
+
// (undocumented)
|
|
59
|
+
permittedLayouts?: PermittedLayoutsDescriptor;
|
|
60
|
+
// (undocumented)
|
|
61
|
+
stickyHeaders?: boolean;
|
|
62
|
+
// (undocumented)
|
|
63
|
+
stickyHeadersOptimization?: boolean;
|
|
64
|
+
// (undocumented)
|
|
65
|
+
tableCellOptimization?: boolean;
|
|
66
|
+
// (undocumented)
|
|
67
|
+
tableOverflowShadowsOptimization?: boolean;
|
|
68
|
+
// (undocumented)
|
|
69
|
+
tableRenderOptimization?: boolean;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// @public (undocumented)
|
|
73
|
+
export type TablePlugin = NextEditorPlugin<'table', {
|
|
74
|
+
pluginConfiguration: TablePluginOptions | undefined;
|
|
75
|
+
actions: {
|
|
76
|
+
insertTable: InsertTableAction;
|
|
77
|
+
};
|
|
78
|
+
dependencies: [
|
|
79
|
+
AnalyticsPlugin,
|
|
80
|
+
ContentInsertionPlugin,
|
|
81
|
+
WidthPlugin,
|
|
82
|
+
GuidelinePlugin
|
|
83
|
+
];
|
|
84
|
+
}>;
|
|
85
|
+
|
|
86
|
+
// @public (undocumented)
|
|
87
|
+
interface TablePluginOptions {
|
|
88
|
+
// (undocumented)
|
|
89
|
+
allowContextualMenu?: boolean;
|
|
90
|
+
// (undocumented)
|
|
91
|
+
breakoutEnabled?: boolean;
|
|
92
|
+
// (undocumented)
|
|
93
|
+
editorSelectionAPI?: EditorSelectionAPI;
|
|
94
|
+
// (undocumented)
|
|
95
|
+
fullWidthEnabled?: boolean;
|
|
96
|
+
// (undocumented)
|
|
97
|
+
getEditorFeatureFlags?: GetEditorFeatureFlags;
|
|
98
|
+
// (undocumented)
|
|
99
|
+
tableOptions: PluginConfig;
|
|
100
|
+
// (undocumented)
|
|
101
|
+
tableResizingEnabled?: boolean;
|
|
102
|
+
// (undocumented)
|
|
103
|
+
wasFullWidthEnabled?: boolean;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// @public (undocumented)
|
|
107
|
+
export const tablesPlugin: TablePlugin;
|
|
108
|
+
|
|
109
|
+
// (No @packageDocumentation comment for this package)
|
|
110
|
+
|
|
111
|
+
```
|