@atlaskit/editor-plugin-table 12.2.6 → 12.2.7
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 +8 -0
- package/package.json +4 -4
- package/afm-cc/tsconfig.json +0 -123
- package/afm-dev-agents/tsconfig.json +0 -123
- package/afm-jira/tsconfig.json +0 -123
- package/afm-passionfruit/tsconfig.json +0 -123
- package/afm-post-office/tsconfig.json +0 -123
- package/afm-rovo-extension/tsconfig.json +0 -123
- package/afm-townsquare/tsconfig.json +0 -123
- package/afm-volt/tsconfig.json +0 -114
- package/build/tsconfig.json +0 -23
- package/docs/0-intro.tsx +0 -57
- package/src/index.ts +0 -21
- package/src/nodeviews/ExternalDropTargets.tsx +0 -91
- package/src/nodeviews/OverflowShadowsObserver.ts +0 -156
- package/src/nodeviews/TableCell.ts +0 -134
- package/src/nodeviews/TableComponent.tsx +0 -1590
- package/src/nodeviews/TableComponentWithSharedState.tsx +0 -278
- package/src/nodeviews/TableContainer.tsx +0 -926
- package/src/nodeviews/TableNodeViewBase.ts +0 -29
- package/src/nodeviews/TableResizer.tsx +0 -884
- package/src/nodeviews/TableRow.ts +0 -830
- package/src/nodeviews/TableStickyScrollbar.ts +0 -211
- package/src/nodeviews/__mocks__/OverflowShadowsObserver.ts +0 -15
- package/src/nodeviews/__mocks__/OverridableMock.ts +0 -26
- package/src/nodeviews/table-container-styles.ts +0 -9
- package/src/nodeviews/table-node-views.ts +0 -76
- package/src/nodeviews/table.tsx +0 -530
- package/src/nodeviews/toDOM.ts +0 -244
- package/src/nodeviews/types.ts +0 -36
- package/src/nodeviews/update-overflow-shadows.ts +0 -11
- package/src/pm-plugins/analytics/actions.ts +0 -21
- package/src/pm-plugins/analytics/commands.ts +0 -47
- package/src/pm-plugins/analytics/plugin-factory.ts +0 -9
- package/src/pm-plugins/analytics/plugin-key.ts +0 -5
- package/src/pm-plugins/analytics/plugin.ts +0 -80
- package/src/pm-plugins/analytics/reducer.ts +0 -27
- package/src/pm-plugins/analytics/types.ts +0 -20
- package/src/pm-plugins/analytics/utils/moved-event.ts +0 -51
- package/src/pm-plugins/commands/clear.ts +0 -43
- package/src/pm-plugins/commands/collapse.ts +0 -17
- package/src/pm-plugins/commands/column-resize.ts +0 -478
- package/src/pm-plugins/commands/commands-with-analytics.ts +0 -715
- package/src/pm-plugins/commands/delete.ts +0 -42
- package/src/pm-plugins/commands/display-mode.ts +0 -18
- package/src/pm-plugins/commands/go-to-next-cell.ts +0 -198
- package/src/pm-plugins/commands/hover.ts +0 -242
- package/src/pm-plugins/commands/index.ts +0 -51
- package/src/pm-plugins/commands/insert.ts +0 -438
- package/src/pm-plugins/commands/misc.ts +0 -811
- package/src/pm-plugins/commands/referentiality.ts +0 -15
- package/src/pm-plugins/commands/selection.ts +0 -537
- package/src/pm-plugins/commands/sort.ts +0 -102
- package/src/pm-plugins/commands/split-cell.ts +0 -28
- package/src/pm-plugins/commands/toggle.ts +0 -109
- package/src/pm-plugins/create-plugin-config.ts +0 -17
- package/src/pm-plugins/decorations/plugin.ts +0 -107
- package/src/pm-plugins/decorations/utils/column-controls.ts +0 -91
- package/src/pm-plugins/decorations/utils/column-resizing.ts +0 -71
- package/src/pm-plugins/decorations/utils/compose-decorations.ts +0 -9
- package/src/pm-plugins/decorations/utils/types.ts +0 -16
- package/src/pm-plugins/default-table-selection.ts +0 -14
- package/src/pm-plugins/drag-and-drop/actions.ts +0 -48
- package/src/pm-plugins/drag-and-drop/commands-with-analytics.ts +0 -222
- package/src/pm-plugins/drag-and-drop/commands.ts +0 -194
- package/src/pm-plugins/drag-and-drop/consts.ts +0 -7
- package/src/pm-plugins/drag-and-drop/plugin-factory.ts +0 -33
- package/src/pm-plugins/drag-and-drop/plugin-key.ts +0 -5
- package/src/pm-plugins/drag-and-drop/plugin.ts +0 -398
- package/src/pm-plugins/drag-and-drop/reducer.ts +0 -38
- package/src/pm-plugins/drag-and-drop/types.ts +0 -18
- package/src/pm-plugins/drag-and-drop/utils/autoscrollers.ts +0 -49
- package/src/pm-plugins/drag-and-drop/utils/getDragBehaviour.ts +0 -9
- package/src/pm-plugins/drag-and-drop/utils/monitor.ts +0 -73
- package/src/pm-plugins/handlers.ts +0 -161
- package/src/pm-plugins/keymap.ts +0 -436
- package/src/pm-plugins/main.ts +0 -433
- package/src/pm-plugins/plugin-factory.ts +0 -42
- package/src/pm-plugins/plugin-key.ts +0 -8
- package/src/pm-plugins/reducer.ts +0 -145
- package/src/pm-plugins/safari-delete-composition-text-issue-workaround.ts +0 -102
- package/src/pm-plugins/sticky-headers/commands.ts +0 -8
- package/src/pm-plugins/sticky-headers/plugin-key.ts +0 -5
- package/src/pm-plugins/sticky-headers/plugin-state.ts +0 -52
- package/src/pm-plugins/sticky-headers/plugin.ts +0 -12
- package/src/pm-plugins/sticky-headers/types.ts +0 -20
- package/src/pm-plugins/sticky-headers/util.ts +0 -18
- package/src/pm-plugins/table-analytics.ts +0 -100
- package/src/pm-plugins/table-local-id.ts +0 -213
- package/src/pm-plugins/table-resizing/commands.ts +0 -116
- package/src/pm-plugins/table-resizing/event-handlers.ts +0 -352
- package/src/pm-plugins/table-resizing/plugin-factory.ts +0 -29
- package/src/pm-plugins/table-resizing/plugin-key.ts +0 -5
- package/src/pm-plugins/table-resizing/plugin.ts +0 -94
- package/src/pm-plugins/table-resizing/reducer.ts +0 -37
- package/src/pm-plugins/table-resizing/utils/colgroup.ts +0 -306
- package/src/pm-plugins/table-resizing/utils/column-state.ts +0 -120
- package/src/pm-plugins/table-resizing/utils/consts.ts +0 -11
- package/src/pm-plugins/table-resizing/utils/content-width.ts +0 -118
- package/src/pm-plugins/table-resizing/utils/dom.ts +0 -132
- package/src/pm-plugins/table-resizing/utils/misc.ts +0 -282
- package/src/pm-plugins/table-resizing/utils/resize-column.ts +0 -34
- package/src/pm-plugins/table-resizing/utils/resize-logic.ts +0 -289
- package/src/pm-plugins/table-resizing/utils/resize-state.ts +0 -417
- package/src/pm-plugins/table-resizing/utils/scale-table.ts +0 -290
- package/src/pm-plugins/table-resizing/utils/types.ts +0 -25
- package/src/pm-plugins/table-resizing/utils/unit-to-number.ts +0 -1
- package/src/pm-plugins/table-selection-keymap.ts +0 -64
- package/src/pm-plugins/table-size-selector.ts +0 -39
- package/src/pm-plugins/table-width-in-comment-fix.ts +0 -113
- package/src/pm-plugins/table-width.ts +0 -153
- package/src/pm-plugins/transforms/column-width.ts +0 -249
- package/src/pm-plugins/transforms/delete-columns.ts +0 -281
- package/src/pm-plugins/transforms/delete-rows.ts +0 -154
- package/src/pm-plugins/transforms/fix-tables.ts +0 -249
- package/src/pm-plugins/transforms/merge.ts +0 -301
- package/src/pm-plugins/transforms/replace-table.ts +0 -38
- package/src/pm-plugins/transforms/split.ts +0 -90
- package/src/pm-plugins/utils/alignment.ts +0 -33
- package/src/pm-plugins/utils/analytics.ts +0 -238
- package/src/pm-plugins/utils/collapse.ts +0 -93
- package/src/pm-plugins/utils/column-controls.ts +0 -250
- package/src/pm-plugins/utils/create.ts +0 -64
- package/src/pm-plugins/utils/decoration.ts +0 -672
- package/src/pm-plugins/utils/dom.ts +0 -251
- package/src/pm-plugins/utils/drag-menu.tsx +0 -491
- package/src/pm-plugins/utils/get-allow-add-column-custom-step.ts +0 -10
- package/src/pm-plugins/utils/guidelines.ts +0 -30
- package/src/pm-plugins/utils/merged-cells.ts +0 -239
- package/src/pm-plugins/utils/nodes.ts +0 -162
- package/src/pm-plugins/utils/paste.ts +0 -386
- package/src/pm-plugins/utils/row-controls.ts +0 -211
- package/src/pm-plugins/utils/selection.ts +0 -17
- package/src/pm-plugins/utils/snapping.ts +0 -136
- package/src/pm-plugins/utils/table.ts +0 -60
- package/src/pm-plugins/utils/update-plugin-state-decorations.ts +0 -13
- package/src/pm-plugins/view-mode-sort/consts.ts +0 -3
- package/src/pm-plugins/view-mode-sort/index.ts +0 -291
- package/src/pm-plugins/view-mode-sort/plugin-key.ts +0 -7
- package/src/pm-plugins/view-mode-sort/types.ts +0 -23
- package/src/pm-plugins/view-mode-sort/utils.ts +0 -136
- package/src/tablePlugin.tsx +0 -971
- package/src/tablePluginType.ts +0 -102
- package/src/types/index.ts +0 -592
- package/src/ui/ColumnResizeWidget/index.tsx +0 -61
- package/src/ui/ContentComponent.tsx +0 -311
- package/src/ui/DragHandle/HandleIconComponent.tsx +0 -21
- package/src/ui/DragHandle/index.tsx +0 -391
- package/src/ui/DragPreview/index.tsx +0 -51
- package/src/ui/FloatingAlignmentButtons/FloatingAlignmentButtons.tsx +0 -59
- package/src/ui/FloatingContextualButton/FixedButton.tsx +0 -203
- package/src/ui/FloatingContextualButton/index.tsx +0 -168
- package/src/ui/FloatingContextualButton/styles.ts +0 -69
- package/src/ui/FloatingContextualMenu/ContextualMenu.tsx +0 -931
- package/src/ui/FloatingContextualMenu/index.tsx +0 -141
- package/src/ui/FloatingContextualMenu/styles.ts +0 -77
- package/src/ui/FloatingDeleteButton/DeleteButton.tsx +0 -54
- package/src/ui/FloatingDeleteButton/getPopUpOptions.ts +0 -65
- package/src/ui/FloatingDeleteButton/index.tsx +0 -383
- package/src/ui/FloatingDeleteButton/types.ts +0 -3
- package/src/ui/FloatingDragMenu/DragMenu.tsx +0 -668
- package/src/ui/FloatingDragMenu/DropdownMenu.tsx +0 -221
- package/src/ui/FloatingDragMenu/index.tsx +0 -136
- package/src/ui/FloatingDragMenu/styles.ts +0 -83
- package/src/ui/FloatingInsertButton/InsertButton.tsx +0 -263
- package/src/ui/FloatingInsertButton/getPopupOptions.ts +0 -131
- package/src/ui/FloatingInsertButton/index.tsx +0 -314
- package/src/ui/FloatingToolbarLabel/FloatingToolbarLabel.tsx +0 -31
- package/src/ui/SizeSelector/index.tsx +0 -74
- package/src/ui/TableFloatingColumnControls/ColumnControls/index.tsx +0 -397
- package/src/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.tsx +0 -105
- package/src/ui/TableFloatingColumnControls/ColumnDropTargets/index.tsx +0 -63
- package/src/ui/TableFloatingColumnControls/index.tsx +0 -151
- package/src/ui/TableFloatingControls/CornerControls/ClassicCornerControls.tsx +0 -106
- package/src/ui/TableFloatingControls/CornerControls/DragCornerControls.tsx +0 -143
- package/src/ui/TableFloatingControls/CornerControls/types.ts +0 -12
- package/src/ui/TableFloatingControls/FloatingControlsWithSelection.tsx +0 -88
- package/src/ui/TableFloatingControls/NumberColumn/index.tsx +0 -175
- package/src/ui/TableFloatingControls/RowControls/ClassicControls.tsx +0 -131
- package/src/ui/TableFloatingControls/RowControls/DragControls.tsx +0 -429
- package/src/ui/TableFloatingControls/RowDropTarget/index.tsx +0 -96
- package/src/ui/TableFloatingControls/index.tsx +0 -275
- package/src/ui/TableFullWidthLabel/index.tsx +0 -38
- package/src/ui/common-styles.ts +0 -1218
- package/src/ui/consts.ts +0 -109
- package/src/ui/event-handlers.ts +0 -662
- package/src/ui/global-styles.tsx +0 -55
- package/src/ui/hooks/useInternalTablePluginStateSelector.ts +0 -38
- package/src/ui/icons/AddColLeftIcon.tsx +0 -37
- package/src/ui/icons/AddColRightIcon.tsx +0 -37
- package/src/ui/icons/AddRowAboveIcon.tsx +0 -22
- package/src/ui/icons/AddRowBelowIcon.tsx +0 -39
- package/src/ui/icons/DragHandleDisabledIcon.tsx +0 -25
- package/src/ui/icons/DragHandleIcon.tsx +0 -16
- package/src/ui/icons/DragInMotionIcon.tsx +0 -54
- package/src/ui/icons/MergeCellsIcon.tsx +0 -26
- package/src/ui/icons/MinimisedHandle.tsx +0 -15
- package/src/ui/icons/SortingIconWrapper.tsx +0 -43
- package/src/ui/icons/SplitCellIcon.tsx +0 -34
- package/src/ui/toolbar.tsx +0 -1153
- package/src/ui/ui-styles.ts +0 -960
- package/tsconfig.app.json +0 -135
- package/tsconfig.dev.json +0 -54
- package/tsconfig.json +0 -18
|
@@ -1,275 +0,0 @@
|
|
|
1
|
-
import React, { useCallback } from 'react';
|
|
2
|
-
|
|
3
|
-
import type { TableColumnOrdering } from '@atlaskit/custom-steps';
|
|
4
|
-
import { browser } from '@atlaskit/editor-common/browser';
|
|
5
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
6
|
-
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
7
|
-
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
8
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
9
|
-
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
10
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
|
-
|
|
12
|
-
import { hoverCell, hoverRows, selectRow, selectRows } from '../../pm-plugins/commands';
|
|
13
|
-
import type { RowStickyState } from '../../pm-plugins/sticky-headers/types';
|
|
14
|
-
import { isTableNested } from '../../pm-plugins/utils/nodes';
|
|
15
|
-
import type { TablePlugin } from '../../tablePluginType';
|
|
16
|
-
import { TableCssClassName as ClassName } from '../../types';
|
|
17
|
-
import type { CellHoverMeta } from '../../types';
|
|
18
|
-
|
|
19
|
-
import { CornerControls } from './CornerControls/ClassicCornerControls';
|
|
20
|
-
import {
|
|
21
|
-
DragCornerControls,
|
|
22
|
-
DragCornerControlsWithSelection,
|
|
23
|
-
} from './CornerControls/DragCornerControls';
|
|
24
|
-
import { FloatingControlsWithSelection } from './FloatingControlsWithSelection';
|
|
25
|
-
import NumberColumn from './NumberColumn';
|
|
26
|
-
import { RowControls } from './RowControls/ClassicControls';
|
|
27
|
-
import { DragControls, DragControlsWithSelection } from './RowControls/DragControls';
|
|
28
|
-
|
|
29
|
-
interface TableFloatingControlsProps {
|
|
30
|
-
editorView: EditorView;
|
|
31
|
-
selection?: Selection;
|
|
32
|
-
tableRef?: HTMLTableElement;
|
|
33
|
-
tableNode?: PmNode;
|
|
34
|
-
tableActive?: boolean;
|
|
35
|
-
isInDanger?: boolean;
|
|
36
|
-
isTableHovered?: boolean;
|
|
37
|
-
isResizing?: boolean;
|
|
38
|
-
isHeaderRowEnabled?: boolean;
|
|
39
|
-
isHeaderColumnEnabled?: boolean;
|
|
40
|
-
isNumberColumnEnabled?: boolean;
|
|
41
|
-
isDragAndDropEnabled?: boolean;
|
|
42
|
-
hasHeaderRow?: boolean;
|
|
43
|
-
headerRowHeight?: number;
|
|
44
|
-
hoveredRows?: number[];
|
|
45
|
-
hoveredCell?: CellHoverMeta;
|
|
46
|
-
ordering?: TableColumnOrdering;
|
|
47
|
-
stickyHeader?: RowStickyState;
|
|
48
|
-
insertRowButtonIndex?: number;
|
|
49
|
-
tableWrapperWidth?: number;
|
|
50
|
-
isChromelessEditor?: boolean;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// Row controls
|
|
54
|
-
export const TableFloatingControls = ({
|
|
55
|
-
editorView,
|
|
56
|
-
tableRef,
|
|
57
|
-
tableNode,
|
|
58
|
-
isInDanger,
|
|
59
|
-
isResizing,
|
|
60
|
-
isNumberColumnEnabled,
|
|
61
|
-
isHeaderRowEnabled,
|
|
62
|
-
isHeaderColumnEnabled,
|
|
63
|
-
tableActive,
|
|
64
|
-
hasHeaderRow,
|
|
65
|
-
hoveredRows,
|
|
66
|
-
stickyHeader,
|
|
67
|
-
isDragAndDropEnabled,
|
|
68
|
-
hoveredCell,
|
|
69
|
-
isTableHovered,
|
|
70
|
-
tableWrapperWidth,
|
|
71
|
-
api,
|
|
72
|
-
isChromelessEditor,
|
|
73
|
-
}: TableFloatingControlsProps & { api?: ExtractInjectionAPI<TablePlugin> }) => {
|
|
74
|
-
const _selectRow = useCallback(
|
|
75
|
-
(row: number, expand: boolean) => {
|
|
76
|
-
const { state, dispatch } = editorView;
|
|
77
|
-
if (browser.ie_version === 11) {
|
|
78
|
-
// Ignored via go/ees005
|
|
79
|
-
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
80
|
-
(editorView.dom as HTMLElement).blur();
|
|
81
|
-
}
|
|
82
|
-
selectRow(row, expand)(state, dispatch);
|
|
83
|
-
},
|
|
84
|
-
[editorView],
|
|
85
|
-
);
|
|
86
|
-
|
|
87
|
-
const _selectRows = useCallback(
|
|
88
|
-
(rowIndexes: number[]) => {
|
|
89
|
-
const { state, dispatch } = editorView;
|
|
90
|
-
if (browser.ie_version === 11) {
|
|
91
|
-
// Ignored via go/ees005
|
|
92
|
-
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
93
|
-
(editorView.dom as HTMLElement).blur();
|
|
94
|
-
}
|
|
95
|
-
selectRows(rowIndexes)(state, dispatch);
|
|
96
|
-
},
|
|
97
|
-
[editorView],
|
|
98
|
-
);
|
|
99
|
-
|
|
100
|
-
const _hoverRows = useCallback(
|
|
101
|
-
(rows: Array<number>, danger?: boolean) => {
|
|
102
|
-
const { state, dispatch } = editorView;
|
|
103
|
-
hoverRows(rows, danger)(state, dispatch);
|
|
104
|
-
},
|
|
105
|
-
[editorView],
|
|
106
|
-
);
|
|
107
|
-
|
|
108
|
-
// re-use across numbered columns and row controls
|
|
109
|
-
const updateCellHoverLocation = useCallback(
|
|
110
|
-
(rowIndex: number) => {
|
|
111
|
-
const { state, dispatch } = editorView;
|
|
112
|
-
|
|
113
|
-
if (tableActive) {
|
|
114
|
-
// For context: Whenever we mouse over a column or row drag handle, we will ALWAYS be hovering over the 0 index
|
|
115
|
-
// of the opposite dimension. For example; here when we mouse over the row drag handle then we're technically
|
|
116
|
-
// also hovering over column 0 index. And vice-versa with columns. This means we don't need to worry about knowing the
|
|
117
|
-
// current column index. We can just force it to 0.
|
|
118
|
-
hoverCell(rowIndex, 0)(state, dispatch);
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
[editorView, tableActive],
|
|
122
|
-
);
|
|
123
|
-
|
|
124
|
-
if (!tableRef) {
|
|
125
|
-
return null;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
const stickyTop =
|
|
129
|
-
stickyHeader && stickyHeader.sticky && hasHeaderRow ? stickyHeader.top : undefined;
|
|
130
|
-
|
|
131
|
-
const wrapperClassName = isDragAndDropEnabled
|
|
132
|
-
? isChromelessEditor
|
|
133
|
-
? ClassName.DRAG_ROW_CONTROLS_WRAPPER + ' ' + ClassName.TABLE_CHROMELESS
|
|
134
|
-
: ClassName.DRAG_ROW_CONTROLS_WRAPPER
|
|
135
|
-
: ClassName.ROW_CONTROLS_WRAPPER;
|
|
136
|
-
|
|
137
|
-
const tablePos = findTable(editorView.state.selection)?.pos;
|
|
138
|
-
// Ignored via go/ees005
|
|
139
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
140
|
-
const isNested = tablePos !== undefined && isTableNested(editorView.state, tablePos!);
|
|
141
|
-
const shouldShowCornerControls = isNested && !fg('platform_editor_nested_dnd_styles_changes');
|
|
142
|
-
|
|
143
|
-
return (
|
|
144
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
145
|
-
<div className={wrapperClassName}>
|
|
146
|
-
{/* eslint-disable-next-line jsx-a11y/no-static-element-interactions */}
|
|
147
|
-
<div onMouseDown={(e) => !isDragAndDropEnabled && e.preventDefault()}>
|
|
148
|
-
{isNumberColumnEnabled ? (
|
|
149
|
-
<NumberColumn
|
|
150
|
-
editorView={editorView}
|
|
151
|
-
hoverRows={_hoverRows}
|
|
152
|
-
tableRef={tableRef}
|
|
153
|
-
tableActive={tableActive}
|
|
154
|
-
hoveredRows={hoveredRows}
|
|
155
|
-
hasHeaderRow={hasHeaderRow}
|
|
156
|
-
isInDanger={isInDanger}
|
|
157
|
-
isResizing={isResizing}
|
|
158
|
-
selectRow={_selectRow}
|
|
159
|
-
updateCellHoverLocation={updateCellHoverLocation}
|
|
160
|
-
stickyTop={stickyTop}
|
|
161
|
-
isDragAndDropEnabled={isDragAndDropEnabled}
|
|
162
|
-
/>
|
|
163
|
-
) : null}
|
|
164
|
-
|
|
165
|
-
{tableActive && (
|
|
166
|
-
<>
|
|
167
|
-
{isDragAndDropEnabled ? (
|
|
168
|
-
<>
|
|
169
|
-
{fg('platform_editor_table_use_shared_state_hook_fg') ? (
|
|
170
|
-
<>
|
|
171
|
-
{shouldShowCornerControls && (
|
|
172
|
-
<DragCornerControlsWithSelection
|
|
173
|
-
editorView={editorView}
|
|
174
|
-
tableRef={tableRef}
|
|
175
|
-
isInDanger={isInDanger}
|
|
176
|
-
isResizing={isResizing}
|
|
177
|
-
api={api}
|
|
178
|
-
/>
|
|
179
|
-
)}
|
|
180
|
-
<DragControlsWithSelection
|
|
181
|
-
tableRef={tableRef}
|
|
182
|
-
tableNode={tableNode}
|
|
183
|
-
hoveredCell={hoveredCell}
|
|
184
|
-
isTableHovered={isTableHovered}
|
|
185
|
-
editorView={editorView}
|
|
186
|
-
tableActive={tableActive}
|
|
187
|
-
isInDanger={isInDanger}
|
|
188
|
-
isResizing={isResizing}
|
|
189
|
-
// Ignored via go/ees005
|
|
190
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
191
|
-
tableWidth={tableWrapperWidth!}
|
|
192
|
-
hoverRows={_hoverRows}
|
|
193
|
-
selectRow={_selectRow}
|
|
194
|
-
selectRows={_selectRows}
|
|
195
|
-
updateCellHoverLocation={updateCellHoverLocation}
|
|
196
|
-
api={api}
|
|
197
|
-
/>
|
|
198
|
-
</>
|
|
199
|
-
) : (
|
|
200
|
-
<>
|
|
201
|
-
{shouldShowCornerControls && (
|
|
202
|
-
<DragCornerControls
|
|
203
|
-
editorView={editorView}
|
|
204
|
-
tableRef={tableRef}
|
|
205
|
-
isInDanger={isInDanger}
|
|
206
|
-
isResizing={isResizing}
|
|
207
|
-
/>
|
|
208
|
-
)}
|
|
209
|
-
<DragControls
|
|
210
|
-
tableRef={tableRef}
|
|
211
|
-
tableNode={tableNode}
|
|
212
|
-
hoveredCell={hoveredCell}
|
|
213
|
-
isTableHovered={isTableHovered}
|
|
214
|
-
editorView={editorView}
|
|
215
|
-
tableActive={tableActive}
|
|
216
|
-
isInDanger={isInDanger}
|
|
217
|
-
isResizing={isResizing}
|
|
218
|
-
// Ignored via go/ees005
|
|
219
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
220
|
-
tableWidth={tableWrapperWidth!}
|
|
221
|
-
hoverRows={_hoverRows}
|
|
222
|
-
selectRow={_selectRow}
|
|
223
|
-
selectRows={_selectRows}
|
|
224
|
-
updateCellHoverLocation={updateCellHoverLocation}
|
|
225
|
-
/>
|
|
226
|
-
</>
|
|
227
|
-
)}
|
|
228
|
-
</>
|
|
229
|
-
) : fg('platform_editor_table_use_shared_state_hook_fg') ? (
|
|
230
|
-
<FloatingControlsWithSelection
|
|
231
|
-
editorView={editorView}
|
|
232
|
-
tableRef={tableRef}
|
|
233
|
-
isInDanger={isInDanger}
|
|
234
|
-
isResizing={isResizing}
|
|
235
|
-
isHeaderRowEnabled={isHeaderRowEnabled}
|
|
236
|
-
isHeaderColumnEnabled={isHeaderColumnEnabled}
|
|
237
|
-
hoveredRows={hoveredRows}
|
|
238
|
-
stickyTop={tableActive ? stickyTop : undefined}
|
|
239
|
-
tableActive={tableActive}
|
|
240
|
-
hoverRows={_hoverRows}
|
|
241
|
-
selectRow={_selectRow}
|
|
242
|
-
api={api}
|
|
243
|
-
/>
|
|
244
|
-
) : (
|
|
245
|
-
<>
|
|
246
|
-
<CornerControls
|
|
247
|
-
editorView={editorView}
|
|
248
|
-
tableRef={tableRef}
|
|
249
|
-
isInDanger={isInDanger}
|
|
250
|
-
isResizing={isResizing}
|
|
251
|
-
isHeaderRowEnabled={isHeaderRowEnabled}
|
|
252
|
-
isHeaderColumnEnabled={isHeaderColumnEnabled}
|
|
253
|
-
hoveredRows={hoveredRows}
|
|
254
|
-
stickyTop={tableActive ? stickyTop : undefined}
|
|
255
|
-
/>
|
|
256
|
-
<RowControls
|
|
257
|
-
editorView={editorView}
|
|
258
|
-
tableRef={tableRef}
|
|
259
|
-
hoverRows={_hoverRows}
|
|
260
|
-
hoveredRows={hoveredRows}
|
|
261
|
-
isInDanger={isInDanger}
|
|
262
|
-
isResizing={isResizing}
|
|
263
|
-
selectRow={_selectRow}
|
|
264
|
-
stickyTop={tableActive ? stickyTop : undefined}
|
|
265
|
-
/>
|
|
266
|
-
</>
|
|
267
|
-
)}
|
|
268
|
-
</>
|
|
269
|
-
)}
|
|
270
|
-
</div>
|
|
271
|
-
</div>
|
|
272
|
-
);
|
|
273
|
-
};
|
|
274
|
-
|
|
275
|
-
export default TableFloatingControls;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { useIntl } from 'react-intl-next';
|
|
4
|
-
|
|
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
|
|
7
|
-
import { Box, Inline, xcss } from '@atlaskit/primitives';
|
|
8
|
-
import { token } from '@atlaskit/tokens';
|
|
9
|
-
|
|
10
|
-
const tableFullWidthLabelWrapperStyles = xcss({
|
|
11
|
-
height: token('space.400', '32px'),
|
|
12
|
-
display: 'flex',
|
|
13
|
-
backgroundColor: 'elevation.surface.overlay',
|
|
14
|
-
borderRadius: 'border.radius',
|
|
15
|
-
boxShadow: 'elevation.shadow.overlay',
|
|
16
|
-
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
17
|
-
lineHeight: 1,
|
|
18
|
-
boxSizing: 'border-box',
|
|
19
|
-
alignItems: 'center',
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
const tableFullWidthLabelStyles = xcss({
|
|
23
|
-
marginLeft: 'space.100',
|
|
24
|
-
marginRight: 'space.100',
|
|
25
|
-
paddingLeft: 'space.075',
|
|
26
|
-
paddingRight: 'space.075',
|
|
27
|
-
paddingTop: 'space.050',
|
|
28
|
-
paddingBottom: 'space.050',
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
export const FullWidthDisplay = () => {
|
|
32
|
-
const { formatMessage } = useIntl();
|
|
33
|
-
return (
|
|
34
|
-
<Box xcss={tableFullWidthLabelWrapperStyles}>
|
|
35
|
-
<Inline xcss={tableFullWidthLabelStyles}>{formatMessage(messages.fullWidthLabel)}</Inline>
|
|
36
|
-
</Box>
|
|
37
|
-
);
|
|
38
|
-
};
|