@atlaskit/editor-plugin-table 7.16.9 → 7.16.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1833 -1828
- package/dist/cjs/nodeviews/TableResizer.js +15 -9
- package/dist/cjs/ui/common-styles.js +13 -7
- package/dist/cjs/utils/guidelines.js +5 -2
- package/dist/cjs/utils/snapping.js +16 -7
- package/dist/es2019/nodeviews/TableResizer.js +13 -9
- package/dist/es2019/ui/common-styles.js +11 -3
- package/dist/es2019/utils/guidelines.js +5 -2
- package/dist/es2019/utils/snapping.js +16 -7
- package/dist/esm/nodeviews/TableResizer.js +15 -9
- package/dist/esm/ui/common-styles.js +13 -7
- package/dist/esm/utils/guidelines.js +5 -2
- package/dist/esm/utils/snapping.js +16 -7
- package/dist/types/utils/guidelines.d.ts +2 -1
- package/dist/types/utils/snapping.d.ts +6 -2
- package/dist/types-ts4.5/utils/guidelines.d.ts +2 -1
- package/dist/types-ts4.5/utils/snapping.d.ts +6 -2
- package/package.json +4 -3
- package/src/nodeviews/TableComponent.tsx +1 -1
- package/src/nodeviews/TableResizer.tsx +20 -10
- package/src/ui/common-styles.ts +15 -5
- package/src/utils/guidelines.ts +6 -2
- package/src/utils/snapping.ts +32 -19
- package/tsconfig.app.json +107 -107
- package/tsconfig.dev.json +47 -47
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
|
|
2
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
|
|
3
3
|
/* eslint-disable @atlaskit/design-system/no-css-tagged-template-expression */
|
|
4
4
|
|
|
5
5
|
import { css } from '@emotion/react';
|
|
@@ -40,13 +40,19 @@ var viewModeSortStyles = function viewModeSortStyles() {
|
|
|
40
40
|
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n th {\n .", " {\n + p {\n margin-top: 0 !important;\n }\n }\n\n &:has(.is-active) {\n .", " {\n opacity: 1;\n }\n }\n\n .", " {\n opacity: 0;\n &:focus {\n opacity: 1;\n }\n }\n\n &:hover {\n .", " {\n opacity: 1;\n }\n }\n }\n "])), SORTING_ICON_CLASS_NAME, SORTABLE_COLUMN_ICON_CLASSNAME, SORTABLE_COLUMN_ICON_CLASSNAME, SORTABLE_COLUMN_ICON_CLASSNAME);
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
|
+
var numberColumnFix = function numberColumnFix() {
|
|
44
|
+
if (getBooleanFF('platform.editor.table.editor-num-col-style-changes')) {
|
|
45
|
+
return '';
|
|
46
|
+
}
|
|
47
|
+
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n > table[data-number-column='true'] {\n width: calc(100% - 1px);\n }\n "])));
|
|
48
|
+
};
|
|
43
49
|
var tableBorderStyles = function tableBorderStyles() {
|
|
44
50
|
return "border-color: ".concat(tableBorderDeleteColor);
|
|
45
51
|
};
|
|
46
52
|
|
|
47
53
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
48
54
|
var tableStickyHeaderColumnControlsDecorationsStyle = function tableStickyHeaderColumnControlsDecorationsStyle() {
|
|
49
|
-
return css(
|
|
55
|
+
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n .", " .", " {\n z-index: 0;\n left: -1px;\n }\n\n .", "\n .", "::after {\n border-left: 1px solid ", ";\n }\n\n .", "\n tr:first-of-type\n th.", " {\n &.", ", &.", " {\n .", "::after {\n left: 0;\n }\n }\n }\n "])), ClassName.TABLE_STICKY, ClassName.COLUMN_CONTROLS_DECORATIONS, ClassName.TABLE_STICKY, ClassName.COLUMN_CONTROLS_DECORATIONS, tableBorderColor, ClassName.TABLE_STICKY, ClassName.TABLE_HEADER_CELL, ClassName.COLUMN_SELECTED, ClassName.HOVERED_COLUMN, ClassName.COLUMN_CONTROLS_DECORATIONS);
|
|
50
56
|
};
|
|
51
57
|
var tableStickyHeaderFirefoxFixStyle = function tableStickyHeaderFirefoxFixStyle() {
|
|
52
58
|
/*
|
|
@@ -55,21 +61,21 @@ var tableStickyHeaderFirefoxFixStyle = function tableStickyHeaderFirefoxFixStyle
|
|
|
55
61
|
see https://product-fabric.atlassian.net/browse/ED-19177
|
|
56
62
|
*/
|
|
57
63
|
if (browser.gecko) {
|
|
58
|
-
return css(
|
|
64
|
+
return css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n .", " > tbody::before {\n content: '';\n }\n "])), ClassName.TABLE_STICKY);
|
|
59
65
|
}
|
|
60
66
|
};
|
|
61
67
|
|
|
62
68
|
// re-exporting these styles to use in Gemini test when table node view is rendered outside of PM
|
|
63
69
|
export var baseTableStyles = function baseTableStyles(props) {
|
|
64
70
|
var _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$featureFlags4;
|
|
65
|
-
return css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n ", ";\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 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 .", ", tr.sticky .", " {\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 pointer-events: none;\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 cursor: pointer;\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 &:active {\n cursor: grabbing;\n }\n\n &.selected {\n :focus {\n outline: 2px solid ", ";\n outline-offset: 1px;\n }\n\n &:active {\n outline: none;\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: 0px;\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 padding-bottom: 0px;\n /* fixes gap cursor height */\n overflow: auto;\n overflow-y: hidden;\n position: relative;\n\n > table[data-number-column='true'] {\n width: calc(100% - 1px);\n }\n }\n"])), 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, viewModeSortStyles(), 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, akEditorTableToolbarSize + akEditorTableNumberColumnWidth + 1, 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, akEditorTableToolbarSize, (_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, 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, ClassName.TABLE_NODE_WRAPPER);
|
|
71
|
+
return css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n ", ";\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 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 .", ", tr.sticky .", " {\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 pointer-events: none;\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 cursor: pointer;\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 &:active {\n cursor: grabbing;\n }\n\n &.selected {\n :focus {\n outline: 2px solid ", ";\n outline-offset: 1px;\n }\n\n &:active {\n outline: none;\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: 0px;\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 padding-bottom: 0px;\n /* fixes gap cursor height */\n overflow: auto;\n overflow-y: hidden;\n position: relative;\n\n ", "\n }\n"])), 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, viewModeSortStyles(), 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, akEditorTableToolbarSize + akEditorTableNumberColumnWidth + 1, 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, akEditorTableToolbarSize, (_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, 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, ClassName.TABLE_NODE_WRAPPER, numberColumnFix());
|
|
66
72
|
};
|
|
67
73
|
|
|
68
74
|
// TODO: https://product-fabric.atlassian.net/browse/DSP-4139
|
|
69
75
|
export var tableStyles = function tableStyles(props) {
|
|
70
|
-
return css(
|
|
76
|
+
return css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n .ProseMirror {\n ", "\n }\n\n .ProseMirror.", " {\n .", " {\n overflow-x: auto;\n ", ";\n }\n }\n\n .ProseMirror.", " {\n cursor: col-resize;\n }\n\n ", "\n"])), baseTableStyles(props), ClassName.IS_RESIZING, ClassName.TABLE_NODE_WRAPPER, scrollbarStyles, ClassName.RESIZE_CURSOR, shadowSentinelStyles);
|
|
71
77
|
};
|
|
72
78
|
|
|
73
79
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
74
|
-
export var tableFullPageEditorStyles = css(
|
|
75
|
-
export var tableCommentEditorStyles = css(
|
|
80
|
+
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);
|
|
81
|
+
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);
|
|
@@ -6,7 +6,10 @@ import { calculateDefaultSnappings, calculateDefaultTablePreserveSnappings } fro
|
|
|
6
6
|
// If we don't do this then the guidelines will not align correctly to the edge of the table
|
|
7
7
|
export var defaultGuidelines = createFixedGuidelinesFromLengths([0].concat(_toConsumableArray(calculateDefaultSnappings(-1))));
|
|
8
8
|
export var defaultGuidelinesForPreserveTable = function defaultGuidelinesForPreserveTable(editorContainerWidth) {
|
|
9
|
-
var
|
|
10
|
-
|
|
9
|
+
var exclude = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
10
|
+
innerGuidelines: false,
|
|
11
|
+
breakoutPoints: false
|
|
12
|
+
};
|
|
13
|
+
var lengths = calculateDefaultTablePreserveSnappings(-1, editorContainerWidth, exclude);
|
|
11
14
|
return createFixedGuidelinesFromLengths(lengths, undefined, true);
|
|
12
15
|
};
|
|
@@ -12,24 +12,33 @@ export var calculateDefaultSnappings = function calculateDefaultSnappings() {
|
|
|
12
12
|
var lengthOffset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
13
13
|
return [].concat(_toConsumableArray(calculateSubSnappingWidths(numberOfLanesInDefaultLayoutWidth, akEditorDefaultLayoutWidth + lengthOffset)), [akEditorDefaultLayoutWidth + lengthOffset, akEditorCalculatedWideLayoutWidth + lengthOffset, akEditorFullWidthLayoutWidth + lengthOffset]);
|
|
14
14
|
};
|
|
15
|
-
|
|
16
15
|
// FF TablePreserve for calculateDefaultSnappings
|
|
17
16
|
export var calculateDefaultTablePreserveSnappings = function calculateDefaultTablePreserveSnappings() {
|
|
18
17
|
var lengthOffset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
19
18
|
var editorContainerWith = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : akEditorFullWidthLayoutWidth;
|
|
20
|
-
var
|
|
19
|
+
var exclude = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
|
20
|
+
innerGuidelines: false,
|
|
21
|
+
breakoutPoints: false
|
|
22
|
+
};
|
|
21
23
|
var dynamicFullWidthLine = editorContainerWith - akEditorGutterPadding * 2 >= akEditorFullWidthLayoutWidth ? akEditorFullWidthLayoutWidth : editorContainerWith - akEditorGutterPadding * 2 - tableResizerWidth;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
var guides = [dynamicFullWidthLine - lengthOffset];
|
|
25
|
+
if (!exclude.breakoutPoints) {
|
|
26
|
+
guides.unshift(akEditorDefaultLayoutWidth + lengthOffset, akEditorCalculatedWideLayoutWidth + lengthOffset);
|
|
24
27
|
}
|
|
25
|
-
|
|
28
|
+
if (!exclude.innerGuidelines) {
|
|
29
|
+
guides.unshift.apply(guides, [0].concat(_toConsumableArray(calculateSubSnappingWidths(numberOfLanesInDefaultLayoutWidth, akEditorDefaultLayoutWidth + lengthOffset))));
|
|
30
|
+
}
|
|
31
|
+
return guides;
|
|
26
32
|
};
|
|
27
33
|
export var defaultSnappingWidths = calculateDefaultSnappings();
|
|
28
34
|
|
|
29
35
|
// FF TablePreserve for defaultSnappingWidths
|
|
30
36
|
export var defaultTablePreserveSnappingWidths = function defaultTablePreserveSnappingWidths(editorContainerWidth) {
|
|
31
|
-
var
|
|
32
|
-
|
|
37
|
+
var exclude = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
38
|
+
innerGuidelines: false,
|
|
39
|
+
breakoutPoints: false
|
|
40
|
+
};
|
|
41
|
+
return editorContainerWidth - akEditorGutterPadding * 2 > akEditorFullWidthLayoutWidth ? calculateDefaultSnappings() : calculateDefaultTablePreserveSnappings(0, editorContainerWidth, exclude);
|
|
33
42
|
};
|
|
34
43
|
|
|
35
44
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { GuidelineConfig } from '@atlaskit/editor-common/guideline';
|
|
2
|
+
import type { GuidelineExcludeConfig } from './snapping';
|
|
2
3
|
export declare const defaultGuidelines: GuidelineConfig[];
|
|
3
|
-
export declare const defaultGuidelinesForPreserveTable: (editorContainerWidth: number,
|
|
4
|
+
export declare const defaultGuidelinesForPreserveTable: (editorContainerWidth: number, exclude?: GuidelineExcludeConfig) => GuidelineConfig[];
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import type { GuidelineConfig } from '@atlaskit/editor-common/guideline';
|
|
2
2
|
export declare const calculateDefaultSnappings: (lengthOffset?: number) => number[];
|
|
3
|
-
export
|
|
3
|
+
export type GuidelineExcludeConfig = {
|
|
4
|
+
innerGuidelines: boolean;
|
|
5
|
+
breakoutPoints: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare const calculateDefaultTablePreserveSnappings: (lengthOffset?: number, editorContainerWith?: number, exclude?: GuidelineExcludeConfig) => number[];
|
|
4
8
|
export declare const defaultSnappingWidths: number[];
|
|
5
|
-
export declare const defaultTablePreserveSnappingWidths: (editorContainerWidth: number,
|
|
9
|
+
export declare const defaultTablePreserveSnappingWidths: (editorContainerWidth: number, exclude?: GuidelineExcludeConfig) => number[];
|
|
6
10
|
/**
|
|
7
11
|
* Returns keys of guidelines that are closest to the table and withthin the snapGap
|
|
8
12
|
*/
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { GuidelineConfig } from '@atlaskit/editor-common/guideline';
|
|
2
|
+
import type { GuidelineExcludeConfig } from './snapping';
|
|
2
3
|
export declare const defaultGuidelines: GuidelineConfig[];
|
|
3
|
-
export declare const defaultGuidelinesForPreserveTable: (editorContainerWidth: number,
|
|
4
|
+
export declare const defaultGuidelinesForPreserveTable: (editorContainerWidth: number, exclude?: GuidelineExcludeConfig) => GuidelineConfig[];
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import type { GuidelineConfig } from '@atlaskit/editor-common/guideline';
|
|
2
2
|
export declare const calculateDefaultSnappings: (lengthOffset?: number) => number[];
|
|
3
|
-
export
|
|
3
|
+
export type GuidelineExcludeConfig = {
|
|
4
|
+
innerGuidelines: boolean;
|
|
5
|
+
breakoutPoints: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare const calculateDefaultTablePreserveSnappings: (lengthOffset?: number, editorContainerWith?: number, exclude?: GuidelineExcludeConfig) => number[];
|
|
4
8
|
export declare const defaultSnappingWidths: number[];
|
|
5
|
-
export declare const defaultTablePreserveSnappingWidths: (editorContainerWidth: number,
|
|
9
|
+
export declare const defaultTablePreserveSnappingWidths: (editorContainerWidth: number, exclude?: GuidelineExcludeConfig) => number[];
|
|
6
10
|
/**
|
|
7
11
|
* Returns keys of guidelines that are closest to the table and withthin the snapGap
|
|
8
12
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "7.16.
|
|
3
|
+
"version": "7.16.11",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -67,7 +67,6 @@
|
|
|
67
67
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
|
-
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
71
70
|
"typescript": "~5.4.2"
|
|
72
71
|
},
|
|
73
72
|
"af:exports": {
|
|
@@ -78,7 +77,6 @@
|
|
|
78
77
|
"./plugin-key": "./src/pm-plugins/plugin-key.ts",
|
|
79
78
|
"./commands": "./src/commands/index.ts"
|
|
80
79
|
},
|
|
81
|
-
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1",
|
|
82
80
|
"techstack": {
|
|
83
81
|
"@atlassian/frontend": {
|
|
84
82
|
"import-structure": [
|
|
@@ -139,6 +137,9 @@
|
|
|
139
137
|
},
|
|
140
138
|
"platform.editor.table.live-pages-sorting_4malx": {
|
|
141
139
|
"type": "boolean"
|
|
140
|
+
},
|
|
141
|
+
"platform.editor.table.editor-num-col-style-changes": {
|
|
142
|
+
"type": "boolean"
|
|
142
143
|
}
|
|
143
144
|
}
|
|
144
145
|
}
|
|
@@ -688,7 +688,7 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
688
688
|
isDragAndDropEnabled,
|
|
689
689
|
getEditorFeatureFlags,
|
|
690
690
|
isTableScalingEnabled, // here we can use options.isTableScalingEnabled
|
|
691
|
-
isTableAlignmentEnabled
|
|
691
|
+
isTableAlignmentEnabled,
|
|
692
692
|
} = this.props;
|
|
693
693
|
|
|
694
694
|
let {
|
|
@@ -209,6 +209,16 @@ export const TableResizer = ({
|
|
|
209
209
|
|
|
210
210
|
const { startMeasure, endMeasure, countFrames } = useMeasureFramerate();
|
|
211
211
|
|
|
212
|
+
const excludeGuidelineConfig = useMemo(
|
|
213
|
+
() => ({
|
|
214
|
+
innerGuidelines: !!isTableAlignmentEnabled,
|
|
215
|
+
breakoutPoints: !!(
|
|
216
|
+
isTableAlignmentEnabled && tableState?.isFullWidthModeEnabled
|
|
217
|
+
),
|
|
218
|
+
}),
|
|
219
|
+
[tableState, isTableAlignmentEnabled],
|
|
220
|
+
);
|
|
221
|
+
|
|
212
222
|
const updateActiveGuidelines = useCallback(
|
|
213
223
|
({ gap, keys }: { gap: number; keys: string[] }) => {
|
|
214
224
|
if (gap !== currentGap.current) {
|
|
@@ -217,7 +227,7 @@ export const TableResizer = ({
|
|
|
217
227
|
isTableScalingEnabled
|
|
218
228
|
? defaultGuidelinesForPreserveTable(
|
|
219
229
|
containerWidth,
|
|
220
|
-
|
|
230
|
+
excludeGuidelineConfig,
|
|
221
231
|
)
|
|
222
232
|
: defaultGuidelines,
|
|
223
233
|
containerWidth,
|
|
@@ -235,7 +245,7 @@ export const TableResizer = ({
|
|
|
235
245
|
},
|
|
236
246
|
[
|
|
237
247
|
isTableScalingEnabled,
|
|
238
|
-
|
|
248
|
+
excludeGuidelineConfig,
|
|
239
249
|
containerWidth,
|
|
240
250
|
displayGuideline,
|
|
241
251
|
],
|
|
@@ -248,7 +258,7 @@ export const TableResizer = ({
|
|
|
248
258
|
x: isTableScalingEnabled
|
|
249
259
|
? defaultTablePreserveSnappingWidths(
|
|
250
260
|
containerWidth,
|
|
251
|
-
|
|
261
|
+
excludeGuidelineConfig,
|
|
252
262
|
)
|
|
253
263
|
: defaultSnappingWidths,
|
|
254
264
|
}
|
|
@@ -256,7 +266,7 @@ export const TableResizer = ({
|
|
|
256
266
|
[
|
|
257
267
|
snappingEnabled,
|
|
258
268
|
isTableScalingEnabled,
|
|
259
|
-
|
|
269
|
+
excludeGuidelineConfig,
|
|
260
270
|
containerWidth,
|
|
261
271
|
],
|
|
262
272
|
);
|
|
@@ -334,7 +344,7 @@ export const TableResizer = ({
|
|
|
334
344
|
isTableScalingEnabled
|
|
335
345
|
? defaultGuidelinesForPreserveTable(
|
|
336
346
|
containerWidth,
|
|
337
|
-
|
|
347
|
+
excludeGuidelineConfig,
|
|
338
348
|
)
|
|
339
349
|
: defaultGuidelines,
|
|
340
350
|
containerWidth,
|
|
@@ -351,7 +361,7 @@ export const TableResizer = ({
|
|
|
351
361
|
node.attrs.localId,
|
|
352
362
|
tableRef,
|
|
353
363
|
isTableScalingEnabled,
|
|
354
|
-
|
|
364
|
+
excludeGuidelineConfig,
|
|
355
365
|
containerWidth,
|
|
356
366
|
displayGuideline,
|
|
357
367
|
onResizeStart,
|
|
@@ -388,13 +398,13 @@ export const TableResizer = ({
|
|
|
388
398
|
isTableScalingEnabled
|
|
389
399
|
? defaultTablePreserveSnappingWidths(
|
|
390
400
|
containerWidth,
|
|
391
|
-
|
|
401
|
+
excludeGuidelineConfig,
|
|
392
402
|
)
|
|
393
403
|
: defaultSnappingWidths,
|
|
394
404
|
isTableScalingEnabled
|
|
395
405
|
? defaultGuidelinesForPreserveTable(
|
|
396
406
|
containerWidth,
|
|
397
|
-
|
|
407
|
+
excludeGuidelineConfig,
|
|
398
408
|
)
|
|
399
409
|
: defaultGuidelines,
|
|
400
410
|
TABLE_HIGHLIGHT_GAP,
|
|
@@ -409,7 +419,7 @@ export const TableResizer = ({
|
|
|
409
419
|
|
|
410
420
|
const fullWidthGuideline = defaultGuidelinesForPreserveTable(
|
|
411
421
|
containerWidth,
|
|
412
|
-
|
|
422
|
+
excludeGuidelineConfig,
|
|
413
423
|
).filter((guideline) => guideline.isFullWidth)[0];
|
|
414
424
|
|
|
415
425
|
const isFullWidthGuidelineActive = closestSnap.keys.includes(
|
|
@@ -434,7 +444,7 @@ export const TableResizer = ({
|
|
|
434
444
|
[
|
|
435
445
|
countFrames,
|
|
436
446
|
isTableScalingEnabled,
|
|
437
|
-
|
|
447
|
+
excludeGuidelineConfig,
|
|
438
448
|
tableRef,
|
|
439
449
|
node,
|
|
440
450
|
editorView,
|
package/src/ui/common-styles.ts
CHANGED
|
@@ -105,8 +105,8 @@ const rangeSelectionStyles = `
|
|
|
105
105
|
|
|
106
106
|
const sentinelStyles = `.${ClassName.TABLE_CONTAINER} {
|
|
107
107
|
> .${ClassName.TABLE_STICKY_SENTINEL_TOP}, > .${
|
|
108
|
-
|
|
109
|
-
} {
|
|
108
|
+
ClassName.TABLE_STICKY_SENTINEL_BOTTOM
|
|
109
|
+
} {
|
|
110
110
|
position: absolute;
|
|
111
111
|
width: 100%;
|
|
112
112
|
height: 1px;
|
|
@@ -238,6 +238,18 @@ const viewModeSortStyles = () => {
|
|
|
238
238
|
}
|
|
239
239
|
};
|
|
240
240
|
|
|
241
|
+
const numberColumnFix = () => {
|
|
242
|
+
if (getBooleanFF('platform.editor.table.editor-num-col-style-changes')) {
|
|
243
|
+
return '';
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
return css`
|
|
247
|
+
> table[data-number-column='true'] {
|
|
248
|
+
width: calc(100% - 1px);
|
|
249
|
+
}
|
|
250
|
+
`;
|
|
251
|
+
};
|
|
252
|
+
|
|
241
253
|
const tableBorderStyles = () => {
|
|
242
254
|
return `border-color: ${tableBorderDeleteColor}`;
|
|
243
255
|
};
|
|
@@ -1077,9 +1089,7 @@ export const baseTableStyles = (props: { featureFlags?: FeatureFlags }) => css`
|
|
|
1077
1089
|
overflow-y: hidden;
|
|
1078
1090
|
position: relative;
|
|
1079
1091
|
|
|
1080
|
-
|
|
1081
|
-
width: calc(100% - 1px);
|
|
1082
|
-
}
|
|
1092
|
+
${numberColumnFix()}
|
|
1083
1093
|
}
|
|
1084
1094
|
`;
|
|
1085
1095
|
|
package/src/utils/guidelines.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createFixedGuidelinesFromLengths } from '@atlaskit/editor-common/guideline';
|
|
2
2
|
import type { GuidelineConfig } from '@atlaskit/editor-common/guideline';
|
|
3
3
|
|
|
4
|
+
import type { GuidelineExcludeConfig } from './snapping';
|
|
4
5
|
import {
|
|
5
6
|
calculateDefaultSnappings,
|
|
6
7
|
calculateDefaultTablePreserveSnappings,
|
|
@@ -15,12 +16,15 @@ export const defaultGuidelines = createFixedGuidelinesFromLengths([
|
|
|
15
16
|
|
|
16
17
|
export const defaultGuidelinesForPreserveTable = (
|
|
17
18
|
editorContainerWidth: number,
|
|
18
|
-
|
|
19
|
+
exclude: GuidelineExcludeConfig = {
|
|
20
|
+
innerGuidelines: false,
|
|
21
|
+
breakoutPoints: false,
|
|
22
|
+
},
|
|
19
23
|
) => {
|
|
20
24
|
const lengths = calculateDefaultTablePreserveSnappings(
|
|
21
25
|
-1,
|
|
22
26
|
editorContainerWidth,
|
|
23
|
-
|
|
27
|
+
exclude,
|
|
24
28
|
);
|
|
25
29
|
|
|
26
30
|
return createFixedGuidelinesFromLengths(
|
package/src/utils/snapping.ts
CHANGED
|
@@ -26,11 +26,19 @@ export const calculateDefaultSnappings = (lengthOffset: number = 0) => [
|
|
|
26
26
|
akEditorFullWidthLayoutWidth + lengthOffset,
|
|
27
27
|
];
|
|
28
28
|
|
|
29
|
+
export type GuidelineExcludeConfig = {
|
|
30
|
+
innerGuidelines: boolean;
|
|
31
|
+
breakoutPoints: boolean;
|
|
32
|
+
};
|
|
33
|
+
|
|
29
34
|
// FF TablePreserve for calculateDefaultSnappings
|
|
30
35
|
export const calculateDefaultTablePreserveSnappings = (
|
|
31
|
-
lengthOffset
|
|
32
|
-
editorContainerWith
|
|
33
|
-
|
|
36
|
+
lengthOffset = 0,
|
|
37
|
+
editorContainerWith = akEditorFullWidthLayoutWidth,
|
|
38
|
+
exclude: GuidelineExcludeConfig = {
|
|
39
|
+
innerGuidelines: false,
|
|
40
|
+
breakoutPoints: false,
|
|
41
|
+
},
|
|
34
42
|
) => {
|
|
35
43
|
const dynamicFullWidthLine =
|
|
36
44
|
editorContainerWith - akEditorGutterPadding * 2 >=
|
|
@@ -38,24 +46,26 @@ export const calculateDefaultTablePreserveSnappings = (
|
|
|
38
46
|
? akEditorFullWidthLayoutWidth
|
|
39
47
|
: editorContainerWith - akEditorGutterPadding * 2 - tableResizerWidth;
|
|
40
48
|
|
|
41
|
-
|
|
42
|
-
|
|
49
|
+
const guides = [dynamicFullWidthLine - lengthOffset];
|
|
50
|
+
|
|
51
|
+
if (!exclude.breakoutPoints) {
|
|
52
|
+
guides.unshift(
|
|
43
53
|
akEditorDefaultLayoutWidth + lengthOffset,
|
|
44
54
|
akEditorCalculatedWideLayoutWidth + lengthOffset,
|
|
45
|
-
|
|
46
|
-
];
|
|
55
|
+
);
|
|
47
56
|
}
|
|
48
57
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
if (!exclude.innerGuidelines) {
|
|
59
|
+
guides.unshift(
|
|
60
|
+
0,
|
|
61
|
+
...calculateSubSnappingWidths(
|
|
62
|
+
numberOfLanesInDefaultLayoutWidth,
|
|
63
|
+
akEditorDefaultLayoutWidth + lengthOffset,
|
|
64
|
+
),
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return guides;
|
|
59
69
|
};
|
|
60
70
|
|
|
61
71
|
export const defaultSnappingWidths = calculateDefaultSnappings();
|
|
@@ -63,7 +73,10 @@ export const defaultSnappingWidths = calculateDefaultSnappings();
|
|
|
63
73
|
// FF TablePreserve for defaultSnappingWidths
|
|
64
74
|
export const defaultTablePreserveSnappingWidths = (
|
|
65
75
|
editorContainerWidth: number,
|
|
66
|
-
|
|
76
|
+
exclude: GuidelineExcludeConfig = {
|
|
77
|
+
innerGuidelines: false,
|
|
78
|
+
breakoutPoints: false,
|
|
79
|
+
},
|
|
67
80
|
) => {
|
|
68
81
|
return editorContainerWidth - akEditorGutterPadding * 2 >
|
|
69
82
|
akEditorFullWidthLayoutWidth
|
|
@@ -71,7 +84,7 @@ export const defaultTablePreserveSnappingWidths = (
|
|
|
71
84
|
: calculateDefaultTablePreserveSnappings(
|
|
72
85
|
0,
|
|
73
86
|
editorContainerWidth,
|
|
74
|
-
|
|
87
|
+
exclude,
|
|
75
88
|
);
|
|
76
89
|
};
|
|
77
90
|
|