@atlaskit/editor-plugin-table 5.3.17 → 5.3.18
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 +6 -0
- package/dist/cjs/plugins/table/nodeviews/TableResizer.js +2 -8
- package/dist/cjs/plugins/table/toolbar.js +29 -56
- package/dist/cjs/plugins/table/ui/ColumnResizeWidget/index.js +2 -2
- package/dist/cjs/plugins/table/ui/FloatingContextualButton/index.js +2 -2
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +14 -56
- package/dist/cjs/plugins/table/ui/FloatingDeleteButton/index.js +2 -2
- package/dist/cjs/plugins/table/ui/FloatingInsertButton/InsertButton.js +2 -2
- package/dist/cjs/plugins/table/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +2 -2
- package/dist/cjs/plugins/table/ui/TableFloatingControls/CornerControls/DragCornerControls.js +2 -2
- package/dist/cjs/plugins/table/ui/TableFloatingControls/RowControls/ClassicControls.js +2 -8
- package/dist/es2019/plugins/table/nodeviews/TableResizer.js +2 -8
- package/dist/es2019/plugins/table/toolbar.js +20 -50
- package/dist/es2019/plugins/table/ui/ColumnResizeWidget/index.js +1 -1
- package/dist/es2019/plugins/table/ui/FloatingContextualButton/index.js +1 -1
- package/dist/es2019/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +6 -48
- package/dist/es2019/plugins/table/ui/FloatingDeleteButton/index.js +2 -2
- package/dist/es2019/plugins/table/ui/FloatingInsertButton/InsertButton.js +2 -2
- package/dist/es2019/plugins/table/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +1 -1
- package/dist/es2019/plugins/table/ui/TableFloatingControls/CornerControls/DragCornerControls.js +1 -1
- package/dist/es2019/plugins/table/ui/TableFloatingControls/RowControls/ClassicControls.js +2 -8
- package/dist/esm/plugins/table/nodeviews/TableResizer.js +2 -8
- package/dist/esm/plugins/table/toolbar.js +20 -50
- package/dist/esm/plugins/table/ui/ColumnResizeWidget/index.js +1 -1
- package/dist/esm/plugins/table/ui/FloatingContextualButton/index.js +1 -1
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +6 -48
- package/dist/esm/plugins/table/ui/FloatingDeleteButton/index.js +2 -2
- package/dist/esm/plugins/table/ui/FloatingInsertButton/InsertButton.js +2 -2
- package/dist/esm/plugins/table/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +1 -1
- package/dist/esm/plugins/table/ui/TableFloatingControls/CornerControls/DragCornerControls.js +1 -1
- package/dist/esm/plugins/table/ui/TableFloatingControls/RowControls/ClassicControls.js +2 -8
- package/dist/types/plugins/table/toolbar.d.ts +0 -27
- package/dist/types/plugins/table/ui/FloatingContextualButton/index.d.ts +5 -5
- package/dist/types/plugins/table/ui/FloatingContextualMenu/ContextualMenu.d.ts +0 -42
- package/dist/types-ts4.5/plugins/table/toolbar.d.ts +0 -27
- package/dist/types-ts4.5/plugins/table/ui/FloatingContextualButton/index.d.ts +5 -5
- package/dist/types-ts4.5/plugins/table/ui/FloatingContextualMenu/ContextualMenu.d.ts +0 -42
- package/package.json +1 -1
- package/src/__tests__/integration/delete-columns.ts +1 -1
- package/src/__tests__/integration/delete-rows.ts +1 -1
- package/src/__tests__/unit/ui/DeleteButton.tsx +4 -3
- package/src/plugins/table/nodeviews/TableResizer.tsx +2 -9
- package/src/plugins/table/toolbar.tsx +22 -53
- package/src/plugins/table/ui/ColumnResizeWidget/index.tsx +1 -1
- package/src/plugins/table/ui/FloatingContextualButton/index.tsx +10 -11
- package/src/plugins/table/ui/FloatingContextualMenu/ContextualMenu.tsx +6 -50
- package/src/plugins/table/ui/FloatingDeleteButton/index.tsx +3 -3
- package/src/plugins/table/ui/FloatingInsertButton/InsertButton.tsx +2 -2
- package/src/plugins/table/ui/TableFloatingControls/CornerControls/ClassicCornerControls.tsx +1 -1
- package/src/plugins/table/ui/TableFloatingControls/CornerControls/DragCornerControls.tsx +1 -1
- package/src/plugins/table/ui/TableFloatingControls/RowControls/ClassicControls.tsx +2 -10
- package/dist/cjs/plugins/table/ui/messages.js +0 -74
- package/dist/es2019/plugins/table/ui/messages.js +0 -68
- package/dist/esm/plugins/table/ui/messages.js +0 -68
- package/dist/types/plugins/table/ui/messages.d.ts +0 -68
- package/dist/types-ts4.5/plugins/table/ui/messages.d.ts +0 -68
- package/src/plugins/table/ui/messages.ts +0 -74
|
@@ -4,6 +4,7 @@ import { jsx } from '@emotion/react';
|
|
|
4
4
|
import { injectIntl } from 'react-intl-next';
|
|
5
5
|
import { ACTION_SUBJECT } from '@atlaskit/editor-common/analytics';
|
|
6
6
|
import { ErrorBoundary } from '@atlaskit/editor-common/error-boundary';
|
|
7
|
+
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
7
8
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
8
9
|
import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
|
|
9
10
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
@@ -11,7 +12,6 @@ import { akEditorSmallZIndex } from '@atlaskit/editor-shared-styles';
|
|
|
11
12
|
import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
12
13
|
import { toggleContextualMenu } from '../../commands';
|
|
13
14
|
import { TableCssClassName as ClassName } from '../../types';
|
|
14
|
-
import messages from '../../ui/messages';
|
|
15
15
|
import FixedButton from './FixedButton';
|
|
16
16
|
import { tableFloatingCellButtonSelectedStyles, tableFloatingCellButtonStyles } from './styles';
|
|
17
17
|
var BUTTON_OFFSET = 3;
|
|
@@ -12,10 +12,11 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
12
12
|
/** @jsx jsx */
|
|
13
13
|
import { Component } from 'react';
|
|
14
14
|
import { jsx } from '@emotion/react';
|
|
15
|
-
import {
|
|
15
|
+
import { injectIntl } from 'react-intl-next';
|
|
16
16
|
import { TableSortOrder as SortOrder } from '@atlaskit/custom-steps';
|
|
17
17
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
18
18
|
import { addColumnAfter, addRowAfter, backspace, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
19
|
+
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
19
20
|
import { DropdownMenuSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
20
21
|
import { backgroundPaletteTooltipMessages, cellBackgroundColorPalette, ColorPalette } from '@atlaskit/editor-common/ui-color';
|
|
21
22
|
import { ArrowKeyNavigationType, DropdownMenu } from '@atlaskit/editor-common/ui-menu';
|
|
@@ -31,50 +32,7 @@ import { canMergeCells } from '../../transforms';
|
|
|
31
32
|
import { TableCssClassName as ClassName } from '../../types';
|
|
32
33
|
import { getMergedCellsPositions, getSelectedColumnIndexes, getSelectedRowIndexes } from '../../utils';
|
|
33
34
|
import { contextualMenuDropdownWidth } from '../consts';
|
|
34
|
-
import tableMessages from '../messages';
|
|
35
35
|
import { cellColourPreviewStyles } from './styles';
|
|
36
|
-
export var messages = defineMessages({
|
|
37
|
-
cellBackground: {
|
|
38
|
-
id: 'fabric.editor.cellBackground',
|
|
39
|
-
defaultMessage: 'Cell background',
|
|
40
|
-
description: 'Change the background color of a table cell.'
|
|
41
|
-
},
|
|
42
|
-
mergeCells: {
|
|
43
|
-
id: 'fabric.editor.mergeCells',
|
|
44
|
-
defaultMessage: 'Merge cells',
|
|
45
|
-
description: 'Merge tables cells together.'
|
|
46
|
-
},
|
|
47
|
-
splitCell: {
|
|
48
|
-
id: 'fabric.editor.splitCell',
|
|
49
|
-
defaultMessage: 'Split cell',
|
|
50
|
-
description: 'Split a merged table cell.'
|
|
51
|
-
},
|
|
52
|
-
clearCells: {
|
|
53
|
-
id: 'fabric.editor.clearCells',
|
|
54
|
-
defaultMessage: 'Clear {0, plural, one {cell} other {cells}}',
|
|
55
|
-
description: 'Clears the contents of the selected cells (this does not delete the cells themselves).'
|
|
56
|
-
},
|
|
57
|
-
sortColumnASC: {
|
|
58
|
-
id: 'fabric.editor.sortColumnASC',
|
|
59
|
-
defaultMessage: 'Sort column A → Z',
|
|
60
|
-
description: 'Sort column in ascending order'
|
|
61
|
-
},
|
|
62
|
-
sortColumnDESC: {
|
|
63
|
-
id: 'fabric.editor.sortColumnDESC',
|
|
64
|
-
defaultMessage: 'Sort column Z → A',
|
|
65
|
-
description: 'Sort column in descending order'
|
|
66
|
-
},
|
|
67
|
-
canNotSortTable: {
|
|
68
|
-
id: 'fabric.editor.canNotSortTable',
|
|
69
|
-
defaultMessage: "\u26A0\uFE0F You can't sort a table with merged cells",
|
|
70
|
-
description: "Split your cells to enable this feature"
|
|
71
|
-
},
|
|
72
|
-
distributeColumns: {
|
|
73
|
-
id: 'fabric.editor.distributeColumns',
|
|
74
|
-
defaultMessage: "Distribute columns",
|
|
75
|
-
description: "Distribute widths between selected columns"
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
36
|
export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
79
37
|
_inherits(ContextualMenu, _Component);
|
|
80
38
|
var _super = _createSuper(ContextualMenu);
|
|
@@ -145,7 +103,7 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
145
103
|
});
|
|
146
104
|
}
|
|
147
105
|
items.push({
|
|
148
|
-
content: formatMessage(
|
|
106
|
+
content: formatMessage(messages.insertColumn),
|
|
149
107
|
value: {
|
|
150
108
|
name: 'insert_column'
|
|
151
109
|
},
|
|
@@ -154,7 +112,7 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
154
112
|
}, tooltip(addColumnAfter))
|
|
155
113
|
});
|
|
156
114
|
items.push({
|
|
157
|
-
content: formatMessage(
|
|
115
|
+
content: formatMessage(messages.insertRow),
|
|
158
116
|
value: {
|
|
159
117
|
name: 'insert_row'
|
|
160
118
|
},
|
|
@@ -169,7 +127,7 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
169
127
|
var noOfColumns = right - left;
|
|
170
128
|
var noOfRows = bottom - top;
|
|
171
129
|
items.push({
|
|
172
|
-
content: formatMessage(
|
|
130
|
+
content: formatMessage(messages.removeColumns, {
|
|
173
131
|
0: noOfColumns
|
|
174
132
|
}),
|
|
175
133
|
value: {
|
|
@@ -177,7 +135,7 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
177
135
|
}
|
|
178
136
|
});
|
|
179
137
|
items.push({
|
|
180
|
-
content: formatMessage(
|
|
138
|
+
content: formatMessage(messages.removeRows, {
|
|
181
139
|
0: noOfRows
|
|
182
140
|
}),
|
|
183
141
|
value: {
|
|
@@ -13,6 +13,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
13
13
|
import React, { Component } from 'react';
|
|
14
14
|
import { createPortal } from 'react-dom';
|
|
15
15
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
16
|
+
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
16
17
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
17
18
|
import { closestElement } from '@atlaskit/editor-common/utils';
|
|
18
19
|
import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
|
|
@@ -24,7 +25,6 @@ import { getPluginState as getTablePluginState } from '../../pm-plugins/plugin-f
|
|
|
24
25
|
import { TableCssClassName as ClassName } from '../../types';
|
|
25
26
|
import { getColumnDeleteButtonParams, getColumnsWidths, getRowDeleteButtonParams, getRowHeights } from '../../utils';
|
|
26
27
|
import { stickyRowZIndex } from '../consts';
|
|
27
|
-
import tableMessages from '../messages';
|
|
28
28
|
import DeleteButton from './DeleteButton';
|
|
29
29
|
import getPopupOptions from './getPopUpOptions';
|
|
30
30
|
export function getSelectionType(selection) {
|
|
@@ -173,7 +173,7 @@ var FloatingDeleteButton = /*#__PURE__*/function (_Component) {
|
|
|
173
173
|
}
|
|
174
174
|
var tableContainerWrapper = closestElement(tableRef, ".".concat(ClassName.TABLE_CONTAINER));
|
|
175
175
|
var button = /*#__PURE__*/React.createElement(DeleteButton, {
|
|
176
|
-
removeLabel: selectionType === 'column' ?
|
|
176
|
+
removeLabel: selectionType === 'column' ? messages.removeColumns : messages.removeRows,
|
|
177
177
|
onClick: this.handleClick,
|
|
178
178
|
onMouseEnter: this.handleMouseEnter,
|
|
179
179
|
onMouseLeave: this.handleMouseLeave
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { injectIntl } from 'react-intl-next';
|
|
5
5
|
import { addColumnAfter, addRowAfter, ToolTipContent } from '@atlaskit/editor-common/keymaps';
|
|
6
|
+
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
6
7
|
import { tableMarginTop } from '@atlaskit/editor-common/styles';
|
|
7
8
|
import { closestElement } from '@atlaskit/editor-common/utils';
|
|
8
9
|
import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
|
|
9
10
|
import Tooltip from '@atlaskit/tooltip';
|
|
10
11
|
import { TableCssClassName as ClassName } from '../../types';
|
|
11
12
|
import { tableToolbarSize } from '../consts';
|
|
12
|
-
import tableMessages from '../messages';
|
|
13
13
|
var getInsertLineHeight = function getInsertLineHeight(tableRef, hasStickyHeaders) {
|
|
14
14
|
// The line gets height 100% from the table,
|
|
15
15
|
// but since we have an overflow on the left,
|
|
@@ -40,7 +40,7 @@ var getInsertLineWidth = function getInsertLineWidth(tableRef, isDragAndDropEnab
|
|
|
40
40
|
return Math.min(offsetWidth + toolbarSize, parentOffsetWidth + toolbarSize - Math.max(scrollLeft - diff, 0)) + LINE_OFFSET;
|
|
41
41
|
};
|
|
42
42
|
var tooltipMessageByType = function tooltipMessageByType(type) {
|
|
43
|
-
return type === 'row' ?
|
|
43
|
+
return type === 'row' ? messages.insertRow : messages.insertColumn;
|
|
44
44
|
};
|
|
45
45
|
export var InsertButtonForDragAndDrop = function InsertButtonForDragAndDrop(_ref2) {
|
|
46
46
|
var onMouseDown = _ref2.onMouseDown,
|
package/dist/esm/plugins/table/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js
CHANGED
|
@@ -10,11 +10,11 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
10
10
|
import React, { Component } from 'react';
|
|
11
11
|
import classnames from 'classnames';
|
|
12
12
|
import { injectIntl } from 'react-intl-next';
|
|
13
|
+
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
13
14
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
14
15
|
import { findTable, isTableSelected, selectTable } from '@atlaskit/editor-tables/utils';
|
|
15
16
|
import { clearHoverSelection, hoverTable } from '../../../commands';
|
|
16
17
|
import { TableCssClassName as ClassName } from '../../../types';
|
|
17
|
-
import messages from '../../messages';
|
|
18
18
|
var CornerControlComponent = /*#__PURE__*/function (_Component) {
|
|
19
19
|
_inherits(CornerControlComponent, _Component);
|
|
20
20
|
var _super = _createSuper(CornerControlComponent);
|
package/dist/esm/plugins/table/ui/TableFloatingControls/CornerControls/DragCornerControls.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
3
|
import { injectIntl } from 'react-intl-next';
|
|
4
|
+
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
4
5
|
import { findTable, isTableSelected, selectTable } from '@atlaskit/editor-tables/utils';
|
|
5
6
|
import { clearHoverSelection, hoverTable } from '../../../commands';
|
|
6
7
|
import { TableCssClassName as ClassName } from '../../../types';
|
|
7
|
-
import messages from '../../messages';
|
|
8
8
|
var DragCornerControlsComponent = function DragCornerControlsComponent(_ref) {
|
|
9
9
|
var editorView = _ref.editorView,
|
|
10
10
|
isInDanger = _ref.isInDanger,
|
|
@@ -8,18 +8,12 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
8
8
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
9
9
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
10
10
|
import React, { Component } from 'react';
|
|
11
|
-
import {
|
|
11
|
+
import { injectIntl } from 'react-intl-next';
|
|
12
|
+
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
12
13
|
import { clearHoverSelection } from '../../../commands';
|
|
13
14
|
import { TableCssClassName as ClassName } from '../../../types';
|
|
14
15
|
import { getRowClassNames, getRowHeights, getRowsParams } from '../../../utils';
|
|
15
16
|
import { tableControlsSpacing, tableToolbarSize } from '../../consts';
|
|
16
|
-
var messages = defineMessages({
|
|
17
|
-
rowControl: {
|
|
18
|
-
id: 'fabric.editor.rowControl',
|
|
19
|
-
defaultMessage: 'Highlight row',
|
|
20
|
-
description: 'A button on the left of each row that shows up when the table is in focus. Clicking on it will select the entire row.'
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
17
|
var RowControlsComponent = /*#__PURE__*/function (_Component) {
|
|
24
18
|
_inherits(RowControlsComponent, _Component);
|
|
25
19
|
var _super = _createSuper(RowControlsComponent);
|
|
@@ -4,33 +4,6 @@ import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
|
4
4
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
5
|
import type { Rect } from '@atlaskit/editor-tables/table-map';
|
|
6
6
|
import type { PluginConfig, ToolbarMenuConfig, ToolbarMenuContext, ToolbarMenuState } from './types';
|
|
7
|
-
export declare const messages: {
|
|
8
|
-
tableOptions: {
|
|
9
|
-
id: string;
|
|
10
|
-
defaultMessage: string;
|
|
11
|
-
description: string;
|
|
12
|
-
};
|
|
13
|
-
headerRow: {
|
|
14
|
-
id: string;
|
|
15
|
-
defaultMessage: string;
|
|
16
|
-
description: string;
|
|
17
|
-
};
|
|
18
|
-
headerColumn: {
|
|
19
|
-
id: string;
|
|
20
|
-
defaultMessage: string;
|
|
21
|
-
description: string;
|
|
22
|
-
};
|
|
23
|
-
numberedColumn: {
|
|
24
|
-
id: string;
|
|
25
|
-
defaultMessage: string;
|
|
26
|
-
description: string;
|
|
27
|
-
};
|
|
28
|
-
collapseTable: {
|
|
29
|
-
id: string;
|
|
30
|
-
defaultMessage: string;
|
|
31
|
-
description: string;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
7
|
export declare const getToolbarMenuConfig: (config: ToolbarMenuConfig, state: ToolbarMenuState, { formatMessage }: ToolbarMenuContext, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => FloatingToolbarItem<Command>;
|
|
35
8
|
export declare const getToolbarCellOptionsConfig: (editorState: EditorState, editorView: EditorView | undefined | null, initialSelectionRect: Rect, { formatMessage }: ToolbarMenuContext, getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => FloatingToolbarDropdown<Command>;
|
|
36
9
|
export declare const getClosestSelectionRect: (state: EditorState) => Rect | undefined;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react';
|
|
2
|
-
import { TableLayout } from '@atlaskit/adf-schema';
|
|
3
|
-
import { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
|
-
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
-
import { RowStickyState } from '../../pm-plugins/sticky-headers';
|
|
2
|
+
import type { TableLayout } from '@atlaskit/adf-schema';
|
|
3
|
+
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
4
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
+
import type { RowStickyState } from '../../pm-plugins/sticky-headers';
|
|
7
7
|
export interface Props {
|
|
8
8
|
editorView: EditorView;
|
|
9
9
|
tableWrapper?: HTMLElement;
|
|
@@ -6,48 +6,6 @@ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
|
6
6
|
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
7
7
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
8
8
|
import type { Rect } from '@atlaskit/editor-tables/table-map';
|
|
9
|
-
export declare const messages: {
|
|
10
|
-
cellBackground: {
|
|
11
|
-
id: string;
|
|
12
|
-
defaultMessage: string;
|
|
13
|
-
description: string;
|
|
14
|
-
};
|
|
15
|
-
mergeCells: {
|
|
16
|
-
id: string;
|
|
17
|
-
defaultMessage: string;
|
|
18
|
-
description: string;
|
|
19
|
-
};
|
|
20
|
-
splitCell: {
|
|
21
|
-
id: string;
|
|
22
|
-
defaultMessage: string;
|
|
23
|
-
description: string;
|
|
24
|
-
};
|
|
25
|
-
clearCells: {
|
|
26
|
-
id: string;
|
|
27
|
-
defaultMessage: string;
|
|
28
|
-
description: string;
|
|
29
|
-
};
|
|
30
|
-
sortColumnASC: {
|
|
31
|
-
id: string;
|
|
32
|
-
defaultMessage: string;
|
|
33
|
-
description: string;
|
|
34
|
-
};
|
|
35
|
-
sortColumnDESC: {
|
|
36
|
-
id: string;
|
|
37
|
-
defaultMessage: string;
|
|
38
|
-
description: string;
|
|
39
|
-
};
|
|
40
|
-
canNotSortTable: {
|
|
41
|
-
id: string;
|
|
42
|
-
defaultMessage: string;
|
|
43
|
-
description: string;
|
|
44
|
-
};
|
|
45
|
-
distributeColumns: {
|
|
46
|
-
id: string;
|
|
47
|
-
defaultMessage: string;
|
|
48
|
-
description: string;
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
9
|
export interface Props {
|
|
52
10
|
editorView: EditorView;
|
|
53
11
|
isOpen: boolean;
|
|
@@ -4,33 +4,6 @@ import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
|
4
4
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
5
|
import type { Rect } from '@atlaskit/editor-tables/table-map';
|
|
6
6
|
import type { PluginConfig, ToolbarMenuConfig, ToolbarMenuContext, ToolbarMenuState } from './types';
|
|
7
|
-
export declare const messages: {
|
|
8
|
-
tableOptions: {
|
|
9
|
-
id: string;
|
|
10
|
-
defaultMessage: string;
|
|
11
|
-
description: string;
|
|
12
|
-
};
|
|
13
|
-
headerRow: {
|
|
14
|
-
id: string;
|
|
15
|
-
defaultMessage: string;
|
|
16
|
-
description: string;
|
|
17
|
-
};
|
|
18
|
-
headerColumn: {
|
|
19
|
-
id: string;
|
|
20
|
-
defaultMessage: string;
|
|
21
|
-
description: string;
|
|
22
|
-
};
|
|
23
|
-
numberedColumn: {
|
|
24
|
-
id: string;
|
|
25
|
-
defaultMessage: string;
|
|
26
|
-
description: string;
|
|
27
|
-
};
|
|
28
|
-
collapseTable: {
|
|
29
|
-
id: string;
|
|
30
|
-
defaultMessage: string;
|
|
31
|
-
description: string;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
7
|
export declare const getToolbarMenuConfig: (config: ToolbarMenuConfig, state: ToolbarMenuState, { formatMessage }: ToolbarMenuContext, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => FloatingToolbarItem<Command>;
|
|
35
8
|
export declare const getToolbarCellOptionsConfig: (editorState: EditorState, editorView: EditorView | undefined | null, initialSelectionRect: Rect, { formatMessage }: ToolbarMenuContext, getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => FloatingToolbarDropdown<Command>;
|
|
36
9
|
export declare const getClosestSelectionRect: (state: EditorState) => Rect | undefined;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react';
|
|
2
|
-
import { TableLayout } from '@atlaskit/adf-schema';
|
|
3
|
-
import { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
|
-
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
-
import { RowStickyState } from '../../pm-plugins/sticky-headers';
|
|
2
|
+
import type { TableLayout } from '@atlaskit/adf-schema';
|
|
3
|
+
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
4
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
+
import type { RowStickyState } from '../../pm-plugins/sticky-headers';
|
|
7
7
|
export interface Props {
|
|
8
8
|
editorView: EditorView;
|
|
9
9
|
tableWrapper?: HTMLElement;
|
|
@@ -6,48 +6,6 @@ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
|
6
6
|
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
7
7
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
8
8
|
import type { Rect } from '@atlaskit/editor-tables/table-map';
|
|
9
|
-
export declare const messages: {
|
|
10
|
-
cellBackground: {
|
|
11
|
-
id: string;
|
|
12
|
-
defaultMessage: string;
|
|
13
|
-
description: string;
|
|
14
|
-
};
|
|
15
|
-
mergeCells: {
|
|
16
|
-
id: string;
|
|
17
|
-
defaultMessage: string;
|
|
18
|
-
description: string;
|
|
19
|
-
};
|
|
20
|
-
splitCell: {
|
|
21
|
-
id: string;
|
|
22
|
-
defaultMessage: string;
|
|
23
|
-
description: string;
|
|
24
|
-
};
|
|
25
|
-
clearCells: {
|
|
26
|
-
id: string;
|
|
27
|
-
defaultMessage: string;
|
|
28
|
-
description: string;
|
|
29
|
-
};
|
|
30
|
-
sortColumnASC: {
|
|
31
|
-
id: string;
|
|
32
|
-
defaultMessage: string;
|
|
33
|
-
description: string;
|
|
34
|
-
};
|
|
35
|
-
sortColumnDESC: {
|
|
36
|
-
id: string;
|
|
37
|
-
defaultMessage: string;
|
|
38
|
-
description: string;
|
|
39
|
-
};
|
|
40
|
-
canNotSortTable: {
|
|
41
|
-
id: string;
|
|
42
|
-
defaultMessage: string;
|
|
43
|
-
description: string;
|
|
44
|
-
};
|
|
45
|
-
distributeColumns: {
|
|
46
|
-
id: string;
|
|
47
|
-
defaultMessage: string;
|
|
48
|
-
description: string;
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
9
|
export interface Props {
|
|
52
10
|
editorView: EditorView;
|
|
53
11
|
isOpen: boolean;
|
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createIntl } from 'react-intl-next';
|
|
2
2
|
|
|
3
|
+
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
3
4
|
// eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
|
|
4
5
|
import {
|
|
5
6
|
editable,
|
|
@@ -14,7 +15,6 @@ import {
|
|
|
14
15
|
import { BrowserTestCase } from '@atlaskit/webdriver-runner/runner';
|
|
15
16
|
|
|
16
17
|
import { TableCssClassName as ClassName } from '../../plugins/table/types';
|
|
17
|
-
import messages from '../../plugins/table/ui/messages';
|
|
18
18
|
|
|
19
19
|
import { documentWithMergedCells } from './__fixtures__/merged-rows-and-cols-document';
|
|
20
20
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createIntl } from 'react-intl-next';
|
|
2
2
|
|
|
3
|
+
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
3
4
|
// eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
|
|
4
5
|
import {
|
|
5
6
|
editable,
|
|
@@ -16,7 +17,6 @@ import {
|
|
|
16
17
|
import { BrowserTestCase } from '@atlaskit/webdriver-runner/runner';
|
|
17
18
|
|
|
18
19
|
import { TableCssClassName as ClassName } from '../../plugins/table/types';
|
|
19
|
-
import messages from '../../plugins/table/ui/messages';
|
|
20
20
|
|
|
21
21
|
import { documentWithMergedCells } from './__fixtures__/merged-rows-and-cols-document';
|
|
22
22
|
import { nestedInExtension } from './__fixtures__/nested-in-extension';
|
|
@@ -3,8 +3,9 @@ import React from 'react';
|
|
|
3
3
|
import { fireEvent, render, screen } from '@testing-library/react';
|
|
4
4
|
import { IntlProvider } from 'react-intl-next';
|
|
5
5
|
|
|
6
|
+
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
7
|
+
|
|
6
8
|
import DeleteButton from '../../../plugins/table/ui/FloatingDeleteButton/DeleteButton';
|
|
7
|
-
import tableMessages from '../../../plugins/table/ui/messages';
|
|
8
9
|
|
|
9
10
|
describe('<DeleteButton />', () => {
|
|
10
11
|
it('should fire the onMouseEnter callback', () => {
|
|
@@ -12,7 +13,7 @@ describe('<DeleteButton />', () => {
|
|
|
12
13
|
render(
|
|
13
14
|
<IntlProvider locale="en">
|
|
14
15
|
<DeleteButton
|
|
15
|
-
removeLabel={
|
|
16
|
+
removeLabel={messages.removeColumns}
|
|
16
17
|
onMouseEnter={onMouseEnter}
|
|
17
18
|
/>
|
|
18
19
|
</IntlProvider>,
|
|
@@ -26,7 +27,7 @@ describe('<DeleteButton />', () => {
|
|
|
26
27
|
render(
|
|
27
28
|
<IntlProvider locale="en">
|
|
28
29
|
<DeleteButton
|
|
29
|
-
removeLabel={
|
|
30
|
+
removeLabel={messages.removeColumns}
|
|
30
31
|
onMouseLeave={onMouseLeave}
|
|
31
32
|
/>
|
|
32
33
|
</IntlProvider>,
|
|
@@ -8,12 +8,13 @@ import React, {
|
|
|
8
8
|
} from 'react';
|
|
9
9
|
|
|
10
10
|
import rafSchd from 'raf-schd';
|
|
11
|
-
import {
|
|
11
|
+
import { useIntl } from 'react-intl-next';
|
|
12
12
|
|
|
13
13
|
import type { TableEventPayload } from '@atlaskit/editor-common/analytics';
|
|
14
14
|
import { TABLE_OVERFLOW_CHANGE_TRIGGER } from '@atlaskit/editor-common/analytics';
|
|
15
15
|
import { getGuidelinesWithHighlights } from '@atlaskit/editor-common/guideline';
|
|
16
16
|
import type { GuidelineConfig } from '@atlaskit/editor-common/guideline';
|
|
17
|
+
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
17
18
|
import type { HandleResize, HandleSize } from '@atlaskit/editor-common/resizer';
|
|
18
19
|
import { ResizerNext } from '@atlaskit/editor-common/resizer';
|
|
19
20
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
@@ -66,14 +67,6 @@ export interface TableResizerImprovementProps extends TableResizerProps {
|
|
|
66
67
|
onResizeStart?: () => void;
|
|
67
68
|
}
|
|
68
69
|
|
|
69
|
-
const messages = defineMessages({
|
|
70
|
-
resizeTable: {
|
|
71
|
-
id: 'fabric.editor.tables.resizeTable',
|
|
72
|
-
defaultMessage: 'Resize table',
|
|
73
|
-
description: 'Tooltip displayed on custom table width resize hande',
|
|
74
|
-
},
|
|
75
|
-
});
|
|
76
|
-
|
|
77
70
|
const handles = { right: true };
|
|
78
71
|
const handleStyles = {
|
|
79
72
|
right: {
|