@atlaskit/editor-plugin-table 7.6.4 → 7.6.6
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 +14 -0
- package/dist/cjs/commands/column-resize.js +62 -16
- package/dist/cjs/commands/go-to-next-cell.js +5 -2
- package/dist/cjs/commands-with-analytics.js +8 -2
- package/dist/cjs/nodeviews/ExternalDropTargets.js +2 -0
- package/dist/cjs/nodeviews/TableComponent.js +8 -6
- package/dist/cjs/nodeviews/TableResizer.js +2 -1
- package/dist/cjs/plugin.js +58 -57
- package/dist/cjs/pm-plugins/keymap.js +26 -8
- package/dist/cjs/pm-plugins/main.js +15 -4
- package/dist/cjs/pm-plugins/table-resizing/event-handlers.js +4 -2
- package/dist/cjs/ui/DragHandle/index.js +2 -2
- package/dist/cjs/ui/DragPreview/index.js +2 -0
- package/dist/cjs/ui/FloatingContextualButton/FixedButton.js +10 -6
- package/dist/cjs/ui/FloatingDeleteButton/index.js +2 -0
- package/dist/cjs/ui/FloatingInsertButton/InsertButton.js +1 -0
- package/dist/cjs/ui/LayoutButton/index.js +2 -0
- package/dist/cjs/ui/TableFloatingColumnControls/ColumnControls/index.js +2 -0
- package/dist/cjs/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.js +3 -0
- package/dist/cjs/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +1 -0
- package/dist/cjs/ui/TableFloatingControls/NumberColumn/index.js +1 -0
- package/dist/cjs/ui/TableFloatingControls/RowControls/ClassicControls.js +4 -0
- package/dist/cjs/ui/TableFloatingControls/RowControls/DragControls.js +3 -1
- package/dist/cjs/ui/common-styles.js +4 -0
- package/dist/cjs/ui/ui-styles.js +93 -37
- package/dist/es2019/commands/column-resize.js +53 -4
- package/dist/es2019/commands/go-to-next-cell.js +5 -2
- package/dist/es2019/commands-with-analytics.js +8 -2
- package/dist/es2019/nodeviews/ExternalDropTargets.js +2 -0
- package/dist/es2019/nodeviews/TableComponent.js +9 -7
- package/dist/es2019/nodeviews/TableResizer.js +2 -1
- package/dist/es2019/plugin.js +4 -2
- package/dist/es2019/pm-plugins/keymap.js +25 -9
- package/dist/es2019/pm-plugins/main.js +15 -4
- package/dist/es2019/pm-plugins/table-resizing/event-handlers.js +4 -2
- package/dist/es2019/ui/DragHandle/index.js +2 -2
- package/dist/es2019/ui/DragPreview/index.js +2 -0
- package/dist/es2019/ui/FloatingContextualButton/FixedButton.js +10 -6
- package/dist/es2019/ui/FloatingDeleteButton/index.js +2 -0
- package/dist/es2019/ui/FloatingInsertButton/InsertButton.js +1 -0
- package/dist/es2019/ui/LayoutButton/index.js +2 -0
- package/dist/es2019/ui/TableFloatingColumnControls/ColumnControls/index.js +2 -0
- package/dist/es2019/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.js +3 -0
- package/dist/es2019/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +1 -0
- package/dist/es2019/ui/TableFloatingControls/NumberColumn/index.js +1 -0
- package/dist/es2019/ui/TableFloatingControls/RowControls/ClassicControls.js +4 -0
- package/dist/es2019/ui/TableFloatingControls/RowControls/DragControls.js +3 -1
- package/dist/es2019/ui/common-styles.js +4 -0
- package/dist/es2019/ui/ui-styles.js +66 -70
- package/dist/esm/commands/column-resize.js +62 -16
- package/dist/esm/commands/go-to-next-cell.js +5 -2
- package/dist/esm/commands-with-analytics.js +8 -2
- package/dist/esm/nodeviews/ExternalDropTargets.js +2 -0
- package/dist/esm/nodeviews/TableComponent.js +9 -7
- package/dist/esm/nodeviews/TableResizer.js +2 -1
- package/dist/esm/plugin.js +58 -57
- package/dist/esm/pm-plugins/keymap.js +26 -8
- package/dist/esm/pm-plugins/main.js +15 -4
- package/dist/esm/pm-plugins/table-resizing/event-handlers.js +4 -2
- package/dist/esm/ui/DragHandle/index.js +2 -2
- package/dist/esm/ui/DragPreview/index.js +2 -0
- package/dist/esm/ui/FloatingContextualButton/FixedButton.js +10 -6
- package/dist/esm/ui/FloatingDeleteButton/index.js +2 -0
- package/dist/esm/ui/FloatingInsertButton/InsertButton.js +1 -0
- package/dist/esm/ui/LayoutButton/index.js +2 -0
- package/dist/esm/ui/TableFloatingColumnControls/ColumnControls/index.js +2 -0
- package/dist/esm/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.js +3 -0
- package/dist/esm/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +1 -0
- package/dist/esm/ui/TableFloatingControls/NumberColumn/index.js +1 -0
- package/dist/esm/ui/TableFloatingControls/RowControls/ClassicControls.js +4 -0
- package/dist/esm/ui/TableFloatingControls/RowControls/DragControls.js +3 -1
- package/dist/esm/ui/common-styles.js +4 -0
- package/dist/esm/ui/ui-styles.js +93 -37
- package/dist/types/commands/column-resize.d.ts +23 -4
- package/dist/types/commands/go-to-next-cell.d.ts +2 -1
- package/dist/types/commands-with-analytics.d.ts +2 -1
- package/dist/types/pm-plugins/keymap.d.ts +3 -1
- package/dist/types/types.d.ts +7 -0
- package/dist/types-ts4.5/commands/column-resize.d.ts +23 -4
- package/dist/types-ts4.5/commands/go-to-next-cell.d.ts +2 -1
- package/dist/types-ts4.5/commands-with-analytics.d.ts +2 -1
- package/dist/types-ts4.5/pm-plugins/keymap.d.ts +3 -1
- package/dist/types-ts4.5/types.d.ts +7 -0
- package/package.json +4 -4
- package/src/commands/column-resize.ts +105 -29
- package/src/commands/go-to-next-cell.ts +10 -2
- package/src/commands-with-analytics.ts +11 -5
- package/src/nodeviews/ExternalDropTargets.tsx +2 -0
- package/src/nodeviews/TableComponent.tsx +14 -16
- package/src/nodeviews/TableResizer.tsx +2 -1
- package/src/plugin.tsx +3 -1
- package/src/pm-plugins/keymap.ts +44 -6
- package/src/pm-plugins/main.ts +18 -4
- package/src/pm-plugins/table-resizing/event-handlers.ts +6 -2
- package/src/types.ts +8 -0
- package/src/ui/DragHandle/index.tsx +2 -2
- package/src/ui/DragPreview/index.tsx +2 -0
- package/src/ui/FloatingContextualButton/FixedButton.tsx +9 -6
- package/src/ui/FloatingDeleteButton/index.tsx +2 -0
- package/src/ui/FloatingInsertButton/InsertButton.tsx +1 -0
- package/src/ui/LayoutButton/index.tsx +2 -0
- package/src/ui/TableFloatingColumnControls/ColumnControls/index.tsx +2 -0
- package/src/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.tsx +3 -0
- package/src/ui/TableFloatingControls/CornerControls/ClassicCornerControls.tsx +1 -0
- package/src/ui/TableFloatingControls/NumberColumn/index.tsx +1 -0
- package/src/ui/TableFloatingControls/RowControls/ClassicControls.tsx +4 -0
- package/src/ui/TableFloatingControls/RowControls/DragControls.tsx +5 -1
- package/src/ui/common-styles.ts +2 -0
- package/src/ui/ui-styles.ts +90 -79
|
@@ -21,11 +21,15 @@ var createTableWithAnalytics = function createTableWithAnalytics(isTableScalingE
|
|
|
21
21
|
})(editorAnalyticsAPI)(createTable(isTableScalingEnabled, isFullWidthModeEnabled));
|
|
22
22
|
};
|
|
23
23
|
export function keymapPlugin(getEditorContainerWidth, editorAnalyticsAPI, dragAndDropEnabled) {
|
|
24
|
+
var _pluginInjectionApi$a;
|
|
24
25
|
var isTableScalingEnabled = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
25
26
|
var isFullWidthEnabled = arguments.length > 4 ? arguments[4] : undefined;
|
|
27
|
+
var pluginInjectionApi = arguments.length > 5 ? arguments[5] : undefined;
|
|
28
|
+
var getIntl = arguments.length > 6 ? arguments[6] : undefined;
|
|
26
29
|
var list = {};
|
|
27
|
-
|
|
28
|
-
bindKeymapWithCommand(
|
|
30
|
+
var ariaNotifyPlugin = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.accessibilityUtils) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions.ariaNotify;
|
|
31
|
+
bindKeymapWithCommand(nextCell.common, goToNextCell(editorAnalyticsAPI, ariaNotifyPlugin, getIntl)(1), list);
|
|
32
|
+
bindKeymapWithCommand(previousCell.common, goToNextCell(editorAnalyticsAPI, ariaNotifyPlugin, getIntl)(-1), list);
|
|
29
33
|
bindKeymapWithCommand(toggleTable.common, createTableWithAnalytics(isTableScalingEnabled, !!isFullWidthEnabled, editorAnalyticsAPI), list);
|
|
30
34
|
bindKeymapWithCommand(backspace.common, chainCommands(deleteTableIfSelectedWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD), emptyMultipleCellsWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD)), list);
|
|
31
35
|
bindKeymapWithCommand(backspace.common, moveCursorBackward, list);
|
|
@@ -54,12 +58,26 @@ export function keymapPlugin(getEditorContainerWidth, editorAnalyticsAPI, dragAn
|
|
|
54
58
|
bindKeymapWithCommand(deleteRow.common, deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut(editorAnalyticsAPI), list);
|
|
55
59
|
}
|
|
56
60
|
if (getBooleanFF('platform.editor.a11y-column-resizing_emcvz')) {
|
|
57
|
-
bindKeymapWithCommand(startColumnResizing.common, initiateKeyboardColumnResizing
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
bindKeymapWithCommand(
|
|
62
|
-
|
|
61
|
+
bindKeymapWithCommand(startColumnResizing.common, initiateKeyboardColumnResizing({
|
|
62
|
+
ariaNotify: ariaNotifyPlugin,
|
|
63
|
+
getIntl: getIntl
|
|
64
|
+
}), list);
|
|
65
|
+
bindKeymapWithCommand(moveRight.common, activateNextResizeArea({
|
|
66
|
+
direction: 1,
|
|
67
|
+
ariaNotify: ariaNotifyPlugin,
|
|
68
|
+
getIntl: getIntl
|
|
69
|
+
}), list);
|
|
70
|
+
bindKeymapWithCommand(moveLeft.common, activateNextResizeArea({
|
|
71
|
+
direction: -1,
|
|
72
|
+
ariaNotify: ariaNotifyPlugin,
|
|
73
|
+
getIntl: getIntl
|
|
74
|
+
}), list);
|
|
75
|
+
bindKeymapWithCommand(decreaseMediaSize.common, changeColumnWidthByStepWithAnalytics(editorAnalyticsAPI)(-10, getEditorContainerWidth, isTableScalingEnabled, INPUT_METHOD.SHORTCUT, ariaNotifyPlugin, getIntl), list);
|
|
76
|
+
bindKeymapWithCommand(increaseMediaSize.common, changeColumnWidthByStepWithAnalytics(editorAnalyticsAPI)(10, getEditorContainerWidth, isTableScalingEnabled, INPUT_METHOD.SHORTCUT, ariaNotifyPlugin, getIntl), list);
|
|
77
|
+
bindKeymapWithCommand(escape.common, stopKeyboardColumnResizing({
|
|
78
|
+
ariaNotify: ariaNotifyPlugin,
|
|
79
|
+
getIntl: getIntl
|
|
80
|
+
}), list);
|
|
63
81
|
}
|
|
64
82
|
return keymap(list);
|
|
65
83
|
}
|
|
@@ -26,6 +26,7 @@ import { defaultHoveredCell, defaultTableSelection } from './default-table-selec
|
|
|
26
26
|
import { createPluginState, getPluginState } from './plugin-factory';
|
|
27
27
|
import { pluginKey } from './plugin-key';
|
|
28
28
|
export var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, eventDispatcher, pluginConfig, getEditorContainerWidth, getEditorFeatureFlags, getIntl, breakoutEnabled, tableResizingEnabled, fullWidthModeEnabled, previousFullWidthModeEnabled, dragAndDropEnabled, editorAnalyticsAPI, pluginInjectionApi, isTableScalingEnabled) {
|
|
29
|
+
var _accessibilityUtils;
|
|
29
30
|
var state = createPluginState(dispatch, _objectSpread(_objectSpread(_objectSpread({
|
|
30
31
|
pluginConfig: pluginConfig,
|
|
31
32
|
isTableHovered: false,
|
|
@@ -46,6 +47,7 @@ export var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch
|
|
|
46
47
|
// Used to prevent invalid table cell spans being reported more than once per editor/document
|
|
47
48
|
var invalidTableIds = [];
|
|
48
49
|
var editorViewRef = null;
|
|
50
|
+
var ariaNotifyPlugin = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_accessibilityUtils = pluginInjectionApi.accessibilityUtils) === null || _accessibilityUtils === void 0 ? void 0 : _accessibilityUtils.actions.ariaNotify;
|
|
49
51
|
var getCurrentEditorState = function getCurrentEditorState() {
|
|
50
52
|
var editorView = editorViewRef;
|
|
51
53
|
if (!editorView) {
|
|
@@ -107,7 +109,7 @@ export var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch
|
|
|
107
109
|
}
|
|
108
110
|
var tableNode = findTable(state.selection);
|
|
109
111
|
if (getBooleanFF('platform.editor.a11y-column-resizing_emcvz')) {
|
|
110
|
-
// when cursor leaves the table we need to stop column resizing
|
|
112
|
+
// when keyboard cursor leaves the table we need to stop column resizing
|
|
111
113
|
var pluginPrevState = getPluginState(prevState);
|
|
112
114
|
var isStopKeyboardColumResizing = pluginPrevState.isResizeHandleWidgetAdded && pluginPrevState.isKeyboardResize;
|
|
113
115
|
if (isStopKeyboardColumResizing) {
|
|
@@ -119,11 +121,17 @@ export var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch
|
|
|
119
121
|
// Add/delete row
|
|
120
122
|
tableNode.node.attrs.localId !== pluginPrevState.tableNode.attrs.localId) {
|
|
121
123
|
// Jump to another table
|
|
122
|
-
stopKeyboardColumnResizing(
|
|
124
|
+
stopKeyboardColumnResizing({
|
|
125
|
+
ariaNotify: ariaNotifyPlugin,
|
|
126
|
+
getIntl: getIntl
|
|
127
|
+
})(state, dispatch);
|
|
123
128
|
}
|
|
124
129
|
} else if (!tableNode) {
|
|
125
130
|
// selection outside of table
|
|
126
|
-
stopKeyboardColumnResizing(
|
|
131
|
+
stopKeyboardColumnResizing({
|
|
132
|
+
ariaNotify: ariaNotifyPlugin,
|
|
133
|
+
getIntl: getIntl
|
|
134
|
+
})(state, dispatch);
|
|
127
135
|
}
|
|
128
136
|
}
|
|
129
137
|
}
|
|
@@ -230,7 +238,10 @@ export var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch
|
|
|
230
238
|
var _getPluginState = getPluginState(state),
|
|
231
239
|
isKeyboardResize = _getPluginState.isKeyboardResize;
|
|
232
240
|
if (isKeyboardResize) {
|
|
233
|
-
stopKeyboardColumnResizing(
|
|
241
|
+
stopKeyboardColumnResizing({
|
|
242
|
+
ariaNotify: ariaNotifyPlugin,
|
|
243
|
+
getIntl: getIntl
|
|
244
|
+
})(state, dispatch);
|
|
234
245
|
return false;
|
|
235
246
|
}
|
|
236
247
|
}
|
|
@@ -123,7 +123,7 @@ export var handleMouseDown = function handleMouseDown(view, event, localResizeHa
|
|
|
123
123
|
/** if column resize had started via keyboard but continued by mouse
|
|
124
124
|
* or mouse pointer leaves the table but mouse button still pressed
|
|
125
125
|
*/
|
|
126
|
-
return stopKeyboardColumnResizing()(state, dispatch, view);
|
|
126
|
+
return stopKeyboardColumnResizing({})(state, dispatch, view);
|
|
127
127
|
} else {
|
|
128
128
|
return stopResizing()(state, dispatch);
|
|
129
129
|
}
|
|
@@ -184,7 +184,9 @@ export var handleMouseDown = function handleMouseDown(view, event, localResizeHa
|
|
|
184
184
|
/** if column resize had started via keyboard but continued by mouse
|
|
185
185
|
* or mouse pointer leaves the table but mouse button still pressed
|
|
186
186
|
*/
|
|
187
|
-
return stopKeyboardColumnResizing(
|
|
187
|
+
return stopKeyboardColumnResizing({
|
|
188
|
+
originalTr: tr
|
|
189
|
+
})(state, dispatch, view);
|
|
188
190
|
} else {
|
|
189
191
|
return stopResizing(tr)(state, dispatch);
|
|
190
192
|
}
|
|
@@ -154,8 +154,8 @@ var DragHandleComponent = function DragHandleComponent(_ref) {
|
|
|
154
154
|
// 16px here because it's the size of drag handle button's large side
|
|
155
155
|
width: isRow ? "var(--ds-space-200, 16px)" // 16px here because it's the size of drag handle button's large side
|
|
156
156
|
: "calc(100% - ".concat(dragTableInsertColumnButtonSize, "px)"),
|
|
157
|
-
left: isRow ?
|
|
158
|
-
bottom: isColumn ?
|
|
157
|
+
left: isRow ? "var(--ds-space-050, 4px)" : undefined,
|
|
158
|
+
bottom: isColumn ? "var(--ds-space-0, 0px)" : undefined,
|
|
159
159
|
alignSelf: isColumn ? 'none' : 'center',
|
|
160
160
|
zIndex: isColumn ? '-1' : 'auto'
|
|
161
161
|
},
|
|
@@ -24,7 +24,9 @@ export var DragPreview = function DragPreview(_ref) {
|
|
|
24
24
|
}, /*#__PURE__*/React.createElement(DragInMotionIcon, {
|
|
25
25
|
style: {
|
|
26
26
|
position: 'absolute',
|
|
27
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
27
28
|
marginLeft: "".concat(marginLeft, "px"),
|
|
29
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
28
30
|
marginTop: "".concat(marginTop, "px"),
|
|
29
31
|
transform: transform
|
|
30
32
|
}
|
|
@@ -92,25 +92,29 @@ export var FixedButton = function FixedButton(_ref2) {
|
|
|
92
92
|
ref: observerTargetRef,
|
|
93
93
|
style: {
|
|
94
94
|
position: 'absolute',
|
|
95
|
-
top:
|
|
96
|
-
left:
|
|
97
|
-
width: "
|
|
98
|
-
|
|
95
|
+
top: "var(--ds-space-0, 0px)",
|
|
96
|
+
left: "var(--ds-space-0, 0px)",
|
|
97
|
+
width: "var(--ds-space-250, 20px)",
|
|
98
|
+
// BUTTON_WIDTH
|
|
99
|
+
height: "var(--ds-space-250, 20px)" // BUTTON_WIDTH
|
|
99
100
|
}
|
|
100
101
|
}, /*#__PURE__*/React.createElement("div", {
|
|
101
102
|
ref: fixedButtonRef,
|
|
102
103
|
style: {
|
|
103
104
|
position: 'fixed',
|
|
105
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
104
106
|
top: stickyHeader.top + stickyHeader.padding + offset * 2,
|
|
105
107
|
zIndex: akEditorTableCellOnStickyHeaderZIndex,
|
|
108
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
106
109
|
left: calcLeftPos({
|
|
107
110
|
buttonWidth: BUTTON_WIDTH,
|
|
108
111
|
cellRectLeft: targetCellRect.left,
|
|
109
112
|
cellRefWidth: targetCellRef.clientWidth,
|
|
110
113
|
offset: offset
|
|
111
114
|
}),
|
|
112
|
-
width: "
|
|
113
|
-
|
|
115
|
+
width: "var(--ds-space-250, 20px)",
|
|
116
|
+
// BUTTON_WIDTH
|
|
117
|
+
height: "var(--ds-space-250, 20px)" // BUTTON_WIDTH
|
|
114
118
|
},
|
|
115
119
|
className: ClassName.CONTEXTUAL_MENU_BUTTON_FIXED
|
|
116
120
|
}, children)), mountTo);
|
|
@@ -199,8 +199,10 @@ var FloatingDeleteButton = /*#__PURE__*/function (_Component) {
|
|
|
199
199
|
return /*#__PURE__*/createPortal( /*#__PURE__*/React.createElement("div", {
|
|
200
200
|
style: {
|
|
201
201
|
position: 'fixed',
|
|
202
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
202
203
|
top: pos.top,
|
|
203
204
|
zIndex: stickyRowZIndex,
|
|
205
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
204
206
|
left: rect.left + (pos.left || 0) - (this.state.selectionType === 'column' ? this.state.scrollLeft : 0) - (this.props.isNumberColumnEnabled ? akEditorTableNumberColumnWidth : 0)
|
|
205
207
|
}
|
|
206
208
|
}, button), mountTo);
|
|
@@ -83,6 +83,7 @@ export var InsertButtonForDragAndDrop = function InsertButtonForDragAndDrop(_ref
|
|
|
83
83
|
left: "var(--ds-space-150, 12px)"
|
|
84
84
|
} : {
|
|
85
85
|
height: getInsertLineHeight(tableRef, hasStickyHeaders, true) - 8,
|
|
86
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
86
87
|
top: '-3px'
|
|
87
88
|
}
|
|
88
89
|
})));
|
|
@@ -117,7 +117,9 @@ var LayoutButton = /*#__PURE__*/function (_React$Component) {
|
|
|
117
117
|
"aria-label": title,
|
|
118
118
|
style: {
|
|
119
119
|
position: 'fixed',
|
|
120
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
120
121
|
top: pos.top + 22,
|
|
122
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
121
123
|
left: tablePos.right
|
|
122
124
|
}
|
|
123
125
|
}, button);
|
|
@@ -182,7 +182,9 @@ export var ColumnControls = function ColumnControls(_ref) {
|
|
|
182
182
|
"data-testid": "table-floating-column-controls",
|
|
183
183
|
style: {
|
|
184
184
|
gridTemplateColumns: widths,
|
|
185
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
185
186
|
marginTop: marginTop,
|
|
187
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
186
188
|
width: stickyTop ? containerWidth : undefined,
|
|
187
189
|
overflowX: stickyTop ? 'hidden' : 'visible',
|
|
188
190
|
pointerEvents: isDragging ? 'none' : undefined
|
|
@@ -74,8 +74,11 @@ export var ColumnDropTarget = function ColumnDropTarget(_ref) {
|
|
|
74
74
|
return /*#__PURE__*/React.createElement("div", {
|
|
75
75
|
ref: dropTargetRef,
|
|
76
76
|
style: {
|
|
77
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
77
78
|
width: width && "".concat(width - 1, "px"),
|
|
79
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
78
80
|
height: height && "".concat(height, "px"),
|
|
81
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
79
82
|
marginTop: marginTop && "".concat(marginTop, "px"),
|
|
80
83
|
pointerEvents: 'auto',
|
|
81
84
|
flexShrink: 0
|
|
@@ -76,6 +76,7 @@ var CornerControlComponent = /*#__PURE__*/function (_Component) {
|
|
|
76
76
|
sticky: this.props.stickyTop !== undefined
|
|
77
77
|
}),
|
|
78
78
|
style: {
|
|
79
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
79
80
|
top: this.props.stickyTop !== undefined ? "".concat(this.props.stickyTop, "px") : undefined
|
|
80
81
|
},
|
|
81
82
|
contentEditable: false
|
|
@@ -102,6 +102,7 @@ var NumberColumn = /*#__PURE__*/function (_Component) {
|
|
|
102
102
|
return /*#__PURE__*/React.createElement("div", {
|
|
103
103
|
className: ClassName.NUMBERED_COLUMN,
|
|
104
104
|
style: {
|
|
105
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
105
106
|
marginTop: hasHeaderRow && this.props.stickyTop !== undefined ? rowHeights[0] : undefined,
|
|
106
107
|
borderLeft: isDragAndDropEnabled && tableActive ? "1px solid ".concat(tableBorderColor) : undefined
|
|
107
108
|
},
|
|
@@ -70,9 +70,13 @@ var RowControlsComponent = /*#__PURE__*/function (_Component) {
|
|
|
70
70
|
className: "".concat(ClassName.ROW_CONTROLS_BUTTON_WRAP, " ").concat(getRowClassNames(startIndex, selectionState || selection, hoveredRows, isInDanger, isResizing), " ").concat(thisRowSticky ? 'sticky' : ''),
|
|
71
71
|
key: startIndex,
|
|
72
72
|
style: {
|
|
73
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
73
74
|
height: height,
|
|
75
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
74
76
|
marginTop: "".concat(marginTop, "px"),
|
|
77
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
75
78
|
top: thisRowSticky ? "".concat(_this2.props.stickyTop + 3, "px") : undefined,
|
|
79
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
76
80
|
paddingTop: thisRowSticky ? "".concat(tableControlsSpacing, "px") : undefined
|
|
77
81
|
}
|
|
78
82
|
}, /*#__PURE__*/React.createElement("button", {
|
|
@@ -129,6 +129,7 @@ var DragControlsComponent = function DragControlsComponent(_ref) {
|
|
|
129
129
|
width: '9px',
|
|
130
130
|
height: '100%',
|
|
131
131
|
position: 'relative',
|
|
132
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
132
133
|
right: '-0.5px'
|
|
133
134
|
},
|
|
134
135
|
"data-testid": "table-floating-row-".concat(isHover ? rowIndex : selectedRowIndexes[0], "-drag-handle")
|
|
@@ -173,7 +174,8 @@ var DragControlsComponent = function DragControlsComponent(_ref) {
|
|
|
173
174
|
style: {
|
|
174
175
|
gridTemplateRows: heights,
|
|
175
176
|
gridTemplateColumns: isDragging ? "".concat(dropTargetExtendedWidth, "px 14px ").concat(tableWidth, "px") : '0px 14px 0px',
|
|
176
|
-
|
|
177
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
178
|
+
left: isDragging ? "-".concat(dropTargetExtendedWidth + 2, "px") : "var(--ds-space-negative-025, -2px)"
|
|
177
179
|
},
|
|
178
180
|
onMouseMove: handleMouseMove,
|
|
179
181
|
contentEditable: false
|
|
@@ -40,6 +40,8 @@ var tableBorderStyles = function tableBorderStyles() {
|
|
|
40
40
|
return "border: 1px solid ".concat(tableBorderDeleteColor);
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
|
+
|
|
44
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
43
45
|
var tableStickyHeaderColumnControlsDecorationsStyle = function tableStickyHeaderColumnControlsDecorationsStyle() {
|
|
44
46
|
if (getBooleanFF('platform.editor.table.column-controls-styles-updated')) {
|
|
45
47
|
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .", " .", " {\n z-index: 0;\n left: -1px;\n }\n\n .", "\n .", "::after {\n border-left: 1px solid ", ";\n }\n\n .", "\n tr:first-of-type\n th.", " {\n &.", ", &.", " {\n .", "::after {\n left: 0;\n }\n }\n }\n "])), ClassName.TABLE_STICKY, ClassName.COLUMN_CONTROLS_DECORATIONS, ClassName.TABLE_STICKY, ClassName.COLUMN_CONTROLS_DECORATIONS, tableBorderColor, ClassName.TABLE_STICKY, ClassName.TABLE_HEADER_CELL, ClassName.COLUMN_SELECTED, ClassName.HOVERED_COLUMN, ClassName.COLUMN_CONTROLS_DECORATIONS);
|
|
@@ -75,5 +77,7 @@ export var baseTableStyles = function baseTableStyles(props) {
|
|
|
75
77
|
export var tableStyles = function tableStyles(props) {
|
|
76
78
|
return css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n .", " button {\n background: ", ";\n color: ", ";\n cursor: none;\n }\n\n .", ":not(.", ") button:hover {\n background: ", ";\n color: ", " !important;\n cursor: pointer;\n }\n\n .ProseMirror {\n ", "\n }\n\n .ProseMirror.", " {\n .", " {\n overflow-x: auto;\n ", ";\n }\n }\n\n .ProseMirror.", " {\n cursor: col-resize;\n }\n\n ", "\n"])), ClassName.LAYOUT_BUTTON, "var(--ds-background-neutral, ".concat(N20A, ")"), "var(--ds-icon, ".concat(N300, ")"), ClassName.LAYOUT_BUTTON, ClassName.IS_RESIZING, "var(--ds-background-neutral-hovered, ".concat(B300, ")"), "var(--ds-icon, white)", baseTableStyles(props), ClassName.IS_RESIZING, ClassName.TABLE_NODE_WRAPPER, scrollbarStyles, ClassName.RESIZE_CURSOR, shadowSentinelStyles);
|
|
77
79
|
};
|
|
80
|
+
|
|
81
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
78
82
|
export var tableFullPageEditorStyles = css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n .ProseMirror .", " > table {\n margin-left: 0;\n // 1px border width offset added here to prevent unwanted overflow and scolling - ED-16212\n margin-right: -1px;\n width: 100%;\n }\n"])), ClassName.TABLE_NODE_WRAPPER);
|
|
79
83
|
export var tableCommentEditorStyles = css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n .ProseMirror .", " > table {\n margin-left: 0;\n margin-right: 0;\n ", ";\n }\n"])), ClassName.TABLE_NODE_WRAPPER, scrollbarStyles);
|