@atlaskit/editor-plugin-table 22.4.14 → 22.4.16
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 +17 -0
- package/dist/cjs/nodeviews/TableComponent.js +2 -2
- package/dist/cjs/nodeviews/table.js +2 -2
- package/dist/cjs/nodeviews/toDOM.js +2 -2
- 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/main.js +4 -3
- package/dist/cjs/pm-plugins/reducer.js +2 -0
- package/dist/cjs/pm-plugins/table-width.js +2 -2
- package/dist/cjs/pm-plugins/transforms/content-mode.js +3 -2
- package/dist/cjs/pm-plugins/utils/tableMode/apply-measured-width-to-all-tables.js +70 -0
- package/dist/cjs/pm-plugins/utils/tableMode/apply-measured-width-to-selected-table.js +41 -0
- package/dist/cjs/pm-plugins/utils/tableMode/is-content-mode-supported.js +12 -0
- package/dist/cjs/pm-plugins/utils/tableMode/measure-table-with-auto-layout.js +113 -0
- package/dist/cjs/pm-plugins/utils/tableMode/smart-adjust/constants.js +10 -0
- package/dist/cjs/pm-plugins/utils/tableMode/smart-adjust/distribute-column-widths.js +83 -0
- package/dist/cjs/pm-plugins/utils/tableMode/smart-adjust/run-smart-adjust.js +56 -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/cjs/ui/toolbar.js +4 -3
- package/dist/es2019/nodeviews/TableComponent.js +1 -1
- package/dist/es2019/nodeviews/table.js +1 -1
- package/dist/es2019/nodeviews/toDOM.js +1 -1
- 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/main.js +2 -1
- package/dist/es2019/pm-plugins/reducer.js +5 -0
- package/dist/es2019/pm-plugins/table-width.js +1 -1
- package/dist/es2019/pm-plugins/transforms/content-mode.js +2 -1
- package/dist/es2019/pm-plugins/utils/tableMode/apply-measured-width-to-all-tables.js +70 -0
- package/dist/es2019/pm-plugins/utils/tableMode/apply-measured-width-to-selected-table.js +38 -0
- package/dist/es2019/pm-plugins/utils/tableMode/is-content-mode-supported.js +7 -0
- package/dist/es2019/pm-plugins/utils/tableMode/measure-table-with-auto-layout.js +97 -0
- package/dist/es2019/pm-plugins/utils/tableMode/smart-adjust/constants.js +4 -0
- package/dist/es2019/pm-plugins/utils/tableMode/smart-adjust/distribute-column-widths.js +63 -0
- package/dist/es2019/pm-plugins/utils/tableMode/smart-adjust/run-smart-adjust.js +47 -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/es2019/ui/toolbar.js +2 -1
- package/dist/esm/nodeviews/TableComponent.js +1 -1
- package/dist/esm/nodeviews/table.js +1 -1
- package/dist/esm/nodeviews/toDOM.js +1 -1
- 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/main.js +2 -1
- package/dist/esm/pm-plugins/reducer.js +2 -0
- package/dist/esm/pm-plugins/table-width.js +1 -1
- package/dist/esm/pm-plugins/transforms/content-mode.js +2 -1
- package/dist/esm/pm-plugins/utils/tableMode/apply-measured-width-to-all-tables.js +65 -0
- package/dist/esm/pm-plugins/utils/tableMode/apply-measured-width-to-selected-table.js +36 -0
- package/dist/esm/pm-plugins/utils/tableMode/is-content-mode-supported.js +6 -0
- package/dist/esm/pm-plugins/utils/tableMode/measure-table-with-auto-layout.js +107 -0
- package/dist/esm/pm-plugins/utils/tableMode/smart-adjust/constants.js +4 -0
- package/dist/esm/pm-plugins/utils/tableMode/smart-adjust/distribute-column-widths.js +77 -0
- package/dist/esm/pm-plugins/utils/tableMode/smart-adjust/run-smart-adjust.js +49 -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/esm/ui/toolbar.js +2 -1
- 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/pm-plugins/transforms/content-mode.d.ts +1 -0
- package/dist/types/pm-plugins/utils/tableMode/apply-measured-width-to-all-tables.d.ts +8 -0
- package/dist/types/pm-plugins/utils/tableMode/apply-measured-width-to-selected-table.d.ts +6 -0
- package/dist/types/pm-plugins/utils/tableMode/is-content-mode-supported.d.ts +7 -0
- package/dist/types/pm-plugins/utils/tableMode/measure-table-with-auto-layout.d.ts +2 -0
- package/dist/types/pm-plugins/utils/tableMode/smart-adjust/constants.d.ts +4 -0
- package/dist/types/pm-plugins/utils/tableMode/smart-adjust/distribute-column-widths.d.ts +8 -0
- package/dist/types/pm-plugins/utils/tableMode/smart-adjust/run-smart-adjust.d.ts +7 -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/column/getColumnMenuComponents.d.ts +1 -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/pm-plugins/transforms/content-mode.d.ts +1 -0
- package/dist/types-ts4.5/pm-plugins/utils/tableMode/apply-measured-width-to-all-tables.d.ts +8 -0
- package/dist/types-ts4.5/pm-plugins/utils/tableMode/apply-measured-width-to-selected-table.d.ts +6 -0
- package/dist/types-ts4.5/pm-plugins/utils/tableMode/is-content-mode-supported.d.ts +7 -0
- package/dist/types-ts4.5/pm-plugins/utils/tableMode/measure-table-with-auto-layout.d.ts +2 -0
- package/dist/types-ts4.5/pm-plugins/utils/tableMode/smart-adjust/constants.d.ts +4 -0
- package/dist/types-ts4.5/pm-plugins/utils/tableMode/smart-adjust/distribute-column-widths.d.ts +8 -0
- package/dist/types-ts4.5/pm-plugins/utils/tableMode/smart-adjust/run-smart-adjust.d.ts +7 -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/column/getColumnMenuComponents.d.ts +1 -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 +10 -7
- package/dist/cjs/pm-plugins/utils/tableMode.js +0 -162
- package/dist/es2019/pm-plugins/utils/tableMode.js +0 -158
- package/dist/esm/pm-plugins/utils/tableMode.js +0 -156
- package/dist/types/pm-plugins/utils/tableMode.d.ts +0 -26
- package/dist/types-ts4.5/pm-plugins/utils/tableMode.d.ts +0 -26
package/dist/esm/ui/toolbar.js
CHANGED
|
@@ -49,7 +49,8 @@ import { normaliseAlignment } from '../pm-plugins/utils/alignment';
|
|
|
49
49
|
import { isTableNested } from '../pm-plugins/utils/nodes';
|
|
50
50
|
import { getSelectedColumnIndexes, getSelectedRowIndexes } from '../pm-plugins/utils/selection';
|
|
51
51
|
import { getMergedCellsPositions } from '../pm-plugins/utils/table';
|
|
52
|
-
import { applyMeasuredWidthToSelectedTable
|
|
52
|
+
import { applyMeasuredWidthToSelectedTable } from '../pm-plugins/utils/tableMode/apply-measured-width-to-selected-table';
|
|
53
|
+
import { isContentModeSupported } from '../pm-plugins/utils/tableMode/is-content-mode-supported';
|
|
53
54
|
import { TableCssClassName } from '../types';
|
|
54
55
|
import { FloatingAlignmentButtons } from './FloatingAlignmentButtons/FloatingAlignmentButtons';
|
|
55
56
|
export var getToolbarMenuConfig = function getToolbarMenuConfig(config, state, _ref, editorAnalyticsAPI) {
|
|
@@ -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';
|
|
@@ -4,5 +4,6 @@ export type TableMeasurement = {
|
|
|
4
4
|
colWidths: Array<number>;
|
|
5
5
|
tableWidth: number;
|
|
6
6
|
};
|
|
7
|
+
export declare const clampToEditorMaxWidth: (contentWidth: number) => number;
|
|
7
8
|
export declare const getTableMeasurement: (tableRef: HTMLTableElement) => TableMeasurement;
|
|
8
9
|
export declare const applyTableMeasurement: (tr: Transaction, tableNode: PMNode, { colWidths, tableWidth }: TableMeasurement, tablePos: number) => Transaction;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
2
|
+
import type { PluginInjectionAPI } from '../../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Iterates all top-level tables in the document, and for those in content mode,
|
|
5
|
+
* measures rendered column widths and sets colwidth + table width attributes
|
|
6
|
+
* in a single batched transaction.
|
|
7
|
+
*/
|
|
8
|
+
export declare const applyMeasuredWidthToAllTables: (view: EditorView, pluginInjectionApi?: PluginInjectionAPI) => void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
2
|
+
import type { PluginInjectionAPI } from '../../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Used to measure a selected table width with it's content being laid out natively by the browser
|
|
5
|
+
*/
|
|
6
|
+
export declare const applyMeasuredWidthToSelectedTable: (view: EditorView, api?: PluginInjectionAPI) => void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type ContentModePluginOptions = {
|
|
2
|
+
allowColumnResizing: boolean;
|
|
3
|
+
allowTableResizing: boolean;
|
|
4
|
+
isFullPageEditor: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare const isContentModeSupported: ({ allowColumnResizing, allowTableResizing, isFullPageEditor, }: ContentModePluginOptions) => boolean;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const sumWidths: (widths: Array<number>) => number;
|
|
2
|
+
/**
|
|
3
|
+
* Clamps each desired width to `[tableCellMinWidth, MAX × evenShare]`. Greedy
|
|
4
|
+
* columns (paragraphs) hit the ceiling and wrap; small columns stay at their
|
|
5
|
+
* natural width. Leftover canvas budget grows ceiling-hitters up to their
|
|
6
|
+
* desired; overflow reclaims from ceiling-hitters only.
|
|
7
|
+
*/
|
|
8
|
+
export declare const distributeByEvenShareRatio: (desiredWidths: Array<number>, editorContainerWidth: number) => Array<number>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type TableMeasurement } from '../../../transforms/content-mode';
|
|
2
|
+
export declare const restoreResizerContainer: (resizerContainer: HTMLElement | undefined | null) => void;
|
|
3
|
+
/**
|
|
4
|
+
* Smart-adjust: measure unconstrained max-content per column, then clamp via
|
|
5
|
+
* `distributeByEvenShareRatio`.
|
|
6
|
+
*/
|
|
7
|
+
export declare const runSmartAdjust: (tableRef: HTMLTableElement, resizerContainer: HTMLElement | undefined | null, resizerItem: HTMLElement | undefined | null, editorContainerWidthFromApi: number | undefined) => TableMeasurement;
|
|
@@ -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,3 +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 getColumnMenuComponents: ({ api }: TableMenuComponentsParams) => RegisterComponent[];
|
|
3
|
+
export declare const getColumnMenuComponents: ({ 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';
|
|
@@ -4,5 +4,6 @@ export type TableMeasurement = {
|
|
|
4
4
|
colWidths: Array<number>;
|
|
5
5
|
tableWidth: number;
|
|
6
6
|
};
|
|
7
|
+
export declare const clampToEditorMaxWidth: (contentWidth: number) => number;
|
|
7
8
|
export declare const getTableMeasurement: (tableRef: HTMLTableElement) => TableMeasurement;
|
|
8
9
|
export declare const applyTableMeasurement: (tr: Transaction, tableNode: PMNode, { colWidths, tableWidth }: TableMeasurement, tablePos: number) => Transaction;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
2
|
+
import type { PluginInjectionAPI } from '../../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Iterates all top-level tables in the document, and for those in content mode,
|
|
5
|
+
* measures rendered column widths and sets colwidth + table width attributes
|
|
6
|
+
* in a single batched transaction.
|
|
7
|
+
*/
|
|
8
|
+
export declare const applyMeasuredWidthToAllTables: (view: EditorView, pluginInjectionApi?: PluginInjectionAPI) => void;
|
package/dist/types-ts4.5/pm-plugins/utils/tableMode/apply-measured-width-to-selected-table.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
2
|
+
import type { PluginInjectionAPI } from '../../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Used to measure a selected table width with it's content being laid out natively by the browser
|
|
5
|
+
*/
|
|
6
|
+
export declare const applyMeasuredWidthToSelectedTable: (view: EditorView, api?: PluginInjectionAPI) => void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type ContentModePluginOptions = {
|
|
2
|
+
allowColumnResizing: boolean;
|
|
3
|
+
allowTableResizing: boolean;
|
|
4
|
+
isFullPageEditor: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare const isContentModeSupported: ({ allowColumnResizing, allowTableResizing, isFullPageEditor, }: ContentModePluginOptions) => boolean;
|
|
7
|
+
export {};
|
package/dist/types-ts4.5/pm-plugins/utils/tableMode/smart-adjust/distribute-column-widths.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const sumWidths: (widths: Array<number>) => number;
|
|
2
|
+
/**
|
|
3
|
+
* Clamps each desired width to `[tableCellMinWidth, MAX × evenShare]`. Greedy
|
|
4
|
+
* columns (paragraphs) hit the ceiling and wrap; small columns stay at their
|
|
5
|
+
* natural width. Leftover canvas budget grows ceiling-hitters up to their
|
|
6
|
+
* desired; overflow reclaims from ceiling-hitters only.
|
|
7
|
+
*/
|
|
8
|
+
export declare const distributeByEvenShareRatio: (desiredWidths: Array<number>, editorContainerWidth: number) => Array<number>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type TableMeasurement } from '../../../transforms/content-mode';
|
|
2
|
+
export declare const restoreResizerContainer: (resizerContainer: HTMLElement | undefined | null) => void;
|
|
3
|
+
/**
|
|
4
|
+
* Smart-adjust: measure unconstrained max-content per column, then clamp via
|
|
5
|
+
* `distributeByEvenShareRatio`.
|
|
6
|
+
*/
|
|
7
|
+
export declare const runSmartAdjust: (tableRef: HTMLTableElement, resizerContainer: HTMLElement | undefined | null, resizerItem: HTMLElement | undefined | null, editorContainerWidthFromApi: number | undefined) => TableMeasurement;
|
|
@@ -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,3 +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 getColumnMenuComponents: ({ api }: TableMenuComponentsParams) => RegisterComponent[];
|
|
3
|
+
export declare const getColumnMenuComponents: ({ 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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "22.4.
|
|
3
|
+
"version": "22.4.16",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"singleton": true
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@atlaskit/adf-schema": "^52.
|
|
31
|
+
"@atlaskit/adf-schema": "^52.14.0",
|
|
32
32
|
"@atlaskit/button": "^23.11.0",
|
|
33
33
|
"@atlaskit/custom-steps": "^0.17.0",
|
|
34
34
|
"@atlaskit/editor-palette": "^2.2.0",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@atlaskit/editor-plugin-batch-attribute-updates": "^10.1.0",
|
|
38
38
|
"@atlaskit/editor-plugin-content-insertion": "^10.1.0",
|
|
39
39
|
"@atlaskit/editor-plugin-editor-viewmode": "^12.1.0",
|
|
40
|
-
"@atlaskit/editor-plugin-extension": "13.5.
|
|
40
|
+
"@atlaskit/editor-plugin-extension": "13.5.6",
|
|
41
41
|
"@atlaskit/editor-plugin-guideline": "^10.1.0",
|
|
42
42
|
"@atlaskit/editor-plugin-interaction": "^19.1.0",
|
|
43
43
|
"@atlaskit/editor-plugin-limited-mode": "^7.2.0",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@atlaskit/editor-tables": "^2.10.0",
|
|
52
52
|
"@atlaskit/editor-toolbar": "^1.7.0",
|
|
53
53
|
"@atlaskit/editor-ui-control-model": "^1.2.0",
|
|
54
|
-
"@atlaskit/icon": "^35.
|
|
54
|
+
"@atlaskit/icon": "^35.1.0",
|
|
55
55
|
"@atlaskit/insm": "^0.4.0",
|
|
56
56
|
"@atlaskit/menu": "^8.5.0",
|
|
57
57
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
@@ -59,10 +59,10 @@
|
|
|
59
59
|
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
|
|
60
60
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.1.0",
|
|
61
61
|
"@atlaskit/primitives": "^19.0.0",
|
|
62
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
62
|
+
"@atlaskit/tmp-editor-statsig": "^83.0.0",
|
|
63
63
|
"@atlaskit/toggle": "^15.6.0",
|
|
64
64
|
"@atlaskit/tokens": "^13.0.0",
|
|
65
|
-
"@atlaskit/tooltip": "^22.
|
|
65
|
+
"@atlaskit/tooltip": "^22.3.0",
|
|
66
66
|
"@babel/runtime": "^7.0.0",
|
|
67
67
|
"@compiled/react": "^0.20.0",
|
|
68
68
|
"@emotion/react": "^11.7.1",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"uuid": "^3.1.0"
|
|
75
75
|
},
|
|
76
76
|
"peerDependencies": {
|
|
77
|
-
"@atlaskit/editor-common": "^114.
|
|
77
|
+
"@atlaskit/editor-common": "^114.47.0",
|
|
78
78
|
"react": "^18.2.0",
|
|
79
79
|
"react-dom": "^18.2.0",
|
|
80
80
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
@@ -122,6 +122,9 @@
|
|
|
122
122
|
"platform_editor_content_mode_button_mvp": {
|
|
123
123
|
"type": "boolean"
|
|
124
124
|
},
|
|
125
|
+
"platform_editor_table_fit_to_content_smart_adjust": {
|
|
126
|
+
"type": "boolean"
|
|
127
|
+
},
|
|
125
128
|
"platform_editor_table_height_analytics": {
|
|
126
129
|
"type": "boolean"
|
|
127
130
|
},
|