@atlaskit/editor-plugin-table 5.6.7 → 5.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/cjs/nodeviews/TableResizer.js +1 -1
- package/dist/cjs/types.js +1 -0
- package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +238 -99
- package/dist/cjs/ui/FloatingContextualMenu/styles.js +1 -1
- package/dist/cjs/ui/consts.js +6 -1
- 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/es2019/nodeviews/TableResizer.js +2 -2
- package/dist/es2019/types.js +1 -0
- package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +248 -71
- package/dist/es2019/ui/FloatingContextualMenu/styles.js +20 -0
- package/dist/es2019/ui/consts.js +5 -0
- 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/esm/nodeviews/TableResizer.js +2 -2
- package/dist/esm/types.js +1 -0
- package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +238 -98
- package/dist/esm/ui/FloatingContextualMenu/styles.js +1 -1
- package/dist/esm/ui/consts.js +5 -0
- 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/types/types.d.ts +1 -0
- package/dist/types/ui/FloatingContextualMenu/ContextualMenu.d.ts +12 -2
- package/dist/types/ui/consts.d.ts +1 -0
- 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-ts4.5/types.d.ts +1 -0
- package/dist/types-ts4.5/ui/FloatingContextualMenu/ContextualMenu.d.ts +12 -2
- package/dist/types-ts4.5/ui/consts.d.ts +1 -0
- 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/package.json +11 -4
- package/src/nodeviews/TableResizer.tsx +3 -1
- package/src/types.ts +1 -0
- package/src/ui/FloatingContextualMenu/ContextualMenu.tsx +316 -68
- package/src/ui/FloatingContextualMenu/styles.ts +20 -0
- package/src/ui/consts.ts +5 -0
- 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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 5.7.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#63516](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/63516) [`8fdf2e7a3737`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8fdf2e7a3737) - [ux] Added an adjustment value to the guidelines visible filtering method to exclude guidelines which may be visible but are not snapable.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
10
|
+
## 5.7.0
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- [#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.
|
|
15
|
+
|
|
3
16
|
## 5.6.7
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -79,7 +79,7 @@ var getResizerMinWidth = function getResizerMinWidth(node) {
|
|
|
79
79
|
*/
|
|
80
80
|
var getVisibleGuidelines = function getVisibleGuidelines(guidelines, containerWidth) {
|
|
81
81
|
return guidelines.filter(function (guideline) {
|
|
82
|
-
return guideline.position && guideline.position.x !== undefined && typeof guideline.position.x === 'number' && Math.abs(guideline.position.x * 2) < containerWidth;
|
|
82
|
+
return guideline.position && guideline.position.x !== undefined && typeof guideline.position.x === 'number' && Math.abs(guideline.position.x * 2) < containerWidth + _consts.TABLE_GUIDELINE_VISIBLE_ADJUSTMENT;
|
|
83
83
|
});
|
|
84
84
|
};
|
|
85
85
|
var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
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
|
|
@@ -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
|
}]);
|
|
@@ -18,4 +18,4 @@ var cellColourPreviewStyles = exports.cellColourPreviewStyles = function cellCol
|
|
|
18
18
|
|
|
19
19
|
// TODO Delete this comment after verifying space token -> previous value `padding: 8px`
|
|
20
20
|
// TODO Delete this comment after verifying space token -> previous value `margin-left: 4px`
|
|
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"])), _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, ")"));
|
|
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, ")"));
|
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.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.contextualMenuDropdownWidth = exports.columnResizeHandleZIndex = exports.columnControlsZIndex = exports.columnControlsSelectedZIndex = exports.columnControlsDecorationHeight = exports.TABLE_SNAP_GAP = exports.TABLE_HIGHLIGHT_TOLERANCE = exports.TABLE_HIGHLIGHT_GAP = exports.STICKY_HEADER_TOGGLE_TOLERANCE_MS = void 0;
|
|
6
|
+
exports.tableToolbarSize = exports.tableToolbarSelectedColor = exports.tableToolbarDeleteColor = exports.tableToolbarColor = exports.tableTextColor = exports.tableScrollbarOffset = 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.contextualMenuDropdownWidth = exports.columnResizeHandleZIndex = exports.columnControlsZIndex = exports.columnControlsSelectedZIndex = exports.columnControlsDecorationHeight = 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;
|
|
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");
|
|
@@ -65,6 +65,11 @@ var TABLE_SNAP_GAP = exports.TABLE_SNAP_GAP = 9;
|
|
|
65
65
|
var TABLE_HIGHLIGHT_GAP = exports.TABLE_HIGHLIGHT_GAP = 10;
|
|
66
66
|
var TABLE_HIGHLIGHT_TOLERANCE = exports.TABLE_HIGHLIGHT_TOLERANCE = 2;
|
|
67
67
|
var STICKY_HEADER_TOGGLE_TOLERANCE_MS = exports.STICKY_HEADER_TOGGLE_TOLERANCE_MS = 5;
|
|
68
|
+
// This adjustment value represents a pixel amount by which the container width needs to be adjusted when determining
|
|
69
|
+
// which guidelines are visible and most importantly CAN BE snapped too within the view. This value can be affected by
|
|
70
|
+
// table margins and padding. For example a guideline at 1800px and the view at 1860px wide, means the guidelines is visible
|
|
71
|
+
// BUT it cannot be snapped to during resize due to padding being applied to the resizer wrapper. This accommodates that difference.
|
|
72
|
+
var TABLE_GUIDELINE_VISIBLE_ADJUSTMENT = exports.TABLE_GUIDELINE_VISIBLE_ADJUSTMENT = -68;
|
|
68
73
|
var dragMenuDropdownWidth = exports.dragMenuDropdownWidth = 240;
|
|
69
74
|
var dragTableInsertColumnButtonSize = exports.dragTableInsertColumnButtonSize = 16;
|
|
70
75
|
var dropTargetExtendedWidth = exports.dropTargetExtendedWidth = 150;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.MergeCellsIcon = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var MergeCellsIcon = exports.MergeCellsIcon = function MergeCellsIcon() {
|
|
10
|
+
return /*#__PURE__*/_react.default.createElement("svg", {
|
|
11
|
+
width: "24",
|
|
12
|
+
height: "24",
|
|
13
|
+
viewBox: "0 0 24 24",
|
|
14
|
+
fill: "none",
|
|
15
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
16
|
+
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
17
|
+
fillRule: "evenodd",
|
|
18
|
+
clipRule: "evenodd",
|
|
19
|
+
d: "M10 19C10.5523 19 11 18.5523 11 18C11 17.4477 10.5523 17 10 17H6V7L10 7C10.5523 7 11 6.55228 11 6C11 5.44771 10.5523 5 10 5H6C4.89543 5 4 5.89543 4 7V17C4 18.1046 4.89543 19 6 19H10ZM14 5C13.4477 5 13 5.44772 13 6C13 6.55228 13.4477 7 14 7H18V17L14 17C13.4477 17 13 17.4477 13 18C13 18.5523 13.4477 19 14 19H18C19.1046 19 20 18.1046 20 17V7C20 5.89543 19.1046 5 18 5H14Z",
|
|
20
|
+
fill: "currentColor"
|
|
21
|
+
}), /*#__PURE__*/_react.default.createElement("path", {
|
|
22
|
+
d: "M15.75 10L13.75 12L15.75 14",
|
|
23
|
+
stroke: "currentColor",
|
|
24
|
+
strokeWidth: "1.5",
|
|
25
|
+
strokeLinecap: "round",
|
|
26
|
+
strokeLinejoin: "round"
|
|
27
|
+
}), /*#__PURE__*/_react.default.createElement("path", {
|
|
28
|
+
d: "M8.25 14L10.25 12L8.25 10",
|
|
29
|
+
stroke: "currentColor",
|
|
30
|
+
strokeWidth: "1.5",
|
|
31
|
+
strokeLinecap: "round",
|
|
32
|
+
strokeLinejoin: "round"
|
|
33
|
+
}));
|
|
34
|
+
};
|