@atlaskit/editor-plugin-table 4.0.2 → 4.0.3
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 +6 -0
- package/dist/cjs/i18n/cs.js +2 -3
- package/dist/cjs/i18n/da.js +2 -3
- package/dist/cjs/i18n/de.js +2 -3
- package/dist/cjs/i18n/en.js +2 -3
- package/dist/cjs/i18n/en_GB.js +2 -3
- package/dist/cjs/i18n/en_ZZ.js +2 -3
- package/dist/cjs/i18n/es.js +2 -3
- package/dist/cjs/i18n/fi.js +2 -3
- package/dist/cjs/i18n/fr.js +2 -3
- package/dist/cjs/i18n/hu.js +2 -3
- package/dist/cjs/i18n/it.js +2 -3
- package/dist/cjs/i18n/ja.js +2 -3
- package/dist/cjs/i18n/ko.js +2 -3
- package/dist/cjs/i18n/nb.js +2 -3
- package/dist/cjs/i18n/nl.js +2 -3
- package/dist/cjs/i18n/pl.js +2 -3
- package/dist/cjs/i18n/pt_BR.js +2 -3
- package/dist/cjs/i18n/ru.js +2 -3
- package/dist/cjs/i18n/sv.js +2 -3
- package/dist/cjs/i18n/th.js +2 -3
- package/dist/cjs/i18n/tr.js +2 -3
- package/dist/cjs/i18n/uk.js +2 -3
- package/dist/cjs/i18n/vi.js +2 -3
- package/dist/cjs/i18n/zh.js +2 -3
- package/dist/cjs/i18n/zh_TW.js +2 -3
- package/dist/cjs/plugins/table/commands/clear.js +3 -5
- package/dist/cjs/plugins/table/commands/collapse.js +2 -3
- package/dist/cjs/plugins/table/commands/go-to-next-cell.js +2 -3
- package/dist/cjs/plugins/table/commands/hover.js +8 -15
- package/dist/cjs/plugins/table/commands/insert.js +6 -11
- package/dist/cjs/plugins/table/commands/misc.js +23 -45
- package/dist/cjs/plugins/table/commands/referentiality.js +2 -3
- package/dist/cjs/plugins/table/commands/selection.js +3 -6
- package/dist/cjs/plugins/table/commands/sort.js +2 -3
- package/dist/cjs/plugins/table/commands/split-cell.js +2 -3
- package/dist/cjs/plugins/table/commands/toggle.js +7 -13
- package/dist/cjs/plugins/table/commands-with-analytics.js +19 -37
- package/dist/cjs/plugins/table/create-plugin-config.js +2 -3
- package/dist/cjs/plugins/table/event-handlers.js +12 -22
- package/dist/cjs/plugins/table/handlers.js +2 -3
- package/dist/cjs/plugins/table/index.js +8 -9
- package/dist/cjs/plugins/table/nodeviews/OverflowShadowsObserver.js +5 -6
- package/dist/cjs/plugins/table/nodeviews/TableComponent.js +2 -3
- package/dist/cjs/plugins/table/nodeviews/TableContainer.js +10 -13
- package/dist/cjs/plugins/table/nodeviews/TableResizer.js +4 -5
- package/dist/cjs/plugins/table/nodeviews/TableStickyScrollbar.js +5 -10
- package/dist/cjs/plugins/table/nodeviews/table.js +4 -6
- package/dist/cjs/plugins/table/nodeviews/tableCell.js +2 -3
- package/dist/cjs/plugins/table/nodeviews/update-overflow-shadows.js +2 -3
- package/dist/cjs/plugins/table/pm-plugins/decorations/plugin.js +5 -9
- package/dist/cjs/plugins/table/pm-plugins/decorations/utils/column-controls.js +3 -5
- package/dist/cjs/plugins/table/pm-plugins/decorations/utils/column-resizing.js +3 -5
- package/dist/cjs/plugins/table/pm-plugins/decorations/utils/compose-decorations.js +2 -3
- package/dist/cjs/plugins/table/pm-plugins/default-table-selection.js +2 -3
- package/dist/cjs/plugins/table/pm-plugins/keymap.js +1 -2
- package/dist/cjs/plugins/table/pm-plugins/main.js +2 -3
- package/dist/cjs/plugins/table/pm-plugins/plugin-factory.js +3 -6
- package/dist/cjs/plugins/table/pm-plugins/plugin-key.js +1 -2
- package/dist/cjs/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +3 -5
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/commands.js +3 -5
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/dom.js +3 -5
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +6 -8
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/plugin-key.js +1 -2
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/plugin-state.js +2 -4
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/plugin.js +2 -3
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/util.js +2 -3
- package/dist/cjs/plugins/table/pm-plugins/table-analytics.js +5 -8
- package/dist/cjs/plugins/table/pm-plugins/table-local-id.js +2 -3
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/commands.js +7 -13
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/event-handlers.js +3 -4
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/plugin-factory.js +3 -6
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/plugin-key.js +1 -2
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/reducer.js +2 -3
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +7 -13
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/column-state.js +5 -10
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/consts.js +2 -4
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/dom.js +8 -15
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/misc.js +2 -3
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-column.js +2 -3
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-logic.js +70 -71
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +11 -21
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +5 -9
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/unit-to-number.js +2 -3
- package/dist/cjs/plugins/table/pm-plugins/table-selection-keymap.js +1 -2
- package/dist/cjs/plugins/table/pm-plugins/table-width.js +3 -5
- package/dist/cjs/plugins/table/reducer.js +2 -3
- package/dist/cjs/plugins/table/toolbar.js +5 -9
- package/dist/cjs/plugins/table/transforms/column-width.js +4 -6
- package/dist/cjs/plugins/table/transforms/delete-columns.js +58 -58
- package/dist/cjs/plugins/table/transforms/delete-rows.js +52 -52
- package/dist/cjs/plugins/table/transforms/fix-tables.js +3 -6
- package/dist/cjs/plugins/table/transforms/replace-table.js +3 -4
- package/dist/cjs/plugins/table/types.js +5 -9
- package/dist/cjs/plugins/table/ui/ColumnResizeWidget/index.js +2 -3
- package/dist/cjs/plugins/table/ui/FloatingContextualButton/FixedButton.js +5 -10
- package/dist/cjs/plugins/table/ui/FloatingContextualButton/styles.js +3 -5
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +4 -7
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/index.js +1 -2
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/styles.js +2 -4
- package/dist/cjs/plugins/table/ui/FloatingDeleteButton/DeleteButton.js +1 -2
- package/dist/cjs/plugins/table/ui/FloatingDeleteButton/index.js +1 -2
- package/dist/cjs/plugins/table/ui/FloatingInsertButton/InsertButton.js +1 -2
- package/dist/cjs/plugins/table/ui/FloatingInsertButton/getPopupOptions.js +1 -2
- package/dist/cjs/plugins/table/ui/FloatingInsertButton/index.js +2 -4
- package/dist/cjs/plugins/table/ui/LayoutButton/index.js +1 -2
- package/dist/cjs/plugins/table/ui/TableFloatingControls/CornerControls/index.js +1 -2
- package/dist/cjs/plugins/table/ui/TableFloatingControls/NumberColumn/index.js +2 -3
- package/dist/cjs/plugins/table/ui/TableFloatingControls/RowControls/index.js +1 -2
- package/dist/cjs/plugins/table/ui/TableFloatingControls/index.js +1 -2
- package/dist/cjs/plugins/table/ui/common-styles.js +23 -14
- package/dist/cjs/plugins/table/ui/consts.js +47 -94
- package/dist/cjs/plugins/table/ui/messages.js +2 -3
- package/dist/cjs/plugins/table/ui/ui-styles.js +32 -38
- package/dist/cjs/plugins/table/utils/analytics.js +7 -12
- package/dist/cjs/plugins/table/utils/collapse.js +3 -5
- package/dist/cjs/plugins/table/utils/column-controls.js +6 -11
- package/dist/cjs/plugins/table/utils/decoration.js +10 -19
- package/dist/cjs/plugins/table/utils/dom.js +16 -28
- package/dist/cjs/plugins/table/utils/guidelines.js +1 -2
- package/dist/cjs/plugins/table/utils/nodes.js +12 -23
- package/dist/cjs/plugins/table/utils/paste.js +10 -16
- package/dist/cjs/plugins/table/utils/row-controls.js +7 -13
- package/dist/cjs/plugins/table/utils/selection.js +5 -9
- package/dist/cjs/plugins/table/utils/snapping.js +4 -7
- package/dist/cjs/plugins/table/utils/table.js +3 -5
- package/dist/cjs/plugins/table/utils/update-plugin-state-decorations.js +2 -3
- package/dist/cjs/plugins/table-plugin.js +1 -2
- package/dist/es2019/plugins/table/ui/common-styles.js +40 -4
- package/dist/es2019/plugins/table/ui/ui-styles.js +223 -85
- package/dist/esm/plugins/table/event-handlers.js +1 -1
- package/dist/esm/plugins/table/index.js +7 -7
- package/dist/esm/plugins/table/nodeviews/OverflowShadowsObserver.js +3 -3
- package/dist/esm/plugins/table/nodeviews/TableComponent.js +1 -1
- package/dist/esm/plugins/table/nodeviews/TableContainer.js +6 -6
- package/dist/esm/plugins/table/nodeviews/TableResizer.js +2 -2
- package/dist/esm/plugins/table/nodeviews/TableStickyScrollbar.js +3 -7
- package/dist/esm/plugins/table/nodeviews/table.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +3 -3
- package/dist/esm/plugins/table/pm-plugins/table-analytics.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/table-resizing/event-handlers.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/resize-logic.js +68 -67
- package/dist/esm/plugins/table/toolbar.js +1 -1
- package/dist/esm/plugins/table/transforms/column-width.js +1 -1
- package/dist/esm/plugins/table/transforms/delete-columns.js +56 -55
- package/dist/esm/plugins/table/transforms/delete-rows.js +51 -50
- package/dist/esm/plugins/table/transforms/replace-table.js +1 -1
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +1 -1
- package/dist/esm/plugins/table/ui/common-styles.js +20 -6
- package/dist/esm/plugins/table/ui/ui-styles.js +18 -10
- package/dist/esm/plugins/table/utils/analytics.js +1 -1
- package/dist/esm/plugins/table/utils/dom.js +1 -1
- package/dist/esm/plugins/table/utils/paste.js +4 -4
- package/package.json +5 -2
- package/src/plugins/table/ui/common-styles.ts +46 -4
- package/src/plugins/table/ui/ui-styles.ts +235 -90
|
@@ -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;
|
|
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;
|
|
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';
|
|
@@ -51,29 +51,37 @@ export var OverflowShadow = function OverflowShadow(props) {
|
|
|
51
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
|
+
if (getBooleanFF('platform.editor.table.column-controls-styles-updated')) {
|
|
55
|
+
return css(_templateObject15 || (_templateObject15 = _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);
|
|
56
|
+
} else {
|
|
57
|
+
return css(_templateObject16 || (_templateObject16 = _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);
|
|
58
|
+
}
|
|
55
59
|
};
|
|
56
60
|
var columnHeaderButtonSelected = function columnHeaderButtonSelected(props) {
|
|
57
|
-
return css(
|
|
61
|
+
return css(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n color: ", ";\n background-color: ", ";\n border-color: ", ";\n z-index: ", ";\n"])), "var(--ds-text-inverse, ".concat(N0, ")"), tableToolbarSelectedColor(props), tableBorderSelectedColor(props), columnControlsSelectedZIndex);
|
|
58
62
|
};
|
|
59
63
|
var getFloatingDotOverrides = function getFloatingDotOverrides(props) {
|
|
60
|
-
return getBooleanFF('platform.editor.custom-table-width') ? css(
|
|
64
|
+
return getBooleanFF('platform.editor.custom-table-width') ? css(_templateObject18 || (_templateObject18 = _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)") : '';
|
|
61
65
|
};
|
|
62
66
|
export var columnControlsDecoration = function columnControlsDecoration(props) {
|
|
63
|
-
|
|
67
|
+
if (getBooleanFF('platform.editor.table.column-controls-styles-updated')) {
|
|
68
|
+
return css(_templateObject19 || (_templateObject19 = _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 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\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.ROW_CONTROLS_WRAPPER, tableBorderColor(props), lineMarkerSize, lineMarkerSize, tableToolbarSize + tableCellBorderWidth, 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));
|
|
69
|
+
} else {
|
|
70
|
+
return css(_templateObject20 || (_templateObject20 = _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 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\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.ROW_CONTROLS_WRAPPER, tableBorderColor(props), lineMarkerSize, lineMarkerSize, tableToolbarSize + tableCellBorderWidth, 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));
|
|
71
|
+
}
|
|
64
72
|
};
|
|
65
73
|
export var hoveredDeleteButton = function hoveredDeleteButton(props) {
|
|
66
|
-
return css(
|
|
74
|
+
return css(_templateObject21 || (_templateObject21 = _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));
|
|
67
75
|
};
|
|
68
76
|
export var hoveredCell = function hoveredCell(props) {
|
|
69
|
-
return css(
|
|
77
|
+
return css(_templateObject22 || (_templateObject22 = _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));
|
|
70
78
|
};
|
|
71
|
-
export var hoveredWarningCell = css(
|
|
79
|
+
export var hoveredWarningCell = css(_templateObject23 || (_templateObject23 = _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, ")"));
|
|
72
80
|
|
|
73
81
|
// move the resize handle zone completely inside the table cell to avoid overflow
|
|
74
82
|
var getLastColumnResizerOverrides = function getLastColumnResizerOverrides() {
|
|
75
|
-
return getBooleanFF('platform.editor.custom-table-width') ? css(
|
|
83
|
+
return getBooleanFF('platform.editor.custom-table-width') ? css(_templateObject24 || (_templateObject24 = _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) : '';
|
|
76
84
|
};
|
|
77
85
|
export var resizeHandle = function resizeHandle(props) {
|
|
78
|
-
return css(
|
|
86
|
+
return css(_templateObject25 || (_templateObject25 = _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 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\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(), 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, ClassName.WITH_RESIZE_LINE, ClassName.RESIZE_HANDLE_DECORATION, ClassName.WITH_RESIZE_LINE, ClassName.RESIZE_HANDLE_DECORATION, tableToolbarSize + tableCellBorderWidth, tableToolbarSize + tableCellBorderWidth);
|
|
79
87
|
};
|
|
@@ -53,7 +53,7 @@ export var withEditorAnalyticsAPI = function withEditorAnalyticsAPI(payload) {
|
|
|
53
53
|
return command(state, function (tr) {
|
|
54
54
|
var dynamicPayload = payload instanceof Function ? payload(state) : payload;
|
|
55
55
|
if (dynamicPayload) {
|
|
56
|
-
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0
|
|
56
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent(dynamicPayload)(tr);
|
|
57
57
|
}
|
|
58
58
|
if (dispatch) {
|
|
59
59
|
dispatch(tr);
|
|
@@ -91,7 +91,7 @@ export var getMousePositionHorizontalRelativeByElement = function getMousePositi
|
|
|
91
91
|
var width, x;
|
|
92
92
|
var closestCell = element.closest(SELECTOR_TABLE_LEAFS);
|
|
93
93
|
var id = (_closestCell$id = closestCell === null || closestCell === void 0 ? void 0 : closestCell.id) !== null && _closestCell$id !== void 0 ? _closestCell$id : '';
|
|
94
|
-
width = (_elementContentRects$ = elementContentRects === null || elementContentRects === void 0
|
|
94
|
+
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;
|
|
95
95
|
x = mouseEvent.offsetX;
|
|
96
96
|
if (width <= 0) {
|
|
97
97
|
return null;
|
|
@@ -57,7 +57,7 @@ export var transformSliceToFixHardBreakProblemOnCopyFromCell = function transfor
|
|
|
57
57
|
return slice;
|
|
58
58
|
};
|
|
59
59
|
export var transformSliceToRemoveOpenTable = function transformSliceToRemoveOpenTable(slice, schema) {
|
|
60
|
-
var _slice$content$
|
|
60
|
+
var _slice$content$firstC2;
|
|
61
61
|
// we're removing the table, tableRow and tableCell reducing the open depth by 3
|
|
62
62
|
var depthDecrement = 3;
|
|
63
63
|
|
|
@@ -67,14 +67,14 @@ export var transformSliceToRemoveOpenTable = function transformSliceToRemoveOpen
|
|
|
67
67
|
slice.openStart >= 4 && slice.openEnd >= 4 &&
|
|
68
68
|
// slice is a table node
|
|
69
69
|
slice.content.childCount === 1 && slice.content.firstChild.type === schema.nodes.table) {
|
|
70
|
-
var _slice$content$firstC
|
|
70
|
+
var _slice$content$firstC;
|
|
71
71
|
// prosemirror-view has a bug that it duplicates table entry when selecting multiple paragraphs in a table cell.
|
|
72
72
|
// https://github.com/ProseMirror/prosemirror/issues/1270
|
|
73
73
|
// The structure becomes
|
|
74
74
|
// table(genuine) > tableRow(genuine) > table(duplicated) > tableRow(duplicated) > tableCell/tableHeader(genuine) > contents(genuine)
|
|
75
75
|
// As we are removing wrapping table anyway, we keep duplicated table and tableRow for simplicity
|
|
76
76
|
var cleaned = slice;
|
|
77
|
-
if (((_slice$content$firstC = slice.content.firstChild) === null || _slice$content$firstC === void 0
|
|
77
|
+
if (((_slice$content$firstC = slice.content.firstChild) === null || _slice$content$firstC === void 0 || (_slice$content$firstC = _slice$content$firstC.content) === null || _slice$content$firstC === void 0 || (_slice$content$firstC = _slice$content$firstC.firstChild) === null || _slice$content$firstC === void 0 || (_slice$content$firstC = _slice$content$firstC.content) === null || _slice$content$firstC === void 0 || (_slice$content$firstC = _slice$content$firstC.firstChild) === null || _slice$content$firstC === void 0 ? void 0 : _slice$content$firstC.type) === schema.nodes.table) {
|
|
78
78
|
cleaned = new Slice(slice.content.firstChild.content.firstChild.content, slice.openStart - 2, slice.openEnd - 2);
|
|
79
79
|
}
|
|
80
80
|
return new Slice(flatmap(cleaned.content, unwrapContentFromTable), cleaned.openStart - depthDecrement, cleaned.openEnd - depthDecrement);
|
|
@@ -85,7 +85,7 @@ export var transformSliceToRemoveOpenTable = function transformSliceToRemoveOpen
|
|
|
85
85
|
// starts inside of a cell but ends outside of the starting table
|
|
86
86
|
slice.openStart >= 4 &&
|
|
87
87
|
// slice starts from a table node (and spans across more than one node)
|
|
88
|
-
slice.content.childCount > 1 && ((_slice$content$
|
|
88
|
+
slice.content.childCount > 1 && ((_slice$content$firstC2 = slice.content.firstChild) === null || _slice$content$firstC2 === void 0 ? void 0 : _slice$content$firstC2.type) === schema.nodes.table) {
|
|
89
89
|
// repoint the slice's cutting depth so that cell content where the slice starts
|
|
90
90
|
// does not get lifted out of the cell on paste
|
|
91
91
|
return new Slice(slice.content, 1, slice.openEnd);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.3",
|
|
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.5.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",
|
|
@@ -106,6 +106,9 @@
|
|
|
106
106
|
"platform.editor.table-sticky-scrollbar": {
|
|
107
107
|
"type": "boolean"
|
|
108
108
|
},
|
|
109
|
+
"platform.editor.table.column-controls-styles-updated": {
|
|
110
|
+
"type": "boolean"
|
|
111
|
+
},
|
|
109
112
|
"platform.editor.update-table-cell-width-via-step": {
|
|
110
113
|
"type": "boolean"
|
|
111
114
|
},
|
|
@@ -194,6 +194,50 @@ const breakoutWidthStyling = () => {
|
|
|
194
194
|
`;
|
|
195
195
|
};
|
|
196
196
|
|
|
197
|
+
const tableBorderStyles = (
|
|
198
|
+
props: ThemeProps & { featureFlags?: FeatureFlags },
|
|
199
|
+
) => {
|
|
200
|
+
if (getBooleanFF('platform.editor.table.column-controls-styles-updated')) {
|
|
201
|
+
return `border-color: ${tableBorderDeleteColor(props)}`;
|
|
202
|
+
} else {
|
|
203
|
+
return `border: 1px solid ${tableBorderDeleteColor(props)}`;
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
const tableStickyHeaderColumnControlsDecorationsStyle = (
|
|
208
|
+
props: ThemeProps & { featureFlags?: FeatureFlags },
|
|
209
|
+
) => {
|
|
210
|
+
if (getBooleanFF('platform.editor.table.column-controls-styles-updated')) {
|
|
211
|
+
return css`
|
|
212
|
+
.${ClassName.TABLE_STICKY} .${ClassName.COLUMN_CONTROLS_DECORATIONS} {
|
|
213
|
+
z-index: 0;
|
|
214
|
+
left: -1px;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.${ClassName.TABLE_STICKY}
|
|
218
|
+
.${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
|
|
219
|
+
border-left: 1px solid ${tableBorderColor(props)};
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.${ClassName.TABLE_STICKY}
|
|
223
|
+
tr:first-of-type
|
|
224
|
+
th.${ClassName.TABLE_HEADER_CELL} {
|
|
225
|
+
&.${ClassName.COLUMN_SELECTED}, &.${ClassName.HOVERED_COLUMN} {
|
|
226
|
+
.${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
|
|
227
|
+
left: 0;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
`;
|
|
232
|
+
} else {
|
|
233
|
+
return css`
|
|
234
|
+
.${ClassName.TABLE_STICKY} .${ClassName.COLUMN_CONTROLS_DECORATIONS} {
|
|
235
|
+
z-index: 0;
|
|
236
|
+
}
|
|
237
|
+
`;
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
|
|
197
241
|
const tableWrapperStyles = () => {
|
|
198
242
|
if (getBooleanFF('platform.editor.custom-table-width')) {
|
|
199
243
|
return css`
|
|
@@ -323,9 +367,7 @@ export const tableStyles = (
|
|
|
323
367
|
width: ${tableToolbarSize}px;
|
|
324
368
|
}
|
|
325
369
|
|
|
326
|
-
|
|
327
|
-
z-index: 0;
|
|
328
|
-
}
|
|
370
|
+
${tableStickyHeaderColumnControlsDecorationsStyle(props)}
|
|
329
371
|
|
|
330
372
|
.${ClassName.TABLE_STICKY}
|
|
331
373
|
.${ClassName.ROW_CONTROLS}
|
|
@@ -798,7 +840,7 @@ export const tableStyles = (
|
|
|
798
840
|
pointer-events: none;
|
|
799
841
|
}
|
|
800
842
|
&.${ClassName.HOVERED_CELL_IN_DANGER}::after {
|
|
801
|
-
|
|
843
|
+
${tableBorderStyles(props)};
|
|
802
844
|
z-index: ${akEditorUnitZIndex * 100};
|
|
803
845
|
}
|
|
804
846
|
}
|
|
@@ -313,19 +313,36 @@ export const OverflowShadow = (props: ThemeProps) => css`
|
|
|
313
313
|
}
|
|
314
314
|
`;
|
|
315
315
|
|
|
316
|
-
const columnHeaderButton = (props: ThemeProps, cssString?: string) =>
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
316
|
+
const columnHeaderButton = (props: ThemeProps, cssString?: string) => {
|
|
317
|
+
if (getBooleanFF('platform.editor.table.column-controls-styles-updated')) {
|
|
318
|
+
return css`
|
|
319
|
+
background: ${tableHeaderCellBackgroundColor(props)};
|
|
320
|
+
display: block;
|
|
321
|
+
box-sizing: border-box;
|
|
322
|
+
padding: 0;
|
|
323
|
+
|
|
324
|
+
:focus {
|
|
325
|
+
outline: none;
|
|
326
|
+
}
|
|
326
327
|
|
|
327
|
-
|
|
328
|
-
`;
|
|
328
|
+
${cssString}
|
|
329
|
+
`;
|
|
330
|
+
} else {
|
|
331
|
+
return css`
|
|
332
|
+
background: ${tableHeaderCellBackgroundColor(props)};
|
|
333
|
+
border: 1px solid ${tableBorderColor(props)};
|
|
334
|
+
display: block;
|
|
335
|
+
box-sizing: border-box;
|
|
336
|
+
padding: 0;
|
|
337
|
+
|
|
338
|
+
:focus {
|
|
339
|
+
outline: none;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
${cssString}
|
|
343
|
+
`;
|
|
344
|
+
}
|
|
345
|
+
};
|
|
329
346
|
|
|
330
347
|
const columnHeaderButtonSelected = (props: ThemeProps) => css`
|
|
331
348
|
color: ${token('color.text.inverse', N0)};
|
|
@@ -357,104 +374,232 @@ const getFloatingDotOverrides = (props: ThemeProps) => {
|
|
|
357
374
|
: '';
|
|
358
375
|
};
|
|
359
376
|
|
|
360
|
-
export const columnControlsDecoration = (props: ThemeProps) =>
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
377
|
+
export const columnControlsDecoration = (props: ThemeProps) => {
|
|
378
|
+
if (getBooleanFF('platform.editor.table.column-controls-styles-updated')) {
|
|
379
|
+
return css`
|
|
380
|
+
.${ClassName.COLUMN_CONTROLS_DECORATIONS} {
|
|
381
|
+
display: none;
|
|
382
|
+
cursor: pointer;
|
|
383
|
+
position: absolute;
|
|
384
|
+
width: 100%;
|
|
385
|
+
left: 0;
|
|
386
|
+
top: -${columnControlsDecorationHeight + tableCellBorderWidth}px;
|
|
387
|
+
height: ${columnControlsDecorationHeight}px;
|
|
388
|
+
// floating dot for adding column button
|
|
389
|
+
&::before {
|
|
390
|
+
content: ' ';
|
|
391
|
+
background-color: ${tableBorderColor(props)};
|
|
392
|
+
position: absolute;
|
|
393
|
+
height: ${lineMarkerSize}px;
|
|
394
|
+
width: ${lineMarkerSize}px;
|
|
395
|
+
border-radius: 50%;
|
|
396
|
+
pointer-events: none;
|
|
397
|
+
top: 2px;
|
|
398
|
+
right: -1px;
|
|
399
|
+
}
|
|
381
400
|
|
|
382
|
-
|
|
383
|
-
|
|
401
|
+
&::after {
|
|
402
|
+
content: ' ';
|
|
384
403
|
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
404
|
+
${columnHeaderButton(
|
|
405
|
+
props,
|
|
406
|
+
`
|
|
388
407
|
border-right: ${tableCellBorderWidth}px solid ${tableBorderColor(
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
border-
|
|
392
|
-
|
|
408
|
+
props,
|
|
409
|
+
)};
|
|
410
|
+
border-top: ${tableCellBorderWidth}px solid ${tableBorderColor(props)};
|
|
411
|
+
border-bottom: ${tableCellBorderWidth}px solid ${tableBorderColor(
|
|
412
|
+
props,
|
|
413
|
+
)};
|
|
414
|
+
box-sizing: content-box;
|
|
415
|
+
height: ${tableToolbarSize - 1}px;
|
|
393
416
|
width: 100%;
|
|
394
417
|
position: absolute;
|
|
395
418
|
top: ${columnControlsDecorationHeight - tableToolbarSize}px;
|
|
396
419
|
left: 0px;
|
|
397
420
|
z-index: ${columnControlsZIndex};
|
|
398
421
|
`,
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
422
|
+
)}
|
|
423
|
+
}
|
|
424
|
+
}
|
|
402
425
|
|
|
403
|
-
|
|
404
|
-
|
|
426
|
+
// floating dot for adding column button - overriding style on last column to avoid scroll
|
|
427
|
+
${getFloatingDotOverrides(props)}
|
|
405
428
|
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
429
|
+
div.${ClassName.WITH_CONTROLS}>.${ClassName.ROW_CONTROLS_WRAPPER}::after {
|
|
430
|
+
content: ' ';
|
|
431
|
+
background-color: ${tableBorderColor(props)};
|
|
432
|
+
position: absolute;
|
|
433
|
+
height: ${lineMarkerSize}px;
|
|
434
|
+
width: ${lineMarkerSize}px;
|
|
435
|
+
border-radius: 50%;
|
|
436
|
+
pointer-events: none;
|
|
437
|
+
top: -${tableToolbarSize + tableCellBorderWidth}px;
|
|
438
|
+
right: -1px;
|
|
439
|
+
}
|
|
417
440
|
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
441
|
+
.${ClassName.WITH_CONTROLS} .${ClassName.COLUMN_CONTROLS_DECORATIONS} {
|
|
442
|
+
display: block;
|
|
443
|
+
}
|
|
421
444
|
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
445
|
+
table tr:first-of-type th.${ClassName.TABLE_HEADER_CELL} {
|
|
446
|
+
&.${ClassName.COLUMN_SELECTED}, &.${ClassName.HOVERED_TABLE} {
|
|
447
|
+
.${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
|
|
448
|
+
${columnHeaderButtonSelected(props)};
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
&.${ClassName.HOVERED_CELL_IN_DANGER}
|
|
452
|
+
.${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
|
|
453
|
+
background-color: ${tableToolbarDeleteColor(props)};
|
|
454
|
+
border-color: ${tableBorderDeleteColor(props)};
|
|
455
|
+
z-index: ${akEditorUnitZIndex * 100};
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
table tr:first-of-type th.${ClassName.TABLE_HEADER_CELL} {
|
|
461
|
+
&.${ClassName.COLUMN_SELECTED}, &.${ClassName.HOVERED_COLUMN} {
|
|
462
|
+
.${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
|
|
463
|
+
${columnHeaderButtonSelected(props)};
|
|
464
|
+
border-left: ${tableCellBorderWidth}px solid
|
|
465
|
+
${tableBorderSelectedColor(props)};
|
|
466
|
+
left: -${tableCellBorderWidth}px;
|
|
467
|
+
}
|
|
468
|
+
}
|
|
433
469
|
}
|
|
434
470
|
|
|
435
|
-
|
|
471
|
+
table tr:first-of-type th.${ClassName.TABLE_HEADER_CELL} {
|
|
472
|
+
&.${ClassName.HOVERED_COLUMN} {
|
|
473
|
+
.${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
|
|
474
|
+
${columnHeaderButtonSelected(props)};
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
&.${ClassName.HOVERED_CELL_IN_DANGER}
|
|
478
|
+
.${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
|
|
479
|
+
background-color: ${tableToolbarDeleteColor(props)};
|
|
480
|
+
border-color: ${tableBorderDeleteColor(props)};
|
|
481
|
+
border-left: ${tableCellBorderWidth}px solid
|
|
482
|
+
${tableBorderDeleteColor(props)};
|
|
483
|
+
left: -${tableCellBorderWidth}px;
|
|
484
|
+
z-index: ${akEditorUnitZIndex * 100};
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
.${ClassName.TABLE_SELECTED}
|
|
490
|
+
table
|
|
491
|
+
tr:first-of-type
|
|
492
|
+
td.${ClassName.TABLE_CELL},
|
|
493
|
+
.${ClassName.TABLE_SELECTED}
|
|
494
|
+
table
|
|
495
|
+
tr:first-of-type
|
|
496
|
+
th.${ClassName.TABLE_HEADER_CELL} {
|
|
436
497
|
.${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
|
|
437
|
-
|
|
438
|
-
|
|
498
|
+
${columnHeaderButtonSelected(props)};
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
`;
|
|
502
|
+
} else {
|
|
503
|
+
return css`
|
|
504
|
+
.${ClassName.COLUMN_CONTROLS_DECORATIONS} {
|
|
505
|
+
display: none;
|
|
506
|
+
cursor: pointer;
|
|
507
|
+
position: absolute;
|
|
508
|
+
width: calc(100% + ${tableCellBorderWidth * 2}px);
|
|
509
|
+
left: -1px;
|
|
510
|
+
top: -${columnControlsDecorationHeight + tableCellBorderWidth}px;
|
|
511
|
+
height: ${columnControlsDecorationHeight}px;
|
|
512
|
+
// floating dot for adding column button
|
|
513
|
+
&::before {
|
|
514
|
+
content: ' ';
|
|
515
|
+
background-color: ${tableBorderColor(props)};
|
|
516
|
+
position: absolute;
|
|
517
|
+
height: ${lineMarkerSize}px;
|
|
518
|
+
width: ${lineMarkerSize}px;
|
|
519
|
+
border-radius: 50%;
|
|
520
|
+
pointer-events: none;
|
|
521
|
+
top: 2px;
|
|
522
|
+
right: -1px;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
&::after {
|
|
526
|
+
content: ' ';
|
|
527
|
+
|
|
528
|
+
${columnHeaderButton(
|
|
529
|
+
props,
|
|
530
|
+
`
|
|
531
|
+
border-right: ${tableCellBorderWidth}px solid ${tableBorderColor(
|
|
532
|
+
props,
|
|
533
|
+
)};
|
|
439
534
|
border-bottom: none;
|
|
440
|
-
|
|
535
|
+
height: ${tableToolbarSize}px;
|
|
536
|
+
width: 100%;
|
|
537
|
+
position: absolute;
|
|
538
|
+
top: ${columnControlsDecorationHeight - tableToolbarSize}px;
|
|
539
|
+
left: 0px;
|
|
540
|
+
z-index: ${columnControlsZIndex};
|
|
541
|
+
`,
|
|
542
|
+
)}
|
|
543
|
+
}
|
|
441
544
|
}
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
545
|
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
546
|
+
// floating dot for adding column button - overriding style on last column to avoid scroll
|
|
547
|
+
${getFloatingDotOverrides(props)}
|
|
548
|
+
|
|
549
|
+
div.${ClassName.WITH_CONTROLS}>.${ClassName.ROW_CONTROLS_WRAPPER}::after {
|
|
550
|
+
content: ' ';
|
|
551
|
+
background-color: ${tableBorderColor(props)};
|
|
552
|
+
position: absolute;
|
|
553
|
+
height: ${lineMarkerSize}px;
|
|
554
|
+
width: ${lineMarkerSize}px;
|
|
555
|
+
border-radius: 50%;
|
|
556
|
+
pointer-events: none;
|
|
557
|
+
top: -${tableToolbarSize + tableCellBorderWidth}px;
|
|
558
|
+
right: -1px;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
.${ClassName.WITH_CONTROLS} .${ClassName.COLUMN_CONTROLS_DECORATIONS} {
|
|
562
|
+
display: block;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
table
|
|
566
|
+
tr:first-of-type
|
|
567
|
+
td.${ClassName.TABLE_CELL},
|
|
568
|
+
table
|
|
569
|
+
tr:first-of-type
|
|
570
|
+
th.${ClassName.TABLE_HEADER_CELL} {
|
|
571
|
+
&.${ClassName.COLUMN_SELECTED},
|
|
572
|
+
&.${ClassName.HOVERED_COLUMN},
|
|
573
|
+
&.${ClassName.HOVERED_TABLE} {
|
|
574
|
+
.${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
|
|
575
|
+
${columnHeaderButtonSelected(props)};
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
&.${ClassName.HOVERED_CELL_IN_DANGER}
|
|
579
|
+
.${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
|
|
580
|
+
background-color: ${tableToolbarDeleteColor(props)};
|
|
581
|
+
border: 1px solid ${tableBorderDeleteColor(props)};
|
|
582
|
+
border-bottom: none;
|
|
583
|
+
z-index: ${akEditorUnitZIndex * 100};
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
.${ClassName.TABLE_SELECTED}
|
|
589
|
+
table
|
|
590
|
+
tr:first-of-type
|
|
591
|
+
td.${ClassName.TABLE_CELL},
|
|
592
|
+
.${ClassName.TABLE_SELECTED}
|
|
593
|
+
table
|
|
594
|
+
tr:first-of-type
|
|
595
|
+
th.${ClassName.TABLE_HEADER_CELL} {
|
|
596
|
+
.${ClassName.COLUMN_CONTROLS_DECORATIONS}::after {
|
|
597
|
+
${columnHeaderButtonSelected(props)};
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
`;
|
|
456
601
|
}
|
|
457
|
-
|
|
602
|
+
};
|
|
458
603
|
|
|
459
604
|
export const hoveredDeleteButton = (props: ThemeProps) => css`
|
|
460
605
|
.${ClassName.TABLE_CONTAINER}.${ClassName.HOVERED_DELETE_BUTTON} {
|