@atlaskit/editor-plugin-table 10.3.3 → 10.4.1
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/dist/cjs/nodeviews/TableRow.js +2 -4
- package/dist/cjs/nodeviews/lazy-node-views.js +1 -1
- package/dist/cjs/nodeviews/table.js +0 -2
- package/dist/cjs/pm-plugins/drag-and-drop/commands.js +1 -1
- package/dist/cjs/pm-plugins/drag-and-drop/plugin.js +2 -2
- package/dist/cjs/pm-plugins/main.js +1 -1
- package/dist/cjs/pm-plugins/table-resizing/utils/content-width.js +2 -2
- package/dist/cjs/pm-plugins/table-resizing/utils/misc.js +1 -1
- package/dist/cjs/pm-plugins/table-resizing/utils/resize-logic.js +1 -1
- package/dist/cjs/pm-plugins/table-resizing/utils/resize-state.js +1 -1
- package/dist/cjs/pm-plugins/table-resizing/utils/scale-table.js +1 -2
- package/dist/cjs/pm-plugins/table-selection-keymap.js +6 -4
- package/dist/cjs/pm-plugins/transforms/delete-columns.js +1 -1
- package/dist/cjs/pm-plugins/transforms/fix-tables.js +2 -3
- package/dist/cjs/pm-plugins/utils/paste.js +1 -1
- package/dist/cjs/pm-plugins/view-mode-sort/index.js +3 -3
- package/dist/cjs/pm-plugins/view-mode-sort/utils.js +1 -1
- package/dist/cjs/tablePlugin.js +1 -1
- package/dist/cjs/ui/FloatingInsertButton/index.js +2 -2
- package/dist/cjs/ui/TableFloatingColumnControls/ColumnControls/index.js +1 -1
- package/dist/cjs/ui/TableFloatingControls/RowControls/ClassicControls.js +6 -1
- package/dist/cjs/ui/TableFloatingControls/index.js +0 -2
- package/dist/cjs/ui/common-styles.js +2 -2
- package/dist/cjs/ui/consts.js +2 -2
- package/dist/cjs/ui/toolbar.js +1 -1
- package/dist/es2019/nodeviews/TableRow.js +2 -4
- package/dist/es2019/nodeviews/lazy-node-views.js +1 -1
- package/dist/es2019/nodeviews/table.js +0 -2
- package/dist/es2019/pm-plugins/drag-and-drop/commands.js +1 -1
- package/dist/es2019/pm-plugins/drag-and-drop/plugin.js +2 -2
- package/dist/es2019/pm-plugins/main.js +1 -1
- package/dist/es2019/pm-plugins/table-resizing/utils/content-width.js +2 -2
- package/dist/es2019/pm-plugins/table-resizing/utils/misc.js +1 -1
- package/dist/es2019/pm-plugins/table-resizing/utils/resize-logic.js +1 -1
- package/dist/es2019/pm-plugins/table-resizing/utils/resize-state.js +1 -1
- package/dist/es2019/pm-plugins/table-resizing/utils/scale-table.js +1 -2
- package/dist/es2019/pm-plugins/table-selection-keymap.js +6 -4
- package/dist/es2019/pm-plugins/transforms/delete-columns.js +1 -1
- package/dist/es2019/pm-plugins/transforms/fix-tables.js +2 -3
- package/dist/es2019/pm-plugins/utils/paste.js +1 -1
- package/dist/es2019/pm-plugins/view-mode-sort/index.js +3 -3
- package/dist/es2019/pm-plugins/view-mode-sort/utils.js +1 -1
- package/dist/es2019/tablePlugin.js +1 -1
- package/dist/es2019/ui/FloatingInsertButton/index.js +2 -2
- package/dist/es2019/ui/TableFloatingColumnControls/ColumnControls/index.js +1 -1
- package/dist/es2019/ui/TableFloatingControls/RowControls/ClassicControls.js +6 -1
- package/dist/es2019/ui/TableFloatingControls/index.js +0 -2
- package/dist/es2019/ui/common-styles.js +8 -14
- package/dist/es2019/ui/consts.js +2 -2
- package/dist/es2019/ui/toolbar.js +1 -1
- package/dist/esm/nodeviews/TableRow.js +2 -4
- package/dist/esm/nodeviews/lazy-node-views.js +1 -1
- package/dist/esm/nodeviews/table.js +0 -2
- package/dist/esm/pm-plugins/drag-and-drop/commands.js +1 -1
- package/dist/esm/pm-plugins/drag-and-drop/plugin.js +2 -2
- package/dist/esm/pm-plugins/main.js +1 -1
- package/dist/esm/pm-plugins/table-resizing/utils/content-width.js +2 -2
- package/dist/esm/pm-plugins/table-resizing/utils/misc.js +1 -1
- package/dist/esm/pm-plugins/table-resizing/utils/resize-logic.js +1 -1
- package/dist/esm/pm-plugins/table-resizing/utils/resize-state.js +1 -1
- package/dist/esm/pm-plugins/table-resizing/utils/scale-table.js +1 -2
- package/dist/esm/pm-plugins/table-selection-keymap.js +6 -4
- package/dist/esm/pm-plugins/transforms/delete-columns.js +1 -1
- package/dist/esm/pm-plugins/transforms/fix-tables.js +2 -3
- package/dist/esm/pm-plugins/utils/paste.js +1 -1
- package/dist/esm/pm-plugins/view-mode-sort/index.js +3 -3
- package/dist/esm/pm-plugins/view-mode-sort/utils.js +1 -1
- package/dist/esm/tablePlugin.js +1 -1
- package/dist/esm/ui/FloatingInsertButton/index.js +2 -2
- package/dist/esm/ui/TableFloatingColumnControls/ColumnControls/index.js +1 -1
- package/dist/esm/ui/TableFloatingControls/RowControls/ClassicControls.js +6 -1
- package/dist/esm/ui/TableFloatingControls/index.js +0 -2
- package/dist/esm/ui/common-styles.js +2 -2
- package/dist/esm/ui/consts.js +2 -2
- package/dist/esm/ui/toolbar.js +1 -1
- package/package.json +9 -6
- package/src/nodeviews/TableRow.ts +2 -3
- package/src/nodeviews/lazy-node-views.ts +1 -1
- package/src/nodeviews/table.tsx +0 -2
- package/src/pm-plugins/drag-and-drop/commands.ts +1 -1
- package/src/pm-plugins/drag-and-drop/plugin.ts +2 -2
- package/src/pm-plugins/main.ts +1 -1
- package/src/pm-plugins/table-resizing/utils/content-width.ts +2 -2
- package/src/pm-plugins/table-resizing/utils/misc.ts +1 -1
- package/src/pm-plugins/table-resizing/utils/resize-logic.ts +1 -1
- package/src/pm-plugins/table-resizing/utils/resize-state.ts +1 -1
- package/src/pm-plugins/table-resizing/utils/scale-table.ts +1 -2
- package/src/pm-plugins/table-selection-keymap.ts +6 -3
- package/src/pm-plugins/transforms/delete-columns.ts +1 -1
- package/src/pm-plugins/transforms/fix-tables.ts +2 -3
- package/src/pm-plugins/utils/paste.ts +3 -1
- package/src/pm-plugins/view-mode-sort/index.ts +3 -3
- package/src/pm-plugins/view-mode-sort/utils.ts +1 -1
- package/src/tablePlugin.tsx +1 -1
- package/src/tablePluginType.ts +2 -2
- package/src/ui/FloatingInsertButton/index.tsx +2 -2
- package/src/ui/TableFloatingColumnControls/ColumnControls/index.tsx +1 -1
- package/src/ui/TableFloatingControls/RowControls/ClassicControls.tsx +10 -1
- package/src/ui/TableFloatingControls/index.tsx +0 -2
- package/src/ui/common-styles.ts +26 -14
- package/src/ui/consts.ts +2 -2
- package/src/ui/toolbar.tsx +1 -1
package/src/tablePlugin.tsx
CHANGED
|
@@ -456,7 +456,7 @@ const tablesPlugin: TablePlugin = ({ config: options, api }) => {
|
|
|
456
456
|
)
|
|
457
457
|
: undefined,
|
|
458
458
|
},
|
|
459
|
-
// TODO: should be deprecated and eventually replaced with 'tableAnalyticsPlugin'
|
|
459
|
+
// TODO: ED-26961 - should be deprecated and eventually replaced with 'tableAnalyticsPlugin'
|
|
460
460
|
{
|
|
461
461
|
name: 'tableOverflowAnalyticsPlugin',
|
|
462
462
|
plugin: ({ dispatch, dispatchAnalyticsEvent }) =>
|
package/src/tablePluginType.ts
CHANGED
|
@@ -25,7 +25,7 @@ export interface TablePluginOptions {
|
|
|
25
25
|
// this option will eventually be removed, and enabled by default
|
|
26
26
|
isTableScalingEnabled?: boolean;
|
|
27
27
|
allowContextualMenu?: boolean;
|
|
28
|
-
// TODO these two need to be rethought
|
|
28
|
+
// TODO: ED-26961 - these two need to be rethought
|
|
29
29
|
fullWidthEnabled?: boolean;
|
|
30
30
|
wasFullWidthEnabled?: boolean;
|
|
31
31
|
getEditorFeatureFlags?: GetEditorFeatureFlags;
|
|
@@ -35,7 +35,7 @@ export interface TablePluginOptions {
|
|
|
35
35
|
|
|
36
36
|
type InsertTableAction = (analyticsPayload: AnalyticsEventPayload) => Command;
|
|
37
37
|
|
|
38
|
-
// TODO: duplicating type instead of importing media plugin causing a circular dependency
|
|
38
|
+
// TODO: ED-26961 - duplicating type instead of importing media plugin causing a circular dependency
|
|
39
39
|
type MediaPlugin = NextEditorPlugin<
|
|
40
40
|
'media',
|
|
41
41
|
{
|
|
@@ -87,7 +87,7 @@ export class FloatingInsertButton extends React.Component<Props & WrappedCompone
|
|
|
87
87
|
isChromelessEditor,
|
|
88
88
|
} = this.props;
|
|
89
89
|
|
|
90
|
-
// TODO: temporarily disable insert button for first column and row https://atlassian.slack.com/archives/C05U8HRQM50/p1698363744682219?thread_ts=1698209039.104909&cid=C05U8HRQM50
|
|
90
|
+
// TODO: ED-26961 - temporarily disable insert button for first column and row https://atlassian.slack.com/archives/C05U8HRQM50/p1698363744682219?thread_ts=1698209039.104909&cid=C05U8HRQM50
|
|
91
91
|
if (isDragAndDropEnabled && (insertColumnButtonIndex === 0 || insertRowButtonIndex === 0)) {
|
|
92
92
|
return null;
|
|
93
93
|
}
|
|
@@ -182,7 +182,7 @@ export class FloatingInsertButton extends React.Component<Props & WrappedCompone
|
|
|
182
182
|
|
|
183
183
|
const hasNumberedColumns = checkIfNumberColumnEnabled(editorView.state.selection);
|
|
184
184
|
|
|
185
|
-
//
|
|
185
|
+
// Fixed the 'add column button' not visible issue when sticky header is enabled
|
|
186
186
|
// By setting the Popup z-index higher than the sticky header z-index ( common-styles.ts tr.sticky)
|
|
187
187
|
// Only when inserting a column, otherwise set to undefined
|
|
188
188
|
// Need to set z-index in the Popup, set z-index in the <InsertButton /> will not work
|
|
@@ -86,7 +86,7 @@ export const ColumnControls = ({
|
|
|
86
86
|
width ? (stickyTop ? `${width - 2}px` : `${width - 1}px`) : '0px',
|
|
87
87
|
)
|
|
88
88
|
.join(' ') ?? '0px';
|
|
89
|
-
// TODO: reusing getRowsParams here because it's generic enough to work for columns -> rename
|
|
89
|
+
// TODO: ED-26961 - reusing getRowsParams here because it's generic enough to work for columns -> rename
|
|
90
90
|
const columnParams = getRowsParams(colWidths ?? []);
|
|
91
91
|
const colIndex = hoveredCell?.colIndex;
|
|
92
92
|
const selectedColIndexes = getSelectedColumns(
|
|
@@ -6,6 +6,7 @@ import { injectIntl } from 'react-intl-next';
|
|
|
6
6
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
7
7
|
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
8
8
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
9
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
10
|
|
|
10
11
|
import { clearHoverSelection } from '../../../pm-plugins/commands';
|
|
11
12
|
import type { RowParams } from '../../../pm-plugins/utils/row-controls';
|
|
@@ -86,7 +87,15 @@ class RowControlsComponent extends Component<Props & WrappedComponentProps> {
|
|
|
86
87
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
87
88
|
top: thisRowSticky ? `3px` : undefined,
|
|
88
89
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
89
|
-
paddingTop: thisRowSticky
|
|
90
|
+
paddingTop: thisRowSticky
|
|
91
|
+
? `${
|
|
92
|
+
fg('platform_editor_number_column_sticky_header_bug')
|
|
93
|
+
? // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
94
|
+
tableControlsSpacing - 2
|
|
95
|
+
: // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
96
|
+
tableControlsSpacing
|
|
97
|
+
}px`
|
|
98
|
+
: undefined,
|
|
90
99
|
}}
|
|
91
100
|
>
|
|
92
101
|
<button
|
|
@@ -75,7 +75,6 @@ export const TableFloatingControls = ({
|
|
|
75
75
|
const _selectRow = useCallback(
|
|
76
76
|
(row: number, expand: boolean) => {
|
|
77
77
|
const { state, dispatch } = editorView;
|
|
78
|
-
// fix for issue ED-4665
|
|
79
78
|
if (browser.ie_version === 11) {
|
|
80
79
|
// Ignored via go/ees005
|
|
81
80
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
@@ -89,7 +88,6 @@ export const TableFloatingControls = ({
|
|
|
89
88
|
const _selectRows = useCallback(
|
|
90
89
|
(rowIndexes: number[]) => {
|
|
91
90
|
const { state, dispatch } = editorView;
|
|
92
|
-
// fix for issue ED-4665
|
|
93
91
|
if (browser.ie_version === 11) {
|
|
94
92
|
// Ignored via go/ees005
|
|
95
93
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
package/src/ui/common-styles.ts
CHANGED
|
@@ -329,8 +329,6 @@ export const baseTableStyles = (props: { featureFlags?: FeatureFlags }) => css`
|
|
|
329
329
|
td.${ClassName.TABLE_CELL} {
|
|
330
330
|
background-color: ${tableCellBackgroundColor};
|
|
331
331
|
|
|
332
|
-
// ED-15246: Trello card is visible through a border of a table border
|
|
333
|
-
// This fixes a border issue caused by relative positioned table cells
|
|
334
332
|
&::after {
|
|
335
333
|
height: 100%;
|
|
336
334
|
content: '';
|
|
@@ -367,7 +365,11 @@ export const baseTableStyles = (props: { featureFlags?: FeatureFlags }) => css`
|
|
|
367
365
|
${fg('platform_editor_nested_tables_sticky_header_bug')
|
|
368
366
|
? `
|
|
369
367
|
.${ClassName.TABLE_STICKY} > .${ClassName.DRAG_ROW_CONTROLS_WRAPPER} .${ClassName.NUMBERED_COLUMN} .${ClassName.NUMBERED_COLUMN_BUTTON}:first-of-type {
|
|
370
|
-
margin-top: ${
|
|
368
|
+
margin-top: ${
|
|
369
|
+
fg('platform_editor_number_column_sticky_header_bug')
|
|
370
|
+
? stickyRowOffsetTop
|
|
371
|
+
: stickyRowOffsetTop + 2
|
|
372
|
+
}px;
|
|
371
373
|
width: ${akEditorTableNumberColumnWidth}px;
|
|
372
374
|
|
|
373
375
|
position: fixed !important;
|
|
@@ -378,8 +380,12 @@ export const baseTableStyles = (props: { featureFlags?: FeatureFlags }) => css`
|
|
|
378
380
|
}
|
|
379
381
|
`
|
|
380
382
|
: `
|
|
381
|
-
|
|
382
|
-
margin-top: ${
|
|
383
|
+
.${ClassName.TABLE_STICKY} .${ClassName.NUMBERED_COLUMN} .${ClassName.NUMBERED_COLUMN_BUTTON}:first-of-type {
|
|
384
|
+
margin-top: ${
|
|
385
|
+
fg('platform_editor_number_column_sticky_header_bug')
|
|
386
|
+
? stickyRowOffsetTop
|
|
387
|
+
: stickyRowOffsetTop + 2
|
|
388
|
+
}px;
|
|
383
389
|
width: ${akEditorTableNumberColumnWidth}px;
|
|
384
390
|
|
|
385
391
|
position: fixed !important;
|
|
@@ -531,20 +537,30 @@ export const baseTableStyles = (props: { featureFlags?: FeatureFlags }) => css`
|
|
|
531
537
|
.${ClassName.WITH_CONTROLS}.${ClassName.TABLE_STICKY} > .${ClassName.DRAG_ROW_CONTROLS_WRAPPER}
|
|
532
538
|
.${ClassName.NUMBERED_COLUMN}
|
|
533
539
|
.${ClassName.NUMBERED_COLUMN_BUTTON}:first-of-type {
|
|
534
|
-
margin-top: ${
|
|
540
|
+
margin-top: ${
|
|
541
|
+
fg('platform_editor_number_column_sticky_header_bug')
|
|
542
|
+
? tableControlsSpacing
|
|
543
|
+
: tableControlsSpacing + 2
|
|
544
|
+
}px;
|
|
535
545
|
}
|
|
536
546
|
`
|
|
537
547
|
: `
|
|
538
548
|
.${ClassName.WITH_CONTROLS}.${ClassName.TABLE_STICKY}
|
|
539
549
|
.${ClassName.NUMBERED_COLUMN}
|
|
540
550
|
.${ClassName.NUMBERED_COLUMN_BUTTON}:first-of-type {
|
|
541
|
-
margin-top: ${
|
|
551
|
+
margin-top: ${
|
|
552
|
+
fg('platform_editor_number_column_sticky_header_bug')
|
|
553
|
+
? tableControlsSpacing
|
|
554
|
+
: tableControlsSpacing + 2
|
|
555
|
+
}px;
|
|
542
556
|
}
|
|
543
557
|
`}
|
|
544
558
|
|
|
545
559
|
.${ClassName.CORNER_CONTROLS}.sticky {
|
|
546
|
-
border-top: ${
|
|
547
|
-
|
|
560
|
+
border-top: ${fg('platform_editor_number_column_sticky_header_bug')
|
|
561
|
+
? tableControlsSpacing - tableToolbarSize
|
|
562
|
+
: tableControlsSpacing - tableToolbarSize + 2}px
|
|
563
|
+
solid ${token('elevation.surface', 'white')};
|
|
548
564
|
}
|
|
549
565
|
|
|
550
566
|
${sentinelStyles}
|
|
@@ -1088,10 +1104,6 @@ export const baseTableStyles = (props: { featureFlags?: FeatureFlags }) => css`
|
|
|
1088
1104
|
background: ${tableCellDeleteColor};
|
|
1089
1105
|
z-index: ${akEditorUnitZIndex * 100};
|
|
1090
1106
|
}
|
|
1091
|
-
// ED-15246: Trello card is visible through a border of a table border
|
|
1092
|
-
/* ED-19064: To fix when enable header column in the table,
|
|
1093
|
-
and selection the header column, the right border is not tableBorderSelectedColor
|
|
1094
|
-
when deleting the header column, the right border is not tableToolbarDeleteColor */
|
|
1095
1107
|
td.${ClassName.HOVERED_CELL},
|
|
1096
1108
|
td.${ClassName.SELECTED_CELL},
|
|
1097
1109
|
th.${ClassName.TABLE_HEADER_CELL}.${ClassName.SELECTED_CELL},
|
|
@@ -1175,7 +1187,7 @@ export const baseTableStyles = (props: { featureFlags?: FeatureFlags }) => css`
|
|
|
1175
1187
|
}
|
|
1176
1188
|
`;
|
|
1177
1189
|
|
|
1178
|
-
// TODO:
|
|
1190
|
+
// TODO: DSP-4139 - Remove this when we have a better solution for the table toolbar
|
|
1179
1191
|
export const tableStyles = (props: { featureFlags?: FeatureFlags }) => css`
|
|
1180
1192
|
.ProseMirror {
|
|
1181
1193
|
${baseTableStyles(props)}
|
package/src/ui/consts.ts
CHANGED
|
@@ -22,7 +22,7 @@ import { RESIZE_HANDLE_AREA_DECORATION_GAP } from '../types';
|
|
|
22
22
|
* Basic colors added to prevent content overflow in table cells.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
// TODO:
|
|
25
|
+
// TODO: DSP-4135 - Remove these tokens once the new elevation tokens are available
|
|
26
26
|
export const tableCellBackgroundColor = token('elevation.surface', N0);
|
|
27
27
|
|
|
28
28
|
export const tableHeaderCellBackgroundColor = token(
|
|
@@ -35,7 +35,7 @@ export const tableTextColor = token('color.text.subtlest', N200);
|
|
|
35
35
|
export const tableBorderColor = token('color.background.accent.gray.subtler', akEditorTableBorder);
|
|
36
36
|
export const tableFloatingControlsColor = token('color.background.neutral', N20);
|
|
37
37
|
|
|
38
|
-
// TODO:
|
|
38
|
+
// TODO: DSP-4461 - Remove these tokens once the new elevation tokens are available
|
|
39
39
|
export const tableCellSelectedColor = token(
|
|
40
40
|
'color.blanket.selected',
|
|
41
41
|
akEditorTableCellBlanketSelected,
|
package/src/ui/toolbar.tsx
CHANGED
|
@@ -647,7 +647,7 @@ export const getToolbarConfig =
|
|
|
647
647
|
...cellItems,
|
|
648
648
|
...columnSettingsItems,
|
|
649
649
|
...colorPicker,
|
|
650
|
-
// TODO: editor controls to move to overflow menu
|
|
650
|
+
// TODO: ED-26961 - editor controls to move to overflow menu
|
|
651
651
|
{
|
|
652
652
|
type: 'extensions-placeholder',
|
|
653
653
|
separator: 'end',
|