@atlaskit/editor-plugin-table 7.16.7 → 7.16.9
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/commands/misc.js +11 -1
- package/dist/cjs/nodeviews/ExternalDropTargets.js +4 -0
- package/dist/cjs/nodeviews/TableComponent.js +28 -5
- package/dist/cjs/nodeviews/TableContainer.js +38 -12
- package/dist/cjs/nodeviews/TableResizer.js +27 -6
- package/dist/cjs/toolbar.js +17 -7
- package/dist/cjs/ui/ColumnResizeWidget/index.js +2 -0
- package/dist/cjs/ui/DragHandle/index.js +10 -3
- package/dist/cjs/ui/DragPreview/index.js +1 -0
- package/dist/cjs/ui/FloatingContextualButton/FixedButton.js +12 -1
- package/dist/cjs/ui/FloatingContextualButton/index.js +3 -1
- package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +7 -2
- package/dist/cjs/ui/FloatingDeleteButton/DeleteButton.js +7 -2
- package/dist/cjs/ui/FloatingDeleteButton/index.js +2 -0
- package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +7 -2
- package/dist/cjs/ui/FloatingDragMenu/DropdownMenu.js +61 -57
- package/dist/cjs/ui/FloatingInsertButton/InsertButton.js +36 -14
- package/dist/cjs/ui/TableFloatingColumnControls/ColumnControls/index.js +22 -4
- package/dist/cjs/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.js +2 -0
- package/dist/cjs/ui/TableFloatingColumnControls/ColumnDropTargets/index.js +4 -1
- package/dist/cjs/ui/TableFloatingColumnControls/index.js +3 -1
- package/dist/cjs/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +12 -3
- package/dist/cjs/ui/TableFloatingControls/CornerControls/DragCornerControls.js +2 -0
- package/dist/cjs/ui/TableFloatingControls/NumberColumn/index.js +13 -4
- package/dist/cjs/ui/TableFloatingControls/RowControls/ClassicControls.js +50 -43
- package/dist/cjs/ui/TableFloatingControls/RowControls/DragControls.js +16 -2
- package/dist/cjs/ui/TableFloatingControls/RowDropTarget/index.js +3 -1
- package/dist/cjs/ui/TableFloatingControls/index.js +80 -76
- package/dist/cjs/ui/icons/DragHandleDisabledIcon.js +3 -1
- package/dist/cjs/ui/icons/DragInMotionIcon.js +3 -1
- package/dist/cjs/ui/icons/MinimisedHandle.js +1 -0
- package/dist/es2019/commands/misc.js +10 -0
- package/dist/es2019/nodeviews/ExternalDropTargets.js +4 -0
- package/dist/es2019/nodeviews/TableComponent.js +28 -5
- package/dist/es2019/nodeviews/TableContainer.js +37 -12
- package/dist/es2019/nodeviews/TableResizer.js +27 -6
- package/dist/es2019/toolbar.js +13 -3
- package/dist/es2019/ui/ColumnResizeWidget/index.js +2 -0
- package/dist/es2019/ui/DragHandle/index.js +10 -3
- package/dist/es2019/ui/DragPreview/index.js +1 -0
- package/dist/es2019/ui/FloatingContextualButton/FixedButton.js +12 -1
- package/dist/es2019/ui/FloatingContextualButton/index.js +3 -1
- package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +7 -2
- package/dist/es2019/ui/FloatingDeleteButton/DeleteButton.js +7 -2
- package/dist/es2019/ui/FloatingDeleteButton/index.js +2 -0
- package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +7 -2
- package/dist/es2019/ui/FloatingDragMenu/DropdownMenu.js +56 -52
- package/dist/es2019/ui/FloatingInsertButton/InsertButton.js +36 -14
- package/dist/es2019/ui/TableFloatingColumnControls/ColumnControls/index.js +22 -4
- package/dist/es2019/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.js +2 -0
- package/dist/es2019/ui/TableFloatingColumnControls/ColumnDropTargets/index.js +4 -1
- package/dist/es2019/ui/TableFloatingColumnControls/index.js +3 -1
- package/dist/es2019/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +12 -3
- package/dist/es2019/ui/TableFloatingControls/CornerControls/DragCornerControls.js +2 -0
- package/dist/es2019/ui/TableFloatingControls/NumberColumn/index.js +13 -4
- package/dist/es2019/ui/TableFloatingControls/RowControls/ClassicControls.js +47 -40
- package/dist/es2019/ui/TableFloatingControls/RowControls/DragControls.js +16 -2
- package/dist/es2019/ui/TableFloatingControls/RowDropTarget/index.js +3 -1
- package/dist/es2019/ui/TableFloatingControls/index.js +78 -74
- package/dist/es2019/ui/icons/DragHandleDisabledIcon.js +3 -1
- package/dist/es2019/ui/icons/DragInMotionIcon.js +3 -1
- package/dist/es2019/ui/icons/MinimisedHandle.js +1 -0
- package/dist/esm/commands/misc.js +10 -0
- package/dist/esm/nodeviews/ExternalDropTargets.js +4 -0
- package/dist/esm/nodeviews/TableComponent.js +28 -5
- package/dist/esm/nodeviews/TableContainer.js +38 -12
- package/dist/esm/nodeviews/TableResizer.js +29 -8
- package/dist/esm/toolbar.js +16 -4
- package/dist/esm/ui/ColumnResizeWidget/index.js +2 -0
- package/dist/esm/ui/DragHandle/index.js +10 -3
- package/dist/esm/ui/DragPreview/index.js +1 -0
- package/dist/esm/ui/FloatingContextualButton/FixedButton.js +12 -1
- package/dist/esm/ui/FloatingContextualButton/index.js +3 -1
- package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +7 -2
- package/dist/esm/ui/FloatingDeleteButton/DeleteButton.js +7 -2
- package/dist/esm/ui/FloatingDeleteButton/index.js +2 -0
- package/dist/esm/ui/FloatingDragMenu/DragMenu.js +7 -2
- package/dist/esm/ui/FloatingDragMenu/DropdownMenu.js +61 -57
- package/dist/esm/ui/FloatingInsertButton/InsertButton.js +36 -14
- package/dist/esm/ui/TableFloatingColumnControls/ColumnControls/index.js +22 -4
- package/dist/esm/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.js +2 -0
- package/dist/esm/ui/TableFloatingColumnControls/ColumnDropTargets/index.js +4 -1
- package/dist/esm/ui/TableFloatingColumnControls/index.js +3 -1
- package/dist/esm/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +12 -3
- package/dist/esm/ui/TableFloatingControls/CornerControls/DragCornerControls.js +2 -0
- package/dist/esm/ui/TableFloatingControls/NumberColumn/index.js +13 -4
- package/dist/esm/ui/TableFloatingControls/RowControls/ClassicControls.js +50 -43
- package/dist/esm/ui/TableFloatingControls/RowControls/DragControls.js +16 -2
- package/dist/esm/ui/TableFloatingControls/RowDropTarget/index.js +3 -1
- package/dist/esm/ui/TableFloatingControls/index.js +80 -76
- package/dist/esm/ui/icons/DragHandleDisabledIcon.js +3 -1
- package/dist/esm/ui/icons/DragInMotionIcon.js +3 -1
- package/dist/esm/ui/icons/MinimisedHandle.js +1 -0
- package/dist/types/commands/misc.d.ts +2 -1
- package/dist/types/nodeviews/TableContainer.d.ts +3 -2
- package/dist/types/nodeviews/TableResizer.d.ts +2 -1
- package/dist/types/toolbar.d.ts +2 -1
- package/dist/types-ts4.5/commands/misc.d.ts +2 -1
- package/dist/types-ts4.5/nodeviews/TableContainer.d.ts +3 -2
- package/dist/types-ts4.5/nodeviews/TableResizer.d.ts +2 -1
- package/dist/types-ts4.5/toolbar.d.ts +2 -1
- package/docs/0-intro.tsx +1 -0
- package/package.json +2 -2
- package/src/commands/misc.ts +20 -1
- package/src/nodeviews/ExternalDropTargets.tsx +4 -0
- package/src/nodeviews/TableComponent.tsx +18 -0
- package/src/nodeviews/TableContainer.tsx +17 -1
- package/src/nodeviews/TableResizer.tsx +52 -6
- package/src/toolbar.tsx +20 -1
- package/src/ui/ColumnResizeWidget/index.tsx +2 -0
- package/src/ui/DragHandle/index.tsx +3 -0
- package/src/ui/DragPreview/index.tsx +1 -0
- package/src/ui/FloatingContextualButton/FixedButton.tsx +10 -0
- package/src/ui/FloatingContextualButton/index.tsx +1 -0
- package/src/ui/FloatingContextualMenu/ContextualMenu.tsx +3 -0
- package/src/ui/FloatingDeleteButton/DeleteButton.tsx +4 -0
- package/src/ui/FloatingDeleteButton/index.tsx +2 -0
- package/src/ui/FloatingDragMenu/DragMenu.tsx +3 -0
- package/src/ui/FloatingDragMenu/DropdownMenu.tsx +3 -0
- package/src/ui/FloatingInsertButton/InsertButton.tsx +14 -0
- package/src/ui/TableFloatingColumnControls/ColumnControls/index.tsx +16 -1
- package/src/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.tsx +2 -0
- package/src/ui/TableFloatingColumnControls/ColumnDropTargets/index.tsx +2 -0
- package/src/ui/TableFloatingColumnControls/index.tsx +1 -0
- package/src/ui/TableFloatingControls/CornerControls/ClassicCornerControls.tsx +6 -0
- package/src/ui/TableFloatingControls/CornerControls/DragCornerControls.tsx +4 -0
- package/src/ui/TableFloatingControls/NumberColumn/index.tsx +5 -0
- package/src/ui/TableFloatingControls/RowControls/ClassicControls.tsx +5 -0
- package/src/ui/TableFloatingControls/RowControls/DragControls.tsx +15 -1
- package/src/ui/TableFloatingControls/RowDropTarget/index.tsx +1 -0
- package/src/ui/TableFloatingControls/index.tsx +1 -0
- package/src/ui/icons/DragHandleDisabledIcon.tsx +1 -0
- package/src/ui/icons/DragInMotionIcon.tsx +1 -0
- package/src/ui/icons/MinimisedHandle.tsx +1 -0
|
@@ -9,6 +9,7 @@ interface TableResizerProps {
|
|
|
9
9
|
width: number;
|
|
10
10
|
maxWidth: number;
|
|
11
11
|
containerWidth: number;
|
|
12
|
+
lineLength: number;
|
|
12
13
|
updateWidth: (width: number) => void;
|
|
13
14
|
editorView: EditorView;
|
|
14
15
|
getPos: () => number | undefined;
|
|
@@ -26,5 +27,5 @@ export interface TableResizerImprovementProps extends TableResizerProps {
|
|
|
26
27
|
onResizeStop?: () => void;
|
|
27
28
|
onResizeStart?: () => void;
|
|
28
29
|
}
|
|
29
|
-
export declare const TableResizer: ({ children, width, maxWidth, containerWidth, updateWidth, onResizeStop, onResizeStart, editorView, getPos, node, tableRef, displayGuideline, attachAnalyticsEvent, displayGapCursor, isTableScalingEnabled, isTableAlignmentEnabled, isWholeTableInDanger, pluginInjectionApi, }: PropsWithChildren<TableResizerImprovementProps>) => JSX.Element;
|
|
30
|
+
export declare const TableResizer: ({ children, width, maxWidth, containerWidth, lineLength, updateWidth, onResizeStop, onResizeStart, editorView, getPos, node, tableRef, displayGuideline, attachAnalyticsEvent, displayGapCursor, isTableScalingEnabled, isTableAlignmentEnabled, isWholeTableInDanger, pluginInjectionApi, }: PropsWithChildren<TableResizerImprovementProps>) => JSX.Element;
|
|
30
31
|
export {};
|
package/dist/types/toolbar.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ type AlignmentIcon = {
|
|
|
19
19
|
value: AlignmentOptions;
|
|
20
20
|
icon: React.ComponentClass<any>;
|
|
21
21
|
};
|
|
22
|
-
export declare const getAlignmentOptionsConfig: (editorState: EditorState, { formatMessage }: ToolbarMenuContext, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Array<FloatingToolbarDropdown<Command>>;
|
|
22
|
+
export declare const getAlignmentOptionsConfig: (editorState: EditorState, { formatMessage }: ToolbarMenuContext, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, getEditorContainerWidth: GetEditorContainerWidth) => Array<FloatingToolbarDropdown<Command>>;
|
|
23
23
|
export declare const getSelectedAlignmentIcon: (alignmentIcons: AlignmentIcon[], selectedNode: PMNode) => AlignmentIcon | undefined;
|
|
24
|
+
export declare const isLayoutOptionDisabled: (selectedNode: PMNode, getEditorContainerWidth: GetEditorContainerWidth) => boolean;
|
|
24
25
|
export {};
|
|
@@ -2,7 +2,7 @@ import type { TableLayout } from '@atlaskit/adf-schema';
|
|
|
2
2
|
import type { Command, EditorCommand } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { Node as PMNode, Schema, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import type { EditorState, Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
-
import type { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
5
|
+
import type { ContentNodeWithPos, NodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
6
6
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
7
|
import type { WidthToWidest } from '../types';
|
|
8
8
|
export declare const setEditorFocus: (editorHasFocus: boolean) => Command;
|
|
@@ -37,3 +37,4 @@ export declare const autoSizeTable: (view: EditorView, node: PMNode, table: HTML
|
|
|
37
37
|
export declare const addBoldInEmptyHeaderCells: (tableCellHeader: ContentNodeWithPos) => Command;
|
|
38
38
|
export declare const updateWidthToWidest: (widthToWidest: WidthToWidest) => Command;
|
|
39
39
|
export declare const setTableAlignment: (newAlignment: TableLayout) => EditorCommand;
|
|
40
|
+
export declare const setTableAlignmentWithTableContentWithPos: (newAlignment: TableLayout, tableNodeWithPos: NodeWithPos) => EditorCommand;
|
|
@@ -17,6 +17,7 @@ export declare const InnerContainer: React.ForwardRefExoticComponent<InnerContai
|
|
|
17
17
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
18
18
|
type ResizableTableContainerProps = {
|
|
19
19
|
containerWidth: number;
|
|
20
|
+
lineLength: number;
|
|
20
21
|
node: PMNode;
|
|
21
22
|
className: string;
|
|
22
23
|
editorView: EditorView;
|
|
@@ -29,7 +30,7 @@ type ResizableTableContainerProps = {
|
|
|
29
30
|
isTableScalingEnabled?: boolean;
|
|
30
31
|
isTableAlignmentEnabled?: boolean;
|
|
31
32
|
};
|
|
32
|
-
export declare const ResizableTableContainer: React.MemoExoticComponent<({ children, className, node, containerWidth, editorView, getPos, tableRef, isResizing, pluginInjectionApi, tableWrapperHeight, isWholeTableInDanger, isTableScalingEnabled, isTableAlignmentEnabled, }: PropsWithChildren<ResizableTableContainerProps>) => JSX.Element>;
|
|
33
|
+
export declare const ResizableTableContainer: React.MemoExoticComponent<({ children, className, node, containerWidth, lineLength, editorView, getPos, tableRef, isResizing, pluginInjectionApi, tableWrapperHeight, isWholeTableInDanger, isTableScalingEnabled, isTableAlignmentEnabled, }: PropsWithChildren<ResizableTableContainerProps>) => JSX.Element>;
|
|
33
34
|
type TableContainerProps = {
|
|
34
35
|
node: PMNode;
|
|
35
36
|
className: string;
|
|
@@ -46,5 +47,5 @@ type TableContainerProps = {
|
|
|
46
47
|
isTableScalingEnabled?: boolean;
|
|
47
48
|
isTableAlignmentEnabled?: boolean;
|
|
48
49
|
};
|
|
49
|
-
export declare const TableContainer: ({ children, node, className, containerWidth: { width: editorWidth }, editorView, getPos, tableRef, isNested, tableWrapperHeight, isResizing, pluginInjectionApi, isWholeTableInDanger, isTableResizingEnabled, isTableScalingEnabled, isTableAlignmentEnabled, }: PropsWithChildren<TableContainerProps>) => JSX.Element;
|
|
50
|
+
export declare const TableContainer: ({ children, node, className, containerWidth: { width: editorWidth, lineLength }, editorView, getPos, tableRef, isNested, tableWrapperHeight, isResizing, pluginInjectionApi, isWholeTableInDanger, isTableResizingEnabled, isTableScalingEnabled, isTableAlignmentEnabled, }: PropsWithChildren<TableContainerProps>) => JSX.Element;
|
|
50
51
|
export {};
|
|
@@ -9,6 +9,7 @@ interface TableResizerProps {
|
|
|
9
9
|
width: number;
|
|
10
10
|
maxWidth: number;
|
|
11
11
|
containerWidth: number;
|
|
12
|
+
lineLength: number;
|
|
12
13
|
updateWidth: (width: number) => void;
|
|
13
14
|
editorView: EditorView;
|
|
14
15
|
getPos: () => number | undefined;
|
|
@@ -26,5 +27,5 @@ export interface TableResizerImprovementProps extends TableResizerProps {
|
|
|
26
27
|
onResizeStop?: () => void;
|
|
27
28
|
onResizeStart?: () => void;
|
|
28
29
|
}
|
|
29
|
-
export declare const TableResizer: ({ children, width, maxWidth, containerWidth, updateWidth, onResizeStop, onResizeStart, editorView, getPos, node, tableRef, displayGuideline, attachAnalyticsEvent, displayGapCursor, isTableScalingEnabled, isTableAlignmentEnabled, isWholeTableInDanger, pluginInjectionApi, }: PropsWithChildren<TableResizerImprovementProps>) => JSX.Element;
|
|
30
|
+
export declare const TableResizer: ({ children, width, maxWidth, containerWidth, lineLength, updateWidth, onResizeStop, onResizeStart, editorView, getPos, node, tableRef, displayGuideline, attachAnalyticsEvent, displayGapCursor, isTableScalingEnabled, isTableAlignmentEnabled, isWholeTableInDanger, pluginInjectionApi, }: PropsWithChildren<TableResizerImprovementProps>) => JSX.Element;
|
|
30
31
|
export {};
|
|
@@ -19,6 +19,7 @@ type AlignmentIcon = {
|
|
|
19
19
|
value: AlignmentOptions;
|
|
20
20
|
icon: React.ComponentClass<any>;
|
|
21
21
|
};
|
|
22
|
-
export declare const getAlignmentOptionsConfig: (editorState: EditorState, { formatMessage }: ToolbarMenuContext, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Array<FloatingToolbarDropdown<Command>>;
|
|
22
|
+
export declare const getAlignmentOptionsConfig: (editorState: EditorState, { formatMessage }: ToolbarMenuContext, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, getEditorContainerWidth: GetEditorContainerWidth) => Array<FloatingToolbarDropdown<Command>>;
|
|
23
23
|
export declare const getSelectedAlignmentIcon: (alignmentIcons: AlignmentIcon[], selectedNode: PMNode) => AlignmentIcon | undefined;
|
|
24
|
+
export declare const isLayoutOptionDisabled: (selectedNode: PMNode, getEditorContainerWidth: GetEditorContainerWidth) => boolean;
|
|
24
25
|
export {};
|
package/docs/0-intro.tsx
CHANGED
|
@@ -13,6 +13,7 @@ ${createEditorUseOnlyNotice('Editor Plugin Table', [
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
${(
|
|
16
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
16
17
|
<div style={{ marginTop: token('space.100', '8px') }}>
|
|
17
18
|
<AtlassianInternalWarning />
|
|
18
19
|
</div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "7.16.
|
|
3
|
+
"version": "7.16.9",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@atlaskit/adf-schema": "^36.10.7",
|
|
32
32
|
"@atlaskit/button": "^17.17.0",
|
|
33
33
|
"@atlaskit/custom-steps": "^0.2.0",
|
|
34
|
-
"@atlaskit/editor-common": "^81.
|
|
34
|
+
"@atlaskit/editor-common": "^81.1.0",
|
|
35
35
|
"@atlaskit/editor-palette": "1.6.0",
|
|
36
36
|
"@atlaskit/editor-plugin-accessibility-utils": "^1.1.0",
|
|
37
37
|
"@atlaskit/editor-plugin-analytics": "^1.2.0",
|
package/src/commands/misc.ts
CHANGED
|
@@ -19,7 +19,10 @@ import type {
|
|
|
19
19
|
Selection,
|
|
20
20
|
Transaction,
|
|
21
21
|
} from '@atlaskit/editor-prosemirror/state';
|
|
22
|
-
import type {
|
|
22
|
+
import type {
|
|
23
|
+
ContentNodeWithPos,
|
|
24
|
+
NodeWithPos,
|
|
25
|
+
} from '@atlaskit/editor-prosemirror/utils';
|
|
23
26
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
24
27
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
25
28
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
@@ -831,3 +834,19 @@ export const setTableAlignment =
|
|
|
831
834
|
|
|
832
835
|
return tr;
|
|
833
836
|
};
|
|
837
|
+
|
|
838
|
+
export const setTableAlignmentWithTableContentWithPos =
|
|
839
|
+
(newAlignment: TableLayout, tableNodeWithPos: NodeWithPos): EditorCommand =>
|
|
840
|
+
({ tr }) => {
|
|
841
|
+
const nextTableAttrs = {
|
|
842
|
+
...tableNodeWithPos.node.attrs,
|
|
843
|
+
layout: newAlignment,
|
|
844
|
+
};
|
|
845
|
+
|
|
846
|
+
tr.setNodeMarkup(tableNodeWithPos.pos, undefined, nextTableAttrs).setMeta(
|
|
847
|
+
'scrollIntoView',
|
|
848
|
+
false,
|
|
849
|
+
);
|
|
850
|
+
|
|
851
|
+
return tr;
|
|
852
|
+
};
|
|
@@ -54,10 +54,13 @@ export const ExternalDropTargets = ({
|
|
|
54
54
|
<div
|
|
55
55
|
style={{
|
|
56
56
|
width: getTableWrapperWidth(),
|
|
57
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
57
58
|
overflow: 'hidden',
|
|
59
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
58
60
|
position: 'absolute',
|
|
59
61
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
60
62
|
top: `-${dropTargetExtendedWidth - tableMarginTop}px`,
|
|
63
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
61
64
|
pointerEvents: 'auto',
|
|
62
65
|
zIndex: `${dropTargetsZIndex}`,
|
|
63
66
|
}}
|
|
@@ -65,6 +68,7 @@ export const ExternalDropTargets = ({
|
|
|
65
68
|
>
|
|
66
69
|
<div
|
|
67
70
|
style={{
|
|
71
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
68
72
|
display: 'flex',
|
|
69
73
|
// move drop targets based on table wrapper scroll
|
|
70
74
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
@@ -804,6 +804,7 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
804
804
|
|
|
805
805
|
return (
|
|
806
806
|
<TableContainer
|
|
807
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
807
808
|
className={classnames(ClassName.TABLE_CONTAINER, {
|
|
808
809
|
[ClassName.WITH_CONTROLS]: allowControls && tableActive,
|
|
809
810
|
[ClassName.TABLE_STICKY]: this.state.stickyHeader && hasHeaderRow,
|
|
@@ -825,11 +826,13 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
825
826
|
isTableAlignmentEnabled={isTableAlignmentEnabled}
|
|
826
827
|
>
|
|
827
828
|
<div
|
|
829
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
828
830
|
className={ClassName.TABLE_STICKY_SENTINEL_TOP}
|
|
829
831
|
data-testid="sticky-sentinel-top"
|
|
830
832
|
/>
|
|
831
833
|
{stickyScrollbar && (
|
|
832
834
|
<div
|
|
835
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
833
836
|
className={ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP}
|
|
834
837
|
data-testid="sticky-scrollbar-sentinel-top"
|
|
835
838
|
/>
|
|
@@ -850,11 +853,14 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
850
853
|
)}
|
|
851
854
|
<div
|
|
852
855
|
contentEditable={false}
|
|
856
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
853
857
|
style={shadowStyle(showBeforeShadow)}
|
|
858
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
854
859
|
className={ClassName.TABLE_LEFT_SHADOW}
|
|
855
860
|
/>
|
|
856
861
|
{this.state.stickyHeader && (
|
|
857
862
|
<div
|
|
863
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
858
864
|
className={`${ClassName.TABLE_LEFT_SHADOW} ${ClassName.TABLE_STICKY_SHADOW}`}
|
|
859
865
|
style={{
|
|
860
866
|
visibility:
|
|
@@ -867,6 +873,7 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
867
873
|
/>
|
|
868
874
|
)}
|
|
869
875
|
<div
|
|
876
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
870
877
|
className={classnames(ClassName.TABLE_NODE_WRAPPER)}
|
|
871
878
|
ref={(elem) => {
|
|
872
879
|
this.wrapper = elem;
|
|
@@ -885,9 +892,12 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
885
892
|
</div>
|
|
886
893
|
{stickyScrollbar && (
|
|
887
894
|
<div
|
|
895
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
888
896
|
className={ClassName.TABLE_STICKY_SCROLLBAR_CONTAINER}
|
|
889
897
|
style={{
|
|
898
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
890
899
|
height: token('space.250', '20px'), // MAX_BROWSER_SCROLLBAR_HEIGHT
|
|
900
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
891
901
|
display: 'none',
|
|
892
902
|
// prevent unwanted scroll during table resize without removing scrollbar container from the dom
|
|
893
903
|
width: isResizing ? token('space.0', '0px') : '100%',
|
|
@@ -896,6 +906,7 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
896
906
|
<div
|
|
897
907
|
style={{
|
|
898
908
|
width: tableRef?.clientWidth,
|
|
909
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
899
910
|
height: '100%',
|
|
900
911
|
}}
|
|
901
912
|
></div>
|
|
@@ -903,17 +914,22 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
903
914
|
)}
|
|
904
915
|
<div
|
|
905
916
|
contentEditable={false}
|
|
917
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
906
918
|
style={shadowStyle(showAfterShadow)}
|
|
919
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
907
920
|
className={ClassName.TABLE_RIGHT_SHADOW}
|
|
908
921
|
/>
|
|
909
922
|
{this.state.stickyHeader && (
|
|
910
923
|
<div
|
|
911
924
|
style={{
|
|
925
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
912
926
|
position: 'absolute',
|
|
927
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
913
928
|
right: token('space.400', '32px'), // tableOverflowShadowWidthWide
|
|
914
929
|
}}
|
|
915
930
|
>
|
|
916
931
|
<div
|
|
932
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
917
933
|
className={`${ClassName.TABLE_RIGHT_SHADOW} ${ClassName.TABLE_STICKY_SHADOW}`}
|
|
918
934
|
style={{
|
|
919
935
|
visibility:
|
|
@@ -927,11 +943,13 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
927
943
|
</div>
|
|
928
944
|
)}
|
|
929
945
|
<div
|
|
946
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
930
947
|
className={ClassName.TABLE_STICKY_SENTINEL_BOTTOM}
|
|
931
948
|
data-testid="sticky-sentinel-bottom"
|
|
932
949
|
/>
|
|
933
950
|
{stickyScrollbar && (
|
|
934
951
|
<div
|
|
952
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
935
953
|
className={ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM}
|
|
936
954
|
data-testid="sticky-scrollbar-sentinel-bottom"
|
|
937
955
|
/>
|
|
@@ -45,7 +45,9 @@ export const InnerContainer = forwardRef<
|
|
|
45
45
|
return (
|
|
46
46
|
<div
|
|
47
47
|
ref={ref}
|
|
48
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
48
49
|
style={style}
|
|
50
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
49
51
|
className={className}
|
|
50
52
|
data-number-column={node.attrs.isNumberColumnEnabled}
|
|
51
53
|
data-layout={node.attrs.layout}
|
|
@@ -75,6 +77,7 @@ const AlignmentTableContainer = ({
|
|
|
75
77
|
}, [alignment]);
|
|
76
78
|
|
|
77
79
|
return (
|
|
80
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
78
81
|
<div data-testid="table-alignment-container" style={style}>
|
|
79
82
|
{children}
|
|
80
83
|
</div>
|
|
@@ -93,7 +96,9 @@ const AlignmentTableContainerWrapper = ({
|
|
|
93
96
|
<div
|
|
94
97
|
data-testid="table-alignment-container"
|
|
95
98
|
style={{
|
|
99
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
96
100
|
display: 'flex',
|
|
101
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
97
102
|
justifyContent: 'center',
|
|
98
103
|
}}
|
|
99
104
|
>
|
|
@@ -109,6 +114,7 @@ const AlignmentTableContainerWrapper = ({
|
|
|
109
114
|
|
|
110
115
|
type ResizableTableContainerProps = {
|
|
111
116
|
containerWidth: number;
|
|
117
|
+
lineLength: number;
|
|
112
118
|
node: PMNode;
|
|
113
119
|
className: string;
|
|
114
120
|
editorView: EditorView;
|
|
@@ -129,6 +135,7 @@ export const ResizableTableContainer = React.memo(
|
|
|
129
135
|
className,
|
|
130
136
|
node,
|
|
131
137
|
containerWidth,
|
|
138
|
+
lineLength,
|
|
132
139
|
editorView,
|
|
133
140
|
getPos,
|
|
134
141
|
tableRef,
|
|
@@ -246,6 +253,7 @@ export const ResizableTableContainer = React.memo(
|
|
|
246
253
|
width,
|
|
247
254
|
maxWidth: maxResizerWidth,
|
|
248
255
|
containerWidth,
|
|
256
|
+
lineLength,
|
|
249
257
|
updateWidth,
|
|
250
258
|
editorView,
|
|
251
259
|
getPos,
|
|
@@ -277,19 +285,23 @@ export const ResizableTableContainer = React.memo(
|
|
|
277
285
|
: 'auto',
|
|
278
286
|
position: isLivePageViewMode ? 'relative' : 'unset',
|
|
279
287
|
}}
|
|
288
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
280
289
|
className={ClassName.TABLE_RESIZER_CONTAINER}
|
|
281
290
|
ref={containerRef}
|
|
282
291
|
>
|
|
283
292
|
{isLivePageViewMode ? (
|
|
284
293
|
<InnerContainer
|
|
294
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
285
295
|
className={className}
|
|
286
296
|
node={node}
|
|
297
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
287
298
|
style={{ width: 'inherit' }}
|
|
288
299
|
>
|
|
289
300
|
{children}
|
|
290
301
|
</InnerContainer>
|
|
291
302
|
) : (
|
|
292
303
|
<TableResizer {...tableResizerProps}>
|
|
304
|
+
{/* eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766 */}
|
|
293
305
|
<InnerContainer className={className} node={node}>
|
|
294
306
|
{children}
|
|
295
307
|
</InnerContainer>
|
|
@@ -323,7 +335,7 @@ export const TableContainer = ({
|
|
|
323
335
|
children,
|
|
324
336
|
node,
|
|
325
337
|
className,
|
|
326
|
-
containerWidth: { width: editorWidth },
|
|
338
|
+
containerWidth: { width: editorWidth, lineLength },
|
|
327
339
|
editorView,
|
|
328
340
|
getPos,
|
|
329
341
|
tableRef,
|
|
@@ -339,9 +351,11 @@ export const TableContainer = ({
|
|
|
339
351
|
if (isTableResizingEnabled && !isNested) {
|
|
340
352
|
return (
|
|
341
353
|
<ResizableTableContainer
|
|
354
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
342
355
|
className={className}
|
|
343
356
|
node={node}
|
|
344
357
|
containerWidth={editorWidth!}
|
|
358
|
+
lineLength={lineLength!}
|
|
345
359
|
editorView={editorView}
|
|
346
360
|
getPos={getPos}
|
|
347
361
|
tableRef={tableRef}
|
|
@@ -360,10 +374,12 @@ export const TableContainer = ({
|
|
|
360
374
|
return (
|
|
361
375
|
<InnerContainer
|
|
362
376
|
node={node}
|
|
377
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
363
378
|
className={classNames(className, {
|
|
364
379
|
'less-padding': editorWidth < akEditorMobileBreakoutPoint && !isNested,
|
|
365
380
|
})}
|
|
366
381
|
style={{
|
|
382
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
367
383
|
width: 'inherit',
|
|
368
384
|
}}
|
|
369
385
|
>
|
|
@@ -24,6 +24,7 @@ import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
|
24
24
|
import type { HandleResize, HandleSize } from '@atlaskit/editor-common/resizer';
|
|
25
25
|
import { ResizerNext } from '@atlaskit/editor-common/resizer';
|
|
26
26
|
import { browser } from '@atlaskit/editor-common/utils';
|
|
27
|
+
import { chainCommands } from '@atlaskit/editor-prosemirror/commands';
|
|
27
28
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
28
29
|
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
29
30
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
@@ -31,7 +32,10 @@ import { findTable } from '@atlaskit/editor-tables/utils';
|
|
|
31
32
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
32
33
|
import { token } from '@atlaskit/tokens';
|
|
33
34
|
|
|
34
|
-
import {
|
|
35
|
+
import {
|
|
36
|
+
setTableAlignmentWithTableContentWithPos,
|
|
37
|
+
updateWidthToWidest,
|
|
38
|
+
} from '../commands/misc';
|
|
35
39
|
import { META_KEYS } from '../pm-plugins/table-analytics';
|
|
36
40
|
import {
|
|
37
41
|
COLUMN_MIN_WIDTH,
|
|
@@ -48,7 +52,11 @@ import {
|
|
|
48
52
|
TABLE_HIGHLIGHT_TOLERANCE,
|
|
49
53
|
TABLE_SNAP_GAP,
|
|
50
54
|
} from '../ui/consts';
|
|
51
|
-
import {
|
|
55
|
+
import {
|
|
56
|
+
ALIGN_CENTER,
|
|
57
|
+
ALIGN_START,
|
|
58
|
+
normaliseAlignment,
|
|
59
|
+
} from '../utils/alignment';
|
|
52
60
|
import {
|
|
53
61
|
generateResizedPayload,
|
|
54
62
|
generateResizeFrameRatePayloads,
|
|
@@ -68,6 +76,7 @@ interface TableResizerProps {
|
|
|
68
76
|
width: number;
|
|
69
77
|
maxWidth: number;
|
|
70
78
|
containerWidth: number;
|
|
79
|
+
lineLength: number;
|
|
71
80
|
updateWidth: (width: number) => void;
|
|
72
81
|
editorView: EditorView;
|
|
73
82
|
getPos: () => number | undefined;
|
|
@@ -93,6 +102,8 @@ type ResizerNextHandler = React.ElementRef<typeof ResizerNext>;
|
|
|
93
102
|
|
|
94
103
|
const RESIZE_STEP_VALUE = 10;
|
|
95
104
|
|
|
105
|
+
const FULL_WIDTH_EDITOR_CONTENT_WIDTH = 1800;
|
|
106
|
+
|
|
96
107
|
const handles = { right: true };
|
|
97
108
|
const handleStyles = {
|
|
98
109
|
right: {
|
|
@@ -160,6 +171,7 @@ export const TableResizer = ({
|
|
|
160
171
|
width,
|
|
161
172
|
maxWidth,
|
|
162
173
|
containerWidth,
|
|
174
|
+
lineLength,
|
|
163
175
|
updateWidth,
|
|
164
176
|
onResizeStop,
|
|
165
177
|
onResizeStart,
|
|
@@ -249,6 +261,34 @@ export const TableResizer = ({
|
|
|
249
261
|
],
|
|
250
262
|
);
|
|
251
263
|
|
|
264
|
+
const switchToCenterAlignment = useCallback(
|
|
265
|
+
(pos, node, newWidth, state, dispatch) => {
|
|
266
|
+
if (
|
|
267
|
+
isTableAlignmentEnabled &&
|
|
268
|
+
node &&
|
|
269
|
+
node.attrs.layout === ALIGN_START &&
|
|
270
|
+
newWidth > lineLength &&
|
|
271
|
+
lineLength < FULL_WIDTH_EDITOR_CONTENT_WIDTH && // We don't want to switch alignment in Full-width editor
|
|
272
|
+
isResizing.current
|
|
273
|
+
) {
|
|
274
|
+
const tableNodeWithPos = { pos, node };
|
|
275
|
+
const tr = setTableAlignmentWithTableContentWithPos(
|
|
276
|
+
ALIGN_CENTER,
|
|
277
|
+
tableNodeWithPos,
|
|
278
|
+
)(state);
|
|
279
|
+
|
|
280
|
+
if (tr) {
|
|
281
|
+
dispatch(tr);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
return true;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
return false;
|
|
288
|
+
},
|
|
289
|
+
[lineLength, isTableAlignmentEnabled, isResizing],
|
|
290
|
+
);
|
|
291
|
+
|
|
252
292
|
useEffect(() => {
|
|
253
293
|
return () => {
|
|
254
294
|
// only bring back the cursor if this table was deleted - i.e. if a user was resizing, then another
|
|
@@ -378,9 +418,14 @@ export const TableResizer = ({
|
|
|
378
418
|
const shouldUpdateWidthToWidest =
|
|
379
419
|
!!isTableScalingEnabled && isFullWidthGuidelineActive;
|
|
380
420
|
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
421
|
+
chainCommands(
|
|
422
|
+
(state, dispatch) => {
|
|
423
|
+
return switchToCenterAlignment(pos, node, newWidth, state, dispatch);
|
|
424
|
+
},
|
|
425
|
+
updateWidthToWidest({
|
|
426
|
+
[currentTableNodeLocalId]: shouldUpdateWidthToWidest,
|
|
427
|
+
}),
|
|
428
|
+
)(state, dispatch);
|
|
384
429
|
|
|
385
430
|
updateWidth(shouldUpdateWidthToWidest ? TABLE_MAX_WIDTH : newWidth);
|
|
386
431
|
|
|
@@ -397,6 +442,7 @@ export const TableResizer = ({
|
|
|
397
442
|
containerWidth,
|
|
398
443
|
updateWidth,
|
|
399
444
|
getPos,
|
|
445
|
+
switchToCenterAlignment,
|
|
400
446
|
],
|
|
401
447
|
);
|
|
402
448
|
|
|
@@ -628,7 +674,7 @@ export const TableResizer = ({
|
|
|
628
674
|
const resizeRatio =
|
|
629
675
|
!isTableAlignmentEnabled ||
|
|
630
676
|
(isTableAlignmentEnabled &&
|
|
631
|
-
normaliseAlignment(node.attrs.layout) ===
|
|
677
|
+
normaliseAlignment(node.attrs.layout) === ALIGN_CENTER)
|
|
632
678
|
? 2
|
|
633
679
|
: 1;
|
|
634
680
|
|
package/src/toolbar.tsx
CHANGED
|
@@ -487,7 +487,7 @@ export const getToolbarConfig =
|
|
|
487
487
|
|
|
488
488
|
alignmentMenu =
|
|
489
489
|
options?.isTableAlignmentEnabled && !isNested
|
|
490
|
-
? getAlignmentOptionsConfig(state, intl, editorAnalyticsAPI)
|
|
490
|
+
? getAlignmentOptionsConfig(state, intl, editorAnalyticsAPI, getEditorContainerWidth)
|
|
491
491
|
: [];
|
|
492
492
|
|
|
493
493
|
let cellItems: Array<FloatingToolbarItem<Command>>;
|
|
@@ -900,6 +900,7 @@ export const getAlignmentOptionsConfig = (
|
|
|
900
900
|
editorState: EditorState,
|
|
901
901
|
{ formatMessage }: ToolbarMenuContext,
|
|
902
902
|
editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null,
|
|
903
|
+
getEditorContainerWidth: GetEditorContainerWidth
|
|
903
904
|
): Array<FloatingToolbarDropdown<Command>> => {
|
|
904
905
|
const tableObject = findTable(editorState.selection);
|
|
905
906
|
|
|
@@ -942,6 +943,7 @@ export const getAlignmentOptionsConfig = (
|
|
|
942
943
|
currentLayout,
|
|
943
944
|
INPUT_METHOD.FLOATING_TB
|
|
944
945
|
),
|
|
946
|
+
...(isLayoutOptionDisabled(tableObject.node, getEditorContainerWidth) && { disabled: value !== 'center' }),
|
|
945
947
|
};
|
|
946
948
|
},
|
|
947
949
|
);
|
|
@@ -988,3 +990,20 @@ export const getSelectedAlignmentIcon = (
|
|
|
988
990
|
(icon) => icon.value === normaliseAlignment(selectedAlignment),
|
|
989
991
|
);
|
|
990
992
|
};
|
|
993
|
+
|
|
994
|
+
export const isLayoutOptionDisabled = (
|
|
995
|
+
selectedNode: PMNode,
|
|
996
|
+
getEditorContainerWidth: GetEditorContainerWidth
|
|
997
|
+
) => {
|
|
998
|
+
const lineLength = getEditorContainerWidth().lineLength;
|
|
999
|
+
|
|
1000
|
+
if (
|
|
1001
|
+
selectedNode &&
|
|
1002
|
+
lineLength &&
|
|
1003
|
+
selectedNode.attrs.width > lineLength
|
|
1004
|
+
) {
|
|
1005
|
+
return true;
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
return false;
|
|
1009
|
+
};
|
|
@@ -27,6 +27,7 @@ export const ColumnResizeWidget = ({
|
|
|
27
27
|
if (!includeTooltip) {
|
|
28
28
|
return (
|
|
29
29
|
<div
|
|
30
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
30
31
|
className={TableCssClassName.RESIZE_HANDLE_DECORATION}
|
|
31
32
|
data-start-index={startIndex}
|
|
32
33
|
data-end-index={endIndex}
|
|
@@ -49,6 +50,7 @@ export const ColumnResizeWidget = ({
|
|
|
49
50
|
>
|
|
50
51
|
{(tooltipProps) => (
|
|
51
52
|
<div
|
|
53
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
52
54
|
className={TableCssClassName.RESIZE_HANDLE_DECORATION}
|
|
53
55
|
data-start-index={startIndex}
|
|
54
56
|
data-end-index={endIndex}
|
|
@@ -213,6 +213,7 @@ const DragHandleComponent = ({
|
|
|
213
213
|
<>
|
|
214
214
|
<button
|
|
215
215
|
type="button"
|
|
216
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
216
217
|
className={ClassName.DRAG_HANDLE_BUTTON_CLICKABLE_ZONE}
|
|
217
218
|
data-testid="table-drag-handle-clickable-zone-button"
|
|
218
219
|
style={{
|
|
@@ -241,6 +242,7 @@ const DragHandleComponent = ({
|
|
|
241
242
|
<button
|
|
242
243
|
type="button"
|
|
243
244
|
id={isDragMenuTarget ? showDragMenuAnchorId : undefined}
|
|
245
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
244
246
|
className={classnames(
|
|
245
247
|
ClassName.DRAG_HANDLE_BUTTON_CONTAINER,
|
|
246
248
|
appearance,
|
|
@@ -279,6 +281,7 @@ const DragHandleComponent = ({
|
|
|
279
281
|
browser.gecko ? (
|
|
280
282
|
<HandleIconComponent {...handleIconProps} />
|
|
281
283
|
) : (
|
|
284
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
282
285
|
<span style={{ pointerEvents: 'none' }}>
|
|
283
286
|
<HandleIconComponent {...handleIconProps} />
|
|
284
287
|
</span>
|
|
@@ -35,6 +35,7 @@ export const DragPreview = ({
|
|
|
35
35
|
>
|
|
36
36
|
<DragInMotionIcon
|
|
37
37
|
style={{
|
|
38
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
38
39
|
position: 'absolute',
|
|
39
40
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
40
41
|
marginLeft: `${marginLeft}px`,
|
|
@@ -144,19 +144,26 @@ export const FixedButton = ({
|
|
|
144
144
|
<div
|
|
145
145
|
ref={observerTargetRef}
|
|
146
146
|
style={{
|
|
147
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
147
148
|
position: 'absolute',
|
|
149
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
148
150
|
top: token('space.0', '0px'),
|
|
151
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
149
152
|
left: token('space.0', '0px'),
|
|
153
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
150
154
|
width: token('space.250', '20px'), // BUTTON_WIDTH
|
|
155
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
151
156
|
height: token('space.250', '20px'), // BUTTON_WIDTH
|
|
152
157
|
}}
|
|
153
158
|
>
|
|
154
159
|
<div
|
|
155
160
|
ref={fixedButtonRef}
|
|
156
161
|
style={{
|
|
162
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
157
163
|
position: 'fixed',
|
|
158
164
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
159
165
|
top: stickyHeader.top + stickyHeader.padding + offset * 2,
|
|
166
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
160
167
|
zIndex: akEditorTableCellOnStickyHeaderZIndex,
|
|
161
168
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
162
169
|
left: calcLeftPos({
|
|
@@ -165,9 +172,12 @@ export const FixedButton = ({
|
|
|
165
172
|
cellRefWidth: targetCellRef.clientWidth,
|
|
166
173
|
offset,
|
|
167
174
|
}),
|
|
175
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
168
176
|
width: token('space.250', '20px'), // BUTTON_WIDTH
|
|
177
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
169
178
|
height: token('space.250', '20px'), // BUTTON_WIDTH
|
|
170
179
|
}}
|
|
180
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
171
181
|
className={ClassName.CONTEXTUAL_MENU_BUTTON_FIXED}
|
|
172
182
|
>
|
|
173
183
|
{children}
|
|
@@ -86,6 +86,7 @@ const FloatingContextualButtonInner = React.memo(
|
|
|
86
86
|
]}
|
|
87
87
|
>
|
|
88
88
|
<ToolbarButton
|
|
89
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
89
90
|
className={ClassName.CONTEXTUAL_MENU_BUTTON}
|
|
90
91
|
selected={isContextualMenuOpen}
|
|
91
92
|
title={labelCellOptions}
|