@atlaskit/editor-plugin-table 7.31.0 → 7.31.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 +9 -0
- package/dist/cjs/commands/column-resize.js +10 -8
- package/dist/cjs/commands/misc.js +4 -4
- package/dist/cjs/event-handlers.js +69 -65
- package/dist/cjs/plugin.js +52 -48
- package/dist/cjs/pm-plugins/decorations/utils/column-resizing.js +2 -2
- package/dist/cjs/pm-plugins/keymap.js +18 -15
- package/dist/cjs/pm-plugins/main.js +2 -2
- package/dist/cjs/pm-plugins/table-resizing/event-handlers.js +2 -2
- package/dist/cjs/pm-plugins/table-resizing/plugin.js +2 -2
- package/dist/cjs/pm-plugins/view-mode-sort/index.js +35 -10
- package/dist/cjs/utils/decoration.js +28 -8
- package/dist/es2019/commands/column-resize.js +10 -8
- package/dist/es2019/commands/misc.js +4 -4
- package/dist/es2019/event-handlers.js +4 -4
- package/dist/es2019/plugin.js +12 -7
- package/dist/es2019/pm-plugins/decorations/utils/column-resizing.js +2 -2
- package/dist/es2019/pm-plugins/keymap.js +7 -4
- package/dist/es2019/pm-plugins/main.js +2 -2
- package/dist/es2019/pm-plugins/table-resizing/event-handlers.js +2 -2
- package/dist/es2019/pm-plugins/table-resizing/plugin.js +2 -2
- package/dist/es2019/pm-plugins/view-mode-sort/index.js +33 -10
- package/dist/es2019/utils/decoration.js +26 -9
- package/dist/esm/commands/column-resize.js +10 -8
- package/dist/esm/commands/misc.js +4 -4
- package/dist/esm/event-handlers.js +69 -65
- package/dist/esm/plugin.js +52 -48
- package/dist/esm/pm-plugins/decorations/utils/column-resizing.js +2 -2
- package/dist/esm/pm-plugins/keymap.js +18 -15
- package/dist/esm/pm-plugins/main.js +2 -2
- package/dist/esm/pm-plugins/table-resizing/event-handlers.js +2 -2
- package/dist/esm/pm-plugins/table-resizing/plugin.js +2 -2
- package/dist/esm/pm-plugins/view-mode-sort/index.js +35 -10
- package/dist/esm/utils/decoration.js +28 -8
- package/dist/types/commands/column-resize.d.ts +5 -2
- package/dist/types/commands/misc.d.ts +3 -2
- package/dist/types/event-handlers.d.ts +2 -1
- package/dist/types/pm-plugins/decorations/utils/column-resizing.d.ts +2 -1
- package/dist/types/pm-plugins/keymap.d.ts +2 -1
- package/dist/types/pm-plugins/main.d.ts +1 -1
- package/dist/types/pm-plugins/table-resizing/event-handlers.d.ts +2 -1
- package/dist/types/pm-plugins/table-resizing/plugin.d.ts +2 -1
- package/dist/types/pm-plugins/view-mode-sort/index.d.ts +2 -1
- package/dist/types/utils/decoration.d.ts +2 -1
- package/dist/types-ts4.5/commands/column-resize.d.ts +5 -2
- package/dist/types-ts4.5/commands/misc.d.ts +3 -2
- package/dist/types-ts4.5/event-handlers.d.ts +2 -1
- package/dist/types-ts4.5/pm-plugins/decorations/utils/column-resizing.d.ts +2 -1
- package/dist/types-ts4.5/pm-plugins/keymap.d.ts +2 -1
- package/dist/types-ts4.5/pm-plugins/main.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/table-resizing/event-handlers.d.ts +2 -1
- package/dist/types-ts4.5/pm-plugins/table-resizing/plugin.d.ts +2 -1
- package/dist/types-ts4.5/pm-plugins/view-mode-sort/index.d.ts +2 -1
- package/dist/types-ts4.5/utils/decoration.d.ts +2 -1
- package/package.json +9 -5
- package/src/commands/column-resize.ts +18 -1
- package/src/commands/misc.ts +5 -0
- package/src/event-handlers.ts +22 -20
- package/src/plugin.tsx +10 -4
- package/src/pm-plugins/decorations/utils/column-resizing.ts +3 -0
- package/src/pm-plugins/keymap.ts +5 -0
- package/src/pm-plugins/main.ts +2 -1
- package/src/pm-plugins/table-resizing/event-handlers.ts +8 -1
- package/src/pm-plugins/table-resizing/plugin.ts +3 -0
- package/src/pm-plugins/view-mode-sort/index.ts +73 -34
- package/src/utils/decoration.ts +39 -13
|
@@ -15,16 +15,18 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
15
15
|
import { createElement } from 'react';
|
|
16
16
|
import ReactDOM from 'react-dom';
|
|
17
17
|
import { RawIntlProvider } from 'react-intl-next';
|
|
18
|
+
import uuid from 'uuid/v4';
|
|
18
19
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
19
20
|
import { SortOrder } from '@atlaskit/editor-common/types';
|
|
20
21
|
import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
21
22
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
23
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
22
24
|
import { SortingIconWrapper } from '../../ui/icons/SortingIconWrapper';
|
|
23
25
|
import { getPluginState } from '../plugin-factory';
|
|
24
26
|
import { IS_DISABLED_CLASS_NAME, SORT_INDEX_DATA_ATTRIBUTE, SORTING_ICON_CLASS_NAME } from './consts';
|
|
25
27
|
import { tableViewModeSortPluginKey as key } from './plugin-key';
|
|
26
28
|
import { getTableElements, toggleSort } from './utils';
|
|
27
|
-
export var createPlugin = function createPlugin(api) {
|
|
29
|
+
export var createPlugin = function createPlugin(api, nodeViewPortalProviderAPI) {
|
|
28
30
|
return new SafePlugin({
|
|
29
31
|
state: {
|
|
30
32
|
init: function init() {
|
|
@@ -97,6 +99,7 @@ export var createPlugin = function createPlugin(api) {
|
|
|
97
99
|
var map = TableMap.get(tableNode);
|
|
98
100
|
var hasMergedCells = new Set(map.map).size !== map.map.length;
|
|
99
101
|
map.mapByRow[0].forEach(function (cell, index) {
|
|
102
|
+
var decorationRenderKey = uuid();
|
|
100
103
|
decs.push(Decoration.widget(cell + pos + 2, function () {
|
|
101
104
|
var _sort$tableId;
|
|
102
105
|
var element = document.createElement('div');
|
|
@@ -114,16 +117,38 @@ export var createPlugin = function createPlugin(api) {
|
|
|
114
117
|
}
|
|
115
118
|
var _getPluginState = getPluginState(oldState),
|
|
116
119
|
getIntl = _getPluginState.getIntl;
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
120
|
+
if (fg('platform_editor_react18_plugin_portalprovider')) {
|
|
121
|
+
nodeViewPortalProviderAPI.render(function () {
|
|
122
|
+
return /*#__PURE__*/createElement(RawIntlProvider, {
|
|
123
|
+
value: getIntl()
|
|
124
|
+
}, /*#__PURE__*/createElement(SortingIconWrapper, {
|
|
125
|
+
isSortingAllowed: !hasMergedCells,
|
|
126
|
+
sortOrdered: sortOrdered,
|
|
127
|
+
onClick: function onClick() {},
|
|
128
|
+
onKeyDown: function onKeyDown() {},
|
|
129
|
+
api: api
|
|
130
|
+
}));
|
|
131
|
+
}, element, decorationRenderKey);
|
|
132
|
+
} else {
|
|
133
|
+
ReactDOM.render( /*#__PURE__*/createElement(RawIntlProvider, {
|
|
134
|
+
value: getIntl()
|
|
135
|
+
}, /*#__PURE__*/createElement(SortingIconWrapper, {
|
|
136
|
+
isSortingAllowed: !hasMergedCells,
|
|
137
|
+
sortOrdered: sortOrdered,
|
|
138
|
+
onClick: function onClick() {},
|
|
139
|
+
onKeyDown: function onKeyDown() {},
|
|
140
|
+
api: api
|
|
141
|
+
})), element);
|
|
142
|
+
}
|
|
126
143
|
return element;
|
|
144
|
+
}, {
|
|
145
|
+
destroy: function destroy(node) {
|
|
146
|
+
if (fg('platform_editor_react18_plugin_portalprovider')) {
|
|
147
|
+
nodeViewPortalProviderAPI.remove(decorationRenderKey);
|
|
148
|
+
} else {
|
|
149
|
+
ReactDOM.unmountComponentAtNode(node);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
127
152
|
}));
|
|
128
153
|
});
|
|
129
154
|
});
|
|
@@ -2,6 +2,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
2
2
|
import { createElement } from 'react';
|
|
3
3
|
import ReactDOM from 'react-dom';
|
|
4
4
|
import { RawIntlProvider } from 'react-intl-next';
|
|
5
|
+
import uuid from 'uuid/v4';
|
|
5
6
|
import { nonNullable } from '@atlaskit/editor-common/utils';
|
|
6
7
|
|
|
7
8
|
// @ts-ignore -- ReadonlyTransaction is a local declaration and will cause a TS2305 error in CCFE typecheck
|
|
@@ -9,6 +10,7 @@ import { nonNullable } from '@atlaskit/editor-common/utils';
|
|
|
9
10
|
import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
10
11
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
11
12
|
import { findTable, getCellsInRow, getSelectionRect } from '@atlaskit/editor-tables/utils';
|
|
13
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
14
|
import { TableCssClassName as ClassName, TableDecorations } from '../types';
|
|
13
15
|
import { ColumnResizeWidget } from '../ui/ColumnResizeWidget';
|
|
14
16
|
var filterDecorationByKey = function filterDecorationByKey(key, decorationSet) {
|
|
@@ -245,6 +247,7 @@ var makeArray = function makeArray(n) {
|
|
|
245
247
|
export var createResizeHandleDecoration = function createResizeHandleDecoration(tr, rowIndexTarget, columnEndIndexTarget) {
|
|
246
248
|
var includeTooltip = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
247
249
|
var getIntl = arguments.length > 4 ? arguments[4] : undefined;
|
|
250
|
+
var nodeViewPortalProviderAPI = arguments.length > 5 ? arguments[5] : undefined;
|
|
248
251
|
var emptyResult = [[], []];
|
|
249
252
|
var table = findTable(tr.selection);
|
|
250
253
|
if (!table || !table.node) {
|
|
@@ -255,21 +258,38 @@ export var createResizeHandleDecoration = function createResizeHandleDecoration(
|
|
|
255
258
|
return emptyResult;
|
|
256
259
|
}
|
|
257
260
|
var createResizerHandleDecoration = function createResizerHandleDecoration(cellColumnPositioning, columnIndex, rowIndex, cellPos, cellNode) {
|
|
261
|
+
var decorationRenderKey = uuid();
|
|
258
262
|
var position = cellPos + cellNode.nodeSize - 1;
|
|
259
263
|
return Decoration.widget(position, function () {
|
|
260
264
|
var element = document.createElement('div');
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
265
|
+
if (fg('platform_editor_react18_plugin_portalprovider')) {
|
|
266
|
+
nodeViewPortalProviderAPI.render(function () {
|
|
267
|
+
return /*#__PURE__*/createElement(RawIntlProvider, {
|
|
268
|
+
value: getIntl()
|
|
269
|
+
}, /*#__PURE__*/createElement(ColumnResizeWidget, {
|
|
270
|
+
startIndex: cellColumnPositioning.left,
|
|
271
|
+
endIndex: cellColumnPositioning.right,
|
|
272
|
+
includeTooltip: includeTooltip
|
|
273
|
+
}));
|
|
274
|
+
}, element, decorationRenderKey);
|
|
275
|
+
} else {
|
|
276
|
+
ReactDOM.render( /*#__PURE__*/createElement(RawIntlProvider, {
|
|
277
|
+
value: getIntl()
|
|
278
|
+
}, /*#__PURE__*/createElement(ColumnResizeWidget, {
|
|
279
|
+
startIndex: cellColumnPositioning.left,
|
|
280
|
+
endIndex: cellColumnPositioning.right,
|
|
281
|
+
includeTooltip: includeTooltip
|
|
282
|
+
})), element);
|
|
283
|
+
}
|
|
268
284
|
return element;
|
|
269
285
|
}, {
|
|
270
286
|
key: "".concat(TableDecorations.COLUMN_RESIZING_HANDLE_WIDGET, "_").concat(rowIndex, "_").concat(columnIndex, "_").concat(includeTooltip ? 'with' : 'no', "-tooltip"),
|
|
271
287
|
destroy: function destroy(node) {
|
|
272
|
-
|
|
288
|
+
if (fg('platform_editor_react18_plugin_portalprovider')) {
|
|
289
|
+
nodeViewPortalProviderAPI.remove(decorationRenderKey);
|
|
290
|
+
} else {
|
|
291
|
+
ReactDOM.unmountComponentAtNode(node);
|
|
292
|
+
}
|
|
273
293
|
}
|
|
274
294
|
});
|
|
275
295
|
};
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import type { IntlShape } from 'react-intl-next/src/types';
|
|
2
|
+
import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
2
3
|
import type { Command, GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
3
4
|
import type { AriaLiveElementAttributes } from '@atlaskit/editor-plugin-accessibility-utils';
|
|
4
5
|
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
5
6
|
import type { Direction } from '@atlaskit/editor-tables/types';
|
|
6
7
|
import type { PluginInjectionAPI } from '../types';
|
|
7
|
-
export declare const initiateKeyboardColumnResizing: ({ ariaNotify, getIntl, }: {
|
|
8
|
+
export declare const initiateKeyboardColumnResizing: ({ ariaNotify, getIntl, nodeViewPortalProviderAPI, }: {
|
|
8
9
|
ariaNotify?: ((message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void) | undefined;
|
|
9
10
|
getIntl?: (() => IntlShape) | undefined;
|
|
11
|
+
nodeViewPortalProviderAPI: PortalProviderAPI;
|
|
10
12
|
}) => Command;
|
|
11
|
-
export declare const activateNextResizeArea: ({ direction, ariaNotify, getIntl, }: {
|
|
13
|
+
export declare const activateNextResizeArea: ({ direction, ariaNotify, getIntl, nodeViewPortalProviderAPI, }: {
|
|
12
14
|
direction: Direction;
|
|
13
15
|
ariaNotify?: ((message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void) | undefined;
|
|
14
16
|
getIntl?: (() => IntlShape) | undefined;
|
|
17
|
+
nodeViewPortalProviderAPI: PortalProviderAPI;
|
|
15
18
|
}) => Command;
|
|
16
19
|
export declare const changeColumnWidthByStep: ({ stepSize, getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, isCommentEditor, ariaNotify, api, getIntl, }: {
|
|
17
20
|
stepSize: number;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { TableLayout } from '@atlaskit/adf-schema';
|
|
2
|
+
import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
2
3
|
import type { Command, EditorCommand } from '@atlaskit/editor-common/types';
|
|
3
4
|
import type { Node as PMNode, Schema, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
4
5
|
import type { EditorState, Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
@@ -28,8 +29,8 @@ export declare const selectRows: (rowIndexes: number[]) => Command;
|
|
|
28
29
|
export declare const showInsertColumnButton: (columnIndex: number) => Command;
|
|
29
30
|
export declare const showInsertRowButton: (rowIndex: number) => Command;
|
|
30
31
|
export declare const hideInsertColumnOrRowButton: () => Command;
|
|
31
|
-
export declare const addResizeHandleDecorations: (rowIndex: number, columnIndex: number, includeTooltip: boolean, isKeyboardResize?: boolean) => Command;
|
|
32
|
-
export declare const updateResizeHandleDecorations: (rowIndex?: number, columnIndex?: number, includeTooltip?: boolean) => Command;
|
|
32
|
+
export declare const addResizeHandleDecorations: (rowIndex: number, columnIndex: number, includeTooltip: boolean, nodeViewPortalProviderAPI: PortalProviderAPI, isKeyboardResize?: boolean) => Command;
|
|
33
|
+
export declare const updateResizeHandleDecorations: (nodeViewPortalProviderAPI: PortalProviderAPI, rowIndex?: number, columnIndex?: number, includeTooltip?: boolean) => Command;
|
|
33
34
|
export declare const removeResizeHandleDecorations: () => Command;
|
|
34
35
|
export declare const autoSizeTable: (view: EditorView, node: PMNode, table: HTMLTableElement, basePos: number | undefined, opts: {
|
|
35
36
|
containerWidth: number;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
2
3
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
4
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
5
|
import type { PluginInjectionAPI } from './types';
|
|
@@ -11,7 +12,7 @@ export declare const handleMouseDown: (_: EditorView, event: Event) => boolean;
|
|
|
11
12
|
export declare const handleMouseOut: (view: EditorView, mouseEvent: Event) => boolean;
|
|
12
13
|
export declare const handleMouseEnter: (view: EditorView, mouseEvent: Event) => boolean;
|
|
13
14
|
export declare const handleMouseLeave: (view: EditorView, event: Event) => boolean;
|
|
14
|
-
export declare const handleMouseMove: (view: EditorView, event: Event) => boolean;
|
|
15
|
+
export declare const handleMouseMove: (nodeViewPortalProviderAPI: PortalProviderAPI) => (view: EditorView, event: Event) => boolean;
|
|
15
16
|
export declare function handleTripleClick(view: EditorView, pos: number): boolean;
|
|
16
17
|
export declare const handleCut: (oldTr: Transaction, oldState: EditorState, newState: EditorState, api: PluginInjectionAPI | undefined | null, editorAnalyticsAPI?: EditorAnalyticsAPI, editorView?: EditorView, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Transaction;
|
|
17
18
|
export declare const isTableInFocus: (view: EditorView) => boolean;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { IntlShape } from 'react-intl-next';
|
|
2
|
+
import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
2
3
|
import type { DecorationTransformer } from './types';
|
|
3
|
-
export declare const buildColumnResizingDecorations: (rowEndIndex: number, columnEndIndex: number, includeTooltip: boolean, getIntl: () => IntlShape) => DecorationTransformer;
|
|
4
|
+
export declare const buildColumnResizingDecorations: (rowEndIndex: number, columnEndIndex: number, includeTooltip: boolean, getIntl: () => IntlShape, nodeViewPortalProviderAPI: PortalProviderAPI) => DecorationTransformer;
|
|
4
5
|
export declare const clearColumnResizingDecorations: () => DecorationTransformer;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { IntlShape } from 'react-intl-next/src/types';
|
|
2
2
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
3
4
|
import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
5
|
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
5
6
|
import type { PluginInjectionAPI, PluginInjectionAPIWithA11y } from '../types';
|
|
6
|
-
export declare function keymapPlugin(getEditorContainerWidth: GetEditorContainerWidth, api: PluginInjectionAPI | undefined | null, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, dragAndDropEnabled?: boolean, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isFullWidthEnabled?: boolean, pluginInjectionApi?: PluginInjectionAPIWithA11y, getIntl?: () => IntlShape, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean, isChromelessEditor?: boolean, isTableResizingEnabled?: boolean): SafePlugin;
|
|
7
|
+
export declare function keymapPlugin(getEditorContainerWidth: GetEditorContainerWidth, api: PluginInjectionAPI | undefined | null, nodeViewPortalProviderAPI: PortalProviderAPI, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, dragAndDropEnabled?: boolean, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isFullWidthEnabled?: boolean, pluginInjectionApi?: PluginInjectionAPIWithA11y, getIntl?: () => IntlShape, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean, isChromelessEditor?: boolean, isTableResizingEnabled?: boolean): SafePlugin;
|
|
7
8
|
export default keymapPlugin;
|
|
@@ -5,4 +5,4 @@ import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
|
5
5
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
6
6
|
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
7
7
|
import type { PluginConfig, PluginInjectionAPI } from '../types';
|
|
8
|
-
export declare const createPlugin: (dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, pluginConfig: PluginConfig, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, getIntl: () => IntlShape, tableResizingEnabled?: boolean, fullWidthModeEnabled?: boolean, previousFullWidthModeEnabled?: boolean, dragAndDropEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, pluginInjectionApi?: PluginInjectionAPI, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean, isChromelessEditor?: boolean) => SafePlugin<import("../types").TablePluginState>;
|
|
8
|
+
export declare const createPlugin: (dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, portalProviderAPI: PortalProviderAPI, nodeViewPortalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, pluginConfig: PluginConfig, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, getIntl: () => IntlShape, tableResizingEnabled?: boolean, fullWidthModeEnabled?: boolean, previousFullWidthModeEnabled?: boolean, dragAndDropEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, pluginInjectionApi?: PluginInjectionAPI, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean, isChromelessEditor?: boolean) => SafePlugin<import("../types").TablePluginState>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
2
3
|
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
3
4
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
5
|
import type { PluginInjectionAPI } from '../../types';
|
|
5
|
-
export declare const handleMouseDown: (view: EditorView, event: MouseEvent, localResizeHandlePos: number, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, isTableScalingEnabled: boolean, api: PluginInjectionAPI | undefined | null, editorAnalyticsAPI?: EditorAnalyticsAPI, isNewColumnResizingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isCommentEditor?: boolean) => boolean;
|
|
6
|
+
export declare const handleMouseDown: (view: EditorView, event: MouseEvent, localResizeHandlePos: number, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, isTableScalingEnabled: boolean, api: PluginInjectionAPI | undefined | null, nodeViewPortalProviderAPI: PortalProviderAPI, editorAnalyticsAPI?: EditorAnalyticsAPI, isNewColumnResizingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isCommentEditor?: boolean) => boolean;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
3
|
+
import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
3
4
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
5
|
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
5
6
|
import type { ColumnResizingPluginState, PluginInjectionAPI } from '../../types';
|
|
6
|
-
export declare function createPlugin(dispatch: Dispatch<ColumnResizingPluginState>, { lastColumnResizable }: ColumnResizingPluginState, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, api: PluginInjectionAPI | undefined | null, editorAnalyticsAPI?: EditorAnalyticsAPI, isTableScalingEnabled?: boolean, isNewColumnResizingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isCommentEditor?: boolean): SafePlugin<ColumnResizingPluginState>;
|
|
7
|
+
export declare function createPlugin(dispatch: Dispatch<ColumnResizingPluginState>, { lastColumnResizable }: ColumnResizingPluginState, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, api: PluginInjectionAPI | undefined | null, nodeViewPortalProviderAPI: PortalProviderAPI, editorAnalyticsAPI?: EditorAnalyticsAPI, isTableScalingEnabled?: boolean, isNewColumnResizingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isCommentEditor?: boolean): SafePlugin<ColumnResizingPluginState>;
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
* Instead of making changes to the ProseMirror document, the plugin sorts the table rows in the DOM. This allows the sorting to be
|
|
4
4
|
* visible to the user without affecting the document's content.
|
|
5
5
|
*/
|
|
6
|
+
import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
6
7
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
7
8
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
8
9
|
import type tablePlugin from '../../plugin';
|
|
9
10
|
import type { ViewModeSortPluginState } from './types';
|
|
10
|
-
export declare const createPlugin: (api: ExtractInjectionAPI<typeof tablePlugin
|
|
11
|
+
export declare const createPlugin: (api: ExtractInjectionAPI<typeof tablePlugin>, nodeViewPortalProviderAPI: PortalProviderAPI) => SafePlugin<ViewModeSortPluginState>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { IntlShape } from 'react-intl-next';
|
|
2
|
+
import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
2
3
|
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
4
|
import type { ReadonlyTransaction, Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
5
|
import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
@@ -12,7 +13,7 @@ export declare const createControlsHoverDecoration: (cells: Cell[], type: 'row'
|
|
|
12
13
|
export declare const createColumnSelectedDecoration: (tr: Transaction | ReadonlyTransaction) => Decoration[];
|
|
13
14
|
export declare const createColumnControlsDecoration: (selection: Selection) => Decoration[];
|
|
14
15
|
export declare const updateDecorations: (node: PmNode, decorationSet: DecorationSet, decorations: Decoration[], key: TableDecorations) => DecorationSet;
|
|
15
|
-
export declare const createResizeHandleDecoration: (tr: Transaction | ReadonlyTransaction, rowIndexTarget: number, columnEndIndexTarget: Omit<CellColumnPositioning, 'left'>, includeTooltip: boolean | undefined, getIntl: () => IntlShape) => [Decoration[], Decoration[]];
|
|
16
|
+
export declare const createResizeHandleDecoration: (tr: Transaction | ReadonlyTransaction, rowIndexTarget: number, columnEndIndexTarget: Omit<CellColumnPositioning, 'left'>, includeTooltip: boolean | undefined, getIntl: () => IntlShape, nodeViewPortalProviderAPI: PortalProviderAPI) => [Decoration[], Decoration[]];
|
|
16
17
|
export declare const createColumnLineResize: (selection: Selection, cellColumnPositioning: Omit<CellColumnPositioning, 'left'>) => Decoration[];
|
|
17
18
|
export declare const createColumnInsertLine: (columnIndex: number, selection: Selection, hasMergedCells: boolean) => Decoration[];
|
|
18
19
|
export declare const createRowInsertLine: (rowIndex: number, selection: Selection, hasMergedCells: boolean) => Decoration[];
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import type { IntlShape } from 'react-intl-next/src/types';
|
|
2
|
+
import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
2
3
|
import type { Command, GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
3
4
|
import type { AriaLiveElementAttributes } from '@atlaskit/editor-plugin-accessibility-utils';
|
|
4
5
|
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
5
6
|
import type { Direction } from '@atlaskit/editor-tables/types';
|
|
6
7
|
import type { PluginInjectionAPI } from '../types';
|
|
7
|
-
export declare const initiateKeyboardColumnResizing: ({ ariaNotify, getIntl, }: {
|
|
8
|
+
export declare const initiateKeyboardColumnResizing: ({ ariaNotify, getIntl, nodeViewPortalProviderAPI, }: {
|
|
8
9
|
ariaNotify?: ((message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void) | undefined;
|
|
9
10
|
getIntl?: (() => IntlShape) | undefined;
|
|
11
|
+
nodeViewPortalProviderAPI: PortalProviderAPI;
|
|
10
12
|
}) => Command;
|
|
11
|
-
export declare const activateNextResizeArea: ({ direction, ariaNotify, getIntl, }: {
|
|
13
|
+
export declare const activateNextResizeArea: ({ direction, ariaNotify, getIntl, nodeViewPortalProviderAPI, }: {
|
|
12
14
|
direction: Direction;
|
|
13
15
|
ariaNotify?: ((message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void) | undefined;
|
|
14
16
|
getIntl?: (() => IntlShape) | undefined;
|
|
17
|
+
nodeViewPortalProviderAPI: PortalProviderAPI;
|
|
15
18
|
}) => Command;
|
|
16
19
|
export declare const changeColumnWidthByStep: ({ stepSize, getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, isCommentEditor, ariaNotify, api, getIntl, }: {
|
|
17
20
|
stepSize: number;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { TableLayout } from '@atlaskit/adf-schema';
|
|
2
|
+
import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
2
3
|
import type { Command, EditorCommand } from '@atlaskit/editor-common/types';
|
|
3
4
|
import type { Node as PMNode, Schema, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
4
5
|
import type { EditorState, Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
@@ -28,8 +29,8 @@ export declare const selectRows: (rowIndexes: number[]) => Command;
|
|
|
28
29
|
export declare const showInsertColumnButton: (columnIndex: number) => Command;
|
|
29
30
|
export declare const showInsertRowButton: (rowIndex: number) => Command;
|
|
30
31
|
export declare const hideInsertColumnOrRowButton: () => Command;
|
|
31
|
-
export declare const addResizeHandleDecorations: (rowIndex: number, columnIndex: number, includeTooltip: boolean, isKeyboardResize?: boolean) => Command;
|
|
32
|
-
export declare const updateResizeHandleDecorations: (rowIndex?: number, columnIndex?: number, includeTooltip?: boolean) => Command;
|
|
32
|
+
export declare const addResizeHandleDecorations: (rowIndex: number, columnIndex: number, includeTooltip: boolean, nodeViewPortalProviderAPI: PortalProviderAPI, isKeyboardResize?: boolean) => Command;
|
|
33
|
+
export declare const updateResizeHandleDecorations: (nodeViewPortalProviderAPI: PortalProviderAPI, rowIndex?: number, columnIndex?: number, includeTooltip?: boolean) => Command;
|
|
33
34
|
export declare const removeResizeHandleDecorations: () => Command;
|
|
34
35
|
export declare const autoSizeTable: (view: EditorView, node: PMNode, table: HTMLTableElement, basePos: number | undefined, opts: {
|
|
35
36
|
containerWidth: number;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
2
3
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
4
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
5
|
import type { PluginInjectionAPI } from './types';
|
|
@@ -11,7 +12,7 @@ export declare const handleMouseDown: (_: EditorView, event: Event) => boolean;
|
|
|
11
12
|
export declare const handleMouseOut: (view: EditorView, mouseEvent: Event) => boolean;
|
|
12
13
|
export declare const handleMouseEnter: (view: EditorView, mouseEvent: Event) => boolean;
|
|
13
14
|
export declare const handleMouseLeave: (view: EditorView, event: Event) => boolean;
|
|
14
|
-
export declare const handleMouseMove: (view: EditorView, event: Event) => boolean;
|
|
15
|
+
export declare const handleMouseMove: (nodeViewPortalProviderAPI: PortalProviderAPI) => (view: EditorView, event: Event) => boolean;
|
|
15
16
|
export declare function handleTripleClick(view: EditorView, pos: number): boolean;
|
|
16
17
|
export declare const handleCut: (oldTr: Transaction, oldState: EditorState, newState: EditorState, api: PluginInjectionAPI | undefined | null, editorAnalyticsAPI?: EditorAnalyticsAPI, editorView?: EditorView, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Transaction;
|
|
17
18
|
export declare const isTableInFocus: (view: EditorView) => boolean;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { IntlShape } from 'react-intl-next';
|
|
2
|
+
import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
2
3
|
import type { DecorationTransformer } from './types';
|
|
3
|
-
export declare const buildColumnResizingDecorations: (rowEndIndex: number, columnEndIndex: number, includeTooltip: boolean, getIntl: () => IntlShape) => DecorationTransformer;
|
|
4
|
+
export declare const buildColumnResizingDecorations: (rowEndIndex: number, columnEndIndex: number, includeTooltip: boolean, getIntl: () => IntlShape, nodeViewPortalProviderAPI: PortalProviderAPI) => DecorationTransformer;
|
|
4
5
|
export declare const clearColumnResizingDecorations: () => DecorationTransformer;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { IntlShape } from 'react-intl-next/src/types';
|
|
2
2
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
3
4
|
import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
5
|
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
5
6
|
import type { PluginInjectionAPI, PluginInjectionAPIWithA11y } from '../types';
|
|
6
|
-
export declare function keymapPlugin(getEditorContainerWidth: GetEditorContainerWidth, api: PluginInjectionAPI | undefined | null, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, dragAndDropEnabled?: boolean, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isFullWidthEnabled?: boolean, pluginInjectionApi?: PluginInjectionAPIWithA11y, getIntl?: () => IntlShape, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean, isChromelessEditor?: boolean, isTableResizingEnabled?: boolean): SafePlugin;
|
|
7
|
+
export declare function keymapPlugin(getEditorContainerWidth: GetEditorContainerWidth, api: PluginInjectionAPI | undefined | null, nodeViewPortalProviderAPI: PortalProviderAPI, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, dragAndDropEnabled?: boolean, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isFullWidthEnabled?: boolean, pluginInjectionApi?: PluginInjectionAPIWithA11y, getIntl?: () => IntlShape, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean, isChromelessEditor?: boolean, isTableResizingEnabled?: boolean): SafePlugin;
|
|
7
8
|
export default keymapPlugin;
|
|
@@ -5,4 +5,4 @@ import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
|
5
5
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
6
6
|
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
7
7
|
import type { PluginConfig, PluginInjectionAPI } from '../types';
|
|
8
|
-
export declare const createPlugin: (dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, pluginConfig: PluginConfig, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, getIntl: () => IntlShape, tableResizingEnabled?: boolean, fullWidthModeEnabled?: boolean, previousFullWidthModeEnabled?: boolean, dragAndDropEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, pluginInjectionApi?: PluginInjectionAPI, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean, isChromelessEditor?: boolean) => SafePlugin<import("../types").TablePluginState>;
|
|
8
|
+
export declare const createPlugin: (dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, portalProviderAPI: PortalProviderAPI, nodeViewPortalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, pluginConfig: PluginConfig, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, getIntl: () => IntlShape, tableResizingEnabled?: boolean, fullWidthModeEnabled?: boolean, previousFullWidthModeEnabled?: boolean, dragAndDropEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, pluginInjectionApi?: PluginInjectionAPI, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean, isChromelessEditor?: boolean) => SafePlugin<import("../types").TablePluginState>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
2
3
|
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
3
4
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
5
|
import type { PluginInjectionAPI } from '../../types';
|
|
5
|
-
export declare const handleMouseDown: (view: EditorView, event: MouseEvent, localResizeHandlePos: number, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, isTableScalingEnabled: boolean, api: PluginInjectionAPI | undefined | null, editorAnalyticsAPI?: EditorAnalyticsAPI, isNewColumnResizingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isCommentEditor?: boolean) => boolean;
|
|
6
|
+
export declare const handleMouseDown: (view: EditorView, event: MouseEvent, localResizeHandlePos: number, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, isTableScalingEnabled: boolean, api: PluginInjectionAPI | undefined | null, nodeViewPortalProviderAPI: PortalProviderAPI, editorAnalyticsAPI?: EditorAnalyticsAPI, isNewColumnResizingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isCommentEditor?: boolean) => boolean;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
3
|
+
import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
3
4
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
5
|
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
5
6
|
import type { ColumnResizingPluginState, PluginInjectionAPI } from '../../types';
|
|
6
|
-
export declare function createPlugin(dispatch: Dispatch<ColumnResizingPluginState>, { lastColumnResizable }: ColumnResizingPluginState, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, api: PluginInjectionAPI | undefined | null, editorAnalyticsAPI?: EditorAnalyticsAPI, isTableScalingEnabled?: boolean, isNewColumnResizingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isCommentEditor?: boolean): SafePlugin<ColumnResizingPluginState>;
|
|
7
|
+
export declare function createPlugin(dispatch: Dispatch<ColumnResizingPluginState>, { lastColumnResizable }: ColumnResizingPluginState, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, api: PluginInjectionAPI | undefined | null, nodeViewPortalProviderAPI: PortalProviderAPI, editorAnalyticsAPI?: EditorAnalyticsAPI, isTableScalingEnabled?: boolean, isNewColumnResizingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isCommentEditor?: boolean): SafePlugin<ColumnResizingPluginState>;
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
* Instead of making changes to the ProseMirror document, the plugin sorts the table rows in the DOM. This allows the sorting to be
|
|
4
4
|
* visible to the user without affecting the document's content.
|
|
5
5
|
*/
|
|
6
|
+
import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
6
7
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
7
8
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
8
9
|
import type tablePlugin from '../../plugin';
|
|
9
10
|
import type { ViewModeSortPluginState } from './types';
|
|
10
|
-
export declare const createPlugin: (api: ExtractInjectionAPI<typeof tablePlugin
|
|
11
|
+
export declare const createPlugin: (api: ExtractInjectionAPI<typeof tablePlugin>, nodeViewPortalProviderAPI: PortalProviderAPI) => SafePlugin<ViewModeSortPluginState>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { IntlShape } from 'react-intl-next';
|
|
2
|
+
import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
2
3
|
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
4
|
import type { ReadonlyTransaction, Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
5
|
import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
@@ -12,7 +13,7 @@ export declare const createControlsHoverDecoration: (cells: Cell[], type: 'row'
|
|
|
12
13
|
export declare const createColumnSelectedDecoration: (tr: Transaction | ReadonlyTransaction) => Decoration[];
|
|
13
14
|
export declare const createColumnControlsDecoration: (selection: Selection) => Decoration[];
|
|
14
15
|
export declare const updateDecorations: (node: PmNode, decorationSet: DecorationSet, decorations: Decoration[], key: TableDecorations) => DecorationSet;
|
|
15
|
-
export declare const createResizeHandleDecoration: (tr: Transaction | ReadonlyTransaction, rowIndexTarget: number, columnEndIndexTarget: Omit<CellColumnPositioning, 'left'>, includeTooltip: boolean | undefined, getIntl: () => IntlShape) => [
|
|
16
|
+
export declare const createResizeHandleDecoration: (tr: Transaction | ReadonlyTransaction, rowIndexTarget: number, columnEndIndexTarget: Omit<CellColumnPositioning, 'left'>, includeTooltip: boolean | undefined, getIntl: () => IntlShape, nodeViewPortalProviderAPI: PortalProviderAPI) => [
|
|
16
17
|
Decoration[],
|
|
17
18
|
Decoration[]
|
|
18
19
|
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "7.31.
|
|
3
|
+
"version": "7.31.1",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@atlaskit/adf-schema": "^44.2.0",
|
|
31
31
|
"@atlaskit/button": "^20.3.0",
|
|
32
32
|
"@atlaskit/custom-steps": "^0.8.0",
|
|
33
|
-
"@atlaskit/editor-common": "^94.
|
|
33
|
+
"@atlaskit/editor-common": "^94.22.0",
|
|
34
34
|
"@atlaskit/editor-palette": "1.6.3",
|
|
35
35
|
"@atlaskit/editor-plugin-accessibility-utils": "^1.2.0",
|
|
36
36
|
"@atlaskit/editor-plugin-analytics": "^1.10.0",
|
|
@@ -49,9 +49,9 @@
|
|
|
49
49
|
"@atlaskit/pragmatic-drag-and-drop": "^1.4.0",
|
|
50
50
|
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^1.4.0",
|
|
51
51
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.0.0",
|
|
52
|
-
"@atlaskit/primitives": "^13.
|
|
52
|
+
"@atlaskit/primitives": "^13.2.0",
|
|
53
53
|
"@atlaskit/theme": "^14.0.0",
|
|
54
|
-
"@atlaskit/tmp-editor-statsig": "^2.
|
|
54
|
+
"@atlaskit/tmp-editor-statsig": "^2.17.0",
|
|
55
55
|
"@atlaskit/toggle": "^13.4.0",
|
|
56
56
|
"@atlaskit/tokens": "^2.2.0",
|
|
57
57
|
"@atlaskit/tooltip": "^18.9.0",
|
|
@@ -60,7 +60,8 @@
|
|
|
60
60
|
"classnames": "^2.2.5",
|
|
61
61
|
"lodash": "^4.17.21",
|
|
62
62
|
"memoize-one": "^6.0.0",
|
|
63
|
-
"raf-schd": "^4.0.3"
|
|
63
|
+
"raf-schd": "^4.0.3",
|
|
64
|
+
"uuid": "^3.1.0"
|
|
64
65
|
},
|
|
65
66
|
"peerDependencies": {
|
|
66
67
|
"react": "^16.8.0 || ^17.0.0 || ~18.2.0",
|
|
@@ -118,6 +119,9 @@
|
|
|
118
119
|
"platform-visual-refresh-icons": {
|
|
119
120
|
"type": "boolean"
|
|
120
121
|
},
|
|
122
|
+
"platform_editor_react18_plugin_portalprovider": {
|
|
123
|
+
"type": "boolean"
|
|
124
|
+
},
|
|
121
125
|
"platform_editor_use_nested_table_pm_nodes": {
|
|
122
126
|
"type": "boolean"
|
|
123
127
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { IntlShape } from 'react-intl-next/src/types';
|
|
2
2
|
|
|
3
3
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
4
|
+
import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
4
5
|
import { tableCellMinWidth } from '@atlaskit/editor-common/styles';
|
|
5
6
|
import type { Command, GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
6
7
|
import type { AriaLiveElementAttributes } from '@atlaskit/editor-plugin-accessibility-utils';
|
|
@@ -54,7 +55,12 @@ const getTablePluginCommand = (
|
|
|
54
55
|
};
|
|
55
56
|
|
|
56
57
|
const updateResizeHandleAndStatePosition =
|
|
57
|
-
(
|
|
58
|
+
(
|
|
59
|
+
rowIndex: number,
|
|
60
|
+
columnIndex: number,
|
|
61
|
+
nextResizeHandlePos: number,
|
|
62
|
+
nodeViewPortalProviderAPI: PortalProviderAPI,
|
|
63
|
+
): Command =>
|
|
58
64
|
(state, dispatch) => {
|
|
59
65
|
let customTr = state.tr;
|
|
60
66
|
const {
|
|
@@ -75,6 +81,7 @@ const updateResizeHandleAndStatePosition =
|
|
|
75
81
|
columnIndex,
|
|
76
82
|
true,
|
|
77
83
|
getIntl,
|
|
84
|
+
nodeViewPortalProviderAPI,
|
|
78
85
|
)({
|
|
79
86
|
tr: customTr,
|
|
80
87
|
decorationSet: getDecorations(state),
|
|
@@ -121,9 +128,11 @@ export const initiateKeyboardColumnResizing =
|
|
|
121
128
|
({
|
|
122
129
|
ariaNotify,
|
|
123
130
|
getIntl,
|
|
131
|
+
nodeViewPortalProviderAPI,
|
|
124
132
|
}: {
|
|
125
133
|
ariaNotify?: (message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void;
|
|
126
134
|
getIntl?: () => IntlShape;
|
|
135
|
+
nodeViewPortalProviderAPI: PortalProviderAPI;
|
|
127
136
|
}): Command =>
|
|
128
137
|
(state, dispatch, view) => {
|
|
129
138
|
const { selection } = state;
|
|
@@ -143,6 +152,7 @@ export const initiateKeyboardColumnResizing =
|
|
|
143
152
|
selectionRect.top,
|
|
144
153
|
selectionRect.right,
|
|
145
154
|
cell.pos,
|
|
155
|
+
nodeViewPortalProviderAPI,
|
|
146
156
|
)(state, dispatch);
|
|
147
157
|
}
|
|
148
158
|
return false;
|
|
@@ -153,10 +163,12 @@ export const activateNextResizeArea =
|
|
|
153
163
|
direction,
|
|
154
164
|
ariaNotify,
|
|
155
165
|
getIntl,
|
|
166
|
+
nodeViewPortalProviderAPI,
|
|
156
167
|
}: {
|
|
157
168
|
direction: Direction;
|
|
158
169
|
ariaNotify?: (message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void;
|
|
159
170
|
getIntl?: () => IntlShape;
|
|
171
|
+
nodeViewPortalProviderAPI: PortalProviderAPI;
|
|
160
172
|
}): Command =>
|
|
161
173
|
(state, dispatch, view) => {
|
|
162
174
|
const { resizeHandlePos } = getTableResizingPluginState(state) || {};
|
|
@@ -217,6 +229,8 @@ export const activateNextResizeArea =
|
|
|
217
229
|
rectForNextCell.top,
|
|
218
230
|
rectForNextCell.right,
|
|
219
231
|
$nextCell.pos,
|
|
232
|
+
|
|
233
|
+
nodeViewPortalProviderAPI,
|
|
220
234
|
)(state, dispatch, view);
|
|
221
235
|
} else {
|
|
222
236
|
// current position is in the one of the side columns of the table(left or right)
|
|
@@ -230,6 +244,7 @@ export const activateNextResizeArea =
|
|
|
230
244
|
currentCellRect.top,
|
|
231
245
|
tableMap.width,
|
|
232
246
|
$lastCell.pos,
|
|
247
|
+
nodeViewPortalProviderAPI,
|
|
233
248
|
)(state, dispatch, view);
|
|
234
249
|
} else if (tableMap.width === currentCellRect.right) {
|
|
235
250
|
const firsCellInCurrentRow =
|
|
@@ -240,6 +255,8 @@ export const activateNextResizeArea =
|
|
|
240
255
|
currentCellRect.top,
|
|
241
256
|
1,
|
|
242
257
|
$nextCell.pos,
|
|
258
|
+
|
|
259
|
+
nodeViewPortalProviderAPI,
|
|
243
260
|
)(state, dispatch);
|
|
244
261
|
}
|
|
245
262
|
}
|
package/src/commands/misc.ts
CHANGED
|
@@ -2,6 +2,7 @@ import isEqual from 'lodash/isEqual';
|
|
|
2
2
|
|
|
3
3
|
import type { CellAttributes, TableAttributes, TableLayout } from '@atlaskit/adf-schema';
|
|
4
4
|
import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
5
|
+
import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
5
6
|
import type { Command, EditorCommand } from '@atlaskit/editor-common/types';
|
|
6
7
|
import {
|
|
7
8
|
closestElement,
|
|
@@ -560,6 +561,7 @@ export const addResizeHandleDecorations = (
|
|
|
560
561
|
rowIndex: number,
|
|
561
562
|
columnIndex: number,
|
|
562
563
|
includeTooltip: boolean,
|
|
564
|
+
nodeViewPortalProviderAPI: PortalProviderAPI,
|
|
563
565
|
isKeyboardResize?: boolean,
|
|
564
566
|
) =>
|
|
565
567
|
createCommand(
|
|
@@ -582,6 +584,7 @@ export const addResizeHandleDecorations = (
|
|
|
582
584
|
columnIndex,
|
|
583
585
|
includeTooltip,
|
|
584
586
|
getIntl,
|
|
587
|
+
nodeViewPortalProviderAPI,
|
|
585
588
|
)({
|
|
586
589
|
tr: state.tr,
|
|
587
590
|
decorationSet: getDecorations(state),
|
|
@@ -597,6 +600,7 @@ export const addResizeHandleDecorations = (
|
|
|
597
600
|
);
|
|
598
601
|
|
|
599
602
|
export const updateResizeHandleDecorations = (
|
|
603
|
+
nodeViewPortalProviderAPI: PortalProviderAPI,
|
|
600
604
|
rowIndex?: number,
|
|
601
605
|
columnIndex?: number,
|
|
602
606
|
includeTooltip?: boolean,
|
|
@@ -636,6 +640,7 @@ export const updateResizeHandleDecorations = (
|
|
|
636
640
|
resolvedColumnIndex,
|
|
637
641
|
resolvedIncludeTooltip,
|
|
638
642
|
getIntl,
|
|
643
|
+
nodeViewPortalProviderAPI,
|
|
639
644
|
)({
|
|
640
645
|
tr: state.tr,
|
|
641
646
|
decorationSet: getDecorations(state),
|