@atlaskit/editor-plugin-table 2.9.1 → 2.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/cjs/plugins/table/event-handlers.js +52 -56
- package/dist/cjs/plugins/table/nodeviews/TableComponent.js +19 -69
- package/dist/cjs/plugins/table/nodeviews/table.js +23 -30
- package/dist/cjs/plugins/table/nodeviews/tableCell.js +3 -6
- package/dist/cjs/plugins/table/nodeviews/update-overflow-shadows.js +2 -40
- package/dist/cjs/plugins/table/pm-plugins/main.js +3 -3
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +2 -73
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/plugin.js +1 -1
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/event-handlers.js +1 -1
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/dom.js +1 -5
- package/dist/cjs/plugins/table/ui/TableFloatingControls/index.js +3 -7
- package/dist/cjs/plugins/table/ui/common-styles.js +2 -2
- package/dist/cjs/plugins/table/utils/dom.js +5 -12
- package/dist/es2019/plugins/table/event-handlers.js +3 -6
- package/dist/es2019/plugins/table/nodeviews/TableComponent.js +18 -69
- package/dist/es2019/plugins/table/nodeviews/table.js +24 -32
- package/dist/es2019/plugins/table/nodeviews/tableCell.js +3 -7
- package/dist/es2019/plugins/table/nodeviews/update-overflow-shadows.js +0 -35
- package/dist/es2019/plugins/table/pm-plugins/main.js +3 -4
- package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +2 -77
- package/dist/es2019/plugins/table/pm-plugins/sticky-headers/plugin.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/event-handlers.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/dom.js +1 -5
- package/dist/es2019/plugins/table/ui/TableFloatingControls/index.js +3 -9
- package/dist/es2019/plugins/table/ui/common-styles.js +3 -3
- package/dist/es2019/plugins/table/utils/dom.js +5 -12
- package/dist/esm/plugins/table/event-handlers.js +52 -56
- package/dist/esm/plugins/table/nodeviews/TableComponent.js +19 -69
- package/dist/esm/plugins/table/nodeviews/table.js +23 -30
- package/dist/esm/plugins/table/nodeviews/tableCell.js +3 -6
- package/dist/esm/plugins/table/nodeviews/update-overflow-shadows.js +0 -37
- package/dist/esm/plugins/table/pm-plugins/main.js +3 -3
- package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +2 -73
- package/dist/esm/plugins/table/pm-plugins/sticky-headers/plugin.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/table-resizing/event-handlers.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/dom.js +1 -5
- package/dist/esm/plugins/table/ui/TableFloatingControls/index.js +3 -7
- package/dist/esm/plugins/table/ui/common-styles.js +2 -2
- package/dist/esm/plugins/table/utils/dom.js +5 -12
- package/dist/types/plugins/table/event-handlers.d.ts +1 -2
- package/dist/types/plugins/table/nodeviews/TableComponent.d.ts +0 -2
- package/dist/types/plugins/table/nodeviews/table.d.ts +0 -1
- package/dist/types/plugins/table/nodeviews/tableCell.d.ts +2 -3
- package/dist/types/plugins/table/nodeviews/types.d.ts +0 -1
- package/dist/types/plugins/table/nodeviews/update-overflow-shadows.d.ts +0 -6
- package/dist/types/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +1 -6
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/dom.d.ts +1 -2
- package/dist/types/plugins/table/types.d.ts +2 -2
- package/dist/types/plugins/table/ui/TableFloatingControls/index.d.ts +0 -1
- package/dist/types/plugins/table/utils/dom.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/event-handlers.d.ts +1 -2
- package/dist/types-ts4.5/plugins/table/nodeviews/TableComponent.d.ts +0 -2
- package/dist/types-ts4.5/plugins/table/nodeviews/table.d.ts +0 -1
- package/dist/types-ts4.5/plugins/table/nodeviews/tableCell.d.ts +2 -3
- package/dist/types-ts4.5/plugins/table/nodeviews/types.d.ts +0 -1
- package/dist/types-ts4.5/plugins/table/nodeviews/update-overflow-shadows.d.ts +0 -6
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +1 -6
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/dom.d.ts +1 -2
- package/dist/types-ts4.5/plugins/table/types.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/table/utils/dom.d.ts +1 -1
- package/package.json +2 -2
- package/report.api.md +2 -0
- package/src/__tests__/integration/horizontal-scroll-shadows.ts +6 -9
- package/src/__tests__/integration/resize.ts +6 -16
- package/src/__tests__/unit/event-handlers.ts +1 -4
- package/src/__tests__/unit/nodeviews/TableComponent.tsx +48 -92
- package/src/__tests__/unit/nodeviews/cell.ts +1 -3
- package/src/__tests__/unit/nodeviews/table.ts +71 -83
- package/src/__tests__/unit/pm-plugins/sticky-headers/tableRow.tsx +5 -9
- package/src/__tests__/unit/ui/RowControls.tsx +1 -0
- package/src/__tests__/unit/utils/dom.ts +6 -112
- package/src/plugins/table/event-handlers.ts +72 -79
- package/src/plugins/table/nodeviews/TableComponent.tsx +37 -114
- package/src/plugins/table/nodeviews/table.tsx +22 -30
- package/src/plugins/table/nodeviews/tableCell.tsx +3 -11
- package/src/plugins/table/nodeviews/types.ts +0 -1
- package/src/plugins/table/nodeviews/update-overflow-shadows.ts +0 -54
- package/src/plugins/table/pm-plugins/main.ts +4 -22
- package/src/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.ts +1 -83
- package/src/plugins/table/pm-plugins/sticky-headers/plugin.ts +1 -7
- package/src/plugins/table/pm-plugins/table-resizing/event-handlers.ts +1 -1
- package/src/plugins/table/pm-plugins/table-resizing/utils/dom.ts +30 -48
- package/src/plugins/table/types.ts +3 -2
- package/src/plugins/table/ui/TableFloatingControls/index.tsx +3 -15
- package/src/plugins/table/ui/common-styles.ts +1 -1
- package/src/plugins/table/utils/dom.ts +3 -11
- package/tmp/api-report-tmp.d.ts +2 -0
|
@@ -37,8 +37,8 @@ var tableWrapperStyles = function tableWrapperStyles() {
|
|
|
37
37
|
|
|
38
38
|
// TODO: https://product-fabric.atlassian.net/browse/DSP-4139
|
|
39
39
|
export var tableStyles = function tableStyles(props) {
|
|
40
|
-
var _props$featureFlags
|
|
41
|
-
return css(_templateObject4 || (_templateObject4 = _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 margin-bottom: 0;\n }\n\n .", " {\n td.", ", th.", " {\n position: relative;\n overflow: visible;\n }\n\n td.", " {\n background-color: ", ";\n\n // ED-15246: Trello card is visible through a border of a table border\n // This fixes a border issue caused by relative positioned table cells\n &::after {\n height: 100%;\n content: '';\n border-left: 1px solid ", ";\n border-bottom: 1px solid ", ";\n position: absolute;\n right: 0px;\n top: 0px;\n bottom: 0;\n width: 100%;\n display: inline-block;\n pointer-events: none;\n }\n }\n }\n\n .", " {\n ", "\n }\n\n .", " {\n ", "\n }\n\n /* Delete button */\n ", "\n /* Ends Delete button */\n\n /* sticky styles */\n .", " .", " .", ":first-of-type {\n margin-top: ", "px;\n width: ", "px;\n\n position: fixed !important;\n z-index: ", " !important;\n box-shadow: 0px -", "px ", ";\n border-right: 0 none;\n /* top set by NumberColumn component */\n }\n\n .", " .", ".sticky {\n position: fixed !important;\n /* needs to be above row controls */\n z-index: ", " !important;\n background: ", ";\n\n width: ", "px;\n height: ", "px;\n }\n\n .", ".sticky .", " {\n border-bottom: 0px none;\n border-right: 0px none;\n\n height: ", "px;\n width: ", "px;\n }\n\n .", " .", " {\n z-index: 0;\n }\n\n .", "\n .", "\n .", ".sticky {\n position: fixed !important;\n z-index: ", " !important;\n display: flex;\n border-left: ", "px solid\n ", ";\n margin-left: -", "px;\n }\n\n .", " col:first-of-type {\n /* moving rows out of a table layout does weird things in Chrome */\n border-right: 1px solid ", ";\n }\n\n tr.sticky {\n padding-top: ", "px;\n position: fixed;\n display: grid;\n\n /* to keep it above cell selection 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 height: 0; // stop overflow flash & set correct height in update-overflow-shadows.ts\n }\n\n .less-padding {\n padding: 0 ", "px;\n\n .", " {\n padding: 0 ", "px;\n\n // https://product-fabric.atlassian.net/browse/ED-16386\n // Fixes issue where the extra padding that is added here throws off the position\n // of the rows control dot\n &::after {\n right: 6px !important;\n }\n }\n\n &.", "[data-number-column='true'] {\n padding-left: ", "px;\n }\n\n .", " {\n left: 6px;\n }\n\n .", " {\n left: calc(100% - 6px);\n }\n }\n\n > .", " {\n /**\n * Prevent margins collapsing, aids with placing the gap-cursor correctly\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Box_Model/Mastering_margin_collapsing\n *\n * TODO: Enable this, many tests will fail!\n * border-top: 1px solid transparent;\n */\n }\n\n /* Breakout only works on top level unless wrapped in fragment mark */\n ", "\n\n ", ";\n\n /* Corner controls */\n .", " {\n width: ", "px;\n height: ", "px;\n display: none;\n\n .", " {\n position: relative;\n\n ", ";\n }\n }\n\n .", ".sticky {\n .", " {\n /* sticky row insert dot overlaps other row insert and messes things up */\n display: none !important;\n }\n }\n\n .", " {\n position: absolute;\n top: 0;\n width: ", "px;\n height: ", "px;\n border: 1px solid ", ";\n border-radius: 0;\n border-top-left-radius: ", "px;\n background: ", ";\n box-sizing: border-box;\n padding: 0;\n :focus {\n outline: none;\n }\n }\n .active .", " {\n border-color: ", ";\n background: ", ";\n }\n\n .", "[data-number-column='true'] {\n .", ", .", " {\n width: ", "px;\n }\n .", " .", " {\n border-right-width: 0;\n }\n }\n\n :not(.", ") .", ":hover {\n border-color: ", ";\n background: ", ";\n cursor: pointer;\n }\n\n :not(.", ")\n .", ".", " {\n border-color: ", ";\n background: ", ";\n }\n\n /* Row controls */\n .", " {\n width: ", "px;\n box-sizing: border-box;\n display: none;\n position: relative;\n\n ", ";\n\n .", " {\n display: flex;\n flex-direction: column;\n }\n .", ":last-child > button {\n border-bottom-left-radius: ", "px;\n }\n .", " {\n position: relative;\n margin-top: -1px;\n }\n .", ":hover,\n .", ".active,\n .", ":hover {\n z-index: ", ";\n }\n\n ", "\n }\n\n :not(.", ") .", " {\n ", "\n ", "\n }\n\n /* Numbered column */\n .", " {\n position: relative;\n float: right;\n margin-left: ", "px;\n top: ", "px;\n width: ", "px;\n box-sizing: border-box;\n }\n\n .", " {\n border: 1px solid ", ";\n box-sizing: border-box;\n margin-top: -1px;\n padding-bottom: 2px;\n padding: 10px 2px;\n text-align: center;\n font-size: ", ";\n background-color: ", ";\n color: ", ";\n border-color: ", ";\n\n :first-child:not(style),\n style:first-child + * {\n margin-top: 0;\n }\n :last-child {\n border-bottom: 1px solid ", ";\n }\n }\n\n .", " {\n .", ", .", " {\n display: block;\n }\n .", " {\n padding-left: 1px;\n .", " {\n border-left: 0 none;\n }\n\n .", ".active {\n border-bottom: 1px solid ", ";\n border-color: ", ";\n background-color: ", ";\n position: relative;\n z-index: ", ";\n color: ", ";\n }\n }\n }\n :not(.", ") .", " {\n .", " {\n cursor: pointer;\n }\n .", ":hover {\n border-bottom: 1px solid ", ";\n border-color: ", ";\n background-color: ", ";\n position: relative;\n z-index: ", ";\n color: ", ";\n }\n .", ".", " {\n background-color: ", ";\n border: 1px solid ", ";\n border-left: 0;\n color: ", ";\n position: relative;\n z-index: ", ";\n }\n }\n\n /* Table */\n .", " > table {\n table-layout: fixed;\n white-space: normal;\n border-top: none;\n // 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 border: 1px solid ", ";\n z-index: ", ";\n }\n }\n }\n .", " {\n position: absolute;\n /* top of corner control is table margin top - corner control height + 1 pixel of table border. */\n top: ", "px;\n }\n .", ".", " {\n z-index: ", ";\n }\n .", " {\n left: -", "px;\n }\n ", "\n }\n\n .ProseMirror.", " {\n .", " {\n overflow-x: auto;\n ", ";\n }\n }\n\n .ProseMirror.", " {\n cursor: col-resize;\n }\n\n /*\n ED-15882: When custom start numbers is enabled for lists, we have\n styles that handle this generally (in editor-common) so we can\n throw away the older table-specific styles here.\n */\n ", "\n\n ", "\n"])), 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(props), columnControlsLineMarker(), hoveredDeleteButton(props), hoveredCell(props), hoveredWarningCell, resizeHandle(props), rangeSelectionStyles, ClassName.LAST_ITEM_IN_CELL, ClassName.TABLE_NODE_WRAPPER, ClassName.TABLE_CELL, ClassName.TABLE_HEADER_CELL, ClassName.TABLE_CELL, tableCellBackgroundColor(props), tableBorderColor(props), tableBorderColor(props), ClassName.CONTROLS_FLOATING_BUTTON_COLUMN, insertColumnButtonWrapper(props), ClassName.CONTROLS_FLOATING_BUTTON_ROW, insertRowButtonWrapper(props), DeleteButton(props), 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, ClassName.TABLE_STICKY, ClassName.COLUMN_CONTROLS_DECORATIONS, 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(props), 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)", (_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.stickyHeadersOptimization ? sentinelStyles : '', OverflowShadow(props), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, tablePadding, ClassName.ROW_CONTROLS_WRAPPER, tablePadding, ClassName.TABLE_CONTAINER, akEditorTableNumberColumnWidth + tablePadding - 1, ClassName.TABLE_LEFT_SHADOW, ClassName.TABLE_RIGHT_SHADOW, ClassName.NODEVIEW_WRAPPER, breakoutWidthStyling(), columnControlsDecoration(props), ClassName.CORNER_CONTROLS, tableToolbarSize + 1, cornerControlHeight, ClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, InsertMarker(props, "\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(props), tableBorderRadiusSize, tableHeaderCellBackgroundColor(props), ClassName.CONTROLS_CORNER_BUTTON, tableBorderSelectedColor(props), tableToolbarSelectedColor(props), ClassName.TABLE_CONTAINER, ClassName.CORNER_CONTROLS, ClassName.CONTROLS_CORNER_BUTTON, akEditorTableToolbarSize + akEditorTableNumberColumnWidth, ClassName.ROW_CONTROLS, ClassName.CONTROLS_BUTTON, ClassName.IS_RESIZING, ClassName.CONTROLS_CORNER_BUTTON, tableBorderSelectedColor(props), tableToolbarSelectedColor(props), ClassName.IS_RESIZING, ClassName.CONTROLS_CORNER_BUTTON, ClassName.HOVERED_CELL_IN_DANGER, tableBorderDeleteColor(props), tableToolbarDeleteColor(props), ClassName.ROW_CONTROLS, tableToolbarSize, InsertMarker(props, "\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(props, "\n border-bottom: 1px solid ".concat(tableBorderColor(props), ";\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.IS_RESIZING, ClassName.ROW_CONTROLS, HeaderButtonHover(props), HeaderButtonDanger(props), ClassName.NUMBERED_COLUMN, akEditorTableToolbarSize - 1, akEditorTableToolbarSize, akEditorTableNumberColumnWidth + 1, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderColor(props), relativeFontSizeToBase16(fontSize()), tableHeaderCellBackgroundColor(props), tableTextColor(props), tableBorderColor(props), tableBorderColor(props), ClassName.WITH_CONTROLS, ClassName.CORNER_CONTROLS, ClassName.ROW_CONTROLS, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderSelectedColor(props), tableBorderSelectedColor(props), tableToolbarSelectedColor(props), akEditorUnitZIndex, "var(--ds-text-selected, ".concat(N0, ")"), ClassName.IS_RESIZING, ClassName.WITH_CONTROLS, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderSelectedColor(props), tableBorderSelectedColor(props), tableToolbarSelectedColor(props), akEditorUnitZIndex, "var(--ds-text-selected, ".concat(N0, ")"), ClassName.NUMBERED_COLUMN_BUTTON, ClassName.HOVERED_CELL_IN_DANGER, tableToolbarDeleteColor(props), tableBorderDeleteColor(props), "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(props), ClassName.SELECTED_CELL, tableCellSelectedColor(props), akEditorSmallZIndex, ClassName.HOVERED_CELL_IN_DANGER, ClassName.HOVERED_CELL_IN_DANGER, tableCellDeleteColor(props), akEditorUnitZIndex * 100, ClassName.HOVERED_CELL, ClassName.SELECTED_CELL, ClassName.TABLE_HEADER_CELL, ClassName.SELECTED_CELL, ClassName.TABLE_HEADER_CELL, ClassName.HOVERED_CELL, tableBorderSelectedColor(props), akEditorSmallZIndex, ClassName.HOVERED_CELL_IN_DANGER, tableBorderDeleteColor(props), akEditorUnitZIndex * 100, ClassName.ROW_CONTROLS_WRAPPER, tableMarginTop - cornerControlHeight + 1, ClassName.ROW_CONTROLS_WRAPPER, ClassName.TABLE_LEFT_SHADOW, akEditorUnitZIndex, ClassName.ROW_CONTROLS_WRAPPER, tableToolbarSize, tableWrapperStyles(), ClassName.IS_RESIZING, ClassName.TABLE_NODE_WRAPPER, scrollbarStyles, ClassName.RESIZE_CURSOR, props !== null && props !== void 0 && (_props$featureFlags2 = props.featureFlags) !== null && _props$featureFlags2 !== void 0 && _props$featureFlags2.restartNumberedLists ? "" : listLargeNumericMarkersOldStyles, shadowSentinelStyles);
|
|
40
|
+
var _props$featureFlags;
|
|
41
|
+
return css(_templateObject4 || (_templateObject4 = _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 margin-bottom: 0;\n }\n\n .", " {\n td.", ", th.", " {\n position: relative;\n overflow: visible;\n }\n\n td.", " {\n background-color: ", ";\n\n // ED-15246: Trello card is visible through a border of a table border\n // This fixes a border issue caused by relative positioned table cells\n &::after {\n height: 100%;\n content: '';\n border-left: 1px solid ", ";\n border-bottom: 1px solid ", ";\n position: absolute;\n right: 0px;\n top: 0px;\n bottom: 0;\n width: 100%;\n display: inline-block;\n pointer-events: none;\n }\n }\n }\n\n .", " {\n ", "\n }\n\n .", " {\n ", "\n }\n\n /* Delete button */\n ", "\n /* Ends Delete button */\n\n /* sticky styles */\n .", " .", " .", ":first-of-type {\n margin-top: ", "px;\n width: ", "px;\n\n position: fixed !important;\n z-index: ", " !important;\n box-shadow: 0px -", "px ", ";\n border-right: 0 none;\n /* top set by NumberColumn component */\n }\n\n .", " .", ".sticky {\n position: fixed !important;\n /* needs to be above row controls */\n z-index: ", " !important;\n background: ", ";\n\n width: ", "px;\n height: ", "px;\n }\n\n .", ".sticky .", " {\n border-bottom: 0px none;\n border-right: 0px none;\n\n height: ", "px;\n width: ", "px;\n }\n\n .", " .", " {\n z-index: 0;\n }\n\n .", "\n .", "\n .", ".sticky {\n position: fixed !important;\n z-index: ", " !important;\n display: flex;\n border-left: ", "px solid\n ", ";\n margin-left: -", "px;\n }\n\n .", " col:first-of-type {\n /* moving rows out of a table layout does weird things in Chrome */\n border-right: 1px solid ", ";\n }\n\n tr.sticky {\n padding-top: ", "px;\n position: fixed;\n display: grid;\n\n /* to keep it above cell selection 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 height: 0; // stop overflow flash & set correct height in update-overflow-shadows.ts\n }\n\n .less-padding {\n padding: 0 ", "px;\n\n .", " {\n padding: 0 ", "px;\n\n // https://product-fabric.atlassian.net/browse/ED-16386\n // Fixes issue where the extra padding that is added here throws off the position\n // of the rows control dot\n &::after {\n right: 6px !important;\n }\n }\n\n &.", "[data-number-column='true'] {\n padding-left: ", "px;\n }\n\n .", " {\n left: 6px;\n }\n\n .", " {\n left: calc(100% - 6px);\n }\n }\n\n > .", " {\n /**\n * Prevent margins collapsing, aids with placing the gap-cursor correctly\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Box_Model/Mastering_margin_collapsing\n *\n * TODO: Enable this, many tests will fail!\n * border-top: 1px solid transparent;\n */\n }\n\n /* Breakout only works on top level unless wrapped in fragment mark */\n ", "\n\n ", ";\n\n /* Corner controls */\n .", " {\n width: ", "px;\n height: ", "px;\n display: none;\n\n .", " {\n position: relative;\n\n ", ";\n }\n }\n\n .", ".sticky {\n .", " {\n /* sticky row insert dot overlaps other row insert and messes things up */\n display: none !important;\n }\n }\n\n .", " {\n position: absolute;\n top: 0;\n width: ", "px;\n height: ", "px;\n border: 1px solid ", ";\n border-radius: 0;\n border-top-left-radius: ", "px;\n background: ", ";\n box-sizing: border-box;\n padding: 0;\n :focus {\n outline: none;\n }\n }\n .active .", " {\n border-color: ", ";\n background: ", ";\n }\n\n .", "[data-number-column='true'] {\n .", ", .", " {\n width: ", "px;\n }\n .", " .", " {\n border-right-width: 0;\n }\n }\n\n :not(.", ") .", ":hover {\n border-color: ", ";\n background: ", ";\n cursor: pointer;\n }\n\n :not(.", ")\n .", ".", " {\n border-color: ", ";\n background: ", ";\n }\n\n /* Row controls */\n .", " {\n width: ", "px;\n box-sizing: border-box;\n display: none;\n position: relative;\n\n ", ";\n\n .", " {\n display: flex;\n flex-direction: column;\n }\n .", ":last-child > button {\n border-bottom-left-radius: ", "px;\n }\n .", " {\n position: relative;\n margin-top: -1px;\n }\n .", ":hover,\n .", ".active,\n .", ":hover {\n z-index: ", ";\n }\n\n ", "\n }\n\n :not(.", ") .", " {\n ", "\n ", "\n }\n\n /* Numbered column */\n .", " {\n position: relative;\n float: right;\n margin-left: ", "px;\n top: ", "px;\n width: ", "px;\n box-sizing: border-box;\n }\n\n .", " {\n border: 1px solid ", ";\n box-sizing: border-box;\n margin-top: -1px;\n padding-bottom: 2px;\n padding: 10px 2px;\n text-align: center;\n font-size: ", ";\n background-color: ", ";\n color: ", ";\n border-color: ", ";\n\n :first-child:not(style),\n style:first-child + * {\n margin-top: 0;\n }\n :last-child {\n border-bottom: 1px solid ", ";\n }\n }\n\n .", " {\n .", ", .", " {\n display: block;\n }\n .", " {\n padding-left: 1px;\n .", " {\n border-left: 0 none;\n }\n\n .", ".active {\n border-bottom: 1px solid ", ";\n border-color: ", ";\n background-color: ", ";\n position: relative;\n z-index: ", ";\n color: ", ";\n }\n }\n }\n :not(.", ") .", " {\n .", " {\n cursor: pointer;\n }\n .", ":hover {\n border-bottom: 1px solid ", ";\n border-color: ", ";\n background-color: ", ";\n position: relative;\n z-index: ", ";\n color: ", ";\n }\n .", ".", " {\n background-color: ", ";\n border: 1px solid ", ";\n border-left: 0;\n color: ", ";\n position: relative;\n z-index: ", ";\n }\n }\n\n /* Table */\n .", " > table {\n table-layout: fixed;\n white-space: normal;\n border-top: none;\n // 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 border: 1px solid ", ";\n z-index: ", ";\n }\n }\n }\n .", " {\n position: absolute;\n /* top of corner control is table margin top - corner control height + 1 pixel of table border. */\n top: ", "px;\n }\n .", ".", " {\n z-index: ", ";\n }\n .", " {\n left: -", "px;\n }\n ", "\n }\n\n .ProseMirror.", " {\n .", " {\n overflow-x: auto;\n ", ";\n }\n }\n\n .ProseMirror.", " {\n cursor: col-resize;\n }\n\n /*\n ED-15882: When custom start numbers is enabled for lists, we have\n styles that handle this generally (in editor-common) so we can\n throw away the older table-specific styles here.\n */\n ", "\n\n ", "\n"])), 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(props), columnControlsLineMarker(), hoveredDeleteButton(props), hoveredCell(props), hoveredWarningCell, resizeHandle(props), rangeSelectionStyles, ClassName.LAST_ITEM_IN_CELL, ClassName.TABLE_NODE_WRAPPER, ClassName.TABLE_CELL, ClassName.TABLE_HEADER_CELL, ClassName.TABLE_CELL, tableCellBackgroundColor(props), tableBorderColor(props), tableBorderColor(props), ClassName.CONTROLS_FLOATING_BUTTON_COLUMN, insertColumnButtonWrapper(props), ClassName.CONTROLS_FLOATING_BUTTON_ROW, insertRowButtonWrapper(props), DeleteButton(props), 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, ClassName.TABLE_STICKY, ClassName.COLUMN_CONTROLS_DECORATIONS, 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(props), 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), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, tablePadding, ClassName.ROW_CONTROLS_WRAPPER, tablePadding, ClassName.TABLE_CONTAINER, akEditorTableNumberColumnWidth + tablePadding - 1, ClassName.TABLE_LEFT_SHADOW, ClassName.TABLE_RIGHT_SHADOW, ClassName.NODEVIEW_WRAPPER, breakoutWidthStyling(), columnControlsDecoration(props), ClassName.CORNER_CONTROLS, tableToolbarSize + 1, cornerControlHeight, ClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, InsertMarker(props, "\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(props), tableBorderRadiusSize, tableHeaderCellBackgroundColor(props), ClassName.CONTROLS_CORNER_BUTTON, tableBorderSelectedColor(props), tableToolbarSelectedColor(props), ClassName.TABLE_CONTAINER, ClassName.CORNER_CONTROLS, ClassName.CONTROLS_CORNER_BUTTON, akEditorTableToolbarSize + akEditorTableNumberColumnWidth, ClassName.ROW_CONTROLS, ClassName.CONTROLS_BUTTON, ClassName.IS_RESIZING, ClassName.CONTROLS_CORNER_BUTTON, tableBorderSelectedColor(props), tableToolbarSelectedColor(props), ClassName.IS_RESIZING, ClassName.CONTROLS_CORNER_BUTTON, ClassName.HOVERED_CELL_IN_DANGER, tableBorderDeleteColor(props), tableToolbarDeleteColor(props), ClassName.ROW_CONTROLS, tableToolbarSize, InsertMarker(props, "\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(props, "\n border-bottom: 1px solid ".concat(tableBorderColor(props), ";\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.IS_RESIZING, ClassName.ROW_CONTROLS, HeaderButtonHover(props), HeaderButtonDanger(props), ClassName.NUMBERED_COLUMN, akEditorTableToolbarSize - 1, akEditorTableToolbarSize, akEditorTableNumberColumnWidth + 1, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderColor(props), relativeFontSizeToBase16(fontSize()), tableHeaderCellBackgroundColor(props), tableTextColor(props), tableBorderColor(props), tableBorderColor(props), ClassName.WITH_CONTROLS, ClassName.CORNER_CONTROLS, ClassName.ROW_CONTROLS, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderSelectedColor(props), tableBorderSelectedColor(props), tableToolbarSelectedColor(props), akEditorUnitZIndex, "var(--ds-text-selected, ".concat(N0, ")"), ClassName.IS_RESIZING, ClassName.WITH_CONTROLS, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderSelectedColor(props), tableBorderSelectedColor(props), tableToolbarSelectedColor(props), akEditorUnitZIndex, "var(--ds-text-selected, ".concat(N0, ")"), ClassName.NUMBERED_COLUMN_BUTTON, ClassName.HOVERED_CELL_IN_DANGER, tableToolbarDeleteColor(props), tableBorderDeleteColor(props), "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(props), ClassName.SELECTED_CELL, tableCellSelectedColor(props), akEditorSmallZIndex, ClassName.HOVERED_CELL_IN_DANGER, ClassName.HOVERED_CELL_IN_DANGER, tableCellDeleteColor(props), akEditorUnitZIndex * 100, ClassName.HOVERED_CELL, ClassName.SELECTED_CELL, ClassName.TABLE_HEADER_CELL, ClassName.SELECTED_CELL, ClassName.TABLE_HEADER_CELL, ClassName.HOVERED_CELL, tableBorderSelectedColor(props), akEditorSmallZIndex, ClassName.HOVERED_CELL_IN_DANGER, tableBorderDeleteColor(props), akEditorUnitZIndex * 100, ClassName.ROW_CONTROLS_WRAPPER, tableMarginTop - cornerControlHeight + 1, ClassName.ROW_CONTROLS_WRAPPER, ClassName.TABLE_LEFT_SHADOW, akEditorUnitZIndex, ClassName.ROW_CONTROLS_WRAPPER, tableToolbarSize, tableWrapperStyles(), ClassName.IS_RESIZING, ClassName.TABLE_NODE_WRAPPER, scrollbarStyles, ClassName.RESIZE_CURSOR, props !== null && props !== void 0 && (_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.restartNumberedLists ? "" : listLargeNumericMarkersOldStyles, shadowSentinelStyles);
|
|
42
42
|
};
|
|
43
43
|
export var tableFullPageEditorStyles = css(_templateObject5 || (_templateObject5 = _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);
|
|
44
44
|
export var tableCommentEditorStyles = css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n .ProseMirror .", " > table {\n margin-left: 0;\n margin-right: 0;\n ", ";\n }\n"])), ClassName.TABLE_NODE_WRAPPER, scrollbarStyles);
|
|
@@ -84,22 +84,15 @@ export var isTableContainerOrWrapper = function isTableContainerOrWrapper(node)
|
|
|
84
84
|
* the same is valid to the right side.
|
|
85
85
|
*/
|
|
86
86
|
|
|
87
|
-
export var getMousePositionHorizontalRelativeByElement = function getMousePositionHorizontalRelativeByElement(mouseEvent,
|
|
87
|
+
export var getMousePositionHorizontalRelativeByElement = function getMousePositionHorizontalRelativeByElement(mouseEvent, elementContentRects, gapInPixels) {
|
|
88
88
|
var element = mouseEvent.target;
|
|
89
89
|
if (element instanceof HTMLElement) {
|
|
90
|
+
var _closestCell$id, _elementContentRects$, _elementContentRects$2;
|
|
90
91
|
var width, x;
|
|
91
92
|
var closestCell = element.closest(SELECTOR_TABLE_LEAFS);
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
width = (_elementContentRects$ = elementContentRects === null || elementContentRects === void 0 ? void 0 : (_elementContentRects$2 = elementContentRects[id]) === null || _elementContentRects$2 === void 0 ? void 0 : _elementContentRects$2.width) !== null && _elementContentRects$ !== void 0 ? _elementContentRects$ : 0;
|
|
96
|
-
x = mouseEvent.offsetX;
|
|
97
|
-
} else {
|
|
98
|
-
var elementRect = element.getBoundingClientRect();
|
|
99
|
-
width = elementRect.width;
|
|
100
|
-
var left = elementRect.left;
|
|
101
|
-
x = mouseEvent.clientX - left;
|
|
102
|
-
}
|
|
93
|
+
var id = (_closestCell$id = closestCell === null || closestCell === void 0 ? void 0 : closestCell.id) !== null && _closestCell$id !== void 0 ? _closestCell$id : '';
|
|
94
|
+
width = (_elementContentRects$ = elementContentRects === null || elementContentRects === void 0 ? void 0 : (_elementContentRects$2 = elementContentRects[id]) === null || _elementContentRects$2 === void 0 ? void 0 : _elementContentRects$2.width) !== null && _elementContentRects$ !== void 0 ? _elementContentRects$ : 0;
|
|
95
|
+
x = mouseEvent.offsetX;
|
|
103
96
|
if (width <= 0) {
|
|
104
97
|
return null;
|
|
105
98
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
3
2
|
import { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
3
|
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
4
|
import { ElementContentRects } from './types';
|
|
@@ -10,7 +9,7 @@ export declare const handleMouseOver: (view: EditorView, mouseEvent: Event) => b
|
|
|
10
9
|
export declare const handleMouseDown: (_: EditorView, event: Event) => boolean;
|
|
11
10
|
export declare const handleMouseOut: (view: EditorView, mouseEvent: Event) => boolean;
|
|
12
11
|
export declare const handleMouseLeave: (view: EditorView, event: Event) => boolean;
|
|
13
|
-
export declare const handleMouseMove: (
|
|
12
|
+
export declare const handleMouseMove: (view: EditorView, event: Event, elementContentRects?: ElementContentRects) => boolean;
|
|
14
13
|
export declare function handleTripleClick(view: EditorView, pos: number): boolean;
|
|
15
14
|
export declare const handleCut: (oldTr: Transaction, oldState: EditorState, newState: EditorState, editorAnalyticsAPI?: EditorAnalyticsAPI) => Transaction;
|
|
16
15
|
export declare const whenTableInFocus: (eventHandler: (view: EditorView, mouseEvent: Event, elementContentRects?: ElementContentRects) => boolean, elementContentRects?: ElementContentRects) => (view: EditorView, mouseEvent: Event) => boolean;
|
|
@@ -30,7 +30,6 @@ export interface ComponentProps {
|
|
|
30
30
|
interface TableState {
|
|
31
31
|
scroll: number;
|
|
32
32
|
parentWidth?: number;
|
|
33
|
-
isLoading: boolean;
|
|
34
33
|
stickyHeader?: RowStickyState;
|
|
35
34
|
[ShadowEvent.SHOW_BEFORE_SHADOW]: boolean;
|
|
36
35
|
[ShadowEvent.SHOW_AFTER_SHADOW]: boolean;
|
|
@@ -48,7 +47,6 @@ declare class TableComponent extends React.Component<ComponentProps, TableState>
|
|
|
48
47
|
componentDidMount(): void;
|
|
49
48
|
componentWillUnmount(): void;
|
|
50
49
|
componentDidUpdate(): void;
|
|
51
|
-
private updateShadows;
|
|
52
50
|
private updateShadowState;
|
|
53
51
|
private createShadowSentinels;
|
|
54
52
|
onStickyState: (state: StickyPluginState) => void;
|
|
@@ -11,7 +11,6 @@ type ForwardRef = (node: HTMLElement | null) => void;
|
|
|
11
11
|
export default class TableView extends ReactNodeView<Props> {
|
|
12
12
|
private table;
|
|
13
13
|
private resizeObserver?;
|
|
14
|
-
private tableRenderOptimization?;
|
|
15
14
|
eventDispatcher?: EventDispatcher;
|
|
16
15
|
getPos: getPosHandlerNode;
|
|
17
16
|
constructor(props: Props);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
2
|
-
import type {
|
|
2
|
+
import type { getPosHandler } from '@atlaskit/editor-common/types';
|
|
3
3
|
import { Node } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
5
5
|
export default class TableCellNodeView implements NodeView {
|
|
@@ -10,8 +10,7 @@ export default class TableCellNodeView implements NodeView {
|
|
|
10
10
|
view: EditorView;
|
|
11
11
|
providerFactory?: ProviderFactory;
|
|
12
12
|
observer?: ResizeObserver;
|
|
13
|
-
|
|
14
|
-
constructor(node: Node, view: EditorView, getPos: any, getEditorFeatureFlags: GetEditorFeatureFlags, observer?: ResizeObserver);
|
|
13
|
+
constructor(node: Node, view: EditorView, getPos: any, observer?: ResizeObserver);
|
|
15
14
|
private updateNodeView;
|
|
16
15
|
update(node: Node): boolean;
|
|
17
16
|
destroy(): void;
|
|
@@ -19,7 +19,6 @@ export interface Props {
|
|
|
19
19
|
eventDispatcher: EventDispatcher;
|
|
20
20
|
getPos: () => number | undefined;
|
|
21
21
|
options?: TableOptions;
|
|
22
|
-
tableRenderOptimization?: boolean;
|
|
23
22
|
getEditorContainerWidth: GetEditorContainerWidth;
|
|
24
23
|
getEditorFeatureFlags: GetEditorFeatureFlags;
|
|
25
24
|
hasIntlContext: boolean;
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
2
1
|
export declare const updateShadowListForStickyStyles: (heightStyle: string, shadows: HTMLCollection) => void;
|
|
3
|
-
/**
|
|
4
|
-
* Update overflow shadows for a given wrapper & table.
|
|
5
|
-
* if `overflowShadowOptimization` is enabled, this will exit early.
|
|
6
|
-
*/
|
|
7
|
-
export declare const updateOverflowShadows: (getEditorFeatureFlags: GetEditorFeatureFlags) => (wrapper?: HTMLElement | null, table?: HTMLElement | null, rightShadows?: NodeListOf<HTMLElement> | null, leftShadows?: NodeListOf<HTMLElement> | null) => false | undefined;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/// <reference types="lodash" />
|
|
2
2
|
import { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
3
|
-
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
4
3
|
import { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
4
|
import { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
6
5
|
import { TablePluginState } from '../../../types';
|
|
@@ -30,11 +29,10 @@ export declare class TableRowNodeView implements NodeView {
|
|
|
30
29
|
lastTimePainted: number;
|
|
31
30
|
private intersectionObserver?;
|
|
32
31
|
private resizeObserver?;
|
|
33
|
-
private stickyHeadersOptimization;
|
|
34
32
|
private sentinels;
|
|
35
33
|
private stickyRowHeight?;
|
|
36
34
|
get tree(): TableDOMElements | null | undefined;
|
|
37
|
-
constructor(node: PmNode, view: EditorView, getPos: any, eventDispatcher: EventDispatcher
|
|
35
|
+
constructor(node: PmNode, view: EditorView, getPos: any, eventDispatcher: EventDispatcher);
|
|
38
36
|
listening: boolean;
|
|
39
37
|
headerRowMouseScrollEnd: import("lodash").DebouncedFunc<() => void>;
|
|
40
38
|
headerRowMouseScroll: import("lodash").DebouncedFunc<() => void>;
|
|
@@ -47,9 +45,6 @@ export declare class TableRowNodeView implements NodeView {
|
|
|
47
45
|
previousPadding: number | undefined;
|
|
48
46
|
latestDomTop: number | undefined;
|
|
49
47
|
nextFrame: number | undefined;
|
|
50
|
-
onScroll: () => void;
|
|
51
|
-
loop: () => void;
|
|
52
|
-
paint: (tree: TableDOMElements) => void;
|
|
53
48
|
update(node: PmNode, ..._args: any[]): boolean;
|
|
54
49
|
destroy(): void;
|
|
55
50
|
ignoreMutation(mutationRecord: MutationRecord | {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
2
1
|
import { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
3
2
|
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
export declare const updateControls: (
|
|
3
|
+
export declare const updateControls: () => (state: EditorState) => void;
|
|
5
4
|
export declare const isClickNear: (event: MouseEvent, click: {
|
|
6
5
|
x: number;
|
|
7
6
|
y: number;
|
|
@@ -38,13 +38,14 @@ export interface PluginConfig {
|
|
|
38
38
|
permittedLayouts?: PermittedLayoutsDescriptor;
|
|
39
39
|
allowControls?: boolean;
|
|
40
40
|
stickyHeaders?: boolean;
|
|
41
|
+
allowCellOptionsInFloatingToolbar?: boolean;
|
|
42
|
+
allowDistributeColumns?: boolean;
|
|
41
43
|
tableCellOptimization?: boolean;
|
|
42
44
|
tableRenderOptimization?: boolean;
|
|
43
45
|
stickyHeadersOptimization?: boolean;
|
|
44
46
|
initialRenderOptimization?: boolean;
|
|
45
47
|
mouseMoveOptimization?: boolean;
|
|
46
48
|
tableOverflowShadowsOptimization?: boolean;
|
|
47
|
-
allowDistributeColumns?: boolean;
|
|
48
49
|
}
|
|
49
50
|
export type { ColumnResizingPluginState } from '@atlaskit/editor-common/types';
|
|
50
51
|
export type CellColumnPositioning = Pick<Rect, 'right' | 'left'>;
|
|
@@ -70,7 +71,6 @@ export interface TablePluginState {
|
|
|
70
71
|
ordering?: TableColumnOrdering;
|
|
71
72
|
resizeHandleRowIndex?: number;
|
|
72
73
|
resizeHandleColumnIndex?: number;
|
|
73
|
-
tableCellOptimization?: boolean;
|
|
74
74
|
isTableCollapsed?: boolean;
|
|
75
75
|
canCollapseTable?: boolean;
|
|
76
76
|
}
|
|
@@ -8,7 +8,7 @@ export declare const isRowControlsButton: (node: HTMLElement | null) => boolean;
|
|
|
8
8
|
export declare const isResizeHandleDecoration: (node: HTMLElement | null) => boolean;
|
|
9
9
|
export declare const isTableControlsButton: (node: HTMLElement | null) => boolean;
|
|
10
10
|
export declare const isTableContainerOrWrapper: (node: HTMLElement | null) => boolean;
|
|
11
|
-
export declare const getMousePositionHorizontalRelativeByElement: (mouseEvent: MouseEvent,
|
|
11
|
+
export declare const getMousePositionHorizontalRelativeByElement: (mouseEvent: MouseEvent, elementContentRects?: ElementContentRects, gapInPixels?: number) => 'left' | 'right' | null;
|
|
12
12
|
export declare const getMousePositionVerticalRelativeByElement: (mouseEvent: MouseEvent) => 'top' | 'bottom' | null;
|
|
13
13
|
export declare const updateResizeHandles: (tableRef?: HTMLElement) => void;
|
|
14
14
|
export declare const hasResizeHandler: ({ columnEndIndexTarget, target, }: {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
3
2
|
import { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
3
|
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
4
|
import { ElementContentRects } from './types';
|
|
@@ -10,7 +9,7 @@ export declare const handleMouseOver: (view: EditorView, mouseEvent: Event) => b
|
|
|
10
9
|
export declare const handleMouseDown: (_: EditorView, event: Event) => boolean;
|
|
11
10
|
export declare const handleMouseOut: (view: EditorView, mouseEvent: Event) => boolean;
|
|
12
11
|
export declare const handleMouseLeave: (view: EditorView, event: Event) => boolean;
|
|
13
|
-
export declare const handleMouseMove: (
|
|
12
|
+
export declare const handleMouseMove: (view: EditorView, event: Event, elementContentRects?: ElementContentRects) => boolean;
|
|
14
13
|
export declare function handleTripleClick(view: EditorView, pos: number): boolean;
|
|
15
14
|
export declare const handleCut: (oldTr: Transaction, oldState: EditorState, newState: EditorState, editorAnalyticsAPI?: EditorAnalyticsAPI) => Transaction;
|
|
16
15
|
export declare const whenTableInFocus: (eventHandler: (view: EditorView, mouseEvent: Event, elementContentRects?: ElementContentRects) => boolean, elementContentRects?: ElementContentRects) => (view: EditorView, mouseEvent: Event) => boolean;
|
|
@@ -30,7 +30,6 @@ export interface ComponentProps {
|
|
|
30
30
|
interface TableState {
|
|
31
31
|
scroll: number;
|
|
32
32
|
parentWidth?: number;
|
|
33
|
-
isLoading: boolean;
|
|
34
33
|
stickyHeader?: RowStickyState;
|
|
35
34
|
[ShadowEvent.SHOW_BEFORE_SHADOW]: boolean;
|
|
36
35
|
[ShadowEvent.SHOW_AFTER_SHADOW]: boolean;
|
|
@@ -48,7 +47,6 @@ declare class TableComponent extends React.Component<ComponentProps, TableState>
|
|
|
48
47
|
componentDidMount(): void;
|
|
49
48
|
componentWillUnmount(): void;
|
|
50
49
|
componentDidUpdate(): void;
|
|
51
|
-
private updateShadows;
|
|
52
50
|
private updateShadowState;
|
|
53
51
|
private createShadowSentinels;
|
|
54
52
|
onStickyState: (state: StickyPluginState) => void;
|
|
@@ -11,7 +11,6 @@ type ForwardRef = (node: HTMLElement | null) => void;
|
|
|
11
11
|
export default class TableView extends ReactNodeView<Props> {
|
|
12
12
|
private table;
|
|
13
13
|
private resizeObserver?;
|
|
14
|
-
private tableRenderOptimization?;
|
|
15
14
|
eventDispatcher?: EventDispatcher;
|
|
16
15
|
getPos: getPosHandlerNode;
|
|
17
16
|
constructor(props: Props);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
2
|
-
import type {
|
|
2
|
+
import type { getPosHandler } from '@atlaskit/editor-common/types';
|
|
3
3
|
import { Node } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
5
5
|
export default class TableCellNodeView implements NodeView {
|
|
@@ -10,8 +10,7 @@ export default class TableCellNodeView implements NodeView {
|
|
|
10
10
|
view: EditorView;
|
|
11
11
|
providerFactory?: ProviderFactory;
|
|
12
12
|
observer?: ResizeObserver;
|
|
13
|
-
|
|
14
|
-
constructor(node: Node, view: EditorView, getPos: any, getEditorFeatureFlags: GetEditorFeatureFlags, observer?: ResizeObserver);
|
|
13
|
+
constructor(node: Node, view: EditorView, getPos: any, observer?: ResizeObserver);
|
|
15
14
|
private updateNodeView;
|
|
16
15
|
update(node: Node): boolean;
|
|
17
16
|
destroy(): void;
|
|
@@ -19,7 +19,6 @@ export interface Props {
|
|
|
19
19
|
eventDispatcher: EventDispatcher;
|
|
20
20
|
getPos: () => number | undefined;
|
|
21
21
|
options?: TableOptions;
|
|
22
|
-
tableRenderOptimization?: boolean;
|
|
23
22
|
getEditorContainerWidth: GetEditorContainerWidth;
|
|
24
23
|
getEditorFeatureFlags: GetEditorFeatureFlags;
|
|
25
24
|
hasIntlContext: boolean;
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
2
1
|
export declare const updateShadowListForStickyStyles: (heightStyle: string, shadows: HTMLCollection) => void;
|
|
3
|
-
/**
|
|
4
|
-
* Update overflow shadows for a given wrapper & table.
|
|
5
|
-
* if `overflowShadowOptimization` is enabled, this will exit early.
|
|
6
|
-
*/
|
|
7
|
-
export declare const updateOverflowShadows: (getEditorFeatureFlags: GetEditorFeatureFlags) => (wrapper?: HTMLElement | null, table?: HTMLElement | null, rightShadows?: NodeListOf<HTMLElement> | null, leftShadows?: NodeListOf<HTMLElement> | null) => false | undefined;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/// <reference types="lodash" />
|
|
2
2
|
import { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
3
|
-
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
4
3
|
import { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
4
|
import { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
6
5
|
import { TablePluginState } from '../../../types';
|
|
@@ -30,11 +29,10 @@ export declare class TableRowNodeView implements NodeView {
|
|
|
30
29
|
lastTimePainted: number;
|
|
31
30
|
private intersectionObserver?;
|
|
32
31
|
private resizeObserver?;
|
|
33
|
-
private stickyHeadersOptimization;
|
|
34
32
|
private sentinels;
|
|
35
33
|
private stickyRowHeight?;
|
|
36
34
|
get tree(): TableDOMElements | null | undefined;
|
|
37
|
-
constructor(node: PmNode, view: EditorView, getPos: any, eventDispatcher: EventDispatcher
|
|
35
|
+
constructor(node: PmNode, view: EditorView, getPos: any, eventDispatcher: EventDispatcher);
|
|
38
36
|
listening: boolean;
|
|
39
37
|
headerRowMouseScrollEnd: import("lodash").DebouncedFunc<() => void>;
|
|
40
38
|
headerRowMouseScroll: import("lodash").DebouncedFunc<() => void>;
|
|
@@ -47,9 +45,6 @@ export declare class TableRowNodeView implements NodeView {
|
|
|
47
45
|
previousPadding: number | undefined;
|
|
48
46
|
latestDomTop: number | undefined;
|
|
49
47
|
nextFrame: number | undefined;
|
|
50
|
-
onScroll: () => void;
|
|
51
|
-
loop: () => void;
|
|
52
|
-
paint: (tree: TableDOMElements) => void;
|
|
53
48
|
update(node: PmNode, ..._args: any[]): boolean;
|
|
54
49
|
destroy(): void;
|
|
55
50
|
ignoreMutation(mutationRecord: MutationRecord | {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
2
1
|
import { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
3
2
|
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
export declare const updateControls: (
|
|
3
|
+
export declare const updateControls: () => (state: EditorState) => void;
|
|
5
4
|
export declare const isClickNear: (event: MouseEvent, click: {
|
|
6
5
|
x: number;
|
|
7
6
|
y: number;
|
|
@@ -38,13 +38,14 @@ export interface PluginConfig {
|
|
|
38
38
|
permittedLayouts?: PermittedLayoutsDescriptor;
|
|
39
39
|
allowControls?: boolean;
|
|
40
40
|
stickyHeaders?: boolean;
|
|
41
|
+
allowCellOptionsInFloatingToolbar?: boolean;
|
|
42
|
+
allowDistributeColumns?: boolean;
|
|
41
43
|
tableCellOptimization?: boolean;
|
|
42
44
|
tableRenderOptimization?: boolean;
|
|
43
45
|
stickyHeadersOptimization?: boolean;
|
|
44
46
|
initialRenderOptimization?: boolean;
|
|
45
47
|
mouseMoveOptimization?: boolean;
|
|
46
48
|
tableOverflowShadowsOptimization?: boolean;
|
|
47
|
-
allowDistributeColumns?: boolean;
|
|
48
49
|
}
|
|
49
50
|
export type { ColumnResizingPluginState } from '@atlaskit/editor-common/types';
|
|
50
51
|
export type CellColumnPositioning = Pick<Rect, 'right' | 'left'>;
|
|
@@ -70,7 +71,6 @@ export interface TablePluginState {
|
|
|
70
71
|
ordering?: TableColumnOrdering;
|
|
71
72
|
resizeHandleRowIndex?: number;
|
|
72
73
|
resizeHandleColumnIndex?: number;
|
|
73
|
-
tableCellOptimization?: boolean;
|
|
74
74
|
isTableCollapsed?: boolean;
|
|
75
75
|
canCollapseTable?: boolean;
|
|
76
76
|
}
|
|
@@ -11,7 +11,7 @@ export declare const isRowControlsButton: (node: HTMLElement | null) => boolean;
|
|
|
11
11
|
export declare const isResizeHandleDecoration: (node: HTMLElement | null) => boolean;
|
|
12
12
|
export declare const isTableControlsButton: (node: HTMLElement | null) => boolean;
|
|
13
13
|
export declare const isTableContainerOrWrapper: (node: HTMLElement | null) => boolean;
|
|
14
|
-
export declare const getMousePositionHorizontalRelativeByElement: (mouseEvent: MouseEvent,
|
|
14
|
+
export declare const getMousePositionHorizontalRelativeByElement: (mouseEvent: MouseEvent, elementContentRects?: ElementContentRects, gapInPixels?: number) => 'left' | 'right' | null;
|
|
15
15
|
export declare const getMousePositionVerticalRelativeByElement: (mouseEvent: MouseEvent) => 'top' | 'bottom' | null;
|
|
16
16
|
export declare const updateResizeHandles: (tableRef?: HTMLElement) => void;
|
|
17
17
|
export declare const hasResizeHandler: ({ columnEndIndexTarget, target, }: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.0",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@atlaskit/adf-schema": "^28.1.0",
|
|
31
|
-
"@atlaskit/editor-common": "^74.
|
|
31
|
+
"@atlaskit/editor-common": "^74.47.0",
|
|
32
32
|
"@atlaskit/editor-palette": "1.5.1",
|
|
33
33
|
"@atlaskit/editor-plugin-analytics": "^0.1.0",
|
|
34
34
|
"@atlaskit/editor-plugin-content-insertion": "^0.0.8",
|
package/report.api.md
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
mountEditor,
|
|
8
8
|
} from '@atlaskit/editor-test-helpers/testing-example-page';
|
|
9
9
|
import { BrowserTestCase } from '@atlaskit/webdriver-runner/runner';
|
|
10
|
-
import WebdriverPage from '@atlaskit/webdriver-runner/wd-wrapper';
|
|
10
|
+
import type WebdriverPage from '@atlaskit/webdriver-runner/wd-wrapper';
|
|
11
11
|
|
|
12
12
|
import { TableCssClassName as className } from '../../plugins/table/types';
|
|
13
13
|
|
|
@@ -15,19 +15,16 @@ import basicTable from './__fixtures__/basic-table';
|
|
|
15
15
|
|
|
16
16
|
const checkShadows = async (page: WebdriverPage, side?: 'left' | 'right') => {
|
|
17
17
|
const leftShadow = await page.$(`.${className.TABLE_LEFT_SHADOW}`);
|
|
18
|
-
const leftShadowStyle = await leftShadow.getAttribute('style');
|
|
19
18
|
const rightShadow = await page.$(`.${className.TABLE_RIGHT_SHADOW}`);
|
|
20
|
-
const rightShadowStyle = await rightShadow.getAttribute('style');
|
|
21
19
|
|
|
22
20
|
if (!side) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
);
|
|
21
|
+
const leftDisplayed = await leftShadow.isDisplayed();
|
|
22
|
+
const rightDisplayed = await rightShadow.isDisplayed();
|
|
23
|
+
return leftDisplayed && rightDisplayed;
|
|
27
24
|
} else if (side === 'left') {
|
|
28
|
-
return
|
|
25
|
+
return await leftShadow.isDisplayed();
|
|
29
26
|
} else if (side === 'right') {
|
|
30
|
-
return
|
|
27
|
+
return await rightShadow.isDisplayed();
|
|
31
28
|
}
|
|
32
29
|
};
|
|
33
30
|
|
|
@@ -178,19 +178,10 @@ BrowserTestCase(
|
|
|
178
178
|
},
|
|
179
179
|
);
|
|
180
180
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
test: 'Should stack columns to the right and go to overflow with overflowShadowsOptimisation',
|
|
188
|
-
featureFlags: {
|
|
189
|
-
tableOverflowShadowsOptimization: true,
|
|
190
|
-
},
|
|
191
|
-
},
|
|
192
|
-
].forEach(({ test, featureFlags }) => {
|
|
193
|
-
BrowserTestCase(test, {}, async (client: any, testName: string) => {
|
|
181
|
+
BrowserTestCase(
|
|
182
|
+
'Should stack columns to the right and go to overflow',
|
|
183
|
+
{},
|
|
184
|
+
async (client: any, testName: string) => {
|
|
194
185
|
const page = await goToEditorTestingWDExample(
|
|
195
186
|
client,
|
|
196
187
|
'editor-plugin-table',
|
|
@@ -202,15 +193,14 @@ BrowserTestCase(
|
|
|
202
193
|
allowTables: {
|
|
203
194
|
advanced: true,
|
|
204
195
|
},
|
|
205
|
-
featureFlags,
|
|
206
196
|
});
|
|
207
197
|
|
|
208
198
|
await resizeColumn(page, { cellHandlePos: 2, resizeWidth: 420 });
|
|
209
199
|
|
|
210
200
|
const doc = await page.$eval(editable, getDocFromElement);
|
|
211
201
|
expect(doc).toMatchCustomDocSnapshot(testName);
|
|
212
|
-
}
|
|
213
|
-
|
|
202
|
+
},
|
|
203
|
+
);
|
|
214
204
|
|
|
215
205
|
BrowserTestCase(
|
|
216
206
|
'Should bulk resize 3 columns in 4 columns table',
|
|
@@ -154,7 +154,6 @@ describe('table plugin: decorations', () => {
|
|
|
154
154
|
|
|
155
155
|
describe('table event handlers', () => {
|
|
156
156
|
const createEditor = createProsemirrorEditorFactory();
|
|
157
|
-
const fakeGetEditorFeatureFlags = () => ({});
|
|
158
157
|
const editor = (doc: DocBuilder) =>
|
|
159
158
|
createEditor({
|
|
160
159
|
doc,
|
|
@@ -222,9 +221,7 @@ describe('table event handlers', () => {
|
|
|
222
221
|
const event = {
|
|
223
222
|
target: firstCell.node,
|
|
224
223
|
};
|
|
225
|
-
expect(
|
|
226
|
-
handleMouseMove(fakeGetEditorFeatureFlags)(editorView, event as any),
|
|
227
|
-
).toEqual(false);
|
|
224
|
+
expect(handleMouseMove(editorView, event as any)).toEqual(false);
|
|
228
225
|
});
|
|
229
226
|
});
|
|
230
227
|
});
|