@atlaskit/editor-plugin-table 1.1.2 → 1.1.3
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 +12 -0
- package/dist/cjs/plugins/table/nodeviews/TableComponent.js +13 -3
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/commands.js +7 -2
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/event-handlers.js +5 -1
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +17 -1
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/misc.js +38 -6
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-logic.js +2 -2
- package/dist/cjs/plugins/table/transforms/column-width.js +47 -5
- package/dist/cjs/plugins/table/ui/common-styles.js +4 -3
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/plugins/table/nodeviews/TableComponent.js +13 -3
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/commands.js +7 -2
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/event-handlers.js +5 -1
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +15 -0
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/misc.js +37 -4
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/resize-logic.js +2 -2
- package/dist/es2019/plugins/table/transforms/column-width.js +45 -5
- package/dist/es2019/plugins/table/ui/common-styles.js +5 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/plugins/table/nodeviews/TableComponent.js +13 -3
- package/dist/esm/plugins/table/pm-plugins/table-resizing/commands.js +7 -2
- package/dist/esm/plugins/table/pm-plugins/table-resizing/event-handlers.js +5 -1
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +15 -0
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/misc.js +35 -4
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/resize-logic.js +2 -2
- package/dist/esm/plugins/table/transforms/column-width.js +47 -5
- package/dist/esm/plugins/table/ui/common-styles.js +3 -3
- package/dist/esm/version.json +1 -1
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/colgroup.d.ts +7 -0
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/misc.d.ts +2 -1
- package/dist/types/plugins/table/ui/common-styles.d.ts +1 -0
- package/package.json +8 -6
- package/src/__tests__/integration/__fixtures__/empty-layout.ts +35 -0
- package/src/__tests__/integration/__fixtures__/nested-in-expand.ts +129 -0
- package/src/__tests__/integration/horizontal-scroll.ts +489 -0
- package/src/__tests__/unit/commands/insert.ts +3 -3
- package/src/__tests__/unit/keymap.ts +3 -1
- package/src/__tests__/unit/pm-plugins/table-resizing/colgroup.ts +38 -0
- package/src/__tests__/unit/pm-plugins/table-resizing/event-handlers.ts +5 -2
- package/src/__tests__/visual-regression/__image_snapshots__/cell-options-menu-ts-table-cell-options-menu-delete-column-menu-item-visual-hints-should-be-added-to-the-table-column-on-hover-1-snap.png +2 -2
- package/src/__tests__/visual-regression/__image_snapshots__/cell-options-menu-ts-table-cell-options-menu-delete-row-menu-item-visual-hints-should-be-added-to-the-table-row-on-hover-1-snap.png +2 -2
- package/src/__tests__/visual-regression/__image_snapshots__/sticky-header-ts-snapshot-test-table-sticky-header-should-align-with-table-cell-when-active-2-snap.png +2 -2
- package/src/__tests__/visual-regression/sticky-header.ts +2 -1
- package/src/plugins/table/nodeviews/TableComponent.tsx +16 -3
- package/src/plugins/table/pm-plugins/table-resizing/commands.ts +6 -2
- package/src/plugins/table/pm-plugins/table-resizing/event-handlers.ts +9 -1
- package/src/plugins/table/pm-plugins/table-resizing/utils/colgroup.ts +19 -1
- package/src/plugins/table/pm-plugins/table-resizing/utils/misc.ts +57 -5
- package/src/plugins/table/pm-plugins/table-resizing/utils/resize-logic.ts +2 -2
- package/src/plugins/table/transforms/column-width.ts +60 -6
- package/src/plugins/table/ui/common-styles.ts +5 -2
|
@@ -5,4 +5,11 @@ declare type Col = Array<string | {
|
|
|
5
5
|
export declare const generateColgroup: (table: PmNode) => Col[];
|
|
6
6
|
export declare const insertColgroupFromNode: (tableRef: HTMLTableElement, table: PmNode) => HTMLCollection;
|
|
7
7
|
export declare const hasTableBeenResized: (table: PmNode) => boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Check if a table has all the column width set to tableCellMinWidth(48px) or null
|
|
10
|
+
*
|
|
11
|
+
* @param table
|
|
12
|
+
* @returns true if all column width is equal to tableCellMinWidth or null, false otherwise
|
|
13
|
+
*/
|
|
14
|
+
export declare const isMinCellWidthTable: (table: PmNode) => boolean;
|
|
8
15
|
export {};
|
|
@@ -18,5 +18,6 @@ interface getTableMaxWidthProps {
|
|
|
18
18
|
layout: TableLayout;
|
|
19
19
|
getEditorContainerWidth: GetEditorContainerWidth;
|
|
20
20
|
}
|
|
21
|
-
export declare const getTableMaxWidth: ({ table, tableStart, state, layout, getEditorContainerWidth, }: getTableMaxWidthProps) =>
|
|
21
|
+
export declare const getTableMaxWidth: ({ table, tableStart, state, layout, getEditorContainerWidth, }: getTableMaxWidthProps) => number;
|
|
22
|
+
export declare const getParentWidthWithoutPadding: (parentWidth: number, tableStartPos: number, state: EditorState) => number | undefined;
|
|
22
23
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
2
2
|
import { ThemeProps } from '@atlaskit/theme/types';
|
|
3
|
+
export declare const insertColumnButtonOffset: number;
|
|
3
4
|
export declare const tableStyles: (props: ThemeProps & {
|
|
4
5
|
featureFlags?: FeatureFlags;
|
|
5
6
|
}) => import("@emotion/react").SerializedStyles;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@atlaskit/editor-tables": "^2.2.0",
|
|
25
25
|
"@atlaskit/icon": "^21.11.0",
|
|
26
26
|
"@atlaskit/theme": "^12.1.0",
|
|
27
|
-
"@atlaskit/tokens": "^1.
|
|
27
|
+
"@atlaskit/tokens": "^1.1.0",
|
|
28
28
|
"@atlaskit/tooltip": "^17.6.0",
|
|
29
29
|
"@babel/runtime": "^7.0.0",
|
|
30
30
|
"@emotion/react": "^11.7.1",
|
|
@@ -51,10 +51,10 @@
|
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@atlaskit/analytics-next": "^8.3.3",
|
|
53
53
|
"@atlaskit/button": "^16.5.0",
|
|
54
|
-
"@atlaskit/editor-core": "^
|
|
54
|
+
"@atlaskit/editor-core": "^179.0.0",
|
|
55
55
|
"@atlaskit/editor-test-helpers": "^18.0.0",
|
|
56
|
-
"@atlaskit/link-provider": "^1.
|
|
57
|
-
"@atlaskit/logo": "^13.
|
|
56
|
+
"@atlaskit/link-provider": "^1.4.0",
|
|
57
|
+
"@atlaskit/logo": "^13.11.0",
|
|
58
58
|
"@atlaskit/media-integration-test-helpers": "^2.6.0",
|
|
59
59
|
"@atlaskit/synchrony-test-helpers": "^2.3.0",
|
|
60
60
|
"@atlaskit/util-data-test": "^17.6.0",
|
|
@@ -78,7 +78,9 @@
|
|
|
78
78
|
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1",
|
|
79
79
|
"techstack": {
|
|
80
80
|
"@repo/internal": {
|
|
81
|
-
"
|
|
81
|
+
"design-tokens": [
|
|
82
|
+
"color"
|
|
83
|
+
],
|
|
82
84
|
"deprecation": "no-deprecated-imports",
|
|
83
85
|
"styling": [
|
|
84
86
|
"emotion"
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export const emptyLayout = {
|
|
2
|
+
version: 1,
|
|
3
|
+
type: 'doc',
|
|
4
|
+
content: [
|
|
5
|
+
{
|
|
6
|
+
type: 'layoutSection',
|
|
7
|
+
content: [
|
|
8
|
+
{
|
|
9
|
+
type: 'layoutColumn',
|
|
10
|
+
attrs: {
|
|
11
|
+
width: 50,
|
|
12
|
+
},
|
|
13
|
+
content: [
|
|
14
|
+
{
|
|
15
|
+
type: 'paragraph',
|
|
16
|
+
content: [],
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
type: 'layoutColumn',
|
|
22
|
+
attrs: {
|
|
23
|
+
width: 50,
|
|
24
|
+
},
|
|
25
|
+
content: [
|
|
26
|
+
{
|
|
27
|
+
type: 'paragraph',
|
|
28
|
+
content: [],
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
};
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
version: 1,
|
|
3
|
+
type: 'doc',
|
|
4
|
+
content: [
|
|
5
|
+
{
|
|
6
|
+
type: 'expand',
|
|
7
|
+
attrs: {
|
|
8
|
+
title: '',
|
|
9
|
+
},
|
|
10
|
+
content: [
|
|
11
|
+
{
|
|
12
|
+
type: 'table',
|
|
13
|
+
attrs: {
|
|
14
|
+
isNumberColumnEnabled: false,
|
|
15
|
+
layout: 'default',
|
|
16
|
+
localId: '30bc8b3b-d6b5-42c8-830b-71358eb3ab39',
|
|
17
|
+
},
|
|
18
|
+
content: [
|
|
19
|
+
{
|
|
20
|
+
type: 'tableRow',
|
|
21
|
+
content: [
|
|
22
|
+
{
|
|
23
|
+
type: 'tableHeader',
|
|
24
|
+
attrs: {},
|
|
25
|
+
content: [
|
|
26
|
+
{
|
|
27
|
+
type: 'paragraph',
|
|
28
|
+
content: [],
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
type: 'tableHeader',
|
|
34
|
+
attrs: {},
|
|
35
|
+
content: [
|
|
36
|
+
{
|
|
37
|
+
type: 'paragraph',
|
|
38
|
+
content: [],
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
type: 'tableHeader',
|
|
44
|
+
attrs: {},
|
|
45
|
+
content: [
|
|
46
|
+
{
|
|
47
|
+
type: 'paragraph',
|
|
48
|
+
content: [],
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
type: 'tableRow',
|
|
56
|
+
content: [
|
|
57
|
+
{
|
|
58
|
+
type: 'tableCell',
|
|
59
|
+
attrs: {},
|
|
60
|
+
content: [
|
|
61
|
+
{
|
|
62
|
+
type: 'paragraph',
|
|
63
|
+
content: [],
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
type: 'tableCell',
|
|
69
|
+
attrs: {},
|
|
70
|
+
content: [
|
|
71
|
+
{
|
|
72
|
+
type: 'paragraph',
|
|
73
|
+
content: [],
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
type: 'tableCell',
|
|
79
|
+
attrs: {},
|
|
80
|
+
content: [
|
|
81
|
+
{
|
|
82
|
+
type: 'paragraph',
|
|
83
|
+
content: [],
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
type: 'tableRow',
|
|
91
|
+
content: [
|
|
92
|
+
{
|
|
93
|
+
type: 'tableCell',
|
|
94
|
+
attrs: {},
|
|
95
|
+
content: [
|
|
96
|
+
{
|
|
97
|
+
type: 'paragraph',
|
|
98
|
+
content: [],
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
type: 'tableCell',
|
|
104
|
+
attrs: {},
|
|
105
|
+
content: [
|
|
106
|
+
{
|
|
107
|
+
type: 'paragraph',
|
|
108
|
+
content: [],
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
type: 'tableCell',
|
|
114
|
+
attrs: {},
|
|
115
|
+
content: [
|
|
116
|
+
{
|
|
117
|
+
type: 'paragraph',
|
|
118
|
+
content: [],
|
|
119
|
+
},
|
|
120
|
+
],
|
|
121
|
+
},
|
|
122
|
+
],
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
};
|