@atlaskit/editor-plugin-table 11.1.2 → 11.1.4
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 +19 -0
- package/afm-rovo-extension/tsconfig.json +108 -0
- package/dist/cjs/nodeviews/TableContainer.js +8 -3
- package/dist/cjs/nodeviews/TableResizer.js +10 -5
- package/dist/cjs/nodeviews/toDOM.js +10 -3
- package/dist/cjs/pm-plugins/table-resizing/utils/misc.js +6 -1
- package/dist/cjs/pm-plugins/utils/snapping.js +9 -2
- package/dist/cjs/ui/DragPreview/index.js +2 -0
- package/dist/cjs/ui/FloatingAlignmentButtons/FloatingAlignmentButtons.js +2 -0
- package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +1 -0
- package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +2 -0
- package/dist/cjs/ui/TableFullWidthLabel/index.js +2 -0
- package/dist/es2019/nodeviews/TableContainer.js +9 -4
- package/dist/es2019/nodeviews/TableResizer.js +11 -6
- package/dist/es2019/nodeviews/toDOM.js +10 -3
- package/dist/es2019/pm-plugins/table-resizing/utils/misc.js +7 -2
- package/dist/es2019/pm-plugins/utils/snapping.js +10 -3
- package/dist/es2019/ui/DragPreview/index.js +2 -0
- package/dist/es2019/ui/FloatingAlignmentButtons/FloatingAlignmentButtons.js +1 -0
- package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +1 -0
- package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +1 -0
- package/dist/es2019/ui/TableFullWidthLabel/index.js +1 -0
- package/dist/es2019/ui/toolbar.js +1 -1
- package/dist/esm/nodeviews/TableContainer.js +9 -4
- package/dist/esm/nodeviews/TableResizer.js +11 -6
- package/dist/esm/nodeviews/toDOM.js +10 -3
- package/dist/esm/pm-plugins/table-resizing/utils/misc.js +7 -2
- package/dist/esm/pm-plugins/utils/snapping.js +10 -3
- package/dist/esm/ui/DragPreview/index.js +2 -0
- package/dist/esm/ui/FloatingAlignmentButtons/FloatingAlignmentButtons.js +1 -0
- package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +1 -0
- package/dist/esm/ui/FloatingDragMenu/DragMenu.js +1 -0
- package/dist/esm/ui/TableFullWidthLabel/index.js +1 -0
- package/dist/esm/ui/toolbar.js +1 -1
- package/package.json +4 -4
- package/src/nodeviews/TableContainer.tsx +15 -5
- package/src/nodeviews/TableResizer.tsx +20 -9
- package/src/nodeviews/toDOM.ts +10 -3
- package/src/pm-plugins/table-resizing/utils/misc.ts +12 -1
- package/src/pm-plugins/utils/snapping.ts +15 -3
- package/src/ui/DragPreview/index.tsx +1 -0
- package/src/ui/FloatingAlignmentButtons/FloatingAlignmentButtons.tsx +1 -0
- package/src/ui/FloatingContextualMenu/ContextualMenu.tsx +1 -0
- package/src/ui/FloatingDragMenu/DragMenu.tsx +1 -0
- package/src/ui/TableFullWidthLabel/index.tsx +1 -0
- package/src/ui/toolbar.tsx +2 -2
|
@@ -14,7 +14,10 @@ import {
|
|
|
14
14
|
akEditorFullWidthLayoutWidth,
|
|
15
15
|
akEditorGutterPaddingDynamic,
|
|
16
16
|
akEditorTableNumberColumnWidth,
|
|
17
|
+
akEditorGutterPaddingReduced,
|
|
18
|
+
akEditorFullPageNarrowBreakout,
|
|
17
19
|
} from '@atlaskit/editor-shared-styles';
|
|
20
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
18
21
|
|
|
19
22
|
import type { TableOptions } from '../../../nodeviews/types';
|
|
20
23
|
|
|
@@ -33,8 +36,16 @@ export function getLayoutSize(
|
|
|
33
36
|
const { isFullWidthModeEnabled } = options;
|
|
34
37
|
|
|
35
38
|
if (isFullWidthModeEnabled) {
|
|
39
|
+
let padding: number = akEditorGutterPaddingDynamic();
|
|
40
|
+
if (
|
|
41
|
+
containerWidth <= akEditorFullPageNarrowBreakout &&
|
|
42
|
+
expValEquals('platform_editor_preview_panel_responsiveness', 'isEnabled', true)
|
|
43
|
+
) {
|
|
44
|
+
padding = akEditorGutterPaddingReduced;
|
|
45
|
+
}
|
|
46
|
+
|
|
36
47
|
return containerWidth
|
|
37
|
-
? Math.min(containerWidth -
|
|
48
|
+
? Math.min(containerWidth - padding * 2, akEditorFullWidthLayoutWidth)
|
|
38
49
|
: akEditorFullWidthLayoutWidth;
|
|
39
50
|
}
|
|
40
51
|
|
|
@@ -5,7 +5,10 @@ import {
|
|
|
5
5
|
akEditorDefaultLayoutWidth,
|
|
6
6
|
akEditorFullWidthLayoutWidth,
|
|
7
7
|
akEditorGutterPaddingDynamic,
|
|
8
|
+
akEditorGutterPaddingReduced,
|
|
9
|
+
akEditorFullPageNarrowBreakout,
|
|
8
10
|
} from '@atlaskit/editor-shared-styles';
|
|
11
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
9
12
|
|
|
10
13
|
const numberOfLanesInDefaultLayoutWidth = 12;
|
|
11
14
|
|
|
@@ -29,6 +32,13 @@ export type GuidelineExcludeConfig = {
|
|
|
29
32
|
breakoutPoints: boolean;
|
|
30
33
|
};
|
|
31
34
|
|
|
35
|
+
const getPadding = (editorContainerWith: number) => {
|
|
36
|
+
return editorContainerWith <= akEditorFullPageNarrowBreakout &&
|
|
37
|
+
expValEquals('platform_editor_preview_panel_responsiveness', 'isEnabled', true)
|
|
38
|
+
? akEditorGutterPaddingReduced
|
|
39
|
+
: akEditorGutterPaddingDynamic();
|
|
40
|
+
};
|
|
41
|
+
|
|
32
42
|
// FF TablePreserve for calculateDefaultSnappings
|
|
33
43
|
export const calculateDefaultTablePreserveSnappings = (
|
|
34
44
|
lengthOffset = 0,
|
|
@@ -38,10 +48,11 @@ export const calculateDefaultTablePreserveSnappings = (
|
|
|
38
48
|
breakoutPoints: false,
|
|
39
49
|
},
|
|
40
50
|
) => {
|
|
51
|
+
const padding = getPadding(editorContainerWith);
|
|
41
52
|
const dynamicFullWidthLine =
|
|
42
|
-
editorContainerWith -
|
|
53
|
+
editorContainerWith - padding * 2 >= akEditorFullWidthLayoutWidth
|
|
43
54
|
? akEditorFullWidthLayoutWidth
|
|
44
|
-
: editorContainerWith -
|
|
55
|
+
: editorContainerWith - padding * 2;
|
|
45
56
|
|
|
46
57
|
const guides = [dynamicFullWidthLine - lengthOffset];
|
|
47
58
|
|
|
@@ -77,7 +88,8 @@ export const defaultTablePreserveSnappingWidths = (
|
|
|
77
88
|
breakoutPoints: false,
|
|
78
89
|
},
|
|
79
90
|
) => {
|
|
80
|
-
|
|
91
|
+
const padding = getPadding(editorContainerWidth);
|
|
92
|
+
return editorContainerWidth - padding * 2 > akEditorFullWidthLayoutWidth
|
|
81
93
|
? calculateDefaultSnappings()
|
|
82
94
|
: calculateDefaultTablePreserveSnappings(lengthOffset, editorContainerWidth, exclude); // lengthOffset was hardcoded 0 here, created PRESERVE_TABLE_SNAPPING_LENGTH_OFFSET instead.
|
|
83
95
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
+
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
3
4
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
4
5
|
|
|
5
6
|
import type { TableDirection } from '../../types';
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
FloatingToolbarButton as Button,
|
|
12
12
|
FloatingToolbarSeparator,
|
|
13
13
|
} from '@atlaskit/editor-common/ui';
|
|
14
|
+
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
14
15
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
15
16
|
|
|
16
17
|
const containerStyles = xcss({
|
|
@@ -53,6 +53,7 @@ import TableRowAddBelowIcon from '@atlaskit/icon/core/table-row-add-below';
|
|
|
53
53
|
import TableRowDeleteIcon from '@atlaskit/icon/core/table-row-delete';
|
|
54
54
|
import CrossCircleIcon from '@atlaskit/icon/glyph/cross-circle';
|
|
55
55
|
import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
|
|
56
|
+
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
56
57
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
57
58
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
58
59
|
|
|
@@ -42,6 +42,7 @@ import {
|
|
|
42
42
|
isSelectionType,
|
|
43
43
|
} from '@atlaskit/editor-tables/utils';
|
|
44
44
|
import PaintBucketIcon from '@atlaskit/icon/core/migration/paint-bucket--editor-background-color';
|
|
45
|
+
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
45
46
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
46
47
|
import Toggle from '@atlaskit/toggle';
|
|
47
48
|
|
|
@@ -3,6 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import { useIntl } from 'react-intl-next';
|
|
4
4
|
|
|
5
5
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
6
|
+
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
6
7
|
import { Box, Inline, xcss } from '@atlaskit/primitives';
|
|
7
8
|
import { token } from '@atlaskit/tokens';
|
|
8
9
|
|
package/src/ui/toolbar.tsx
CHANGED
|
@@ -17,8 +17,8 @@ import type {
|
|
|
17
17
|
Command,
|
|
18
18
|
CommandDispatch,
|
|
19
19
|
ConfirmDialogOptions,
|
|
20
|
-
DropdownOptions,
|
|
21
20
|
DropdownOptionT,
|
|
21
|
+
DropdownOptions,
|
|
22
22
|
FloatingToolbarDropdown,
|
|
23
23
|
FloatingToolbarHandler,
|
|
24
24
|
FloatingToolbarItem,
|
|
@@ -26,7 +26,7 @@ import type {
|
|
|
26
26
|
Icon,
|
|
27
27
|
typeOption,
|
|
28
28
|
} from '@atlaskit/editor-common/types';
|
|
29
|
-
import {
|
|
29
|
+
import { DEFAULT_BORDER_COLOR, cellBackgroundColorPalette } from '@atlaskit/editor-common/ui-color';
|
|
30
30
|
import {
|
|
31
31
|
closestElement,
|
|
32
32
|
getChildrenInfo,
|