@atlaskit/editor-plugin-table 5.6.6 → 5.7.0
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 +13 -0
- package/dist/cjs/types.js +1 -0
- package/dist/cjs/ui/FloatingContextualButton/index.js +1 -7
- package/dist/cjs/ui/FloatingContextualButton/styles.js +5 -25
- package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +238 -99
- package/dist/cjs/ui/FloatingContextualMenu/styles.js +1 -2
- package/dist/cjs/ui/TableFloatingControls/NumberColumn/index.js +1 -1
- package/dist/cjs/ui/common-styles.js +7 -7
- package/dist/cjs/ui/consts.js +16 -63
- package/dist/cjs/ui/icons/MergeCellsIcon.js +34 -0
- package/dist/cjs/ui/icons/SplitCellIcon.js +41 -0
- package/dist/cjs/ui/icons/index.js +14 -0
- package/dist/cjs/ui/ui-styles.js +47 -48
- package/dist/es2019/types.js +1 -0
- package/dist/es2019/ui/FloatingContextualButton/index.js +1 -5
- package/dist/es2019/ui/FloatingContextualButton/styles.js +10 -31
- package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +248 -71
- package/dist/es2019/ui/FloatingContextualMenu/styles.js +22 -3
- package/dist/es2019/ui/TableFloatingControls/NumberColumn/index.js +1 -1
- package/dist/es2019/ui/common-styles.js +59 -59
- package/dist/es2019/ui/consts.js +18 -64
- package/dist/es2019/ui/icons/MergeCellsIcon.js +25 -0
- package/dist/es2019/ui/icons/SplitCellIcon.js +32 -0
- package/dist/es2019/ui/icons/index.js +2 -0
- package/dist/es2019/ui/ui-styles.js +98 -99
- package/dist/esm/types.js +1 -0
- package/dist/esm/ui/FloatingContextualButton/index.js +1 -7
- package/dist/esm/ui/FloatingContextualButton/styles.js +5 -26
- package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +238 -98
- package/dist/esm/ui/FloatingContextualMenu/styles.js +1 -2
- package/dist/esm/ui/TableFloatingControls/NumberColumn/index.js +1 -1
- package/dist/esm/ui/common-styles.js +7 -7
- package/dist/esm/ui/consts.js +18 -64
- package/dist/esm/ui/icons/MergeCellsIcon.js +27 -0
- package/dist/esm/ui/icons/SplitCellIcon.js +34 -0
- package/dist/esm/ui/icons/index.js +2 -0
- package/dist/esm/ui/ui-styles.js +47 -48
- package/dist/types/types.d.ts +1 -0
- package/dist/types/ui/FloatingContextualButton/styles.d.ts +2 -3
- package/dist/types/ui/FloatingContextualMenu/ContextualMenu.d.ts +12 -2
- package/dist/types/ui/common-styles.d.ts +1 -2
- package/dist/types/ui/consts.d.ts +15 -15
- package/dist/types/ui/icons/MergeCellsIcon.d.ts +2 -0
- package/dist/types/ui/icons/SplitCellIcon.d.ts +2 -0
- package/dist/types/ui/icons/index.d.ts +2 -0
- package/dist/types/ui/ui-styles.d.ts +17 -18
- package/dist/types-ts4.5/types.d.ts +1 -0
- package/dist/types-ts4.5/ui/FloatingContextualButton/styles.d.ts +2 -3
- package/dist/types-ts4.5/ui/FloatingContextualMenu/ContextualMenu.d.ts +12 -2
- package/dist/types-ts4.5/ui/common-styles.d.ts +1 -2
- package/dist/types-ts4.5/ui/consts.d.ts +15 -15
- package/dist/types-ts4.5/ui/icons/MergeCellsIcon.d.ts +2 -0
- package/dist/types-ts4.5/ui/icons/SplitCellIcon.d.ts +2 -0
- package/dist/types-ts4.5/ui/icons/index.d.ts +2 -0
- package/dist/types-ts4.5/ui/ui-styles.d.ts +17 -18
- package/package.json +12 -5
- package/src/types.ts +1 -0
- package/src/ui/FloatingContextualButton/index.tsx +3 -5
- package/src/ui/FloatingContextualButton/styles.ts +13 -35
- package/src/ui/FloatingContextualMenu/ContextualMenu.tsx +316 -68
- package/src/ui/FloatingContextualMenu/styles.ts +22 -3
- package/src/ui/TableFloatingControls/NumberColumn/index.tsx +1 -1
- package/src/ui/common-styles.ts +57 -69
- package/src/ui/consts.ts +52 -73
- package/src/ui/icons/MergeCellsIcon.tsx +32 -0
- package/src/ui/icons/SplitCellIcon.tsx +40 -0
- package/src/ui/icons/index.ts +2 -0
- package/src/ui/ui-styles.ts +94 -106
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 5.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#62416](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/62416) [`9f3c36680d89`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9f3c36680d89) - [ux] Updated table context menu styling.
|
|
8
|
+
|
|
9
|
+
## 5.6.7
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#61923](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/61923) [`04e38cfe9e90`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/04e38cfe9e90) - Remove legacy theming logic from all Editor plugin packages. Theming is still available via the @atlaskit/tokens package.
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
3
16
|
## 5.6.6
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/cjs/types.js
CHANGED
|
@@ -130,6 +130,7 @@ var TableCssClassName = exports.TableCssClassName = _objectSpread(_objectSpread(
|
|
|
130
130
|
CONTEXTUAL_MENU_BUTTON: "".concat(_adfSchema.tablePrefixSelector, "-contextual-menu-button"),
|
|
131
131
|
CONTEXTUAL_MENU_BUTTON_FIXED: "".concat(_adfSchema.tablePrefixSelector, "-contextual-menu-button-fixed"),
|
|
132
132
|
CONTEXTUAL_MENU_ICON: "".concat(_adfSchema.tablePrefixSelector, "-contextual-submenu-icon"),
|
|
133
|
+
CONTEXTUAL_MENU_ICON_SMALL: "".concat(_adfSchema.tablePrefixSelector, "-contextual-submenu-icon-small"),
|
|
133
134
|
// come from prosemirror-table
|
|
134
135
|
SELECTED_CELL: 'selectedCell',
|
|
135
136
|
// defined in ReactNodeView based on PM node name
|
|
@@ -53,13 +53,7 @@ var FloatingContextualButtonInner = /*#__PURE__*/_react.default.memo(function (p
|
|
|
53
53
|
}
|
|
54
54
|
var labelCellOptions = formatMessage(_messages.tableMessages.cellOptions);
|
|
55
55
|
var button = (0, _react2.jsx)("div", {
|
|
56
|
-
css:
|
|
57
|
-
return [(0, _styles.tableFloatingCellButtonStyles)({
|
|
58
|
-
theme: theme
|
|
59
|
-
}), isContextualMenuOpen && (0, _styles.tableFloatingCellButtonSelectedStyles)({
|
|
60
|
-
theme: theme
|
|
61
|
-
})];
|
|
62
|
-
}
|
|
56
|
+
css: [(0, _styles.tableFloatingCellButtonStyles)(), isContextualMenuOpen && (0, _styles.tableFloatingCellButtonSelectedStyles)()]
|
|
63
57
|
}, (0, _react2.jsx)(_uiMenu.ToolbarButton, {
|
|
64
58
|
className: _types.TableCssClassName.CONTEXTUAL_MENU_BUTTON,
|
|
65
59
|
selected: isContextualMenuOpen,
|
|
@@ -8,31 +8,11 @@ exports.tableFloatingCellButtonStyles = exports.tableFloatingCellButtonSelectedS
|
|
|
8
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
9
|
var _react = require("@emotion/react");
|
|
10
10
|
var _colors = require("@atlaskit/theme/colors");
|
|
11
|
-
var _components = require("@atlaskit/theme/components");
|
|
12
|
-
var _constants = require("@atlaskit/theme/constants");
|
|
13
11
|
var _consts = require("../consts");
|
|
14
|
-
var _templateObject, _templateObject2;
|
|
15
|
-
var tableFloatingCellButtonStyles = exports.tableFloatingCellButtonStyles = function tableFloatingCellButtonStyles(
|
|
16
|
-
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n > div {\n // Sits behind button to provide surface-color background\n background: ", ";\n border-radius: ", "
|
|
17
|
-
light: "var(--ds-background-neutral, none)",
|
|
18
|
-
dark: "var(--ds-background-neutral, none)"
|
|
19
|
-
})(props), "var(--ds-space-025, 2px)", "var(--ds-surface, ".concat(_colors.N0, ")"), (0, _components.themed)({
|
|
20
|
-
light: "var(--ds-background-neutral-hovered, ".concat(_colors.N30A, ")"),
|
|
21
|
-
dark: "var(--ds-background-neutral-hovered, ".concat(_colors.DN60, ")")
|
|
22
|
-
})(props), (0, _components.themed)({
|
|
23
|
-
light: "var(--ds-background-neutral-pressed, rgba(179, 212, 255, 0.6))",
|
|
24
|
-
dark: "var(--ds-background-neutral-pressed, ".concat(_colors.B75, ")")
|
|
25
|
-
})(props), "var(--ds-space-negative-050, -4px)");
|
|
12
|
+
var _templateObject, _templateObject2;
|
|
13
|
+
var tableFloatingCellButtonStyles = exports.tableFloatingCellButtonStyles = function tableFloatingCellButtonStyles() {
|
|
14
|
+
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n > div {\n // Sits behind button to provide surface-color background\n background: ", ";\n border-radius: ", ";\n display: flex;\n height: ", "px;\n flex-direction: column;\n }\n && button {\n background: ", ";\n flex-direction: column;\n margin: ", ";\n outline: 2px solid ", ";\n border-radius: 1px;\n padding: 0;\n height: calc(100% - 4px);\n display: flex;\n }\n && button:hover {\n background: ", ";\n }\n && button:active {\n background: ", ";\n }\n && button > span {\n margin: 0px ", ";\n }\n && span {\n pointer-events: none;\n }\n"])), "var(--ds-surface, ".concat(_colors.N20, ")"), "var(--ds-border-radius, 3px)", _consts.contextualMenuTriggerSize + 2, "var(--ds-background-neutral, none)", "var(--ds-space-025, 2px)", "var(--ds-surface, ".concat(_colors.N0, ")"), "var(--ds-background-neutral-hovered, ".concat(_colors.N30A, ")"), "var(--ds-background-neutral-pressed, rgba(179, 212, 255, 0.6))", "var(--ds-space-negative-050, -4px)");
|
|
26
15
|
};
|
|
27
|
-
var tableFloatingCellButtonSelectedStyles = exports.tableFloatingCellButtonSelectedStyles = function tableFloatingCellButtonSelectedStyles(
|
|
28
|
-
return (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n && button {\n background: ", ";\n }\n && button:hover {\n background: ", ";\n }\n && button:active {\n background: ", ";\n }\n"])), (
|
|
29
|
-
light: "var(--ds-background-selected, ".concat(_colors.N700, ")"),
|
|
30
|
-
dark: "var(--ds-background-selected, ".concat(_colors.DN0, ")")
|
|
31
|
-
})(props), (0, _components.themed)({
|
|
32
|
-
light: "var(--ds-background-selected-hovered, ".concat(_colors.N700, ")"),
|
|
33
|
-
dark: "var(--ds-background-selected-hovered, ".concat(_colors.DN0, ")")
|
|
34
|
-
})(props), (0, _components.themed)({
|
|
35
|
-
light: "var(--ds-background-selected-pressed, ".concat(_colors.N700, ")"),
|
|
36
|
-
dark: "var(--ds-background-selected-pressed, ".concat(_colors.DN0, ")")
|
|
37
|
-
})(props));
|
|
16
|
+
var tableFloatingCellButtonSelectedStyles = exports.tableFloatingCellButtonSelectedStyles = function tableFloatingCellButtonSelectedStyles() {
|
|
17
|
+
return (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n && button {\n background: ", ";\n }\n && button:hover {\n background: ", ";\n }\n && button:active {\n background: ", ";\n }\n"])), "var(--ds-background-selected, ".concat(_colors.N700, ")"), "var(--ds-background-selected-hovered, ".concat(_colors.N700, ")"), "var(--ds-background-selected-pressed, ".concat(_colors.N700, ")"));
|
|
38
18
|
};
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = exports.ContextualMenu = void 0;
|
|
8
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
8
9
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
10
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
11
|
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
@@ -26,6 +27,10 @@ var _utils = require("@atlaskit/editor-common/utils");
|
|
|
26
27
|
var _editorPalette = require("@atlaskit/editor-palette");
|
|
27
28
|
var _shortcut = require("@atlaskit/editor-shared-styles/shortcut");
|
|
28
29
|
var _utils2 = require("@atlaskit/editor-tables/utils");
|
|
30
|
+
var _crossCircle = _interopRequireDefault(require("@atlaskit/icon/glyph/cross-circle"));
|
|
31
|
+
var _backgroundColor = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/background-color"));
|
|
32
|
+
var _remove = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/remove"));
|
|
33
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
29
34
|
var _commands = require("../../commands");
|
|
30
35
|
var _commandsWithAnalytics = require("../../commands-with-analytics");
|
|
31
36
|
var _pluginFactory = require("../../pm-plugins/plugin-factory");
|
|
@@ -34,11 +39,12 @@ var _transforms = require("../../transforms");
|
|
|
34
39
|
var _types = require("../../types");
|
|
35
40
|
var _utils3 = require("../../utils");
|
|
36
41
|
var _consts = require("../consts");
|
|
42
|
+
var _icons = require("../icons");
|
|
37
43
|
var _styles2 = require("./styles");
|
|
38
44
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
39
45
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
40
46
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
41
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */
|
|
47
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /* eslint-disable @atlaskit/design-system/prefer-primitives */ /** @jsx jsx */
|
|
42
48
|
var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
43
49
|
(0, _inherits2.default)(ContextualMenu, _Component);
|
|
44
50
|
var _super = _createSuper(ContextualMenu);
|
|
@@ -63,36 +69,35 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
63
69
|
ref.style.left = "-".concat(rect.width, "px");
|
|
64
70
|
}
|
|
65
71
|
});
|
|
66
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "
|
|
72
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "createBackgroundColorItem", function () {
|
|
67
73
|
var _this$props = _this.props,
|
|
68
|
-
allowMergeCells = _this$props.allowMergeCells,
|
|
69
|
-
allowColumnSorting = _this$props.allowColumnSorting,
|
|
70
74
|
allowBackgroundColor = _this$props.allowBackgroundColor,
|
|
71
75
|
state = _this$props.editorView.state,
|
|
72
76
|
isOpen = _this$props.isOpen,
|
|
73
|
-
selectionRect = _this$props.selectionRect,
|
|
74
77
|
formatMessage = _this$props.intl.formatMessage,
|
|
75
78
|
editorView = _this$props.editorView;
|
|
76
|
-
var items = [];
|
|
77
79
|
var isSubmenuOpen = _this.state.isSubmenuOpen;
|
|
78
|
-
// TargetCellPosition could be outdated: https://product-fabric.atlassian.net/browse/ED-8129
|
|
79
80
|
var _getPluginState = (0, _pluginFactory.getPluginState)(editorView.state),
|
|
80
81
|
targetCellPosition = _getPluginState.targetCellPosition,
|
|
81
|
-
|
|
82
|
+
isDragAndDropEnabled = _getPluginState.isDragAndDropEnabled;
|
|
82
83
|
if (allowBackgroundColor) {
|
|
83
84
|
var _node$attrs;
|
|
84
85
|
var node = isOpen && targetCellPosition ? state.doc.nodeAt(targetCellPosition) : null;
|
|
85
86
|
var background = (0, _editorPalette.hexToEditorBackgroundPaletteColor)((node === null || node === void 0 || (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.background) || '#ffffff');
|
|
86
|
-
|
|
87
|
-
content: formatMessage(_messages.tableMessages.cellBackground),
|
|
87
|
+
return {
|
|
88
|
+
content: isDragAndDropEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.new-cell-context-menu-styling') ? formatMessage(_messages.tableMessages.backgroundColor) : formatMessage(_messages.tableMessages.cellBackground),
|
|
88
89
|
value: {
|
|
89
90
|
name: 'background'
|
|
90
91
|
},
|
|
92
|
+
elemBefore: isDragAndDropEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.new-cell-context-menu-styling') ? (0, _react2.jsx)(_backgroundColor.default, {
|
|
93
|
+
label: formatMessage(_messages.tableMessages.backgroundColor),
|
|
94
|
+
size: "medium"
|
|
95
|
+
}) : undefined,
|
|
91
96
|
elemAfter: (0, _react2.jsx)("div", {
|
|
92
97
|
className: _styles.DropdownMenuSharedCssClassName.SUBMENU
|
|
93
98
|
}, (0, _react2.jsx)("div", {
|
|
94
99
|
css: (0, _styles2.cellColourPreviewStyles)(background),
|
|
95
|
-
className: _types.TableCssClassName.CONTEXTUAL_MENU_ICON
|
|
100
|
+
className: isDragAndDropEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.new-cell-context-menu-styling') ? _types.TableCssClassName.CONTEXTUAL_MENU_ICON_SMALL : _types.TableCssClassName.CONTEXTUAL_MENU_ICON
|
|
96
101
|
}), isSubmenuOpen && (0, _react2.jsx)("div", {
|
|
97
102
|
className: _types.TableCssClassName.CONTEXTUAL_SUBMENU,
|
|
98
103
|
ref: _this.handleSubMenuRef
|
|
@@ -106,122 +111,253 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
106
111
|
hexToPaletteColor: _editorPalette.hexToEditorBackgroundPaletteColor
|
|
107
112
|
}
|
|
108
113
|
})))
|
|
109
|
-
}
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "createMergeSplitCellItems", function () {
|
|
118
|
+
var _this$props2 = _this.props,
|
|
119
|
+
allowMergeCells = _this$props2.allowMergeCells,
|
|
120
|
+
state = _this$props2.editorView.state,
|
|
121
|
+
formatMessage = _this$props2.intl.formatMessage,
|
|
122
|
+
editorView = _this$props2.editorView;
|
|
123
|
+
var _getPluginState2 = (0, _pluginFactory.getPluginState)(editorView.state),
|
|
124
|
+
isDragAndDropEnabled = _getPluginState2.isDragAndDropEnabled;
|
|
125
|
+
if (allowMergeCells) {
|
|
126
|
+
return [{
|
|
127
|
+
content: formatMessage(_messages.tableMessages.mergeCells),
|
|
128
|
+
value: {
|
|
129
|
+
name: 'merge'
|
|
130
|
+
},
|
|
131
|
+
isDisabled: !(0, _transforms.canMergeCells)(state.tr),
|
|
132
|
+
elemBefore: isDragAndDropEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.new-cell-context-menu-styling') ? (0, _react2.jsx)(_icons.MergeCellsIcon, null) : undefined
|
|
133
|
+
}, {
|
|
134
|
+
content: formatMessage(_messages.tableMessages.splitCell),
|
|
135
|
+
value: {
|
|
136
|
+
name: 'split'
|
|
137
|
+
},
|
|
138
|
+
isDisabled: !(0, _utils2.splitCell)(state),
|
|
139
|
+
elemBefore: isDragAndDropEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.new-cell-context-menu-styling') ? (0, _react2.jsx)(_icons.SplitCellIcon, null) : undefined
|
|
140
|
+
}];
|
|
110
141
|
}
|
|
111
|
-
|
|
112
|
-
|
|
142
|
+
return [];
|
|
143
|
+
});
|
|
144
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "createInsertColumnItem", function () {
|
|
145
|
+
var _this$props3 = _this.props,
|
|
146
|
+
formatMessage = _this$props3.intl.formatMessage,
|
|
147
|
+
editorView = _this$props3.editorView;
|
|
148
|
+
var _getPluginState3 = (0, _pluginFactory.getPluginState)(editorView.state),
|
|
149
|
+
isDragAndDropEnabled = _getPluginState3.isDragAndDropEnabled;
|
|
150
|
+
return {
|
|
151
|
+
content: formatMessage(isDragAndDropEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.new-cell-context-menu-styling') ? _messages.tableMessages.addColumn : _messages.tableMessages.insertColumn),
|
|
113
152
|
value: {
|
|
114
153
|
name: 'insert_column'
|
|
115
154
|
},
|
|
116
155
|
elemAfter: (0, _react2.jsx)("div", {
|
|
117
156
|
css: _shortcut.shortcutStyle
|
|
118
|
-
}, (0, _keymaps.tooltip)(_keymaps.addColumnAfter))
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
157
|
+
}, (0, _keymaps.tooltip)(_keymaps.addColumnAfter)),
|
|
158
|
+
elemBefore: isDragAndDropEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.new-cell-context-menu-styling') ? (0, _react2.jsx)(_icons.AddColRightIcon, null) : undefined
|
|
159
|
+
};
|
|
160
|
+
});
|
|
161
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "createInsertRowItem", function () {
|
|
162
|
+
var _this$props4 = _this.props,
|
|
163
|
+
formatMessage = _this$props4.intl.formatMessage,
|
|
164
|
+
editorView = _this$props4.editorView;
|
|
165
|
+
var _getPluginState4 = (0, _pluginFactory.getPluginState)(editorView.state),
|
|
166
|
+
isDragAndDropEnabled = _getPluginState4.isDragAndDropEnabled;
|
|
167
|
+
return {
|
|
168
|
+
content: formatMessage(isDragAndDropEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.new-cell-context-menu-styling') ? _messages.tableMessages.addRow : _messages.tableMessages.insertRow),
|
|
122
169
|
value: {
|
|
123
170
|
name: 'insert_row'
|
|
124
171
|
},
|
|
125
172
|
elemAfter: (0, _react2.jsx)("div", {
|
|
126
173
|
css: _shortcut.shortcutStyle
|
|
127
|
-
}, (0, _keymaps.tooltip)(_keymaps.addRowAfter))
|
|
128
|
-
|
|
174
|
+
}, (0, _keymaps.tooltip)(_keymaps.addRowAfter)),
|
|
175
|
+
elemBefore: isDragAndDropEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.new-cell-context-menu-styling') ? (0, _react2.jsx)(_icons.AddRowBelowIcon, null) : undefined
|
|
176
|
+
};
|
|
177
|
+
});
|
|
178
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "createClearCellsItem", function () {
|
|
179
|
+
var _this$props5 = _this.props,
|
|
180
|
+
selectionRect = _this$props5.selectionRect,
|
|
181
|
+
formatMessage = _this$props5.intl.formatMessage,
|
|
182
|
+
editorView = _this$props5.editorView;
|
|
183
|
+
var _getPluginState5 = (0, _pluginFactory.getPluginState)(editorView.state),
|
|
184
|
+
isDragAndDropEnabled = _getPluginState5.isDragAndDropEnabled;
|
|
129
185
|
var top = selectionRect.top,
|
|
130
186
|
bottom = selectionRect.bottom,
|
|
131
187
|
right = selectionRect.right,
|
|
132
188
|
left = selectionRect.left;
|
|
133
189
|
var noOfColumns = right - left;
|
|
134
190
|
var noOfRows = bottom - top;
|
|
135
|
-
|
|
191
|
+
return {
|
|
192
|
+
content: formatMessage(_messages.tableMessages.clearCells, {
|
|
193
|
+
0: Math.max(noOfColumns, noOfRows)
|
|
194
|
+
}),
|
|
195
|
+
value: {
|
|
196
|
+
name: 'clear'
|
|
197
|
+
},
|
|
198
|
+
elemAfter: (0, _react2.jsx)("div", {
|
|
199
|
+
css: _shortcut.shortcutStyle
|
|
200
|
+
}, (0, _keymaps.tooltip)(_keymaps.backspace)),
|
|
201
|
+
elemBefore: isDragAndDropEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.new-cell-context-menu-styling') ? (0, _react2.jsx)(_crossCircle.default, {
|
|
202
|
+
label: formatMessage(_messages.tableMessages.clearCells, {
|
|
203
|
+
0: Math.max(noOfColumns, noOfRows)
|
|
204
|
+
})
|
|
205
|
+
}) : undefined
|
|
206
|
+
};
|
|
207
|
+
});
|
|
208
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "createDeleteColumnItem", function () {
|
|
209
|
+
var _this$props6 = _this.props,
|
|
210
|
+
selectionRect = _this$props6.selectionRect,
|
|
211
|
+
formatMessage = _this$props6.intl.formatMessage,
|
|
212
|
+
editorView = _this$props6.editorView;
|
|
213
|
+
var _getPluginState6 = (0, _pluginFactory.getPluginState)(editorView.state),
|
|
214
|
+
isDragAndDropEnabled = _getPluginState6.isDragAndDropEnabled;
|
|
215
|
+
var right = selectionRect.right,
|
|
216
|
+
left = selectionRect.left;
|
|
217
|
+
var noOfColumns = right - left;
|
|
218
|
+
return {
|
|
136
219
|
content: formatMessage(_messages.tableMessages.removeColumns, {
|
|
137
220
|
0: noOfColumns
|
|
138
221
|
}),
|
|
139
222
|
value: {
|
|
140
223
|
name: 'delete_column'
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
|
|
224
|
+
},
|
|
225
|
+
elemBefore: isDragAndDropEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.new-cell-context-menu-styling') ? (0, _react2.jsx)(_remove.default, {
|
|
226
|
+
label: formatMessage(_messages.tableMessages.removeColumns, {
|
|
227
|
+
0: noOfColumns
|
|
228
|
+
})
|
|
229
|
+
}) : undefined
|
|
230
|
+
};
|
|
231
|
+
});
|
|
232
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "createDeleteRowItem", function () {
|
|
233
|
+
var _this$props7 = _this.props,
|
|
234
|
+
selectionRect = _this$props7.selectionRect,
|
|
235
|
+
formatMessage = _this$props7.intl.formatMessage,
|
|
236
|
+
editorView = _this$props7.editorView;
|
|
237
|
+
var _getPluginState7 = (0, _pluginFactory.getPluginState)(editorView.state),
|
|
238
|
+
isDragAndDropEnabled = _getPluginState7.isDragAndDropEnabled;
|
|
239
|
+
var bottom = selectionRect.bottom,
|
|
240
|
+
top = selectionRect.top;
|
|
241
|
+
var noOfRows = bottom - top;
|
|
242
|
+
return {
|
|
144
243
|
content: formatMessage(_messages.tableMessages.removeRows, {
|
|
145
244
|
0: noOfRows
|
|
146
245
|
}),
|
|
147
246
|
value: {
|
|
148
247
|
name: 'delete_row'
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
if (allowDistributeColumns) {
|
|
248
|
+
},
|
|
249
|
+
elemBefore: isDragAndDropEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.new-cell-context-menu-styling') ? (0, _react2.jsx)(_remove.default, {
|
|
250
|
+
label: formatMessage(_messages.tableMessages.removeRows, {
|
|
251
|
+
0: noOfRows
|
|
252
|
+
})
|
|
253
|
+
}) : undefined
|
|
254
|
+
};
|
|
255
|
+
});
|
|
256
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "createDistributeColumnsItem", function () {
|
|
257
|
+
var _this$props8 = _this.props,
|
|
258
|
+
selectionRect = _this$props8.selectionRect,
|
|
259
|
+
formatMessage = _this$props8.intl.formatMessage,
|
|
260
|
+
editorView = _this$props8.editorView,
|
|
261
|
+
getEditorContainerWidth = _this$props8.getEditorContainerWidth;
|
|
262
|
+
var _getPluginState8 = (0, _pluginFactory.getPluginState)(editorView.state),
|
|
263
|
+
isDragAndDropEnabled = _getPluginState8.isDragAndDropEnabled,
|
|
264
|
+
allowDistributeColumns = _getPluginState8.pluginConfig.allowDistributeColumns;
|
|
265
|
+
if (allowDistributeColumns && (!isDragAndDropEnabled || !(0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.new-cell-context-menu-styling'))) {
|
|
168
266
|
var _newResizeState$chang;
|
|
169
|
-
var newResizeState = (0, _resizeState.getNewResizeStateFromSelectedColumns)(selectionRect, state, editorView.domAtPos.bind(editorView),
|
|
267
|
+
var newResizeState = (0, _resizeState.getNewResizeStateFromSelectedColumns)(selectionRect, editorView.state, editorView.domAtPos.bind(editorView), getEditorContainerWidth);
|
|
170
268
|
var wouldChange = (_newResizeState$chang = newResizeState === null || newResizeState === void 0 ? void 0 : newResizeState.changed) !== null && _newResizeState$chang !== void 0 ? _newResizeState$chang : false;
|
|
171
|
-
|
|
269
|
+
return {
|
|
172
270
|
content: formatMessage(_messages.tableMessages.distributeColumns),
|
|
173
271
|
value: {
|
|
174
272
|
name: 'distribute_columns'
|
|
175
273
|
},
|
|
176
274
|
isDisabled: !wouldChange
|
|
177
|
-
}
|
|
275
|
+
};
|
|
178
276
|
}
|
|
179
|
-
|
|
180
|
-
|
|
277
|
+
return null;
|
|
278
|
+
});
|
|
279
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "createSortColumnItems", function () {
|
|
280
|
+
var _this$props9 = _this.props,
|
|
281
|
+
formatMessage = _this$props9.intl.formatMessage,
|
|
282
|
+
editorView = _this$props9.editorView,
|
|
283
|
+
allowColumnSorting = _this$props9.allowColumnSorting;
|
|
284
|
+
var _getPluginState9 = (0, _pluginFactory.getPluginState)(editorView.state),
|
|
285
|
+
isDragAndDropEnabled = _getPluginState9.isDragAndDropEnabled;
|
|
286
|
+
if (allowColumnSorting && (!isDragAndDropEnabled || !(0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.new-cell-context-menu-styling'))) {
|
|
287
|
+
var hasMergedCellsInTable = (0, _utils3.getMergedCellsPositions)(editorView.state.tr).length > 0;
|
|
181
288
|
var warning = hasMergedCellsInTable ? {
|
|
182
289
|
tooltipDescription: formatMessage(_messages.tableMessages.canNotSortTable),
|
|
183
290
|
isDisabled: true
|
|
184
291
|
} : {};
|
|
185
|
-
|
|
292
|
+
return [_objectSpread({
|
|
186
293
|
content: formatMessage(_messages.tableMessages.sortColumnASC),
|
|
187
294
|
value: {
|
|
188
295
|
name: 'sort_column_asc'
|
|
189
296
|
}
|
|
190
|
-
}, warning)
|
|
191
|
-
items.push(_objectSpread({
|
|
297
|
+
}, warning), _objectSpread({
|
|
192
298
|
content: formatMessage(_messages.tableMessages.sortColumnDESC),
|
|
193
299
|
value: {
|
|
194
300
|
name: 'sort_column_desc'
|
|
195
301
|
}
|
|
196
|
-
}, warning)
|
|
302
|
+
}, warning)];
|
|
197
303
|
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
304
|
+
return null;
|
|
305
|
+
});
|
|
306
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "createOriginalContextMenuItems", function () {
|
|
307
|
+
var items = [];
|
|
308
|
+
var backgroundColorItem = _this.createBackgroundColorItem();
|
|
309
|
+
backgroundColorItem && items.push(backgroundColorItem);
|
|
310
|
+
items.push(_this.createInsertColumnItem());
|
|
311
|
+
items.push(_this.createInsertRowItem());
|
|
312
|
+
items.push(_this.createDeleteColumnItem());
|
|
313
|
+
items.push(_this.createDeleteRowItem());
|
|
314
|
+
items.push.apply(items, (0, _toConsumableArray2.default)(_this.createMergeSplitCellItems()));
|
|
315
|
+
var distributeColumnsItem = _this.createDistributeColumnsItem();
|
|
316
|
+
distributeColumnsItem && items.push(distributeColumnsItem);
|
|
317
|
+
var sortColumnItems = _this.createSortColumnItems();
|
|
318
|
+
sortColumnItems && items.push.apply(items, (0, _toConsumableArray2.default)(sortColumnItems));
|
|
319
|
+
items.push(_this.createClearCellsItem());
|
|
320
|
+
return [{
|
|
210
321
|
items: items
|
|
211
|
-
}]
|
|
322
|
+
}];
|
|
323
|
+
});
|
|
324
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "createNewContextMenuItems", function () {
|
|
325
|
+
var _items$0$items;
|
|
326
|
+
var backgroundColorItem = _this.createBackgroundColorItem();
|
|
327
|
+
var mergeSplitCellItems = _this.createMergeSplitCellItems();
|
|
328
|
+
var insertColumnItem = _this.createInsertColumnItem();
|
|
329
|
+
var insertRowItem = _this.createInsertRowItem();
|
|
330
|
+
var clearCellsItem = _this.createClearCellsItem();
|
|
331
|
+
var deleteColumnItem = _this.createDeleteColumnItem();
|
|
332
|
+
var deleteRowItem = _this.createDeleteRowItem();
|
|
333
|
+
|
|
334
|
+
// Group items so when table.menu.group-items FF is enabled, a divider shows under split cell, above add column
|
|
335
|
+
var items = [{
|
|
336
|
+
items: []
|
|
337
|
+
}, {
|
|
338
|
+
items: []
|
|
339
|
+
}];
|
|
340
|
+
backgroundColorItem && items[0].items.push(backgroundColorItem);
|
|
341
|
+
(_items$0$items = items[0].items).push.apply(_items$0$items, (0, _toConsumableArray2.default)(mergeSplitCellItems));
|
|
342
|
+
items[1].items.push(insertColumnItem);
|
|
343
|
+
items[1].items.push(insertRowItem);
|
|
344
|
+
items[1].items.push(clearCellsItem);
|
|
345
|
+
items[1].items.push(deleteColumnItem);
|
|
346
|
+
items[1].items.push(deleteRowItem);
|
|
347
|
+
return items;
|
|
212
348
|
});
|
|
213
349
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onMenuItemActivated", function (_ref) {
|
|
214
350
|
var item = _ref.item;
|
|
215
|
-
var _this$
|
|
216
|
-
editorView = _this$
|
|
217
|
-
selectionRect = _this$
|
|
218
|
-
editorAnalyticsAPI = _this$
|
|
219
|
-
getEditorContainerWidth = _this$
|
|
351
|
+
var _this$props10 = _this.props,
|
|
352
|
+
editorView = _this$props10.editorView,
|
|
353
|
+
selectionRect = _this$props10.selectionRect,
|
|
354
|
+
editorAnalyticsAPI = _this$props10.editorAnalyticsAPI,
|
|
355
|
+
getEditorContainerWidth = _this$props10.getEditorContainerWidth;
|
|
220
356
|
// TargetCellPosition could be outdated: https://product-fabric.atlassian.net/browse/ED-8129
|
|
221
357
|
var state = editorView.state,
|
|
222
358
|
dispatch = editorView.dispatch;
|
|
223
|
-
var
|
|
224
|
-
targetCellPosition =
|
|
359
|
+
var _getPluginState10 = (0, _pluginFactory.getPluginState)(state),
|
|
360
|
+
targetCellPosition = _getPluginState10.targetCellPosition;
|
|
225
361
|
switch (item.value.name) {
|
|
226
362
|
case 'sort_column_desc':
|
|
227
363
|
(0, _commandsWithAnalytics.sortColumnWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.CONTEXT_MENU, selectionRect.left, _customSteps.TableSortOrder.DESC)(state, dispatch);
|
|
@@ -266,19 +402,19 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
266
402
|
_this.toggleOpen();
|
|
267
403
|
break;
|
|
268
404
|
case 'delete_row':
|
|
269
|
-
var
|
|
270
|
-
isHeaderRowRequired =
|
|
405
|
+
var _getPluginState11 = (0, _pluginFactory.getPluginState)(state),
|
|
406
|
+
isHeaderRowRequired = _getPluginState11.pluginConfig.isHeaderRowRequired;
|
|
271
407
|
(0, _commandsWithAnalytics.deleteRowsWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.CONTEXT_MENU, selectionRect, !!isHeaderRowRequired)(state, dispatch);
|
|
272
408
|
_this.toggleOpen();
|
|
273
409
|
break;
|
|
274
410
|
}
|
|
275
411
|
});
|
|
276
412
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "toggleOpen", function () {
|
|
277
|
-
var _this$
|
|
278
|
-
isOpen = _this$
|
|
279
|
-
_this$
|
|
280
|
-
state = _this$
|
|
281
|
-
dispatch = _this$
|
|
413
|
+
var _this$props11 = _this.props,
|
|
414
|
+
isOpen = _this$props11.isOpen,
|
|
415
|
+
_this$props11$editorV = _this$props11.editorView,
|
|
416
|
+
state = _this$props11$editorV.state,
|
|
417
|
+
dispatch = _this$props11$editorV.dispatch;
|
|
282
418
|
(0, _commands.toggleContextualMenu)()(state, dispatch);
|
|
283
419
|
if (!isOpen) {
|
|
284
420
|
_this.setState({
|
|
@@ -297,11 +433,11 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
297
433
|
});
|
|
298
434
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleItemMouseEnter", function (_ref2) {
|
|
299
435
|
var item = _ref2.item;
|
|
300
|
-
var _this$
|
|
301
|
-
_this$
|
|
302
|
-
state = _this$
|
|
303
|
-
dispatch = _this$
|
|
304
|
-
selectionRect = _this$
|
|
436
|
+
var _this$props12 = _this.props,
|
|
437
|
+
_this$props12$editorV = _this$props12.editorView,
|
|
438
|
+
state = _this$props12$editorV.state,
|
|
439
|
+
dispatch = _this$props12$editorV.dispatch,
|
|
440
|
+
selectionRect = _this$props12.selectionRect;
|
|
305
441
|
if (item.value.name === 'background') {
|
|
306
442
|
if (!_this.state.isSubmenuOpen) {
|
|
307
443
|
_this.setState({
|
|
@@ -339,12 +475,12 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
339
475
|
}
|
|
340
476
|
});
|
|
341
477
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "setColor", function (color) {
|
|
342
|
-
var _this$
|
|
343
|
-
editorView = _this$
|
|
344
|
-
editorAnalyticsAPI = _this$
|
|
478
|
+
var _this$props13 = _this.props,
|
|
479
|
+
editorView = _this$props13.editorView,
|
|
480
|
+
editorAnalyticsAPI = _this$props13.editorAnalyticsAPI;
|
|
345
481
|
// TargetCellPosition could be outdated: https://product-fabric.atlassian.net/browse/ED-8129
|
|
346
|
-
var
|
|
347
|
-
targetCellPosition =
|
|
482
|
+
var _getPluginState12 = (0, _pluginFactory.getPluginState)(editorView.state),
|
|
483
|
+
targetCellPosition = _getPluginState12.targetCellPosition;
|
|
348
484
|
var state = editorView.state,
|
|
349
485
|
dispatch = editorView.dispatch;
|
|
350
486
|
(0, _commandsWithAnalytics.setColorWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.CONTEXT_MENU, color, targetCellPosition)(state, dispatch);
|
|
@@ -355,15 +491,15 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
355
491
|
(0, _createClass2.default)(ContextualMenu, [{
|
|
356
492
|
key: "render",
|
|
357
493
|
value: function render() {
|
|
358
|
-
var _this$
|
|
359
|
-
isOpen = _this$
|
|
360
|
-
mountPoint = _this$
|
|
361
|
-
offset = _this$
|
|
362
|
-
boundariesElement = _this$
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
494
|
+
var _this$props14 = this.props,
|
|
495
|
+
isOpen = _this$props14.isOpen,
|
|
496
|
+
mountPoint = _this$props14.mountPoint,
|
|
497
|
+
offset = _this$props14.offset,
|
|
498
|
+
boundariesElement = _this$props14.boundariesElement,
|
|
499
|
+
editorView = _this$props14.editorView;
|
|
500
|
+
var _getPluginState13 = (0, _pluginFactory.getPluginState)(editorView.state),
|
|
501
|
+
isDragAndDropEnabled = _getPluginState13.isDragAndDropEnabled;
|
|
502
|
+
var items = isDragAndDropEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.new-cell-context-menu-styling') ? this.createNewContextMenuItems() : this.createOriginalContextMenuItems();
|
|
367
503
|
return (0, _react2.jsx)("div", {
|
|
368
504
|
"data-testid": "table-cell-contextual-menu",
|
|
369
505
|
onMouseLeave: this.closeSubmenu
|
|
@@ -385,7 +521,10 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
385
521
|
fitHeight: 188,
|
|
386
522
|
fitWidth: _consts.contextualMenuDropdownWidth,
|
|
387
523
|
boundariesElement: boundariesElement,
|
|
388
|
-
offset: offset
|
|
524
|
+
offset: offset,
|
|
525
|
+
section: isDragAndDropEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.new-cell-context-menu-styling') && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.menu.group-items') ? {
|
|
526
|
+
hasSeparator: true
|
|
527
|
+
} : undefined
|
|
389
528
|
}));
|
|
390
529
|
}
|
|
391
530
|
}]);
|
|
@@ -9,7 +9,6 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
|
|
|
9
9
|
var _react = require("@emotion/react");
|
|
10
10
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
11
11
|
var _colors = require("@atlaskit/theme/colors");
|
|
12
|
-
var _constants = require("@atlaskit/theme/constants");
|
|
13
12
|
var _types = require("../../types");
|
|
14
13
|
var _consts = require("../consts");
|
|
15
14
|
var _templateObject, _templateObject2;
|
|
@@ -19,4 +18,4 @@ var cellColourPreviewStyles = exports.cellColourPreviewStyles = function cellCol
|
|
|
19
18
|
|
|
20
19
|
// TODO Delete this comment after verifying space token -> previous value `padding: 8px`
|
|
21
20
|
// TODO Delete this comment after verifying space token -> previous value `margin-left: 4px`
|
|
22
|
-
var tablePopupStyles = exports.tablePopupStyles = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n border-radius: ", "
|
|
21
|
+
var tablePopupStyles = exports.tablePopupStyles = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n border-radius: ", ";\n background: ", ";\n box-shadow: ", ";\n display: block;\n position: absolute;\n top: 0;\n left: ", "px;\n padding: ", ";\n\n > div {\n padding: 0;\n }\n }\n\n .", " {\n display: flex;\n\n &::before {\n content: '';\n display: block;\n border: 1px solid ", ";\n border-radius: ", ";\n width: 20px;\n height: 20px;\n }\n\n &::after {\n content: '\u203A';\n margin-left: ", ";\n line-height: 20px;\n color: ", ";\n }\n }\n\n .", " {\n display: flex;\n\n &::before {\n content: '';\n display: block;\n border: 1px solid ", ";\n border-radius: ", ";\n width: 14px;\n height: 14px;\n }\n\n &::after {\n content: '\u203A';\n margin-left: ", ";\n line-height: 14px;\n color: ", ";\n }\n }\n"])), _types.TableCssClassName.CONTEXTUAL_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), ")"), _consts.contextualMenuDropdownWidth, "var(--ds-space-100, 8px)", _types.TableCssClassName.CONTEXTUAL_MENU_ICON, _adfSchema.tableBackgroundBorderColor, "var(--ds-border-radius, 3px)", "var(--ds-space-050, 4px)", "var(--ds-icon, ".concat(_colors.N90, ")"), _types.TableCssClassName.CONTEXTUAL_MENU_ICON_SMALL, _adfSchema.tableBackgroundBorderColor, "var(--ds-border-radius, 3px)", "var(--ds-space-050, 4px)", "var(--ds-icon, ".concat(_colors.N90, ")"));
|
|
@@ -113,7 +113,7 @@ var NumberColumn = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
113
113
|
className: _types.TableCssClassName.NUMBERED_COLUMN,
|
|
114
114
|
style: {
|
|
115
115
|
marginTop: hasHeaderRow && this.props.stickyTop !== undefined ? rowHeights[0] : undefined,
|
|
116
|
-
borderLeft: isDragAndDropEnabled && tableActive ? "1px solid ".concat(
|
|
116
|
+
borderLeft: isDragAndDropEnabled && tableActive ? "1px solid ".concat(_consts.tableBorderColor) : undefined
|
|
117
117
|
},
|
|
118
118
|
contentEditable: false
|
|
119
119
|
}, rowHeights.map(function (rowHeight, index) {
|