@atlaskit/editor-plugin-table 3.0.5 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/cjs/plugins/table/commands/insert.js +5 -0
- package/dist/cjs/plugins/table/commands/toggle.js +11 -1
- package/dist/cjs/plugins/table/index.js +37 -26
- package/dist/cjs/plugins/table/nodeviews/TableComponent.js +112 -47
- package/dist/cjs/plugins/table/nodeviews/TableResizer.js +9 -4
- package/dist/cjs/plugins/table/pm-plugins/table-analytics.js +83 -0
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/commands.js +5 -0
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/event-handlers.js +8 -0
- package/dist/cjs/plugins/table/transforms/delete-columns.js +5 -0
- package/dist/cjs/plugins/table/ui/common-styles.js +1 -1
- package/dist/cjs/plugins/table/ui/consts.js +3 -1
- package/dist/cjs/plugins/table/ui/ui-styles.js +1 -1
- package/dist/es2019/plugins/table/commands/insert.js +5 -0
- package/dist/es2019/plugins/table/commands/toggle.js +11 -1
- package/dist/es2019/plugins/table/index.js +12 -0
- package/dist/es2019/plugins/table/nodeviews/TableComponent.js +73 -4
- package/dist/es2019/plugins/table/nodeviews/TableResizer.js +5 -0
- package/dist/es2019/plugins/table/pm-plugins/table-analytics.js +74 -0
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/commands.js +5 -0
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/event-handlers.js +9 -1
- package/dist/es2019/plugins/table/transforms/delete-columns.js +5 -0
- package/dist/es2019/plugins/table/ui/common-styles.js +4 -1
- package/dist/es2019/plugins/table/ui/consts.js +1 -0
- package/dist/es2019/plugins/table/ui/ui-styles.js +7 -5
- package/dist/esm/plugins/table/commands/insert.js +5 -0
- package/dist/esm/plugins/table/commands/toggle.js +11 -1
- package/dist/esm/plugins/table/index.js +37 -26
- package/dist/esm/plugins/table/nodeviews/TableComponent.js +114 -49
- package/dist/esm/plugins/table/nodeviews/TableResizer.js +5 -0
- package/dist/esm/plugins/table/pm-plugins/table-analytics.js +75 -0
- package/dist/esm/plugins/table/pm-plugins/table-resizing/commands.js +5 -0
- package/dist/esm/plugins/table/pm-plugins/table-resizing/event-handlers.js +9 -1
- package/dist/esm/plugins/table/transforms/delete-columns.js +5 -0
- package/dist/esm/plugins/table/ui/common-styles.js +2 -2
- package/dist/esm/plugins/table/ui/consts.js +1 -0
- package/dist/esm/plugins/table/ui/ui-styles.js +2 -2
- package/dist/types/plugins/table/commands/insert.d.ts +3 -4
- package/dist/types/plugins/table/commands/toggle.d.ts +2 -2
- package/dist/types/plugins/table/nodeviews/TableComponent.d.ts +4 -1
- package/dist/types/plugins/table/pm-plugins/table-analytics.d.ts +23 -0
- package/dist/types/plugins/table/pm-plugins/table-resizing/commands.d.ts +4 -4
- package/dist/types/plugins/table/transforms/delete-columns.d.ts +2 -2
- package/dist/types/plugins/table/ui/consts.d.ts +1 -0
- package/dist/types-ts4.5/plugins/table/commands/insert.d.ts +3 -4
- package/dist/types-ts4.5/plugins/table/commands/toggle.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/nodeviews/TableComponent.d.ts +4 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-analytics.d.ts +23 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/commands.d.ts +4 -4
- package/dist/types-ts4.5/plugins/table/transforms/delete-columns.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/ui/consts.d.ts +1 -0
- package/package.json +8 -2
- package/src/plugins/table/commands/insert.ts +12 -4
- package/src/plugins/table/commands/toggle.ts +17 -4
- package/src/plugins/table/index.tsx +17 -1
- package/src/plugins/table/nodeviews/TableComponent.tsx +110 -4
- package/src/plugins/table/nodeviews/TableResizer.tsx +6 -0
- package/src/plugins/table/pm-plugins/table-analytics.ts +102 -0
- package/src/plugins/table/pm-plugins/table-resizing/commands.ts +10 -4
- package/src/plugins/table/pm-plugins/table-resizing/event-handlers.ts +10 -0
- package/src/plugins/table/transforms/delete-columns.ts +12 -4
- package/src/plugins/table/ui/common-styles.ts +4 -0
- package/src/plugins/table/ui/consts.ts +1 -0
- package/src/plugins/table/ui/ui-styles.ts +28 -5
|
@@ -3,9 +3,11 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
3
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
5
|
import { AddColumnStep } from '@atlaskit/adf-schema/steps';
|
|
6
|
+
import { TABLE_OVERFLOW_CHANGE_TRIGGER } from '@atlaskit/editor-common/analytics';
|
|
6
7
|
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
7
8
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
8
9
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
10
|
+
import { META_KEYS } from '../pm-plugins/table-analytics';
|
|
9
11
|
import { splitCellsInColumns } from './split';
|
|
10
12
|
var deleteColumnsCustomStep = function deleteColumnsCustomStep(rect) {
|
|
11
13
|
return function (tr) {
|
|
@@ -203,6 +205,9 @@ function fixRowSpans(table) {
|
|
|
203
205
|
export var deleteColumns = function deleteColumns(rect) {
|
|
204
206
|
var allowAddColumnCustomStep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
205
207
|
return function (tr) {
|
|
208
|
+
tr.setMeta(META_KEYS.OVERFLOW_TRIGGER, {
|
|
209
|
+
name: TABLE_OVERFLOW_CHANGE_TRIGGER.DELETED_COLUMN
|
|
210
|
+
});
|
|
206
211
|
if (allowAddColumnCustomStep) {
|
|
207
212
|
return deleteColumnsCustomStep(rect)(tr);
|
|
208
213
|
}
|
|
@@ -8,7 +8,7 @@ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
|
8
8
|
import { B300, N0, N20A, N300, N40A, R500 } from '@atlaskit/theme/colors';
|
|
9
9
|
import { fontSize } from '@atlaskit/theme/constants';
|
|
10
10
|
import { TableCssClassName as ClassName } from '../types';
|
|
11
|
-
import { columnControlsDecorationHeight, resizeHandlerAreaWidth, resizeLineWidth, stickyHeaderBorderBottomWidth, stickyRowOffsetTop, tableBorderColor, tableBorderDeleteColor, tableBorderRadiusSize, tableBorderSelectedColor, tableCellBackgroundColor, tableCellDeleteColor, tableCellSelectedColor, tableControlsSpacing, tableHeaderCellBackgroundColor, tableInsertColumnButtonSize, tablePadding, tableScrollbarOffset, tableTextColor, tableToolbarDeleteColor, tableToolbarSelectedColor, tableToolbarSize } from './consts';
|
|
11
|
+
import { columnControlsDecorationHeight, resizeHandlerAreaWidth, resizeLineWidth, stickyHeaderBorderBottomWidth, stickyRowOffsetTop, tableBorderColor, tableBorderDeleteColor, tableBorderRadiusSize, tableBorderSelectedColor, tableCellBackgroundColor, tableCellDeleteColor, tableCellSelectedColor, tableControlsSpacing, tableHeaderCellBackgroundColor, tableInsertColumnButtonSize, tableOverflowShadowWidth, tablePadding, tableScrollbarOffset, tableTextColor, tableToolbarDeleteColor, tableToolbarSelectedColor, tableToolbarSize } from './consts';
|
|
12
12
|
import { columnControlsDecoration, columnControlsLineMarker, DeleteButton, HeaderButton, HeaderButtonDanger, HeaderButtonHover, hoveredCell, hoveredDeleteButton, hoveredWarningCell, insertColumnButtonWrapper, InsertMarker, insertRowButtonWrapper, OverflowShadow, resizeHandle } from './ui-styles';
|
|
13
13
|
var cornerControlHeight = tableToolbarSize + 1;
|
|
14
14
|
|
|
@@ -38,7 +38,7 @@ var tableWrapperStyles = function tableWrapperStyles() {
|
|
|
38
38
|
// TODO: https://product-fabric.atlassian.net/browse/DSP-4139
|
|
39
39
|
export var tableStyles = function tableStyles(props) {
|
|
40
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: ", "px;\n\n .", " {\n border-left: 0 none;\n }\n\n .", ".active {\n border-bottom: 1px solid ", ";\n border-color: ", ";\n background-color: ", ";\n position: relative;\n z-index: ", ";\n color: ", ";\n }\n }\n }\n :not(.", ") .", " {\n .", " {\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, getBooleanFF('platform.editor.custom-table-width') ? akEditorTableToolbarSize + akEditorTableNumberColumnWidth + 1 : akEditorTableToolbarSize + akEditorTableNumberColumnWidth, ClassName.ROW_CONTROLS, ClassName.CONTROLS_BUTTON, ClassName.IS_RESIZING, ClassName.CONTROLS_CORNER_BUTTON, tableBorderSelectedColor(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, getBooleanFF('platform.editor.custom-table-width') ? akEditorTableToolbarSize : 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, getBooleanFF('platform.editor.custom-table-width') ? 0 : 1, 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);
|
|
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 width: ", "px;\n }\n\n .", " {\n left: 6px;\n }\n\n .", " {\n left: calc(100% - 6px);\n }\n }\n\n > .", " {\n /**\n * Prevent margins collapsing, aids with placing the gap-cursor correctly\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Box_Model/Mastering_margin_collapsing\n *\n * TODO: Enable this, many tests will fail!\n * border-top: 1px solid transparent;\n */\n }\n\n /* Breakout only works on top level unless wrapped in fragment mark */\n ", "\n\n ", ";\n\n /* Corner controls */\n .", " {\n width: ", "px;\n height: ", "px;\n display: none;\n\n .", " {\n position: relative;\n\n ", ";\n }\n }\n\n .", ".sticky {\n .", " {\n /* sticky row insert dot overlaps other row insert and messes things up */\n display: none !important;\n }\n }\n\n .", " {\n position: absolute;\n top: 0;\n width: ", "px;\n height: ", "px;\n border: 1px solid ", ";\n border-radius: 0;\n border-top-left-radius: ", "px;\n background: ", ";\n box-sizing: border-box;\n padding: 0;\n :focus {\n outline: none;\n }\n }\n .active .", " {\n border-color: ", ";\n background: ", ";\n }\n\n .", "[data-number-column='true'] {\n .", ", .", " {\n width: ", "px;\n }\n .", " .", " {\n border-right-width: 0;\n }\n }\n\n :not(.", ") .", ":hover {\n border-color: ", ";\n background: ", ";\n cursor: pointer;\n }\n\n :not(.", ")\n .", ".", " {\n border-color: ", ";\n background: ", ";\n }\n\n /* Row controls */\n .", " {\n width: ", "px;\n box-sizing: border-box;\n display: none;\n position: relative;\n\n ", ";\n\n .", " {\n display: flex;\n flex-direction: column;\n }\n .", ":last-child > button {\n border-bottom-left-radius: ", "px;\n }\n .", " {\n position: relative;\n margin-top: -1px;\n }\n .", ":hover,\n .", ".active,\n .", ":hover {\n z-index: ", ";\n }\n\n ", "\n }\n\n :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: ", "px;\n\n .", " {\n border-left: 0 none;\n }\n\n .", ".active {\n border-bottom: 1px solid ", ";\n border-color: ", ";\n background-color: ", ";\n position: relative;\n z-index: ", ";\n color: ", ";\n }\n }\n }\n :not(.", ") .", " {\n .", " {\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, tableOverflowShadowWidth, 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, getBooleanFF('platform.editor.custom-table-width') ? akEditorTableToolbarSize + akEditorTableNumberColumnWidth + 1 : akEditorTableToolbarSize + akEditorTableNumberColumnWidth, ClassName.ROW_CONTROLS, ClassName.CONTROLS_BUTTON, ClassName.IS_RESIZING, ClassName.CONTROLS_CORNER_BUTTON, tableBorderSelectedColor(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, getBooleanFF('platform.editor.custom-table-width') ? akEditorTableToolbarSize : 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, getBooleanFF('platform.editor.custom-table-width') ? 0 : 1, 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);
|
|
@@ -98,6 +98,7 @@ export var stickyRowZIndex = resizeHandlerZIndex + 2;
|
|
|
98
98
|
export var stickyRowOffsetTop = 8;
|
|
99
99
|
export var stickyHeaderBorderBottomWidth = 1;
|
|
100
100
|
export var tableOverflowShadowWidth = 8;
|
|
101
|
+
export var tableOverflowShadowWidthWide = 32;
|
|
101
102
|
export var TABLE_SNAP_GAP = 9;
|
|
102
103
|
export var TABLE_HIGHLIGHT_GAP = 10;
|
|
103
104
|
export var TABLE_HIGHLIGHT_TOLERANCE = 2;
|
|
@@ -7,7 +7,7 @@ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
|
7
7
|
import { B300, N0, N300, N40A, N60A, Y200, Y50 } from '@atlaskit/theme/colors';
|
|
8
8
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
9
9
|
import { TableCssClassName as ClassName } from '../types';
|
|
10
|
-
import { columnControlsDecorationHeight, columnControlsSelectedZIndex, columnControlsZIndex, lineMarkerSize, resizeHandlerAreaWidth, resizeHandlerZIndex, resizeLineWidth, tableBorderColor, tableBorderDeleteColor, tableBorderSelectedColor, tableCellDeleteColor, tableCellHoverDeleteIconBackground, tableCellHoverDeleteIconColor, tableCellSelectedDeleteIconBackground, tableCellSelectedDeleteIconColor, tableDeleteButtonSize, tableHeaderCellBackgroundColor, tableInsertColumnButtonSize, tableOverflowShadowWidth, tableToolbarDeleteColor, tableToolbarSelectedColor, tableToolbarSize } from './consts';
|
|
10
|
+
import { columnControlsDecorationHeight, columnControlsSelectedZIndex, columnControlsZIndex, lineMarkerSize, resizeHandlerAreaWidth, resizeHandlerZIndex, resizeLineWidth, tableBorderColor, tableBorderDeleteColor, tableBorderSelectedColor, tableCellDeleteColor, tableCellHoverDeleteIconBackground, tableCellHoverDeleteIconColor, tableCellSelectedDeleteIconBackground, tableCellSelectedDeleteIconColor, tableDeleteButtonSize, tableHeaderCellBackgroundColor, tableInsertColumnButtonSize, tableOverflowShadowWidth, tableOverflowShadowWidthWide, tableToolbarDeleteColor, tableToolbarSelectedColor, tableToolbarSize } from './consts';
|
|
11
11
|
var InsertLine = function InsertLine(props, cssString) {
|
|
12
12
|
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " {\n background: ", ";\n display: none;\n position: absolute;\n z-index: ", ";\n ", "\n }\n"])), ClassName.CONTROLS_INSERT_LINE, tableBorderSelectedColor(props), akEditorUnitZIndex, cssString);
|
|
13
13
|
};
|
|
@@ -48,7 +48,7 @@ export var DeleteButton = function DeleteButton(props) {
|
|
|
48
48
|
return css(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n .", ",\n .", " {\n height: ", "px;\n width: ", "px;\n }\n .", " {\n .", " {\n ", "\n }\n }\n\n .", ":hover {\n background: ", ";\n color: ", ";\n cursor: pointer;\n }\n"])), ClassName.CONTROLS_DELETE_BUTTON_WRAP, ClassName.CONTROLS_DELETE_BUTTON, tableDeleteButtonSize, tableDeleteButtonSize, ClassName.CONTROLS_DELETE_BUTTON_WRAP, ClassName.CONTROLS_DELETE_BUTTON, Button("\n background: ".concat(tableCellSelectedDeleteIconBackground(props), ";\n color: ").concat(tableCellSelectedDeleteIconColor(props), ";\n ")), ClassName.CONTROLS_DELETE_BUTTON, tableCellHoverDeleteIconBackground(props), tableCellHoverDeleteIconColor(props));
|
|
49
49
|
};
|
|
50
50
|
export var OverflowShadow = function OverflowShadow(props) {
|
|
51
|
-
return css(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n .", ", .", " {\n display: block;\n height: calc(100% - ", "px);\n position: absolute;\n pointer-events: none;\n top: ", "px;\n z-index: ", ";\n width: ", "px;\n }\n .", " {\n background: linear-gradient(\n to left,\n transparent 0,\n ", "
|
|
51
|
+
return css(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n .", ", .", " {\n display: block;\n height: calc(100% - ", "px);\n position: absolute;\n pointer-events: none;\n top: ", "px;\n z-index: ", ";\n width: ", "px;\n }\n .", " {\n background: linear-gradient(\n to left,\n transparent 0,\n ", "\n ", "%\n ),\n linear-gradient(\n to right,\n ", " 0px,\n transparent 1px\n );\n left: 0px;\n }\n .", "[data-number-column='true'] > :not(.", ").", " {\n left: ", "px;\n }\n .", " {\n background: linear-gradient(\n to right,\n transparent 0,\n ", "\n ", "%\n ),\n linear-gradient(\n to left,\n ", " 0px,\n transparent 1px\n );\n left: ", ";\n }\n .", " {\n .", ", .", " {\n height: calc(100% - ", "px);\n top: ", "px;\n }\n .", " {\n border-left: 1px solid ", ";\n }\n }\n"])), ClassName.TABLE_RIGHT_SHADOW, ClassName.TABLE_LEFT_SHADOW, tableMarginTop, tableMarginTop, akEditorShadowZIndex, getBooleanFF('platform.editor.table.increase-shadow-visibility_lh89r') ? tableOverflowShadowWidthWide : tableOverflowShadowWidth, ClassName.TABLE_LEFT_SHADOW, "var(--ds-shadow-overflow-spread, ".concat(N40A, ")"), getBooleanFF('platform.editor.table.increase-shadow-visibility_lh89r') ? 140 : 100, "var(--ds-shadow-overflow-perimeter, transparent)", ClassName.TABLE_CONTAINER, ClassName.TABLE_STICKY_SHADOW, ClassName.TABLE_LEFT_SHADOW, akEditorTableNumberColumnWidth - 1, ClassName.TABLE_RIGHT_SHADOW, "var(--ds-shadow-overflow-spread, ".concat(N40A, ")"), getBooleanFF('platform.editor.table.increase-shadow-visibility_lh89r') ? 140 : 100, "var(--ds-shadow-overflow-perimeter, transparent)", getBooleanFF('platform.editor.custom-table-width') ? "calc(100% - ".concat(getBooleanFF('platform.editor.table.increase-shadow-visibility_lh89r') ? tableOverflowShadowWidthWide : tableOverflowShadowWidth, "px)") : "calc(100% - ".concat(getBooleanFF('platform.editor.table.increase-shadow-visibility_lh89r') ? tableOverflowShadowWidthWide - 10 : -2, "px)"), ClassName.WITH_CONTROLS, ClassName.TABLE_RIGHT_SHADOW, ClassName.TABLE_LEFT_SHADOW, tableMarginTopWithControl, tableMarginTopWithControl, ClassName.TABLE_LEFT_SHADOW, tableBorderColor(props));
|
|
52
52
|
};
|
|
53
53
|
var columnHeaderButton = function columnHeaderButton(props, cssString) {
|
|
54
54
|
return css(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["\n background: ", ";\n border: 1px solid ", ";\n display: block;\n box-sizing: border-box;\n padding: 0;\n\n :focus {\n outline: none;\n }\n\n ", "\n"])), tableHeaderCellBackgroundColor(props), tableBorderColor(props), cssString);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { Command } from '@atlaskit/editor-common/types';
|
|
2
|
-
import type {
|
|
3
|
-
import {
|
|
4
|
-
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
1
|
+
import type { Command, GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
4
|
export declare function addColumnAt(getEditorContainerWidth: GetEditorContainerWidth): (column: number, allowAddColumnCustomStep: boolean | undefined, view: EditorView | undefined) => (tr: Transaction) => Transaction;
|
|
6
5
|
export declare const addColumnBefore: (getEditorContainerWidth: GetEditorContainerWidth) => Command;
|
|
7
6
|
export declare const addColumnAfter: (getEditorContainerWidth: GetEditorContainerWidth) => Command;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TableLayout } from '@atlaskit/adf-schema';
|
|
2
|
-
import { Command } from '@atlaskit/editor-common/types';
|
|
1
|
+
import type { TableLayout } from '@atlaskit/adf-schema';
|
|
2
|
+
import type { Command } from '@atlaskit/editor-common/types';
|
|
3
3
|
/**
|
|
4
4
|
* Table layout toggle logic
|
|
5
5
|
* default -> wide -> full-width -> default
|
|
@@ -43,10 +43,12 @@ declare class TableComponent extends React.Component<ComponentProps, TableState>
|
|
|
43
43
|
private containerWidth?;
|
|
44
44
|
private layoutSize?;
|
|
45
45
|
private overflowShadowsObserver?;
|
|
46
|
+
private isInitialOverflowSent;
|
|
47
|
+
private initialOverflowCaptureTimerId?;
|
|
46
48
|
constructor(props: ComponentProps);
|
|
47
49
|
componentDidMount(): void;
|
|
48
50
|
componentWillUnmount(): void;
|
|
49
|
-
componentDidUpdate(): void;
|
|
51
|
+
componentDidUpdate(_: any, prevState: TableState): void;
|
|
50
52
|
private updateShadowState;
|
|
51
53
|
private createShadowSentinels;
|
|
52
54
|
onStickyState: (state: StickyPluginState) => void;
|
|
@@ -55,6 +57,7 @@ declare class TableComponent extends React.Component<ComponentProps, TableState>
|
|
|
55
57
|
private handleScroll;
|
|
56
58
|
private handleTableResizing;
|
|
57
59
|
private scaleTable;
|
|
60
|
+
private setTimerToSendInitialOverflowCaptured;
|
|
58
61
|
private handleAutoSize;
|
|
59
62
|
private handleWindowResize;
|
|
60
63
|
private getParentNodeWidth;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A plugin is created for collecting payload data for tableOverflowChanged analytics event
|
|
3
|
+
*/
|
|
4
|
+
import { TABLE_OVERFLOW_CHANGE_TRIGGER } from '@atlaskit/editor-common/analytics';
|
|
5
|
+
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
6
|
+
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
7
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
8
|
+
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
9
|
+
interface LastTrigger {
|
|
10
|
+
name: TABLE_OVERFLOW_CHANGE_TRIGGER;
|
|
11
|
+
}
|
|
12
|
+
type TableAnalyticsPluginState = {
|
|
13
|
+
lastTrigger: LastTrigger | undefined;
|
|
14
|
+
};
|
|
15
|
+
export declare const pluginKey: PluginKey<TableAnalyticsPluginState>;
|
|
16
|
+
export declare const META_KEYS: {
|
|
17
|
+
OVERFLOW_TRIGGER: string;
|
|
18
|
+
OVERFLOW_STATE_CHANGED: string;
|
|
19
|
+
};
|
|
20
|
+
declare const createPlugin: (dispatch: Dispatch, dispatchAnalyticsEvent: DispatchAnalyticsEvent, tableResizingEnabled: boolean) => SafePlugin<{
|
|
21
|
+
lastTrigger: undefined;
|
|
22
|
+
}>;
|
|
23
|
+
export { createPlugin };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Command } from '@atlaskit/editor-common/types';
|
|
2
|
-
import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
-
import { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
import { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
5
|
-
import { ResizeState } from './utils';
|
|
2
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
import type { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
5
|
+
import type { ResizeState } from './utils';
|
|
6
6
|
export declare const evenColumns: ({ resizeState, table, start, event, }: {
|
|
7
7
|
resizeState: ResizeState;
|
|
8
8
|
table: PMNode;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import { Rect } from '@atlaskit/editor-tables/table-map';
|
|
1
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import type { Rect } from '@atlaskit/editor-tables/table-map';
|
|
3
3
|
export declare const deleteColumns: (rect: Rect, allowAddColumnCustomStep?: boolean) => (tr: Transaction) => Transaction;
|
|
@@ -43,6 +43,7 @@ export declare const stickyRowZIndex: number;
|
|
|
43
43
|
export declare const stickyRowOffsetTop = 8;
|
|
44
44
|
export declare const stickyHeaderBorderBottomWidth = 1;
|
|
45
45
|
export declare const tableOverflowShadowWidth = 8;
|
|
46
|
+
export declare const tableOverflowShadowWidthWide = 32;
|
|
46
47
|
export declare const TABLE_SNAP_GAP = 9;
|
|
47
48
|
export declare const TABLE_HIGHLIGHT_GAP = 10;
|
|
48
49
|
export declare const TABLE_HIGHLIGHT_TOLERANCE = 2;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { Command } from '@atlaskit/editor-common/types';
|
|
2
|
-
import type {
|
|
3
|
-
import {
|
|
4
|
-
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
1
|
+
import type { Command, GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
4
|
export declare function addColumnAt(getEditorContainerWidth: GetEditorContainerWidth): (column: number, allowAddColumnCustomStep: boolean | undefined, view: EditorView | undefined) => (tr: Transaction) => Transaction;
|
|
6
5
|
export declare const addColumnBefore: (getEditorContainerWidth: GetEditorContainerWidth) => Command;
|
|
7
6
|
export declare const addColumnAfter: (getEditorContainerWidth: GetEditorContainerWidth) => Command;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TableLayout } from '@atlaskit/adf-schema';
|
|
2
|
-
import { Command } from '@atlaskit/editor-common/types';
|
|
1
|
+
import type { TableLayout } from '@atlaskit/adf-schema';
|
|
2
|
+
import type { Command } from '@atlaskit/editor-common/types';
|
|
3
3
|
/**
|
|
4
4
|
* Table layout toggle logic
|
|
5
5
|
* default -> wide -> full-width -> default
|
|
@@ -43,10 +43,12 @@ declare class TableComponent extends React.Component<ComponentProps, TableState>
|
|
|
43
43
|
private containerWidth?;
|
|
44
44
|
private layoutSize?;
|
|
45
45
|
private overflowShadowsObserver?;
|
|
46
|
+
private isInitialOverflowSent;
|
|
47
|
+
private initialOverflowCaptureTimerId?;
|
|
46
48
|
constructor(props: ComponentProps);
|
|
47
49
|
componentDidMount(): void;
|
|
48
50
|
componentWillUnmount(): void;
|
|
49
|
-
componentDidUpdate(): void;
|
|
51
|
+
componentDidUpdate(_: any, prevState: TableState): void;
|
|
50
52
|
private updateShadowState;
|
|
51
53
|
private createShadowSentinels;
|
|
52
54
|
onStickyState: (state: StickyPluginState) => void;
|
|
@@ -55,6 +57,7 @@ declare class TableComponent extends React.Component<ComponentProps, TableState>
|
|
|
55
57
|
private handleScroll;
|
|
56
58
|
private handleTableResizing;
|
|
57
59
|
private scaleTable;
|
|
60
|
+
private setTimerToSendInitialOverflowCaptured;
|
|
58
61
|
private handleAutoSize;
|
|
59
62
|
private handleWindowResize;
|
|
60
63
|
private getParentNodeWidth;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A plugin is created for collecting payload data for tableOverflowChanged analytics event
|
|
3
|
+
*/
|
|
4
|
+
import { TABLE_OVERFLOW_CHANGE_TRIGGER } from '@atlaskit/editor-common/analytics';
|
|
5
|
+
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
6
|
+
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
7
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
8
|
+
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
9
|
+
interface LastTrigger {
|
|
10
|
+
name: TABLE_OVERFLOW_CHANGE_TRIGGER;
|
|
11
|
+
}
|
|
12
|
+
type TableAnalyticsPluginState = {
|
|
13
|
+
lastTrigger: LastTrigger | undefined;
|
|
14
|
+
};
|
|
15
|
+
export declare const pluginKey: PluginKey<TableAnalyticsPluginState>;
|
|
16
|
+
export declare const META_KEYS: {
|
|
17
|
+
OVERFLOW_TRIGGER: string;
|
|
18
|
+
OVERFLOW_STATE_CHANGED: string;
|
|
19
|
+
};
|
|
20
|
+
declare const createPlugin: (dispatch: Dispatch, dispatchAnalyticsEvent: DispatchAnalyticsEvent, tableResizingEnabled: boolean) => SafePlugin<{
|
|
21
|
+
lastTrigger: undefined;
|
|
22
|
+
}>;
|
|
23
|
+
export { createPlugin };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Command } from '@atlaskit/editor-common/types';
|
|
2
|
-
import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
-
import { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
import { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
5
|
-
import { ResizeState } from './utils';
|
|
2
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
import type { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
5
|
+
import type { ResizeState } from './utils';
|
|
6
6
|
export declare const evenColumns: ({ resizeState, table, start, event, }: {
|
|
7
7
|
resizeState: ResizeState;
|
|
8
8
|
table: PMNode;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import { Rect } from '@atlaskit/editor-tables/table-map';
|
|
1
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import type { Rect } from '@atlaskit/editor-tables/table-map';
|
|
3
3
|
export declare const deleteColumns: (rect: Rect, allowAddColumnCustomStep?: boolean) => (tr: Transaction) => Transaction;
|
|
@@ -43,6 +43,7 @@ export declare const stickyRowZIndex: number;
|
|
|
43
43
|
export declare const stickyRowOffsetTop = 8;
|
|
44
44
|
export declare const stickyHeaderBorderBottomWidth = 1;
|
|
45
45
|
export declare const tableOverflowShadowWidth = 8;
|
|
46
|
+
export declare const tableOverflowShadowWidthWide = 32;
|
|
46
47
|
export declare const TABLE_SNAP_GAP = 9;
|
|
47
48
|
export declare const TABLE_HIGHLIGHT_GAP = 10;
|
|
48
49
|
export declare const TABLE_HIGHLIGHT_TOLERANCE = 2;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.1",
|
|
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": "^29.1.0",
|
|
31
|
-
"@atlaskit/editor-common": "^75.
|
|
31
|
+
"@atlaskit/editor-common": "^75.5.0",
|
|
32
32
|
"@atlaskit/editor-palette": "1.5.1",
|
|
33
33
|
"@atlaskit/editor-plugin-analytics": "^0.2.0",
|
|
34
34
|
"@atlaskit/editor-plugin-content-insertion": "^0.1.0",
|
|
@@ -110,6 +110,12 @@
|
|
|
110
110
|
},
|
|
111
111
|
"platform.editor.table-remove-update-resize-handles_djvab": {
|
|
112
112
|
"type": "boolean"
|
|
113
|
+
},
|
|
114
|
+
"platform.editor.table.overflow-state-analytics": {
|
|
115
|
+
"type": "boolean"
|
|
116
|
+
},
|
|
117
|
+
"platform.editor.table.increase-shadow-visibility_lh89r": {
|
|
118
|
+
"type": "boolean"
|
|
113
119
|
}
|
|
114
120
|
}
|
|
115
121
|
}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
// #region Imports
|
|
2
2
|
import { AddColumnStep } from '@atlaskit/adf-schema/steps';
|
|
3
|
-
import {
|
|
4
|
-
import type {
|
|
5
|
-
|
|
3
|
+
import { TABLE_OVERFLOW_CHANGE_TRIGGER } from '@atlaskit/editor-common/analytics';
|
|
4
|
+
import type {
|
|
5
|
+
Command,
|
|
6
|
+
GetEditorContainerWidth,
|
|
7
|
+
} from '@atlaskit/editor-common/types';
|
|
8
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
9
|
+
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
6
10
|
import { safeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
7
|
-
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
11
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
8
12
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
9
13
|
import {
|
|
10
14
|
addColumnAt as addColumnAtPMUtils,
|
|
@@ -14,6 +18,7 @@ import {
|
|
|
14
18
|
selectedRect,
|
|
15
19
|
} from '@atlaskit/editor-tables/utils';
|
|
16
20
|
|
|
21
|
+
import { META_KEYS } from '../pm-plugins/table-analytics';
|
|
17
22
|
import { rescaleColumns } from '../transforms/column-width';
|
|
18
23
|
import { checkIfHeaderRowEnabled, copyPreviousRow } from '../utils';
|
|
19
24
|
import { getAllowAddColumnCustomStep } from '../utils/get-allow-add-column-custom-step';
|
|
@@ -50,6 +55,9 @@ export function addColumnAt(getEditorContainerWidth: GetEditorContainerWidth) {
|
|
|
50
55
|
updatedTr,
|
|
51
56
|
);
|
|
52
57
|
}
|
|
58
|
+
updatedTr.setMeta(META_KEYS.OVERFLOW_TRIGGER, {
|
|
59
|
+
name: TABLE_OVERFLOW_CHANGE_TRIGGER.ADDED_COLUMN,
|
|
60
|
+
});
|
|
53
61
|
return updatedTr;
|
|
54
62
|
};
|
|
55
63
|
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
//#region Imports
|
|
2
2
|
|
|
3
|
-
import { TableLayout } from '@atlaskit/adf-schema';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import type { TableLayout } from '@atlaskit/adf-schema';
|
|
4
|
+
import { TABLE_OVERFLOW_CHANGE_TRIGGER } from '@atlaskit/editor-common/analytics';
|
|
5
|
+
import type { Command } from '@atlaskit/editor-common/types';
|
|
6
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
6
7
|
import { findTable, toggleHeader } from '@atlaskit/editor-tables/utils';
|
|
7
8
|
|
|
8
9
|
import { createCommand } from '../pm-plugins/plugin-factory';
|
|
10
|
+
import { META_KEYS } from '../pm-plugins/table-analytics';
|
|
9
11
|
//#endregion
|
|
10
12
|
|
|
11
13
|
// #region Utils
|
|
@@ -45,13 +47,21 @@ export const toggleHeaderColumn: Command = (state, dispatch): boolean =>
|
|
|
45
47
|
export const toggleNumberColumn: Command = (state, dispatch) => {
|
|
46
48
|
const { tr } = state;
|
|
47
49
|
const { node, pos } = findTable(state.selection)!;
|
|
50
|
+
const isNumberedColumnEnabled = node.attrs.isNumberColumnEnabled;
|
|
48
51
|
|
|
49
52
|
tr.setNodeMarkup(pos, state.schema.nodes.table, {
|
|
50
53
|
...node.attrs,
|
|
51
|
-
isNumberColumnEnabled: !
|
|
54
|
+
isNumberColumnEnabled: !isNumberedColumnEnabled,
|
|
52
55
|
});
|
|
53
56
|
tr.setMeta('scrollIntoView', false);
|
|
54
57
|
|
|
58
|
+
const tableOverflowChangeTriggerName = isNumberedColumnEnabled
|
|
59
|
+
? TABLE_OVERFLOW_CHANGE_TRIGGER.DISABLED_NUMBERED_COLUMN
|
|
60
|
+
: TABLE_OVERFLOW_CHANGE_TRIGGER.ENABLED_NUMBERED_COLUMN;
|
|
61
|
+
tr.setMeta(META_KEYS.OVERFLOW_TRIGGER, {
|
|
62
|
+
name: tableOverflowChangeTriggerName,
|
|
63
|
+
});
|
|
64
|
+
|
|
55
65
|
if (dispatch) {
|
|
56
66
|
dispatch(tr);
|
|
57
67
|
}
|
|
@@ -77,6 +87,9 @@ export const toggleTableLayout: Command = (state, dispatch): boolean => {
|
|
|
77
87
|
...table.node.attrs,
|
|
78
88
|
layout,
|
|
79
89
|
});
|
|
90
|
+
tr.setMeta(META_KEYS.OVERFLOW_TRIGGER, {
|
|
91
|
+
name: TABLE_OVERFLOW_CHANGE_TRIGGER.RESIZED,
|
|
92
|
+
});
|
|
80
93
|
return tr.setMeta('scrollIntoView', false);
|
|
81
94
|
},
|
|
82
95
|
)(state, dispatch);
|
|
@@ -41,6 +41,7 @@ import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
|
41
41
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
42
42
|
import { tableEditing } from '@atlaskit/editor-tables/pm-plugins';
|
|
43
43
|
import { createTable } from '@atlaskit/editor-tables/utils';
|
|
44
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
44
45
|
|
|
45
46
|
import { pluginConfig } from './create-plugin-config';
|
|
46
47
|
import { createPlugin as createDecorationsPlugin } from './pm-plugins/decorations/plugin';
|
|
@@ -53,6 +54,10 @@ import {
|
|
|
53
54
|
findStickyHeaderForTable,
|
|
54
55
|
pluginKey as stickyHeadersPluginKey,
|
|
55
56
|
} from './pm-plugins/sticky-headers';
|
|
57
|
+
import {
|
|
58
|
+
createPlugin as createTableAnalyticsPlugin,
|
|
59
|
+
pluginKey as tableAnalyticsPluginKey,
|
|
60
|
+
} from './pm-plugins/table-analytics';
|
|
56
61
|
import { createPlugin as createTableLocalIdPlugin } from './pm-plugins/table-local-id';
|
|
57
62
|
import {
|
|
58
63
|
createPlugin as createFlexiResizingPlugin,
|
|
@@ -290,7 +295,17 @@ const tablesPlugin: TablePlugin = ({ config: options, api }) => {
|
|
|
290
295
|
)
|
|
291
296
|
: undefined,
|
|
292
297
|
},
|
|
293
|
-
|
|
298
|
+
{
|
|
299
|
+
name: 'tableAnalyticsPlugin',
|
|
300
|
+
plugin: ({ dispatch, dispatchAnalyticsEvent }) =>
|
|
301
|
+
getBooleanFF('platform.editor.table.overflow-state-analytics')
|
|
302
|
+
? createTableAnalyticsPlugin(
|
|
303
|
+
dispatch,
|
|
304
|
+
dispatchAnalyticsEvent,
|
|
305
|
+
options?.tableResizingEnabled ?? false,
|
|
306
|
+
)
|
|
307
|
+
: undefined,
|
|
308
|
+
},
|
|
294
309
|
{
|
|
295
310
|
name: 'tableGetEditorViewReferencePlugin',
|
|
296
311
|
plugin: () => {
|
|
@@ -337,6 +352,7 @@ const tablesPlugin: TablePlugin = ({ config: options, api }) => {
|
|
|
337
352
|
>
|
|
338
353
|
<WithPluginState
|
|
339
354
|
plugins={{
|
|
355
|
+
tableAnalyticsPluginState: tableAnalyticsPluginKey,
|
|
340
356
|
tablePluginState: pluginKey,
|
|
341
357
|
tableWidthPluginState: tableWidthPluginKey,
|
|
342
358
|
tableResizingPluginState: tableResizingPluginKey,
|