@atlaskit/editor-plugin-table 5.3.15 → 5.3.16
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 +8 -0
- package/dist/cjs/plugins/table/event-handlers.js +4 -3
- package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/plugin.js +1 -0
- package/dist/cjs/plugins/table/types.js +5 -3
- package/dist/cjs/plugins/table/ui/FloatingInsertButton/index.js +5 -0
- package/dist/cjs/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.js +3 -11
- package/dist/cjs/plugins/table/ui/TableFloatingColumnControls/ColumnDropTargets/index.js +2 -2
- package/dist/cjs/plugins/table/ui/TableFloatingColumnControls/index.js +1 -1
- package/dist/cjs/plugins/table/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +114 -0
- package/dist/cjs/plugins/table/ui/TableFloatingControls/CornerControls/DragCornerControls.js +60 -0
- package/dist/cjs/plugins/table/ui/TableFloatingControls/CornerControls/index.js +11 -112
- package/dist/cjs/plugins/table/ui/TableFloatingControls/CornerControls/types.js +5 -0
- package/dist/cjs/plugins/table/ui/TableFloatingControls/RowControls/DragControls.js +1 -7
- package/dist/cjs/plugins/table/ui/TableFloatingControls/index.js +7 -2
- package/dist/cjs/plugins/table/ui/common-styles.js +1 -1
- package/dist/cjs/plugins/table/ui/messages.js +5 -0
- package/dist/cjs/plugins/table/ui/ui-styles.js +28 -25
- package/dist/cjs/plugins/table/utils/dom.js +16 -7
- package/dist/cjs/plugins/table/utils/index.js +12 -6
- package/dist/es2019/plugins/table/event-handlers.js +5 -4
- package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/plugin.js +2 -1
- package/dist/es2019/plugins/table/types.js +5 -3
- package/dist/es2019/plugins/table/ui/FloatingInsertButton/index.js +5 -0
- package/dist/es2019/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.js +3 -11
- package/dist/es2019/plugins/table/ui/TableFloatingColumnControls/ColumnDropTargets/index.js +2 -2
- package/dist/es2019/plugins/table/ui/TableFloatingColumnControls/index.js +1 -1
- package/dist/es2019/plugins/table/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +93 -0
- package/dist/es2019/plugins/table/ui/TableFloatingControls/CornerControls/DragCornerControls.js +61 -0
- package/dist/es2019/plugins/table/ui/TableFloatingControls/CornerControls/index.js +2 -99
- package/dist/es2019/plugins/table/ui/TableFloatingControls/CornerControls/types.js +1 -0
- package/dist/es2019/plugins/table/ui/TableFloatingControls/RowControls/DragControls.js +1 -7
- package/dist/es2019/plugins/table/ui/TableFloatingControls/index.js +8 -3
- package/dist/es2019/plugins/table/ui/common-styles.js +8 -6
- package/dist/es2019/plugins/table/ui/messages.js +5 -0
- package/dist/es2019/plugins/table/ui/ui-styles.js +44 -3
- package/dist/es2019/plugins/table/utils/dom.js +13 -6
- package/dist/es2019/plugins/table/utils/index.js +1 -1
- package/dist/esm/plugins/table/event-handlers.js +5 -4
- package/dist/esm/plugins/table/pm-plugins/drag-and-drop/plugin.js +2 -1
- package/dist/esm/plugins/table/types.js +5 -3
- package/dist/esm/plugins/table/ui/FloatingInsertButton/index.js +5 -0
- package/dist/esm/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.js +3 -11
- package/dist/esm/plugins/table/ui/TableFloatingColumnControls/ColumnDropTargets/index.js +2 -2
- package/dist/esm/plugins/table/ui/TableFloatingColumnControls/index.js +1 -1
- package/dist/esm/plugins/table/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +104 -0
- package/dist/esm/plugins/table/ui/TableFloatingControls/CornerControls/DragCornerControls.js +50 -0
- package/dist/esm/plugins/table/ui/TableFloatingControls/CornerControls/index.js +2 -110
- package/dist/esm/plugins/table/ui/TableFloatingControls/CornerControls/types.js +1 -0
- package/dist/esm/plugins/table/ui/TableFloatingControls/RowControls/DragControls.js +1 -7
- package/dist/esm/plugins/table/ui/TableFloatingControls/index.js +8 -3
- package/dist/esm/plugins/table/ui/common-styles.js +2 -2
- package/dist/esm/plugins/table/ui/messages.js +5 -0
- package/dist/esm/plugins/table/ui/ui-styles.js +27 -24
- package/dist/esm/plugins/table/utils/dom.js +15 -6
- package/dist/esm/plugins/table/utils/index.js +1 -1
- package/dist/types/plugins/table/types.d.ts +5 -3
- package/dist/types/plugins/table/ui/TableFloatingControls/CornerControls/ClassicCornerControls.d.ts +6 -0
- package/dist/types/plugins/table/ui/TableFloatingControls/CornerControls/DragCornerControls.d.ts +6 -0
- package/dist/types/plugins/table/ui/TableFloatingControls/CornerControls/index.d.ts +2 -16
- package/dist/types/plugins/table/ui/TableFloatingControls/CornerControls/types.d.ts +11 -0
- package/dist/types/plugins/table/ui/messages.d.ts +5 -0
- package/dist/types/plugins/table/ui/ui-styles.d.ts +1 -0
- package/dist/types/plugins/table/utils/dom.d.ts +3 -2
- package/dist/types/plugins/table/utils/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/types.d.ts +5 -3
- package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/CornerControls/ClassicCornerControls.d.ts +6 -0
- package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/CornerControls/DragCornerControls.d.ts +6 -0
- package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/CornerControls/index.d.ts +2 -16
- package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/CornerControls/types.d.ts +11 -0
- package/dist/types-ts4.5/plugins/table/ui/messages.d.ts +5 -0
- package/dist/types-ts4.5/plugins/table/ui/ui-styles.d.ts +1 -0
- package/dist/types-ts4.5/plugins/table/utils/dom.d.ts +3 -2
- package/dist/types-ts4.5/plugins/table/utils/index.d.ts +1 -1
- package/package.json +2 -2
- package/src/plugins/table/event-handlers.ts +7 -2
- package/src/plugins/table/pm-plugins/drag-and-drop/plugin.ts +7 -1
- package/src/plugins/table/types.ts +7 -4
- package/src/plugins/table/ui/FloatingInsertButton/index.tsx +8 -0
- package/src/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.tsx +5 -7
- package/src/plugins/table/ui/TableFloatingColumnControls/ColumnDropTargets/index.tsx +2 -2
- package/src/plugins/table/ui/TableFloatingColumnControls/index.tsx +1 -1
- package/src/plugins/table/ui/TableFloatingControls/CornerControls/ClassicCornerControls.tsx +107 -0
- package/src/plugins/table/ui/TableFloatingControls/CornerControls/DragCornerControls.tsx +66 -0
- package/src/plugins/table/ui/TableFloatingControls/CornerControls/index.tsx +2 -125
- package/src/plugins/table/ui/TableFloatingControls/CornerControls/types.ts +12 -0
- package/src/plugins/table/ui/TableFloatingControls/RowControls/DragControls.tsx +3 -3
- package/src/plugins/table/ui/TableFloatingControls/index.tsx +22 -14
- package/src/plugins/table/ui/common-styles.ts +8 -5
- package/src/plugins/table/ui/messages.ts +6 -0
- package/src/plugins/table/ui/ui-styles.ts +45 -3
- package/src/plugins/table/utils/dom.ts +16 -4
- package/src/plugins/table/utils/index.ts +2 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27, _templateObject28, _templateObject29, _templateObject30, _templateObject31, _templateObject32;
|
|
2
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27, _templateObject28, _templateObject29, _templateObject30, _templateObject31, _templateObject32, _templateObject33;
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import { tableCellBorderWidth, tableMarginTop, tableMarginTopWithControl } from '@atlaskit/editor-common/styles';
|
|
5
5
|
import { akEditorShadowZIndex, akEditorTableNumberColumnWidth, akEditorUnitZIndex } from '@atlaskit/editor-shared-styles';
|
|
@@ -36,74 +36,77 @@ var InsertButtonHover = function InsertButtonHover() {
|
|
|
36
36
|
return css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n .", ":hover {\n background: ", ";\n color: ", ";\n cursor: pointer;\n }\n"])), ClassName.CONTROLS_INSERT_BUTTON, "var(--ds-background-brand-bold, ".concat(B300, ")"), "var(--ds-icon-inverse, white)");
|
|
37
37
|
};
|
|
38
38
|
export var dragInsertButtonWrapper = function dragInsertButtonWrapper(props) {
|
|
39
|
-
return css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n .", " {\n position: absolute;\n z-index: ", ";\n bottom: -5px;\n left: 3px;\n }\n .", " {\n ", "\n }\n .", ":hover {\n background: ", ";\n border: 1px solid ", ";\n color: ", ";\n cursor: pointer;\n }\n"])), ClassName.DRAG_CONTROLS_INSERT_BUTTON_INNER, akEditorUnitZIndex + 10, ClassName.DRAG_CONTROLS_INSERT_BUTTON, Button("\n background: ".concat("var(--ds-surface-overlay, white)", ";\n color: ", "var(--ds-icon, ".concat(N300, ")"), ";\n border: 1px solid ", "var(--ds-background-accent-gray-subtler, #C1C7D0)", ";\n border-radius: 50%;\n ")), ClassName.DRAG_CONTROLS_INSERT_BUTTON, "var(--ds-background-brand-bold, ".concat(B300, ")"), "var(--ds-background-brand-bold, ".concat(B300, ")"), "var(--ds-icon-inverse, white)");
|
|
39
|
+
return css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n .", " {\n position: absolute;\n z-index: ", ";\n bottom: -5px;\n left: 3px;\n }\n\n .", " {\n ", "\n }\n\n .", ":hover {\n background: ", ";\n border: 1px solid ", ";\n color: ", ";\n cursor: pointer;\n }\n"])), ClassName.DRAG_CONTROLS_INSERT_BUTTON_INNER, akEditorUnitZIndex + 10, ClassName.DRAG_CONTROLS_INSERT_BUTTON, Button("\n background: ".concat("var(--ds-surface-overlay, white)", ";\n color: ", "var(--ds-icon, ".concat(N300, ")"), ";\n border: 1px solid ", "var(--ds-background-accent-gray-subtler, #C1C7D0)", ";\n border-radius: 50%;\n ")), ClassName.DRAG_CONTROLS_INSERT_BUTTON, "var(--ds-background-brand-bold, ".concat(B300, ")"), "var(--ds-background-brand-bold, ".concat(B300, ")"), "var(--ds-icon-inverse, white)");
|
|
40
|
+
};
|
|
41
|
+
export var dragCornerControlButton = function dragCornerControlButton(props) {
|
|
42
|
+
return css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n .", " {\n width: 12px;\n height: 12px;\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n top: ", ";\n left: ", ";\n background-color: ", ";\n border-radius: 50%;\n border: none;\n padding: 0;\n outline: none;\n z-index: ", ";\n\n &.active .", " {\n background-color: ", ";\n border-color: ", ";\n }\n\n &:hover {\n cursor: pointer;\n\n .", " {\n border-color: ", ";\n }\n }\n }\n\n .", " {\n border: 1px solid\n ", ";\n border-radius: 50%;\n width: 6px;\n height: 6px;\n }\n"])), ClassName.DRAG_CORNER_BUTTON, "var(--ds-space-negative-075, -6px)", "var(--ds-space-075, 6px)", "var(--ds-surface, #FFF)", akEditorUnitZIndex * 99, ClassName.DRAG_CORNER_BUTTON_INNER, "var(--ds-border-selected, #0C66E4)", "var(--ds-border-selected, #0C66E4)", ClassName.DRAG_CORNER_BUTTON_INNER, "var(--ds-border-selected, #0C66E4)", ClassName.DRAG_CORNER_BUTTON_INNER, "var(--ds-background-accent-gray-subtler, #DCDFE4)");
|
|
40
43
|
};
|
|
41
44
|
export var insertColumnButtonWrapper = function insertColumnButtonWrapper(props) {
|
|
42
|
-
return css(
|
|
45
|
+
return css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n ", "\n ", "\n ", "\n"])), InsertButton(), InsertButtonHover(), InsertLine(props, "\n width: 2px;\n left: 9px;\n "));
|
|
43
46
|
};
|
|
44
47
|
export var insertRowButtonWrapper = function insertRowButtonWrapper(props) {
|
|
45
|
-
return css(
|
|
48
|
+
return css(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n ", "\n ", "\n ", "\n"])), InsertButton(), InsertButtonHover(), InsertLine(props, "\n height: 2px;\n top: -11px;\n left: ".concat(tableInsertColumnButtonSize - 1, "px;\n ")));
|
|
46
49
|
};
|
|
47
50
|
export var columnControlsLineMarker = function columnControlsLineMarker() {
|
|
48
|
-
return css(
|
|
51
|
+
return css(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n .", ".", "\n table\n tr:first-of-type\n td,\n .", ".", "\n table\n tr:first-of-type\n th {\n position: relative;\n }\n"])), ClassName.TABLE_CONTAINER, ClassName.WITH_CONTROLS, ClassName.TABLE_CONTAINER, ClassName.WITH_CONTROLS);
|
|
49
52
|
};
|
|
50
53
|
export var DeleteButton = function DeleteButton(props) {
|
|
51
|
-
return css(
|
|
54
|
+
return css(_templateObject15 || (_templateObject15 = _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));
|
|
52
55
|
};
|
|
53
56
|
export var OverflowShadow = function OverflowShadow(props) {
|
|
54
|
-
return css(
|
|
57
|
+
return css(_templateObject16 || (_templateObject16 = _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));
|
|
55
58
|
};
|
|
56
59
|
var columnHeaderButton = function columnHeaderButton(props, cssString) {
|
|
57
60
|
if (getBooleanFF('platform.editor.table.column-controls-styles-updated')) {
|
|
58
|
-
return css(
|
|
61
|
+
return css(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n background: ", ";\n display: block;\n box-sizing: border-box;\n padding: 0;\n\n :focus {\n outline: none;\n }\n\n ", "\n "])), tableHeaderCellBackgroundColor(props), cssString);
|
|
59
62
|
} else {
|
|
60
|
-
return css(
|
|
63
|
+
return css(_templateObject18 || (_templateObject18 = _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);
|
|
61
64
|
}
|
|
62
65
|
};
|
|
63
66
|
var columnHeaderButtonSelected = function columnHeaderButtonSelected(props) {
|
|
64
|
-
return css(
|
|
67
|
+
return css(_templateObject19 || (_templateObject19 = _taggedTemplateLiteral(["\n color: ", ";\n background-color: ", ";\n border-color: ", ";\n z-index: ", ";\n"])), "var(--ds-text-inverse, ".concat(N0, ")"), tableToolbarSelectedColor(props), tableBorderSelectedColor(props), columnControlsSelectedZIndex);
|
|
65
68
|
};
|
|
66
69
|
var getFloatingDotOverrides = function getFloatingDotOverrides(props) {
|
|
67
|
-
return getBooleanFF('platform.editor.custom-table-width') ? css(
|
|
70
|
+
return getBooleanFF('platform.editor.custom-table-width') ? css(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["\n tr\n th:last-child\n .", "::before,\n tr\n td:last-child\n .", "::before {\n content: '';\n background-color: ", ";\n position: absolute;\n height: ", "px;\n width: ", "px;\n border-radius: 50%;\n pointer-events: none;\n top: ", ";\n right: 0px;\n }\n "])), ClassName.COLUMN_CONTROLS_DECORATIONS, ClassName.COLUMN_CONTROLS_DECORATIONS, tableBorderColor(props), lineMarkerSize, lineMarkerSize, "var(--ds-space-025, 2px)") : '';
|
|
68
71
|
};
|
|
69
72
|
export var floatingColumnControls = function floatingColumnControls(props) {
|
|
70
|
-
return css(
|
|
73
|
+
return css(_templateObject21 || (_templateObject21 = _taggedTemplateLiteral(["\n .", " {\n box-sizing: border-box;\n position: absolute;\n top: 0;\n\n .", " {\n display: flex;\n flex-direction: row;\n }\n }\n\n .", " {\n box-sizing: border-box;\n\n .", " {\n display: grid;\n justify-items: center;\n }\n }\n "])), ClassName.DRAG_COLUMN_DROP_TARGET_CONTROLS, ClassName.DRAG_COLUMN_CONTROLS_INNER, ClassName.DRAG_COLUMN_CONTROLS, ClassName.DRAG_COLUMN_CONTROLS_INNER);
|
|
71
74
|
};
|
|
72
75
|
export var rowControlsWrapperDotStyle = function rowControlsWrapperDotStyle(props) {
|
|
73
76
|
if (getBooleanFF('platform.editor.table.drag-and-drop')) {
|
|
74
|
-
return css(
|
|
77
|
+
return css(_templateObject22 || (_templateObject22 = _taggedTemplateLiteral(["\n div.", ">.", "::after {\n display: none;\n }\n "])), ClassName.WITH_CONTROLS, ClassName.ROW_CONTROLS_WRAPPER);
|
|
75
78
|
} else {
|
|
76
|
-
return css(
|
|
79
|
+
return css(_templateObject23 || (_templateObject23 = _taggedTemplateLiteral(["\n div.", ">.", "::after {\n content: ' ';\n background-color: ", ";\n position: absolute;\n height: ", "px;\n width: ", "px;\n border-radius: 50%;\n pointer-events: none;\n top: -", "px;\n right: -1px;\n }\n "])), ClassName.WITH_CONTROLS, ClassName.ROW_CONTROLS_WRAPPER, tableBorderColor(props), lineMarkerSize, lineMarkerSize, tableToolbarSize + tableCellBorderWidth);
|
|
77
80
|
}
|
|
78
81
|
};
|
|
79
82
|
export var columnControlsDecoration = function columnControlsDecoration(props) {
|
|
80
83
|
if (getBooleanFF('platform.editor.table.column-controls-styles-updated')) {
|
|
81
|
-
return css(
|
|
84
|
+
return css(_templateObject24 || (_templateObject24 = _taggedTemplateLiteral(["\n .", " {\n display: none;\n cursor: pointer;\n position: absolute;\n width: 100%;\n left: 0;\n top: -", "px;\n height: ", "px;\n // floating dot for adding column button\n &::before {\n content: ' ';\n background-color: ", ";\n position: absolute;\n height: ", "px;\n width: ", "px;\n border-radius: 50%;\n pointer-events: none;\n top: 2px;\n right: -1px;\n }\n\n &::after {\n content: ' ';\n\n ", "\n }\n }\n\n // floating dot for adding column button - overriding style on last column to avoid scroll\n ", "\n\n .", " .", " {\n display: block;\n }\n\n table tr:first-of-type th.", " {\n &.", ", &.", " {\n .", "::after {\n ", ";\n }\n\n &.", "\n .", "::after {\n background-color: ", ";\n border-color: ", ";\n z-index: ", ";\n }\n }\n }\n\n table tr:first-of-type th.", " {\n &.", ", &.", " {\n .", "::after {\n ", ";\n border-left: ", "px solid\n ", ";\n left: -", "px;\n }\n }\n }\n\n table tr:first-of-type th.", " {\n &.", " {\n .", "::after {\n ", ";\n }\n\n &.", "\n .", "::after {\n background-color: ", ";\n border-color: ", ";\n border-left: ", "px solid\n ", ";\n left: -", "px;\n z-index: ", ";\n }\n }\n }\n\n .", "\n table\n tr:first-of-type\n td.", ",\n .", "\n table\n tr:first-of-type\n th.", " {\n .", "::after {\n ", ";\n }\n }\n "])), ClassName.COLUMN_CONTROLS_DECORATIONS, columnControlsDecorationHeight + tableCellBorderWidth, columnControlsDecorationHeight, tableBorderColor(props), lineMarkerSize, lineMarkerSize, columnHeaderButton(props, "\n border-right: ".concat(tableCellBorderWidth, "px solid ").concat(tableBorderColor(props), ";\n border-top: ").concat(tableCellBorderWidth, "px solid ").concat(tableBorderColor(props), ";\n border-bottom: ").concat(tableCellBorderWidth, "px solid ").concat(tableBorderColor(props), ";\n box-sizing: content-box;\n height: ").concat(tableToolbarSize - 1, "px;\n width: 100%;\n position: absolute;\n top: ").concat(columnControlsDecorationHeight - tableToolbarSize, "px;\n left: 0px;\n z-index: ").concat(columnControlsZIndex, ";\n ")), getFloatingDotOverrides(props), ClassName.WITH_CONTROLS, ClassName.COLUMN_CONTROLS_DECORATIONS, ClassName.TABLE_HEADER_CELL, ClassName.COLUMN_SELECTED, ClassName.HOVERED_TABLE, ClassName.COLUMN_CONTROLS_DECORATIONS, columnHeaderButtonSelected(props), ClassName.HOVERED_CELL_IN_DANGER, ClassName.COLUMN_CONTROLS_DECORATIONS, tableToolbarDeleteColor(props), tableBorderDeleteColor(props), akEditorUnitZIndex * 100, ClassName.TABLE_HEADER_CELL, ClassName.COLUMN_SELECTED, ClassName.HOVERED_COLUMN, ClassName.COLUMN_CONTROLS_DECORATIONS, columnHeaderButtonSelected(props), tableCellBorderWidth, tableBorderSelectedColor(props), tableCellBorderWidth, ClassName.TABLE_HEADER_CELL, ClassName.HOVERED_COLUMN, ClassName.COLUMN_CONTROLS_DECORATIONS, columnHeaderButtonSelected(props), ClassName.HOVERED_CELL_IN_DANGER, ClassName.COLUMN_CONTROLS_DECORATIONS, tableToolbarDeleteColor(props), tableBorderDeleteColor(props), tableCellBorderWidth, tableBorderDeleteColor(props), tableCellBorderWidth, akEditorUnitZIndex * 100, ClassName.TABLE_SELECTED, ClassName.TABLE_CELL, ClassName.TABLE_SELECTED, ClassName.TABLE_HEADER_CELL, ClassName.COLUMN_CONTROLS_DECORATIONS, columnHeaderButtonSelected(props));
|
|
82
85
|
} else {
|
|
83
|
-
return css(
|
|
86
|
+
return css(_templateObject25 || (_templateObject25 = _taggedTemplateLiteral(["\n .", " {\n display: none;\n cursor: pointer;\n position: absolute;\n width: calc(100% + ", "px);\n left: -1px;\n top: -", "px;\n height: ", "px;\n // floating dot for adding column button\n &::before {\n content: ' ';\n background-color: ", ";\n position: absolute;\n height: ", "px;\n width: ", "px;\n border-radius: 50%;\n pointer-events: none;\n top: 2px;\n right: -1px;\n }\n\n &::after {\n content: ' ';\n\n ", "\n }\n }\n\n // floating dot for adding column button - overriding style on last column to avoid scroll\n ", "\n\n .", " .", " {\n display: block;\n }\n\n table\n tr:first-of-type\n td.", ",\n table\n tr:first-of-type\n th.", " {\n &.", ",\n &.", ",\n &.", " {\n .", "::after {\n ", ";\n }\n\n &.", "\n .", "::after {\n background-color: ", ";\n border: 1px solid ", ";\n border-bottom: none;\n z-index: ", ";\n }\n }\n }\n\n .", "\n table\n tr:first-of-type\n td.", ",\n .", "\n table\n tr:first-of-type\n th.", " {\n .", "::after {\n ", ";\n }\n }\n "])), ClassName.COLUMN_CONTROLS_DECORATIONS, tableCellBorderWidth * 2, columnControlsDecorationHeight + tableCellBorderWidth, columnControlsDecorationHeight, tableBorderColor(props), lineMarkerSize, lineMarkerSize, columnHeaderButton(props, "\n border-right: ".concat(tableCellBorderWidth, "px solid ").concat(tableBorderColor(props), ";\n border-bottom: none;\n height: ").concat(tableToolbarSize, "px;\n width: 100%;\n position: absolute;\n top: ").concat(columnControlsDecorationHeight - tableToolbarSize, "px;\n left: 0px;\n z-index: ").concat(columnControlsZIndex, ";\n ")), getFloatingDotOverrides(props), ClassName.WITH_CONTROLS, ClassName.COLUMN_CONTROLS_DECORATIONS, ClassName.TABLE_CELL, ClassName.TABLE_HEADER_CELL, ClassName.COLUMN_SELECTED, ClassName.HOVERED_COLUMN, ClassName.HOVERED_TABLE, ClassName.COLUMN_CONTROLS_DECORATIONS, columnHeaderButtonSelected(props), ClassName.HOVERED_CELL_IN_DANGER, ClassName.COLUMN_CONTROLS_DECORATIONS, tableToolbarDeleteColor(props), tableBorderDeleteColor(props), akEditorUnitZIndex * 100, ClassName.TABLE_SELECTED, ClassName.TABLE_CELL, ClassName.TABLE_SELECTED, ClassName.TABLE_HEADER_CELL, ClassName.COLUMN_CONTROLS_DECORATIONS, columnHeaderButtonSelected(props));
|
|
84
87
|
}
|
|
85
88
|
};
|
|
86
89
|
export var hoveredDeleteButton = function hoveredDeleteButton(props) {
|
|
87
|
-
return css(
|
|
90
|
+
return css(_templateObject26 || (_templateObject26 = _taggedTemplateLiteral(["\n .", ".", " {\n .", ",\n .", ",\n .", " {\n border: 1px solid ", ";\n }\n .", "::after {\n background: ", ";\n }\n }\n"])), ClassName.TABLE_CONTAINER, ClassName.HOVERED_DELETE_BUTTON, ClassName.SELECTED_CELL, ClassName.COLUMN_SELECTED, ClassName.HOVERED_CELL, tableBorderDeleteColor(props), ClassName.SELECTED_CELL, tableCellDeleteColor(props));
|
|
88
91
|
};
|
|
89
92
|
export var hoveredCell = function hoveredCell(props) {
|
|
90
|
-
return css(
|
|
93
|
+
return css(_templateObject27 || (_templateObject27 = _taggedTemplateLiteral(["\n :not(.", ")\n .", ":not(.", ") {\n .", " {\n position: relative;\n border: 1px solid ", ";\n }\n }\n"])), ClassName.IS_RESIZING, ClassName.TABLE_CONTAINER, ClassName.HOVERED_DELETE_BUTTON, ClassName.HOVERED_CELL, tableBorderSelectedColor(props));
|
|
91
94
|
};
|
|
92
|
-
export var hoveredWarningCell = css(
|
|
95
|
+
export var hoveredWarningCell = css(_templateObject28 || (_templateObject28 = _taggedTemplateLiteral(["\n :not(.", ")\n .", ":not(.", ") {\n td.", " {\n background-color: ", " !important; // We need to override the background-color added to the cell\n border: 1px solid ", ";\n }\n }\n"])), ClassName.IS_RESIZING, ClassName.TABLE_CONTAINER, ClassName.HOVERED_DELETE_BUTTON, ClassName.HOVERED_CELL_WARNING, "var(--ds-background-warning, ".concat(Y50, ")"), "var(--ds-border-warning, ".concat(Y200, ")"));
|
|
93
96
|
|
|
94
97
|
// move the resize handle zone completely inside the table cell to avoid overflow
|
|
95
98
|
var getLastColumnResizerOverrides = function getLastColumnResizerOverrides() {
|
|
96
|
-
return getBooleanFF('platform.editor.custom-table-width') ? css(
|
|
99
|
+
return getBooleanFF('platform.editor.custom-table-width') ? css(_templateObject29 || (_templateObject29 = _taggedTemplateLiteral(["\n tr\n th:last-child\n .", ",\n tr\n td:last-child\n .", " {\n background-color: transparent;\n position: absolute;\n width: ", "px;\n height: 100%;\n top: 0;\n right: 0;\n cursor: col-resize;\n z-index: ", ";\n }\n "])), ClassName.RESIZE_HANDLE_DECORATION, ClassName.RESIZE_HANDLE_DECORATION, resizeHandlerAreaWidth / 2, resizeHandlerZIndex) : '';
|
|
97
100
|
};
|
|
98
101
|
var resizeHandleOverrides = function resizeHandleOverrides(props) {
|
|
99
102
|
if (getBooleanFF('platform.editor.table.drag-and-drop')) {
|
|
100
|
-
return css(
|
|
103
|
+
return css(_templateObject30 || (_templateObject30 = _taggedTemplateLiteral(["\n th.", "::before,\n td.", "::before {\n content: ' ';\n position: absolute;\n left: ", ";\n top: -1px;\n width: ", "px;\n height: calc(100% + 2px);\n background-color: ", ";\n z-index: ", ";\n }\n\n th.", "::before,\n td.", "::before {\n content: ' ';\n position: absolute;\n right: -1px;\n top: -1px;\n width: ", "px;\n height: calc(100% + 2px);\n background-color: ", ";\n z-index: ", ";\n }\n "])), ClassName.WITH_RESIZE_LINE, ClassName.WITH_RESIZE_LINE, "var(--ds-space-negative-025, -2px)", resizeLineWidth, tableBorderSelectedColor(props), columnControlsZIndex * 2, ClassName.WITH_RESIZE_LINE_LAST_COLUMN, ClassName.WITH_RESIZE_LINE_LAST_COLUMN, resizeLineWidth, tableBorderSelectedColor(props), columnControlsZIndex * 2);
|
|
101
104
|
}
|
|
102
|
-
return css(
|
|
105
|
+
return css(_templateObject31 || (_templateObject31 = _taggedTemplateLiteral(["\n td.", "::before {\n content: ' ';\n position: absolute;\n left: ", ";\n top: -1px;\n width: ", "px;\n height: calc(100% + 2px);\n background-color: ", ";\n z-index: ", ";\n }\n\n th.", "::before {\n content: ' ';\n left: ", ";\n position: absolute;\n width: ", "px;\n height: calc(100% + ", "px);\n background-color: ", ";\n z-index: ", ";\n top: -", "px;\n }\n\n td.", "::before {\n content: ' ';\n position: absolute;\n right: -1px;\n top: -1px;\n width: ", "px;\n height: calc(100% + 2px);\n background-color: ", ";\n z-index: ", ";\n }\n\n th.", "::before {\n content: ' ';\n right: -1px;\n position: absolute;\n width: ", "px;\n height: calc(100% + ", "px);\n background-color: ", ";\n z-index: ", ";\n top: -", "px;\n }\n "])), ClassName.WITH_RESIZE_LINE, "var(--ds-space-negative-025, -2px)", resizeLineWidth, tableBorderSelectedColor(props), columnControlsZIndex * 2, ClassName.WITH_RESIZE_LINE, "var(--ds-space-negative-025, -2px)", resizeLineWidth, tableToolbarSize + tableCellBorderWidth, tableBorderSelectedColor(props), columnControlsZIndex * 2, tableToolbarSize + tableCellBorderWidth, ClassName.WITH_RESIZE_LINE_LAST_COLUMN, resizeLineWidth, tableBorderSelectedColor(props), columnControlsZIndex * 2, ClassName.WITH_RESIZE_LINE_LAST_COLUMN, resizeLineWidth, tableToolbarSize + tableCellBorderWidth, tableBorderSelectedColor(props), columnControlsZIndex * 2, tableToolbarSize + tableCellBorderWidth);
|
|
103
106
|
};
|
|
104
107
|
export var resizeHandle = function resizeHandle(props) {
|
|
105
|
-
return css(
|
|
108
|
+
return css(_templateObject32 || (_templateObject32 = _taggedTemplateLiteral(["\n .", " {\n .", " {\n background-color: transparent;\n position: absolute;\n width: ", "px;\n height: 100%;\n top: 0;\n right: -", "px;\n cursor: col-resize;\n z-index: ", ";\n }\n\n ", "\n\n ", "\n\n table\n tr:first-of-type\n th.", "\n .", "::after,\n table\n tr:first-of-type\n td.", "\n .", "::after {\n top: -", "px;\n height: calc(100% + ", "px);\n }\n }\n"])), ClassName.TABLE_CONTAINER, ClassName.RESIZE_HANDLE_DECORATION, resizeHandlerAreaWidth, resizeHandlerAreaWidth / 2, resizeHandlerZIndex, getLastColumnResizerOverrides(), resizeHandleOverrides(props), ClassName.WITH_RESIZE_LINE, ClassName.RESIZE_HANDLE_DECORATION, ClassName.WITH_RESIZE_LINE, ClassName.RESIZE_HANDLE_DECORATION, tableToolbarSize + tableCellBorderWidth, tableToolbarSize + tableCellBorderWidth);
|
|
106
109
|
};
|
|
107
110
|
export var insertLine = function insertLine(props) {
|
|
108
|
-
return css(
|
|
111
|
+
return css(_templateObject33 || (_templateObject33 = _taggedTemplateLiteral(["\n .", " {\n td.", "::before {\n content: ' ';\n position: absolute;\n left: -1px;\n top: -1px;\n width: ", "px;\n height: calc(100% + ", "px);\n background-color: ", ";\n z-index: ", ";\n }\n\n th.", "::before {\n content: ' ';\n left: -1px;\n position: absolute;\n width: ", "px;\n height: calc(100% + ", "px);\n background-color: ", ";\n z-index: ", ";\n top: -", "px;\n }\n\n td.", "::before {\n content: ' ';\n position: absolute;\n left: ", ";\n top: -1px;\n width: ", "px;\n height: calc(100% + ", "px);\n background-color: ", ";\n z-index: ", ";\n }\n\n th.", "::before {\n content: ' ';\n left: ", ";\n position: absolute;\n width: ", "px;\n height: calc(100% + ", "px);\n background-color: ", ";\n z-index: ", ";\n top: -", "px;\n }\n\n td.", "::before {\n content: ' ';\n position: absolute;\n right: -1px;\n top: -1px;\n width: ", "px;\n height: calc(100% + ", "px);\n background-color: ", ";\n z-index: ", ";\n }\n\n th.", "::before {\n content: ' ';\n right: -1px;\n position: absolute;\n width: ", "px;\n height: calc(100% + ", "px);\n background-color: ", ";\n z-index: ", ";\n top: -", "px;\n }\n\n td.", "::before {\n content: ' ';\n position: absolute;\n left: ", ";\n top: -1px;\n height: ", "px;\n width: calc(100% + ", "px);\n background-color: ", ";\n z-index: ", ";\n }\n\n th.", "::before {\n content: ' ';\n left: ", ";\n position: absolute;\n height: ", "px;\n width: calc(100% + ", "px);\n background-color: ", ";\n z-index: ", ";\n top: -1px;\n }\n\n td.", "::before {\n content: ' ';\n position: absolute;\n left: ", ";\n bottom: 0;\n height: ", "px;\n width: calc(100% + 2px);\n background-color: ", ";\n z-index: ", ";\n }\n\n th.", "::before {\n content: ' ';\n left: ", ";\n bottom: 0;\n position: absolute;\n height: ", "px;\n width: calc(100% + ", "px);\n background-color: ", ";\n z-index: ", ";\n }\n }\n"])), ClassName.TABLE_CONTAINER, ClassName.WITH_FIRST_COLUMN_INSERT_LINE, insertLineWidth, tableCellBorderWidth * 2, tableBorderSelectedColor(props), columnControlsZIndex * 2, ClassName.WITH_FIRST_COLUMN_INSERT_LINE, insertLineWidth, tableCellBorderWidth * 2, tableBorderSelectedColor(props), columnControlsZIndex * 2, tableCellBorderWidth, ClassName.WITH_COLUMN_INSERT_LINE, "var(--ds-space-negative-025, -2px)", insertLineWidth, tableCellBorderWidth * 2, tableBorderSelectedColor(props), columnControlsZIndex * 2, ClassName.WITH_COLUMN_INSERT_LINE, "var(--ds-space-negative-025, -2px)", insertLineWidth, tableCellBorderWidth * 2, tableBorderSelectedColor(props), columnControlsZIndex * 2, tableCellBorderWidth, ClassName.WITH_LAST_COLUMN_INSERT_LINE, insertLineWidth, tableCellBorderWidth * 2, tableBorderSelectedColor(props), columnControlsZIndex * 2, ClassName.WITH_LAST_COLUMN_INSERT_LINE, insertLineWidth, tableCellBorderWidth * 2, tableBorderSelectedColor(props), columnControlsZIndex * 2, tableCellBorderWidth, ClassName.WITH_ROW_INSERT_LINE, "var(--ds-space-negative-025, -2px)", insertLineWidth, tableCellBorderWidth * 2, tableBorderSelectedColor(props), columnControlsZIndex * 2, ClassName.WITH_ROW_INSERT_LINE, "var(--ds-space-negative-025, -2px)", insertLineWidth, tableCellBorderWidth * 2, tableBorderSelectedColor(props), columnControlsZIndex * 2, ClassName.WITH_LAST_ROW_INSERT_LINE, "var(--ds-space-negative-025, -2px)", insertLineWidth, tableBorderSelectedColor(props), columnControlsZIndex * 2, ClassName.WITH_LAST_ROW_INSERT_LINE, "var(--ds-space-negative-025, -2px)", insertLineWidth, tableCellBorderWidth * 2, tableBorderSelectedColor(props), columnControlsZIndex * 2);
|
|
109
112
|
};
|
|
@@ -31,7 +31,7 @@ export var isTableContainerOrWrapper = function isTableContainerOrWrapper(node)
|
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
/** drag-and-drop classes */
|
|
34
|
-
export var
|
|
34
|
+
export var isDragRowControlsButton = function isDragRowControlsButton(node) {
|
|
35
35
|
return containsClassName(node, ClassName.DRAG_ROW_CONTROLS) || closestElement(node, ".".concat(ClassName.DRAG_ROW_CONTROLS));
|
|
36
36
|
};
|
|
37
37
|
export var isDragRowFloatingInsertDot = function isDragRowFloatingInsertDot(node) {
|
|
@@ -40,6 +40,9 @@ export var isDragRowFloatingInsertDot = function isDragRowFloatingInsertDot(node
|
|
|
40
40
|
export var isDragColumnFloatingInsertDot = function isDragColumnFloatingInsertDot(node) {
|
|
41
41
|
return containsClassName(node, ClassName.DRAG_COLUMN_FLOATING_INSERT_DOT_WRAPPER);
|
|
42
42
|
};
|
|
43
|
+
export var isDragCornerButton = function isDragCornerButton(node) {
|
|
44
|
+
return containsClassName(node, ClassName.DRAG_CORNER_BUTTON) || containsClassName(node, ClassName.DRAG_CORNER_BUTTON_INNER);
|
|
45
|
+
};
|
|
43
46
|
|
|
44
47
|
/*
|
|
45
48
|
* This function returns which side of a given element the mouse cursor is,
|
|
@@ -95,14 +98,20 @@ export var isDragColumnFloatingInsertDot = function isDragColumnFloatingInsertDo
|
|
|
95
98
|
* the same is valid to the right side.
|
|
96
99
|
*/
|
|
97
100
|
|
|
98
|
-
export var getMousePositionHorizontalRelativeByElement = function getMousePositionHorizontalRelativeByElement(mouseEvent, elementContentRects, gapInPixels) {
|
|
101
|
+
export var getMousePositionHorizontalRelativeByElement = function getMousePositionHorizontalRelativeByElement(mouseEvent, elementContentRects, gapInPixels, isDragAndDropEnabled) {
|
|
99
102
|
var element = mouseEvent.target;
|
|
100
103
|
if (element instanceof HTMLElement) {
|
|
101
|
-
var _closestCell$id, _elementContentRects$, _elementContentRects$2;
|
|
102
104
|
var width, x;
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
105
|
+
if (isDragAndDropEnabled) {
|
|
106
|
+
// mouse event fires for new overlapping column controls, so the cell can not get detected. Get width
|
|
107
|
+
// directly from element that will be .pm-table-drag-columns-floating-insert-dot-wrapper
|
|
108
|
+
width = element.clientWidth;
|
|
109
|
+
} else {
|
|
110
|
+
var _closestCell$id, _elementContentRects$, _elementContentRects$2;
|
|
111
|
+
var closestCell = element.closest(SELECTOR_TABLE_LEAFS);
|
|
112
|
+
var id = (_closestCell$id = closestCell === null || closestCell === void 0 ? void 0 : closestCell.id) !== null && _closestCell$id !== void 0 ? _closestCell$id : '';
|
|
113
|
+
width = (_elementContentRects$ = elementContentRects === null || elementContentRects === void 0 || (_elementContentRects$2 = elementContentRects[id]) === null || _elementContentRects$2 === void 0 ? void 0 : _elementContentRects$2.width) !== null && _elementContentRects$ !== void 0 ? _elementContentRects$ : 0;
|
|
114
|
+
}
|
|
106
115
|
x = mouseEvent.offsetX;
|
|
107
116
|
if (width <= 0) {
|
|
108
117
|
return null;
|
|
@@ -2,7 +2,7 @@ export { getSelectedColumnIndexes, getSelectedRowIndexes, normalizeSelection, is
|
|
|
2
2
|
export { findControlsHoverDecoration, createControlsHoverDecoration, createColumnControlsDecoration, createColumnSelectedDecoration, createCellHoverDecoration, updateDecorations, createResizeHandleDecoration, createColumnInsertLine, createColumnLineResize, createRowInsertLine } from './decoration';
|
|
3
3
|
export { isIsolating, containsHeaderColumn, containsHeaderRow, checkIfHeaderColumnEnabled, checkIfHeaderRowEnabled, checkIfNumberColumnEnabled, isLayoutSupported, getTableWidth, tablesHaveDifferentColumnWidths, tablesHaveDifferentNoOfColumns, isTableNested, anyChildCellMergedAcrossRow, supportedHeaderRow } from './nodes';
|
|
4
4
|
export { unwrapContentFromTable, removeTableFromFirstChild, removeTableFromLastChild, transformSliceToRemoveOpenTable, transformSliceToCorrectEmptyTableCells, transformSliceToFixHardBreakProblemOnCopyFromCell } from './paste';
|
|
5
|
-
export { isCell, isCornerButton, isInsertRowButton, isColumnControlsDecorations, isTableControlsButton, isTableContainerOrWrapper,
|
|
5
|
+
export { isCell, isCornerButton, isInsertRowButton, isColumnControlsDecorations, isTableControlsButton, isTableContainerOrWrapper, isRowControlsButton, isDragRowControlsButton, isDragColumnFloatingInsertDot, isDragRowFloatingInsertDot, isDragCornerButton, getColumnOrRowIndex, getMousePositionHorizontalRelativeByElement, getMousePositionVerticalRelativeByElement, updateResizeHandles, isResizeHandleDecoration, hasResizeHandler } from './dom';
|
|
6
6
|
export { getColumnsWidths, isColumnDeleteButtonVisible, getColumnDeleteButtonParams, getColumnClassNames } from './column-controls';
|
|
7
7
|
export { getRowHeights, isRowDeleteButtonVisible, getRowDeleteButtonParams, getRowsParams, getRowClassNames, copyPreviousRow } from './row-controls';
|
|
8
8
|
export { getSelectedTableInfo, getSelectedCellInfo } from './analytics';
|
|
@@ -253,9 +253,6 @@ export declare const TableCssClassName: {
|
|
|
253
253
|
COLUMN_CONTROLS: string;
|
|
254
254
|
COLUMN_CONTROLS_DECORATIONS: string;
|
|
255
255
|
COLUMN_SELECTED: string;
|
|
256
|
-
COLUMN_CONTROLS_WRAPPER: string;
|
|
257
|
-
COLUMN_DROP_TARGET_CONTROLS: string;
|
|
258
|
-
COLUMN_CONTROLS_INNER: string;
|
|
259
256
|
ROW_CONTROLS_WRAPPER: string;
|
|
260
257
|
ROW_CONTROLS: string;
|
|
261
258
|
ROW_CONTROLS_INNER: string;
|
|
@@ -290,7 +287,12 @@ export declare const TableCssClassName: {
|
|
|
290
287
|
DRAG_COLUMN_CONTROLS: string;
|
|
291
288
|
DRAG_COLUMN_FLOATING_INSERT_DOT_WRAPPER: string;
|
|
292
289
|
DRAG_COLUMN_FLOATING_INSERT_DOT: string;
|
|
290
|
+
DRAG_COLUMN_CONTROLS_WRAPPER: string;
|
|
291
|
+
DRAG_COLUMN_DROP_TARGET_CONTROLS: string;
|
|
292
|
+
DRAG_COLUMN_CONTROLS_INNER: string;
|
|
293
293
|
DRAG_HANDLE_BUTTON_CONTAINER: string;
|
|
294
|
+
DRAG_CORNER_BUTTON: string;
|
|
295
|
+
DRAG_CORNER_BUTTON_INNER: string;
|
|
294
296
|
/** Other classes */
|
|
295
297
|
NUMBERED_COLUMN: string;
|
|
296
298
|
NUMBERED_COLUMN_BUTTON: string;
|
package/dist/types/plugins/table/ui/TableFloatingControls/CornerControls/ClassicCornerControls.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
|
+
import type { CornerControlProps } from './types';
|
|
4
|
+
export declare const CornerControls: React.FC<import("react-intl-next").WithIntlProps<CornerControlProps & WrappedComponentProps<"intl">>> & {
|
|
5
|
+
WrappedComponent: React.ComponentType<CornerControlProps & WrappedComponentProps<"intl">>;
|
|
6
|
+
};
|
package/dist/types/plugins/table/ui/TableFloatingControls/CornerControls/DragCornerControls.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
|
+
import type { CornerControlProps } from './types';
|
|
4
|
+
export declare const DragCornerControls: React.FC<import("react-intl-next").WithIntlProps<CornerControlProps & WrappedComponentProps<"intl">>> & {
|
|
5
|
+
WrappedComponent: React.ComponentType<CornerControlProps & WrappedComponentProps<"intl">>;
|
|
6
|
+
};
|
|
@@ -1,16 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
export interface Props {
|
|
5
|
-
editorView: EditorView;
|
|
6
|
-
tableRef?: HTMLTableElement;
|
|
7
|
-
isInDanger?: boolean;
|
|
8
|
-
isResizing?: boolean;
|
|
9
|
-
hoveredRows?: number[];
|
|
10
|
-
isHeaderColumnEnabled?: boolean;
|
|
11
|
-
isHeaderRowEnabled?: boolean;
|
|
12
|
-
stickyTop?: number;
|
|
13
|
-
}
|
|
14
|
-
export declare const CornerControls: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
|
|
15
|
-
WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
|
|
16
|
-
};
|
|
1
|
+
export { CornerControls } from './ClassicCornerControls';
|
|
2
|
+
export { DragCornerControls } from './DragCornerControls';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
2
|
+
export type CornerControlProps = {
|
|
3
|
+
editorView: EditorView;
|
|
4
|
+
tableRef?: HTMLTableElement;
|
|
5
|
+
isInDanger?: boolean;
|
|
6
|
+
isResizing?: boolean;
|
|
7
|
+
hoveredRows?: number[];
|
|
8
|
+
isHeaderColumnEnabled?: boolean;
|
|
9
|
+
isHeaderRowEnabled?: boolean;
|
|
10
|
+
stickyTop?: number;
|
|
11
|
+
};
|
|
@@ -4,6 +4,7 @@ export declare const HeaderButton: (props: ThemeProps, cssString?: string) => im
|
|
|
4
4
|
export declare const HeaderButtonHover: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
5
5
|
export declare const HeaderButtonDanger: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
6
6
|
export declare const dragInsertButtonWrapper: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
7
|
+
export declare const dragCornerControlButton: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
7
8
|
export declare const insertColumnButtonWrapper: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
8
9
|
export declare const insertRowButtonWrapper: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
9
10
|
export declare const columnControlsLineMarker: () => import("@emotion/react").SerializedStyles;
|
|
@@ -9,10 +9,11 @@ export declare const isResizeHandleDecoration: (node: HTMLElement | null) => boo
|
|
|
9
9
|
export declare const isTableControlsButton: (node: HTMLElement | null) => boolean;
|
|
10
10
|
export declare const isTableContainerOrWrapper: (node: HTMLElement | null) => boolean;
|
|
11
11
|
/** drag-and-drop classes */
|
|
12
|
-
export declare const
|
|
12
|
+
export declare const isDragRowControlsButton: (node: HTMLElement | null) => true | HTMLElement | null;
|
|
13
13
|
export declare const isDragRowFloatingInsertDot: (node: HTMLElement | null) => boolean;
|
|
14
14
|
export declare const isDragColumnFloatingInsertDot: (node: HTMLElement | null) => boolean;
|
|
15
|
-
export declare const
|
|
15
|
+
export declare const isDragCornerButton: (node: HTMLElement | null) => boolean;
|
|
16
|
+
export declare const getMousePositionHorizontalRelativeByElement: (mouseEvent: MouseEvent, elementContentRects?: ElementContentRects, gapInPixels?: number, isDragAndDropEnabled?: boolean) => 'left' | 'right' | null;
|
|
16
17
|
export declare const getMousePositionVerticalRelativeByElement: (mouseEvent: MouseEvent) => 'top' | 'bottom' | null;
|
|
17
18
|
export declare const updateResizeHandles: (tableRef?: HTMLElement) => void;
|
|
18
19
|
export declare const hasResizeHandler: ({ columnEndIndexTarget, target, }: {
|
|
@@ -2,7 +2,7 @@ export { getSelectedColumnIndexes, getSelectedRowIndexes, normalizeSelection, is
|
|
|
2
2
|
export { findControlsHoverDecoration, createControlsHoverDecoration, createColumnControlsDecoration, createColumnSelectedDecoration, createCellHoverDecoration, updateDecorations, createResizeHandleDecoration, createColumnInsertLine, createColumnLineResize, createRowInsertLine, } from './decoration';
|
|
3
3
|
export { isIsolating, containsHeaderColumn, containsHeaderRow, checkIfHeaderColumnEnabled, checkIfHeaderRowEnabled, checkIfNumberColumnEnabled, isLayoutSupported, getTableWidth, tablesHaveDifferentColumnWidths, tablesHaveDifferentNoOfColumns, isTableNested, anyChildCellMergedAcrossRow, supportedHeaderRow, } from './nodes';
|
|
4
4
|
export { unwrapContentFromTable, removeTableFromFirstChild, removeTableFromLastChild, transformSliceToRemoveOpenTable, transformSliceToCorrectEmptyTableCells, transformSliceToFixHardBreakProblemOnCopyFromCell, } from './paste';
|
|
5
|
-
export { isCell, isCornerButton, isInsertRowButton, isColumnControlsDecorations, isTableControlsButton, isTableContainerOrWrapper,
|
|
5
|
+
export { isCell, isCornerButton, isInsertRowButton, isColumnControlsDecorations, isTableControlsButton, isTableContainerOrWrapper, isRowControlsButton, isDragRowControlsButton, isDragColumnFloatingInsertDot, isDragRowFloatingInsertDot, isDragCornerButton, getColumnOrRowIndex, getMousePositionHorizontalRelativeByElement, getMousePositionVerticalRelativeByElement, updateResizeHandles, isResizeHandleDecoration, hasResizeHandler, } from './dom';
|
|
6
6
|
export { getColumnsWidths, isColumnDeleteButtonVisible, getColumnDeleteButtonParams, getColumnClassNames, } from './column-controls';
|
|
7
7
|
export { getRowHeights, isRowDeleteButtonVisible, getRowDeleteButtonParams, getRowsParams, getRowClassNames, copyPreviousRow, } from './row-controls';
|
|
8
8
|
export type { RowParams } from './row-controls';
|
|
@@ -253,9 +253,6 @@ export declare const TableCssClassName: {
|
|
|
253
253
|
COLUMN_CONTROLS: string;
|
|
254
254
|
COLUMN_CONTROLS_DECORATIONS: string;
|
|
255
255
|
COLUMN_SELECTED: string;
|
|
256
|
-
COLUMN_CONTROLS_WRAPPER: string;
|
|
257
|
-
COLUMN_DROP_TARGET_CONTROLS: string;
|
|
258
|
-
COLUMN_CONTROLS_INNER: string;
|
|
259
256
|
ROW_CONTROLS_WRAPPER: string;
|
|
260
257
|
ROW_CONTROLS: string;
|
|
261
258
|
ROW_CONTROLS_INNER: string;
|
|
@@ -290,7 +287,12 @@ export declare const TableCssClassName: {
|
|
|
290
287
|
DRAG_COLUMN_CONTROLS: string;
|
|
291
288
|
DRAG_COLUMN_FLOATING_INSERT_DOT_WRAPPER: string;
|
|
292
289
|
DRAG_COLUMN_FLOATING_INSERT_DOT: string;
|
|
290
|
+
DRAG_COLUMN_CONTROLS_WRAPPER: string;
|
|
291
|
+
DRAG_COLUMN_DROP_TARGET_CONTROLS: string;
|
|
292
|
+
DRAG_COLUMN_CONTROLS_INNER: string;
|
|
293
293
|
DRAG_HANDLE_BUTTON_CONTAINER: string;
|
|
294
|
+
DRAG_CORNER_BUTTON: string;
|
|
295
|
+
DRAG_CORNER_BUTTON_INNER: string;
|
|
294
296
|
/** Other classes */
|
|
295
297
|
NUMBERED_COLUMN: string;
|
|
296
298
|
NUMBERED_COLUMN_BUTTON: string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
|
+
import type { CornerControlProps } from './types';
|
|
4
|
+
export declare const CornerControls: React.FC<import("react-intl-next").WithIntlProps<CornerControlProps & WrappedComponentProps<"intl">>> & {
|
|
5
|
+
WrappedComponent: React.ComponentType<CornerControlProps & WrappedComponentProps<"intl">>;
|
|
6
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
|
+
import type { CornerControlProps } from './types';
|
|
4
|
+
export declare const DragCornerControls: React.FC<import("react-intl-next").WithIntlProps<CornerControlProps & WrappedComponentProps<"intl">>> & {
|
|
5
|
+
WrappedComponent: React.ComponentType<CornerControlProps & WrappedComponentProps<"intl">>;
|
|
6
|
+
};
|
|
@@ -1,16 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
export interface Props {
|
|
5
|
-
editorView: EditorView;
|
|
6
|
-
tableRef?: HTMLTableElement;
|
|
7
|
-
isInDanger?: boolean;
|
|
8
|
-
isResizing?: boolean;
|
|
9
|
-
hoveredRows?: number[];
|
|
10
|
-
isHeaderColumnEnabled?: boolean;
|
|
11
|
-
isHeaderRowEnabled?: boolean;
|
|
12
|
-
stickyTop?: number;
|
|
13
|
-
}
|
|
14
|
-
export declare const CornerControls: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
|
|
15
|
-
WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
|
|
16
|
-
};
|
|
1
|
+
export { CornerControls } from './ClassicCornerControls';
|
|
2
|
+
export { DragCornerControls } from './DragCornerControls';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
2
|
+
export type CornerControlProps = {
|
|
3
|
+
editorView: EditorView;
|
|
4
|
+
tableRef?: HTMLTableElement;
|
|
5
|
+
isInDanger?: boolean;
|
|
6
|
+
isResizing?: boolean;
|
|
7
|
+
hoveredRows?: number[];
|
|
8
|
+
isHeaderColumnEnabled?: boolean;
|
|
9
|
+
isHeaderRowEnabled?: boolean;
|
|
10
|
+
stickyTop?: number;
|
|
11
|
+
};
|
|
@@ -4,6 +4,7 @@ export declare const HeaderButton: (props: ThemeProps, cssString?: string) => im
|
|
|
4
4
|
export declare const HeaderButtonHover: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
5
5
|
export declare const HeaderButtonDanger: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
6
6
|
export declare const dragInsertButtonWrapper: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
7
|
+
export declare const dragCornerControlButton: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
7
8
|
export declare const insertColumnButtonWrapper: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
8
9
|
export declare const insertRowButtonWrapper: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
9
10
|
export declare const columnControlsLineMarker: () => import("@emotion/react").SerializedStyles;
|
|
@@ -12,10 +12,11 @@ export declare const isResizeHandleDecoration: (node: HTMLElement | null) => boo
|
|
|
12
12
|
export declare const isTableControlsButton: (node: HTMLElement | null) => boolean;
|
|
13
13
|
export declare const isTableContainerOrWrapper: (node: HTMLElement | null) => boolean;
|
|
14
14
|
/** drag-and-drop classes */
|
|
15
|
-
export declare const
|
|
15
|
+
export declare const isDragRowControlsButton: (node: HTMLElement | null) => true | HTMLElement | null;
|
|
16
16
|
export declare const isDragRowFloatingInsertDot: (node: HTMLElement | null) => boolean;
|
|
17
17
|
export declare const isDragColumnFloatingInsertDot: (node: HTMLElement | null) => boolean;
|
|
18
|
-
export declare const
|
|
18
|
+
export declare const isDragCornerButton: (node: HTMLElement | null) => boolean;
|
|
19
|
+
export declare const getMousePositionHorizontalRelativeByElement: (mouseEvent: MouseEvent, elementContentRects?: ElementContentRects, gapInPixels?: number, isDragAndDropEnabled?: boolean) => 'left' | 'right' | null;
|
|
19
20
|
export declare const getMousePositionVerticalRelativeByElement: (mouseEvent: MouseEvent) => 'top' | 'bottom' | null;
|
|
20
21
|
export declare const updateResizeHandles: (tableRef?: HTMLElement) => void;
|
|
21
22
|
export declare const hasResizeHandler: ({ columnEndIndexTarget, target, }: {
|
|
@@ -2,7 +2,7 @@ export { getSelectedColumnIndexes, getSelectedRowIndexes, normalizeSelection, is
|
|
|
2
2
|
export { findControlsHoverDecoration, createControlsHoverDecoration, createColumnControlsDecoration, createColumnSelectedDecoration, createCellHoverDecoration, updateDecorations, createResizeHandleDecoration, createColumnInsertLine, createColumnLineResize, createRowInsertLine, } from './decoration';
|
|
3
3
|
export { isIsolating, containsHeaderColumn, containsHeaderRow, checkIfHeaderColumnEnabled, checkIfHeaderRowEnabled, checkIfNumberColumnEnabled, isLayoutSupported, getTableWidth, tablesHaveDifferentColumnWidths, tablesHaveDifferentNoOfColumns, isTableNested, anyChildCellMergedAcrossRow, supportedHeaderRow, } from './nodes';
|
|
4
4
|
export { unwrapContentFromTable, removeTableFromFirstChild, removeTableFromLastChild, transformSliceToRemoveOpenTable, transformSliceToCorrectEmptyTableCells, transformSliceToFixHardBreakProblemOnCopyFromCell, } from './paste';
|
|
5
|
-
export { isCell, isCornerButton, isInsertRowButton, isColumnControlsDecorations, isTableControlsButton, isTableContainerOrWrapper,
|
|
5
|
+
export { isCell, isCornerButton, isInsertRowButton, isColumnControlsDecorations, isTableControlsButton, isTableContainerOrWrapper, isRowControlsButton, isDragRowControlsButton, isDragColumnFloatingInsertDot, isDragRowFloatingInsertDot, isDragCornerButton, getColumnOrRowIndex, getMousePositionHorizontalRelativeByElement, getMousePositionVerticalRelativeByElement, updateResizeHandles, isResizeHandleDecoration, hasResizeHandler, } from './dom';
|
|
6
6
|
export { getColumnsWidths, isColumnDeleteButtonVisible, getColumnDeleteButtonParams, getColumnClassNames, } from './column-controls';
|
|
7
7
|
export { getRowHeights, isRowDeleteButtonVisible, getRowDeleteButtonParams, getRowsParams, getRowClassNames, copyPreviousRow, } from './row-controls';
|
|
8
8
|
export type { RowParams } from './row-controls';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.16",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@atlaskit/adf-schema": "^32.0.0",
|
|
31
31
|
"@atlaskit/custom-steps": "^0.0.2",
|
|
32
|
-
"@atlaskit/editor-common": "^76.
|
|
32
|
+
"@atlaskit/editor-common": "^76.16.0",
|
|
33
33
|
"@atlaskit/editor-palette": "1.5.1",
|
|
34
34
|
"@atlaskit/editor-plugin-analytics": "^0.2.0",
|
|
35
35
|
"@atlaskit/editor-plugin-content-insertion": "^0.1.0",
|
|
@@ -56,6 +56,7 @@ import {
|
|
|
56
56
|
isColumnControlsDecorations,
|
|
57
57
|
isCornerButton,
|
|
58
58
|
isDragColumnFloatingInsertDot,
|
|
59
|
+
isDragCornerButton,
|
|
59
60
|
isDragRowFloatingInsertDot,
|
|
60
61
|
isInsertRowButton,
|
|
61
62
|
isResizeHandleDecoration,
|
|
@@ -237,7 +238,8 @@ export const handleMouseDown = (_: EditorView, event: Event) => {
|
|
|
237
238
|
event.target instanceof HTMLElement &&
|
|
238
239
|
(isTableContainerOrWrapper(event.target) ||
|
|
239
240
|
isColumnControlsDecorations(event.target) ||
|
|
240
|
-
isRowControlsButton(event.target)
|
|
241
|
+
isRowControlsButton(event.target) ||
|
|
242
|
+
isDragCornerButton(event.target))
|
|
241
243
|
);
|
|
242
244
|
|
|
243
245
|
if (isControl) {
|
|
@@ -326,13 +328,16 @@ export const handleMouseMove = (
|
|
|
326
328
|
isDragColumnFloatingInsertDot(element)
|
|
327
329
|
) {
|
|
328
330
|
const { state, dispatch } = view;
|
|
329
|
-
const { insertColumnButtonIndex } =
|
|
331
|
+
const { insertColumnButtonIndex, isDragAndDropEnabled } =
|
|
332
|
+
getPluginState(state);
|
|
330
333
|
const [startIndex, endIndex] = getColumnOrRowIndex(element);
|
|
331
334
|
|
|
332
335
|
const positionColumn =
|
|
333
336
|
getMousePositionHorizontalRelativeByElement(
|
|
334
337
|
event as MouseEvent,
|
|
335
338
|
elementContentRects,
|
|
339
|
+
undefined,
|
|
340
|
+
isDragAndDropEnabled,
|
|
336
341
|
) === 'right'
|
|
337
342
|
? endIndex
|
|
338
343
|
: startIndex;
|
|
@@ -17,7 +17,12 @@ import {
|
|
|
17
17
|
import { getPluginState as getTablePluginState } from '../plugin-factory';
|
|
18
18
|
|
|
19
19
|
import { DragAndDropActionType } from './actions';
|
|
20
|
-
import {
|
|
20
|
+
import {
|
|
21
|
+
clearDropTarget,
|
|
22
|
+
moveSource,
|
|
23
|
+
setDropTarget,
|
|
24
|
+
toggleDragMenu,
|
|
25
|
+
} from './commands';
|
|
21
26
|
import { DropTargetType } from './consts';
|
|
22
27
|
import { createPluginState, getPluginState } from './plugin-factory';
|
|
23
28
|
import { pluginKey } from './plugin-key';
|
|
@@ -99,6 +104,7 @@ export const createPlugin = (
|
|
|
99
104
|
},
|
|
100
105
|
onDragStart: ({ location }) => {
|
|
101
106
|
autoScroller.start({ input: location.current.input });
|
|
107
|
+
toggleDragMenu(false)(editorView.state, editorView.dispatch);
|
|
102
108
|
},
|
|
103
109
|
onDrag(event) {
|
|
104
110
|
autoScroller.updateInput({
|