@atlaskit/editor-plugin-table 0.2.6 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/cjs/plugins/table/commands/index.js +9 -1
  3. package/dist/cjs/plugins/table/commands/referentiality.js +23 -0
  4. package/dist/cjs/plugins/table/event-handlers.js +5 -1
  5. package/dist/cjs/plugins/table/nodeviews/table.js +10 -1
  6. package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +15 -12
  7. package/dist/cjs/plugins/table/toolbar.js +78 -35
  8. package/dist/cjs/plugins/table/ui/common-styles.js +6 -3
  9. package/dist/cjs/plugins/table/ui/messages.js +17 -2
  10. package/dist/cjs/plugins/table/ui/ui-styles.js +2 -7
  11. package/dist/cjs/version.json +1 -1
  12. package/dist/es2019/plugins/table/commands/index.js +2 -1
  13. package/dist/es2019/plugins/table/commands/referentiality.js +10 -0
  14. package/dist/es2019/plugins/table/event-handlers.js +3 -1
  15. package/dist/es2019/plugins/table/nodeviews/table.js +13 -1
  16. package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +16 -11
  17. package/dist/es2019/plugins/table/toolbar.js +65 -29
  18. package/dist/es2019/plugins/table/ui/common-styles.js +15 -5
  19. package/dist/es2019/plugins/table/ui/messages.js +17 -2
  20. package/dist/es2019/plugins/table/ui/ui-styles.js +24 -16
  21. package/dist/es2019/version.json +1 -1
  22. package/dist/esm/plugins/table/commands/index.js +2 -1
  23. package/dist/esm/plugins/table/commands/referentiality.js +12 -0
  24. package/dist/esm/plugins/table/event-handlers.js +5 -1
  25. package/dist/esm/plugins/table/nodeviews/table.js +10 -1
  26. package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +15 -12
  27. package/dist/esm/plugins/table/toolbar.js +74 -29
  28. package/dist/esm/plugins/table/ui/common-styles.js +6 -3
  29. package/dist/esm/plugins/table/ui/messages.js +17 -2
  30. package/dist/esm/plugins/table/ui/ui-styles.js +2 -6
  31. package/dist/esm/version.json +1 -1
  32. package/dist/types/plugins/table/commands/index.d.ts +1 -0
  33. package/dist/types/plugins/table/commands/referentiality.d.ts +2 -0
  34. package/dist/types/plugins/table/index.d.ts +2 -3
  35. package/dist/types/plugins/table/nodeviews/table.d.ts +4 -1
  36. package/dist/types/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +0 -1
  37. package/dist/types/plugins/table/ui/common-styles.d.ts +4 -1
  38. package/dist/types/plugins/table/ui/messages.d.ts +15 -0
  39. package/package.json +6 -6
  40. package/report.api.md +6 -6
  41. package/src/__tests__/integration/__fixtures__/table-and-paragraph-adf.json +130 -0
  42. package/src/__tests__/integration/floating-toolbar.ts +54 -0
  43. package/src/__tests__/integration/meta-arrowup-cursor-in-first-row.ts +37 -0
  44. package/src/__tests__/unit/color-picker.ts +100 -0
  45. package/src/__tests__/unit/get-toolbar-config.ts +1 -4
  46. package/src/__tests__/unit/keymap.ts +1 -1
  47. package/src/__tests__/unit/nodeviews/cell.ts +52 -57
  48. package/src/__tests__/unit/pm-plugins/sticky-headers/tableRow.tsx +90 -8
  49. package/src/__tests__/unit/transforms/delete-columns.ts +1 -1
  50. package/src/__tests__/unit/transforms/delete-rows.ts +1 -1
  51. package/src/__tests__/unit/utils/collapse.ts +2 -2
  52. package/src/plugins/table/commands/index.ts +1 -0
  53. package/src/plugins/table/commands/referentiality.ts +14 -0
  54. package/src/plugins/table/event-handlers.ts +7 -1
  55. package/src/plugins/table/index.tsx +6 -1
  56. package/src/plugins/table/nodeviews/table.tsx +16 -1
  57. package/src/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.ts +12 -10
  58. package/src/plugins/table/toolbar.tsx +84 -28
  59. package/src/plugins/table/ui/common-styles.ts +20 -4
  60. package/src/plugins/table/ui/messages.ts +18 -3
  61. package/src/plugins/table/ui/ui-styles.ts +23 -14
  62. package/dist/cjs/plugins/table/utils/referentiality.js +0 -29
  63. package/dist/es2019/plugins/table/utils/referentiality.js +0 -18
  64. package/dist/esm/plugins/table/utils/referentiality.js +0 -20
  65. package/dist/types/plugins/table/utils/referentiality.d.ts +0 -2
  66. package/src/plugins/table/utils/referentiality.ts +0 -24
package/CHANGELOG.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 1.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [`5d317ed8aa3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5d317ed8aa3) - [ux] ED-15882: Implement custom starting numbers for orderedList nodes in adf-schema, editor, renderer, transformers behind restartNumberedLists feature flag. Users will be able to set a custom starting number when typing to create a numbered list in the Editor and this will be persisted across Renderer and other format transformations.
8
+
9
+ Note: restartNumberedLists will be off by default. To enable it, consumers will need to set <Editor featureFlags={{ restartNumberedLists: true }}> or <Renderer featureFlags={{ restartNumberedLists: true }}>
10
+
11
+ ### Minor Changes
12
+
13
+ - [`8820442c2b2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8820442c2b2) - [ux] ED-15709: add feature for delete element if it is `isReferencedSource` is `true`
14
+
15
+ - add checkbox confirmation dialog when then config have `isReferentiality.`
16
+ - add referentiality helper functions.
17
+ - update confirmDialog config to a handler to reduce traverse times.
18
+ - user can now tick checkbox to delete descendent nodes or only selected node when user click the delete icon in floating toolbar.
19
+
20
+ ### Patch Changes
21
+
22
+ - [`f0901dad354`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f0901dad354) - ED-16218 - Patch to fix editor.table.colorPicker id
23
+ - [`bd809217772`](https://bitbucket.org/atlassian/atlassian-frontend/commits/bd809217772) - [ux] Table plugin will now re-read the selection or re-parse the range around the mutation for 'selection' mutations
24
+ - [`ed617ce197c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ed617ce197c) - [ux] DSP-4451 - Adds design tokens to table overflow shadows. Fixes visual bug with table overflow shadow size and placement.
25
+ - [`38a9332eed9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/38a9332eed9) - [ux] Fixed sticky header related table render issues when header row is toggled
26
+ - [`7a123e47141`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7a123e47141) - [ux] Make sure sticky header is only applied to first row
27
+ - [`233e03b2d92`](https://bitbucket.org/atlassian/atlassian-frontend/commits/233e03b2d92) - ED-16007 To highlight the table rows and columns when the 'Delete Row' and 'Delete Column' options are highlighted in the 'cell options' menu of floating toolbar
28
+ - [`f788287d932`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f788287d932) - [ux] Fix table sticky header becoming unsticky when cursor moves below table
29
+ - [`60068f7fcbe`](https://bitbucket.org/atlassian/atlassian-frontend/commits/60068f7fcbe) - [ED-16007] Changes made to enable the keyboard accessibility to the table's floating toolbar
30
+
31
+ 1. Use Alt+F10 to access the table's floating toolbar
32
+ 2. Use 'Esc' to return to table
33
+ 3. If any of the options accessed in dropdown of floating toolbar the focus should be retained on editor's current selection.
34
+
35
+ - Updated dependencies
36
+
3
37
  ## 0.2.6
4
38
 
5
39
  ### Patch Changes
@@ -117,6 +117,12 @@ Object.defineProperty(exports, "moveCursorBackward", {
117
117
  return _misc.moveCursorBackward;
118
118
  }
119
119
  });
120
+ Object.defineProperty(exports, "removeDescendantNodes", {
121
+ enumerable: true,
122
+ get: function get() {
123
+ return _referentiality.removeDescendantNodes;
124
+ }
125
+ });
120
126
  Object.defineProperty(exports, "selectColumn", {
121
127
  enumerable: true,
122
128
  get: function get() {
@@ -232,4 +238,6 @@ var _misc = require("./misc");
232
238
 
233
239
  var _sort = require("./sort");
234
240
 
235
- var _goToNextCell = require("./go-to-next-cell");
241
+ var _goToNextCell = require("./go-to-next-cell");
242
+
243
+ var _referentiality = require("./referentiality");
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.removeDescendantNodes = void 0;
7
+
8
+ var _pluginFactory = require("../pm-plugins/plugin-factory");
9
+
10
+ var _utils = require("@atlaskit/editor-common/utils");
11
+
12
+ var removeDescendantNodes = function removeDescendantNodes(sourceNode) {
13
+ return (0, _pluginFactory.createCommand)({
14
+ type: 'UPDATE_STATE',
15
+ data: {
16
+ element: undefined
17
+ }
18
+ }, function (tr, state) {
19
+ return sourceNode ? (0, _utils.removeConnectedNodes)(state, sourceNode) : tr;
20
+ });
21
+ };
22
+
23
+ exports.removeDescendantNodes = removeDescendantNodes;
@@ -45,12 +45,16 @@ var isFocusingModal = function isFocusingModal(event) {
45
45
  return event instanceof FocusEvent && event.relatedTarget instanceof HTMLElement && event.relatedTarget.closest('[role="dialog"]');
46
46
  };
47
47
 
48
+ var isFocusingFloatingToolbar = function isFocusingFloatingToolbar(event) {
49
+ return event instanceof FocusEvent && event.relatedTarget instanceof HTMLElement && event.relatedTarget.closest('[role="toolbar"]');
50
+ };
51
+
48
52
  var handleBlur = function handleBlur(view, event) {
49
53
  var state = view.state,
50
54
  dispatch = view.dispatch; // IE version check for ED-4665
51
55
  // Calendar focus check for ED-10466
52
56
 
53
- if (_utils2.browser.ie_version !== 11 && !isFocusingCalendar(event) && !isFocusingModal(event)) {
57
+ if (_utils2.browser.ie_version !== 11 && !isFocusingCalendar(event) && !isFocusingModal(event) && !isFocusingFloatingToolbar(event)) {
54
58
  (0, _commands.setEditorFocus)(false)(state, dispatch);
55
59
  }
56
60
 
@@ -219,7 +219,16 @@ var TableView = /*#__PURE__*/function (_ReactNodeView) {
219
219
  }
220
220
  }, {
221
221
  key: "ignoreMutation",
222
- value: function ignoreMutation() {
222
+ value: function ignoreMutation(mutation) {
223
+ var type = mutation.type,
224
+ _mutation$target = mutation.target,
225
+ nodeName = _mutation$target.nodeName,
226
+ firstChild = _mutation$target.firstChild;
227
+
228
+ if (type === 'selection' && (nodeName === null || nodeName === void 0 ? void 0 : nodeName.toUpperCase()) === 'DIV' && (firstChild === null || firstChild === void 0 ? void 0 : firstChild.nodeName.toUpperCase()) === 'TABLE') {
229
+ return false;
230
+ }
231
+
223
232
  return true;
224
233
  }
225
234
  }, {
@@ -167,15 +167,6 @@ var TableRowNodeView = /*#__PURE__*/function () {
167
167
 
168
168
  if (!tree) {
169
169
  return;
170
- } // make it non-sticky initially to avoid making it look separated
171
-
172
-
173
- if (!_this.isTableInit) {
174
- if (_this.tree) {
175
- _this.makeRowHeaderNotSticky(_this.tree.table);
176
-
177
- _this.isTableInit = true;
178
- }
179
170
  } // when header rows are toggled off - mark sentinels as unobserved
180
171
 
181
172
 
@@ -187,7 +178,11 @@ var TableRowNodeView = /*#__PURE__*/function () {
187
178
  });
188
179
  }
189
180
 
190
- var isCurrentTableSelected = tableRef === tree.table;
181
+ var isCurrentTableSelected = tableRef === tree.table; // If current table selected and header row is toggled off, turn off sticky header
182
+
183
+ if (isCurrentTableSelected && !state.isHeaderRowEnabled && _this.tree) {
184
+ _this.makeRowHeaderNotSticky(_this.tree.table);
185
+ }
191
186
 
192
187
  if (isCurrentTableSelected !== _this.focused) {
193
188
  focusChanged = true;
@@ -262,12 +257,21 @@ var TableRowNodeView = /*#__PURE__*/function () {
262
257
  return false;
263
258
  });
264
259
  (0, _defineProperty2.default)(this, "makeHeaderRowSticky", function (tree) {
260
+ var _tbody$firstChild;
261
+
265
262
  // If header row height is more than 50% of viewport height don't do this
266
263
  if (_this.stickyRowHeight && _this.stickyRowHeight > window.innerHeight / 2) {
267
264
  return;
268
265
  }
269
266
 
270
- var table = tree.table;
267
+ var table = tree.table; // ED-16035 Make sure sticky header is only applied to first row
268
+
269
+ var tbody = _this.dom.parentElement;
270
+ var isFirstHeader = tbody === null || tbody === void 0 ? void 0 : (_tbody$firstChild = tbody.firstChild) === null || _tbody$firstChild === void 0 ? void 0 : _tbody$firstChild.isEqualNode(_this.dom);
271
+
272
+ if (!isFirstHeader) {
273
+ return;
274
+ }
271
275
 
272
276
  var currentTableTop = _this.getCurrentTableTop(tree);
273
277
 
@@ -364,7 +368,6 @@ var TableRowNodeView = /*#__PURE__*/function () {
364
368
  this.lastTimePainted = 0;
365
369
  this.isHeaderRow = supportedHeaderRow(node);
366
370
  this.isSticky = false;
367
- this.isTableInit = false;
368
371
 
369
372
  if (this.isHeaderRow) {
370
373
  this.dom.setAttribute('data-header-row', 'true');
@@ -29,11 +29,11 @@ var _types = require("./types");
29
29
 
30
30
  var _utils = require("./utils");
31
31
 
32
- var _referentiality = require("./utils/referentiality");
32
+ var _utils2 = require("@atlaskit/editor-common/utils");
33
33
 
34
34
  var _analytics = require("@atlaskit/editor-common/analytics");
35
35
 
36
- var _utils2 = require("@atlaskit/editor-tables/utils");
36
+ var _utils3 = require("@atlaskit/editor-tables/utils");
37
37
 
38
38
  var _transforms = require("./transforms");
39
39
 
@@ -43,8 +43,6 @@ var _ContextualMenu = require("./ui/FloatingContextualMenu/ContextualMenu");
43
43
 
44
44
  var _prosemirrorUtils = require("prosemirror-utils");
45
45
 
46
- var _utils3 = require("@atlaskit/editor-common/utils");
47
-
48
46
  var _keymaps = require("@atlaskit/editor-common/keymaps");
49
47
 
50
48
  var _resizeState = require("./pm-plugins/table-resizing/utils/resize-state");
@@ -118,6 +116,7 @@ var getToolbarMenuConfig = function getToolbarMenuConfig(config, state, _ref, ed
118
116
  return {
119
117
  id: 'editor.table.tableOptions',
120
118
  type: 'dropdown',
119
+ testId: 'table_options',
121
120
  title: formatMessage(messages.tableOptions),
122
121
  hidden: options.every(function (option) {
123
122
  return option.hidden;
@@ -195,16 +194,9 @@ var getToolbarCellOptionsConfig = function getToolbarCellOptionsConfig(editorSta
195
194
 
196
195
  return true;
197
196
  },
198
- onMouseOver: function onMouseOver(state, dispatch) {
199
- var selectionRect = getClosestSelectionRect(state);
200
-
201
- if (selectionRect) {
202
- (0, _commands.hoverColumns)((0, _utils.getSelectedColumnIndexes)(selectionRect), true)(state, dispatch);
203
- return true;
204
- }
205
-
206
- return false;
207
- },
197
+ onFocus: highlightColumnsHandler,
198
+ onBlur: (0, _commands.clearHoverSelection)(),
199
+ onMouseOver: highlightColumnsHandler,
208
200
  onMouseLeave: (0, _commands.clearHoverSelection)(),
209
201
  selected: false,
210
202
  disabled: false
@@ -222,16 +214,9 @@ var getToolbarCellOptionsConfig = function getToolbarCellOptionsConfig(editorSta
222
214
 
223
215
  return true;
224
216
  },
225
- onMouseOver: function onMouseOver(state, dispatch) {
226
- var selectionRect = getClosestSelectionRect(state);
227
-
228
- if (selectionRect) {
229
- (0, _commands.hoverRows)((0, _utils.getSelectedRowIndexes)(selectionRect), true)(state, dispatch);
230
- return true;
231
- }
232
-
233
- return false;
234
- },
217
+ onFocus: highlightRowsHandler,
218
+ onBlur: (0, _commands.clearHoverSelection)(),
219
+ onMouseOver: highlightRowsHandler,
235
220
  onMouseLeave: (0, _commands.clearHoverSelection)(),
236
221
  selected: false,
237
222
  disabled: false
@@ -246,7 +231,7 @@ var getToolbarCellOptionsConfig = function getToolbarCellOptionsConfig(editorSta
246
231
  title: formatMessage(_ContextualMenu.messages.splitCell),
247
232
  onClick: (0, _commandsWithAnalytics.splitCellWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.FLOATING_TB),
248
233
  selected: false,
249
- disabled: !(0, _utils2.splitCell)(editorState)
234
+ disabled: !(0, _utils3.splitCell)(editorState)
250
235
  }];
251
236
 
252
237
  if (pluginState !== null && pluginState !== void 0 && (_pluginState$pluginCo = pluginState.pluginConfig) !== null && _pluginState$pluginCo !== void 0 && _pluginState$pluginCo.allowDistributeColumns) {
@@ -320,6 +305,7 @@ var getToolbarCellOptionsConfig = function getToolbarCellOptionsConfig(editorSta
320
305
  });
321
306
  return {
322
307
  id: 'editor.table.cellOptions',
308
+ testId: 'cell_options',
323
309
  type: 'dropdown',
324
310
  title: formatMessage(_messages2.default.cellOptions),
325
311
  options: options,
@@ -333,13 +319,13 @@ exports.getToolbarCellOptionsConfig = getToolbarCellOptionsConfig;
333
319
 
334
320
  var getClosestSelectionRect = function getClosestSelectionRect(state) {
335
321
  var selection = state.selection;
336
- return (0, _utils2.isSelectionType)(selection, 'cell') ? (0, _utils2.getSelectionRect)(selection) : (0, _utils2.findCellRectClosestToPos)(selection.$from);
322
+ return (0, _utils3.isSelectionType)(selection, 'cell') ? (0, _utils3.getSelectionRect)(selection) : (0, _utils3.findCellRectClosestToPos)(selection.$from);
337
323
  };
338
324
 
339
325
  var getToolbarConfig = function getToolbarConfig(getEditorContainerWidth, editorAnalyticsAPI, getEditorFeatureFlags, getEditorView) {
340
326
  return function (config) {
341
327
  return function (state, intl) {
342
- var tableObject = (0, _utils2.findTable)(state.selection);
328
+ var tableObject = (0, _utils3.findTable)(state.selection);
343
329
  var pluginState = (0, _pluginFactory.getPluginState)(state);
344
330
 
345
331
  var resizeState = _tableResizing.pluginKey.getState(state);
@@ -355,12 +341,26 @@ var getToolbarConfig = function getToolbarConfig(getEditorContainerWidth, editor
355
341
  var colorPicker = getColorPicker(state, menu, intl, getEditorContainerWidth, editorAnalyticsAPI, tableCellOptionsInFloatingToolbar); // Check if we need to show confirm dialog for delete button
356
342
 
357
343
  var confirmDialog;
358
- var localId = tableObject.node.attrs.localId;
359
344
 
360
- if (localId && (0, _referentiality.isReferencedSource)(state, localId)) {
361
- confirmDialog = {
362
- okButtonLabel: intl.formatMessage(_messages2.default.confirmDeleteLinkedModalOKButton),
363
- message: intl.formatMessage(_messages2.default.confirmDeleteLinkedModalMessage)
345
+ if ((0, _utils2.isReferencedSource)(state, tableObject.node)) {
346
+ confirmDialog = function confirmDialog() {
347
+ return {
348
+ title: intl.formatMessage(_messages2.default.deleteElementTitle),
349
+ okButtonLabel: intl.formatMessage(_messages2.default.confirmDeleteLinkedModalOKButton),
350
+ message: intl.formatMessage(_messages2.default.confirmDeleteLinkedModalMessage, {
351
+ nodeName: (0, _utils2.getNodeName)(state, tableObject.node)
352
+ }),
353
+ messagePrefix: intl.formatMessage(_messages2.default.confirmDeleteLinkedModalMessagePrefix),
354
+ isReferentialityDialog: true,
355
+ getChildrenInfo: function getChildrenInfo() {
356
+ return (0, _utils2.getChildrenInfo)(state, tableObject.node);
357
+ },
358
+ checkboxLabel: intl.formatMessage(_messages2.default.confirmModalCheckboxLabel),
359
+ onConfirm: function onConfirm() {
360
+ var isChecked = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
361
+ return clickWithCheckboxHandler(isChecked, tableObject.node);
362
+ }
363
+ };
364
364
  };
365
365
  }
366
366
 
@@ -373,7 +373,7 @@ var getToolbarConfig = function getToolbarConfig(getEditorContainerWidth, editor
373
373
  var tableRef = parent.querySelector('table') || undefined;
374
374
 
375
375
  if (tableRef) {
376
- element = (0, _utils3.closestElement)(tableRef, ".".concat(_types.TableCssClassName.TABLE_NODE_WRAPPER)) || undefined;
376
+ element = (0, _utils2.closestElement)(tableRef, ".".concat(_types.TableCssClassName.TABLE_NODE_WRAPPER)) || undefined;
377
377
  }
378
378
  }
379
379
 
@@ -397,7 +397,9 @@ var getToolbarConfig = function getToolbarConfig(getEditorContainerWidth, editor
397
397
  formatMessage: intl.formatMessage,
398
398
  nodeType: nodeType,
399
399
  onMouseEnter: (0, _commands.hoverTable)(false, true),
400
- onMouseLeave: (0, _commands.clearHoverSelection)()
400
+ onMouseLeave: (0, _commands.clearHoverSelection)(),
401
+ onFocus: (0, _commands.hoverTable)(false, true),
402
+ onBlur: (0, _commands.clearHoverSelection)()
401
403
  }, {
402
404
  type: 'separator'
403
405
  }]
@@ -409,8 +411,11 @@ var getToolbarConfig = function getToolbarConfig(getEditorContainerWidth, editor
409
411
  onClick: (0, _commandsWithAnalytics.deleteTableWithAnalytics)(editorAnalyticsAPI),
410
412
  disabled: !!resizeState && !!resizeState.dragging,
411
413
  onMouseEnter: (0, _commands.hoverTable)(true),
414
+ onFocus: (0, _commands.hoverTable)(true),
415
+ onBlur: (0, _commands.clearHoverSelection)(),
412
416
  onMouseLeave: (0, _commands.clearHoverSelection)(),
413
417
  title: intl.formatMessage(_messages.default.remove),
418
+ focusEditoronEnter: true,
414
419
  confirmDialog: confirmDialog
415
420
  }]),
416
421
  scrollable: true
@@ -471,7 +476,7 @@ var getColorPicker = function getColorPicker(state, menu, _ref5, getEditorContai
471
476
  border: _uiColor.DEFAULT_BORDER_COLOR
472
477
  };
473
478
  return [{
474
- id: 'editor.panel.colorPicker',
479
+ id: 'editor.table.colorPicker',
475
480
  title: formatMessage(_ContextualMenu.messages.cellBackground),
476
481
  type: 'select',
477
482
  selectType: 'color',
@@ -481,4 +486,42 @@ var getColorPicker = function getColorPicker(state, menu, _ref5, getEditorContai
481
486
  return (0, _commandsWithAnalytics.setColorWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.FLOATING_TB, option.value, targetCellPosition);
482
487
  }
483
488
  }, separator(menu.hidden)];
489
+ };
490
+
491
+ var clickWithCheckboxHandler = function clickWithCheckboxHandler(isChecked, node, editorAnalyticsAPI) {
492
+ return function (state, dispatch) {
493
+ if (!node) {
494
+ return false;
495
+ }
496
+
497
+ if (!isChecked) {
498
+ return (0, _commandsWithAnalytics.deleteTableWithAnalytics)(editorAnalyticsAPI)(state, dispatch);
499
+ } else {
500
+ (0, _commands.removeDescendantNodes)(node)(state, dispatch);
501
+ }
502
+
503
+ return true;
504
+ };
505
+ };
506
+
507
+ var highlightRowsHandler = function highlightRowsHandler(state, dispatch) {
508
+ var selectionRect = getClosestSelectionRect(state);
509
+
510
+ if (selectionRect) {
511
+ (0, _commands.hoverRows)((0, _utils.getSelectedRowIndexes)(selectionRect), true)(state, dispatch);
512
+ return true;
513
+ }
514
+
515
+ return false;
516
+ };
517
+
518
+ var highlightColumnsHandler = function highlightColumnsHandler(state, dispatch) {
519
+ var selectionRect = getClosestSelectionRect(state);
520
+
521
+ if (selectionRect) {
522
+ (0, _commands.hoverColumns)((0, _utils.getSelectedColumnIndexes)(selectionRect), true)(state, dispatch);
523
+ return true;
524
+ }
525
+
526
+ return false;
484
527
  };
@@ -40,12 +40,15 @@ var cornerControlHeight = _consts.tableToolbarSize + 1;
40
40
 
41
41
  var insertColumnButtonOffset = _consts.tableInsertColumnButtonSize / 2;
42
42
  var rangeSelectionStyles = "\n.".concat(_types.TableCssClassName.NODEVIEW_WRAPPER, ".").concat(_editorSharedStyles.akEditorSelectedNodeClassName, " table tbody tr {\n th,td {\n ").concat((0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.Blanket, _editorSharedStyles.SelectionStyle.Border]), "\n }\n}\n");
43
- var sentinelStyles = ".".concat(_types.TableCssClassName.TABLE_CONTAINER, " {\n > .").concat(_types.TableCssClassName.TABLE_STICKY_SENTINEL_TOP, ", > .").concat(_types.TableCssClassName.TABLE_STICKY_SENTINEL_BOTTOM, " {\n position: absolute;\n width: 100%;\n height: 1px;\n margin-top: -1px;\n // need this to avoid sentinel being focused via keyboard\n // this still allows it to be detected by intersection observer\n visibility: hidden;\n }\n > .").concat(_types.TableCssClassName.TABLE_STICKY_SENTINEL_TOP, " {\n top: ").concat(_consts.columnControlsDecorationHeight, "px;\n }\n > .").concat(_types.TableCssClassName.TABLE_STICKY_SENTINEL_BOTTOM, " {\n bottom: ").concat(_consts.tableScrollbarOffset + _consts.stickyRowOffsetTop + _consts.tablePadding * 2 + 23, "px;\n }\n &.").concat(_types.TableCssClassName.WITH_CONTROLS, " {\n > .").concat(_types.TableCssClassName.TABLE_STICKY_SENTINEL_TOP, " {\n top: 0px;\n }\n > .").concat(_types.TableCssClassName.TABLE_STICKY_SENTINEL_BOTTOM, " {\n margin-bottom: ").concat(_consts.columnControlsDecorationHeight, "px;\n }\n }\n}"); // TODO: https://product-fabric.atlassian.net/browse/DSP-4139
43
+ var sentinelStyles = ".".concat(_types.TableCssClassName.TABLE_CONTAINER, " {\n > .").concat(_types.TableCssClassName.TABLE_STICKY_SENTINEL_TOP, ", > .").concat(_types.TableCssClassName.TABLE_STICKY_SENTINEL_BOTTOM, " {\n position: absolute;\n width: 100%;\n height: 1px;\n margin-top: -1px;\n // need this to avoid sentinel being focused via keyboard\n // this still allows it to be detected by intersection observer\n visibility: hidden;\n }\n > .").concat(_types.TableCssClassName.TABLE_STICKY_SENTINEL_TOP, " {\n top: ").concat(_consts.columnControlsDecorationHeight, "px;\n }\n > .").concat(_types.TableCssClassName.TABLE_STICKY_SENTINEL_BOTTOM, " {\n bottom: ").concat(_consts.tableScrollbarOffset + _consts.stickyRowOffsetTop + _consts.tablePadding * 2 + 23, "px;\n }\n &.").concat(_types.TableCssClassName.WITH_CONTROLS, " {\n > .").concat(_types.TableCssClassName.TABLE_STICKY_SENTINEL_TOP, " {\n top: 0px;\n }\n > .").concat(_types.TableCssClassName.TABLE_STICKY_SENTINEL_BOTTOM, " {\n margin-bottom: ").concat(_consts.columnControlsDecorationHeight, "px;\n }\n }\n}"); // previous styles to add spacing to numbered lists with
44
+ // large item markers (e.g. 101, 102, ...) when nested inside tables
45
+
46
+ var listLargeNumericMarkersOldStyles = "\n .ProseMirror .pm-table-cell-content-wrap ol[data-child-count='100+'] {\n padding-left: revert;\n }\n"; // TODO: https://product-fabric.atlassian.net/browse/DSP-4139
44
47
 
45
48
  var tableStyles = function tableStyles(props) {
46
- var _props$featureFlags;
49
+ var _props$featureFlags, _props$featureFlags2;
47
50
 
48
- return (0, _react.css)(_templateObject || (_templateObject = (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 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 z-index: 0;\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 */\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: ", ";\n margin-left: -1px;\n\n &.no-pointer-events {\n pointer-events: none;\n }\n }\n\n .", " .", " {\n left: unset;\n position: fixed;\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 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\n &.", "[data-number-column='true'] {\n padding-left: ", "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 */\n > * .", " .", " {\n margin-left: unset !important;\n width: 100% !important;\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 :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 .", " {\n .", ", .", " {\n display: block;\n }\n .", " {\n padding-left: 1px;\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 .", " {\n cursor: pointer;\n }\n .", ":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\n > tbody > tr {\n white-space: pre-wrap;\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 td.", ", td.", " {\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 border: 1px solid ", ";\n z-index: ", ";\n }\n }\n }\n .", " {\n position: absolute;\n /* top of corner control is table margin top - corner control height + 1 pixel of table border. */\n top: ", "px;\n }\n .", ".", " {\n z-index: ", ";\n }\n .", " {\n left: -", "px;\n }\n .", " {\n padding-right: ", "px;\n margin-right: -", "px;\n padding-bottom: ", "px;\n margin-bottom: -", "px;\n /* fixes gap cursor height */\n overflow: auto;\n position: relative;\n }\n }\n\n .ProseMirror.", " {\n .", " {\n overflow-x: auto;\n ", ";\n }\n }\n\n .ProseMirror.", " {\n cursor: col-resize;\n }\n\n .ProseMirror .pm-table-cell-content-wrap ol[data-child-count='100+'] {\n padding-left: revert;\n }\n"])), _types.TableCssClassName.LAYOUT_BUTTON, (0, _tokens.token)('color.background.neutral', _colors.N20A), (0, _tokens.token)('color.icon', _colors.N300), _types.TableCssClassName.LAYOUT_BUTTON, _types.TableCssClassName.IS_RESIZING, (0, _tokens.token)('color.background.neutral.hovered', _colors.B300), (0, _tokens.token)('color.icon', 'white'), (0, _styles.tableSharedStyle)(props), (0, _uiStyles.columnControlsLineMarker)(props), _uiStyles.hoveredDeleteButton, _uiStyles.hoveredCell, _uiStyles.hoveredWarningCell, _uiStyles.resizeHandle, 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, _uiStyles.insertColumnButtonWrapper, _types.TableCssClassName.CONTROLS_FLOATING_BUTTON_ROW, _uiStyles.insertRowButtonWrapper, _uiStyles.DeleteButton, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.NUMBERED_COLUMN, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _consts.stickyRowOffsetTop + 2, _editorSharedStyles.akEditorTableNumberColumnWidth, _editorSharedStyles.akEditorStickyHeaderZIndex, _consts.stickyRowOffsetTop, (0, _tokens.token)('elevation.surface', 'white'), _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.CORNER_CONTROLS, _editorSharedStyles.akEditorSmallZIndex, (0, _tokens.token)('elevation.surface', 'white'), _consts.tableToolbarSize, _consts.tableToolbarSize, _types.TableCssClassName.CORNER_CONTROLS, _types.TableCssClassName.CONTROLS_CORNER_BUTTON, _consts.tableToolbarSize, _consts.tableToolbarSize, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.COLUMN_CONTROLS_DECORATIONS, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.ROW_CONTROLS, _types.TableCssClassName.ROW_CONTROLS_BUTTON_WRAP, _editorSharedStyles.akEditorStickyHeaderZIndex, _consts.tableToolbarSize, (0, _tokens.token)('elevation.surface', 'white'), _consts.tableToolbarSize, _types.TableCssClassName.TABLE_STICKY, (0, _tokens.token)('elevation.surface', 'green'), _consts.stickyRowOffsetTop, _consts.stickyRowZIndex, (0, _tokens.token)('elevation.surface', 'white'), (0, _tokens.token)('elevation.shadow.overflow', "0 6px 4px -4px ".concat(_colors.N40A)), _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY_SHADOW, _consts.stickyRowZIndex + 1, _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, (0, _tokens.token)('elevation.surface', 'white'), (_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.stickyHeadersOptimization ? sentinelStyles : '', (0, _uiStyles.OverflowShadow)(props), _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY_SHADOW, _consts.tablePadding, _types.TableCssClassName.ROW_CONTROLS_WRAPPER, _consts.tablePadding, _types.TableCssClassName.TABLE_CONTAINER, _editorSharedStyles.akEditorTableNumberColumnWidth + _consts.tablePadding - 1, _types.TableCssClassName.TABLE_LEFT_SHADOW, _types.TableCssClassName.TABLE_RIGHT_SHADOW, _types.TableCssClassName.NODEVIEW_WRAPPER, _types.TableCssClassName.NODEVIEW_WRAPPER, _types.TableCssClassName.TABLE_CONTAINER, (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.tableToolbarColor)(props), _types.TableCssClassName.CONTROLS_CORNER_BUTTON, _consts.tableBorderSelectedColor, (0, _tokens.token)('color.background.selected', _consts.tableToolbarSelectedColor), _types.TableCssClassName.TABLE_CONTAINER, _types.TableCssClassName.CORNER_CONTROLS, _types.TableCssClassName.CONTROLS_CORNER_BUTTON, _editorSharedStyles.akEditorTableToolbarSize + _editorSharedStyles.akEditorTableNumberColumnWidth, _types.TableCssClassName.ROW_CONTROLS, _types.TableCssClassName.CONTROLS_BUTTON, _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.CONTROLS_CORNER_BUTTON, _consts.tableBorderSelectedColor, (0, _tokens.token)('color.background.selected', _consts.tableToolbarSelectedColor), _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.CONTROLS_CORNER_BUTTON, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, _consts.tableBorderDeleteColor, (0, _tokens.token)('color.background.danger', _consts.tableToolbarDeleteColor), _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.IS_RESIZING, _types.TableCssClassName.ROW_CONTROLS, (0, _uiStyles.HeaderButtonHover)(), (0, _uiStyles.HeaderButtonDanger)(), _types.TableCssClassName.NUMBERED_COLUMN, _editorSharedStyles.akEditorTableToolbarSize - 1, _editorSharedStyles.akEditorTableToolbarSize, _editorSharedStyles.akEditorTableNumberColumnWidth + 1, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, (0, _consts.tableBorderColor)(props), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), (0, _consts.tableToolbarColor)(props), (0, _consts.tableTextColor)(props), (0, _consts.tableBorderColor)(props), (0, _consts.tableBorderColor)(props), _types.TableCssClassName.WITH_CONTROLS, _types.TableCssClassName.CORNER_CONTROLS, _types.TableCssClassName.ROW_CONTROLS, _types.TableCssClassName.NUMBERED_COLUMN, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _consts.tableBorderSelectedColor, _consts.tableBorderSelectedColor, (0, _tokens.token)('color.background.selected', _consts.tableToolbarSelectedColor), _editorSharedStyles.akEditorUnitZIndex, (0, _tokens.token)('color.text.selected', _colors.N0), _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.WITH_CONTROLS, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _consts.tableBorderSelectedColor, _consts.tableBorderSelectedColor, (0, _tokens.token)('color.background.selected', _consts.tableToolbarSelectedColor), _editorSharedStyles.akEditorUnitZIndex, (0, _tokens.token)('color.text.selected', _colors.N0), _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, (0, _tokens.token)('color.background.danger', _consts.tableToolbarDeleteColor), _consts.tableBorderDeleteColor, (0, _tokens.token)('color.text.danger', _colors.R500), _editorSharedStyles.akEditorUnitZIndex, _types.TableCssClassName.TABLE_NODE_WRAPPER, _types.TableCssClassName.COLUMN_CONTROLS_DECORATIONS, _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, _consts.tableBorderSelectedColor, _types.TableCssClassName.SELECTED_CELL, _consts.tableCellSelectedColor, _editorSharedStyles.akEditorSmallZIndex, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, _consts.tableCellDeleteColor, _editorSharedStyles.akEditorUnitZIndex * 100, _types.TableCssClassName.HOVERED_CELL, _types.TableCssClassName.SELECTED_CELL, _consts.tableBorderSelectedColor, _editorSharedStyles.akEditorSmallZIndex, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, _consts.tableBorderDeleteColor, _editorSharedStyles.akEditorUnitZIndex * 100, _types.TableCssClassName.ROW_CONTROLS_WRAPPER, _styles.tableMarginTop - cornerControlHeight + 1, _types.TableCssClassName.ROW_CONTROLS_WRAPPER, _types.TableCssClassName.TABLE_LEFT_SHADOW, _editorSharedStyles.akEditorUnitZIndex, _types.TableCssClassName.ROW_CONTROLS_WRAPPER, _consts.tableToolbarSize, _types.TableCssClassName.TABLE_NODE_WRAPPER, insertColumnButtonOffset, insertColumnButtonOffset, _consts.tableScrollbarOffset, _consts.tableScrollbarOffset, _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.TABLE_NODE_WRAPPER, _scrollbar.scrollbarStyles, _types.TableCssClassName.RESIZE_CURSOR);
51
+ return (0, _react.css)(_templateObject || (_templateObject = (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 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 z-index: 0;\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 */\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: ", ";\n margin-left: -1px;\n\n &.no-pointer-events {\n pointer-events: none;\n }\n }\n\n .", " .", " {\n left: unset;\n position: fixed;\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 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\n &.", "[data-number-column='true'] {\n padding-left: ", "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 */\n > * .", " .", " {\n margin-left: unset !important;\n width: 100% !important;\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 :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 .", " {\n .", ", .", " {\n display: block;\n }\n .", " {\n padding-left: 1px;\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 .", " {\n cursor: pointer;\n }\n .", ":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\n > tbody > tr {\n white-space: pre-wrap;\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 td.", ", td.", " {\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 border: 1px solid ", ";\n z-index: ", ";\n }\n }\n }\n .", " {\n position: absolute;\n /* top of corner control is table margin top - corner control height + 1 pixel of table border. */\n top: ", "px;\n }\n .", ".", " {\n z-index: ", ";\n }\n .", " {\n left: -", "px;\n }\n .", " {\n padding-right: ", "px;\n margin-right: -", "px;\n padding-bottom: ", "px;\n margin-bottom: -", "px;\n /* fixes gap cursor height */\n overflow: auto;\n position: relative;\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"])), _types.TableCssClassName.LAYOUT_BUTTON, (0, _tokens.token)('color.background.neutral', _colors.N20A), (0, _tokens.token)('color.icon', _colors.N300), _types.TableCssClassName.LAYOUT_BUTTON, _types.TableCssClassName.IS_RESIZING, (0, _tokens.token)('color.background.neutral.hovered', _colors.B300), (0, _tokens.token)('color.icon', 'white'), (0, _styles.tableSharedStyle)(props), (0, _uiStyles.columnControlsLineMarker)(props), _uiStyles.hoveredDeleteButton, _uiStyles.hoveredCell, _uiStyles.hoveredWarningCell, _uiStyles.resizeHandle, 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, _uiStyles.insertColumnButtonWrapper, _types.TableCssClassName.CONTROLS_FLOATING_BUTTON_ROW, _uiStyles.insertRowButtonWrapper, _uiStyles.DeleteButton, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.NUMBERED_COLUMN, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _consts.stickyRowOffsetTop + 2, _editorSharedStyles.akEditorTableNumberColumnWidth, _editorSharedStyles.akEditorStickyHeaderZIndex, _consts.stickyRowOffsetTop, (0, _tokens.token)('elevation.surface', 'white'), _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.CORNER_CONTROLS, _editorSharedStyles.akEditorSmallZIndex, (0, _tokens.token)('elevation.surface', 'white'), _consts.tableToolbarSize, _consts.tableToolbarSize, _types.TableCssClassName.CORNER_CONTROLS, _types.TableCssClassName.CONTROLS_CORNER_BUTTON, _consts.tableToolbarSize, _consts.tableToolbarSize, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.COLUMN_CONTROLS_DECORATIONS, _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.ROW_CONTROLS, _types.TableCssClassName.ROW_CONTROLS_BUTTON_WRAP, _editorSharedStyles.akEditorStickyHeaderZIndex, _consts.tableToolbarSize, (0, _tokens.token)('elevation.surface', 'white'), _consts.tableToolbarSize, _types.TableCssClassName.TABLE_STICKY, (0, _tokens.token)('elevation.surface', 'green'), _consts.stickyRowOffsetTop, _consts.stickyRowZIndex, (0, _tokens.token)('elevation.surface', 'white'), (0, _tokens.token)('elevation.shadow.overflow', "0 6px 4px -4px ".concat(_colors.N40A)), _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY_SHADOW, _consts.stickyRowZIndex + 1, _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, (0, _tokens.token)('elevation.surface', 'white'), (_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.stickyHeadersOptimization ? sentinelStyles : '', (0, _uiStyles.OverflowShadow)(props), _types.TableCssClassName.TABLE_STICKY, _types.TableCssClassName.TABLE_STICKY_SHADOW, _consts.tablePadding, _types.TableCssClassName.ROW_CONTROLS_WRAPPER, _consts.tablePadding, _types.TableCssClassName.TABLE_CONTAINER, _editorSharedStyles.akEditorTableNumberColumnWidth + _consts.tablePadding - 1, _types.TableCssClassName.TABLE_LEFT_SHADOW, _types.TableCssClassName.TABLE_RIGHT_SHADOW, _types.TableCssClassName.NODEVIEW_WRAPPER, _types.TableCssClassName.NODEVIEW_WRAPPER, _types.TableCssClassName.TABLE_CONTAINER, (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.tableToolbarColor)(props), _types.TableCssClassName.CONTROLS_CORNER_BUTTON, _consts.tableBorderSelectedColor, (0, _tokens.token)('color.background.selected', _consts.tableToolbarSelectedColor), _types.TableCssClassName.TABLE_CONTAINER, _types.TableCssClassName.CORNER_CONTROLS, _types.TableCssClassName.CONTROLS_CORNER_BUTTON, _editorSharedStyles.akEditorTableToolbarSize + _editorSharedStyles.akEditorTableNumberColumnWidth, _types.TableCssClassName.ROW_CONTROLS, _types.TableCssClassName.CONTROLS_BUTTON, _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.CONTROLS_CORNER_BUTTON, _consts.tableBorderSelectedColor, (0, _tokens.token)('color.background.selected', _consts.tableToolbarSelectedColor), _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.CONTROLS_CORNER_BUTTON, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, _consts.tableBorderDeleteColor, (0, _tokens.token)('color.background.danger', _consts.tableToolbarDeleteColor), _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.IS_RESIZING, _types.TableCssClassName.ROW_CONTROLS, (0, _uiStyles.HeaderButtonHover)(), (0, _uiStyles.HeaderButtonDanger)(), _types.TableCssClassName.NUMBERED_COLUMN, _editorSharedStyles.akEditorTableToolbarSize - 1, _editorSharedStyles.akEditorTableToolbarSize, _editorSharedStyles.akEditorTableNumberColumnWidth + 1, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, (0, _consts.tableBorderColor)(props), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), (0, _consts.tableToolbarColor)(props), (0, _consts.tableTextColor)(props), (0, _consts.tableBorderColor)(props), (0, _consts.tableBorderColor)(props), _types.TableCssClassName.WITH_CONTROLS, _types.TableCssClassName.CORNER_CONTROLS, _types.TableCssClassName.ROW_CONTROLS, _types.TableCssClassName.NUMBERED_COLUMN, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _consts.tableBorderSelectedColor, _consts.tableBorderSelectedColor, (0, _tokens.token)('color.background.selected', _consts.tableToolbarSelectedColor), _editorSharedStyles.akEditorUnitZIndex, (0, _tokens.token)('color.text.selected', _colors.N0), _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.WITH_CONTROLS, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _consts.tableBorderSelectedColor, _consts.tableBorderSelectedColor, (0, _tokens.token)('color.background.selected', _consts.tableToolbarSelectedColor), _editorSharedStyles.akEditorUnitZIndex, (0, _tokens.token)('color.text.selected', _colors.N0), _types.TableCssClassName.NUMBERED_COLUMN_BUTTON, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, (0, _tokens.token)('color.background.danger', _consts.tableToolbarDeleteColor), _consts.tableBorderDeleteColor, (0, _tokens.token)('color.text.danger', _colors.R500), _editorSharedStyles.akEditorUnitZIndex, _types.TableCssClassName.TABLE_NODE_WRAPPER, _types.TableCssClassName.COLUMN_CONTROLS_DECORATIONS, _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, _consts.tableBorderSelectedColor, _types.TableCssClassName.SELECTED_CELL, _consts.tableCellSelectedColor, _editorSharedStyles.akEditorSmallZIndex, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, _consts.tableCellDeleteColor, _editorSharedStyles.akEditorUnitZIndex * 100, _types.TableCssClassName.HOVERED_CELL, _types.TableCssClassName.SELECTED_CELL, _consts.tableBorderSelectedColor, _editorSharedStyles.akEditorSmallZIndex, _types.TableCssClassName.HOVERED_CELL_IN_DANGER, _consts.tableBorderDeleteColor, _editorSharedStyles.akEditorUnitZIndex * 100, _types.TableCssClassName.ROW_CONTROLS_WRAPPER, _styles.tableMarginTop - cornerControlHeight + 1, _types.TableCssClassName.ROW_CONTROLS_WRAPPER, _types.TableCssClassName.TABLE_LEFT_SHADOW, _editorSharedStyles.akEditorUnitZIndex, _types.TableCssClassName.ROW_CONTROLS_WRAPPER, _consts.tableToolbarSize, _types.TableCssClassName.TABLE_NODE_WRAPPER, insertColumnButtonOffset, insertColumnButtonOffset, _consts.tableScrollbarOffset, _consts.tableScrollbarOffset, _types.TableCssClassName.IS_RESIZING, _types.TableCssClassName.TABLE_NODE_WRAPPER, _scrollbar.scrollbarStyles, _types.TableCssClassName.RESIZE_CURSOR, props !== null && props !== void 0 && (_props$featureFlags2 = props.featureFlags) !== null && _props$featureFlags2 !== void 0 && _props$featureFlags2.restartNumberedLists ? "" : listLargeNumericMarkersOldStyles);
49
52
  };
50
53
 
51
54
  exports.tableStyles = tableStyles;
@@ -35,13 +35,28 @@ var _default = (0, _reactIntlNext.defineMessages)({
35
35
  },
36
36
  confirmDeleteLinkedModalOKButton: {
37
37
  id: 'fabric.editor.tables.confirmDeleteLinkedModalOKButton',
38
- defaultMessage: 'Remove table and data',
38
+ defaultMessage: 'Delete',
39
39
  description: 'Action button label for confirm modal when deleting a table linked to an extension.'
40
40
  },
41
41
  confirmDeleteLinkedModalMessage: {
42
42
  id: 'fabric.editor.tables.confirmDeleteLinkedModalMessage',
43
- defaultMessage: 'Removing this table will break all the charts connected to it.',
43
+ defaultMessage: 'Deleting {nodeName} will break anything connected to it.',
44
44
  description: 'Message for confirm modal when deleting a table linked to an extension.'
45
+ },
46
+ confirmDeleteLinkedModalMessagePrefix: {
47
+ id: 'fabric.editor.extension.confirmDeleteLinkedModalMessagePrefix',
48
+ defaultMessage: 'Deleting',
49
+ description: 'prefix for confirmation dialog text'
50
+ },
51
+ confirmModalCheckboxLabel: {
52
+ id: 'fabric.editor.floatingToolbar.confirmModalCheckboxLabel',
53
+ defaultMessage: 'Also delete connected elements',
54
+ description: 'checkbox label text'
55
+ },
56
+ deleteElementTitle: {
57
+ id: 'fabric.editor.extension.deleteElementTitle',
58
+ defaultMessage: 'Delete element',
59
+ description: 'Title text for confirm modal when deleting an extension linked to a data consumer.'
45
60
  }
46
61
  });
47
62
 
@@ -81,17 +81,12 @@ var columnControlsLineMarker = function columnControlsLineMarker(props) {
81
81
  };
82
82
 
83
83
  exports.columnControlsLineMarker = columnControlsLineMarker;
84
- var DeleteButton = (0, _react.css)(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2.default)(["\n .", ",\n .", " {\n height: ", "px;\n width: ", "px;\n }\n .", " {\n .", " {\n ", "\n }\n }\n\n .", ":hover {\n background: ", ";\n color: ", ";\n cursor: pointer;\n }\n"])), _types.TableCssClassName.CONTROLS_DELETE_BUTTON_WRAP, _types.TableCssClassName.CONTROLS_DELETE_BUTTON, _consts.tableDeleteButtonSize, _consts.tableDeleteButtonSize, _types.TableCssClassName.CONTROLS_DELETE_BUTTON_WRAP, _types.TableCssClassName.CONTROLS_DELETE_BUTTON, Button("\n background: ".concat((0, _tokens.token)('color.background.neutral', _colors.N20A), ";\n color: ").concat((0, _tokens.token)('color.icon', _colors.N300), ";\n ")), _types.TableCssClassName.CONTROLS_DELETE_BUTTON, (0, _tokens.token)('color.background.danger.bold', _colors.R300), (0, _tokens.token)('color.icon.inverse', 'white')); // TODO: https://product-fabric.atlassian.net/browse/DSP-4451
85
-
86
- /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
87
-
84
+ var DeleteButton = (0, _react.css)(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2.default)(["\n .", ",\n .", " {\n height: ", "px;\n width: ", "px;\n }\n .", " {\n .", " {\n ", "\n }\n }\n\n .", ":hover {\n background: ", ";\n color: ", ";\n cursor: pointer;\n }\n"])), _types.TableCssClassName.CONTROLS_DELETE_BUTTON_WRAP, _types.TableCssClassName.CONTROLS_DELETE_BUTTON, _consts.tableDeleteButtonSize, _consts.tableDeleteButtonSize, _types.TableCssClassName.CONTROLS_DELETE_BUTTON_WRAP, _types.TableCssClassName.CONTROLS_DELETE_BUTTON, Button("\n background: ".concat((0, _tokens.token)('color.background.neutral', _colors.N20A), ";\n color: ").concat((0, _tokens.token)('color.icon', _colors.N300), ";\n ")), _types.TableCssClassName.CONTROLS_DELETE_BUTTON, (0, _tokens.token)('color.background.danger.bold', _colors.R300), (0, _tokens.token)('color.icon.inverse', 'white'));
88
85
  exports.DeleteButton = DeleteButton;
89
86
 
90
87
  var OverflowShadow = function OverflowShadow(props) {
91
- return (0, _react.css)(_templateObject14 || (_templateObject14 = (0, _taggedTemplateLiteral2.default)(["\n .", ", .", " {\n display: block;\n height: calc(\n 100% - ", "px\n );\n position: absolute;\n pointer-events: none;\n top: ", "px;\n z-index: ", ";\n width: 8px;\n }\n .", " {\n background: linear-gradient(to left, rgba(99, 114, 130, 0) 0, ", " 100%);\n left: 0px;\n }\n .", "[data-number-column='true'] > :not(.", ").", " {\n left: ", "px;\n }\n .", " {\n background: linear-gradient(\n to right,\n rgba(99, 114, 130, 0) 0,\n ", " 100%\n );\n left: calc(100% + 2px);\n }\n .", " {\n .", ", .", " {\n height: calc(100% - ", "px);\n top: ", "px;\n }\n .", " {\n border-left: 1px solid ", ";\n }\n }\n"])), _types.TableCssClassName.TABLE_RIGHT_SHADOW, _types.TableCssClassName.TABLE_LEFT_SHADOW, _styles.tableMarginTop + _styles.tableMarginBottom + _consts.tableToolbarSize - 2, _styles.tableMarginTop + _consts.tableToolbarSize - 1, _editorSharedStyles.akEditorShadowZIndex, _types.TableCssClassName.TABLE_LEFT_SHADOW, _colors.N40A, _types.TableCssClassName.TABLE_CONTAINER, _types.TableCssClassName.TABLE_STICKY_SHADOW, _types.TableCssClassName.TABLE_LEFT_SHADOW, _editorSharedStyles.akEditorTableNumberColumnWidth - 1, _types.TableCssClassName.TABLE_RIGHT_SHADOW, _colors.N40A, _types.TableCssClassName.WITH_CONTROLS, _types.TableCssClassName.TABLE_RIGHT_SHADOW, _types.TableCssClassName.TABLE_LEFT_SHADOW, _styles.tableMarginTop + _styles.tableMarginBottom - 2, _styles.tableMarginTop - 1, _types.TableCssClassName.TABLE_LEFT_SHADOW, (0, _consts.tableBorderColor)(props));
88
+ return (0, _react.css)(_templateObject14 || (_templateObject14 = (0, _taggedTemplateLiteral2.default)(["\n .", ", .", " {\n display: block;\n height: calc(100% - ", "px);\n position: absolute;\n pointer-events: none;\n top: ", "px;\n z-index: ", ";\n width: 8px;\n }\n .", " {\n background: linear-gradient(\n to left,\n transparent 0,\n ", " 100%\n ),\n linear-gradient(\n to right,\n ", " 0px,\n transparent 1px\n );\n left: 0px;\n }\n .", "[data-number-column='true'] > :not(.", ").", " {\n left: ", "px;\n }\n .", " {\n background: linear-gradient(\n to right,\n transparent 0,\n ", " 100%\n ),\n linear-gradient(\n to left,\n ", " 0px,\n transparent 1px\n );\n left: calc(100% + 2px);\n }\n .", " {\n .", ", .", " {\n height: calc(100% - ", "px);\n top: ", "px;\n }\n .", " {\n border-left: 1px solid ", ";\n }\n }\n"])), _types.TableCssClassName.TABLE_RIGHT_SHADOW, _types.TableCssClassName.TABLE_LEFT_SHADOW, _styles.tableMarginTop + _styles.tableMarginBottom, _styles.tableMarginTop, _editorSharedStyles.akEditorShadowZIndex, _types.TableCssClassName.TABLE_LEFT_SHADOW, (0, _tokens.token)('elevation.shadow.overflow.spread', _colors.N40A), (0, _tokens.token)('elevation.shadow.overflow.perimeter', 'transparent'), _types.TableCssClassName.TABLE_CONTAINER, _types.TableCssClassName.TABLE_STICKY_SHADOW, _types.TableCssClassName.TABLE_LEFT_SHADOW, _editorSharedStyles.akEditorTableNumberColumnWidth - 1, _types.TableCssClassName.TABLE_RIGHT_SHADOW, (0, _tokens.token)('elevation.shadow.overflow.spread', _colors.N40A), (0, _tokens.token)('elevation.shadow.overflow.perimeter', 'transparent'), _types.TableCssClassName.WITH_CONTROLS, _types.TableCssClassName.TABLE_RIGHT_SHADOW, _types.TableCssClassName.TABLE_LEFT_SHADOW, _styles.tableMarginTop + _styles.tableMarginBottom, _styles.tableMarginTop, _types.TableCssClassName.TABLE_LEFT_SHADOW, (0, _consts.tableBorderColor)(props));
92
89
  };
93
- /* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
94
-
95
90
 
96
91
  exports.OverflowShadow = OverflowShadow;
97
92
 
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "0.2.6",
3
+ "version": "1.0.0",
4
4
  "sideEffects": false
5
5
  }
@@ -4,4 +4,5 @@ export { getNextLayout, toggleContextualMenu, toggleHeaderColumn, toggleHeaderRo
4
4
  export { clearMultipleCells } from './clear';
5
5
  export { autoSizeTable, convertFirstRowToHeader, deleteTable, hideInsertColumnOrRowButton, moveCursorBackward, selectColumn, selectRow, setCellAttr, setEditorFocus, setMultipleCellAttrs, setTableRef, showInsertColumnButton, showInsertRowButton, transformSliceToAddTableHeaders, triggerUnlessTableHeader, addBoldInEmptyHeaderCells, addResizeHandleDecorations } from './misc';
6
6
  export { sortByColumn } from './sort';
7
- export { goToNextCell } from './go-to-next-cell';
7
+ export { goToNextCell } from './go-to-next-cell';
8
+ export { removeDescendantNodes } from './referentiality';
@@ -0,0 +1,10 @@
1
+ import { createCommand } from '../pm-plugins/plugin-factory';
2
+ import { removeConnectedNodes } from '@atlaskit/editor-common/utils';
3
+ export const removeDescendantNodes = sourceNode => createCommand({
4
+ type: 'UPDATE_STATE',
5
+ data: {
6
+ element: undefined
7
+ }
8
+ }, (tr, state) => {
9
+ return sourceNode ? removeConnectedNodes(state, sourceNode) : tr;
10
+ });