@atlaskit/editor-plugin-table 5.3.4 → 5.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/cjs/plugins/table/nodeviews/TableRow.js +53 -35
- package/dist/cjs/plugins/table/types.js +1 -0
- package/dist/cjs/plugins/table/ui/DragHandle/index.js +25 -13
- package/dist/cjs/plugins/table/ui/TableFloatingControls/RowControls/DragControls.js +3 -2
- package/dist/cjs/plugins/table/ui/common-styles.js +1 -1
- package/dist/cjs/plugins/table/ui/icons/DragHandleIcon.js +63 -0
- package/dist/es2019/plugins/table/nodeviews/TableRow.js +22 -7
- package/dist/es2019/plugins/table/types.js +1 -0
- package/dist/es2019/plugins/table/ui/DragHandle/index.js +24 -13
- package/dist/es2019/plugins/table/ui/TableFloatingControls/RowControls/DragControls.js +3 -2
- package/dist/es2019/plugins/table/ui/common-styles.js +9 -0
- package/dist/es2019/plugins/table/ui/icons/DragHandleIcon.js +54 -0
- package/dist/esm/plugins/table/nodeviews/TableRow.js +53 -35
- package/dist/esm/plugins/table/types.js +1 -0
- package/dist/esm/plugins/table/ui/DragHandle/index.js +25 -13
- package/dist/esm/plugins/table/ui/TableFloatingControls/RowControls/DragControls.js +3 -2
- package/dist/esm/plugins/table/ui/common-styles.js +1 -1
- package/dist/esm/plugins/table/ui/icons/DragHandleIcon.js +55 -0
- package/dist/types/plugins/table/nodeviews/TableRow.d.ts +1 -0
- package/dist/types/plugins/table/types.d.ts +1 -0
- package/dist/types/plugins/table/ui/DragHandle/index.d.ts +3 -1
- package/dist/types/plugins/table/ui/icons/DragHandleIcon.d.ts +7 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/TableRow.d.ts +1 -0
- package/dist/types-ts4.5/plugins/table/types.d.ts +1 -0
- package/dist/types-ts4.5/plugins/table/ui/DragHandle/index.d.ts +3 -1
- package/dist/types-ts4.5/plugins/table/ui/icons/DragHandleIcon.d.ts +7 -0
- package/package.json +1 -2
- package/src/plugins/table/nodeviews/TableRow.ts +12 -6
- package/src/plugins/table/types.ts +1 -1
- package/src/plugins/table/ui/DragHandle/index.tsx +31 -12
- package/src/plugins/table/ui/TableFloatingControls/RowControls/DragControls.tsx +4 -1
- package/src/plugins/table/ui/common-styles.ts +9 -0
- package/src/plugins/table/ui/icons/DragHandleIcon.tsx +74 -0
- package/tsconfig.app.json +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 5.3.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#41863](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41863) [`fe134b9566c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fe134b9566c) - Add a new custom icon for table drag and drop
|
|
8
|
+
|
|
9
|
+
## 5.3.5
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#41864](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41864) [`34e85d7299e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/34e85d7299e) - The table row nodeview needs to fetch the current live index and id when the canDrop and getData DnD methods are called. This is due to the fact that prosemirror reorders the tr elements efficently which causes the target indexes to be reordered and never updated.
|
|
14
|
+
|
|
3
15
|
## 5.3.4
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -168,6 +168,7 @@ var TableRow = exports.default = /*#__PURE__*/function (_ref) {
|
|
|
168
168
|
}, {
|
|
169
169
|
key: "addDropTarget",
|
|
170
170
|
value: function addDropTarget(element) {
|
|
171
|
+
var _this2 = this;
|
|
171
172
|
var pos = this.getPos();
|
|
172
173
|
if (!Number.isFinite(pos)) {
|
|
173
174
|
return;
|
|
@@ -175,15 +176,15 @@ var TableRow = exports.default = /*#__PURE__*/function (_ref) {
|
|
|
175
176
|
if (this.dropTargetCleanup) {
|
|
176
177
|
this.dropTargetCleanup();
|
|
177
178
|
}
|
|
178
|
-
var resolvedPos = this.view.state.doc.resolve(pos);
|
|
179
|
-
var targetIndex = resolvedPos.index();
|
|
180
|
-
var localId = resolvedPos.parent.attrs.localId;
|
|
181
179
|
this.dropTargetCleanup = (0, _element.dropTargetForElements)({
|
|
182
180
|
element: element,
|
|
183
181
|
canDrop: function canDrop(_ref2) {
|
|
184
182
|
var _data$indexes, _data$indexes2;
|
|
185
183
|
var source = _ref2.source;
|
|
186
184
|
var data = source.data;
|
|
185
|
+
var _this2$getCurrentData = _this2.getCurrentData(),
|
|
186
|
+
localId = _this2$getCurrentData.localId,
|
|
187
|
+
targetIndex = _this2$getCurrentData.targetIndex;
|
|
187
188
|
return (
|
|
188
189
|
// Only draggables of row type can be dropped on this target
|
|
189
190
|
data.type === 'table-row' &&
|
|
@@ -193,9 +194,15 @@ var TableRow = exports.default = /*#__PURE__*/function (_ref) {
|
|
|
193
194
|
!!((_data$indexes = data.indexes) !== null && _data$indexes !== void 0 && _data$indexes.length) && ((_data$indexes2 = data.indexes) === null || _data$indexes2 === void 0 ? void 0 : _data$indexes2.indexOf(targetIndex)) === -1
|
|
194
195
|
);
|
|
195
196
|
},
|
|
197
|
+
getIsSticky: function getIsSticky() {
|
|
198
|
+
return true;
|
|
199
|
+
},
|
|
196
200
|
getData: function getData(_ref3) {
|
|
197
201
|
var input = _ref3.input,
|
|
198
202
|
element = _ref3.element;
|
|
203
|
+
var _this2$getCurrentData2 = _this2.getCurrentData(),
|
|
204
|
+
localId = _this2$getCurrentData2.localId,
|
|
205
|
+
targetIndex = _this2$getCurrentData2.targetIndex;
|
|
199
206
|
var data = {
|
|
200
207
|
localId: localId,
|
|
201
208
|
type: 'table-row',
|
|
@@ -209,6 +216,17 @@ var TableRow = exports.default = /*#__PURE__*/function (_ref) {
|
|
|
209
216
|
}
|
|
210
217
|
});
|
|
211
218
|
}
|
|
219
|
+
}, {
|
|
220
|
+
key: "getCurrentData",
|
|
221
|
+
value: function getCurrentData() {
|
|
222
|
+
var resolvedPos = this.view.state.doc.resolve(this.getPos());
|
|
223
|
+
var targetIndex = resolvedPos.index();
|
|
224
|
+
var localId = resolvedPos.parent.attrs.localId;
|
|
225
|
+
return {
|
|
226
|
+
targetIndex: targetIndex,
|
|
227
|
+
localId: localId
|
|
228
|
+
};
|
|
229
|
+
}
|
|
212
230
|
}, {
|
|
213
231
|
key: "subscribe",
|
|
214
232
|
value: function subscribe() {
|
|
@@ -257,7 +275,7 @@ var TableRow = exports.default = /*#__PURE__*/function (_ref) {
|
|
|
257
275
|
}, {
|
|
258
276
|
key: "initObservers",
|
|
259
277
|
value: function initObservers() {
|
|
260
|
-
var
|
|
278
|
+
var _this3 = this;
|
|
261
279
|
if (!this.dom || this.dom.dataset.isObserved) {
|
|
262
280
|
return;
|
|
263
281
|
}
|
|
@@ -274,15 +292,15 @@ var TableRow = exports.default = /*#__PURE__*/function (_ref) {
|
|
|
274
292
|
window.requestAnimationFrame(function () {
|
|
275
293
|
var _getTree;
|
|
276
294
|
// we expect tree to be defined after animation frame
|
|
277
|
-
var tableContainer = (_getTree = (0, _dom2.getTree)(
|
|
295
|
+
var tableContainer = (_getTree = (0, _dom2.getTree)(_this3.dom)) === null || _getTree === void 0 ? void 0 : _getTree.wrapper.closest(".".concat(_types.TableCssClassName.NODEVIEW_WRAPPER));
|
|
278
296
|
if (tableContainer) {
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
[
|
|
297
|
+
_this3.sentinels.top = tableContainer.getElementsByClassName(_types.TableCssClassName.TABLE_STICKY_SENTINEL_TOP).item(0);
|
|
298
|
+
_this3.sentinels.bottom = tableContainer.getElementsByClassName(_types.TableCssClassName.TABLE_STICKY_SENTINEL_BOTTOM).item(0);
|
|
299
|
+
[_this3.sentinels.top, _this3.sentinels.bottom].forEach(function (el) {
|
|
282
300
|
// skip if already observed for another row on this table
|
|
283
301
|
if (el && !el.dataset.isObserved) {
|
|
284
302
|
el.dataset.isObserved = 'true';
|
|
285
|
-
|
|
303
|
+
_this3.intersectionObserver.observe(el);
|
|
286
304
|
}
|
|
287
305
|
});
|
|
288
306
|
}
|
|
@@ -294,27 +312,27 @@ var TableRow = exports.default = /*#__PURE__*/function (_ref) {
|
|
|
294
312
|
}, {
|
|
295
313
|
key: "createResizeObserver",
|
|
296
314
|
value: function createResizeObserver() {
|
|
297
|
-
var
|
|
315
|
+
var _this4 = this;
|
|
298
316
|
this.resizeObserver = new ResizeObserver(function (entries) {
|
|
299
|
-
var tree = (0, _dom2.getTree)(
|
|
317
|
+
var tree = (0, _dom2.getTree)(_this4.dom);
|
|
300
318
|
if (!tree) {
|
|
301
319
|
return;
|
|
302
320
|
}
|
|
303
321
|
var table = tree.table;
|
|
304
322
|
entries.forEach(function (entry) {
|
|
305
|
-
var
|
|
323
|
+
var _this4$editorScrollab;
|
|
306
324
|
// On resize of the parent scroll element we need to adjust the width
|
|
307
325
|
// of the sticky header
|
|
308
|
-
if (entry.target.className === ((
|
|
309
|
-
|
|
326
|
+
if (entry.target.className === ((_this4$editorScrollab = _this4.editorScrollableElement) === null || _this4$editorScrollab === void 0 ? void 0 : _this4$editorScrollab.className)) {
|
|
327
|
+
_this4.updateStickyHeaderWidth();
|
|
310
328
|
} else {
|
|
311
329
|
var newHeight = entry.contentRect ? entry.contentRect.height : entry.target.offsetHeight;
|
|
312
|
-
if (
|
|
330
|
+
if (_this4.sentinels.bottom &&
|
|
313
331
|
// When the table header is sticky, it would be taller by a 1px (border-bottom),
|
|
314
332
|
// So we adding this check to allow a 1px difference.
|
|
315
|
-
Math.abs(newHeight - (
|
|
316
|
-
|
|
317
|
-
|
|
333
|
+
Math.abs(newHeight - (_this4.stickyRowHeight || 0)) > _consts.stickyHeaderBorderBottomWidth) {
|
|
334
|
+
_this4.stickyRowHeight = newHeight;
|
|
335
|
+
_this4.sentinels.bottom.style.bottom = "".concat(_consts.tableScrollbarOffset + _consts.stickyRowOffsetTop + newHeight, "px");
|
|
318
336
|
(0, _dom.updateStickyMargins)(table);
|
|
319
337
|
}
|
|
320
338
|
}
|
|
@@ -324,9 +342,9 @@ var TableRow = exports.default = /*#__PURE__*/function (_ref) {
|
|
|
324
342
|
}, {
|
|
325
343
|
key: "createIntersectionObserver",
|
|
326
344
|
value: function createIntersectionObserver() {
|
|
327
|
-
var
|
|
345
|
+
var _this5 = this;
|
|
328
346
|
this.intersectionObserver = new IntersectionObserver(function (entries, _) {
|
|
329
|
-
var tree = (0, _dom2.getTree)(
|
|
347
|
+
var tree = (0, _dom2.getTree)(_this5.dom);
|
|
330
348
|
if (!tree) {
|
|
331
349
|
return;
|
|
332
350
|
}
|
|
@@ -349,28 +367,28 @@ var TableRow = exports.default = /*#__PURE__*/function (_ref) {
|
|
|
349
367
|
var sentinelIsBelowScrollArea = (((_entry$rootBounds2 = entry.rootBounds) === null || _entry$rootBounds2 === void 0 ? void 0 : _entry$rootBounds2.bottom) || 0) < entry.boundingClientRect.bottom;
|
|
350
368
|
if (!entry.isIntersecting && !sentinelIsBelowScrollArea) {
|
|
351
369
|
var _entry$rootBounds3;
|
|
352
|
-
tree &&
|
|
353
|
-
|
|
370
|
+
tree && _this5.makeHeaderRowSticky(tree, (_entry$rootBounds3 = entry.rootBounds) === null || _entry$rootBounds3 === void 0 ? void 0 : _entry$rootBounds3.top);
|
|
371
|
+
_this5.lastStickyTimestamp = Date.now();
|
|
354
372
|
} else {
|
|
355
|
-
table &&
|
|
373
|
+
table && _this5.makeRowHeaderNotSticky(table);
|
|
356
374
|
}
|
|
357
375
|
}
|
|
358
376
|
if (target.classList.contains(_types.TableCssClassName.TABLE_STICKY_SENTINEL_BOTTOM)) {
|
|
359
377
|
var _entry$rootBounds4;
|
|
360
|
-
var sentinelIsAboveScrollArea = entry.boundingClientRect.top -
|
|
378
|
+
var sentinelIsAboveScrollArea = entry.boundingClientRect.top - _this5.dom.offsetHeight < (((_entry$rootBounds4 = entry.rootBounds) === null || _entry$rootBounds4 === void 0 ? void 0 : _entry$rootBounds4.top) || 0);
|
|
361
379
|
if (table && !entry.isIntersecting && sentinelIsAboveScrollArea) {
|
|
362
380
|
// Not a perfect solution, but need to this code specific for FireFox ED-19177
|
|
363
381
|
if (_utils.browser.gecko) {
|
|
364
|
-
if (
|
|
365
|
-
|
|
382
|
+
if (_this5.lastStickyTimestamp && Date.now() - _this5.lastStickyTimestamp > _consts.STICKY_HEADER_TOGGLE_TOLERANCE_MS) {
|
|
383
|
+
_this5.makeRowHeaderNotSticky(table);
|
|
366
384
|
}
|
|
367
385
|
} else {
|
|
368
|
-
|
|
386
|
+
_this5.makeRowHeaderNotSticky(table);
|
|
369
387
|
}
|
|
370
388
|
} else if (entry.isIntersecting && sentinelIsAboveScrollArea) {
|
|
371
389
|
var _entry$rootBounds5;
|
|
372
|
-
tree &&
|
|
373
|
-
|
|
390
|
+
tree && _this5.makeHeaderRowSticky(tree, entry === null || entry === void 0 || (_entry$rootBounds5 = entry.rootBounds) === null || _entry$rootBounds5 === void 0 ? void 0 : _entry$rootBounds5.top);
|
|
391
|
+
_this5.lastStickyTimestamp = Date.now();
|
|
374
392
|
}
|
|
375
393
|
}
|
|
376
394
|
return;
|
|
@@ -445,12 +463,12 @@ var TableRow = exports.default = /*#__PURE__*/function (_ref) {
|
|
|
445
463
|
}, {
|
|
446
464
|
key: "refireIntersectionObservers",
|
|
447
465
|
value: function refireIntersectionObservers() {
|
|
448
|
-
var
|
|
466
|
+
var _this6 = this;
|
|
449
467
|
if (this.isSticky) {
|
|
450
468
|
[this.sentinels.top, this.sentinels.bottom].forEach(function (el) {
|
|
451
|
-
if (el &&
|
|
452
|
-
|
|
453
|
-
|
|
469
|
+
if (el && _this6.intersectionObserver) {
|
|
470
|
+
_this6.intersectionObserver.unobserve(el);
|
|
471
|
+
_this6.intersectionObserver.observe(el);
|
|
454
472
|
}
|
|
455
473
|
});
|
|
456
474
|
}
|
|
@@ -459,7 +477,7 @@ var TableRow = exports.default = /*#__PURE__*/function (_ref) {
|
|
|
459
477
|
key: "makeHeaderRowSticky",
|
|
460
478
|
value: function makeHeaderRowSticky(tree, scrollTop) {
|
|
461
479
|
var _tbody$firstChild,
|
|
462
|
-
|
|
480
|
+
_this7 = this;
|
|
463
481
|
// If header row height is more than 50% of viewport height don't do this
|
|
464
482
|
if (this.isSticky || this.stickyRowHeight && this.stickyRowHeight > window.innerHeight / 2) {
|
|
465
483
|
return;
|
|
@@ -496,7 +514,7 @@ var TableRow = exports.default = /*#__PURE__*/function (_ref) {
|
|
|
496
514
|
});
|
|
497
515
|
var fastScrollThresholdMs = 500;
|
|
498
516
|
setTimeout(function () {
|
|
499
|
-
|
|
517
|
+
_this7.refireIntersectionObservers();
|
|
500
518
|
}, fastScrollThresholdMs);
|
|
501
519
|
}
|
|
502
520
|
this.dom.style.top = "".concat(domTop, "px");
|
|
@@ -88,6 +88,7 @@ var TableCssClassName = exports.TableCssClassName = _objectSpread(_objectSpread(
|
|
|
88
88
|
/** Controls with drag handle */
|
|
89
89
|
COLUMN_CONTROLS_DECORATIONS_WITH_DRAG: "".concat(_adfSchema.tablePrefixSelector, "-column-controls-decoration-with-drag"),
|
|
90
90
|
ROW_CONTROLS_WITH_DRAG: "".concat(_adfSchema.tablePrefixSelector, "-row-controls-with-drag"),
|
|
91
|
+
DRAG_HANDLE_BUTTON_CONTAINER: "".concat(_adfSchema.tablePrefixSelector, "-drag-handle-button-container"),
|
|
91
92
|
/** Other classes */
|
|
92
93
|
NUMBERED_COLUMN: "".concat(_adfSchema.tablePrefixSelector, "-numbered-column"),
|
|
93
94
|
NUMBERED_COLUMN_BUTTON: "".concat(_adfSchema.tablePrefixSelector, "-numbered-column__button"),
|
|
@@ -6,21 +6,37 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.DragHandle = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _dragHandleButton = require("@atlaskit/pragmatic-drag-and-drop-react-accessibility/drag-handle-button");
|
|
10
9
|
var _element = require("@atlaskit/pragmatic-drag-and-drop/adapter/element");
|
|
10
|
+
var _colors = require("@atlaskit/theme/colors");
|
|
11
|
+
var _types = require("../../types");
|
|
12
|
+
var _DragHandleIcon = require("../icons/DragHandleIcon");
|
|
11
13
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
12
14
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
var mapStateToProps = function mapStateToProps(state) {
|
|
16
|
+
switch (state) {
|
|
17
|
+
case 'danger':
|
|
18
|
+
case 'disabled':
|
|
19
|
+
case 'selected':
|
|
20
|
+
case 'default':
|
|
21
|
+
default:
|
|
22
|
+
return {
|
|
23
|
+
backgroundColor: "var(--ds-background-accent-gray-subtlest, ".concat(_colors.N200, ")"),
|
|
24
|
+
foregroundColor: "var(--ds-icon-subtle, ".concat(_colors.N700, ")")
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
};
|
|
15
28
|
var DragHandle = exports.DragHandle = function DragHandle(_ref) {
|
|
16
29
|
var tableLocalId = _ref.tableLocalId,
|
|
17
30
|
_ref$direction = _ref.direction,
|
|
18
31
|
direction = _ref$direction === void 0 ? 'row' : _ref$direction,
|
|
32
|
+
_ref$state = _ref.state,
|
|
33
|
+
state = _ref$state === void 0 ? 'default' : _ref$state,
|
|
19
34
|
indexes = _ref.indexes,
|
|
20
35
|
onClick = _ref.onClick,
|
|
21
36
|
onMouseOver = _ref.onMouseOver,
|
|
22
37
|
onMouseOut = _ref.onMouseOut;
|
|
23
38
|
var dragHandleDivRef = (0, _react.useRef)(null);
|
|
39
|
+
var iconProps = mapStateToProps(state);
|
|
24
40
|
(0, _react.useEffect)(function () {
|
|
25
41
|
var dragHandleDivRefCurrent = dragHandleDivRef.current;
|
|
26
42
|
if (dragHandleDivRefCurrent) {
|
|
@@ -36,15 +52,11 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
|
|
|
36
52
|
});
|
|
37
53
|
}
|
|
38
54
|
}, [tableLocalId, direction, indexes]);
|
|
39
|
-
return /*#__PURE__*/_react.default.createElement("
|
|
40
|
-
|
|
55
|
+
return /*#__PURE__*/_react.default.createElement("button", {
|
|
56
|
+
className: _types.TableCssClassName.DRAG_HANDLE_BUTTON_CONTAINER,
|
|
41
57
|
style: {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
}, /*#__PURE__*/_react.default.createElement(_dragHandleButton.DragHandleButton, {
|
|
48
|
-
label: "blah"
|
|
49
|
-
}));
|
|
58
|
+
transform: direction === 'column' ? 'none' : 'rotate(90deg)'
|
|
59
|
+
},
|
|
60
|
+
ref: dragHandleDivRef
|
|
61
|
+
}, /*#__PURE__*/_react.default.createElement(_DragHandleIcon.DragHandleIcon, iconProps));
|
|
50
62
|
};
|
|
@@ -19,7 +19,7 @@ var DragControlsComponent = function DragControlsComponent(_ref) {
|
|
|
19
19
|
tableActive = _ref.tableActive,
|
|
20
20
|
editorView = _ref.editorView;
|
|
21
21
|
var rowHeights = (0, _utils2.getRowHeights)(tableRef);
|
|
22
|
-
var heights = rowHeights.map(function (height) {
|
|
22
|
+
var heights = rowHeights.map(function (height, index) {
|
|
23
23
|
return "".concat(height - 1, "px");
|
|
24
24
|
}).join(' ');
|
|
25
25
|
var _onClick = function onClick(index, event) {};
|
|
@@ -38,7 +38,8 @@ var DragControlsComponent = function DragControlsComponent(_ref) {
|
|
|
38
38
|
}
|
|
39
39
|
}, Number.isFinite(rowIndex) && /*#__PURE__*/_react.default.createElement("div", {
|
|
40
40
|
style: {
|
|
41
|
-
gridRow: "".concat(rowIndex + 1, " / span 1")
|
|
41
|
+
gridRow: "".concat(rowIndex + 1, " / span 1"),
|
|
42
|
+
display: 'flex'
|
|
42
43
|
}
|
|
43
44
|
}, /*#__PURE__*/_react.default.createElement(_DragHandle.DragHandle, {
|
|
44
45
|
onClick: function onClick(event) {
|
|
@@ -68,7 +68,7 @@ var tableWrapperStyles = function tableWrapperStyles() {
|
|
|
68
68
|
// TODO: https://product-fabric.atlassian.net/browse/DSP-4139
|
|
69
69
|
var tableStyles = exports.tableStyles = function tableStyles(props) {
|
|
70
70
|
var _props$featureFlags;
|
|
71
|
-
return (0, _react.css)(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n .", " button {\n background: ", ";\n color: ", ";\n cursor: none;\n }\n\n .", ":not(.", ") button:hover {\n background: ", ";\n color: ", " !important;\n cursor: pointer;\n }\n\n .ProseMirror {\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n\n .", " {\n margin-bottom: 0;\n }\n\n .", " {\n td.", ", th.", " {\n position: relative;\n overflow: visible;\n }\n\n td.", " {\n background-color: ", ";\n\n // ED-15246: Trello card is visible through a border of a table border\n // This fixes a border issue caused by relative positioned table cells\n &::after {\n height: 100%;\n content: '';\n border-left: 1px solid ", ";\n border-bottom: 1px solid ", ";\n position: absolute;\n right: 0px;\n top: 0px;\n bottom: 0;\n width: 100%;\n display: inline-block;\n pointer-events: none;\n }\n }\n }\n\n .", " {\n ", "\n }\n\n .", " {\n ", "\n }\n\n /* Delete button */\n ", "\n /* Ends Delete button */\n\n /* sticky styles */\n .", " .", " .", ":first-of-type {\n margin-top: ", "px;\n width: ", "px;\n\n position: fixed !important;\n z-index: ", " !important;\n box-shadow: 0px -", "px ", ";\n border-right: 0 none;\n /* top set by NumberColumn component */\n }\n\n .", " .", ".sticky {\n position: fixed !important;\n /* needs to be above row controls */\n z-index: ", " !important;\n background: ", ";\n\n width: ", "px;\n height: ", "px;\n }\n\n .", ".sticky .", " {\n border-bottom: 0px none;\n border-right: 0px none;\n\n height: ", "px;\n width: ", "px;\n }\n\n ", "\n\n .", "\n .", "\n .", ".sticky {\n position: fixed !important;\n z-index: ", " !important;\n display: flex;\n border-left: ", "px solid\n ", ";\n margin-left: -", "px;\n }\n\n .", " col:first-of-type {\n /* moving rows out of a table layout does weird things in Chrome */\n border-right: 1px solid ", ";\n }\n\n tr.sticky {\n padding-top: ", "px;\n position: fixed;\n display: grid;\n\n /* to keep it above cell selection but below date and other nodes popups that are inside sticky header */\n z-index: ", ";\n\n overflow-y: visible;\n overflow-x: hidden;\n\n grid-auto-flow: column;\n\n /* background for where controls apply */\n background: ", ";\n box-sizing: content-box;\n\n margin-top: 2px;\n\n box-shadow: 0 6px 4px -4px ", ";\n margin-left: -1px;\n\n &.no-pointer-events {\n pointer-events: none;\n }\n }\n\n .", " .", " {\n left: unset;\n position: fixed;\n /* needs to be above sticky header row and below date and other nodes popups that are inside sticky header */\n z-index: ", ";\n }\n\n .", ".", "\n .", " {\n padding-bottom: ", "px;\n }\n\n tr.sticky th {\n border-bottom: ", "px solid\n ", ";\n margin-right: -1px;\n }\n\n .", " tr.sticky > th:last-child {\n border-right-width: 1px;\n }\n\n /* add left edge for first cell */\n .", " tr.sticky > th:first-of-type {\n margin-left: 0px;\n }\n\n /* add a little bit so the scroll lines up with the table */\n .", " tr.sticky::after {\n content: ' ';\n width: ", "px;\n }\n\n /* To fix jumpiness caused in Chrome Browsers for sticky headers */\n .", " .sticky + tr {\n min-height: 0px;\n }\n\n /* move resize line a little in sticky bar */\n .", ".", " {\n tr.sticky\n td.", ",\n tr.sticky\n th.", " {\n .", "::after {\n right: ", "px;\n }\n }\n\n /* when selected put it back to normal -- :not selector would be nicer */\n tr.sticky\n td.", ".", ",\n tr.sticky\n th.", ".", " {\n .", "::after {\n right: ", "px;\n }\n }\n }\n\n tr.sticky\n .", ",\n tr.sticky\n .", " {\n z-index: 1;\n }\n\n .", " tr.sticky {\n padding-top: ", "px;\n }\n\n .", ".", "\n .", "\n .", ":first-of-type {\n margin-top: ", "px;\n }\n\n .", ".sticky {\n border-top: ", "px solid\n ", ";\n }\n\n ", "\n ", "\n ", "\n\n .", " .", " {\n height: 0; // stop overflow flash & set correct height in update-overflow-shadows.ts\n }\n\n .less-padding {\n padding: 0 ", "px;\n\n .", " {\n padding: 0 ", "px;\n\n // https://product-fabric.atlassian.net/browse/ED-16386\n // Fixes issue where the extra padding that is added here throws off the position\n // of the rows control dot\n &::after {\n right: 6px !important;\n }\n }\n\n .", " {\n padding: 0 ", "px;\n }\n\n &.", "[data-number-column='true'] {\n padding-left: ", "px;\n }\n .", ", .", " {\n width: ", "px;\n }\n\n .", " {\n left: 6px;\n }\n\n .", " {\n left: calc(100% - 6px);\n }\n }\n\n > .", " {\n /**\n * Prevent margins collapsing, aids with placing the gap-cursor correctly\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Box_Model/Mastering_margin_collapsing\n *\n * TODO: Enable this, many tests will fail!\n * border-top: 1px solid transparent;\n */\n }\n\n /* Breakout only works on top level unless wrapped in fragment mark */\n ", "\n\n ", ";\n\n /* Corner controls */\n .", " {\n width: ", "px;\n height: ", "px;\n display: none;\n\n .", " {\n position: relative;\n\n ", ";\n }\n }\n\n .", ".sticky {\n .", " {\n /* sticky row insert dot overlaps other row insert and messes things up */\n display: none !important;\n }\n }\n\n .", " {\n position: absolute;\n top: 0;\n width: ", "px;\n height: ", "px;\n border: 1px solid ", ";\n border-radius: 0;\n border-top-left-radius: ", "px;\n background: ", ";\n box-sizing: border-box;\n padding: 0;\n :focus {\n outline: none;\n }\n }\n .active .", " {\n border-color: ", ";\n background: ", ";\n }\n\n .", "[data-number-column='true'] {\n .", ", .", " {\n width: ", "px;\n }\n .", " .", " {\n border-right-width: 0;\n }\n }\n\n :not(.", ") .", ":hover {\n border-color: ", ";\n background: ", ";\n cursor: pointer;\n }\n\n :not(.", ")\n .", ".", " {\n border-color: ", ";\n background: ", ";\n }\n\n /* Row controls */\n .", " {\n width: ", "px;\n box-sizing: border-box;\n display: none;\n position: relative;\n\n ", ";\n\n .", " {\n display: flex;\n flex-direction: column;\n }\n .", ":last-child > button {\n border-bottom-left-radius: ", "px;\n }\n .", " {\n position: relative;\n margin-top: -1px;\n }\n .", ":hover,\n .", ".active,\n .", ":hover {\n z-index: ", ";\n }\n\n ", "\n }\n\n .", " {\n display: grid;\n align-items: center;\n position: absolute;\n }\n\n ", "\n\n :not(.", ") .", " {\n ", "\n ", "\n }\n\n /* Numbered column */\n .", " {\n position: relative;\n float: right;\n margin-left: ", "px;\n top: ", "px;\n width: ", "px;\n box-sizing: border-box;\n }\n\n .", " {\n border: 1px solid ", ";\n box-sizing: border-box;\n margin-top: -1px;\n padding-bottom: 2px;\n padding: 10px 2px;\n text-align: center;\n font-size: ", ";\n background-color: ", ";\n color: ", ";\n border-color: ", ";\n\n :first-child:not(style),\n style:first-child + * {\n margin-top: 0;\n }\n :last-child {\n border-bottom: 1px solid ", ";\n }\n }\n\n // add a background above the first numbered column cell when sticky header is engaged\n // which hides the table when scrolling\n .", ":first-of-type::after {\n content: '';\n display: block;\n height: 33px;\n width: 100%;\n background-color: ", ";\n position: absolute;\n\n // the extra pixel is accounting for borders\n top: -34px;\n left: -1px;\n }\n\n .", " {\n .", ", .", " {\n display: block;\n }\n .", " {\n padding-left: ", "px;\n\n .", " {\n border-left: 0 none;\n }\n\n .", ".active {\n border-bottom: 1px solid ", ";\n border-color: ", ";\n background-color: ", ";\n position: relative;\n z-index: ", ";\n color: ", ";\n }\n }\n }\n :not(.", ") .", " {\n .", ":not(.", ") {\n cursor: pointer;\n }\n .", ":not(.", "):hover {\n border-bottom: 1px solid ", ";\n border-color: ", ";\n background-color: ", ";\n position: relative;\n z-index: ", ";\n color: ", ";\n }\n .", ".", " {\n background-color: ", ";\n border: 1px solid ", ";\n border-left: 0;\n color: ", ";\n position: relative;\n z-index: ", ";\n }\n }\n\n /* Table */\n .", " > table {\n table-layout: fixed;\n white-space: normal;\n border-top: none;\n // 1px border width offset added here to prevent unwanted overflow and scolling - ED-16212\n margin-right: -1px;\n // Allows better positioning for the shadow sentinels - ED-16668\n position: relative;\n\n > tbody > tr {\n white-space: pre-wrap;\n }\n\n .", " + * {\n margin-top: 0;\n }\n\n .", " + * {\n margin-top: 0;\n }\n\n /*\n * Headings have a top margin by default, but we don't want this on the\n * first heading within table header cells.\n *\n * This specifically sets margin-top for the first heading within a header\n * cell when center/right aligned.\n */\n th.", " > .fabric-editor-block-mark {\n > h1:first-of-type,\n > h2:first-of-type,\n > h3:first-of-type,\n > h4:first-of-type,\n > h5:first-of-type,\n > h6:first-of-type {\n margin-top: 0;\n }\n }\n\n .", ", .", " {\n position: relative;\n }\n /* Give selected cells a blue overlay */\n .", "::after,\n .", "::after {\n z-index: ", ";\n position: absolute;\n content: '';\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n width: 100%;\n pointer-events: none;\n }\n .", " {\n border: 1px solid ", ";\n }\n .", "::after {\n background: ", ";\n z-index: ", ";\n }\n th.", "::after,\n td.", "::after {\n background: ", ";\n z-index: ", ";\n }\n // ED-15246: Trello card is visible through a border of a table border\n /* ED-19064: To fix when enable header column in the table,\n and selection the header column, the right border is not tableBorderSelectedColor\n when deleting the header column, the right border is not tableToolbarDeleteColor */\n td.", ",\n td.", ",\n th.", ".", ",\n th.", ".", " {\n &::after {\n height: 100%;\n width: 100%;\n border: 1px solid ", ";\n content: '';\n position: absolute;\n left: -1px;\n top: -1px;\n bottom: 0;\n z-index: ", ";\n display: inline-block;\n pointer-events: none;\n }\n &.", "::after {\n ", ";\n z-index: ", ";\n }\n }\n }\n ", "\n .", ".", " {\n z-index: ", ";\n }\n\n .", " {\n position: absolute;\n top: ", "px;\n }\n\n ", "\n }\n\n .ProseMirror.", " {\n .", " {\n overflow-x: auto;\n ", ";\n }\n }\n\n .ProseMirror.", " {\n cursor: col-resize;\n }\n\n /*\n ED-15882: When custom start numbers is enabled for lists, we have\n styles that handle this generally (in editor-common) so we can\n throw away the older table-specific styles here.\n */\n ", "\n\n ", "\n"])), _types.TableCssClassName.LAYOUT_BUTTON, "var(--ds-background-neutral, ".concat(_colors.N20A, ")"), "var(--ds-icon, ".concat(_colors.N300, ")"), _types.TableCssClassName.LAYOUT_BUTTON, _types.TableCssClassName.IS_RESIZING, "var(--ds-background-neutral-hovered, ".concat(_colors.B300, ")"), "var(--ds-icon, white)", (0, _styles.tableSharedStyle)(props), (0, _uiStyles.columnControlsLineMarker)(), (0, _uiStyles.hoveredDeleteButton)(props), (0, _uiStyles.hoveredCell)(props), _uiStyles.hoveredWarningCell, (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.drag-and-drop') && (0, _uiStyles.insertLine)(props), (0, _uiStyles.resizeHandle)(props), rangeSelectionStyles, _types.TableCssClassName.LAST_ITEM_IN_CELL, _types.TableCssClassName.TABLE_NODE_WRAPPER, _types.TableCssClassName.TABLE_CELL, _types.TableCssClassName.TABLE_HEADER_CELL, _types.TableCssClassName.TABLE_CELL, (0, _consts.tableCellBackgroundColor)(props), (0, _consts.tableBorderColor)(props), (0, _consts.tableBorderColor)(props), _types.TableCssClassName.CONTROLS_FLOATING_BUTTON_COLUMN, (0, _uiStyles.insertColumnButtonWrapper)(props), _types.TableCssClassName.CONTROLS_FLOATING_BUTTON_ROW, (0, _uiStyles.insertRowButtonWrapper)(props), (0, _uiStyles.DeleteButton)(props), _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.NUMBERED_COLUMN, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _consts.stickyRowOffsetTop + 2, _editorSharedStyles.akEditorTableNumberColumnWidth, _editorSharedStyles.akEditorStickyHeaderZIndex, _consts.stickyRowOffsetTop, "var(--ds-surface, white)", _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.CORNER_CONTROLS, _editorSharedStyles.akEditorSmallZIndex, "var(--ds-surface, white)", _consts.tableToolbarSize, _consts.tableToolbarSize, _types.TableCssClassName.CORNER_CONTROLS, _types.TableCssClassName.CONTROLS_CORNER_BUTTON, _consts.tableToolbarSize, _consts.tableToolbarSize, tableStickyHeaderColumnControlsDecorationsStyle(props), _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.ROW_CONTROLS, _types.TableCssClassName.ROW_CONTROLS_BUTTON_WRAP, _editorSharedStyles.akEditorStickyHeaderZIndex, _consts.tableToolbarSize, "var(--ds-surface, white)", _consts.tableToolbarSize, _types.TableCssClassName.TABLE_STICKY, "var(--ds-surface, green)", _consts.stickyRowOffsetTop, _editorSharedStyles.akEditorTableCellOnStickyHeaderZIndex - 5, "var(--ds-surface, white)", "var(--ds-shadow-overflow-perimeter, ".concat(_colors.N40A, ")"), _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY_SHADOW, _editorSharedStyles.akEditorTableCellOnStickyHeaderZIndex, _types.TableCssClassName.WITH_CONTROLS, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY_SHADOW, _consts.tableToolbarSize, _consts.stickyHeaderBorderBottomWidth, (0, _consts.tableBorderColor)(props), _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY, insertColumnButtonOffset + 1, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_CONTAINER, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.WITH_RESIZE_LINE, _types.TableCssClassName.WITH_RESIZE_LINE, _types.TableCssClassName.RESIZE_HANDLE_DECORATION, (_consts.resizeHandlerAreaWidth - _consts.resizeLineWidth) / 2 + 1, _types.TableCssClassName.WITH_RESIZE_LINE, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.WITH_RESIZE_LINE, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.RESIZE_HANDLE_DECORATION, (_consts.resizeHandlerAreaWidth - _consts.resizeLineWidth) / 2, _types.TableCssClassName.HOVERED_CELL, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.WITH_CONTROLS, _consts.tableControlsSpacing, _types.TableCssClassName.WITH_CONTROLS, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.NUMBERED_COLUMN, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _consts.tableControlsSpacing + 2, _types.TableCssClassName.CORNER_CONTROLS, _consts.tableControlsSpacing - _consts.tableToolbarSize + 2, "var(--ds-surface, white)", sentinelStyles, (0, _uiStyles.OverflowShadow)(props), stickyScrollbarStyles(), _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY_SHADOW, _consts.tablePadding, _types.TableCssClassName.ROW_CONTROLS_WRAPPER, _consts.tablePadding, _types.TableCssClassName.COLUMN_CONTROLS_WRAPPER, _consts.tablePadding, _types.TableCssClassName.TABLE_CONTAINER, _editorSharedStyles.akEditorTableNumberColumnWidth + _consts.tablePadding - 1, _types.TableCssClassName.TABLE_LEFT_SHADOW, _types.TableCssClassName.TABLE_RIGHT_SHADOW, _consts.tableOverflowShadowWidth, _types.TableCssClassName.TABLE_LEFT_SHADOW, _types.TableCssClassName.TABLE_RIGHT_SHADOW, _types.TableCssClassName.NODEVIEW_WRAPPER, breakoutWidthStyling(), (0, _uiStyles.columnControlsDecoration)(props), _types.TableCssClassName.CORNER_CONTROLS, _consts.tableToolbarSize + 1, cornerControlHeight, _types.TableCssClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, (0, _uiStyles.InsertMarker)(props, "\n left: -11px;\n top: 9px;\n "), _types.TableCssClassName.CORNER_CONTROLS, _types.TableCssClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, _types.TableCssClassName.CONTROLS_CORNER_BUTTON, _consts.tableToolbarSize + 1, _consts.tableToolbarSize + 1, (0, _consts.tableBorderColor)(props), _consts.tableBorderRadiusSize, (0, _consts.tableHeaderCellBackgroundColor)(props), _types.TableCssClassName.CONTROLS_CORNER_BUTTON, (0, _consts.tableBorderSelectedColor)(props), (0, _consts.tableToolbarSelectedColor)(props), _types.TableCssClassName.TABLE_CONTAINER, _types.TableCssClassName.CORNER_CONTROLS, _types.TableCssClassName.CONTROLS_CORNER_BUTTON, (0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width') ? _editorSharedStyles.akEditorTableToolbarSize + _editorSharedStyles.akEditorTableNumberColumnWidth + 1 : _editorSharedStyles.akEditorTableToolbarSize + _editorSharedStyles.akEditorTableNumberColumnWidth, _types.TableCssClassName.ROW_CONTROLS, _types.TableCssClassName.CONTROLS_BUTTON, _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.CONTROLS_CORNER_BUTTON, (0, _consts.tableBorderSelectedColor)(props), (0, _consts.tableToolbarSelectedColor)(props), _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.CONTROLS_CORNER_BUTTON, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, (0, _consts.tableBorderDeleteColor)(props), (0, _consts.tableToolbarDeleteColor)(props), _types.TableCssClassName.ROW_CONTROLS, _consts.tableToolbarSize, (0, _uiStyles.InsertMarker)(props, "\n bottom: -1px;\n left: -11px;\n "), _types.TableCssClassName.ROW_CONTROLS_INNER, _types.TableCssClassName.ROW_CONTROLS_BUTTON_WRAP, _consts.tableBorderRadiusSize, _types.TableCssClassName.ROW_CONTROLS_BUTTON_WRAP, _types.TableCssClassName.ROW_CONTROLS_BUTTON_WRAP, _types.TableCssClassName.ROW_CONTROLS_BUTTON_WRAP, _types.TableCssClassName.CONTROLS_BUTTON, _editorSharedStyles.akEditorUnitZIndex, (0, _uiStyles.HeaderButton)(props, "\n border-bottom: 1px solid ".concat((0, _consts.tableBorderColor)(props), ";\n border-right: 0px;\n border-radius: 0;\n height: 100%;\n width: ").concat(_consts.tableToolbarSize, "px;\n\n .").concat(_types.TableCssClassName.CONTROLS_BUTTON_OVERLAY, " {\n position: absolute;\n width: 30px;\n height: 50%;\n right: 0;\n bottom: 0;\n }\n .").concat(_types.TableCssClassName.CONTROLS_BUTTON_OVERLAY, ":first-of-type {\n top: 0;\n }\n ")), _types.TableCssClassName.ROW_CONTROLS_WITH_DRAG, (0, _uiStyles.floatingColumnControls)(props), _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.ROW_CONTROLS, (0, _uiStyles.HeaderButtonHover)(props), (0, _uiStyles.HeaderButtonDanger)(props), _types.TableCssClassName.NUMBERED_COLUMN, (0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width') ? _editorSharedStyles.akEditorTableToolbarSize : _editorSharedStyles.akEditorTableToolbarSize - 1, (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.drag-and-drop') ? 0 : _editorSharedStyles.akEditorTableToolbarSize, _editorSharedStyles.akEditorTableNumberColumnWidth + 1, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, (0, _consts.tableBorderColor)(props), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), (0, _consts.tableHeaderCellBackgroundColor)(props), (0, _consts.tableTextColor)(props), (0, _consts.tableBorderColor)(props), (0, _consts.tableBorderColor)(props), _types.TableCssClassName.NUMBERED_COLUMN_BUTTON_DISABLED, "var(--ds-surface, white)", _types.TableCssClassName.WITH_CONTROLS, _types.TableCssClassName.CORNER_CONTROLS, _types.TableCssClassName.ROW_CONTROLS, _types.TableCssClassName.NUMBERED_COLUMN, (0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width') ? 0 : 1, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, (0, _consts.tableBorderSelectedColor)(props), (0, _consts.tableBorderSelectedColor)(props), (0, _consts.tableToolbarSelectedColor)(props), _editorSharedStyles.akEditorUnitZIndex, "var(--ds-text-selected, ".concat(_colors.N0, ")"), _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.WITH_CONTROLS, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON_DISABLED, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON_DISABLED, (0, _consts.tableBorderSelectedColor)(props), (0, _consts.tableBorderSelectedColor)(props), (0, _consts.tableToolbarSelectedColor)(props), _editorSharedStyles.akEditorUnitZIndex, "var(--ds-text-selected, ".concat(_colors.N0, ")"), _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, (0, _consts.tableToolbarDeleteColor)(props), (0, _consts.tableBorderDeleteColor)(props), "var(--ds-text-danger, ".concat(_colors.R500, ")"), _editorSharedStyles.akEditorUnitZIndex, _types.TableCssClassName.TABLE_NODE_WRAPPER, _types.TableCssClassName.COLUMN_CONTROLS_DECORATIONS, _types.TableCssClassName.COLUMN_CONTROLS_DECORATIONS_WITH_DRAG, _types.TableCssClassName.TABLE_HEADER_CELL, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, _editorSharedStyles.akEditorSmallZIndex, _types.TableCssClassName.SELECTED_CELL, (0, _consts.tableBorderSelectedColor)(props), _types.TableCssClassName.SELECTED_CELL, (0, _consts.tableCellSelectedColor)(props), _editorSharedStyles.akEditorSmallZIndex, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, (0, _consts.tableCellDeleteColor)(props), _editorSharedStyles.akEditorUnitZIndex * 100, _types.TableCssClassName.HOVERED_CELL, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.TABLE_HEADER_CELL, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.TABLE_HEADER_CELL, _types.TableCssClassName.HOVERED_CELL, (0, _consts.tableBorderSelectedColor)(props), _editorSharedStyles.akEditorSmallZIndex, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, tableBorderStyles(props), _editorSharedStyles.akEditorUnitZIndex * 100, tableRowControlStyles(), _types.TableCssClassName.ROW_CONTROLS_WRAPPER, _types.TableCssClassName.TABLE_LEFT_SHADOW, _editorSharedStyles.akEditorUnitZIndex, _types.TableCssClassName.COLUMN_CONTROLS_WRAPPER, _styles.tableMarginTop + 1, tableWrapperStyles(), _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.TABLE_NODE_WRAPPER, _scrollbar.scrollbarStyles, _types.TableCssClassName.RESIZE_CURSOR, props !== null && props !== void 0 && (_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.restartNumberedLists ? "" : listLargeNumericMarkersOldStyles, shadowSentinelStyles);
|
|
71
|
+
return (0, _react.css)(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n .", " button {\n background: ", ";\n color: ", ";\n cursor: none;\n }\n\n .", ":not(.", ") button:hover {\n background: ", ";\n color: ", " !important;\n cursor: pointer;\n }\n\n .ProseMirror {\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n\n .", " {\n margin-bottom: 0;\n }\n\n .", " {\n td.", ", th.", " {\n position: relative;\n overflow: visible;\n }\n\n td.", " {\n background-color: ", ";\n\n // ED-15246: Trello card is visible through a border of a table border\n // This fixes a border issue caused by relative positioned table cells\n &::after {\n height: 100%;\n content: '';\n border-left: 1px solid ", ";\n border-bottom: 1px solid ", ";\n position: absolute;\n right: 0px;\n top: 0px;\n bottom: 0;\n width: 100%;\n display: inline-block;\n pointer-events: none;\n }\n }\n }\n\n .", " {\n ", "\n }\n\n .", " {\n ", "\n }\n\n /* Delete button */\n ", "\n /* Ends Delete button */\n\n /* sticky styles */\n .", " .", " .", ":first-of-type {\n margin-top: ", "px;\n width: ", "px;\n\n position: fixed !important;\n z-index: ", " !important;\n box-shadow: 0px -", "px ", ";\n border-right: 0 none;\n /* top set by NumberColumn component */\n }\n\n .", " .", ".sticky {\n position: fixed !important;\n /* needs to be above row controls */\n z-index: ", " !important;\n background: ", ";\n\n width: ", "px;\n height: ", "px;\n }\n\n .", ".sticky .", " {\n border-bottom: 0px none;\n border-right: 0px none;\n\n height: ", "px;\n width: ", "px;\n }\n\n ", "\n\n .", "\n .", "\n .", ".sticky {\n position: fixed !important;\n z-index: ", " !important;\n display: flex;\n border-left: ", "px solid\n ", ";\n margin-left: -", "px;\n }\n\n .", " col:first-of-type {\n /* moving rows out of a table layout does weird things in Chrome */\n border-right: 1px solid ", ";\n }\n\n tr.sticky {\n padding-top: ", "px;\n position: fixed;\n display: grid;\n\n /* to keep it above cell selection but below date and other nodes popups that are inside sticky header */\n z-index: ", ";\n\n overflow-y: visible;\n overflow-x: hidden;\n\n grid-auto-flow: column;\n\n /* background for where controls apply */\n background: ", ";\n box-sizing: content-box;\n\n margin-top: 2px;\n\n box-shadow: 0 6px 4px -4px ", ";\n margin-left: -1px;\n\n &.no-pointer-events {\n pointer-events: none;\n }\n }\n\n .", " .", " {\n left: unset;\n position: fixed;\n /* needs to be above sticky header row and below date and other nodes popups that are inside sticky header */\n z-index: ", ";\n }\n\n .", ".", "\n .", " {\n padding-bottom: ", "px;\n }\n\n tr.sticky th {\n border-bottom: ", "px solid\n ", ";\n margin-right: -1px;\n }\n\n .", " tr.sticky > th:last-child {\n border-right-width: 1px;\n }\n\n /* add left edge for first cell */\n .", " tr.sticky > th:first-of-type {\n margin-left: 0px;\n }\n\n /* add a little bit so the scroll lines up with the table */\n .", " tr.sticky::after {\n content: ' ';\n width: ", "px;\n }\n\n /* To fix jumpiness caused in Chrome Browsers for sticky headers */\n .", " .sticky + tr {\n min-height: 0px;\n }\n\n /* move resize line a little in sticky bar */\n .", ".", " {\n tr.sticky\n td.", ",\n tr.sticky\n th.", " {\n .", "::after {\n right: ", "px;\n }\n }\n\n /* when selected put it back to normal -- :not selector would be nicer */\n tr.sticky\n td.", ".", ",\n tr.sticky\n th.", ".", " {\n .", "::after {\n right: ", "px;\n }\n }\n }\n\n tr.sticky\n .", ",\n tr.sticky\n .", " {\n z-index: 1;\n }\n\n .", " tr.sticky {\n padding-top: ", "px;\n }\n\n .", ".", "\n .", "\n .", ":first-of-type {\n margin-top: ", "px;\n }\n\n .", ".sticky {\n border-top: ", "px solid\n ", ";\n }\n\n ", "\n ", "\n ", "\n\n .", " .", " {\n height: 0; // stop overflow flash & set correct height in update-overflow-shadows.ts\n }\n\n .less-padding {\n padding: 0 ", "px;\n\n .", " {\n padding: 0 ", "px;\n\n // https://product-fabric.atlassian.net/browse/ED-16386\n // Fixes issue where the extra padding that is added here throws off the position\n // of the rows control dot\n &::after {\n right: 6px !important;\n }\n }\n\n .", " {\n padding: 0 ", "px;\n }\n\n &.", "[data-number-column='true'] {\n padding-left: ", "px;\n }\n .", ", .", " {\n width: ", "px;\n }\n\n .", " {\n left: 6px;\n }\n\n .", " {\n left: calc(100% - 6px);\n }\n }\n\n > .", " {\n /**\n * Prevent margins collapsing, aids with placing the gap-cursor correctly\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Box_Model/Mastering_margin_collapsing\n *\n * TODO: Enable this, many tests will fail!\n * border-top: 1px solid transparent;\n */\n }\n\n /* Breakout only works on top level unless wrapped in fragment mark */\n ", "\n\n ", ";\n\n /* Corner controls */\n .", " {\n width: ", "px;\n height: ", "px;\n display: none;\n\n .", " {\n position: relative;\n\n ", ";\n }\n }\n\n .", ".sticky {\n .", " {\n /* sticky row insert dot overlaps other row insert and messes things up */\n display: none !important;\n }\n }\n\n .", " {\n position: absolute;\n top: 0;\n width: ", "px;\n height: ", "px;\n border: 1px solid ", ";\n border-radius: 0;\n border-top-left-radius: ", "px;\n background: ", ";\n box-sizing: border-box;\n padding: 0;\n :focus {\n outline: none;\n }\n }\n .active .", " {\n border-color: ", ";\n background: ", ";\n }\n\n .", "[data-number-column='true'] {\n .", ", .", " {\n width: ", "px;\n }\n .", " .", " {\n border-right-width: 0;\n }\n }\n\n :not(.", ") .", ":hover {\n border-color: ", ";\n background: ", ";\n cursor: pointer;\n }\n\n :not(.", ")\n .", ".", " {\n border-color: ", ";\n background: ", ";\n }\n\n /* Row controls */\n .", " {\n width: ", "px;\n box-sizing: border-box;\n display: none;\n position: relative;\n\n ", ";\n\n .", " {\n display: flex;\n flex-direction: column;\n }\n .", ":last-child > button {\n border-bottom-left-radius: ", "px;\n }\n .", " {\n position: relative;\n margin-top: -1px;\n }\n .", ":hover,\n .", ".active,\n .", ":hover {\n z-index: ", ";\n }\n\n ", "\n }\n\n .", " {\n display: grid;\n align-items: center;\n position: absolute;\n left: -4px;\n }\n\n .", " {\n cursor: grab;\n width: max-content;\n padding: 0;\n border: none;\n background: none;\n }\n\n ", "\n\n :not(.", ") .", " {\n ", "\n ", "\n }\n\n /* Numbered column */\n .", " {\n position: relative;\n float: right;\n margin-left: ", "px;\n top: ", "px;\n width: ", "px;\n box-sizing: border-box;\n }\n\n .", " {\n border: 1px solid ", ";\n box-sizing: border-box;\n margin-top: -1px;\n padding-bottom: 2px;\n padding: 10px 2px;\n text-align: center;\n font-size: ", ";\n background-color: ", ";\n color: ", ";\n border-color: ", ";\n\n :first-child:not(style),\n style:first-child + * {\n margin-top: 0;\n }\n :last-child {\n border-bottom: 1px solid ", ";\n }\n }\n\n // add a background above the first numbered column cell when sticky header is engaged\n // which hides the table when scrolling\n .", ":first-of-type::after {\n content: '';\n display: block;\n height: 33px;\n width: 100%;\n background-color: ", ";\n position: absolute;\n\n // the extra pixel is accounting for borders\n top: -34px;\n left: -1px;\n }\n\n .", " {\n .", ", .", " {\n display: block;\n }\n .", " {\n padding-left: ", "px;\n\n .", " {\n border-left: 0 none;\n }\n\n .", ".active {\n border-bottom: 1px solid ", ";\n border-color: ", ";\n background-color: ", ";\n position: relative;\n z-index: ", ";\n color: ", ";\n }\n }\n }\n :not(.", ") .", " {\n .", ":not(.", ") {\n cursor: pointer;\n }\n .", ":not(.", "):hover {\n border-bottom: 1px solid ", ";\n border-color: ", ";\n background-color: ", ";\n position: relative;\n z-index: ", ";\n color: ", ";\n }\n .", ".", " {\n background-color: ", ";\n border: 1px solid ", ";\n border-left: 0;\n color: ", ";\n position: relative;\n z-index: ", ";\n }\n }\n\n /* Table */\n .", " > table {\n table-layout: fixed;\n white-space: normal;\n border-top: none;\n // 1px border width offset added here to prevent unwanted overflow and scolling - ED-16212\n margin-right: -1px;\n // Allows better positioning for the shadow sentinels - ED-16668\n position: relative;\n\n > tbody > tr {\n white-space: pre-wrap;\n }\n\n .", " + * {\n margin-top: 0;\n }\n\n .", " + * {\n margin-top: 0;\n }\n\n /*\n * Headings have a top margin by default, but we don't want this on the\n * first heading within table header cells.\n *\n * This specifically sets margin-top for the first heading within a header\n * cell when center/right aligned.\n */\n th.", " > .fabric-editor-block-mark {\n > h1:first-of-type,\n > h2:first-of-type,\n > h3:first-of-type,\n > h4:first-of-type,\n > h5:first-of-type,\n > h6:first-of-type {\n margin-top: 0;\n }\n }\n\n .", ", .", " {\n position: relative;\n }\n /* Give selected cells a blue overlay */\n .", "::after,\n .", "::after {\n z-index: ", ";\n position: absolute;\n content: '';\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n width: 100%;\n pointer-events: none;\n }\n .", " {\n border: 1px solid ", ";\n }\n .", "::after {\n background: ", ";\n z-index: ", ";\n }\n th.", "::after,\n td.", "::after {\n background: ", ";\n z-index: ", ";\n }\n // ED-15246: Trello card is visible through a border of a table border\n /* ED-19064: To fix when enable header column in the table,\n and selection the header column, the right border is not tableBorderSelectedColor\n when deleting the header column, the right border is not tableToolbarDeleteColor */\n td.", ",\n td.", ",\n th.", ".", ",\n th.", ".", " {\n &::after {\n height: 100%;\n width: 100%;\n border: 1px solid ", ";\n content: '';\n position: absolute;\n left: -1px;\n top: -1px;\n bottom: 0;\n z-index: ", ";\n display: inline-block;\n pointer-events: none;\n }\n &.", "::after {\n ", ";\n z-index: ", ";\n }\n }\n }\n ", "\n .", ".", " {\n z-index: ", ";\n }\n\n .", " {\n position: absolute;\n top: ", "px;\n }\n\n ", "\n }\n\n .ProseMirror.", " {\n .", " {\n overflow-x: auto;\n ", ";\n }\n }\n\n .ProseMirror.", " {\n cursor: col-resize;\n }\n\n /*\n ED-15882: When custom start numbers is enabled for lists, we have\n styles that handle this generally (in editor-common) so we can\n throw away the older table-specific styles here.\n */\n ", "\n\n ", "\n"])), _types.TableCssClassName.LAYOUT_BUTTON, "var(--ds-background-neutral, ".concat(_colors.N20A, ")"), "var(--ds-icon, ".concat(_colors.N300, ")"), _types.TableCssClassName.LAYOUT_BUTTON, _types.TableCssClassName.IS_RESIZING, "var(--ds-background-neutral-hovered, ".concat(_colors.B300, ")"), "var(--ds-icon, white)", (0, _styles.tableSharedStyle)(props), (0, _uiStyles.columnControlsLineMarker)(), (0, _uiStyles.hoveredDeleteButton)(props), (0, _uiStyles.hoveredCell)(props), _uiStyles.hoveredWarningCell, (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.drag-and-drop') && (0, _uiStyles.insertLine)(props), (0, _uiStyles.resizeHandle)(props), rangeSelectionStyles, _types.TableCssClassName.LAST_ITEM_IN_CELL, _types.TableCssClassName.TABLE_NODE_WRAPPER, _types.TableCssClassName.TABLE_CELL, _types.TableCssClassName.TABLE_HEADER_CELL, _types.TableCssClassName.TABLE_CELL, (0, _consts.tableCellBackgroundColor)(props), (0, _consts.tableBorderColor)(props), (0, _consts.tableBorderColor)(props), _types.TableCssClassName.CONTROLS_FLOATING_BUTTON_COLUMN, (0, _uiStyles.insertColumnButtonWrapper)(props), _types.TableCssClassName.CONTROLS_FLOATING_BUTTON_ROW, (0, _uiStyles.insertRowButtonWrapper)(props), (0, _uiStyles.DeleteButton)(props), _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.NUMBERED_COLUMN, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _consts.stickyRowOffsetTop + 2, _editorSharedStyles.akEditorTableNumberColumnWidth, _editorSharedStyles.akEditorStickyHeaderZIndex, _consts.stickyRowOffsetTop, "var(--ds-surface, white)", _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.CORNER_CONTROLS, _editorSharedStyles.akEditorSmallZIndex, "var(--ds-surface, white)", _consts.tableToolbarSize, _consts.tableToolbarSize, _types.TableCssClassName.CORNER_CONTROLS, _types.TableCssClassName.CONTROLS_CORNER_BUTTON, _consts.tableToolbarSize, _consts.tableToolbarSize, tableStickyHeaderColumnControlsDecorationsStyle(props), _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.ROW_CONTROLS, _types.TableCssClassName.ROW_CONTROLS_BUTTON_WRAP, _editorSharedStyles.akEditorStickyHeaderZIndex, _consts.tableToolbarSize, "var(--ds-surface, white)", _consts.tableToolbarSize, _types.TableCssClassName.TABLE_STICKY, "var(--ds-surface, green)", _consts.stickyRowOffsetTop, _editorSharedStyles.akEditorTableCellOnStickyHeaderZIndex - 5, "var(--ds-surface, white)", "var(--ds-shadow-overflow-perimeter, ".concat(_colors.N40A, ")"), _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY_SHADOW, _editorSharedStyles.akEditorTableCellOnStickyHeaderZIndex, _types.TableCssClassName.WITH_CONTROLS, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY_SHADOW, _consts.tableToolbarSize, _consts.stickyHeaderBorderBottomWidth, (0, _consts.tableBorderColor)(props), _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY, insertColumnButtonOffset + 1, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_CONTAINER, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.WITH_RESIZE_LINE, _types.TableCssClassName.WITH_RESIZE_LINE, _types.TableCssClassName.RESIZE_HANDLE_DECORATION, (_consts.resizeHandlerAreaWidth - _consts.resizeLineWidth) / 2 + 1, _types.TableCssClassName.WITH_RESIZE_LINE, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.WITH_RESIZE_LINE, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.RESIZE_HANDLE_DECORATION, (_consts.resizeHandlerAreaWidth - _consts.resizeLineWidth) / 2, _types.TableCssClassName.HOVERED_CELL, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.WITH_CONTROLS, _consts.tableControlsSpacing, _types.TableCssClassName.WITH_CONTROLS, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.NUMBERED_COLUMN, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _consts.tableControlsSpacing + 2, _types.TableCssClassName.CORNER_CONTROLS, _consts.tableControlsSpacing - _consts.tableToolbarSize + 2, "var(--ds-surface, white)", sentinelStyles, (0, _uiStyles.OverflowShadow)(props), stickyScrollbarStyles(), _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY_SHADOW, _consts.tablePadding, _types.TableCssClassName.ROW_CONTROLS_WRAPPER, _consts.tablePadding, _types.TableCssClassName.COLUMN_CONTROLS_WRAPPER, _consts.tablePadding, _types.TableCssClassName.TABLE_CONTAINER, _editorSharedStyles.akEditorTableNumberColumnWidth + _consts.tablePadding - 1, _types.TableCssClassName.TABLE_LEFT_SHADOW, _types.TableCssClassName.TABLE_RIGHT_SHADOW, _consts.tableOverflowShadowWidth, _types.TableCssClassName.TABLE_LEFT_SHADOW, _types.TableCssClassName.TABLE_RIGHT_SHADOW, _types.TableCssClassName.NODEVIEW_WRAPPER, breakoutWidthStyling(), (0, _uiStyles.columnControlsDecoration)(props), _types.TableCssClassName.CORNER_CONTROLS, _consts.tableToolbarSize + 1, cornerControlHeight, _types.TableCssClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, (0, _uiStyles.InsertMarker)(props, "\n left: -11px;\n top: 9px;\n "), _types.TableCssClassName.CORNER_CONTROLS, _types.TableCssClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, _types.TableCssClassName.CONTROLS_CORNER_BUTTON, _consts.tableToolbarSize + 1, _consts.tableToolbarSize + 1, (0, _consts.tableBorderColor)(props), _consts.tableBorderRadiusSize, (0, _consts.tableHeaderCellBackgroundColor)(props), _types.TableCssClassName.CONTROLS_CORNER_BUTTON, (0, _consts.tableBorderSelectedColor)(props), (0, _consts.tableToolbarSelectedColor)(props), _types.TableCssClassName.TABLE_CONTAINER, _types.TableCssClassName.CORNER_CONTROLS, _types.TableCssClassName.CONTROLS_CORNER_BUTTON, (0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width') ? _editorSharedStyles.akEditorTableToolbarSize + _editorSharedStyles.akEditorTableNumberColumnWidth + 1 : _editorSharedStyles.akEditorTableToolbarSize + _editorSharedStyles.akEditorTableNumberColumnWidth, _types.TableCssClassName.ROW_CONTROLS, _types.TableCssClassName.CONTROLS_BUTTON, _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.CONTROLS_CORNER_BUTTON, (0, _consts.tableBorderSelectedColor)(props), (0, _consts.tableToolbarSelectedColor)(props), _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.CONTROLS_CORNER_BUTTON, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, (0, _consts.tableBorderDeleteColor)(props), (0, _consts.tableToolbarDeleteColor)(props), _types.TableCssClassName.ROW_CONTROLS, _consts.tableToolbarSize, (0, _uiStyles.InsertMarker)(props, "\n bottom: -1px;\n left: -11px;\n "), _types.TableCssClassName.ROW_CONTROLS_INNER, _types.TableCssClassName.ROW_CONTROLS_BUTTON_WRAP, _consts.tableBorderRadiusSize, _types.TableCssClassName.ROW_CONTROLS_BUTTON_WRAP, _types.TableCssClassName.ROW_CONTROLS_BUTTON_WRAP, _types.TableCssClassName.ROW_CONTROLS_BUTTON_WRAP, _types.TableCssClassName.CONTROLS_BUTTON, _editorSharedStyles.akEditorUnitZIndex, (0, _uiStyles.HeaderButton)(props, "\n border-bottom: 1px solid ".concat((0, _consts.tableBorderColor)(props), ";\n border-right: 0px;\n border-radius: 0;\n height: 100%;\n width: ").concat(_consts.tableToolbarSize, "px;\n\n .").concat(_types.TableCssClassName.CONTROLS_BUTTON_OVERLAY, " {\n position: absolute;\n width: 30px;\n height: 50%;\n right: 0;\n bottom: 0;\n }\n .").concat(_types.TableCssClassName.CONTROLS_BUTTON_OVERLAY, ":first-of-type {\n top: 0;\n }\n ")), _types.TableCssClassName.ROW_CONTROLS_WITH_DRAG, _types.TableCssClassName.DRAG_HANDLE_BUTTON_CONTAINER, (0, _uiStyles.floatingColumnControls)(props), _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.ROW_CONTROLS, (0, _uiStyles.HeaderButtonHover)(props), (0, _uiStyles.HeaderButtonDanger)(props), _types.TableCssClassName.NUMBERED_COLUMN, (0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width') ? _editorSharedStyles.akEditorTableToolbarSize : _editorSharedStyles.akEditorTableToolbarSize - 1, (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.drag-and-drop') ? 0 : _editorSharedStyles.akEditorTableToolbarSize, _editorSharedStyles.akEditorTableNumberColumnWidth + 1, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, (0, _consts.tableBorderColor)(props), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), (0, _consts.tableHeaderCellBackgroundColor)(props), (0, _consts.tableTextColor)(props), (0, _consts.tableBorderColor)(props), (0, _consts.tableBorderColor)(props), _types.TableCssClassName.NUMBERED_COLUMN_BUTTON_DISABLED, "var(--ds-surface, white)", _types.TableCssClassName.WITH_CONTROLS, _types.TableCssClassName.CORNER_CONTROLS, _types.TableCssClassName.ROW_CONTROLS, _types.TableCssClassName.NUMBERED_COLUMN, (0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width') ? 0 : 1, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, (0, _consts.tableBorderSelectedColor)(props), (0, _consts.tableBorderSelectedColor)(props), (0, _consts.tableToolbarSelectedColor)(props), _editorSharedStyles.akEditorUnitZIndex, "var(--ds-text-selected, ".concat(_colors.N0, ")"), _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.WITH_CONTROLS, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON_DISABLED, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON_DISABLED, (0, _consts.tableBorderSelectedColor)(props), (0, _consts.tableBorderSelectedColor)(props), (0, _consts.tableToolbarSelectedColor)(props), _editorSharedStyles.akEditorUnitZIndex, "var(--ds-text-selected, ".concat(_colors.N0, ")"), _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, (0, _consts.tableToolbarDeleteColor)(props), (0, _consts.tableBorderDeleteColor)(props), "var(--ds-text-danger, ".concat(_colors.R500, ")"), _editorSharedStyles.akEditorUnitZIndex, _types.TableCssClassName.TABLE_NODE_WRAPPER, _types.TableCssClassName.COLUMN_CONTROLS_DECORATIONS, _types.TableCssClassName.COLUMN_CONTROLS_DECORATIONS_WITH_DRAG, _types.TableCssClassName.TABLE_HEADER_CELL, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, _editorSharedStyles.akEditorSmallZIndex, _types.TableCssClassName.SELECTED_CELL, (0, _consts.tableBorderSelectedColor)(props), _types.TableCssClassName.SELECTED_CELL, (0, _consts.tableCellSelectedColor)(props), _editorSharedStyles.akEditorSmallZIndex, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, (0, _consts.tableCellDeleteColor)(props), _editorSharedStyles.akEditorUnitZIndex * 100, _types.TableCssClassName.HOVERED_CELL, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.TABLE_HEADER_CELL, _types.TableCssClassName.SELECTED_CELL, _types.TableCssClassName.TABLE_HEADER_CELL, _types.TableCssClassName.HOVERED_CELL, (0, _consts.tableBorderSelectedColor)(props), _editorSharedStyles.akEditorSmallZIndex, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, tableBorderStyles(props), _editorSharedStyles.akEditorUnitZIndex * 100, tableRowControlStyles(), _types.TableCssClassName.ROW_CONTROLS_WRAPPER, _types.TableCssClassName.TABLE_LEFT_SHADOW, _editorSharedStyles.akEditorUnitZIndex, _types.TableCssClassName.COLUMN_CONTROLS_WRAPPER, _styles.tableMarginTop + 1, tableWrapperStyles(), _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.TABLE_NODE_WRAPPER, _scrollbar.scrollbarStyles, _types.TableCssClassName.RESIZE_CURSOR, props !== null && props !== void 0 && (_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.restartNumberedLists ? "" : listLargeNumericMarkersOldStyles, shadowSentinelStyles);
|
|
72
72
|
};
|
|
73
73
|
var tableFullPageEditorStyles = exports.tableFullPageEditorStyles = (0, _react.css)(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror .", " > table {\n margin-left: 0;\n // 1px border width offset added here to prevent unwanted overflow and scolling - ED-16212\n margin-right: -1px;\n width: 100%;\n }\n"])), _types.TableCssClassName.TABLE_NODE_WRAPPER);
|
|
74
74
|
var tableCommentEditorStyles = exports.tableCommentEditorStyles = (0, _react.css)(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror .", " > table {\n margin-left: 0;\n margin-right: 0;\n ", ";\n }\n"])), _types.TableCssClassName.TABLE_NODE_WRAPPER, _scrollbar.scrollbarStyles);
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.DragHandleIcon = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
10
|
+
|
|
11
|
+
var DragHandleIcon = exports.DragHandleIcon = function DragHandleIcon(_ref) {
|
|
12
|
+
var backgroundColor = _ref.backgroundColor,
|
|
13
|
+
foregroundColor = _ref.foregroundColor;
|
|
14
|
+
return /*#__PURE__*/_react.default.createElement("svg", {
|
|
15
|
+
width: "28",
|
|
16
|
+
height: "20",
|
|
17
|
+
viewBox: "0 0 28 20",
|
|
18
|
+
fill: "none",
|
|
19
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
20
|
+
}, /*#__PURE__*/_react.default.createElement("rect", {
|
|
21
|
+
x: "1",
|
|
22
|
+
y: "1",
|
|
23
|
+
width: "26",
|
|
24
|
+
height: "18",
|
|
25
|
+
rx: "5",
|
|
26
|
+
fill: backgroundColor || '#F1F2F4'
|
|
27
|
+
}), /*#__PURE__*/_react.default.createElement("g", {
|
|
28
|
+
clipPath: "url(#clip0_125_45007)"
|
|
29
|
+
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
30
|
+
d: "M11 12C11 11.4477 10.5523 11 10 11C9.44772 11 9 11.4477 9 12C9 12.5523 9.44772 13 10 13C10.5523 13 11 12.5523 11 12Z",
|
|
31
|
+
fill: foregroundColor || '#626F86'
|
|
32
|
+
}), /*#__PURE__*/_react.default.createElement("path", {
|
|
33
|
+
d: "M11 8C11 7.44772 10.5523 7 10 7C9.44772 7 9 7.44772 9 8C9 8.55228 9.44772 9 10 9C10.5523 9 11 8.55228 11 8Z",
|
|
34
|
+
fill: foregroundColor || '#626F86'
|
|
35
|
+
}), /*#__PURE__*/_react.default.createElement("path", {
|
|
36
|
+
d: "M19 12C19 11.4477 18.5523 11 18 11C17.4477 11 17 11.4477 17 12C17 12.5523 17.4477 13 18 13C18.5523 13 19 12.5523 19 12Z",
|
|
37
|
+
fill: foregroundColor || '#626F86'
|
|
38
|
+
}), /*#__PURE__*/_react.default.createElement("path", {
|
|
39
|
+
d: "M19 8C19 7.44772 18.5523 7 18 7C17.4477 7 17 7.44772 17 8C17 8.55228 17.4477 9 18 9C18.5523 9 19 8.55228 19 8Z",
|
|
40
|
+
fill: foregroundColor || '#626F86'
|
|
41
|
+
}), /*#__PURE__*/_react.default.createElement("path", {
|
|
42
|
+
d: "M15 12C15 11.4477 14.5523 11 14 11C13.4477 11 13 11.4477 13 12C13 12.5523 13.4477 13 14 13C14.5523 13 15 12.5523 15 12Z",
|
|
43
|
+
fill: foregroundColor || '#626F86'
|
|
44
|
+
}), /*#__PURE__*/_react.default.createElement("path", {
|
|
45
|
+
d: "M15 8C15 7.44772 14.5523 7 14 7C13.4477 7 13 7.44772 13 8C13 8.55228 13.4477 9 14 9C14.5523 9 15 8.55228 15 8Z",
|
|
46
|
+
fill: foregroundColor || '#626F86'
|
|
47
|
+
})), /*#__PURE__*/_react.default.createElement("rect", {
|
|
48
|
+
x: "1",
|
|
49
|
+
y: "1",
|
|
50
|
+
width: "26",
|
|
51
|
+
height: "18",
|
|
52
|
+
rx: "5",
|
|
53
|
+
stroke: "white",
|
|
54
|
+
strokeWidth: "2"
|
|
55
|
+
}), /*#__PURE__*/_react.default.createElement("defs", null, /*#__PURE__*/_react.default.createElement("clipPath", {
|
|
56
|
+
id: "clip0_125_45007"
|
|
57
|
+
}, /*#__PURE__*/_react.default.createElement("rect", {
|
|
58
|
+
width: "16",
|
|
59
|
+
height: "24",
|
|
60
|
+
fill: "white",
|
|
61
|
+
transform: "matrix(0 -1 1 0 2 18)"
|
|
62
|
+
}))));
|
|
63
|
+
};
|
|
@@ -150,16 +150,17 @@ export default class TableRow extends TableNodeView {
|
|
|
150
150
|
if (this.dropTargetCleanup) {
|
|
151
151
|
this.dropTargetCleanup();
|
|
152
152
|
}
|
|
153
|
-
const resolvedPos = this.view.state.doc.resolve(pos);
|
|
154
|
-
const targetIndex = resolvedPos.index();
|
|
155
|
-
const localId = resolvedPos.parent.attrs.localId;
|
|
156
153
|
this.dropTargetCleanup = dropTargetForElements({
|
|
157
154
|
element: element,
|
|
158
|
-
canDrop({
|
|
155
|
+
canDrop: ({
|
|
159
156
|
source
|
|
160
|
-
}) {
|
|
157
|
+
}) => {
|
|
161
158
|
var _data$indexes, _data$indexes2;
|
|
162
159
|
const data = source.data;
|
|
160
|
+
const {
|
|
161
|
+
localId,
|
|
162
|
+
targetIndex
|
|
163
|
+
} = this.getCurrentData();
|
|
163
164
|
return (
|
|
164
165
|
// Only draggables of row type can be dropped on this target
|
|
165
166
|
data.type === 'table-row' &&
|
|
@@ -169,10 +170,15 @@ export default class TableRow extends TableNodeView {
|
|
|
169
170
|
!!((_data$indexes = data.indexes) !== null && _data$indexes !== void 0 && _data$indexes.length) && ((_data$indexes2 = data.indexes) === null || _data$indexes2 === void 0 ? void 0 : _data$indexes2.indexOf(targetIndex)) === -1
|
|
170
171
|
);
|
|
171
172
|
},
|
|
172
|
-
|
|
173
|
+
getIsSticky: () => true,
|
|
174
|
+
getData: ({
|
|
173
175
|
input,
|
|
174
176
|
element
|
|
175
|
-
}) {
|
|
177
|
+
}) => {
|
|
178
|
+
const {
|
|
179
|
+
localId,
|
|
180
|
+
targetIndex
|
|
181
|
+
} = this.getCurrentData();
|
|
176
182
|
const data = {
|
|
177
183
|
localId,
|
|
178
184
|
type: 'table-row',
|
|
@@ -186,6 +192,15 @@ export default class TableRow extends TableNodeView {
|
|
|
186
192
|
}
|
|
187
193
|
});
|
|
188
194
|
}
|
|
195
|
+
getCurrentData() {
|
|
196
|
+
const resolvedPos = this.view.state.doc.resolve(this.getPos());
|
|
197
|
+
const targetIndex = resolvedPos.index();
|
|
198
|
+
const localId = resolvedPos.parent.attrs.localId;
|
|
199
|
+
return {
|
|
200
|
+
targetIndex,
|
|
201
|
+
localId
|
|
202
|
+
};
|
|
203
|
+
}
|
|
189
204
|
subscribe() {
|
|
190
205
|
this.editorScrollableElement = findOverflowScrollParent(this.view.dom) || window;
|
|
191
206
|
if (this.editorScrollableElement) {
|
|
@@ -80,6 +80,7 @@ export const TableCssClassName = {
|
|
|
80
80
|
/** Controls with drag handle */
|
|
81
81
|
COLUMN_CONTROLS_DECORATIONS_WITH_DRAG: `${tablePrefixSelector}-column-controls-decoration-with-drag`,
|
|
82
82
|
ROW_CONTROLS_WITH_DRAG: `${tablePrefixSelector}-row-controls-with-drag`,
|
|
83
|
+
DRAG_HANDLE_BUTTON_CONTAINER: `${tablePrefixSelector}-drag-handle-button-container`,
|
|
83
84
|
/** Other classes */
|
|
84
85
|
NUMBERED_COLUMN: `${tablePrefixSelector}-numbered-column`,
|
|
85
86
|
NUMBERED_COLUMN_BUTTON: `${tablePrefixSelector}-numbered-column__button`,
|