@atlaskit/editor-plugin-table 22.4.15 → 22.4.17
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 +15 -0
- package/dist/cjs/pm-plugins/commands/active-table-menu.js +51 -0
- package/dist/cjs/pm-plugins/commands/commands-with-analytics.js +42 -10
- package/dist/cjs/pm-plugins/commands/index.js +13 -0
- package/dist/cjs/pm-plugins/drag-and-drop/commands-with-analytics.js +2 -0
- package/dist/cjs/pm-plugins/drag-and-drop/plugin.js +4 -0
- package/dist/cjs/pm-plugins/handlers.js +8 -1
- package/dist/cjs/pm-plugins/reducer.js +2 -0
- package/dist/cjs/tablePlugin.js +1 -0
- package/dist/cjs/ui/ContentComponent.js +1 -1
- package/dist/cjs/ui/FloatingContextualButton/index.js +28 -9
- package/dist/cjs/ui/FloatingContextualMenu/CellMenuPopup.js +58 -73
- package/dist/cjs/ui/FloatingContextualMenu/index.js +26 -12
- package/dist/cjs/ui/FloatingDragMenu/index.js +21 -8
- package/dist/cjs/ui/TableFloatingColumnControls/ColumnControls/index.js +13 -5
- package/dist/cjs/ui/TableFloatingControls/RowControls/DragControls.js +14 -5
- package/dist/cjs/ui/TableMenu/cell/getCellMenuComponents.js +8 -3
- package/dist/cjs/ui/TableMenu/cell/items/MergeCellsItem.js +16 -1
- package/dist/cjs/ui/TableMenu/cell/items/SplitCellItem.js +16 -1
- package/dist/cjs/ui/TableMenu/column/items/AddColumnLeftItem.js +4 -4
- package/dist/cjs/ui/TableMenu/column/items/AddColumnRightItem.js +4 -4
- package/dist/cjs/ui/TableMenu/column/items/DeleteColumnItem.js +2 -3
- package/dist/cjs/ui/TableMenu/column/items/DistributeColumnsItem.js +2 -3
- package/dist/cjs/ui/TableMenu/column/items/HeaderColumnToggleItem.js +2 -3
- package/dist/cjs/ui/TableMenu/column/items/MoveColumnLeftItem.js +2 -3
- package/dist/cjs/ui/TableMenu/column/items/MoveColumnRightItem.js +2 -3
- package/dist/cjs/ui/TableMenu/column/items/SortDecreasingItem.js +2 -3
- package/dist/cjs/ui/TableMenu/column/items/SortIncreasingItem.js +2 -3
- package/dist/cjs/ui/TableMenu/row/items/AddRowAboveItem.js +4 -4
- package/dist/cjs/ui/TableMenu/row/items/AddRowBelowItem.js +4 -4
- package/dist/cjs/ui/TableMenu/row/items/DeleteRowItem.js +2 -3
- package/dist/cjs/ui/TableMenu/row/items/HeaderRowToggleItem.js +2 -3
- package/dist/cjs/ui/TableMenu/row/items/MoveRowDownItem.js +2 -3
- package/dist/cjs/ui/TableMenu/row/items/MoveRowUpItem.js +2 -3
- package/dist/cjs/ui/TableMenu/row/items/NumberedRowsToggleItem.js +4 -3
- package/dist/cjs/ui/TableMenu/shared/TableMenu.compiled.css +0 -2
- package/dist/cjs/ui/TableMenu/shared/TableMenu.js +8 -9
- package/dist/cjs/ui/TableMenu/shared/getSharedItems.js +3 -1
- package/dist/cjs/ui/TableMenu/shared/getTableMenuComponents.js +1 -1
- package/dist/cjs/ui/TableMenu/shared/items/BackgroundColorItem.js +30 -4
- package/dist/cjs/ui/TableMenu/shared/items/ClearCellsItem.js +4 -3
- package/dist/es2019/pm-plugins/commands/active-table-menu.js +39 -0
- package/dist/es2019/pm-plugins/commands/commands-with-analytics.js +31 -2
- package/dist/es2019/pm-plugins/commands/index.js +1 -0
- package/dist/es2019/pm-plugins/drag-and-drop/commands-with-analytics.js +2 -0
- package/dist/es2019/pm-plugins/drag-and-drop/plugin.js +4 -0
- package/dist/es2019/pm-plugins/handlers.js +8 -1
- package/dist/es2019/pm-plugins/reducer.js +5 -0
- package/dist/es2019/tablePlugin.js +1 -0
- package/dist/es2019/ui/ContentComponent.js +1 -1
- package/dist/es2019/ui/FloatingContextualButton/index.js +29 -9
- package/dist/es2019/ui/FloatingContextualMenu/CellMenuPopup.js +60 -77
- package/dist/es2019/ui/FloatingContextualMenu/index.js +27 -12
- package/dist/es2019/ui/FloatingDragMenu/index.js +22 -8
- package/dist/es2019/ui/TableFloatingColumnControls/ColumnControls/index.js +12 -4
- package/dist/es2019/ui/TableFloatingControls/RowControls/DragControls.js +13 -4
- package/dist/es2019/ui/TableMenu/cell/getCellMenuComponents.js +9 -3
- package/dist/es2019/ui/TableMenu/cell/items/MergeCellsItem.js +18 -2
- package/dist/es2019/ui/TableMenu/cell/items/SplitCellItem.js +18 -2
- package/dist/es2019/ui/TableMenu/column/items/AddColumnLeftItem.js +3 -3
- package/dist/es2019/ui/TableMenu/column/items/AddColumnRightItem.js +3 -3
- package/dist/es2019/ui/TableMenu/column/items/DeleteColumnItem.js +2 -3
- package/dist/es2019/ui/TableMenu/column/items/DistributeColumnsItem.js +2 -3
- package/dist/es2019/ui/TableMenu/column/items/HeaderColumnToggleItem.js +2 -3
- package/dist/es2019/ui/TableMenu/column/items/MoveColumnLeftItem.js +2 -3
- package/dist/es2019/ui/TableMenu/column/items/MoveColumnRightItem.js +2 -3
- package/dist/es2019/ui/TableMenu/column/items/SortDecreasingItem.js +2 -3
- package/dist/es2019/ui/TableMenu/column/items/SortIncreasingItem.js +2 -3
- package/dist/es2019/ui/TableMenu/row/items/AddRowAboveItem.js +3 -3
- package/dist/es2019/ui/TableMenu/row/items/AddRowBelowItem.js +3 -3
- package/dist/es2019/ui/TableMenu/row/items/DeleteRowItem.js +2 -3
- package/dist/es2019/ui/TableMenu/row/items/HeaderRowToggleItem.js +2 -3
- package/dist/es2019/ui/TableMenu/row/items/MoveRowDownItem.js +2 -3
- package/dist/es2019/ui/TableMenu/row/items/MoveRowUpItem.js +2 -3
- package/dist/es2019/ui/TableMenu/row/items/NumberedRowsToggleItem.js +3 -2
- package/dist/es2019/ui/TableMenu/shared/TableMenu.compiled.css +0 -2
- package/dist/es2019/ui/TableMenu/shared/TableMenu.js +8 -9
- package/dist/es2019/ui/TableMenu/shared/getSharedItems.js +3 -1
- package/dist/es2019/ui/TableMenu/shared/getTableMenuComponents.js +1 -1
- package/dist/es2019/ui/TableMenu/shared/items/BackgroundColorItem.js +33 -4
- package/dist/es2019/ui/TableMenu/shared/items/ClearCellsItem.js +4 -3
- package/dist/esm/pm-plugins/commands/active-table-menu.js +45 -0
- package/dist/esm/pm-plugins/commands/commands-with-analytics.js +41 -10
- package/dist/esm/pm-plugins/commands/index.js +1 -0
- package/dist/esm/pm-plugins/drag-and-drop/commands-with-analytics.js +2 -0
- package/dist/esm/pm-plugins/drag-and-drop/plugin.js +4 -0
- package/dist/esm/pm-plugins/handlers.js +8 -1
- package/dist/esm/pm-plugins/reducer.js +2 -0
- package/dist/esm/tablePlugin.js +1 -0
- package/dist/esm/ui/ContentComponent.js +1 -1
- package/dist/esm/ui/FloatingContextualButton/index.js +29 -10
- package/dist/esm/ui/FloatingContextualMenu/CellMenuPopup.js +60 -75
- package/dist/esm/ui/FloatingContextualMenu/index.js +26 -12
- package/dist/esm/ui/FloatingDragMenu/index.js +21 -8
- package/dist/esm/ui/TableFloatingColumnControls/ColumnControls/index.js +12 -4
- package/dist/esm/ui/TableFloatingControls/RowControls/DragControls.js +13 -4
- package/dist/esm/ui/TableMenu/cell/getCellMenuComponents.js +8 -3
- package/dist/esm/ui/TableMenu/cell/items/MergeCellsItem.js +16 -2
- package/dist/esm/ui/TableMenu/cell/items/SplitCellItem.js +16 -2
- package/dist/esm/ui/TableMenu/column/items/AddColumnLeftItem.js +4 -4
- package/dist/esm/ui/TableMenu/column/items/AddColumnRightItem.js +4 -4
- package/dist/esm/ui/TableMenu/column/items/DeleteColumnItem.js +2 -3
- package/dist/esm/ui/TableMenu/column/items/DistributeColumnsItem.js +2 -3
- package/dist/esm/ui/TableMenu/column/items/HeaderColumnToggleItem.js +2 -3
- package/dist/esm/ui/TableMenu/column/items/MoveColumnLeftItem.js +2 -3
- package/dist/esm/ui/TableMenu/column/items/MoveColumnRightItem.js +2 -3
- package/dist/esm/ui/TableMenu/column/items/SortDecreasingItem.js +2 -3
- package/dist/esm/ui/TableMenu/column/items/SortIncreasingItem.js +2 -3
- package/dist/esm/ui/TableMenu/row/items/AddRowAboveItem.js +4 -4
- package/dist/esm/ui/TableMenu/row/items/AddRowBelowItem.js +4 -4
- package/dist/esm/ui/TableMenu/row/items/DeleteRowItem.js +2 -3
- package/dist/esm/ui/TableMenu/row/items/HeaderRowToggleItem.js +2 -3
- package/dist/esm/ui/TableMenu/row/items/MoveRowDownItem.js +2 -3
- package/dist/esm/ui/TableMenu/row/items/MoveRowUpItem.js +2 -3
- package/dist/esm/ui/TableMenu/row/items/NumberedRowsToggleItem.js +4 -3
- package/dist/esm/ui/TableMenu/shared/TableMenu.compiled.css +0 -2
- package/dist/esm/ui/TableMenu/shared/TableMenu.js +8 -9
- package/dist/esm/ui/TableMenu/shared/getSharedItems.js +3 -1
- package/dist/esm/ui/TableMenu/shared/getTableMenuComponents.js +1 -1
- package/dist/esm/ui/TableMenu/shared/items/BackgroundColorItem.js +30 -4
- package/dist/esm/ui/TableMenu/shared/items/ClearCellsItem.js +4 -3
- package/dist/types/entry-points/types.d.ts +1 -1
- package/dist/types/pm-plugins/commands/active-table-menu.d.ts +6 -0
- package/dist/types/pm-plugins/commands/commands-with-analytics.d.ts +3 -1
- package/dist/types/pm-plugins/commands/index.d.ts +1 -0
- package/dist/types/types/index.d.ts +21 -1
- package/dist/types/ui/FloatingContextualButton/index.d.ts +2 -0
- package/dist/types/ui/FloatingContextualMenu/CellMenuPopup.d.ts +7 -5
- package/dist/types/ui/FloatingContextualMenu/index.d.ts +0 -1
- package/dist/types/ui/TableMenu/cell/getCellMenuComponents.d.ts +2 -1
- package/dist/types/ui/TableMenu/cell/items/MergeCellsItem.d.ts +2 -1
- package/dist/types/ui/TableMenu/cell/items/SplitCellItem.d.ts +2 -1
- package/dist/types/ui/TableMenu/shared/TableMenuContext.d.ts +2 -0
- package/dist/types/ui/TableMenu/shared/items/BackgroundColorItem.d.ts +2 -1
- package/dist/types-ts4.5/entry-points/types.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/commands/active-table-menu.d.ts +6 -0
- package/dist/types-ts4.5/pm-plugins/commands/commands-with-analytics.d.ts +3 -1
- package/dist/types-ts4.5/pm-plugins/commands/index.d.ts +1 -0
- package/dist/types-ts4.5/types/index.d.ts +21 -1
- package/dist/types-ts4.5/ui/FloatingContextualButton/index.d.ts +2 -0
- package/dist/types-ts4.5/ui/FloatingContextualMenu/CellMenuPopup.d.ts +7 -5
- package/dist/types-ts4.5/ui/FloatingContextualMenu/index.d.ts +0 -1
- package/dist/types-ts4.5/ui/TableMenu/cell/getCellMenuComponents.d.ts +2 -1
- package/dist/types-ts4.5/ui/TableMenu/cell/items/MergeCellsItem.d.ts +2 -1
- package/dist/types-ts4.5/ui/TableMenu/cell/items/SplitCellItem.d.ts +2 -1
- package/dist/types-ts4.5/ui/TableMenu/shared/TableMenuContext.d.ts +2 -0
- package/dist/types-ts4.5/ui/TableMenu/shared/items/BackgroundColorItem.d.ts +2 -1
- package/package.json +4 -4
|
@@ -4,7 +4,6 @@ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
|
4
4
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
5
5
|
import { moveColumnRight, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
6
6
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
7
|
-
import { useEditorToolbar } from '@atlaskit/editor-common/toolbar';
|
|
8
7
|
import { getSelectionRect } from '@atlaskit/editor-tables/utils';
|
|
9
8
|
import { TableColumnMoveRightIcon, ToolbarDropdownItem, ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar';
|
|
10
9
|
import { moveSourceWithAnalytics } from '../../../../pm-plugins/drag-and-drop/commands-with-analytics';
|
|
@@ -18,9 +17,9 @@ var shouldShowMoveColumnRight = function shouldShowMoveColumnRight(isLastColumn)
|
|
|
18
17
|
export var MoveColumnRightItem = function MoveColumnRightItem(props) {
|
|
19
18
|
var _tableMenuContext$sel, _tooltip;
|
|
20
19
|
var api = props.api;
|
|
21
|
-
var _useEditorToolbar = useEditorToolbar(),
|
|
22
|
-
editorView = _useEditorToolbar.editorView;
|
|
23
20
|
var tableMenuContext = useTableMenuContext();
|
|
21
|
+
var _ref = tableMenuContext !== null && tableMenuContext !== void 0 ? tableMenuContext : {},
|
|
22
|
+
editorView = _ref.editorView;
|
|
24
23
|
var _useSharedPluginState = useSharedPluginStateWithSelector(api !== null && api !== void 0 ? api : undefined, ['table'], function (states) {
|
|
25
24
|
var _states$tableState;
|
|
26
25
|
return {
|
|
@@ -3,16 +3,15 @@ import { useIntl } from 'react-intl';
|
|
|
3
3
|
import { TableSortOrder as SortOrder } from '@atlaskit/custom-steps';
|
|
4
4
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
6
|
-
import { useEditorToolbar } from '@atlaskit/editor-common/toolbar';
|
|
7
6
|
import { getSelectionRect } from '@atlaskit/editor-tables/utils';
|
|
8
7
|
import { ArrowDownIcon, ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
|
|
9
8
|
import { sortColumnWithAnalytics } from '../../../../pm-plugins/commands/commands-with-analytics';
|
|
10
9
|
import { useTableMenuContext } from '../../shared/TableMenuContext';
|
|
11
10
|
export var SortDecreasingItem = function SortDecreasingItem(_ref) {
|
|
12
11
|
var api = _ref.api;
|
|
13
|
-
var _useEditorToolbar = useEditorToolbar(),
|
|
14
|
-
editorView = _useEditorToolbar.editorView;
|
|
15
12
|
var tableMenuContext = useTableMenuContext();
|
|
13
|
+
var _ref2 = tableMenuContext !== null && tableMenuContext !== void 0 ? tableMenuContext : {},
|
|
14
|
+
editorView = _ref2.editorView;
|
|
16
15
|
var _useIntl = useIntl(),
|
|
17
16
|
formatMessage = _useIntl.formatMessage;
|
|
18
17
|
var handleClick = function handleClick() {
|
|
@@ -3,16 +3,15 @@ import { useIntl } from 'react-intl';
|
|
|
3
3
|
import { TableSortOrder as SortOrder } from '@atlaskit/custom-steps';
|
|
4
4
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
6
|
-
import { useEditorToolbar } from '@atlaskit/editor-common/toolbar';
|
|
7
6
|
import { getSelectionRect } from '@atlaskit/editor-tables/utils';
|
|
8
7
|
import { ArrowUpIcon, ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
|
|
9
8
|
import { sortColumnWithAnalytics } from '../../../../pm-plugins/commands/commands-with-analytics';
|
|
10
9
|
import { useTableMenuContext } from '../../shared/TableMenuContext';
|
|
11
10
|
export var SortIncreasingItem = function SortIncreasingItem(_ref) {
|
|
12
11
|
var api = _ref.api;
|
|
13
|
-
var _useEditorToolbar = useEditorToolbar(),
|
|
14
|
-
editorView = _useEditorToolbar.editorView;
|
|
15
12
|
var tableMenuContext = useTableMenuContext();
|
|
13
|
+
var _ref2 = tableMenuContext !== null && tableMenuContext !== void 0 ? tableMenuContext : {},
|
|
14
|
+
editorView = _ref2.editorView;
|
|
16
15
|
var _useIntl = useIntl(),
|
|
17
16
|
formatMessage = _useIntl.formatMessage;
|
|
18
17
|
var handleClick = function handleClick() {
|
|
@@ -3,15 +3,15 @@ import { useIntl } from 'react-intl';
|
|
|
3
3
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { addRowBefore, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
5
5
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
6
|
-
import { useEditorToolbar } from '@atlaskit/editor-common/toolbar';
|
|
7
6
|
import { getSelectionRect } from '@atlaskit/editor-tables/utils';
|
|
8
7
|
import { TableRowAddAboveIcon, ToolbarDropdownItem, ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar';
|
|
9
8
|
import { insertRowWithAnalytics } from '../../../../pm-plugins/commands/commands-with-analytics';
|
|
9
|
+
import { useTableMenuContext } from '../../shared/TableMenuContext';
|
|
10
10
|
export var AddRowAboveItem = function AddRowAboveItem(props) {
|
|
11
|
-
var _tooltip;
|
|
11
|
+
var _useTableMenuContext, _tooltip;
|
|
12
12
|
var api = props.api;
|
|
13
|
-
var
|
|
14
|
-
editorView =
|
|
13
|
+
var _ref = (_useTableMenuContext = useTableMenuContext()) !== null && _useTableMenuContext !== void 0 ? _useTableMenuContext : {},
|
|
14
|
+
editorView = _ref.editorView;
|
|
15
15
|
var _useIntl = useIntl(),
|
|
16
16
|
formatMessage = _useIntl.formatMessage;
|
|
17
17
|
var handleClick = function handleClick() {
|
|
@@ -3,15 +3,15 @@ import { useIntl } from 'react-intl';
|
|
|
3
3
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { addRowAfter, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
5
5
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
6
|
-
import { useEditorToolbar } from '@atlaskit/editor-common/toolbar';
|
|
7
6
|
import { getSelectionRect } from '@atlaskit/editor-tables/utils';
|
|
8
7
|
import { TableRowAddBelowIcon, ToolbarDropdownItem, ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar';
|
|
9
8
|
import { insertRowWithAnalytics } from '../../../../pm-plugins/commands/commands-with-analytics';
|
|
9
|
+
import { useTableMenuContext } from '../../shared/TableMenuContext';
|
|
10
10
|
export var AddRowBelowItem = function AddRowBelowItem(props) {
|
|
11
|
-
var _tooltip;
|
|
11
|
+
var _useTableMenuContext, _tooltip;
|
|
12
12
|
var api = props.api;
|
|
13
|
-
var
|
|
14
|
-
editorView =
|
|
13
|
+
var _ref = (_useTableMenuContext = useTableMenuContext()) !== null && _useTableMenuContext !== void 0 ? _useTableMenuContext : {},
|
|
14
|
+
editorView = _ref.editorView;
|
|
15
15
|
var _useIntl = useIntl(),
|
|
16
16
|
formatMessage = _useIntl.formatMessage;
|
|
17
17
|
var handleClick = function handleClick() {
|
|
@@ -4,7 +4,6 @@ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
|
4
4
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
5
5
|
import { deleteRow, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
6
6
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
7
|
-
import { useEditorToolbar } from '@atlaskit/editor-common/toolbar';
|
|
8
7
|
import { getSelectionRect } from '@atlaskit/editor-tables/utils';
|
|
9
8
|
import { DeleteIcon, ToolbarDropdownItem, ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar';
|
|
10
9
|
import { clearHoverSelection, hoverRows } from '../../../../pm-plugins/commands';
|
|
@@ -14,9 +13,9 @@ import { useTableMenuContext } from '../../shared/TableMenuContext';
|
|
|
14
13
|
export var DeleteRowItem = function DeleteRowItem(props) {
|
|
15
14
|
var _tableMenuContext$sel, _tooltip;
|
|
16
15
|
var api = props.api;
|
|
17
|
-
var _useEditorToolbar = useEditorToolbar(),
|
|
18
|
-
editorView = _useEditorToolbar.editorView;
|
|
19
16
|
var tableMenuContext = useTableMenuContext();
|
|
17
|
+
var _ref = tableMenuContext !== null && tableMenuContext !== void 0 ? tableMenuContext : {},
|
|
18
|
+
editorView = _ref.editorView;
|
|
20
19
|
var _useSharedPluginState = useSharedPluginStateWithSelector(api !== null && api !== void 0 ? api : undefined, ['table'], function (states) {
|
|
21
20
|
var _states$tableState;
|
|
22
21
|
return {
|
|
@@ -2,7 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
3
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
4
4
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
5
|
-
import { useEditorToolbar } from '@atlaskit/editor-common/toolbar';
|
|
6
5
|
import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
|
|
7
6
|
import Toggle from '@atlaskit/toggle';
|
|
8
7
|
import { toggleHeaderRowWithAnalytics } from '../../../../pm-plugins/commands/commands-with-analytics';
|
|
@@ -17,9 +16,9 @@ var shouldShowHeaderRowToggle = function shouldShowHeaderRowToggle(_ref) {
|
|
|
17
16
|
export var HeaderRowToggleItem = function HeaderRowToggleItem(props) {
|
|
18
17
|
var _tableMenuContext$sel;
|
|
19
18
|
var api = props.api;
|
|
20
|
-
var _useEditorToolbar = useEditorToolbar(),
|
|
21
|
-
editorView = _useEditorToolbar.editorView;
|
|
22
19
|
var tableMenuContext = useTableMenuContext();
|
|
20
|
+
var _ref2 = tableMenuContext !== null && tableMenuContext !== void 0 ? tableMenuContext : {},
|
|
21
|
+
editorView = _ref2.editorView;
|
|
23
22
|
var _useSharedPluginState = useSharedPluginStateWithSelector(api !== null && api !== void 0 ? api : undefined, ['table'], function (states) {
|
|
24
23
|
var _states$tableState, _states$tableState2;
|
|
25
24
|
return {
|
|
@@ -4,7 +4,6 @@ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
|
4
4
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
5
5
|
import { moveRowDown, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
6
6
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
7
|
-
import { useEditorToolbar } from '@atlaskit/editor-common/toolbar';
|
|
8
7
|
import { getSelectionRect } from '@atlaskit/editor-tables/utils';
|
|
9
8
|
import { TableRowMoveDownIcon, ToolbarDropdownItem, ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar';
|
|
10
9
|
import { moveSourceWithAnalytics } from '../../../../pm-plugins/drag-and-drop/commands-with-analytics';
|
|
@@ -18,9 +17,9 @@ var shouldShowMoveRowDown = function shouldShowMoveRowDown(isLastRow) {
|
|
|
18
17
|
export var MoveRowDownItem = function MoveRowDownItem(props) {
|
|
19
18
|
var _tableMenuContext$sel, _tooltip;
|
|
20
19
|
var api = props.api;
|
|
21
|
-
var _useEditorToolbar = useEditorToolbar(),
|
|
22
|
-
editorView = _useEditorToolbar.editorView;
|
|
23
20
|
var tableMenuContext = useTableMenuContext();
|
|
21
|
+
var _ref = tableMenuContext !== null && tableMenuContext !== void 0 ? tableMenuContext : {},
|
|
22
|
+
editorView = _ref.editorView;
|
|
24
23
|
var _useSharedPluginState = useSharedPluginStateWithSelector(api !== null && api !== void 0 ? api : undefined, ['table'], function (states) {
|
|
25
24
|
var _states$tableState;
|
|
26
25
|
return {
|
|
@@ -4,7 +4,6 @@ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
|
4
4
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
5
5
|
import { moveRowUp, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
6
6
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
7
|
-
import { useEditorToolbar } from '@atlaskit/editor-common/toolbar';
|
|
8
7
|
import { getSelectionRect } from '@atlaskit/editor-tables/utils';
|
|
9
8
|
import { TableRowMoveUpIcon, ToolbarDropdownItem, ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar';
|
|
10
9
|
import { moveSourceWithAnalytics } from '../../../../pm-plugins/drag-and-drop/commands-with-analytics';
|
|
@@ -18,9 +17,9 @@ var shouldShowMoveRowUp = function shouldShowMoveRowUp(isFirstRow) {
|
|
|
18
17
|
export var MoveRowUpItem = function MoveRowUpItem(props) {
|
|
19
18
|
var _tableMenuContext$sel, _tooltip;
|
|
20
19
|
var api = props.api;
|
|
21
|
-
var _useEditorToolbar = useEditorToolbar(),
|
|
22
|
-
editorView = _useEditorToolbar.editorView;
|
|
23
20
|
var tableMenuContext = useTableMenuContext();
|
|
21
|
+
var _ref = tableMenuContext !== null && tableMenuContext !== void 0 ? tableMenuContext : {},
|
|
22
|
+
editorView = _ref.editorView;
|
|
24
23
|
var _useSharedPluginState = useSharedPluginStateWithSelector(api !== null && api !== void 0 ? api : undefined, ['table'], function (states) {
|
|
25
24
|
var _states$tableState;
|
|
26
25
|
return {
|
|
@@ -2,14 +2,15 @@ import React from 'react';
|
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
3
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
4
4
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
5
|
-
import { useEditorToolbar } from '@atlaskit/editor-common/toolbar';
|
|
6
5
|
import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
|
|
7
6
|
import Toggle from '@atlaskit/toggle';
|
|
8
7
|
import { toggleNumberColumnWithAnalytics } from '../../../../pm-plugins/commands/commands-with-analytics';
|
|
8
|
+
import { useTableMenuContext } from '../../shared/TableMenuContext';
|
|
9
9
|
export var NumberedRowsToggleItem = function NumberedRowsToggleItem(props) {
|
|
10
|
+
var _useTableMenuContext;
|
|
10
11
|
var api = props.api;
|
|
11
|
-
var
|
|
12
|
-
editorView =
|
|
12
|
+
var _ref = (_useTableMenuContext = useTableMenuContext()) !== null && _useTableMenuContext !== void 0 ? _useTableMenuContext : {},
|
|
13
|
+
editorView = _ref.editorView;
|
|
13
14
|
var _useSharedPluginState = useSharedPluginStateWithSelector(api !== null && api !== void 0 ? api : undefined, ['table'], function (states) {
|
|
14
15
|
var _states$tableState, _states$tableState2;
|
|
15
16
|
return {
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
|
|
2
2
|
._2rko1qi0{border-radius:var(--ds-radius-medium,6px)}._16qs130s{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #1e1f2126,0 0 1px #1e1f214f)}
|
|
3
|
-
._18m915vq{overflow-y:hidden}
|
|
4
3
|
._1bsb1178{width:280px}
|
|
5
|
-
._1reo15vq{overflow-x:hidden}
|
|
6
4
|
._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
|
|
@@ -6,7 +6,6 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
6
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
7
|
import React, { memo, useMemo } from 'react';
|
|
8
8
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
9
|
-
import { EditorToolbarProvider } from '@atlaskit/editor-common/toolbar';
|
|
10
9
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
11
10
|
import { getSelectionRect } from '@atlaskit/editor-tables/utils';
|
|
12
11
|
import { SurfaceRenderer } from '@atlaskit/editor-ui-control-model';
|
|
@@ -15,9 +14,8 @@ import { canSplitCellSelection } from '../../../pm-plugins/commands/split-cell';
|
|
|
15
14
|
import { canMergeCellSelection } from '../../../pm-plugins/transforms/merge';
|
|
16
15
|
import { TableMenuProvider } from './TableMenuContext';
|
|
17
16
|
var tableMenuContainerStyles = {
|
|
18
|
-
container: "_2rko1qi0
|
|
17
|
+
container: "_2rko1qi0 _1bsb1178 _16qs130s _bfhk1bhr"
|
|
19
18
|
};
|
|
20
|
-
var EMPTY_CONTEXT = {};
|
|
21
19
|
export var TableMenu = /*#__PURE__*/memo(function (_ref) {
|
|
22
20
|
var api = _ref.api,
|
|
23
21
|
editorView = _ref.editorView,
|
|
@@ -37,11 +35,14 @@ export var TableMenu = /*#__PURE__*/memo(function (_ref) {
|
|
|
37
35
|
selection = _useSharedPluginState.selection;
|
|
38
36
|
var tableMenuContext = useMemo(function () {
|
|
39
37
|
if (!selection || !tableNode) {
|
|
40
|
-
return
|
|
38
|
+
return {
|
|
39
|
+
editorView: editorView
|
|
40
|
+
};
|
|
41
41
|
}
|
|
42
42
|
var tableMap = TableMap.get(tableNode);
|
|
43
43
|
var selectionRect = getSelectionRect(selection);
|
|
44
44
|
var cellOps = {
|
|
45
|
+
editorView: editorView,
|
|
45
46
|
canMergeCells: canMergeCellSelection(selection),
|
|
46
47
|
canSplitCell: canSplitCellSelection(selection),
|
|
47
48
|
hasMergedCellsInTable: tableMap.hasMergedCells()
|
|
@@ -57,13 +58,11 @@ export var TableMenu = /*#__PURE__*/memo(function (_ref) {
|
|
|
57
58
|
isLastColumn: selectionRect.right === tableMap.width,
|
|
58
59
|
selectedColumnCount: selectionRect.right - selectionRect.left
|
|
59
60
|
});
|
|
60
|
-
}, [selection, tableNode]);
|
|
61
|
+
}, [editorView, selection, tableNode]);
|
|
61
62
|
if (components.length === 0) {
|
|
62
63
|
return null;
|
|
63
64
|
}
|
|
64
|
-
return /*#__PURE__*/React.createElement(
|
|
65
|
-
editorView: editorView !== null && editorView !== void 0 ? editorView : null
|
|
66
|
-
}, /*#__PURE__*/React.createElement(TableMenuProvider, {
|
|
65
|
+
return /*#__PURE__*/React.createElement(TableMenuProvider, {
|
|
67
66
|
value: tableMenuContext
|
|
68
67
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
69
68
|
xcss: tableMenuContainerStyles.container,
|
|
@@ -71,6 +70,6 @@ export var TableMenu = /*#__PURE__*/memo(function (_ref) {
|
|
|
71
70
|
}, /*#__PURE__*/React.createElement(SurfaceRenderer, {
|
|
72
71
|
surface: surface,
|
|
73
72
|
components: components
|
|
74
|
-
})))
|
|
73
|
+
})));
|
|
75
74
|
});
|
|
76
75
|
TableMenu.displayName = 'TableMenu';
|
|
@@ -24,7 +24,9 @@ export var getSharedItems = function getSharedItems(_ref) {
|
|
|
24
24
|
rank: CELL_ACTION_SECTION_RANK[BACKGROUND_COLOR_ITEM.key]
|
|
25
25
|
}],
|
|
26
26
|
component: function component() {
|
|
27
|
-
return /*#__PURE__*/React.createElement(BackgroundColorItem,
|
|
27
|
+
return /*#__PURE__*/React.createElement(BackgroundColorItem, {
|
|
28
|
+
api: api
|
|
29
|
+
});
|
|
28
30
|
}
|
|
29
31
|
}, {
|
|
30
32
|
type: CLEAR_CELLS_ITEM.type,
|
|
@@ -4,5 +4,5 @@ import { getColumnMenuComponents } from '../column/getColumnMenuComponents';
|
|
|
4
4
|
import { getRowMenuComponents } from '../row/getRowMenuComponents';
|
|
5
5
|
import { getSharedItems } from './getSharedItems';
|
|
6
6
|
export var getTableMenuComponents = function getTableMenuComponents(params) {
|
|
7
|
-
return [].concat(_toConsumableArray(getRowMenuComponents(params)), _toConsumableArray(getColumnMenuComponents(params)), _toConsumableArray(getCellMenuComponents()), _toConsumableArray(getSharedItems(params)));
|
|
7
|
+
return [].concat(_toConsumableArray(getRowMenuComponents(params)), _toConsumableArray(getColumnMenuComponents(params)), _toConsumableArray(getCellMenuComponents(params)), _toConsumableArray(getSharedItems(params)));
|
|
8
8
|
};
|
|
@@ -3,27 +3,53 @@ import "./BackgroundColorItem.compiled.css";
|
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React, { useCallback, useMemo } from 'react';
|
|
5
5
|
import { useIntl } from 'react-intl';
|
|
6
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
6
7
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
7
8
|
import { backgroundPaletteTooltipMessages, cellBackgroundColorPalette, ColorPalette } from '@atlaskit/editor-common/ui-color';
|
|
8
9
|
import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
|
|
9
10
|
import { NestedDropdownRightIcon, PaintBucketIcon, ToolbarNestedDropdownMenu } from '@atlaskit/editor-toolbar';
|
|
10
11
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
12
|
+
import { closeActiveTableMenu } from '../../../../pm-plugins/commands';
|
|
13
|
+
import { setColorWithAnalytics } from '../../../../pm-plugins/commands/commands-with-analytics';
|
|
14
|
+
import { getPluginState } from '../../../../pm-plugins/plugin-factory';
|
|
15
|
+
import { useTableMenuContext } from '../TableMenuContext';
|
|
11
16
|
var colorPaletteColumns = 7;
|
|
12
17
|
var colorPaletteStyles = {
|
|
13
18
|
container: "_1rjcu2gc",
|
|
14
19
|
elemAfter: "_zulp1b66 _1e0c1txw _4cvr1h6o",
|
|
15
20
|
colorPreview: "_2rko12b0 _1h6d1l7x _1dqonqa1 _189ee4h9 _1bsbdlk8 _4t3idlk8 _1o9zidpf"
|
|
16
21
|
};
|
|
17
|
-
export var BackgroundColorItem = function BackgroundColorItem() {
|
|
22
|
+
export var BackgroundColorItem = function BackgroundColorItem(_ref) {
|
|
23
|
+
var _useTableMenuContext, _api$analytics2;
|
|
24
|
+
var api = _ref.api;
|
|
25
|
+
var _ref2 = (_useTableMenuContext = useTableMenuContext()) !== null && _useTableMenuContext !== void 0 ? _useTableMenuContext : {},
|
|
26
|
+
editorView = _ref2.editorView;
|
|
18
27
|
var _useIntl = useIntl(),
|
|
19
28
|
formatMessage = _useIntl.formatMessage;
|
|
20
|
-
var
|
|
29
|
+
var selectedColor = useMemo(function () {
|
|
30
|
+
var _node$attrs;
|
|
31
|
+
if (!editorView) {
|
|
32
|
+
return '#ffffff';
|
|
33
|
+
}
|
|
34
|
+
var _getPluginState = getPluginState(editorView.state),
|
|
35
|
+
targetCellPosition = _getPluginState.targetCellPosition;
|
|
36
|
+
var node = targetCellPosition ? editorView.state.doc.nodeAt(targetCellPosition) : null;
|
|
37
|
+
return hexToEditorBackgroundPaletteColor((node === null || node === void 0 || (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.background) || '#ffffff');
|
|
38
|
+
}, [editorView]);
|
|
39
|
+
var onClick = useCallback(function (color) {
|
|
40
|
+
var _api$analytics;
|
|
41
|
+
if (!editorView) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
setColorWithAnalytics(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions)(INPUT_METHOD.TABLE_CONTEXT_MENU, color, editorView)(editorView.state, editorView.dispatch);
|
|
45
|
+
closeActiveTableMenu()(editorView.state, editorView.dispatch);
|
|
46
|
+
}, [api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions, editorView]);
|
|
21
47
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
22
48
|
var colorPreviewStyle = useMemo(function () {
|
|
23
49
|
return {
|
|
24
|
-
backgroundColor:
|
|
50
|
+
backgroundColor: selectedColor
|
|
25
51
|
};
|
|
26
|
-
}, []);
|
|
52
|
+
}, [selectedColor]);
|
|
27
53
|
var paletteOptions = useMemo(function () {
|
|
28
54
|
return {
|
|
29
55
|
palette: cellBackgroundColorPalette,
|
|
@@ -3,17 +3,17 @@ import { useIntl } from 'react-intl';
|
|
|
3
3
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { backspace, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
5
5
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
6
|
-
import { useEditorToolbar } from '@atlaskit/editor-common/toolbar';
|
|
7
6
|
import { CrossIcon, ToolbarDropdownItem, ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar';
|
|
7
|
+
import { closeActiveTableMenu } from '../../../../pm-plugins/commands';
|
|
8
8
|
import { emptyMultipleCellsWithAnalytics } from '../../../../pm-plugins/commands/commands-with-analytics';
|
|
9
9
|
import { getPluginState } from '../../../../pm-plugins/plugin-factory';
|
|
10
10
|
import { useTableMenuContext } from '../TableMenuContext';
|
|
11
11
|
export var ClearCellsItem = function ClearCellsItem(_ref) {
|
|
12
12
|
var _tableMenuContext$sel, _tableMenuContext$sel2, _tooltip;
|
|
13
13
|
var api = _ref.api;
|
|
14
|
-
var _useEditorToolbar = useEditorToolbar(),
|
|
15
|
-
editorView = _useEditorToolbar.editorView;
|
|
16
14
|
var tableMenuContext = useTableMenuContext();
|
|
15
|
+
var _ref2 = tableMenuContext !== null && tableMenuContext !== void 0 ? tableMenuContext : {},
|
|
16
|
+
editorView = _ref2.editorView;
|
|
17
17
|
var _useIntl = useIntl(),
|
|
18
18
|
formatMessage = _useIntl.formatMessage;
|
|
19
19
|
var selectedCellCount = Math.max((_tableMenuContext$sel = tableMenuContext === null || tableMenuContext === void 0 ? void 0 : tableMenuContext.selectedColumnCount) !== null && _tableMenuContext$sel !== void 0 ? _tableMenuContext$sel : 1, (_tableMenuContext$sel2 = tableMenuContext === null || tableMenuContext === void 0 ? void 0 : tableMenuContext.selectedRowCount) !== null && _tableMenuContext$sel2 !== void 0 ? _tableMenuContext$sel2 : 1);
|
|
@@ -25,6 +25,7 @@ export var ClearCellsItem = function ClearCellsItem(_ref) {
|
|
|
25
25
|
var _getPluginState = getPluginState(editorView.state),
|
|
26
26
|
targetCellPosition = _getPluginState.targetCellPosition;
|
|
27
27
|
emptyMultipleCellsWithAnalytics(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions)(INPUT_METHOD.TABLE_CONTEXT_MENU, targetCellPosition)(editorView.state, editorView.dispatch);
|
|
28
|
+
closeActiveTableMenu()(editorView.state, editorView.dispatch);
|
|
28
29
|
};
|
|
29
30
|
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
30
31
|
onClick: handleClick,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { RESIZE_HANDLE_AREA_DECORATION_GAP, ShadowEvent, TableCssClassName, TableDecorations, } from '../types/index';
|
|
2
|
-
export type { AlignmentOptions, Cell, CellColumnPositioning, CellHoverMeta, CellTransform, ColumnResizingPluginAction, ColumnResizingPluginState, DraggableBehaviour, DraggableData, DraggableSourceData, DraggableTargetData, DraggableType, HandleTypes, InsertRowMethods, InsertRowOptions, InvalidNodeAttr, MessageDescriptor, PermittedLayoutsDescriptor, PluginConfig, PluginInjectionAPI, PluginInjectionAPIWithA11y, ReportInvalidNodeAttrs, RowInsertPosition, TableDirection, TablePluginAction, TablePluginState, TableSharedState, TableSharedStateInternal, ToolbarMenuConfig, ToolbarMenuContext, ToolbarMenuState, WidthToWidest, } from '../types/index';
|
|
2
|
+
export type { ActiveTableMenu, AlignmentOptions, Cell, CellColumnPositioning, CellHoverMeta, CellTransform, ColumnResizingPluginAction, ColumnResizingPluginState, DraggableBehaviour, DraggableData, DraggableSourceData, DraggableTargetData, DraggableType, HandleTypes, InsertRowMethods, InsertRowOptions, InvalidNodeAttr, MessageDescriptor, PermittedLayoutsDescriptor, PluginConfig, PluginInjectionAPI, PluginInjectionAPIWithA11y, ReportInvalidNodeAttrs, RowInsertPosition, TableDirection, TablePluginAction, TablePluginState, TableSharedState, TableSharedStateInternal, ToolbarMenuConfig, ToolbarMenuContext, ToolbarMenuState, WidthToWidest, } from '../types/index';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Command } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { ActiveTableMenu } from '../../types';
|
|
3
|
+
export declare const closeActiveTableMenu: () => Command;
|
|
4
|
+
export declare const toggleActiveTableMenu: (activeTableMenu: Exclude<ActiveTableMenu, {
|
|
5
|
+
type: "none";
|
|
6
|
+
}>) => Command;
|
|
@@ -7,8 +7,10 @@ import type { Command, GetEditorContainerWidth } from '@atlaskit/editor-common/t
|
|
|
7
7
|
import type { NodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
8
8
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
9
9
|
import type { Rect } from '@atlaskit/editor-tables/table-map';
|
|
10
|
-
import type { AlignmentOptions, InsertRowMethods, InsertRowOptions, PluginInjectionAPI, RowInsertPosition } from '../../types';
|
|
10
|
+
import type { AlignmentOptions, InsertRowMethods, InsertRowOptions, PluginInjectionAPI, RowInsertPosition, TableDirection } from '../../types';
|
|
11
|
+
import type { TriggerType } from '../drag-and-drop/types';
|
|
11
12
|
import type { ResizeStateWithAnalytics } from '../table-resizing/utils/types';
|
|
13
|
+
export declare const toggleActiveTableMenuWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (direction: TableDirection, index: number, trigger?: TriggerType) => Command;
|
|
12
14
|
export declare const emptyMultipleCellsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.KEYBOARD | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, targetCellPosition?: number) => Command;
|
|
13
15
|
export declare const mergeCellsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | null | undefined) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB) => Command;
|
|
14
16
|
export declare const splitCellWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB) => Command;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { hoverColumns, hoverRows, hoverTable, hoverCell, hoverMergedCells, clearHoverSelection, showResizeHandleLine, hideResizeHandleLine, setTableHovered, } from './hover';
|
|
2
2
|
export { insertColumn, insertRow, createTable } from './insert';
|
|
3
3
|
export { getNextLayout, toggleContextualMenu, toggleHeaderColumn, toggleHeaderRow, toggleNumberColumn, toggleTableLayout, } from './toggle';
|
|
4
|
+
export { closeActiveTableMenu, toggleActiveTableMenu } from './active-table-menu';
|
|
4
5
|
export { clearMultipleCells } from './clear';
|
|
5
6
|
export { autoSizeTable, convertFirstRowToHeader, deleteTable, hideInsertColumnOrRowButton, moveCursorBackward, selectColumn, selectColumns, selectRow, selectRows, setCellAttr, setEditorFocus, setMultipleCellAttrs, setTableRef, showInsertColumnButton, showInsertRowButton, transformSliceToAddTableHeaders, triggerUnlessTableHeader, addBoldInEmptyHeaderCells, addResizeHandleDecorations, updateWidthToWidest, setFocusToCellMenu, } from './misc';
|
|
6
7
|
export { sortByColumn } from './sort';
|
|
@@ -34,7 +34,7 @@ export type PluginInjectionAPIWithA11y = ExtractInjectionAPI<TablePlugin> & {
|
|
|
34
34
|
};
|
|
35
35
|
};
|
|
36
36
|
};
|
|
37
|
-
export type TableSharedStateInternal = Pick<TablePluginState, 'isFullWidthModeEnabled' | 'isMaxWidthModeEnabled' | 'wasFullWidthModeEnabled' | 'wasMaxWidthModeEnabled' | 'isHeaderRowEnabled' | 'isHeaderColumnEnabled' | 'isNumberColumnEnabled' | 'isCommentEditor' | 'isTableScalingEnabled' | 'ordering' | 'isInDanger' | 'hoveredRows' | 'hoveredColumns' | 'hoveredCell' | 'isTableHovered' | 'tableNode' | 'widthToWidest' | 'tableRef' | 'tablePos' | 'targetCellPosition' | 'isContextualMenuOpen' | 'pluginConfig' | 'insertColumnButtonIndex' | 'insertRowButtonIndex' | 'tableWrapperTarget' | 'isCellMenuOpenByKeyboard'> & {
|
|
37
|
+
export type TableSharedStateInternal = Pick<TablePluginState, 'isFullWidthModeEnabled' | 'isMaxWidthModeEnabled' | 'wasFullWidthModeEnabled' | 'wasMaxWidthModeEnabled' | 'isHeaderRowEnabled' | 'isHeaderColumnEnabled' | 'isNumberColumnEnabled' | 'isCommentEditor' | 'isTableScalingEnabled' | 'ordering' | 'isInDanger' | 'hoveredRows' | 'hoveredColumns' | 'hoveredCell' | 'isTableHovered' | 'tableNode' | 'widthToWidest' | 'tableRef' | 'tablePos' | 'targetCellPosition' | 'isContextualMenuOpen' | 'pluginConfig' | 'insertColumnButtonIndex' | 'insertRowButtonIndex' | 'tableWrapperTarget' | 'isCellMenuOpenByKeyboard' | 'activeTableMenu'> & {
|
|
38
38
|
dragMenuDirection?: TableDirection;
|
|
39
39
|
dragMenuIndex?: number;
|
|
40
40
|
editorContentAreaHeight?: number;
|
|
@@ -85,7 +85,22 @@ export interface CellHoverMeta {
|
|
|
85
85
|
export interface WidthToWidest {
|
|
86
86
|
[tableLocalId: string]: boolean;
|
|
87
87
|
}
|
|
88
|
+
export type ActiveTableMenu = {
|
|
89
|
+
type: 'none';
|
|
90
|
+
} | {
|
|
91
|
+
openedBy: 'mouse' | 'keyboard';
|
|
92
|
+
type: 'cell';
|
|
93
|
+
} | {
|
|
94
|
+
index: number;
|
|
95
|
+
openedBy: 'mouse' | 'keyboard';
|
|
96
|
+
type: 'row';
|
|
97
|
+
} | {
|
|
98
|
+
index: number;
|
|
99
|
+
openedBy: 'mouse' | 'keyboard';
|
|
100
|
+
type: 'column';
|
|
101
|
+
};
|
|
88
102
|
export interface TablePluginState {
|
|
103
|
+
activeTableMenu?: ActiveTableMenu;
|
|
89
104
|
canCollapseTable?: boolean;
|
|
90
105
|
editorHasFocus?: boolean;
|
|
91
106
|
editorViewportHeight?: number;
|
|
@@ -266,6 +281,11 @@ export type TablePluginAction = {
|
|
|
266
281
|
type: 'HIDE_INSERT_COLUMN_OR_ROW_BUTTON';
|
|
267
282
|
} | {
|
|
268
283
|
type: 'TOGGLE_CONTEXTUAL_MENU';
|
|
284
|
+
} | {
|
|
285
|
+
data: {
|
|
286
|
+
activeTableMenu: ActiveTableMenu;
|
|
287
|
+
};
|
|
288
|
+
type: 'SET_ACTIVE_TABLE_MENU';
|
|
269
289
|
} | {
|
|
270
290
|
data: {
|
|
271
291
|
isCellMenuOpenByKeyboard: boolean;
|
|
@@ -2,7 +2,9 @@ import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
|
2
2
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
4
|
import type { RowStickyState } from '../../pm-plugins/sticky-headers/types';
|
|
5
|
+
import { type PluginInjectionAPI } from '../../types';
|
|
5
6
|
export interface Props {
|
|
7
|
+
api?: PluginInjectionAPI | null;
|
|
6
8
|
boundariesElement?: HTMLElement;
|
|
7
9
|
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
8
10
|
editorView: EditorView;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
-
import type
|
|
3
|
+
import { type PluginInjectionAPI } from '../../types';
|
|
4
4
|
type CellMenuPopupProps = {
|
|
5
5
|
api: PluginInjectionAPI | undefined | null;
|
|
6
|
+
boundariesElement?: HTMLElement;
|
|
6
7
|
editorView: EditorView;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
targetCellRef:
|
|
8
|
+
mountPoint?: HTMLElement;
|
|
9
|
+
scrollableElement?: HTMLElement;
|
|
10
|
+
targetCellRef: HTMLElement;
|
|
11
|
+
zIndex: number;
|
|
10
12
|
};
|
|
11
|
-
export declare const CellMenuPopup: ({ api, editorView,
|
|
13
|
+
export declare const CellMenuPopup: ({ api, boundariesElement, editorView, mountPoint, scrollableElement, targetCellRef, zIndex, }: CellMenuPopupProps) => React.JSX.Element;
|
|
12
14
|
export {};
|
|
@@ -16,7 +16,6 @@ interface Props {
|
|
|
16
16
|
mountPoint?: HTMLElement;
|
|
17
17
|
pluginConfig?: PluginConfig;
|
|
18
18
|
scrollableElement?: HTMLElement;
|
|
19
|
-
targetCellPosition?: number;
|
|
20
19
|
}
|
|
21
20
|
declare const FloatingContextualMenu: {
|
|
22
21
|
({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, pluginConfig, editorAnalyticsAPI, getEditorContainerWidth, getEditorFeatureFlags, isCellMenuOpenByKeyboard, isCommentEditor, api, isDragMenuOpen, }: Props): JSX.Element | null;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import type { RegisterComponent } from '@atlaskit/editor-ui-control-model';
|
|
2
|
-
|
|
2
|
+
import type { TableMenuComponentsParams } from '../shared/types';
|
|
3
|
+
export declare const getCellMenuComponents: ({ api }: TableMenuComponentsParams) => RegisterComponent[];
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
2
3
|
export type TableMenuContextValue = {
|
|
3
4
|
canMergeCells?: boolean;
|
|
4
5
|
canSplitCell?: boolean;
|
|
6
|
+
editorView?: EditorView;
|
|
5
7
|
hasMergedCellsInTable?: boolean;
|
|
6
8
|
isFirstColumn?: boolean;
|
|
7
9
|
isFirstRow?: boolean;
|
|
@@ -3,4 +3,5 @@
|
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
|
-
|
|
6
|
+
import type { TableMenuComponentsParams } from '../types';
|
|
7
|
+
export declare const BackgroundColorItem: ({ api }: TableMenuComponentsParams) => React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { RESIZE_HANDLE_AREA_DECORATION_GAP, ShadowEvent, TableCssClassName, TableDecorations, } from '../types/index';
|
|
2
|
-
export type { AlignmentOptions, Cell, CellColumnPositioning, CellHoverMeta, CellTransform, ColumnResizingPluginAction, ColumnResizingPluginState, DraggableBehaviour, DraggableData, DraggableSourceData, DraggableTargetData, DraggableType, HandleTypes, InsertRowMethods, InsertRowOptions, InvalidNodeAttr, MessageDescriptor, PermittedLayoutsDescriptor, PluginConfig, PluginInjectionAPI, PluginInjectionAPIWithA11y, ReportInvalidNodeAttrs, RowInsertPosition, TableDirection, TablePluginAction, TablePluginState, TableSharedState, TableSharedStateInternal, ToolbarMenuConfig, ToolbarMenuContext, ToolbarMenuState, WidthToWidest, } from '../types/index';
|
|
2
|
+
export type { ActiveTableMenu, AlignmentOptions, Cell, CellColumnPositioning, CellHoverMeta, CellTransform, ColumnResizingPluginAction, ColumnResizingPluginState, DraggableBehaviour, DraggableData, DraggableSourceData, DraggableTargetData, DraggableType, HandleTypes, InsertRowMethods, InsertRowOptions, InvalidNodeAttr, MessageDescriptor, PermittedLayoutsDescriptor, PluginConfig, PluginInjectionAPI, PluginInjectionAPIWithA11y, ReportInvalidNodeAttrs, RowInsertPosition, TableDirection, TablePluginAction, TablePluginState, TableSharedState, TableSharedStateInternal, ToolbarMenuConfig, ToolbarMenuContext, ToolbarMenuState, WidthToWidest, } from '../types/index';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Command } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { ActiveTableMenu } from '../../types';
|
|
3
|
+
export declare const closeActiveTableMenu: () => Command;
|
|
4
|
+
export declare const toggleActiveTableMenu: (activeTableMenu: Exclude<ActiveTableMenu, {
|
|
5
|
+
type: "none";
|
|
6
|
+
}>) => Command;
|
|
@@ -7,8 +7,10 @@ import type { Command, GetEditorContainerWidth } from '@atlaskit/editor-common/t
|
|
|
7
7
|
import type { NodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
8
8
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
9
9
|
import type { Rect } from '@atlaskit/editor-tables/table-map';
|
|
10
|
-
import type { AlignmentOptions, InsertRowMethods, InsertRowOptions, PluginInjectionAPI, RowInsertPosition } from '../../types';
|
|
10
|
+
import type { AlignmentOptions, InsertRowMethods, InsertRowOptions, PluginInjectionAPI, RowInsertPosition, TableDirection } from '../../types';
|
|
11
|
+
import type { TriggerType } from '../drag-and-drop/types';
|
|
11
12
|
import type { ResizeStateWithAnalytics } from '../table-resizing/utils/types';
|
|
13
|
+
export declare const toggleActiveTableMenuWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (direction: TableDirection, index: number, trigger?: TriggerType) => Command;
|
|
12
14
|
export declare const emptyMultipleCellsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.KEYBOARD | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, targetCellPosition?: number) => Command;
|
|
13
15
|
export declare const mergeCellsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | null | undefined) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB) => Command;
|
|
14
16
|
export declare const splitCellWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB) => Command;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { hoverColumns, hoverRows, hoverTable, hoverCell, hoverMergedCells, clearHoverSelection, showResizeHandleLine, hideResizeHandleLine, setTableHovered, } from './hover';
|
|
2
2
|
export { insertColumn, insertRow, createTable } from './insert';
|
|
3
3
|
export { getNextLayout, toggleContextualMenu, toggleHeaderColumn, toggleHeaderRow, toggleNumberColumn, toggleTableLayout, } from './toggle';
|
|
4
|
+
export { closeActiveTableMenu, toggleActiveTableMenu } from './active-table-menu';
|
|
4
5
|
export { clearMultipleCells } from './clear';
|
|
5
6
|
export { autoSizeTable, convertFirstRowToHeader, deleteTable, hideInsertColumnOrRowButton, moveCursorBackward, selectColumn, selectColumns, selectRow, selectRows, setCellAttr, setEditorFocus, setMultipleCellAttrs, setTableRef, showInsertColumnButton, showInsertRowButton, transformSliceToAddTableHeaders, triggerUnlessTableHeader, addBoldInEmptyHeaderCells, addResizeHandleDecorations, updateWidthToWidest, setFocusToCellMenu, } from './misc';
|
|
6
7
|
export { sortByColumn } from './sort';
|