@atlaskit/editor-plugin-table 7.3.0 → 7.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/afm-cc/tsconfig.json +3 -0
  3. package/dist/cjs/commands/misc.js +4 -2
  4. package/dist/cjs/commands/selection.js +4 -2
  5. package/dist/cjs/pm-plugins/drag-and-drop/commands.js +3 -1
  6. package/dist/cjs/pm-plugins/drag-and-drop/plugin.js +33 -1
  7. package/dist/cjs/pm-plugins/drag-and-drop/reducer.js +2 -1
  8. package/dist/cjs/pm-plugins/table-selection-keymap.js +2 -2
  9. package/dist/cjs/ui/DragHandle/HandleIconComponent.js +1 -3
  10. package/dist/cjs/ui/DragHandle/index.js +22 -10
  11. package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +75 -33
  12. package/dist/cjs/ui/FloatingDragMenu/DropdownMenu.js +123 -0
  13. package/dist/cjs/ui/FloatingDragMenu/index.js +2 -2
  14. package/dist/cjs/ui/TableFloatingColumnControls/ColumnControls/index.js +24 -35
  15. package/dist/cjs/ui/TableFloatingColumnControls/index.js +1 -2
  16. package/dist/cjs/ui/TableFloatingControls/CornerControls/DragCornerControls.js +4 -0
  17. package/dist/cjs/ui/TableFloatingControls/RowControls/DragControls.js +26 -33
  18. package/dist/cjs/ui/common-styles.js +1 -1
  19. package/dist/cjs/ui/consts.js +3 -2
  20. package/dist/es2019/commands/misc.js +4 -4
  21. package/dist/es2019/commands/selection.js +4 -4
  22. package/dist/es2019/pm-plugins/drag-and-drop/commands.js +3 -3
  23. package/dist/es2019/pm-plugins/drag-and-drop/plugin.js +34 -1
  24. package/dist/es2019/pm-plugins/drag-and-drop/reducer.js +2 -1
  25. package/dist/es2019/pm-plugins/table-selection-keymap.js +2 -2
  26. package/dist/es2019/ui/DragHandle/HandleIconComponent.js +1 -3
  27. package/dist/es2019/ui/DragHandle/index.js +25 -10
  28. package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +72 -32
  29. package/dist/es2019/ui/FloatingDragMenu/DropdownMenu.js +109 -0
  30. package/dist/es2019/ui/FloatingDragMenu/index.js +2 -2
  31. package/dist/es2019/ui/TableFloatingColumnControls/ColumnControls/index.js +24 -35
  32. package/dist/es2019/ui/TableFloatingColumnControls/index.js +1 -2
  33. package/dist/es2019/ui/TableFloatingControls/CornerControls/DragCornerControls.js +4 -0
  34. package/dist/es2019/ui/TableFloatingControls/RowControls/DragControls.js +26 -33
  35. package/dist/es2019/ui/common-styles.js +11 -1
  36. package/dist/es2019/ui/consts.js +2 -1
  37. package/dist/esm/commands/misc.js +4 -2
  38. package/dist/esm/commands/selection.js +4 -2
  39. package/dist/esm/pm-plugins/drag-and-drop/commands.js +3 -2
  40. package/dist/esm/pm-plugins/drag-and-drop/plugin.js +33 -1
  41. package/dist/esm/pm-plugins/drag-and-drop/reducer.js +2 -1
  42. package/dist/esm/pm-plugins/table-selection-keymap.js +2 -2
  43. package/dist/esm/ui/DragHandle/HandleIconComponent.js +1 -3
  44. package/dist/esm/ui/DragHandle/index.js +21 -9
  45. package/dist/esm/ui/FloatingDragMenu/DragMenu.js +74 -35
  46. package/dist/esm/ui/FloatingDragMenu/DropdownMenu.js +116 -0
  47. package/dist/esm/ui/FloatingDragMenu/index.js +2 -2
  48. package/dist/esm/ui/TableFloatingColumnControls/ColumnControls/index.js +24 -35
  49. package/dist/esm/ui/TableFloatingColumnControls/index.js +1 -2
  50. package/dist/esm/ui/TableFloatingControls/CornerControls/DragCornerControls.js +4 -0
  51. package/dist/esm/ui/TableFloatingControls/RowControls/DragControls.js +26 -33
  52. package/dist/esm/ui/common-styles.js +1 -1
  53. package/dist/esm/ui/consts.js +2 -1
  54. package/dist/types/commands/misc.d.ts +2 -2
  55. package/dist/types/commands/selection.d.ts +2 -2
  56. package/dist/types/pm-plugins/drag-and-drop/actions.d.ts +1 -0
  57. package/dist/types/pm-plugins/drag-and-drop/commands.d.ts +2 -1
  58. package/dist/types/pm-plugins/drag-and-drop/types.d.ts +2 -0
  59. package/dist/types/ui/DragHandle/HandleIconComponent.d.ts +1 -2
  60. package/dist/types/ui/DragHandle/index.d.ts +3 -2
  61. package/dist/types/ui/FloatingDragMenu/DragMenu.d.ts +7 -8
  62. package/dist/types/ui/FloatingDragMenu/DropdownMenu.d.ts +30 -0
  63. package/dist/types/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +1 -2
  64. package/dist/types/ui/TableFloatingControls/RowControls/DragControls.d.ts +1 -1
  65. package/dist/types/ui/consts.d.ts +1 -0
  66. package/dist/types-ts4.5/commands/misc.d.ts +2 -2
  67. package/dist/types-ts4.5/commands/selection.d.ts +2 -2
  68. package/dist/types-ts4.5/pm-plugins/drag-and-drop/actions.d.ts +1 -0
  69. package/dist/types-ts4.5/pm-plugins/drag-and-drop/commands.d.ts +2 -1
  70. package/dist/types-ts4.5/pm-plugins/drag-and-drop/types.d.ts +2 -0
  71. package/dist/types-ts4.5/ui/DragHandle/HandleIconComponent.d.ts +1 -2
  72. package/dist/types-ts4.5/ui/DragHandle/index.d.ts +3 -2
  73. package/dist/types-ts4.5/ui/FloatingDragMenu/DragMenu.d.ts +7 -8
  74. package/dist/types-ts4.5/ui/FloatingDragMenu/DropdownMenu.d.ts +30 -0
  75. package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +1 -2
  76. package/dist/types-ts4.5/ui/TableFloatingControls/RowControls/DragControls.d.ts +1 -1
  77. package/dist/types-ts4.5/ui/consts.d.ts +1 -0
  78. package/package.json +3 -2
  79. package/src/commands/misc.ts +17 -4
  80. package/src/commands/selection.ts +12 -4
  81. package/src/pm-plugins/drag-and-drop/actions.ts +1 -0
  82. package/src/pm-plugins/drag-and-drop/commands.ts +3 -0
  83. package/src/pm-plugins/drag-and-drop/plugin.ts +47 -0
  84. package/src/pm-plugins/drag-and-drop/reducer.ts +1 -0
  85. package/src/pm-plugins/drag-and-drop/types.ts +3 -0
  86. package/src/pm-plugins/table-selection-keymap.ts +2 -2
  87. package/src/ui/DragHandle/HandleIconComponent.tsx +2 -9
  88. package/src/ui/DragHandle/index.tsx +37 -16
  89. package/src/ui/FloatingDragMenu/DragMenu.tsx +362 -310
  90. package/src/ui/FloatingDragMenu/DropdownMenu.tsx +150 -0
  91. package/src/ui/FloatingDragMenu/index.tsx +3 -3
  92. package/src/ui/TableFloatingColumnControls/ColumnControls/index.tsx +72 -91
  93. package/src/ui/TableFloatingColumnControls/index.tsx +1 -2
  94. package/src/ui/TableFloatingControls/CornerControls/DragCornerControls.tsx +5 -0
  95. package/src/ui/TableFloatingControls/RowControls/DragControls.tsx +89 -104
  96. package/src/ui/common-styles.ts +11 -1
  97. package/src/ui/consts.ts +1 -0
  98. package/tsconfig.app.json +3 -0
@@ -75,11 +75,11 @@ var DragControlsComponent = function DragControlsComponent(_ref) {
75
75
  }
76
76
  });
77
77
  }, [editorView]);
78
- var onMouseUp = useCallback(function (event) {
79
- if (event.shiftKey) {
78
+ var toggleDragMenuHandler = useCallback(function (trigger, event) {
79
+ if (event !== null && event !== void 0 && event.shiftKey) {
80
80
  return;
81
81
  }
82
- toggleDragMenu(undefined, 'row', hoveredCell === null || hoveredCell === void 0 ? void 0 : hoveredCell.rowIndex)(editorView.state, editorView.dispatch);
82
+ toggleDragMenu(undefined, 'row', hoveredCell === null || hoveredCell === void 0 ? void 0 : hoveredCell.rowIndex, trigger)(editorView.state, editorView.dispatch);
83
83
  }, [editorView, hoveredCell === null || hoveredCell === void 0 ? void 0 : hoveredCell.rowIndex]);
84
84
  var rowIndex = hoveredCell === null || hoveredCell === void 0 ? void 0 : hoveredCell.rowIndex;
85
85
  var handleMouseOut = useCallback(function () {
@@ -114,31 +114,15 @@ var DragControlsComponent = function DragControlsComponent(_ref) {
114
114
  selectRows(selectedRowIndexes);
115
115
  }
116
116
  }, [rowIndex, selectRow, selectRows, selectedRowIndexes]);
117
- var generateHandleByType = function generateHandleByType(type) {
118
- if (!hoveredCell) {
119
- return null;
120
- }
117
+ var generateHandleByType = function generateHandleByType(type, appearance, gridRow, indexes) {
121
118
  var isHover = type === 'hover';
122
- var isRowsSelected = selectedRowIndexes.length > 0;
123
- var showCondition = isHover ? isRowsSelected && !selectedRowIndexes.includes(rowIndex) && Number.isFinite(hoveredCell === null || hoveredCell === void 0 ? void 0 : hoveredCell.colIndex) : selectedRowIndexes.length < rowHeights.length && rowIndex < rowHeights.length && Number.isFinite(hoveredCell === null || hoveredCell === void 0 ? void 0 : hoveredCell.colIndex);
124
- if (!showCondition) {
125
- return null;
126
- }
127
- var gridRowPosition = "".concat(rowIndex + 1, " / span 1");
128
-
129
- // if more than one row is selected, ensure the handle spans over the selected range
130
- var selectedRowPosition = "".concat(selectedRowIndexes[0] + 1, " / span ").concat(selectedRowIndexes.length);
131
- var hoveredAppearance = selectedRowIndexes.includes(rowIndex) ? isInDanger ? 'danger' : 'selected' : 'default';
132
- var currentSelectionAppearance = isRowsSelected ? isInDanger ? 'danger' : 'selected' : hoveredAppearance;
133
- var isSelecting = isRowsSelected && !isHover;
134
- var indexes = isRowsSelected ? isHover ? rowIndexes : selectedRowIndexes : rowIndexes;
135
119
  var previewHeight = rowHeights.reduce(function (sum, v, i) {
136
120
  return sum + v * (indexes.includes(i) ? 1 : 0);
137
121
  }, 0);
138
122
  return /*#__PURE__*/React.createElement("div", {
139
123
  key: type,
140
124
  style: {
141
- gridRow: isSelecting ? selectedRowPosition : gridRowPosition,
125
+ gridRow: gridRow,
142
126
  gridColumn: '2',
143
127
  // DragHandle uses `transform: rotate(90)`, which doesn't affect its parent (this div) causing the width of this element to be the true height of the drag handle
144
128
  display: 'flex',
@@ -147,33 +131,42 @@ var DragControlsComponent = function DragControlsComponent(_ref) {
147
131
  position: 'relative',
148
132
  right: '-0.5px'
149
133
  },
150
- "data-testid": "table-floating-row-".concat(isSelecting ? selectedRowIndexes[0] : rowIndex, "-drag-handle")
134
+ "data-testid": "table-floating-row-".concat(isHover ? rowIndex : selectedRowIndexes[0], "-drag-handle")
151
135
  }, /*#__PURE__*/React.createElement(DragHandle, {
152
136
  isDragMenuTarget: !isHover,
153
137
  direction: "row",
154
138
  tableLocalId: currentNodeLocalId,
155
139
  indexes: indexes,
156
- forceDefaultHandle: isHover ? false : isRowsSelected,
140
+ forceDefaultHandle: !isHover,
157
141
  previewWidth: tableWidth,
158
142
  previewHeight: previewHeight,
159
- appearance: isSelecting ? currentSelectionAppearance : hoveredAppearance,
143
+ appearance: appearance,
160
144
  onClick: handleClick,
161
145
  onMouseOver: handleMouseOver,
162
146
  onMouseOut: handleMouseOut,
163
- onMouseUp: onMouseUp,
147
+ toggleDragMenu: toggleDragMenuHandler,
164
148
  editorView: editorView
165
149
  }));
166
150
  };
167
- var rowHandles = function rowHandles(hoveredCell) {
168
- if (!hoveredCell) {
151
+ var rowHandles = function rowHandles() {
152
+ var handles = [];
153
+ var isRowSelected = selectedRowIndexes.length > 0;
154
+ var isEntireTableSelected = rowHeights.length > selectedRowIndexes.length;
155
+ if (!tableActive) {
169
156
  return null;
170
157
  }
171
- if (hoveredCell.rowIndex === undefined) {
172
- return generateHandleByType('selected');
158
+
159
+ // placeholder / selected need to always render at least one handle
160
+ // so it can be focused via keyboard shortcuts
161
+ handles.push(generateHandleByType('selected', isRowSelected && isEntireTableSelected ? isInDanger ? 'danger' : 'selected' : 'placeholder', "".concat(selectedRowIndexes[0] + 1, " / span ").concat(selectedRowIndexes.length), selectedRowIndexes));
162
+ if (hoveredCell && isTableHovered && rowIndex !== undefined && !selectedRowIndexes.includes(rowIndex) && rowIndex < rowHeights.length) {
163
+ handles.push(generateHandleByType('hover', 'default', "".concat(rowIndex + 1, " / span 1"), rowIndexes));
173
164
  }
174
- var sortedHandles = [generateHandleByType('hover'), generateHandleByType('selected')];
175
- return hoveredCell.rowIndex < selectedRowIndexes[0] ? sortedHandles : sortedHandles.reverse();
165
+ return handles;
176
166
  };
167
+ if (isResizing) {
168
+ return null;
169
+ }
177
170
  return /*#__PURE__*/React.createElement("div", {
178
171
  className: ClassName.DRAG_ROW_CONTROLS,
179
172
  style: {
@@ -183,7 +176,7 @@ var DragControlsComponent = function DragControlsComponent(_ref) {
183
176
  },
184
177
  onMouseMove: handleMouseMove,
185
178
  contentEditable: false
186
- }, !isResizing && rowsParams.map(function (_ref4, index) {
179
+ }, rowsParams.map(function (_ref4, index) {
187
180
  var startIndex = _ref4.startIndex,
188
181
  endIndex = _ref4.endIndex;
189
182
  return /*#__PURE__*/React.createElement(Fragment, {
@@ -213,6 +206,6 @@ var DragControlsComponent = function DragControlsComponent(_ref) {
213
206
  left: "var(--ds-space-negative-100, -8px)"
214
207
  }
215
208
  }));
216
- }), tableActive && isTableHovered && !isResizing && Number.isFinite(rowIndex) && rowHandles(hoveredCell));
209
+ }), rowHandles());
217
210
  };
218
211
  export var DragControls = injectIntl(DragControlsComponent);
@@ -66,7 +66,7 @@ var tableWrapperStyles = function tableWrapperStyles() {
66
66
  // TODO: https://product-fabric.atlassian.net/browse/DSP-4139
67
67
  export var tableStyles = function tableStyles(props) {
68
68
  var _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$featureFlags4;
69
- return css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\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 ", "\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 .", "\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 .", " {\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\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 z-index: ", ";\n\n .", " {\n position: absolute;\n align-self: end;\n height: 100%;\n width: 18px;\n }\n\n .", " {\n position: absolute;\n bottom: -3px;\n left: 2px;\n background-color: ", ";\n height: 4px;\n width: 4px;\n border-radius: 50%;\n }\n }\n\n .", " {\n .", " {\n height: 24px;\n position: absolute;\n top: ", ";\n z-index: ", ";\n }\n\n .", " {\n position: absolute;\n height: 24px;\n width: 100%;\n }\n\n .", " {\n background-color: ", ";\n height: 4px;\n width: 4px;\n border-radius: 50%;\n position: absolute;\n right: -2px;\n }\n }\n\n .", " {\n background: none;\n border: none;\n outline: none;\n position: absolute;\n margin: 0;\n padding: 0;\n display: flex;\n align-items: center;\n cursor: pointer;\n\n :focus {\n outline: none;\n }\n }\n\n .", " {\n cursor: grab;\n pointer-events: auto;\n\n line-height: 0;\n padding: 0;\n border-radius: 6px;\n width: max-content;\n border: 2px solid ", ";\n\n display: flex;\n justify-content: center;\n align-items: center;\n outline: none !important;\n background: transparent;\n\n &.", " {\n & svg {\n & > rect.", " {\n fill: ", ";\n }\n & > rect {\n fill: ", ";\n }\n & > g > rect {\n fill: ", ";\n }\n }\n }\n\n &:not(.", ") {\n & svg {\n rect {\n fill: ", ";\n }\n g {\n fill: ", ";\n }\n }\n\n &:hover {\n svg {\n rect {\n fill: ", ";\n }\n g {\n fill: ", ";\n }\n }\n }\n\n &.selected {\n svg {\n rect {\n fill: ", ";\n }\n g {\n fill: ", ";\n }\n }\n }\n\n &.danger {\n svg {\n rect {\n fill: ", ";\n }\n g {\n fill: ", ";\n }\n }\n }\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 // add a background above the first numbered column cell when sticky header is engaged\n // which hides the table when scrolling\n .", " {\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 .", ", .", " {\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 * 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 &.", ".", "::after {\n ", ";\n z-index: ", ";\n }\n }\n }\n\n // override for DnD controls\n .", " {\n position: absolute;\n margin-top: ", "px;\n left: -", "px;\n z-index: ", ";\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 left: -", "px;\n }\n\n .", ".", ",\n .", ".", " {\n z-index: ", ";\n }\n\n .", " {\n position: absolute;\n top: ", "px;\n }\n\n .", " .", " {\n position: fixed;\n /* higher zIndex than sticky header which is akEditorTableCellOnStickyHeaderZIndex - 5 */\n z-index: ", ";\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"])), ClassName.LAYOUT_BUTTON, "var(--ds-background-neutral, ".concat(N20A, ")"), "var(--ds-icon, ".concat(N300, ")"), ClassName.LAYOUT_BUTTON, ClassName.IS_RESIZING, "var(--ds-background-neutral-hovered, ".concat(B300, ")"), "var(--ds-icon, white)", tableSharedStyle(), columnControlsLineMarker(), hoveredDeleteButton(), hoveredCell(), hoveredWarningCell, ((_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags.tableDragAndDrop) && insertLine(), resizeHandle((_props$featureFlags2 = props.featureFlags) === null || _props$featureFlags2 === void 0 ? void 0 : _props$featureFlags2.tableDragAndDrop), rangeSelectionStyles, ClassName.LAST_ITEM_IN_CELL, ClassName.TABLE_NODE_WRAPPER, ClassName.TABLE_CELL, ClassName.TABLE_HEADER_CELL, ClassName.TABLE_CELL, tableCellBackgroundColor, tableBorderColor, tableBorderColor, ClassName.CONTROLS_FLOATING_BUTTON_COLUMN, insertColumnButtonWrapper(), ClassName.CONTROLS_FLOATING_BUTTON_ROW, insertRowButtonWrapper(), dragInsertButtonWrapper(), dragCornerControlButton(), DeleteButton(), ClassName.TABLE_STICKY, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, stickyRowOffsetTop + 2, akEditorTableNumberColumnWidth, akEditorStickyHeaderZIndex, stickyRowOffsetTop, "var(--ds-surface, white)", ClassName.TABLE_STICKY, ClassName.CORNER_CONTROLS, akEditorSmallZIndex, "var(--ds-surface, white)", tableToolbarSize, tableToolbarSize, ClassName.CORNER_CONTROLS, ClassName.CONTROLS_CORNER_BUTTON, tableToolbarSize, tableToolbarSize, tableStickyHeaderColumnControlsDecorationsStyle(), tableStickyHeaderFirefoxFixStyle(), ClassName.TABLE_STICKY, ClassName.ROW_CONTROLS, ClassName.ROW_CONTROLS_BUTTON_WRAP, akEditorStickyHeaderZIndex, tableToolbarSize, "var(--ds-surface, white)", tableToolbarSize, ClassName.TABLE_STICKY, "var(--ds-surface, green)", stickyRowOffsetTop, akEditorTableCellOnStickyHeaderZIndex - 5, "var(--ds-surface, white)", "var(--ds-shadow-overflow-perimeter, ".concat(N40A, ")"), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, akEditorTableCellOnStickyHeaderZIndex, ClassName.WITH_CONTROLS, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, tableToolbarSize, stickyHeaderBorderBottomWidth, tableBorderColor, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY, insertColumnButtonOffset + 1, ClassName.TABLE_STICKY, ClassName.TABLE_CONTAINER, ClassName.TABLE_STICKY, ClassName.WITH_RESIZE_LINE, ClassName.WITH_RESIZE_LINE, ClassName.RESIZE_HANDLE_DECORATION, (resizeHandlerAreaWidth - resizeLineWidth) / 2 + 1, ClassName.WITH_RESIZE_LINE, ClassName.SELECTED_CELL, ClassName.WITH_RESIZE_LINE, ClassName.SELECTED_CELL, ClassName.RESIZE_HANDLE_DECORATION, (resizeHandlerAreaWidth - resizeLineWidth) / 2, ClassName.HOVERED_CELL, ClassName.SELECTED_CELL, ClassName.WITH_CONTROLS, tableControlsSpacing, ClassName.WITH_CONTROLS, ClassName.TABLE_STICKY, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, tableControlsSpacing + 2, ClassName.CORNER_CONTROLS, tableControlsSpacing - tableToolbarSize + 2, "var(--ds-surface, white)", sentinelStyles, OverflowShadow((_props$featureFlags3 = props.featureFlags) === null || _props$featureFlags3 === void 0 ? void 0 : _props$featureFlags3.tableDragAndDrop), stickyScrollbarStyles(props.featureFlags), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, tablePadding, ClassName.DRAG_ROW_CONTROLS_WRAPPER, ClassName.ROW_CONTROLS_WRAPPER, tablePadding, ClassName.DRAG_COLUMN_CONTROLS_WRAPPER, tablePadding, ClassName.TABLE_CONTAINER, akEditorTableNumberColumnWidth + tablePadding - 1, ClassName.TABLE_LEFT_SHADOW, ClassName.TABLE_RIGHT_SHADOW, tableOverflowShadowWidth, ClassName.TABLE_LEFT_SHADOW, ClassName.TABLE_RIGHT_SHADOW, ClassName.NODEVIEW_WRAPPER, breakoutWidthStyling(), columnControlsDecoration(), rowControlsWrapperDotStyle(), ClassName.CORNER_CONTROLS, tableToolbarSize + 1, cornerControlHeight, ClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, InsertMarker("\n left: -11px;\n top: 9px;\n "), ClassName.CORNER_CONTROLS, ClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, ClassName.CONTROLS_CORNER_BUTTON, tableToolbarSize + 1, tableToolbarSize + 1, tableBorderColor, tableBorderRadiusSize, tableHeaderCellBackgroundColor, ClassName.CONTROLS_CORNER_BUTTON, tableBorderSelectedColor, tableToolbarSelectedColor, ClassName.TABLE_CONTAINER, ClassName.CORNER_CONTROLS, ClassName.CONTROLS_CORNER_BUTTON, getBooleanFF('platform.editor.custom-table-width') ? akEditorTableToolbarSize + akEditorTableNumberColumnWidth + 1 : akEditorTableToolbarSize + akEditorTableNumberColumnWidth, ClassName.ROW_CONTROLS, ClassName.CONTROLS_BUTTON, ClassName.IS_RESIZING, ClassName.CONTROLS_CORNER_BUTTON, tableBorderSelectedColor, tableToolbarSelectedColor, ClassName.IS_RESIZING, ClassName.CONTROLS_CORNER_BUTTON, ClassName.HOVERED_CELL_IN_DANGER, tableBorderDeleteColor, tableToolbarDeleteColor, ClassName.ROW_CONTROLS, tableToolbarSize, InsertMarker("\n bottom: -1px;\n left: -11px;\n "), ClassName.ROW_CONTROLS_INNER, ClassName.ROW_CONTROLS_BUTTON_WRAP, tableBorderRadiusSize, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.CONTROLS_BUTTON, akEditorUnitZIndex, HeaderButton("\n border-bottom: 1px solid ".concat(tableBorderColor, ";\n border-right: 0px;\n border-radius: 0;\n height: 100%;\n width: ").concat(tableToolbarSize, "px;\n\n .").concat(ClassName.CONTROLS_BUTTON_OVERLAY, " {\n position: absolute;\n width: 30px;\n height: 50%;\n right: 0;\n bottom: 0;\n }\n .").concat(ClassName.CONTROLS_BUTTON_OVERLAY, ":first-of-type {\n top: 0;\n }\n ")), ClassName.DRAG_ROW_CONTROLS, akEditorUnitZIndex, ClassName.DRAG_ROW_FLOATING_INSERT_DOT_WRAPPER, ClassName.DRAG_ROW_FLOATING_INSERT_DOT, "var(--ds-background-accent-gray-subtler, #C1C7D0)", ClassName.DRAG_COLUMN_CONTROLS, ClassName.DRAG_COLUMN_CONTROLS_INNER, "var(--ds-space-negative-150, -12px)", resizeHandlerZIndex, ClassName.DRAG_COLUMN_FLOATING_INSERT_DOT_WRAPPER, ClassName.DRAG_COLUMN_FLOATING_INSERT_DOT, "var(--ds-background-accent-gray-subtler, #C1C7D0)", ClassName.DRAG_HANDLE_BUTTON_CLICKABLE_ZONE, ClassName.DRAG_HANDLE_BUTTON_CONTAINER, "var(--ds-surface, ".concat(N0, ")"), ClassName.DRAG_HANDLE_DISABLED, ClassName.DRAG_HANDLE_MINIMISED, "var(--ds-background-accent-gray-subtler, #DCDFE4)", "var(--ds-background-accent-gray-subtlest, #F4F5F7)", "var(--ds-icon-disabled, #BFDBF847)", ClassName.DRAG_HANDLE_DISABLED, "var(--ds-background-accent-gray-subtler, #DCDFE4)", "var(--ds-icon-subtle, #626f86)", "var(--ds-background-accent-blue-subtle, #579DFF)", "var(--ds-icon-inverse, #FFF)", "var(--ds-background-accent-blue-subtle, #579dff)", "var(--ds-icon-inverse, #fff)", "var(--ds-background-accent-red-subtler-pressed, #F87462)", "var(--ds-border-inverse, #FFF)", floatingColumnControls(), ClassName.IS_RESIZING, ClassName.ROW_CONTROLS, HeaderButtonHover(), HeaderButtonDanger(), ClassName.NUMBERED_COLUMN, getBooleanFF('platform.editor.custom-table-width') ? akEditorTableToolbarSize : akEditorTableToolbarSize - 1, (_props$featureFlags4 = props.featureFlags) !== null && _props$featureFlags4 !== void 0 && _props$featureFlags4.tableDragAndDrop ? 0 : akEditorTableToolbarSize, akEditorTableNumberColumnWidth + 1, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderColor, relativeFontSizeToBase16(fontSize()), tableHeaderCellBackgroundColor, tableTextColor, tableBorderColor, tableBorderColor, ClassName.TABLE_STICKY, ClassName.NUMBERED_COLUMN_BUTTON_DISABLED, "var(--ds-surface, white)", ClassName.WITH_CONTROLS, ClassName.CORNER_CONTROLS, ClassName.ROW_CONTROLS, ClassName.NUMBERED_COLUMN, getBooleanFF('platform.editor.custom-table-width') ? 0 : 1, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderSelectedColor, tableBorderSelectedColor, tableToolbarSelectedColor, akEditorUnitZIndex, "var(--ds-text-selected, ".concat(N0, ")"), ClassName.IS_RESIZING, ClassName.WITH_CONTROLS, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON_DISABLED, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON_DISABLED, tableBorderSelectedColor, tableBorderSelectedColor, tableToolbarSelectedColor, akEditorUnitZIndex, "var(--ds-text-selected, ".concat(N0, ")"), ClassName.NUMBERED_COLUMN_BUTTON, ClassName.HOVERED_CELL_IN_DANGER, tableToolbarDeleteColor, tableBorderDeleteColor, "var(--ds-text-danger, ".concat(R500, ")"), akEditorUnitZIndex, ClassName.TABLE_NODE_WRAPPER, ClassName.COLUMN_CONTROLS_DECORATIONS, ClassName.TABLE_HEADER_CELL, ClassName.SELECTED_CELL, ClassName.HOVERED_CELL_IN_DANGER, ClassName.SELECTED_CELL, ClassName.HOVERED_CELL_IN_DANGER, akEditorSmallZIndex, ClassName.SELECTED_CELL, tableBorderSelectedColor, ClassName.SELECTED_CELL, tableCellSelectedColor, akEditorSmallZIndex, ClassName.HOVERED_CELL_IN_DANGER, ClassName.HOVERED_CELL_IN_DANGER, tableCellDeleteColor, akEditorUnitZIndex * 100, ClassName.HOVERED_CELL, ClassName.SELECTED_CELL, ClassName.TABLE_HEADER_CELL, ClassName.SELECTED_CELL, ClassName.TABLE_HEADER_CELL, ClassName.HOVERED_CELL, tableBorderSelectedColor, akEditorSmallZIndex, ClassName.HOVERED_CELL_IN_DANGER, tableBorderStyles(), akEditorUnitZIndex * 100, ClassName.HOVERED_NO_HIGHLIGHT, ClassName.HOVERED_CELL_IN_DANGER, tableBorderStyles(), akEditorUnitZIndex * 100, ClassName.DRAG_ROW_CONTROLS_WRAPPER, tableMarginTop, tableToolbarSize + 1, rowControlsZIndex + 4, ClassName.ROW_CONTROLS_WRAPPER, tableMarginTop - cornerControlHeight + 1, tableToolbarSize, ClassName.DRAG_ROW_CONTROLS_WRAPPER, ClassName.TABLE_LEFT_SHADOW, ClassName.ROW_CONTROLS_WRAPPER, ClassName.TABLE_LEFT_SHADOW, akEditorUnitZIndex, ClassName.DRAG_COLUMN_CONTROLS_WRAPPER, tableMarginTop, ClassName.TABLE_STICKY, ClassName.DRAG_COLUMN_CONTROLS_WRAPPER, akEditorTableCellOnStickyHeaderZIndex - 4, tableWrapperStyles(), ClassName.IS_RESIZING, ClassName.TABLE_NODE_WRAPPER, scrollbarStyles, ClassName.RESIZE_CURSOR, shadowSentinelStyles);
69
+ return css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\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 ", "\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 .", "\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 .", " {\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\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 z-index: ", ";\n\n .", " {\n position: absolute;\n align-self: end;\n height: 100%;\n width: 18px;\n }\n\n .", " {\n position: absolute;\n bottom: -3px;\n left: 2px;\n background-color: ", ";\n height: 4px;\n width: 4px;\n border-radius: 50%;\n }\n }\n\n .", " {\n .", " {\n height: 24px;\n position: absolute;\n top: ", ";\n z-index: ", ";\n }\n\n .", " {\n position: absolute;\n height: 24px;\n width: 100%;\n }\n\n .", " {\n background-color: ", ";\n height: 4px;\n width: 4px;\n border-radius: 50%;\n position: absolute;\n right: -2px;\n }\n }\n\n .", " {\n background: none;\n border: none;\n outline: none;\n position: absolute;\n margin: 0;\n padding: 0;\n display: flex;\n align-items: center;\n cursor: pointer;\n\n :focus {\n outline: none;\n }\n }\n\n .", " {\n cursor: grab;\n pointer-events: auto;\n\n line-height: 0;\n padding: 0;\n border-radius: 6px;\n width: max-content;\n border: 2px solid ", ";\n\n display: flex;\n justify-content: center;\n align-items: center;\n background: transparent;\n outline: none;\n\n &.placeholder {\n background-color: transparent;\n border: 2px solid transparent;\n }\n\n &.", " {\n & svg {\n & > rect.", " {\n fill: ", ";\n }\n & > rect {\n fill: ", ";\n }\n & > g > rect {\n fill: ", ";\n }\n }\n }\n\n &:not(.", ") {\n & svg {\n rect {\n fill: ", ";\n }\n g {\n fill: ", ";\n }\n }\n\n &:hover {\n svg {\n rect {\n fill: ", ";\n }\n g {\n fill: ", ";\n }\n }\n }\n\n &.selected {\n :focus {\n outline: 2px solid ", ";\n outline-offset: 1px;\n }\n\n svg {\n rect {\n fill: ", ";\n }\n g {\n fill: ", ";\n }\n }\n }\n\n &.danger {\n svg {\n rect {\n fill: ", ";\n }\n g {\n fill: ", ";\n }\n }\n }\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 // add a background above the first numbered column cell when sticky header is engaged\n // which hides the table when scrolling\n .", " {\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 .", ", .", " {\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 * 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 &.", ".", "::after {\n ", ";\n z-index: ", ";\n }\n }\n }\n\n // override for DnD controls\n .", " {\n position: absolute;\n margin-top: ", "px;\n left: -", "px;\n z-index: ", ";\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 left: -", "px;\n }\n\n .", ".", ",\n .", ".", " {\n z-index: ", ";\n }\n\n .", " {\n position: absolute;\n top: ", "px;\n }\n\n .", " .", " {\n position: fixed;\n /* higher zIndex than sticky header which is akEditorTableCellOnStickyHeaderZIndex - 5 */\n z-index: ", ";\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"])), ClassName.LAYOUT_BUTTON, "var(--ds-background-neutral, ".concat(N20A, ")"), "var(--ds-icon, ".concat(N300, ")"), ClassName.LAYOUT_BUTTON, ClassName.IS_RESIZING, "var(--ds-background-neutral-hovered, ".concat(B300, ")"), "var(--ds-icon, white)", tableSharedStyle(), columnControlsLineMarker(), hoveredDeleteButton(), hoveredCell(), hoveredWarningCell, ((_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags.tableDragAndDrop) && insertLine(), resizeHandle((_props$featureFlags2 = props.featureFlags) === null || _props$featureFlags2 === void 0 ? void 0 : _props$featureFlags2.tableDragAndDrop), rangeSelectionStyles, ClassName.LAST_ITEM_IN_CELL, ClassName.TABLE_NODE_WRAPPER, ClassName.TABLE_CELL, ClassName.TABLE_HEADER_CELL, ClassName.TABLE_CELL, tableCellBackgroundColor, tableBorderColor, tableBorderColor, ClassName.CONTROLS_FLOATING_BUTTON_COLUMN, insertColumnButtonWrapper(), ClassName.CONTROLS_FLOATING_BUTTON_ROW, insertRowButtonWrapper(), dragInsertButtonWrapper(), dragCornerControlButton(), DeleteButton(), ClassName.TABLE_STICKY, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, stickyRowOffsetTop + 2, akEditorTableNumberColumnWidth, akEditorStickyHeaderZIndex, stickyRowOffsetTop, "var(--ds-surface, white)", ClassName.TABLE_STICKY, ClassName.CORNER_CONTROLS, akEditorSmallZIndex, "var(--ds-surface, white)", tableToolbarSize, tableToolbarSize, ClassName.CORNER_CONTROLS, ClassName.CONTROLS_CORNER_BUTTON, tableToolbarSize, tableToolbarSize, tableStickyHeaderColumnControlsDecorationsStyle(), tableStickyHeaderFirefoxFixStyle(), ClassName.TABLE_STICKY, ClassName.ROW_CONTROLS, ClassName.ROW_CONTROLS_BUTTON_WRAP, akEditorStickyHeaderZIndex, tableToolbarSize, "var(--ds-surface, white)", tableToolbarSize, ClassName.TABLE_STICKY, "var(--ds-surface, green)", stickyRowOffsetTop, akEditorTableCellOnStickyHeaderZIndex - 5, "var(--ds-surface, white)", "var(--ds-shadow-overflow-perimeter, ".concat(N40A, ")"), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, akEditorTableCellOnStickyHeaderZIndex, ClassName.WITH_CONTROLS, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, tableToolbarSize, stickyHeaderBorderBottomWidth, tableBorderColor, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY, insertColumnButtonOffset + 1, ClassName.TABLE_STICKY, ClassName.TABLE_CONTAINER, ClassName.TABLE_STICKY, ClassName.WITH_RESIZE_LINE, ClassName.WITH_RESIZE_LINE, ClassName.RESIZE_HANDLE_DECORATION, (resizeHandlerAreaWidth - resizeLineWidth) / 2 + 1, ClassName.WITH_RESIZE_LINE, ClassName.SELECTED_CELL, ClassName.WITH_RESIZE_LINE, ClassName.SELECTED_CELL, ClassName.RESIZE_HANDLE_DECORATION, (resizeHandlerAreaWidth - resizeLineWidth) / 2, ClassName.HOVERED_CELL, ClassName.SELECTED_CELL, ClassName.WITH_CONTROLS, tableControlsSpacing, ClassName.WITH_CONTROLS, ClassName.TABLE_STICKY, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, tableControlsSpacing + 2, ClassName.CORNER_CONTROLS, tableControlsSpacing - tableToolbarSize + 2, "var(--ds-surface, white)", sentinelStyles, OverflowShadow((_props$featureFlags3 = props.featureFlags) === null || _props$featureFlags3 === void 0 ? void 0 : _props$featureFlags3.tableDragAndDrop), stickyScrollbarStyles(props.featureFlags), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, tablePadding, ClassName.DRAG_ROW_CONTROLS_WRAPPER, ClassName.ROW_CONTROLS_WRAPPER, tablePadding, ClassName.DRAG_COLUMN_CONTROLS_WRAPPER, tablePadding, ClassName.TABLE_CONTAINER, akEditorTableNumberColumnWidth + tablePadding - 1, ClassName.TABLE_LEFT_SHADOW, ClassName.TABLE_RIGHT_SHADOW, tableOverflowShadowWidth, ClassName.TABLE_LEFT_SHADOW, ClassName.TABLE_RIGHT_SHADOW, ClassName.NODEVIEW_WRAPPER, breakoutWidthStyling(), columnControlsDecoration(), rowControlsWrapperDotStyle(), ClassName.CORNER_CONTROLS, tableToolbarSize + 1, cornerControlHeight, ClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, InsertMarker("\n left: -11px;\n top: 9px;\n "), ClassName.CORNER_CONTROLS, ClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, ClassName.CONTROLS_CORNER_BUTTON, tableToolbarSize + 1, tableToolbarSize + 1, tableBorderColor, tableBorderRadiusSize, tableHeaderCellBackgroundColor, ClassName.CONTROLS_CORNER_BUTTON, tableBorderSelectedColor, tableToolbarSelectedColor, ClassName.TABLE_CONTAINER, ClassName.CORNER_CONTROLS, ClassName.CONTROLS_CORNER_BUTTON, getBooleanFF('platform.editor.custom-table-width') ? akEditorTableToolbarSize + akEditorTableNumberColumnWidth + 1 : akEditorTableToolbarSize + akEditorTableNumberColumnWidth, ClassName.ROW_CONTROLS, ClassName.CONTROLS_BUTTON, ClassName.IS_RESIZING, ClassName.CONTROLS_CORNER_BUTTON, tableBorderSelectedColor, tableToolbarSelectedColor, ClassName.IS_RESIZING, ClassName.CONTROLS_CORNER_BUTTON, ClassName.HOVERED_CELL_IN_DANGER, tableBorderDeleteColor, tableToolbarDeleteColor, ClassName.ROW_CONTROLS, tableToolbarSize, InsertMarker("\n bottom: -1px;\n left: -11px;\n "), ClassName.ROW_CONTROLS_INNER, ClassName.ROW_CONTROLS_BUTTON_WRAP, tableBorderRadiusSize, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.CONTROLS_BUTTON, akEditorUnitZIndex, HeaderButton("\n border-bottom: 1px solid ".concat(tableBorderColor, ";\n border-right: 0px;\n border-radius: 0;\n height: 100%;\n width: ").concat(tableToolbarSize, "px;\n\n .").concat(ClassName.CONTROLS_BUTTON_OVERLAY, " {\n position: absolute;\n width: 30px;\n height: 50%;\n right: 0;\n bottom: 0;\n }\n .").concat(ClassName.CONTROLS_BUTTON_OVERLAY, ":first-of-type {\n top: 0;\n }\n ")), ClassName.DRAG_ROW_CONTROLS, akEditorUnitZIndex, ClassName.DRAG_ROW_FLOATING_INSERT_DOT_WRAPPER, ClassName.DRAG_ROW_FLOATING_INSERT_DOT, "var(--ds-background-accent-gray-subtler, #C1C7D0)", ClassName.DRAG_COLUMN_CONTROLS, ClassName.DRAG_COLUMN_CONTROLS_INNER, "var(--ds-space-negative-150, -12px)", resizeHandlerZIndex, ClassName.DRAG_COLUMN_FLOATING_INSERT_DOT_WRAPPER, ClassName.DRAG_COLUMN_FLOATING_INSERT_DOT, "var(--ds-background-accent-gray-subtler, #C1C7D0)", ClassName.DRAG_HANDLE_BUTTON_CLICKABLE_ZONE, ClassName.DRAG_HANDLE_BUTTON_CONTAINER, "var(--ds-surface, ".concat(N0, ")"), ClassName.DRAG_HANDLE_DISABLED, ClassName.DRAG_HANDLE_MINIMISED, "var(--ds-background-accent-gray-subtler, #DCDFE4)", "var(--ds-background-accent-gray-subtlest, #F4F5F7)", "var(--ds-icon-disabled, #BFDBF847)", ClassName.DRAG_HANDLE_DISABLED, "var(--ds-background-accent-gray-subtler, #DCDFE4)", "var(--ds-icon-subtle, #626f86)", "var(--ds-background-accent-blue-subtle, #579DFF)", "var(--ds-icon-inverse, #FFF)", "var(--ds-border-focused, #2684FF)", "var(--ds-background-accent-blue-subtle, #579dff)", "var(--ds-icon-inverse, #fff)", "var(--ds-background-accent-red-subtler-pressed, #F87462)", "var(--ds-border-inverse, #FFF)", floatingColumnControls(), ClassName.IS_RESIZING, ClassName.ROW_CONTROLS, HeaderButtonHover(), HeaderButtonDanger(), ClassName.NUMBERED_COLUMN, getBooleanFF('platform.editor.custom-table-width') ? akEditorTableToolbarSize : akEditorTableToolbarSize - 1, (_props$featureFlags4 = props.featureFlags) !== null && _props$featureFlags4 !== void 0 && _props$featureFlags4.tableDragAndDrop ? 0 : akEditorTableToolbarSize, akEditorTableNumberColumnWidth + 1, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderColor, relativeFontSizeToBase16(fontSize()), tableHeaderCellBackgroundColor, tableTextColor, tableBorderColor, tableBorderColor, ClassName.TABLE_STICKY, ClassName.NUMBERED_COLUMN_BUTTON_DISABLED, "var(--ds-surface, white)", ClassName.WITH_CONTROLS, ClassName.CORNER_CONTROLS, ClassName.ROW_CONTROLS, ClassName.NUMBERED_COLUMN, getBooleanFF('platform.editor.custom-table-width') ? 0 : 1, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderSelectedColor, tableBorderSelectedColor, tableToolbarSelectedColor, akEditorUnitZIndex, "var(--ds-text-selected, ".concat(N0, ")"), ClassName.IS_RESIZING, ClassName.WITH_CONTROLS, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON_DISABLED, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON_DISABLED, tableBorderSelectedColor, tableBorderSelectedColor, tableToolbarSelectedColor, akEditorUnitZIndex, "var(--ds-text-selected, ".concat(N0, ")"), ClassName.NUMBERED_COLUMN_BUTTON, ClassName.HOVERED_CELL_IN_DANGER, tableToolbarDeleteColor, tableBorderDeleteColor, "var(--ds-text-danger, ".concat(R500, ")"), akEditorUnitZIndex, ClassName.TABLE_NODE_WRAPPER, ClassName.COLUMN_CONTROLS_DECORATIONS, ClassName.TABLE_HEADER_CELL, ClassName.SELECTED_CELL, ClassName.HOVERED_CELL_IN_DANGER, ClassName.SELECTED_CELL, ClassName.HOVERED_CELL_IN_DANGER, akEditorSmallZIndex, ClassName.SELECTED_CELL, tableBorderSelectedColor, ClassName.SELECTED_CELL, tableCellSelectedColor, akEditorSmallZIndex, ClassName.HOVERED_CELL_IN_DANGER, ClassName.HOVERED_CELL_IN_DANGER, tableCellDeleteColor, akEditorUnitZIndex * 100, ClassName.HOVERED_CELL, ClassName.SELECTED_CELL, ClassName.TABLE_HEADER_CELL, ClassName.SELECTED_CELL, ClassName.TABLE_HEADER_CELL, ClassName.HOVERED_CELL, tableBorderSelectedColor, akEditorSmallZIndex, ClassName.HOVERED_CELL_IN_DANGER, tableBorderStyles(), akEditorUnitZIndex * 100, ClassName.HOVERED_NO_HIGHLIGHT, ClassName.HOVERED_CELL_IN_DANGER, tableBorderStyles(), akEditorUnitZIndex * 100, ClassName.DRAG_ROW_CONTROLS_WRAPPER, tableMarginTop, tableToolbarSize + 1, rowControlsZIndex + 4, ClassName.ROW_CONTROLS_WRAPPER, tableMarginTop - cornerControlHeight + 1, tableToolbarSize, ClassName.DRAG_ROW_CONTROLS_WRAPPER, ClassName.TABLE_LEFT_SHADOW, ClassName.ROW_CONTROLS_WRAPPER, ClassName.TABLE_LEFT_SHADOW, akEditorUnitZIndex, ClassName.DRAG_COLUMN_CONTROLS_WRAPPER, tableMarginTop, ClassName.TABLE_STICKY, ClassName.DRAG_COLUMN_CONTROLS_WRAPPER, akEditorTableCellOnStickyHeaderZIndex - 4, tableWrapperStyles(), ClassName.IS_RESIZING, ClassName.TABLE_NODE_WRAPPER, scrollbarStyles, ClassName.RESIZE_CURSOR, shadowSentinelStyles);
70
70
  };
71
71
  export var tableFullPageEditorStyles = css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\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"])), ClassName.TABLE_NODE_WRAPPER);
72
72
  export var tableCommentEditorStyles = css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n .ProseMirror .", " > table {\n margin-left: 0;\n margin-right: 0;\n ", ";\n }\n"])), ClassName.TABLE_NODE_WRAPPER, scrollbarStyles);
@@ -68,4 +68,5 @@ export var STICKY_HEADER_TOGGLE_TOLERANCE_MS = 5;
68
68
  export var TABLE_GUIDELINE_VISIBLE_ADJUSTMENT = -68;
69
69
  export var dragMenuDropdownWidth = 250;
70
70
  export var dragTableInsertColumnButtonSize = 16;
71
- export var dropTargetExtendedWidth = 150;
71
+ export var dropTargetExtendedWidth = 150;
72
+ export var colorPalletteColumns = 7;
@@ -19,9 +19,9 @@ export declare const deleteTableIfSelected: Command;
19
19
  export declare const convertFirstRowToHeader: (schema: Schema) => (tr: Transaction) => Transaction;
20
20
  export declare const moveCursorBackward: Command;
21
21
  export declare const setMultipleCellAttrs: (attrs: Object, targetCellPosition?: number) => Command;
22
- export declare const selectColumn: (column: number, expand?: boolean) => Command;
22
+ export declare const selectColumn: (column: number, expand?: boolean, triggeredByKeyboard?: boolean) => Command;
23
23
  export declare const selectColumns: (columnIndexes: number[]) => Command;
24
- export declare const selectRow: (row: number, expand?: boolean) => Command;
24
+ export declare const selectRow: (row: number, expand?: boolean, triggeredByKeyboard?: boolean) => Command;
25
25
  export declare const selectRows: (rowIndexes: number[]) => Command;
26
26
  export declare const showInsertColumnButton: (columnIndex: number) => Command;
27
27
  export declare const showInsertRowButton: (rowIndex: number) => Command;
@@ -6,6 +6,6 @@ export declare enum TableSelectionDirection {
6
6
  }
7
7
  export declare const arrowLeftFromTable: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => () => Command;
8
8
  export declare const arrowRightFromTable: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => () => Command;
9
- export declare const selectColumns: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => () => Command;
10
- export declare const selectRows: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => () => Command;
9
+ export declare const selectColumns: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => (triggeredByKeyboard?: boolean) => Command;
10
+ export declare const selectRows: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => (triggeredByKeyboard?: boolean) => Command;
11
11
  export declare const shiftArrowUpFromTable: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => () => Command;
@@ -22,5 +22,6 @@ export type DragAndDropToggleDragMenuAction = DragAndDropAction<typeof DragAndDr
22
22
  isDragMenuOpen: boolean;
23
23
  direction: TableDirection;
24
24
  index: number;
25
+ isKeyboardModeActive: boolean;
25
26
  }>;
26
27
  export type DragAndDropPluginAction = DragAndDropSetDropTargetAction | DragAndDropClearDropTargetAction | DragAndDropToggleDragMenuAction;
@@ -4,9 +4,10 @@ import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
4
4
  import type { DraggableType, TableDirection } from '../../types';
5
5
  import { TableDecorations } from '../../types';
6
6
  import { DropTargetType } from './consts';
7
+ import type { TriggerType } from './types';
7
8
  export declare const getDecorations: (state: EditorState) => DecorationSet;
8
9
  export declare const updatePluginStateDecorations: (state: EditorState, decorations: Decoration[], key: TableDecorations) => DecorationSet;
9
10
  export declare const setDropTarget: (type: DropTargetType, index: number, hasMergedCells: boolean, tr?: Transaction) => import("@atlaskit/editor-common/types").Command;
10
11
  export declare const clearDropTarget: (tr?: Transaction) => import("@atlaskit/editor-common/types").Command;
11
12
  export declare const moveSource: (sourceType: DraggableType, sourceIndexes: number[], targetIndex: number, tr?: Transaction) => import("@atlaskit/editor-common/types").Command;
12
- export declare const toggleDragMenu: (isDragMenuOpen: boolean | undefined, direction?: TableDirection, index?: number) => import("@atlaskit/editor-common/types").Command;
13
+ export declare const toggleDragMenu: (isDragMenuOpen: boolean | undefined, direction?: TableDirection, index?: number, trigger?: TriggerType) => import("@atlaskit/editor-common/types").Command;
@@ -9,4 +9,6 @@ export interface DragAndDropPluginState {
9
9
  dragMenuDirection?: TableDirection;
10
10
  dragMenuIndex: number;
11
11
  isDragging: boolean;
12
+ isKeyboardModeActive: boolean;
12
13
  }
14
+ export type TriggerType = 'mouse' | 'keyboard';
@@ -1,8 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  type HandleIconProps = {
3
3
  forceDefaultHandle: boolean;
4
- isRowHandleHovered: boolean;
5
- isColumnHandleHovered: boolean;
4
+ isHandleHovered: boolean;
6
5
  hasMergedCells: boolean;
7
6
  };
8
7
  export declare const HandleIconComponent: (props: HandleIconProps) => JSX.Element;
@@ -2,8 +2,9 @@ import type { MouseEventHandler } from 'react';
2
2
  import React from 'react';
3
3
  import type { WrappedComponentProps } from 'react-intl-next';
4
4
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
5
+ import type { TriggerType } from '../../pm-plugins/drag-and-drop/types';
5
6
  import type { TableDirection } from '../../types';
6
- type DragHandleAppearance = 'default' | 'selected' | 'disabled' | 'danger';
7
+ export type DragHandleAppearance = 'default' | 'selected' | 'disabled' | 'danger' | 'placeholder';
7
8
  type DragHandleProps = {
8
9
  tableLocalId: string;
9
10
  indexes: number[];
@@ -15,7 +16,7 @@ type DragHandleProps = {
15
16
  onClick?: MouseEventHandler;
16
17
  onMouseOver?: MouseEventHandler;
17
18
  onMouseOut?: MouseEventHandler;
18
- onMouseUp?: MouseEventHandler;
19
+ toggleDragMenu?: (trigger: TriggerType, event?: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
19
20
  editorView: EditorView;
20
21
  isDragMenuTarget: boolean;
21
22
  };
@@ -1,4 +1,6 @@
1
- /// <reference types="react" />
1
+ /** @jsx jsx */
2
+ /** @jsxFrag */
3
+ import React from 'react';
2
4
  import { jsx } from '@emotion/react';
3
5
  import type { WrappedComponentProps } from 'react-intl-next';
4
6
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
@@ -9,20 +11,17 @@ import type { PluginConfig, TableDirection } from '../../types';
9
11
  type DragMenuProps = {
10
12
  direction?: TableDirection;
11
13
  index?: number;
12
- tableRef?: HTMLTableElement;
14
+ target?: Element;
13
15
  tableNode?: PmNode;
14
16
  editorView: EditorView;
15
17
  isOpen?: boolean;
16
18
  targetCellPosition?: number;
17
- mountPoint?: HTMLElement;
18
- boundariesElement?: HTMLElement;
19
- scrollableElement?: HTMLElement;
20
19
  pluginConfig?: PluginConfig;
21
20
  getEditorContainerWidth: GetEditorContainerWidth;
22
21
  editorAnalyticsAPI?: EditorAnalyticsAPI;
23
22
  };
24
- export declare const DragMenu: ({ direction, index, isOpen, editorView, tableNode, mountPoint, boundariesElement, scrollableElement, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, pluginConfig, intl: { formatMessage }, }: DragMenuProps & WrappedComponentProps) => jsx.JSX.Element | null;
25
- declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<DragMenuProps & WrappedComponentProps<"intl">>> & {
26
- WrappedComponent: import("react").ComponentType<DragMenuProps & WrappedComponentProps<"intl">>;
23
+ export declare const DragMenu: React.MemoExoticComponent<({ direction, index, target, isOpen, editorView, tableNode, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, pluginConfig, intl: { formatMessage }, }: DragMenuProps & WrappedComponentProps) => jsx.JSX.Element | null>;
24
+ declare const _default: React.FC<import("react-intl-next").WithIntlProps<DragMenuProps & WrappedComponentProps<"intl">>> & {
25
+ WrappedComponent: React.ComponentType<DragMenuProps & WrappedComponentProps<"intl">>;
27
26
  };
28
27
  export default _default;
@@ -0,0 +1,30 @@
1
+ /// <reference types="react" />
2
+ import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
3
+ type DropdownMenuProps = {
4
+ target?: HTMLElement;
5
+ items: Array<{
6
+ items: MenuItem[];
7
+ }>;
8
+ /**
9
+ * use to toggle top level menu keyboard navigation and action keys
10
+ * e.g. should be false if submenu is rendered as a child to avoid multiple keydown handlers
11
+ */
12
+ disableKeyboardHandling: boolean;
13
+ section: {
14
+ hasSeparator?: boolean;
15
+ title?: string;
16
+ };
17
+ onItemActivated?: (attrs: {
18
+ item: MenuItem;
19
+ shouldCloseMenu?: boolean;
20
+ }) => void;
21
+ handleClose: (focusTarget: 'editor' | 'handle') => void;
22
+ onMouseEnter: (attrs: {
23
+ item: MenuItem;
24
+ }) => void;
25
+ onMouseLeave: (attrs: {
26
+ item: MenuItem;
27
+ }) => void;
28
+ };
29
+ export declare const DropdownMenu: ({ target, items, section, disableKeyboardHandling, onItemActivated, handleClose, onMouseEnter, onMouseLeave, }: DropdownMenuProps) => JSX.Element;
30
+ export {};
@@ -7,7 +7,6 @@ export interface ColumnControlsProps {
7
7
  isInDanger?: boolean;
8
8
  tableRef: HTMLTableElement;
9
9
  hoveredCell?: CellHoverMeta;
10
- isResizing?: boolean;
11
10
  stickyTop?: number;
12
11
  localId?: string;
13
12
  rowHeights?: number[];
@@ -19,5 +18,5 @@ export interface ColumnControlsProps {
19
18
  isDragging?: boolean;
20
19
  getScrollOffset?: () => number;
21
20
  }
22
- export declare const ColumnControls: ({ editorView, tableActive, tableRef, hoveredCell, isResizing, stickyTop, localId, isInDanger, rowHeights, colWidths, hasHeaderColumn, isTableHovered, tableContainerWidth, isNumberColumnEnabled, isDragging, getScrollOffset, }: ColumnControlsProps) => JSX.Element;
21
+ export declare const ColumnControls: ({ editorView, tableActive, tableRef, hoveredCell, stickyTop, localId, isInDanger, rowHeights, colWidths, hasHeaderColumn, isTableHovered, tableContainerWidth, isNumberColumnEnabled, isDragging, getScrollOffset, }: ColumnControlsProps) => JSX.Element;
23
22
  export default ColumnControls;
@@ -11,8 +11,8 @@ type DragControlsProps = {
11
11
  tableActive?: boolean;
12
12
  hoveredCell?: CellHoverMeta;
13
13
  isInDanger?: boolean;
14
- isResizing?: boolean;
15
14
  isTableHovered?: boolean;
15
+ isResizing?: boolean;
16
16
  hoverRows: (rows: number[], danger?: boolean) => void;
17
17
  selectRow: (row: number, expand: boolean) => void;
18
18
  selectRows: (rowIndexes: number[]) => void;
@@ -56,3 +56,4 @@ export declare const TABLE_GUIDELINE_VISIBLE_ADJUSTMENT = -68;
56
56
  export declare const dragMenuDropdownWidth = 250;
57
57
  export declare const dragTableInsertColumnButtonSize = 16;
58
58
  export declare const dropTargetExtendedWidth = 150;
59
+ export declare const colorPalletteColumns = 7;
@@ -19,9 +19,9 @@ export declare const deleteTableIfSelected: Command;
19
19
  export declare const convertFirstRowToHeader: (schema: Schema) => (tr: Transaction) => Transaction;
20
20
  export declare const moveCursorBackward: Command;
21
21
  export declare const setMultipleCellAttrs: (attrs: Object, targetCellPosition?: number) => Command;
22
- export declare const selectColumn: (column: number, expand?: boolean) => Command;
22
+ export declare const selectColumn: (column: number, expand?: boolean, triggeredByKeyboard?: boolean) => Command;
23
23
  export declare const selectColumns: (columnIndexes: number[]) => Command;
24
- export declare const selectRow: (row: number, expand?: boolean) => Command;
24
+ export declare const selectRow: (row: number, expand?: boolean, triggeredByKeyboard?: boolean) => Command;
25
25
  export declare const selectRows: (rowIndexes: number[]) => Command;
26
26
  export declare const showInsertColumnButton: (columnIndex: number) => Command;
27
27
  export declare const showInsertRowButton: (rowIndex: number) => Command;
@@ -6,6 +6,6 @@ export declare enum TableSelectionDirection {
6
6
  }
7
7
  export declare const arrowLeftFromTable: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => () => Command;
8
8
  export declare const arrowRightFromTable: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => () => Command;
9
- export declare const selectColumns: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => () => Command;
10
- export declare const selectRows: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => () => Command;
9
+ export declare const selectColumns: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => (triggeredByKeyboard?: boolean) => Command;
10
+ export declare const selectRows: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => (triggeredByKeyboard?: boolean) => Command;
11
11
  export declare const shiftArrowUpFromTable: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => () => Command;
@@ -22,5 +22,6 @@ export type DragAndDropToggleDragMenuAction = DragAndDropAction<typeof DragAndDr
22
22
  isDragMenuOpen: boolean;
23
23
  direction: TableDirection;
24
24
  index: number;
25
+ isKeyboardModeActive: boolean;
25
26
  }>;
26
27
  export type DragAndDropPluginAction = DragAndDropSetDropTargetAction | DragAndDropClearDropTargetAction | DragAndDropToggleDragMenuAction;
@@ -4,9 +4,10 @@ import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
4
4
  import type { DraggableType, TableDirection } from '../../types';
5
5
  import { TableDecorations } from '../../types';
6
6
  import { DropTargetType } from './consts';
7
+ import type { TriggerType } from './types';
7
8
  export declare const getDecorations: (state: EditorState) => DecorationSet;
8
9
  export declare const updatePluginStateDecorations: (state: EditorState, decorations: Decoration[], key: TableDecorations) => DecorationSet;
9
10
  export declare const setDropTarget: (type: DropTargetType, index: number, hasMergedCells: boolean, tr?: Transaction) => import("@atlaskit/editor-common/types").Command;
10
11
  export declare const clearDropTarget: (tr?: Transaction) => import("@atlaskit/editor-common/types").Command;
11
12
  export declare const moveSource: (sourceType: DraggableType, sourceIndexes: number[], targetIndex: number, tr?: Transaction) => import("@atlaskit/editor-common/types").Command;
12
- export declare const toggleDragMenu: (isDragMenuOpen: boolean | undefined, direction?: TableDirection, index?: number) => import("@atlaskit/editor-common/types").Command;
13
+ export declare const toggleDragMenu: (isDragMenuOpen: boolean | undefined, direction?: TableDirection, index?: number, trigger?: TriggerType) => import("@atlaskit/editor-common/types").Command;
@@ -9,4 +9,6 @@ export interface DragAndDropPluginState {
9
9
  dragMenuDirection?: TableDirection;
10
10
  dragMenuIndex: number;
11
11
  isDragging: boolean;
12
+ isKeyboardModeActive: boolean;
12
13
  }
14
+ export type TriggerType = 'mouse' | 'keyboard';
@@ -1,8 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  type HandleIconProps = {
3
3
  forceDefaultHandle: boolean;
4
- isRowHandleHovered: boolean;
5
- isColumnHandleHovered: boolean;
4
+ isHandleHovered: boolean;
6
5
  hasMergedCells: boolean;
7
6
  };
8
7
  export declare const HandleIconComponent: (props: HandleIconProps) => JSX.Element;
@@ -2,8 +2,9 @@ import type { MouseEventHandler } from 'react';
2
2
  import React from 'react';
3
3
  import type { WrappedComponentProps } from 'react-intl-next';
4
4
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
5
+ import type { TriggerType } from '../../pm-plugins/drag-and-drop/types';
5
6
  import type { TableDirection } from '../../types';
6
- type DragHandleAppearance = 'default' | 'selected' | 'disabled' | 'danger';
7
+ export type DragHandleAppearance = 'default' | 'selected' | 'disabled' | 'danger' | 'placeholder';
7
8
  type DragHandleProps = {
8
9
  tableLocalId: string;
9
10
  indexes: number[];
@@ -15,7 +16,7 @@ type DragHandleProps = {
15
16
  onClick?: MouseEventHandler;
16
17
  onMouseOver?: MouseEventHandler;
17
18
  onMouseOut?: MouseEventHandler;
18
- onMouseUp?: MouseEventHandler;
19
+ toggleDragMenu?: (trigger: TriggerType, event?: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
19
20
  editorView: EditorView;
20
21
  isDragMenuTarget: boolean;
21
22
  };
@@ -1,4 +1,6 @@
1
- /// <reference types="react" />
1
+ /** @jsx jsx */
2
+ /** @jsxFrag */
3
+ import React from 'react';
2
4
  import { jsx } from '@emotion/react';
3
5
  import type { WrappedComponentProps } from 'react-intl-next';
4
6
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
@@ -9,20 +11,17 @@ import type { PluginConfig, TableDirection } from '../../types';
9
11
  type DragMenuProps = {
10
12
  direction?: TableDirection;
11
13
  index?: number;
12
- tableRef?: HTMLTableElement;
14
+ target?: Element;
13
15
  tableNode?: PmNode;
14
16
  editorView: EditorView;
15
17
  isOpen?: boolean;
16
18
  targetCellPosition?: number;
17
- mountPoint?: HTMLElement;
18
- boundariesElement?: HTMLElement;
19
- scrollableElement?: HTMLElement;
20
19
  pluginConfig?: PluginConfig;
21
20
  getEditorContainerWidth: GetEditorContainerWidth;
22
21
  editorAnalyticsAPI?: EditorAnalyticsAPI;
23
22
  };
24
- export declare const DragMenu: ({ direction, index, isOpen, editorView, tableNode, mountPoint, boundariesElement, scrollableElement, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, pluginConfig, intl: { formatMessage }, }: DragMenuProps & WrappedComponentProps) => jsx.JSX.Element | null;
25
- declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<DragMenuProps & WrappedComponentProps<"intl">>> & {
26
- WrappedComponent: import("react").ComponentType<DragMenuProps & WrappedComponentProps<"intl">>;
23
+ export declare const DragMenu: React.MemoExoticComponent<({ direction, index, target, isOpen, editorView, tableNode, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, pluginConfig, intl: { formatMessage }, }: DragMenuProps & WrappedComponentProps) => jsx.JSX.Element | null>;
24
+ declare const _default: React.FC<import("react-intl-next").WithIntlProps<DragMenuProps & WrappedComponentProps<"intl">>> & {
25
+ WrappedComponent: React.ComponentType<DragMenuProps & WrappedComponentProps<"intl">>;
27
26
  };
28
27
  export default _default;
@@ -0,0 +1,30 @@
1
+ /// <reference types="react" />
2
+ import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
3
+ type DropdownMenuProps = {
4
+ target?: HTMLElement;
5
+ items: Array<{
6
+ items: MenuItem[];
7
+ }>;
8
+ /**
9
+ * use to toggle top level menu keyboard navigation and action keys
10
+ * e.g. should be false if submenu is rendered as a child to avoid multiple keydown handlers
11
+ */
12
+ disableKeyboardHandling: boolean;
13
+ section: {
14
+ hasSeparator?: boolean;
15
+ title?: string;
16
+ };
17
+ onItemActivated?: (attrs: {
18
+ item: MenuItem;
19
+ shouldCloseMenu?: boolean;
20
+ }) => void;
21
+ handleClose: (focusTarget: 'editor' | 'handle') => void;
22
+ onMouseEnter: (attrs: {
23
+ item: MenuItem;
24
+ }) => void;
25
+ onMouseLeave: (attrs: {
26
+ item: MenuItem;
27
+ }) => void;
28
+ };
29
+ export declare const DropdownMenu: ({ target, items, section, disableKeyboardHandling, onItemActivated, handleClose, onMouseEnter, onMouseLeave, }: DropdownMenuProps) => JSX.Element;
30
+ export {};