@atlaskit/editor-plugin-table 7.17.0 → 7.17.2
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 +28 -0
- package/dist/cjs/nodeviews/ExternalDropTargets.js +2 -1
- package/dist/cjs/nodeviews/TableResizer.js +2 -0
- package/dist/cjs/plugin.js +2 -1
- package/dist/cjs/pm-plugins/table-resizing/event-handlers.js +2 -2
- package/dist/cjs/pm-plugins/table-resizing/utils/resize-column.js +2 -1
- package/dist/cjs/toolbar.js +3 -0
- package/dist/cjs/ui/DragHandle/index.js +4 -2
- package/dist/cjs/ui/FloatingContextualButton/FixedButton.js +1 -1
- package/dist/cjs/ui/FloatingContextualButton/index.js +5 -1
- package/dist/cjs/ui/FloatingContextualButton/styles.js +10 -0
- package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +47 -22
- package/dist/cjs/ui/FloatingContextualMenu/styles.js +3 -0
- package/dist/cjs/ui/FloatingDeleteButton/index.js +4 -2
- package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +36 -13
- package/dist/cjs/ui/FloatingDragMenu/index.js +5 -2
- package/dist/cjs/ui/FloatingDragMenu/styles.js +12 -1
- package/dist/cjs/ui/TableFloatingControls/NumberColumn/index.js +3 -1
- package/dist/cjs/ui/TableFloatingControls/RowControls/ClassicControls.js +1 -1
- package/dist/cjs/ui/TableFloatingControls/RowControls/DragControls.js +4 -2
- package/dist/cjs/ui/common-styles.js +3 -1
- package/dist/cjs/ui/consts.js +4 -1
- package/dist/cjs/ui/ui-styles.js +35 -3
- package/dist/cjs/utils/drag-menu.js +32 -27
- package/dist/es2019/nodeviews/ExternalDropTargets.js +2 -1
- package/dist/es2019/nodeviews/TableResizer.js +2 -0
- package/dist/es2019/plugin.js +34 -31
- package/dist/es2019/pm-plugins/table-resizing/event-handlers.js +3 -3
- package/dist/es2019/pm-plugins/table-resizing/utils/resize-column.js +2 -1
- package/dist/es2019/toolbar.js +3 -0
- package/dist/es2019/ui/DragHandle/index.js +6 -2
- package/dist/es2019/ui/FloatingContextualButton/FixedButton.js +1 -1
- package/dist/es2019/ui/FloatingContextualButton/index.js +5 -1
- package/dist/es2019/ui/FloatingContextualButton/styles.js +10 -0
- package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +38 -11
- package/dist/es2019/ui/FloatingContextualMenu/styles.js +3 -0
- package/dist/es2019/ui/FloatingDeleteButton/index.js +4 -2
- package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +34 -13
- package/dist/es2019/ui/FloatingDragMenu/index.js +4 -2
- package/dist/es2019/ui/FloatingDragMenu/styles.js +11 -3
- package/dist/es2019/ui/TableFloatingControls/NumberColumn/index.js +3 -1
- package/dist/es2019/ui/TableFloatingControls/RowControls/ClassicControls.js +1 -1
- package/dist/es2019/ui/TableFloatingControls/RowControls/DragControls.js +6 -2
- package/dist/es2019/ui/common-styles.js +3 -1
- package/dist/es2019/ui/consts.js +3 -0
- package/dist/es2019/ui/ui-styles.js +36 -3
- package/dist/es2019/utils/drag-menu.js +23 -19
- package/dist/esm/nodeviews/ExternalDropTargets.js +2 -1
- package/dist/esm/nodeviews/TableResizer.js +2 -0
- package/dist/esm/plugin.js +2 -1
- package/dist/esm/pm-plugins/table-resizing/event-handlers.js +3 -3
- package/dist/esm/pm-plugins/table-resizing/utils/resize-column.js +2 -1
- package/dist/esm/toolbar.js +3 -0
- package/dist/esm/ui/DragHandle/index.js +4 -2
- package/dist/esm/ui/FloatingContextualButton/FixedButton.js +1 -1
- package/dist/esm/ui/FloatingContextualButton/index.js +5 -1
- package/dist/esm/ui/FloatingContextualButton/styles.js +10 -0
- package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +47 -22
- package/dist/esm/ui/FloatingContextualMenu/styles.js +3 -0
- package/dist/esm/ui/FloatingDeleteButton/index.js +4 -2
- package/dist/esm/ui/FloatingDragMenu/DragMenu.js +36 -13
- package/dist/esm/ui/FloatingDragMenu/index.js +5 -2
- package/dist/esm/ui/FloatingDragMenu/styles.js +13 -2
- package/dist/esm/ui/TableFloatingControls/NumberColumn/index.js +3 -1
- package/dist/esm/ui/TableFloatingControls/RowControls/ClassicControls.js +1 -1
- package/dist/esm/ui/TableFloatingControls/RowControls/DragControls.js +4 -2
- package/dist/esm/ui/common-styles.js +3 -1
- package/dist/esm/ui/consts.js +3 -0
- package/dist/esm/ui/ui-styles.js +35 -3
- package/dist/esm/utils/drag-menu.js +32 -27
- package/dist/types/ui/FloatingDragMenu/DragMenu.d.ts +2 -1
- package/dist/types/ui/FloatingDragMenu/styles.d.ts +1 -1
- package/dist/types/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +8 -0
- package/dist/types/ui/TableFloatingControls/CornerControls/DragCornerControls.d.ts +16 -0
- package/dist/types/ui/TableFloatingControls/index.d.ts +8 -0
- package/dist/types/ui/consts.d.ts +3 -0
- package/dist/types/utils/drag-menu.d.ts +1 -1
- package/dist/types-ts4.5/ui/FloatingDragMenu/DragMenu.d.ts +2 -1
- package/dist/types-ts4.5/ui/FloatingDragMenu/styles.d.ts +1 -1
- package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +8 -0
- package/dist/types-ts4.5/ui/TableFloatingControls/CornerControls/DragCornerControls.d.ts +16 -0
- package/dist/types-ts4.5/ui/TableFloatingControls/index.d.ts +8 -0
- package/dist/types-ts4.5/ui/consts.d.ts +3 -0
- package/dist/types-ts4.5/utils/drag-menu.d.ts +1 -1
- package/package.json +136 -147
- package/src/nodeviews/ExternalDropTargets.tsx +2 -1
- package/src/nodeviews/TableResizer.tsx +3 -0
- package/src/plugin.tsx +3 -1
- package/src/pm-plugins/table-resizing/event-handlers.ts +9 -3
- package/src/pm-plugins/table-resizing/utils/resize-column.ts +2 -1
- package/src/toolbar.tsx +3 -0
- package/src/ui/DragHandle/index.tsx +4 -2
- package/src/ui/FloatingContextualButton/FixedButton.tsx +1 -1
- package/src/ui/FloatingContextualButton/index.tsx +2 -0
- package/src/ui/FloatingContextualButton/styles.ts +10 -0
- package/src/ui/FloatingContextualMenu/ContextualMenu.tsx +22 -3
- package/src/ui/FloatingContextualMenu/index.tsx +1 -0
- package/src/ui/FloatingContextualMenu/styles.ts +2 -0
- package/src/ui/FloatingDeleteButton/index.tsx +2 -1
- package/src/ui/FloatingDragMenu/DragMenu.tsx +39 -16
- package/src/ui/FloatingDragMenu/DropdownMenu.tsx +1 -1
- package/src/ui/FloatingDragMenu/index.tsx +6 -2
- package/src/ui/FloatingDragMenu/styles.ts +20 -3
- package/src/ui/TableFloatingControls/NumberColumn/index.tsx +1 -0
- package/src/ui/TableFloatingControls/RowControls/ClassicControls.tsx +1 -1
- package/src/ui/TableFloatingControls/RowControls/DragControls.tsx +4 -2
- package/src/ui/common-styles.ts +2 -1
- package/src/ui/consts.ts +4 -0
- package/src/ui/ui-styles.ts +25 -0
- package/src/utils/drag-menu.ts +28 -18
|
@@ -15,28 +15,39 @@ var _templateObject;
|
|
|
15
15
|
var cellColourPreviewStyles = exports.cellColourPreviewStyles = function cellColourPreviewStyles(selectedColor) {
|
|
16
16
|
return (0, _react.css)({
|
|
17
17
|
'&::before': {
|
|
18
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
18
19
|
background: selectedColor
|
|
19
20
|
}
|
|
20
21
|
});
|
|
21
22
|
};
|
|
23
|
+
|
|
24
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
22
25
|
var elementBeforeIconStyles = exports.elementBeforeIconStyles = (0, _react.css)({
|
|
23
26
|
marginRight: "var(--ds-space-negative-075, -6px)",
|
|
24
27
|
display: 'flex'
|
|
25
28
|
});
|
|
26
29
|
|
|
27
30
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
28
|
-
var dragMenuBackgroundColorStyles = exports.dragMenuBackgroundColorStyles =
|
|
31
|
+
var dragMenuBackgroundColorStyles = exports.dragMenuBackgroundColorStyles = function dragMenuBackgroundColorStyles() {
|
|
32
|
+
var tableSortColumnDiscoverability = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
33
|
+
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t.", " {\n\t\tborder-radius: ", ";\n\t\tbackground: ", ";\n\t\tbox-shadow: ", ";\n\t\tdisplay: block;\n\t\tposition: absolute;\n\t\ttop: ", "px; // move the submenu down when 'sort increasing/decreasing' appear before background color picker\n\t\tleft: ", "px;\n\t\tpadding: ", ";\n\n\t\t> div {\n\t\t\tpadding: 0;\n\t\t}\n\t}\n\n\t.", " {\n\t\tdisplay: flex;\n\n\t\t&::before {\n\t\t\tcontent: '';\n\t\t\tdisplay: block;\n\t\t\tborder: 1px solid ", ";\n\t\t\tborder-radius: ", ";\n\t\t\twidth: 14px;\n\t\t\theight: 14px;\n\t\t}\n\n\t\t&::after {\n\t\t\tcontent: '\u203A';\n\t\t\tmargin-left: ", ";\n\t\t\tline-height: 14px;\n\t\t\tcolor: ", ";\n\t\t}\n\t}\n"])), _types.TableCssClassName.DRAG_SUBMENU, "var(--ds-border-radius, 3px)", "var(--ds-surface-overlay, white)", "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(_colors.N60A, ", 0 0 1px ").concat(_colors.N60A), ")"), tableSortColumnDiscoverability ? _consts.TABLE_DRAG_MENU_PADDING_TOP + _consts.TABLE_DRAG_MENU_SORT_GROUP_HEIGHT + _consts.TABLE_DRAG_MENU_MENU_GROUP_BEFORE_HEIGHT : 0, _consts.dragMenuDropdownWidth, "var(--ds-space-100, 8px)", _types.TableCssClassName.DRAG_SUBMENU_ICON, _adfSchema.tableBackgroundBorderColor, "var(--ds-border-radius, 3px)", "var(--ds-space-050, 4px)", "var(--ds-icon, ".concat(_colors.N90, ")"));
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
29
37
|
var toggleStyles = exports.toggleStyles = (0, _react.css)({
|
|
30
38
|
display: 'flex',
|
|
39
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
31
40
|
"input[type='checkbox']": {
|
|
32
41
|
width: '30px',
|
|
33
42
|
height: '14px',
|
|
34
43
|
pointerEvents: 'initial',
|
|
35
44
|
cursor: 'pointer'
|
|
36
45
|
},
|
|
46
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
37
47
|
'> label': {
|
|
38
48
|
margin: '0px',
|
|
39
49
|
pointerEvents: 'none',
|
|
50
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
40
51
|
'> span': {
|
|
41
52
|
pointerEvents: 'none'
|
|
42
53
|
}
|
|
@@ -115,7 +115,9 @@ var NumberColumn = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
115
115
|
style: {
|
|
116
116
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
117
117
|
marginTop: hasHeaderRow && this.props.stickyTop !== undefined ? rowHeights[0] : undefined,
|
|
118
|
-
borderLeft:
|
|
118
|
+
borderLeft:
|
|
119
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
120
|
+
isDragAndDropEnabled && tableActive ? "1px solid ".concat(_consts.tableBorderColor) : undefined
|
|
119
121
|
},
|
|
120
122
|
contentEditable: false
|
|
121
123
|
}, rowHeights.map(function (rowHeight, index) {
|
|
@@ -90,7 +90,7 @@ var RowControlsComponent = /*#__PURE__*/function (_Component) {
|
|
|
90
90
|
marginTop: "".concat(marginTop, "px"),
|
|
91
91
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
92
92
|
top: thisRowSticky ? "".concat(_this2.props.stickyTop + 3, "px") : undefined,
|
|
93
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
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
94
|
paddingTop: thisRowSticky ? "".concat(_consts.tableControlsSpacing, "px") : undefined
|
|
95
95
|
}
|
|
96
96
|
}, /*#__PURE__*/_react.default.createElement("button", {
|
|
@@ -202,9 +202,11 @@ var DragControlsComponent = function DragControlsComponent(_ref) {
|
|
|
202
202
|
className: _types.TableCssClassName.DRAG_ROW_CONTROLS,
|
|
203
203
|
style: {
|
|
204
204
|
gridTemplateRows: heights,
|
|
205
|
-
gridTemplateColumns: isDragging ?
|
|
205
|
+
gridTemplateColumns: isDragging ? // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
206
|
+
"".concat(_consts.dropTargetExtendedWidth, "px 14px ").concat(tableWidth, "px") : '0px 14px 0px',
|
|
206
207
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
207
|
-
left: isDragging ?
|
|
208
|
+
left: isDragging ? // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
209
|
+
"-".concat(_consts.dropTargetExtendedWidth + 2, "px") : "var(--ds-space-negative-025, -2px)"
|
|
208
210
|
},
|
|
209
211
|
onMouseMove: handleMouseMove,
|
|
210
212
|
contentEditable: false
|
|
@@ -82,6 +82,8 @@ var tableStyles = exports.tableStyles = function tableStyles(props) {
|
|
|
82
82
|
return (0, _react.css)(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n\t.ProseMirror {\n\t\t", "\n\t}\n\n\t.ProseMirror.", " {\n\t\t.", " {\n\t\t\toverflow-x: auto;\n\t\t\t", ";\n\t\t}\n\t}\n\n\t.ProseMirror.", " {\n\t\tcursor: col-resize;\n\t}\n\n\t", "\n"])), baseTableStyles(props), _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.TABLE_NODE_WRAPPER, _scrollbar.scrollbarStyles, _types.TableCssClassName.RESIZE_CURSOR, shadowSentinelStyles);
|
|
83
83
|
};
|
|
84
84
|
|
|
85
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
85
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
86
86
|
var tableFullPageEditorStyles = exports.tableFullPageEditorStyles = (0, _react.css)(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n\t.ProseMirror .", " > table {\n\t\tmargin-left: 0;\n\t\t// 1px border width offset added here to prevent unwanted overflow and scolling - ED-16212\n\t\tmargin-right: -1px;\n\t\twidth: 100%;\n\t}\n"])), _types.TableCssClassName.TABLE_NODE_WRAPPER);
|
|
87
|
+
|
|
88
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
87
89
|
var tableCommentEditorStyles = exports.tableCommentEditorStyles = (0, _react.css)(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n\t.ProseMirror .", " > table {\n\t\tmargin-left: 0;\n\t\tmargin-right: 0;\n\t\t", ";\n\t}\n"])), _types.TableCssClassName.TABLE_NODE_WRAPPER, _scrollbar.scrollbarStyles);
|
package/dist/cjs/ui/consts.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.tableToolbarSize = exports.tableToolbarSelectedColor = exports.tableToolbarDeleteColor = exports.tableToolbarColor = exports.tableTextColor = exports.tableScrollbarOffset = exports.tableResizerWidth = exports.tablePopupMenuFitHeight = exports.tablePadding = exports.tableOverflowShadowWidthWide = exports.tableOverflowShadowWidth = exports.tableMarginFullWidthMode = exports.tableInsertColumnButtonSize = exports.tableInsertColumnButtonOffset = exports.tableHeaderCellBackgroundColor = exports.tableFloatingControlsColor = exports.tableDeleteButtonSize = exports.tableDeleteButtonOffset = exports.tableControlsSpacing = exports.tableCellSelectedDeleteIconColor = exports.tableCellSelectedDeleteIconBackground = exports.tableCellSelectedColor = exports.tableCellHoverDeleteIconColor = exports.tableCellHoverDeleteIconBackground = exports.tableCellDeleteColor = exports.tableCellBackgroundColor = exports.tableBorderSelectedColor = exports.tableBorderRadiusSize = exports.tableBorderDeleteColor = exports.tableBorderColor = exports.stickyRowZIndex = exports.stickyRowOffsetTop = exports.stickyHeaderBorderBottomWidth = exports.rowControlsZIndex = exports.resizeLineWidth = exports.resizeHandlerZIndex = exports.resizeHandlerAreaWidth = exports.lineMarkerSize = exports.lineMarkerOffsetFromColumnControls = exports.layoutButtonSize = exports.insertLineWidth = exports.dropTargetsZIndex = exports.dropTargetExtendedWidth = exports.dragTableInsertColumnButtonSize = exports.dragMenuDropdownWidth = exports.contextualMenuTriggerSize = exports.contextualMenuDropdownWidthDnD = exports.contextualMenuDropdownWidth = exports.columnResizeHandleZIndex = exports.columnControlsZIndex = exports.columnControlsSelectedZIndex = exports.columnControlsDecorationHeight = exports.colorPalletteColumns = exports.TABLE_SNAP_GAP = exports.TABLE_HIGHLIGHT_TOLERANCE = exports.TABLE_HIGHLIGHT_GAP = exports.TABLE_GUIDELINE_VISIBLE_ADJUSTMENT = exports.STICKY_HEADER_TOGGLE_TOLERANCE_MS = void 0;
|
|
6
|
+
exports.tableToolbarSize = exports.tableToolbarSelectedColor = exports.tableToolbarDeleteColor = exports.tableToolbarColor = exports.tableTextColor = exports.tableScrollbarOffset = exports.tableResizerWidth = exports.tablePopupMenuFitHeight = exports.tablePadding = exports.tableOverflowShadowWidthWide = exports.tableOverflowShadowWidth = exports.tableMarginFullWidthMode = exports.tableInsertColumnButtonSize = exports.tableInsertColumnButtonOffset = exports.tableHeaderCellBackgroundColor = exports.tableFloatingControlsColor = exports.tableDeleteButtonSize = exports.tableDeleteButtonOffset = exports.tableControlsSpacing = exports.tableCellSelectedDeleteIconColor = exports.tableCellSelectedDeleteIconBackground = exports.tableCellSelectedColor = exports.tableCellHoverDeleteIconColor = exports.tableCellHoverDeleteIconBackground = exports.tableCellDeleteColor = exports.tableCellBackgroundColor = exports.tableBorderSelectedColor = exports.tableBorderRadiusSize = exports.tableBorderDeleteColor = exports.tableBorderColor = exports.stickyRowZIndex = exports.stickyRowOffsetTop = exports.stickyHeaderBorderBottomWidth = exports.rowControlsZIndex = exports.resizeLineWidth = exports.resizeHandlerZIndex = exports.resizeHandlerAreaWidth = exports.lineMarkerSize = exports.lineMarkerOffsetFromColumnControls = exports.layoutButtonSize = exports.insertLineWidth = exports.dropTargetsZIndex = exports.dropTargetExtendedWidth = exports.dragTableInsertColumnButtonSize = exports.dragMenuDropdownWidth = exports.contextualMenuTriggerSize = exports.contextualMenuDropdownWidthDnD = exports.contextualMenuDropdownWidth = exports.columnResizeHandleZIndex = exports.columnControlsZIndex = exports.columnControlsSelectedZIndex = exports.columnControlsDecorationHeight = exports.colorPalletteColumns = exports.TABLE_SNAP_GAP = exports.TABLE_HIGHLIGHT_TOLERANCE = exports.TABLE_HIGHLIGHT_GAP = exports.TABLE_GUIDELINE_VISIBLE_ADJUSTMENT = exports.TABLE_DRAG_MENU_SORT_GROUP_HEIGHT = exports.TABLE_DRAG_MENU_PADDING_TOP = exports.TABLE_DRAG_MENU_MENU_GROUP_BEFORE_HEIGHT = exports.STICKY_HEADER_TOGGLE_TOLERANCE_MS = void 0;
|
|
7
7
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
8
8
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
9
9
|
var _colors = require("@atlaskit/theme/colors");
|
|
@@ -72,6 +72,9 @@ var STICKY_HEADER_TOGGLE_TOLERANCE_MS = exports.STICKY_HEADER_TOGGLE_TOLERANCE_M
|
|
|
72
72
|
// table margins and padding. For example a guideline at 1800px and the view at 1860px wide, means the guidelines is visible
|
|
73
73
|
// BUT it cannot be snapped to during resize due to padding being applied to the resizer wrapper. This accommodates that difference.
|
|
74
74
|
var TABLE_GUIDELINE_VISIBLE_ADJUSTMENT = exports.TABLE_GUIDELINE_VISIBLE_ADJUSTMENT = -68;
|
|
75
|
+
var TABLE_DRAG_MENU_SORT_GROUP_HEIGHT = exports.TABLE_DRAG_MENU_SORT_GROUP_HEIGHT = 92;
|
|
76
|
+
var TABLE_DRAG_MENU_PADDING_TOP = exports.TABLE_DRAG_MENU_PADDING_TOP = 4;
|
|
77
|
+
var TABLE_DRAG_MENU_MENU_GROUP_BEFORE_HEIGHT = exports.TABLE_DRAG_MENU_MENU_GROUP_BEFORE_HEIGHT = 6;
|
|
75
78
|
var dragMenuDropdownWidth = exports.dragMenuDropdownWidth = 250;
|
|
76
79
|
var dragTableInsertColumnButtonSize = exports.dragTableInsertColumnButtonSize = 16;
|
|
77
80
|
var dropTargetExtendedWidth = exports.dropTargetExtendedWidth = 150;
|
package/dist/cjs/ui/ui-styles.js
CHANGED
|
@@ -19,9 +19,12 @@ var InsertLine = function InsertLine(cssString) {
|
|
|
19
19
|
};
|
|
20
20
|
var Marker = function Marker() {
|
|
21
21
|
return (0, _react.css)({
|
|
22
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
22
23
|
backgroundColor: _consts.tableBorderColor,
|
|
23
24
|
position: 'absolute',
|
|
25
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
24
26
|
height: "".concat(_consts.lineMarkerSize, "px"),
|
|
27
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
25
28
|
width: "".concat(_consts.lineMarkerSize, "px"),
|
|
26
29
|
borderRadius: '50%',
|
|
27
30
|
pointerEvents: 'none'
|
|
@@ -61,10 +64,22 @@ var dragCornerControlButton = exports.dragCornerControlButton = function dragCor
|
|
|
61
64
|
return (0, _react.css)(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2.default)(["\n\t.", " {\n\t\twidth: 15px;\n\t\theight: 15px;\n\t\tdisplay: flex;\n\t\tjustify-content: center;\n\t\talign-items: center;\n\t\tposition: absolute;\n\t\ttop: -17px;\n\t\tleft: -5px;\n\t\tbackground-color: transparent;\n\t\tborder: none;\n\t\tpadding: 0;\n\t\toutline: none;\n\t\tz-index: ", ";\n\n\t\t&.active .", " {\n\t\t\tbackground-color: ", ";\n\t\t\twidth: 10px;\n\t\t\theight: 10px;\n\t\t\tborder-width: 2px;\n\t\t\tborder-radius: 4px;\n\n\t\t\ttop: 3px;\n\t\t\tleft: 2px;\n\t\t}\n\n\t\t&:hover {\n\t\t\tcursor: pointer;\n\n\t\t\t.", " {\n\t\t\t\twidth: 10px;\n\t\t\t\theight: 10px;\n\t\t\t\tborder-radius: 4px;\n\t\t\t\ttop: 3px;\n\t\t\t\tleft: 2px;\n\t\t\t}\n\t\t}\n\t}\n\n\t.", " {\n\t\tborder: 1px solid ", ";\n\t\tbackground-color: ", ";\n\t\tborder-radius: 2px;\n\t\twidth: 5px;\n\t\theight: 5px;\n\t\tposition: relative;\n\t}\n"])), _types.TableCssClassName.DRAG_CORNER_BUTTON, _editorSharedStyles.akEditorUnitZIndex * 99, _types.TableCssClassName.DRAG_CORNER_BUTTON_INNER, "var(--ds-border-selected, #0C66E4)", _types.TableCssClassName.DRAG_CORNER_BUTTON_INNER, _types.TableCssClassName.DRAG_CORNER_BUTTON_INNER, "var(--ds-border-inverse, #FFF)", "var(--ds-background-accent-gray-subtler, #DCDFE4)");
|
|
62
65
|
};
|
|
63
66
|
var insertColumnButtonWrapper = exports.insertColumnButtonWrapper = function insertColumnButtonWrapper() {
|
|
64
|
-
return (0, _react.css)(
|
|
67
|
+
return (0, _react.css)(
|
|
68
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
69
|
+
InsertButton(),
|
|
70
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
71
|
+
InsertButtonHover(),
|
|
72
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
73
|
+
InsertLine("\n width: 2px;\n left: 9px;\n "));
|
|
65
74
|
};
|
|
66
75
|
var insertRowButtonWrapper = exports.insertRowButtonWrapper = function insertRowButtonWrapper() {
|
|
67
|
-
return (0, _react.css)(
|
|
76
|
+
return (0, _react.css)(
|
|
77
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
78
|
+
InsertButton(),
|
|
79
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
80
|
+
InsertButtonHover(),
|
|
81
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
82
|
+
InsertLine("\n height: 2px;\n top: -11px;\n// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766\n left: ".concat(_consts.tableInsertColumnButtonSize - 1, "px;\n ")));
|
|
68
83
|
};
|
|
69
84
|
var columnControlsLineMarker = exports.columnControlsLineMarker = function columnControlsLineMarker() {
|
|
70
85
|
return (0, _react.css)(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2.default)(["\n\t.", ".", " table tr:first-of-type td,\n\t.", ".", " table tr:first-of-type th {\n\t\tposition: relative;\n\t}\n"])), _types.TableCssClassName.TABLE_CONTAINER, _types.TableCssClassName.WITH_CONTROLS, _types.TableCssClassName.TABLE_CONTAINER, _types.TableCssClassName.WITH_CONTROLS);
|
|
@@ -82,20 +97,27 @@ var overflowShadowWidhoutDnD = function overflowShadowWidhoutDnD(isDragAndDropEn
|
|
|
82
97
|
};
|
|
83
98
|
var columnHeaderButton = function columnHeaderButton(cssString) {
|
|
84
99
|
return (0, _react.css)({
|
|
100
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
85
101
|
background: _consts.tableHeaderCellBackgroundColor,
|
|
86
102
|
display: 'block',
|
|
87
103
|
boxSizing: 'border-box',
|
|
88
104
|
padding: 0,
|
|
105
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
89
106
|
':focus': {
|
|
90
107
|
outline: 'none'
|
|
91
108
|
}
|
|
92
|
-
},
|
|
109
|
+
},
|
|
110
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
111
|
+
cssString);
|
|
93
112
|
};
|
|
94
113
|
var columnHeaderButtonSelected = function columnHeaderButtonSelected() {
|
|
95
114
|
return (0, _react.css)({
|
|
96
115
|
color: "var(--ds-text-inverse, ".concat(_colors.N0, ")"),
|
|
116
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
97
117
|
backgroundColor: _consts.tableToolbarSelectedColor,
|
|
118
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
98
119
|
borderColor: _consts.tableBorderSelectedColor,
|
|
120
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
99
121
|
zIndex: _consts.columnControlsSelectedZIndex
|
|
100
122
|
});
|
|
101
123
|
};
|
|
@@ -117,6 +139,8 @@ var hoveredDeleteButton = exports.hoveredDeleteButton = function hoveredDeleteBu
|
|
|
117
139
|
var hoveredCell = exports.hoveredCell = function hoveredCell() {
|
|
118
140
|
return (0, _react.css)(_templateObject20 || (_templateObject20 = (0, _taggedTemplateLiteral2.default)(["\n\t:not(.", ")\n\t\t.", ":not(.", ") {\n\t\t.", " {\n\t\t\tposition: relative;\n\t\t\tborder: 1px solid ", ";\n\t\t}\n\t\t.", ".", " {\n\t\t\tposition: relative;\n\t\t\tborder: 1px solid ", ";\n\t\t}\n\t}\n"])), _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.TABLE_CONTAINER, _types.TableCssClassName.HOVERED_DELETE_BUTTON, _types.TableCssClassName.HOVERED_CELL, _consts.tableBorderSelectedColor, _types.TableCssClassName.HOVERED_CELL, _types.TableCssClassName.HOVERED_NO_HIGHLIGHT, _consts.tableBorderColor);
|
|
119
141
|
};
|
|
142
|
+
|
|
143
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
120
144
|
var hoveredWarningCell = exports.hoveredWarningCell = (0, _react.css)(_templateObject21 || (_templateObject21 = (0, _taggedTemplateLiteral2.default)(["\n\t:not(.", ")\n\t\t.", ":not(.", ") {\n\t\ttd.", " {\n\t\t\tbackground-color: ", " !important; // We need to override the background-color added to the cell\n\t\t\tborder: 1px solid ", ";\n\t\t}\n\t}\n"])), _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.TABLE_CONTAINER, _types.TableCssClassName.HOVERED_DELETE_BUTTON, _types.TableCssClassName.HOVERED_CELL_WARNING, "var(--ds-background-warning, ".concat(_colors.Y50, ")"), "var(--ds-border-warning, ".concat(_colors.Y200, ")"));
|
|
121
145
|
|
|
122
146
|
// Explicit pixel values required here to ensure correct positioning and sizes of column resize handle
|
|
@@ -135,22 +159,30 @@ var resizeHandle = exports.resizeHandle = function resizeHandle(isDragAndDropEna
|
|
|
135
159
|
var tableCellColumnInsertLineStyles = (0, _react.css)({
|
|
136
160
|
content: "' '",
|
|
137
161
|
position: 'absolute',
|
|
162
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
138
163
|
height: "calc(100% + ".concat(_styles.tableCellBorderWidth * 2, "px)"),
|
|
164
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
139
165
|
width: "".concat(_consts.insertLineWidth, "px"),
|
|
166
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
140
167
|
zIndex: _consts.columnControlsZIndex * 2
|
|
141
168
|
});
|
|
142
169
|
var tableCellRowInsertLineStyles = (0, _react.css)({
|
|
143
170
|
content: "' '",
|
|
144
171
|
position: 'absolute',
|
|
145
172
|
left: "var(--ds-space-negative-025, -2px)",
|
|
173
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
146
174
|
height: "".concat(_consts.insertLineWidth, "px"),
|
|
175
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
147
176
|
width: "calc(100% + ".concat(_styles.tableCellBorderWidth * 2, "px)"),
|
|
177
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
148
178
|
zIndex: _consts.columnControlsZIndex * 2
|
|
149
179
|
});
|
|
150
180
|
var insertLineActiveColor = (0, _react.css)({
|
|
181
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
151
182
|
backgroundColor: _consts.tableBorderSelectedColor
|
|
152
183
|
});
|
|
153
184
|
var insertLineInactiveColor = (0, _react.css)({
|
|
185
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
154
186
|
backgroundColor: "var(--ds-background-accent-gray-subtler, ".concat(_editorSharedStyles.akEditorTableBorder, ")")
|
|
155
187
|
});
|
|
156
188
|
|
|
@@ -81,6 +81,8 @@ var getDragMenuConfig = exports.getDragMenuConfig = function getDragMenuConfig(d
|
|
|
81
81
|
var tableDuplicateCellColouring = arguments.length > 12 && arguments[12] !== undefined ? arguments[12] : false;
|
|
82
82
|
var isTableFixedColumnWidthsOptionEnabled = arguments.length > 13 && arguments[13] !== undefined ? arguments[13] : false;
|
|
83
83
|
var shouldUseIncreasedScalingPercent = arguments.length > 14 && arguments[14] !== undefined ? arguments[14] : false;
|
|
84
|
+
var tableSortColumnDiscoverability = arguments.length > 15 && arguments[15] !== undefined ? arguments[15] : false;
|
|
85
|
+
var selection = editorView.state.selection;
|
|
84
86
|
var addOptions = direction === 'row' ? [{
|
|
85
87
|
label: 'above',
|
|
86
88
|
offset: 0,
|
|
@@ -102,7 +104,6 @@ var getDragMenuConfig = exports.getDragMenuConfig = function getDragMenuConfig(d
|
|
|
102
104
|
icon: _icons.AddColRightIcon,
|
|
103
105
|
keymap: _keymaps.addColumnAfter
|
|
104
106
|
}];
|
|
105
|
-
var selection = editorView.state.selection;
|
|
106
107
|
var moveOptions = direction === 'row' ? [{
|
|
107
108
|
label: 'up',
|
|
108
109
|
icon: _arrowUp.default,
|
|
@@ -149,11 +150,26 @@ var getDragMenuConfig = exports.getDragMenuConfig = function getDragMenuConfig(d
|
|
|
149
150
|
order: _customSteps.TableSortOrder.DESC,
|
|
150
151
|
icon: _chevronDoubleDown.default
|
|
151
152
|
}] : [];
|
|
152
|
-
|
|
153
|
+
var sortConfigs = (0, _toConsumableArray2.default)(sortOptions.map(function (_ref) {
|
|
153
154
|
var label = _ref.label,
|
|
154
|
-
|
|
155
|
-
icon = _ref.icon
|
|
156
|
-
|
|
155
|
+
order = _ref.order,
|
|
156
|
+
icon = _ref.icon;
|
|
157
|
+
return {
|
|
158
|
+
id: "sort_column_".concat(order),
|
|
159
|
+
title: "Sort ".concat(label),
|
|
160
|
+
disabled: hasMergedCellsInTable,
|
|
161
|
+
icon: icon,
|
|
162
|
+
onClick: function onClick(state, dispatch) {
|
|
163
|
+
(0, _commandsWithAnalytics.sortColumnWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.TABLE_CONTEXT_MENU, index !== null && index !== void 0 ? index : 0, order)(state, dispatch);
|
|
164
|
+
return true;
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
}));
|
|
168
|
+
var restConfigs = [].concat((0, _toConsumableArray2.default)(addOptions.map(function (_ref2) {
|
|
169
|
+
var label = _ref2.label,
|
|
170
|
+
offset = _ref2.offset,
|
|
171
|
+
icon = _ref2.icon,
|
|
172
|
+
keymap = _ref2.keymap;
|
|
157
173
|
return {
|
|
158
174
|
id: "add_".concat(direction, "_").concat(label),
|
|
159
175
|
title: "Add ".concat(direction, " ").concat(label),
|
|
@@ -210,13 +226,13 @@ var getDragMenuConfig = exports.getDragMenuConfig = function getDragMenuConfig(d
|
|
|
210
226
|
},
|
|
211
227
|
icon: _remove.default,
|
|
212
228
|
keymap: direction === 'row' ? (0, _keymaps.tooltip)(_keymaps.deleteRow) : (0, _keymaps.tooltip)(_keymaps.deleteColumn)
|
|
213
|
-
}], (0, _toConsumableArray2.default)(moveOptions.map(function (
|
|
214
|
-
var label =
|
|
215
|
-
canMove =
|
|
216
|
-
icon =
|
|
217
|
-
keymap =
|
|
218
|
-
getOriginIndexes =
|
|
219
|
-
getTargetIndex =
|
|
229
|
+
}], (0, _toConsumableArray2.default)(moveOptions.map(function (_ref3) {
|
|
230
|
+
var label = _ref3.label,
|
|
231
|
+
canMove = _ref3.canMove,
|
|
232
|
+
icon = _ref3.icon,
|
|
233
|
+
keymap = _ref3.keymap,
|
|
234
|
+
getOriginIndexes = _ref3.getOriginIndexes,
|
|
235
|
+
getTargetIndex = _ref3.getTargetIndex;
|
|
220
236
|
return {
|
|
221
237
|
id: "move_".concat(direction, "_").concat(label),
|
|
222
238
|
title: "Move ".concat(direction, " ").concat(label),
|
|
@@ -233,19 +249,8 @@ var getDragMenuConfig = exports.getDragMenuConfig = function getDragMenuConfig(d
|
|
|
233
249
|
},
|
|
234
250
|
keymap: keymap && (0, _keymaps.tooltip)(keymap)
|
|
235
251
|
};
|
|
236
|
-
}))
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
return {
|
|
241
|
-
id: "sort_column_".concat(order),
|
|
242
|
-
title: "Sort ".concat(label),
|
|
243
|
-
disabled: hasMergedCellsInTable,
|
|
244
|
-
icon: icon,
|
|
245
|
-
onClick: function onClick(state, dispatch) {
|
|
246
|
-
(0, _commandsWithAnalytics.sortColumnWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.TABLE_CONTEXT_MENU, index !== null && index !== void 0 ? index : 0, order)(state, dispatch);
|
|
247
|
-
return true;
|
|
248
|
-
}
|
|
249
|
-
};
|
|
250
|
-
}))).filter(Boolean);
|
|
252
|
+
})));
|
|
253
|
+
var allConfigs = (0, _toConsumableArray2.default)(restConfigs);
|
|
254
|
+
tableSortColumnDiscoverability ? allConfigs.unshift.apply(allConfigs, (0, _toConsumableArray2.default)(sortConfigs)) : allConfigs.push.apply(allConfigs, (0, _toConsumableArray2.default)(sortConfigs));
|
|
255
|
+
return allConfigs.filter(Boolean);
|
|
251
256
|
};
|
|
@@ -43,10 +43,11 @@ export const ExternalDropTargets = ({
|
|
|
43
43
|
overflow: 'hidden',
|
|
44
44
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
45
45
|
position: 'absolute',
|
|
46
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
46
|
+
// 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
|
|
47
47
|
top: `-${dropTargetExtendedWidth - tableMarginTop}px`,
|
|
48
48
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
49
49
|
pointerEvents: 'auto',
|
|
50
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
50
51
|
zIndex: `${dropTargetsZIndex}`
|
|
51
52
|
},
|
|
52
53
|
"data-testid": "table-floating-column-extended-drop-targets"
|
|
@@ -209,6 +209,7 @@ export const TableResizer = ({
|
|
|
209
209
|
tableLocalId: node.attrs.localId,
|
|
210
210
|
tableRef: tableRef
|
|
211
211
|
});
|
|
212
|
+
tr.setMeta('is-resizer-resizing', true);
|
|
212
213
|
tr.setMeta(META_KEYS.OVERFLOW_TRIGGER, {
|
|
213
214
|
name: TABLE_OVERFLOW_CHANGE_TRIGGER.RESIZED
|
|
214
215
|
});
|
|
@@ -276,6 +277,7 @@ export const TableResizer = ({
|
|
|
276
277
|
tableLocalId: '',
|
|
277
278
|
tableRef: null
|
|
278
279
|
});
|
|
280
|
+
tr.setMeta('is-resizer-resizing', false);
|
|
279
281
|
const frameRateSamples = endMeasure();
|
|
280
282
|
if (frameRateSamples.length > 0) {
|
|
281
283
|
const resizeFrameRatePayloads = generateResizeFrameRatePayloads({
|
package/dist/es2019/plugin.js
CHANGED
|
@@ -433,37 +433,40 @@ const tablesPlugin = ({
|
|
|
433
433
|
pluginsOptions: {
|
|
434
434
|
quickInsert: ({
|
|
435
435
|
formatMessage
|
|
436
|
-
}) =>
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
436
|
+
}) => {
|
|
437
|
+
var _options$getEditorFea3;
|
|
438
|
+
return [{
|
|
439
|
+
id: 'table',
|
|
440
|
+
title: formatMessage(messages.table),
|
|
441
|
+
description: formatMessage(messages.tableDescription),
|
|
442
|
+
keywords: ['cell', 'table'],
|
|
443
|
+
priority: options !== null && options !== void 0 && (_options$getEditorFea3 = options.getEditorFeatureFlags) !== null && _options$getEditorFea3 !== void 0 && _options$getEditorFea3.call(options).platformEditorTypeaheadImprovedRelevancy ? 800 : 600,
|
|
444
|
+
keyshortcut: tooltip(toggleTable),
|
|
445
|
+
icon: () => /*#__PURE__*/React.createElement(IconTable, null),
|
|
446
|
+
action(insert, state) {
|
|
447
|
+
var _api$table;
|
|
448
|
+
// see comment on tablesPlugin.getSharedState on usage
|
|
449
|
+
const tableState = api === null || api === void 0 ? void 0 : (_api$table = api.table) === null || _api$table === void 0 ? void 0 : _api$table.sharedState.currentState();
|
|
450
|
+
const tableNode = createTableWithWidth({
|
|
451
|
+
isTableScalingEnabled: options === null || options === void 0 ? void 0 : options.isTableScalingEnabled,
|
|
452
|
+
isTableAlignmentEnabled: options === null || options === void 0 ? void 0 : options.isTableAlignmentEnabled,
|
|
453
|
+
isFullWidthModeEnabled: tableState === null || tableState === void 0 ? void 0 : tableState.isFullWidthModeEnabled
|
|
454
|
+
})(state.schema);
|
|
455
|
+
const tr = insert(tableNode);
|
|
456
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent({
|
|
457
|
+
action: ACTION.INSERTED,
|
|
458
|
+
actionSubject: ACTION_SUBJECT.DOCUMENT,
|
|
459
|
+
actionSubjectId: ACTION_SUBJECT_ID.TABLE,
|
|
460
|
+
attributes: {
|
|
461
|
+
inputMethod: INPUT_METHOD.QUICK_INSERT,
|
|
462
|
+
localId: tableNode.attrs.localId
|
|
463
|
+
},
|
|
464
|
+
eventType: EVENT_TYPE.TRACK
|
|
465
|
+
})(tr);
|
|
466
|
+
return tr;
|
|
467
|
+
}
|
|
468
|
+
}];
|
|
469
|
+
},
|
|
467
470
|
floatingToolbar: getToolbarConfig(defaultGetEditorContainerWidth, editorAnalyticsAPI, (options === null || options === void 0 ? void 0 : options.getEditorFeatureFlags) || defaultGetEditorFeatureFlags, () => editorViewRef.current, options, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent)(pluginConfig(options === null || options === void 0 ? void 0 : options.tableOptions))
|
|
468
471
|
}
|
|
469
472
|
};
|
|
@@ -6,7 +6,7 @@ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
|
6
6
|
import { stopKeyboardColumnResizing } from '../../commands/column-resize';
|
|
7
7
|
import { updateResizeHandleDecorations } from '../../commands/misc';
|
|
8
8
|
import { updateColumnWidths } from '../../transforms';
|
|
9
|
-
import { getSelectedColumnIndexes } from '../../utils';
|
|
9
|
+
import { getSelectedColumnIndexes, isTableNested } from '../../utils';
|
|
10
10
|
import { getPluginState as getTablePluginState } from '../plugin-factory';
|
|
11
11
|
import { META_KEYS } from '../table-analytics';
|
|
12
12
|
import { evenColumns, setDragging, stopResizing } from './commands';
|
|
@@ -154,7 +154,7 @@ export const handleMouseDown = (view, event, localResizeHandlePos, getEditorCont
|
|
|
154
154
|
shouldScale = shouldScale && originalTable.attrs.displayMode !== 'fixed';
|
|
155
155
|
}
|
|
156
156
|
const resizedDelta = clientX - startX;
|
|
157
|
-
if (getBooleanFF('platform.editor.table.colum-resizing-improvements')) {
|
|
157
|
+
if (getBooleanFF('platform.editor.table.colum-resizing-improvements') && !isTableNested(state, tablePos)) {
|
|
158
158
|
const newResizeState = resizeColumnAndTable(resizeState, colIndex, clientX - startX, dom, originalTable, resizingSelectedColumns ? selectedColumns : undefined, shouldScale);
|
|
159
159
|
tr = updateColumnWidths(newResizeState, table, start)(tr);
|
|
160
160
|
tr.setNodeAttribute(start - 1, 'width', newResizeState.tableWidth);
|
|
@@ -237,7 +237,7 @@ export const handleMouseDown = (view, event, localResizeHandlePos, getEditorCont
|
|
|
237
237
|
if (isTableScalingWithFixedColumnWidthsOptionEnabled) {
|
|
238
238
|
shouldScale = shouldScale && originalTable.attrs.displayMode !== 'fixed';
|
|
239
239
|
}
|
|
240
|
-
if (getBooleanFF('platform.editor.table.colum-resizing-improvements')) {
|
|
240
|
+
if (getBooleanFF('platform.editor.table.colum-resizing-improvements') && !isTableNested(state, tablePos)) {
|
|
241
241
|
resizeColumnAndTable(resizeState, colIndex, clientX - dragging.startX, dom, table, undefined, shouldScale, undefined, shouldUseIncreasedScalingPercent);
|
|
242
242
|
} else {
|
|
243
243
|
resizeColumn(resizeState, colIndex, clientX - dragging.startX, dom, table, undefined, shouldScale, shouldUseIncreasedScalingPercent);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Resize a given column by an amount from the current state
|
|
2
2
|
|
|
3
3
|
import { TableCssClassName as ClassName } from '../../../types';
|
|
4
|
+
import { ALIGN_START } from '../../../utils/alignment';
|
|
4
5
|
import { getTableContainerElementWidth, getTableScalingPercent } from './misc';
|
|
5
6
|
import { growColumn, shrinkColumn, updateAffectedColumn } from './resize-logic';
|
|
6
7
|
import { updateColgroup } from './resize-state';
|
|
@@ -23,7 +24,7 @@ export const resizeColumnAndTable = (resizeState, colIndex, amount, tableRef, ta
|
|
|
23
24
|
const tableWidth = tableRef.clientWidth;
|
|
24
25
|
const tableContainerWidth = (_tableRef$closest = tableRef.closest('.pm-table-container')) === null || _tableRef$closest === void 0 ? void 0 : _tableRef$closest.clientWidth;
|
|
25
26
|
const isOverflowed = !!(tableWidth && tableContainerWidth && tableWidth > tableContainerWidth);
|
|
26
|
-
let resizeAmount = amount * 2;
|
|
27
|
+
let resizeAmount = tableNode.attrs.layout === ALIGN_START && !isOverflowed ? amount : amount * 2;
|
|
27
28
|
|
|
28
29
|
// todo: reimplement - use getTableScalingPercentFrozen to get scaled percent before table width changes dynamically
|
|
29
30
|
// let scalePercent = 1;
|
package/dist/es2019/toolbar.js
CHANGED
|
@@ -136,6 +136,7 @@ export const getToolbarCellOptionsConfig = (editorState, editorView, initialSele
|
|
|
136
136
|
},
|
|
137
137
|
selected: false,
|
|
138
138
|
disabled: false,
|
|
139
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
139
140
|
elemAfter: jsx("div", {
|
|
140
141
|
css: shortcutStyle
|
|
141
142
|
}, tooltip(addColumnAfter))
|
|
@@ -155,6 +156,7 @@ export const getToolbarCellOptionsConfig = (editorState, editorView, initialSele
|
|
|
155
156
|
},
|
|
156
157
|
selected: false,
|
|
157
158
|
disabled: false,
|
|
159
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
158
160
|
elemAfter: jsx("div", {
|
|
159
161
|
css: shortcutStyle
|
|
160
162
|
}, tooltip(addRowAfter))
|
|
@@ -288,6 +290,7 @@ export const getToolbarCellOptionsConfig = (editorState, editorView, initialSele
|
|
|
288
290
|
},
|
|
289
291
|
selected: false,
|
|
290
292
|
disabled: false,
|
|
293
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
291
294
|
elemAfter: jsx("div", {
|
|
292
295
|
css: shortcutStyle
|
|
293
296
|
}, tooltip(backspace))
|
|
@@ -154,10 +154,14 @@ const DragHandleComponent = ({
|
|
|
154
154
|
className: ClassName.DRAG_HANDLE_BUTTON_CLICKABLE_ZONE,
|
|
155
155
|
"data-testid": "table-drag-handle-clickable-zone-button",
|
|
156
156
|
style: {
|
|
157
|
-
height: isRow ?
|
|
157
|
+
height: isRow ?
|
|
158
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
159
|
+
`calc(100% - ${dragTableInsertColumnButtonSize}px)` : `${"var(--ds-space-200, 16px)"}`,
|
|
158
160
|
// 16px here because it's the size of drag handle button's large side
|
|
159
161
|
width: isRow ? `${"var(--ds-space-200, 16px)"}` // 16px here because it's the size of drag handle button's large side
|
|
160
|
-
:
|
|
162
|
+
:
|
|
163
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
164
|
+
`calc(100% - ${dragTableInsertColumnButtonSize}px)`,
|
|
161
165
|
left: isRow ? `${"var(--ds-space-050, 4px)"}` : undefined,
|
|
162
166
|
bottom: isColumn ? `${"var(--ds-space-0, 0px)"}` : undefined,
|
|
163
167
|
alignSelf: isColumn ? 'none' : 'center',
|
|
@@ -112,7 +112,7 @@ export const FixedButton = ({
|
|
|
112
112
|
position: 'fixed',
|
|
113
113
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
114
114
|
top: stickyHeader.top + stickyHeader.padding + offset * 2,
|
|
115
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
115
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
116
116
|
zIndex: akEditorTableCellOnStickyHeaderZIndex,
|
|
117
117
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
118
118
|
left: calcLeftPos({
|
|
@@ -51,7 +51,11 @@ const FloatingContextualButtonInner = /*#__PURE__*/React.memo(props => {
|
|
|
51
51
|
}
|
|
52
52
|
const labelCellOptions = formatMessage(messages.cellOptions);
|
|
53
53
|
const button = jsx("div", {
|
|
54
|
-
css: [
|
|
54
|
+
css: [
|
|
55
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
56
|
+
tableFloatingCellButtonStyles(),
|
|
57
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
58
|
+
isContextualMenuOpen && tableFloatingCellButtonSelectedStyles()]
|
|
55
59
|
}, jsx(ToolbarButton
|
|
56
60
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
57
61
|
, {
|
|
@@ -2,14 +2,17 @@ import { css } from '@emotion/react';
|
|
|
2
2
|
import { N0, N20, N30A, N700 } from '@atlaskit/theme/colors';
|
|
3
3
|
import { contextualMenuTriggerSize } from '../consts';
|
|
4
4
|
export const tableFloatingCellButtonStyles = () => css({
|
|
5
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
5
6
|
'> div': {
|
|
6
7
|
// Sits behind button to provide surface-color background
|
|
7
8
|
background: `var(--ds-surface, ${N20})`,
|
|
8
9
|
borderRadius: "var(--ds-border-radius, 3px)",
|
|
9
10
|
display: 'flex',
|
|
11
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
10
12
|
height: `${contextualMenuTriggerSize + 2}px`,
|
|
11
13
|
flexDirection: 'column'
|
|
12
14
|
},
|
|
15
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
13
16
|
'&& button': {
|
|
14
17
|
background: "var(--ds-background-neutral, none)",
|
|
15
18
|
flexDirection: 'column',
|
|
@@ -20,26 +23,33 @@ export const tableFloatingCellButtonStyles = () => css({
|
|
|
20
23
|
height: 'calc(100% - 4px)',
|
|
21
24
|
display: 'flex'
|
|
22
25
|
},
|
|
26
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
23
27
|
'&& button:hover': {
|
|
24
28
|
background: `var(--ds-background-neutral-hovered, ${N30A})`
|
|
25
29
|
},
|
|
30
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
26
31
|
'&& button:active': {
|
|
27
32
|
background: "var(--ds-background-neutral-pressed, rgba(179, 212, 255, 0.6))"
|
|
28
33
|
},
|
|
34
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
29
35
|
'&& button > span': {
|
|
30
36
|
margin: `0px ${"var(--ds-space-negative-050, -4px)"}`
|
|
31
37
|
},
|
|
38
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
32
39
|
'&& span': {
|
|
33
40
|
pointerEvents: 'none'
|
|
34
41
|
}
|
|
35
42
|
});
|
|
36
43
|
export const tableFloatingCellButtonSelectedStyles = () => css({
|
|
44
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
37
45
|
'&& button': {
|
|
38
46
|
background: `var(--ds-background-selected, ${N700})`
|
|
39
47
|
},
|
|
48
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
40
49
|
'&& button:hover': {
|
|
41
50
|
background: `var(--ds-background-selected-hovered, ${N700})`
|
|
42
51
|
},
|
|
52
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
43
53
|
'&& button:active': {
|
|
44
54
|
background: `var(--ds-background-selected-pressed, ${N700})`
|
|
45
55
|
}
|