@atlaskit/editor-plugin-table 22.2.4 → 22.2.7
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 +21 -0
- package/dist/cjs/nodeviews/TableComponent.js +3 -2
- package/dist/cjs/nodeviews/TableContainer.js +16 -7
- package/dist/cjs/nodeviews/TableResizer.js +30 -16
- package/dist/cjs/pm-plugins/analytics/commands.js +4 -0
- package/dist/cjs/pm-plugins/commands/hover.js +4 -0
- package/dist/cjs/pm-plugins/commands/referentiality.js +4 -0
- package/dist/cjs/pm-plugins/drag-and-drop/commands.js +4 -0
- package/dist/cjs/pm-plugins/drag-and-drop/plugin.js +2 -0
- package/dist/cjs/pm-plugins/drag-and-drop/utils/autoscrollers.js +4 -0
- package/dist/cjs/pm-plugins/sticky-headers/commands.js +2 -0
- package/dist/cjs/pm-plugins/table-resizing/plugin-factory.js +5 -0
- package/dist/cjs/pm-plugins/table-resizing/utils/colgroup.js +6 -6
- package/dist/cjs/pm-plugins/table-resizing/utils/consts.js +3 -2
- package/dist/cjs/pm-plugins/table-resizing/utils/scale-table.js +4 -4
- package/dist/cjs/pm-plugins/utils/drag-menu.js +2 -2
- package/dist/cjs/ui/ColumnResizeWidget/index.js +1 -1
- package/dist/cjs/ui/DragHandle/index.js +2 -0
- package/dist/cjs/ui/FloatingAlignmentButtons/FloatingAlignmentButtons.js +1 -1
- package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +4 -4
- package/dist/cjs/ui/FloatingDeleteButton/DeleteButton.js +4 -1
- package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +4 -1
- package/dist/cjs/ui/FloatingInsertButton/InsertButton.js +6 -1
- package/dist/cjs/ui/FloatingInsertButton/index.js +3 -2
- package/dist/cjs/ui/SizeSelector/index.js +1 -1
- package/dist/cjs/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +1 -1
- package/dist/cjs/ui/TableFloatingControls/CornerControls/DragCornerControls.js +4 -0
- package/dist/cjs/ui/TableFloatingControls/RowControls/ClassicControls.js +1 -1
- package/dist/cjs/ui/TableFloatingControls/index.js +1 -1
- package/dist/cjs/ui/global-styles.js +1 -1
- package/dist/es2019/nodeviews/TableComponent.js +4 -1
- package/dist/es2019/nodeviews/TableContainer.js +17 -8
- package/dist/es2019/nodeviews/TableResizer.js +31 -17
- package/dist/es2019/pm-plugins/analytics/commands.js +3 -0
- package/dist/es2019/pm-plugins/commands/hover.js +3 -0
- package/dist/es2019/pm-plugins/commands/referentiality.js +3 -0
- package/dist/es2019/pm-plugins/drag-and-drop/commands.js +4 -0
- package/dist/es2019/pm-plugins/drag-and-drop/plugin.js +2 -0
- package/dist/es2019/pm-plugins/drag-and-drop/utils/autoscrollers.js +3 -0
- package/dist/es2019/pm-plugins/sticky-headers/commands.js +2 -0
- package/dist/es2019/pm-plugins/table-resizing/plugin-factory.js +5 -0
- package/dist/es2019/pm-plugins/table-resizing/utils/colgroup.js +6 -6
- package/dist/es2019/pm-plugins/table-resizing/utils/consts.js +2 -1
- package/dist/es2019/pm-plugins/table-resizing/utils/scale-table.js +4 -4
- package/dist/es2019/pm-plugins/utils/drag-menu.js +2 -2
- package/dist/es2019/ui/ColumnResizeWidget/index.js +1 -1
- package/dist/es2019/ui/DragHandle/index.js +2 -0
- package/dist/es2019/ui/FloatingAlignmentButtons/FloatingAlignmentButtons.js +1 -1
- package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +5 -2
- package/dist/es2019/ui/FloatingDeleteButton/DeleteButton.js +4 -1
- package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +4 -1
- package/dist/es2019/ui/FloatingInsertButton/InsertButton.js +6 -1
- package/dist/es2019/ui/FloatingInsertButton/index.js +4 -1
- package/dist/es2019/ui/SizeSelector/index.js +1 -1
- package/dist/es2019/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +2 -0
- package/dist/es2019/ui/TableFloatingControls/CornerControls/DragCornerControls.js +4 -0
- package/dist/es2019/ui/TableFloatingControls/RowControls/ClassicControls.js +2 -0
- package/dist/es2019/ui/TableFloatingControls/index.js +2 -2
- package/dist/es2019/ui/global-styles.js +2 -2
- package/dist/esm/nodeviews/TableComponent.js +3 -2
- package/dist/esm/nodeviews/TableContainer.js +17 -8
- package/dist/esm/nodeviews/TableResizer.js +31 -17
- package/dist/esm/pm-plugins/analytics/commands.js +3 -0
- package/dist/esm/pm-plugins/commands/hover.js +3 -0
- package/dist/esm/pm-plugins/commands/referentiality.js +3 -0
- package/dist/esm/pm-plugins/drag-and-drop/commands.js +4 -0
- package/dist/esm/pm-plugins/drag-and-drop/plugin.js +2 -0
- package/dist/esm/pm-plugins/drag-and-drop/utils/autoscrollers.js +3 -0
- package/dist/esm/pm-plugins/sticky-headers/commands.js +2 -0
- package/dist/esm/pm-plugins/table-resizing/plugin-factory.js +5 -0
- package/dist/esm/pm-plugins/table-resizing/utils/colgroup.js +6 -6
- package/dist/esm/pm-plugins/table-resizing/utils/consts.js +2 -1
- package/dist/esm/pm-plugins/table-resizing/utils/scale-table.js +4 -4
- package/dist/esm/pm-plugins/utils/drag-menu.js +2 -2
- package/dist/esm/ui/ColumnResizeWidget/index.js +1 -1
- package/dist/esm/ui/DragHandle/index.js +2 -0
- package/dist/esm/ui/FloatingAlignmentButtons/FloatingAlignmentButtons.js +1 -1
- package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +5 -2
- package/dist/esm/ui/FloatingDeleteButton/DeleteButton.js +4 -1
- package/dist/esm/ui/FloatingDragMenu/DragMenu.js +4 -1
- package/dist/esm/ui/FloatingInsertButton/InsertButton.js +6 -1
- package/dist/esm/ui/FloatingInsertButton/index.js +4 -1
- package/dist/esm/ui/SizeSelector/index.js +1 -1
- package/dist/esm/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +1 -1
- package/dist/esm/ui/TableFloatingControls/CornerControls/DragCornerControls.js +4 -0
- package/dist/esm/ui/TableFloatingControls/RowControls/ClassicControls.js +1 -1
- package/dist/esm/ui/TableFloatingControls/index.js +2 -2
- package/dist/esm/ui/global-styles.js +2 -2
- package/dist/types/nodeviews/TableComponent.d.ts +3 -3
- package/dist/types/nodeviews/TableResizer.d.ts +2 -1
- package/dist/types/nodeviews/table-node-views.d.ts +3 -3
- package/dist/types/nodeviews/table.d.ts +2 -2
- package/dist/types/pm-plugins/analytics/commands.d.ts +2 -1
- package/dist/types/pm-plugins/analytics/plugin.d.ts +2 -1
- package/dist/types/pm-plugins/commands/hover.d.ts +10 -9
- package/dist/types/pm-plugins/commands/misc.d.ts +1 -1
- package/dist/types/pm-plugins/commands/referentiality.d.ts +2 -1
- package/dist/types/pm-plugins/commands/toggle.d.ts +1 -1
- package/dist/types/pm-plugins/decorations/plugin.d.ts +1 -1
- package/dist/types/pm-plugins/drag-and-drop/commands.d.ts +6 -5
- package/dist/types/pm-plugins/drag-and-drop/plugin.d.ts +2 -1
- package/dist/types/pm-plugins/drag-and-drop/utils/autoscrollers.d.ts +2 -1
- package/dist/types/pm-plugins/main.d.ts +2 -2
- package/dist/types/pm-plugins/sticky-headers/commands.d.ts +3 -2
- package/dist/types/pm-plugins/sticky-headers/plugin.d.ts +2 -1
- package/dist/types/pm-plugins/sticky-headers/util.d.ts +2 -2
- package/dist/types/pm-plugins/table-anchor-names/plugin.d.ts +1 -1
- package/dist/types/pm-plugins/table-resizing/plugin-factory.d.ts +7 -4
- package/dist/types/pm-plugins/table-resizing/utils/colgroup.d.ts +2 -2
- package/dist/types/pm-plugins/table-resizing/utils/consts.d.ts +1 -0
- package/dist/types/pm-plugins/table-resizing/utils/scale-table.d.ts +2 -2
- package/dist/types/pm-plugins/utils/create.d.ts +2 -2
- package/dist/types/pm-plugins/utils/sticky-header.d.ts +2 -1
- package/dist/types/types/index.d.ts +26 -26
- package/dist/types/ui/ColumnResizeWidget/index.d.ts +1 -1
- package/dist/types/ui/DragHandle/index.d.ts +2 -2
- package/dist/types/ui/FloatingContextualButton/styles.d.ts +3 -2
- package/dist/types/ui/FloatingContextualMenu/ContextualMenu.d.ts +3 -3
- package/dist/types/ui/FloatingContextualMenu/styles.d.ts +3 -2
- package/dist/types/ui/FloatingDeleteButton/DeleteButton.d.ts +3 -3
- package/dist/types/ui/FloatingDragMenu/DragMenu.d.ts +3 -3
- package/dist/types/ui/FloatingInsertButton/InsertButton.d.ts +4 -4
- package/dist/types/ui/FloatingInsertButton/index.d.ts +3 -3
- package/dist/types/ui/TableFloatingControls/CornerControls/ClassicCornerControls.d.ts +2 -2
- package/dist/types/ui/TableFloatingControls/CornerControls/DragCornerControls.d.ts +3 -3
- package/dist/types/ui/TableFloatingControls/RowControls/ClassicControls.d.ts +2 -2
- package/dist/types/ui/common-styles.d.ts +5 -4
- package/dist/types/ui/consts.d.ts +18 -18
- package/dist/types/ui/ui-styles.d.ts +21 -20
- package/dist/types-ts4.5/nodeviews/TableComponent.d.ts +3 -3
- package/dist/types-ts4.5/nodeviews/TableResizer.d.ts +2 -1
- package/dist/types-ts4.5/nodeviews/table-node-views.d.ts +3 -3
- package/dist/types-ts4.5/nodeviews/table.d.ts +2 -2
- package/dist/types-ts4.5/pm-plugins/analytics/commands.d.ts +2 -1
- package/dist/types-ts4.5/pm-plugins/analytics/plugin.d.ts +2 -1
- package/dist/types-ts4.5/pm-plugins/commands/hover.d.ts +10 -9
- package/dist/types-ts4.5/pm-plugins/commands/misc.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/commands/referentiality.d.ts +2 -1
- package/dist/types-ts4.5/pm-plugins/commands/toggle.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/decorations/plugin.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/drag-and-drop/commands.d.ts +6 -5
- package/dist/types-ts4.5/pm-plugins/drag-and-drop/plugin.d.ts +2 -1
- package/dist/types-ts4.5/pm-plugins/drag-and-drop/utils/autoscrollers.d.ts +2 -1
- package/dist/types-ts4.5/pm-plugins/main.d.ts +2 -2
- package/dist/types-ts4.5/pm-plugins/sticky-headers/commands.d.ts +3 -2
- package/dist/types-ts4.5/pm-plugins/sticky-headers/plugin.d.ts +2 -1
- package/dist/types-ts4.5/pm-plugins/sticky-headers/util.d.ts +2 -2
- package/dist/types-ts4.5/pm-plugins/table-anchor-names/plugin.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/table-resizing/plugin-factory.d.ts +7 -4
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/colgroup.d.ts +2 -2
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/consts.d.ts +1 -0
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/scale-table.d.ts +2 -2
- package/dist/types-ts4.5/pm-plugins/utils/create.d.ts +2 -2
- package/dist/types-ts4.5/pm-plugins/utils/sticky-header.d.ts +2 -1
- package/dist/types-ts4.5/types/index.d.ts +26 -26
- package/dist/types-ts4.5/ui/ColumnResizeWidget/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/DragHandle/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/FloatingContextualButton/styles.d.ts +3 -2
- package/dist/types-ts4.5/ui/FloatingContextualMenu/ContextualMenu.d.ts +3 -3
- package/dist/types-ts4.5/ui/FloatingContextualMenu/styles.d.ts +3 -2
- package/dist/types-ts4.5/ui/FloatingDeleteButton/DeleteButton.d.ts +3 -3
- package/dist/types-ts4.5/ui/FloatingDragMenu/DragMenu.d.ts +3 -3
- package/dist/types-ts4.5/ui/FloatingInsertButton/InsertButton.d.ts +4 -4
- package/dist/types-ts4.5/ui/FloatingInsertButton/index.d.ts +3 -3
- package/dist/types-ts4.5/ui/TableFloatingControls/CornerControls/ClassicCornerControls.d.ts +2 -2
- package/dist/types-ts4.5/ui/TableFloatingControls/CornerControls/DragCornerControls.d.ts +3 -3
- package/dist/types-ts4.5/ui/TableFloatingControls/RowControls/ClassicControls.d.ts +2 -2
- package/dist/types-ts4.5/ui/common-styles.d.ts +5 -4
- package/dist/types-ts4.5/ui/consts.d.ts +18 -18
- package/dist/types-ts4.5/ui/ui-styles.d.ts +21 -20
- package/package.json +4 -4
|
@@ -11,7 +11,7 @@ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
|
11
11
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
12
12
|
import { setTableAlignmentWithTableContentWithPosWithAnalytics } from '../pm-plugins/commands/commands-with-analytics';
|
|
13
13
|
import { getPluginState } from '../pm-plugins/plugin-factory';
|
|
14
|
-
import { TABLE_MAX_WIDTH, TABLE_FULL_WIDTH, TABLE_OFFSET_IN_COMMENT_EDITOR } from '../pm-plugins/table-resizing/utils/consts';
|
|
14
|
+
import { TABLE_MAX_WIDTH, TABLE_FULL_WIDTH, TABLE_OFFSET_IN_COMMENT_EDITOR, RESIZE_HANDLE_SPACING } from '../pm-plugins/table-resizing/utils/consts';
|
|
15
15
|
import { getTableResizerContainerMaxWidthInCSS, getTableResizerContainerForFullPageWidthInCSS } from '../pm-plugins/table-resizing/utils/misc';
|
|
16
16
|
import { ALIGN_CENTER, ALIGN_START } from '../pm-plugins/utils/alignment';
|
|
17
17
|
import { TableCssClassName as ClassName } from '../types';
|
|
@@ -208,7 +208,6 @@ export var ResizableTableContainer = /*#__PURE__*/React.memo(function (_ref4) {
|
|
|
208
208
|
var isFullPageAppearance = !isCommentEditor && !isChromelessEditor;
|
|
209
209
|
var _useMemo = useMemo(function () {
|
|
210
210
|
var responsiveContainerWidth = 0;
|
|
211
|
-
var resizeHandleSpacing = 12;
|
|
212
211
|
var padding = getPadding(containerWidth);
|
|
213
212
|
// When Full width or Max width editor enabled, a Mac OS user can change "ak-editor-content-area" width by
|
|
214
213
|
// updating Settings -> Appearance -> Show scroll bars from "When scrolling" to "Always". It causes
|
|
@@ -226,30 +225,39 @@ export var ResizableTableContainer = /*#__PURE__*/React.memo(function (_ref4) {
|
|
|
226
225
|
if (isTableScalingEnabled && Number.isFinite(lineLength) && lineLength !== undefined) {
|
|
227
226
|
responsiveContainerWidth = lineLength;
|
|
228
227
|
} else {
|
|
229
|
-
responsiveContainerWidth = containerWidth - padding * 2 -
|
|
228
|
+
responsiveContainerWidth = containerWidth - padding * 2 - RESIZE_HANDLE_SPACING;
|
|
230
229
|
}
|
|
231
230
|
} else if (isCommentEditor) {
|
|
232
231
|
responsiveContainerWidth = containerWidth - TABLE_OFFSET_IN_COMMENT_EDITOR;
|
|
232
|
+
} else if (isChromelessEditor && expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true)) {
|
|
233
|
+
// there's no padding included in chromeless appearance, so we need to reduce table
|
|
234
|
+
// width to ensure all controls are visible.
|
|
235
|
+
// use lineLength as the value is updated by scrollbar visibility changes
|
|
236
|
+
responsiveContainerWidth = Number.isFinite(lineLength) && lineLength !== undefined ? lineLength : containerWidth - RESIZE_HANDLE_SPACING;
|
|
233
237
|
} else {
|
|
234
238
|
// 76 is currently an accepted padding value considering the spacing for resizer handle
|
|
235
239
|
// containerWidth = width of a DIV with test id="ak-editor-fp-content-area". It is a parent of
|
|
236
240
|
// a DIV with className="ak-editor-content-area". This DIV has padding left and padding right.
|
|
237
241
|
// padding left = padding right = akEditorGutterPadding = 32
|
|
238
|
-
responsiveContainerWidth = isTableScalingEnabled ? containerWidth - padding * 2 : containerWidth - padding * 2 -
|
|
242
|
+
responsiveContainerWidth = isTableScalingEnabled ? containerWidth - padding * 2 : containerWidth - padding * 2 - RESIZE_HANDLE_SPACING;
|
|
239
243
|
}
|
|
240
244
|
|
|
241
245
|
// Fix for HOT-119925: Ensure table width is properly constrained and responsive
|
|
242
246
|
// For wide tables, ensure they don't exceed container width and can be scrolled
|
|
243
|
-
var calculatedWidth =
|
|
247
|
+
var calculatedWidth =
|
|
248
|
+
// remove isCommentEditor check if platform_editor_table_resize_chromeless is cleaned up
|
|
249
|
+
!node.attrs.width && (expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) && !isFullPageAppearance || isCommentEditor) ? responsiveContainerWidth : Math.min(tableWidth, responsiveContainerWidth);
|
|
244
250
|
|
|
245
251
|
// Ensure minimum width for usability while respecting container constraints
|
|
246
252
|
var width = Math.max(calculatedWidth, Math.min(responsiveContainerWidth * 0.5, 300));
|
|
247
|
-
|
|
253
|
+
|
|
254
|
+
// remove isCommentEditor check if platform_editor_table_resize_chromeless is cleaned up
|
|
255
|
+
var maxResizerWidth = expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) && !isFullPageAppearance || isCommentEditor ? responsiveContainerWidth : Math.min(responsiveContainerWidth, expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true) ? TABLE_MAX_WIDTH : TABLE_FULL_WIDTH);
|
|
248
256
|
return {
|
|
249
257
|
width: width,
|
|
250
258
|
maxResizerWidth: maxResizerWidth
|
|
251
259
|
};
|
|
252
|
-
}, [containerWidth, isCommentEditor, isFullWidthModeEnabled, isMaxWidthModeEnabled, isTableScalingEnabled, lineLength, node.attrs.width, tableWidth]),
|
|
260
|
+
}, [containerWidth, isCommentEditor, isChromelessEditor, isFullWidthModeEnabled, isMaxWidthModeEnabled, isFullPageAppearance, isTableScalingEnabled, lineLength, node.attrs.width, tableWidth]),
|
|
253
261
|
width = _useMemo.width,
|
|
254
262
|
maxResizerWidth = _useMemo.maxResizerWidth;
|
|
255
263
|
useEffect(function () {
|
|
@@ -299,7 +307,8 @@ export var ResizableTableContainer = /*#__PURE__*/React.memo(function (_ref4) {
|
|
|
299
307
|
pluginInjectionApi: pluginInjectionApi,
|
|
300
308
|
onResizeStart: onResizeStart,
|
|
301
309
|
onResizeStop: onResizeStop,
|
|
302
|
-
isCommentEditor: isCommentEditor
|
|
310
|
+
isCommentEditor: isCommentEditor,
|
|
311
|
+
isChromelessEditor: isChromelessEditor
|
|
303
312
|
};
|
|
304
313
|
var isLivePageViewMode = mode === 'view';
|
|
305
314
|
return /*#__PURE__*/React.createElement(AlignmentTableContainerWrapper, {
|
|
@@ -24,7 +24,7 @@ import { setTableAlignmentWithTableContentWithPosWithAnalytics } from '../pm-plu
|
|
|
24
24
|
import { updateWidthToWidest } from '../pm-plugins/commands/misc';
|
|
25
25
|
import { META_KEYS } from '../pm-plugins/table-analytics';
|
|
26
26
|
import { getColgroupChildrenLength } from '../pm-plugins/table-resizing/utils/colgroup';
|
|
27
|
-
import { COLUMN_MIN_WIDTH, TABLE_MAX_WIDTH, TABLE_FULL_WIDTH, TABLE_OFFSET_IN_COMMENT_EDITOR } from '../pm-plugins/table-resizing/utils/consts';
|
|
27
|
+
import { COLUMN_MIN_WIDTH, TABLE_MAX_WIDTH, TABLE_FULL_WIDTH, TABLE_OFFSET_IN_COMMENT_EDITOR, RESIZE_HANDLE_SPACING } from '../pm-plugins/table-resizing/utils/consts';
|
|
28
28
|
import { previewScaleTable, scaleTable } from '../pm-plugins/table-resizing/utils/scale-table';
|
|
29
29
|
import { pluginKey as tableWidthPluginKey } from '../pm-plugins/table-width';
|
|
30
30
|
import { ALIGN_CENTER, ALIGN_START, normaliseAlignment, shouldChangeAlignmentToCenterResized } from '../pm-plugins/utils/alignment';
|
|
@@ -47,12 +47,12 @@ var getResizerHandleHeight = function getResizerHandleHeight(tableRef) {
|
|
|
47
47
|
var _tableRef$clientHeigh;
|
|
48
48
|
var tableHeight = (_tableRef$clientHeigh = tableRef === null || tableRef === void 0 ? void 0 : tableRef.clientHeight) !== null && _tableRef$clientHeigh !== void 0 ? _tableRef$clientHeigh : 0;
|
|
49
49
|
/*
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
- One row table height (minimum possible table height) ~ 45px
|
|
51
|
+
- Two row table height ~ 90px
|
|
52
|
+
- Three row table height ~ 134px
|
|
53
|
+
In the if below we need to use:
|
|
54
|
+
- > 46 because the height of the table can be a float number like 45.44.
|
|
55
|
+
- < 96 is the height of large resize handle.
|
|
56
56
|
*/
|
|
57
57
|
if (tableHeight >= 96) {
|
|
58
58
|
return 'large';
|
|
@@ -74,6 +74,15 @@ var getPadding = function getPadding(containerWidth) {
|
|
|
74
74
|
exposure: true
|
|
75
75
|
}) ? akEditorGutterPaddingReduced : akEditorGutterPaddingDynamic();
|
|
76
76
|
};
|
|
77
|
+
var getTableMaxWidth = function getTableMaxWidth(containerWidth, lineLength, isCommentEditor, isChromelessEditor) {
|
|
78
|
+
if (isCommentEditor) {
|
|
79
|
+
return Math.floor(containerWidth - TABLE_OFFSET_IN_COMMENT_EDITOR);
|
|
80
|
+
} else if (isChromelessEditor) {
|
|
81
|
+
return Number.isFinite(lineLength) && lineLength !== undefined ? lineLength : Math.floor(containerWidth - RESIZE_HANDLE_SPACING);
|
|
82
|
+
} else {
|
|
83
|
+
return expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true) ? TABLE_MAX_WIDTH : TABLE_FULL_WIDTH;
|
|
84
|
+
}
|
|
85
|
+
};
|
|
77
86
|
|
|
78
87
|
/**
|
|
79
88
|
* When guidelines are outside the viewport, filter them out, do not show
|
|
@@ -134,6 +143,7 @@ export var TableResizer = function TableResizer(_ref) {
|
|
|
134
143
|
pluginInjectionApi = _ref.pluginInjectionApi,
|
|
135
144
|
isFullWidthModeEnabled = _ref.isFullWidthModeEnabled,
|
|
136
145
|
isCommentEditor = _ref.isCommentEditor,
|
|
146
|
+
isChromelessEditor = _ref.isChromelessEditor,
|
|
137
147
|
disabled = _ref.disabled;
|
|
138
148
|
var currentGap = useRef(0);
|
|
139
149
|
// track resizing state - use ref over state to avoid re-render
|
|
@@ -152,6 +162,7 @@ export var TableResizer = function TableResizer(_ref) {
|
|
|
152
162
|
setSnappingEnabled = _useState2[1];
|
|
153
163
|
var _useIntl = useIntl(),
|
|
154
164
|
formatMessage = _useIntl.formatMessage;
|
|
165
|
+
var isFullPageAppearance = !isCommentEditor && !isChromelessEditor;
|
|
155
166
|
var currentSelection = (_editorView$state = editorView.state) === null || _editorView$state === void 0 ? void 0 : _editorView$state.selection;
|
|
156
167
|
var tableFromSelection = useMemo(function () {
|
|
157
168
|
return findTable(currentSelection);
|
|
@@ -283,7 +294,9 @@ export var TableResizer = function TableResizer(_ref) {
|
|
|
283
294
|
return;
|
|
284
295
|
}
|
|
285
296
|
var editorContainerWidth = isFullWidthModeEnabled ? lineLength + 2 * getPadding(containerWidth) : containerWidth;
|
|
286
|
-
var closestSnap =
|
|
297
|
+
var closestSnap =
|
|
298
|
+
// remove isCommentEditor check if platform_editor_table_resize_chromeless is cleaned up
|
|
299
|
+
(expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) && isFullPageAppearance || !isCommentEditor) && findClosestSnap(newWidth, isTableScalingEnabled ? defaultTablePreserveSnappingWidths(PRESERVE_TABLE_SNAPPING_LENGTH_OFFSET, editorContainerWidth, excludeGuidelineConfig) : defaultSnappingWidths, isTableScalingEnabled ? defaultGuidelinesForPreserveTable(PRESERVE_TABLE_GUIDELINES_LENGTH_OFFSET, editorContainerWidth, excludeGuidelineConfig) : defaultGuidelines, TABLE_HIGHLIGHT_GAP, TABLE_HIGHLIGHT_TOLERANCE);
|
|
287
300
|
closestSnap && updateActiveGuidelines(closestSnap);
|
|
288
301
|
|
|
289
302
|
// When snapping to the full width guideline, resize the table to be 1800px
|
|
@@ -294,21 +307,21 @@ export var TableResizer = function TableResizer(_ref) {
|
|
|
294
307
|
return guideline.isFullWidth;
|
|
295
308
|
})[0];
|
|
296
309
|
var isFullWidthGuidelineActive = expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true) ? closestSnap && fullWidthGuideline && closestSnap.keys.includes(fullWidthGuideline.key) : closestSnap && closestSnap.keys.includes(fullWidthGuideline.key);
|
|
297
|
-
var tableMaxWidth = isCommentEditor ? Math.floor(containerWidth - TABLE_OFFSET_IN_COMMENT_EDITOR) : expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true) ? TABLE_MAX_WIDTH : TABLE_FULL_WIDTH;
|
|
298
|
-
var shouldUpdateWidthToWidest = isCommentEditor ? tableMaxWidth <= newWidth : !!isTableScalingEnabled && isFullWidthGuidelineActive;
|
|
299
|
-
var previewParentWidth = isCommentEditor && shouldUpdateWidthToWidest ? tableMaxWidth : newWidth;
|
|
310
|
+
var tableMaxWidth = expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) ? getTableMaxWidth(containerWidth, lineLength, isCommentEditor, isChromelessEditor) : isCommentEditor ? Math.floor(containerWidth - TABLE_OFFSET_IN_COMMENT_EDITOR) : expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true) ? TABLE_MAX_WIDTH : TABLE_FULL_WIDTH;
|
|
311
|
+
var shouldUpdateWidthToWidest = expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) && !isFullPageAppearance || isCommentEditor ? tableMaxWidth <= newWidth : !!isTableScalingEnabled && isFullWidthGuidelineActive;
|
|
312
|
+
var previewParentWidth = (expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) && !isFullPageAppearance || isCommentEditor) && shouldUpdateWidthToWidest ? tableMaxWidth : newWidth;
|
|
300
313
|
previewScaleTable(tableRef, {
|
|
301
314
|
node: node,
|
|
302
315
|
prevNode: node,
|
|
303
316
|
start: pos + 1,
|
|
304
317
|
parentWidth: previewParentWidth
|
|
305
|
-
}, editorView.domAtPos.bind(editorView), isTableScalingEnabled, allowFixedColumnWidthOption, isCommentEditor);
|
|
318
|
+
}, editorView.domAtPos.bind(editorView), isTableScalingEnabled, allowFixedColumnWidthOption, expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) ? !isFullPageAppearance : isCommentEditor);
|
|
306
319
|
chainCommands(function (state, dispatch) {
|
|
307
320
|
return switchToCenterAlignment(pos, node, newWidth, state, dispatch);
|
|
308
321
|
}, updateWidthToWidest(_defineProperty({}, currentTableNodeLocalId, shouldUpdateWidthToWidest)))(state, dispatch);
|
|
309
322
|
updateWidth(shouldUpdateWidthToWidest ? tableMaxWidth : newWidth);
|
|
310
323
|
return newWidth;
|
|
311
|
-
}, [countFrames, isCommentEditor, isTableScalingEnabled, allowFixedColumnWidthOption, isFullWidthModeEnabled, excludeGuidelineConfig, tableRef, node, editorView, updateActiveGuidelines, containerWidth, lineLength, updateWidth, getPos, switchToCenterAlignment]);
|
|
324
|
+
}, [countFrames, isCommentEditor, isChromelessEditor, isFullPageAppearance, isTableScalingEnabled, allowFixedColumnWidthOption, isFullWidthModeEnabled, excludeGuidelineConfig, tableRef, node, editorView, updateActiveGuidelines, containerWidth, lineLength, updateWidth, getPos, switchToCenterAlignment]);
|
|
312
325
|
var scheduleResize = useMemo(function () {
|
|
313
326
|
return rafSchd(handleResize);
|
|
314
327
|
}, [handleResize]);
|
|
@@ -321,7 +334,7 @@ export var TableResizer = function TableResizer(_ref) {
|
|
|
321
334
|
dispatch = editorView.dispatch;
|
|
322
335
|
var pos = getPos();
|
|
323
336
|
var currentTableNodeLocalId = (_node$attrs$localId2 = node === null || node === void 0 || (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.localId) !== null && _node$attrs$localId2 !== void 0 ? _node$attrs$localId2 : '';
|
|
324
|
-
var tableMaxWidth = isCommentEditor ? undefined // Table's full-width in comment appearance inherit the width of the Editor/Renderer
|
|
337
|
+
var tableMaxWidth = expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) && !isFullPageAppearance || isCommentEditor ? undefined // Table's full-width in comment appearance inherit the width of the Editor/Renderer
|
|
325
338
|
: expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true) ? TABLE_MAX_WIDTH : TABLE_FULL_WIDTH;
|
|
326
339
|
newWidth = widthToWidest && currentTableNodeLocalId && widthToWidest[currentTableNodeLocalId] ? tableMaxWidth : newWidth;
|
|
327
340
|
var tr = state.tr.setMeta(tableWidthPluginKey, {
|
|
@@ -362,8 +375,9 @@ export var TableResizer = function TableResizer(_ref) {
|
|
|
362
375
|
// We use originalNewWidth in comment editor, because in comment editor
|
|
363
376
|
// newWidth can be underined when table is resized to 'full-width'
|
|
364
377
|
// scaleTable function needs number value to work correctly.
|
|
365
|
-
|
|
366
|
-
|
|
378
|
+
// remove isCommentEditor check when platform_editor_table_resize_chromeless is removed
|
|
379
|
+
parentWidth: expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) && !isFullPageAppearance || isCommentEditor ? originalNewWidth : newWidth
|
|
380
|
+
}, editorView.domAtPos.bind(editorView), pluginInjectionApi, isTableScalingEnabled, shouldUseIncreasedScalingPercent || false, expValEquals('platform_editor_table_resize_chromeless', 'isEnabled', true) ? !isFullPageAppearance : isCommentEditor)(tr);
|
|
367
381
|
|
|
368
382
|
// Ignored via go/ees005
|
|
369
383
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
@@ -399,7 +413,7 @@ export var TableResizer = function TableResizer(_ref) {
|
|
|
399
413
|
(_insm$session2 = insm.session) === null || _insm$session2 === void 0 || _insm$session2.endFeature('tableResize');
|
|
400
414
|
}
|
|
401
415
|
return newWidth;
|
|
402
|
-
}, [editorView, getPos, node, isCommentEditor, widthToWidest, endMeasure, displayGapCursor, displayGuideline, updateWidth, scheduleResize, onResizeStop, pluginInjectionApi, attachAnalyticsEvent, tableRef, isTableScalingEnabled, shouldUseIncreasedScalingPercent, formatMessage]);
|
|
416
|
+
}, [editorView, getPos, node, isCommentEditor, widthToWidest, endMeasure, displayGapCursor, displayGuideline, updateWidth, scheduleResize, onResizeStop, pluginInjectionApi, attachAnalyticsEvent, tableRef, isTableScalingEnabled, shouldUseIncreasedScalingPercent, formatMessage, isFullPageAppearance]);
|
|
403
417
|
var handleTableSizeChangeOnKeypress = useCallback(function (step) {
|
|
404
418
|
var newWidth = width + step;
|
|
405
419
|
if (newWidth < resizerMinWidth) {
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { AnalyticPluginTypes } from './actions';
|
|
2
2
|
import { createCommand, getPluginState } from './plugin-factory';
|
|
3
3
|
import { pluginKey } from './plugin-key';
|
|
4
|
+
// eslint-disable-next-line import/order
|
|
4
5
|
import { getMovedPayload } from './utils/moved-event';
|
|
6
|
+
// eslint-disable-next-line import/order
|
|
7
|
+
|
|
5
8
|
export var updateRowOrColumnMoved = function updateRowOrColumnMoved(nextState, nextAction) {
|
|
6
9
|
return createCommand(function (state) {
|
|
7
10
|
var _getPluginState = getPluginState(state),
|
|
@@ -5,7 +5,10 @@ import { TableDecorations } from '../../types';
|
|
|
5
5
|
import { createCommand, getPluginState } from '../plugin-factory';
|
|
6
6
|
import { createCellHoverDecoration, createColumnLineResize, createControlsHoverDecoration } from '../utils/decoration';
|
|
7
7
|
import { getMergedCellsPositions } from '../utils/table';
|
|
8
|
+
// eslint-disable-next-line import/order
|
|
8
9
|
import { updatePluginStateDecorations } from '../utils/update-plugin-state-decorations';
|
|
10
|
+
// eslint-disable-next-line import/order
|
|
11
|
+
|
|
9
12
|
var makeArray = function makeArray(n) {
|
|
10
13
|
return Array.from(Array(n).keys());
|
|
11
14
|
};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { removeConnectedNodes } from '@atlaskit/editor-common/utils';
|
|
2
|
+
// eslint-disable-next-line import/order
|
|
2
3
|
import { createCommand } from '../plugin-factory';
|
|
4
|
+
// eslint-disable-next-line import/order
|
|
5
|
+
|
|
3
6
|
export var removeDescendantNodes = function removeDescendantNodes(sourceNode) {
|
|
4
7
|
return createCommand({
|
|
5
8
|
type: 'UPDATE_STATE',
|
|
@@ -6,6 +6,10 @@ import { DragAndDropActionType } from './actions';
|
|
|
6
6
|
import { DropTargetType } from './consts';
|
|
7
7
|
import { createCommand, getPluginState } from './plugin-factory';
|
|
8
8
|
import { pluginKey } from './plugin-key';
|
|
9
|
+
// eslint-disable-next-line import/order
|
|
10
|
+
|
|
11
|
+
// eslint-disable-next-line import/order
|
|
12
|
+
|
|
9
13
|
// TODO: ED-26961 - This command is a placeholder example. Please replace this if required.
|
|
10
14
|
var getDecorations = function getDecorations(state) {
|
|
11
15
|
var _pluginKey$getState;
|
|
@@ -20,6 +20,8 @@ import { DropTargetType } from './consts';
|
|
|
20
20
|
import { createPluginState, getPluginState } from './plugin-factory';
|
|
21
21
|
import { pluginKey } from './plugin-key';
|
|
22
22
|
import { getDraggableDataFromEvent } from './utils/monitor';
|
|
23
|
+
// eslint-disable-next-line import/order
|
|
24
|
+
|
|
23
25
|
var destroyFn = function destroyFn(editorView, editorAnalyticsAPI, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, isCommentEditor, api) {
|
|
24
26
|
var editorPageScrollContainer = document.querySelector('.fabric-editor-popup-scroll-parent');
|
|
25
27
|
var rowAutoScrollers = editorPageScrollContainer ? [monitorForElements({
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { autoScrollForElements } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/element';
|
|
2
2
|
import { unsafeOverflowAutoScrollForElements } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/unsafe-overflow/element';
|
|
3
|
+
// eslint-disable-next-line import/order
|
|
3
4
|
import { dropTargetExtendedWidth } from '../../../ui/consts';
|
|
5
|
+
// eslint-disable-next-line import/order
|
|
6
|
+
|
|
4
7
|
export var autoScrollerFactory = function autoScrollerFactory(_ref) {
|
|
5
8
|
var tableWrapper = _ref.tableWrapper,
|
|
6
9
|
getNode = _ref.getNode;
|
|
@@ -4,7 +4,12 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
// @ts-ignore -- ReadonlyTransaction is a local declaration and will cause a TS2305 error in CCFE typecheck
|
|
5
5
|
import { pluginFactory } from '@atlaskit/editor-common/utils';
|
|
6
6
|
import { pluginKey } from './plugin-key';
|
|
7
|
+
// eslint-disable-next-line import/order
|
|
7
8
|
import reducer from './reducer';
|
|
9
|
+
// eslint-disable-next-line import/order
|
|
10
|
+
|
|
11
|
+
// eslint-disable-next-line import/order
|
|
12
|
+
|
|
8
13
|
function mapping(tr, pluginState) {
|
|
9
14
|
if (pluginState && pluginState.resizeHandlePos !== null) {
|
|
10
15
|
return _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
@@ -94,7 +94,7 @@ export var generateColgroupFromNode = function generateColgroupFromNode(table, i
|
|
|
94
94
|
});
|
|
95
95
|
return cols;
|
|
96
96
|
};
|
|
97
|
-
export var generateColgroup = function generateColgroup(table, tableRef, shouldUseIncreasedScalingPercent,
|
|
97
|
+
export var generateColgroup = function generateColgroup(table, tableRef, shouldUseIncreasedScalingPercent, isCommentOrChromelessEditor) {
|
|
98
98
|
var cols = [];
|
|
99
99
|
var map = TableMap.get(table);
|
|
100
100
|
|
|
@@ -109,7 +109,7 @@ export var generateColgroup = function generateColgroup(table, tableRef, shouldU
|
|
|
109
109
|
var _table$attrs;
|
|
110
110
|
// if we have tableRef here, isTableScalingEnabled is true
|
|
111
111
|
var scalePercent = 1;
|
|
112
|
-
if (
|
|
112
|
+
if (isCommentOrChromelessEditor && !((_table$attrs = table.attrs) !== null && _table$attrs !== void 0 && _table$attrs.width)) {
|
|
113
113
|
scalePercent = getScalingPercentForTableWithoutWidth(table, tableRef);
|
|
114
114
|
} else {
|
|
115
115
|
scalePercent = getTableScalingPercent(table, tableRef, shouldUseIncreasedScalingPercent);
|
|
@@ -149,14 +149,14 @@ export var insertColgroupFromNode = function insertColgroupFromNode(tableRef, ta
|
|
|
149
149
|
var isTableScalingEnabled = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
150
150
|
var shouldRemove = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
151
151
|
var shouldUseIncreasedScalingPercent = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
152
|
-
var
|
|
152
|
+
var isCommentOrChromelessEditor = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
|
|
153
153
|
// Ignored via go/ees005
|
|
154
154
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
155
155
|
var colgroup = tableRef === null || tableRef === void 0 ? void 0 : tableRef.querySelector('colgroup');
|
|
156
156
|
if (colgroup && shouldRemove) {
|
|
157
157
|
tableRef === null || tableRef === void 0 || tableRef.removeChild(colgroup);
|
|
158
158
|
}
|
|
159
|
-
colgroup = renderColgroupFromNode(table, isTableScalingEnabled ? tableRef !== null && tableRef !== void 0 ? tableRef : undefined : undefined, shouldUseIncreasedScalingPercent,
|
|
159
|
+
colgroup = renderColgroupFromNode(table, isTableScalingEnabled ? tableRef !== null && tableRef !== void 0 ? tableRef : undefined : undefined, shouldUseIncreasedScalingPercent, isCommentOrChromelessEditor);
|
|
160
160
|
if (shouldRemove) {
|
|
161
161
|
tableRef === null || tableRef === void 0 || tableRef.insertBefore(colgroup, tableRef === null || tableRef === void 0 ? void 0 : tableRef.firstChild);
|
|
162
162
|
}
|
|
@@ -186,8 +186,8 @@ export var isMinCellWidthTable = function isMinCellWidthTable(table) {
|
|
|
186
186
|
});
|
|
187
187
|
return isTableMinCellWidth;
|
|
188
188
|
};
|
|
189
|
-
function renderColgroupFromNode(table, maybeTableRef, shouldUseIncreasedScalingPercent,
|
|
190
|
-
var rendered = DOMSerializer.renderSpec(document, ['colgroup', {}].concat(_toConsumableArray(generateColgroup(table, maybeTableRef, shouldUseIncreasedScalingPercent,
|
|
189
|
+
function renderColgroupFromNode(table, maybeTableRef, shouldUseIncreasedScalingPercent, isCommentOrChromelessEditor) {
|
|
190
|
+
var rendered = DOMSerializer.renderSpec(document, ['colgroup', {}].concat(_toConsumableArray(generateColgroup(table, maybeTableRef, shouldUseIncreasedScalingPercent, isCommentOrChromelessEditor))));
|
|
191
191
|
|
|
192
192
|
// Ignored via go/ees005
|
|
193
193
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
@@ -8,4 +8,5 @@ export var MAX_SCALING_PERCENT_TABLES_WITH_FIXED_COLUMN_WIDTHS_OPTION = 0.4;
|
|
|
8
8
|
export var TABLE_EDITOR_MARGIN = 76;
|
|
9
9
|
var COMMENT_AK_EDITOR_CONTENT_AREA_PADDING = 20;
|
|
10
10
|
var COMMENT_PM_TABLE_RESIZING_PLUGIN_MARGIN = 12;
|
|
11
|
-
export var TABLE_OFFSET_IN_COMMENT_EDITOR = 2 * (COMMENT_AK_EDITOR_CONTENT_AREA_PADDING + COMMENT_PM_TABLE_RESIZING_PLUGIN_MARGIN);
|
|
11
|
+
export var TABLE_OFFSET_IN_COMMENT_EDITOR = 2 * (COMMENT_AK_EDITOR_CONTENT_AREA_PADDING + COMMENT_PM_TABLE_RESIZING_PLUGIN_MARGIN);
|
|
12
|
+
export var RESIZE_HANDLE_SPACING = 12;
|
|
@@ -107,7 +107,7 @@ export function scaleTableTo(state, maxSize) {
|
|
|
107
107
|
export var previewScaleTable = function previewScaleTable(tableRef, options, domAtPos) {
|
|
108
108
|
var isTableScalingEnabled = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
109
109
|
var allowFixedColumnWidthOption = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
110
|
-
var
|
|
110
|
+
var isCommentOrChromelessEditor = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
|
|
111
111
|
var node = options.node,
|
|
112
112
|
start = options.start,
|
|
113
113
|
parentWidth = options.parentWidth;
|
|
@@ -130,7 +130,7 @@ export var previewScaleTable = function previewScaleTable(tableRef, options, dom
|
|
|
130
130
|
syncStickyRowToTable(tableRef);
|
|
131
131
|
return;
|
|
132
132
|
}
|
|
133
|
-
var shouldUseIncreasedScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled || isTableScalingEnabled &&
|
|
133
|
+
var shouldUseIncreasedScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled || isTableScalingEnabled && isCommentOrChromelessEditor;
|
|
134
134
|
var resizeState = parentWidth ? scaleWithParent(tableRef, parentWidth, node, start, domAtPos, false,
|
|
135
135
|
// Here isTableScalingEnabled = false
|
|
136
136
|
shouldUseIncreasedScalingPercent) : scale(tableRef, options, domAtPos, false, shouldUseIncreasedScalingPercent);
|
|
@@ -143,7 +143,7 @@ export var previewScaleTable = function previewScaleTable(tableRef, options, dom
|
|
|
143
143
|
export var scaleTable = function scaleTable(tableRef, options, domAtPos, api) {
|
|
144
144
|
var isTableScalingEnabledOnCurrentTable = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
145
145
|
var shouldUseIncreasedScalingPercent = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
|
|
146
|
-
var
|
|
146
|
+
var isCommentOrChromelessEditor = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
|
|
147
147
|
return function (tr) {
|
|
148
148
|
if (!tableRef) {
|
|
149
149
|
return tr;
|
|
@@ -158,7 +158,7 @@ export var scaleTable = function scaleTable(tableRef, options, domAtPos, api) {
|
|
|
158
158
|
// To force reflow of columns upon delete.
|
|
159
159
|
if (!isTableScalingEnabledOnCurrentTable) {
|
|
160
160
|
var isTableScalingEnabled = false;
|
|
161
|
-
insertColgroupFromNode(tableRef, node, isTableScalingEnabled, undefined, shouldUseIncreasedScalingPercent,
|
|
161
|
+
insertColgroupFromNode(tableRef, node, isTableScalingEnabled, undefined, shouldUseIncreasedScalingPercent, isCommentOrChromelessEditor);
|
|
162
162
|
}
|
|
163
163
|
tr.setMeta('scrollIntoView', false);
|
|
164
164
|
return tr;
|
|
@@ -205,7 +205,7 @@ export var getDragMenuConfig = function getDragMenuConfig(direction, getEditorCo
|
|
|
205
205
|
});
|
|
206
206
|
}
|
|
207
207
|
}] : [];
|
|
208
|
-
var sortConfigs =
|
|
208
|
+
var sortConfigs = sortOptions.map(function (_ref) {
|
|
209
209
|
var label = _ref.label,
|
|
210
210
|
order = _ref.order,
|
|
211
211
|
icon = _ref.icon;
|
|
@@ -219,7 +219,7 @@ export var getDragMenuConfig = function getDragMenuConfig(direction, getEditorCo
|
|
|
219
219
|
return true;
|
|
220
220
|
}
|
|
221
221
|
};
|
|
222
|
-
})
|
|
222
|
+
});
|
|
223
223
|
var restConfigs = [].concat(_toConsumableArray(addOptions.map(function (_ref2) {
|
|
224
224
|
var label = _ref2.label,
|
|
225
225
|
offset = _ref2.offset,
|
|
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
3
3
|
* @jsxRuntime classic
|
|
4
4
|
* @jsx jsx
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
/* eslint-disable @typescript-eslint/consistent-type-imports, @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766; jsx required at runtime for @jsxRuntime classic */
|
|
7
7
|
import { jsx } from '@emotion/react';
|
|
8
8
|
import { useIntl } from 'react-intl';
|
|
9
9
|
import { startColumnResizing, ToolTipContent } from '@atlaskit/editor-common/keymaps';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @jsxRuntime classic
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
/* eslint-disable @typescript-eslint/consistent-type-imports, @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766; jsx required at runtime for @jsxRuntime classic */
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
7
|
import { ButtonGroup } from '@atlaskit/button';
|
|
8
8
|
import { FloatingToolbarButton as Button, FloatingToolbarSeparator } from '@atlaskit/editor-common/ui';
|
|
@@ -15,7 +15,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
15
15
|
* @jsx jsx
|
|
16
16
|
*/
|
|
17
17
|
import React, { Component } from 'react';
|
|
18
|
-
|
|
18
|
+
/* eslint-disable @typescript-eslint/consistent-type-imports, @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766; jsx required at runtime for @jsxRuntime classic */
|
|
19
19
|
import { jsx } from '@emotion/react';
|
|
20
20
|
import { injectIntl } from 'react-intl';
|
|
21
21
|
import { TableSortOrder as SortOrder } from '@atlaskit/custom-steps';
|
|
@@ -814,7 +814,10 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
814
814
|
}
|
|
815
815
|
}]);
|
|
816
816
|
}(Component);
|
|
817
|
+
|
|
818
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
817
819
|
_defineProperty(ContextualMenu, "defaultProps", {
|
|
818
820
|
boundariesElement: typeof document !== 'undefined' ? document.body : undefined
|
|
819
821
|
});
|
|
820
|
-
|
|
822
|
+
var _default_1 = injectIntl(ContextualMenu);
|
|
823
|
+
export default _default_1;
|
|
@@ -39,4 +39,7 @@ var DeleteButton = function DeleteButton(_ref) {
|
|
|
39
39
|
fillRule: "evenodd"
|
|
40
40
|
}))));
|
|
41
41
|
};
|
|
42
|
-
|
|
42
|
+
|
|
43
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
44
|
+
var _default_1 = injectIntl(DeleteButton);
|
|
45
|
+
export default _default_1;
|
|
@@ -581,4 +581,7 @@ var DragMenu = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
581
581
|
scrollableElement: scrollableElement
|
|
582
582
|
}));
|
|
583
583
|
});
|
|
584
|
-
|
|
584
|
+
|
|
585
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
586
|
+
var _default_1 = injectIntl(DragMenu);
|
|
587
|
+
export default _default_1;
|
|
@@ -117,6 +117,8 @@ var InsertButtonForDragAndDrop = function InsertButtonForDragAndDrop(_ref2) {
|
|
|
117
117
|
}, content))
|
|
118
118
|
);
|
|
119
119
|
};
|
|
120
|
+
|
|
121
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
120
122
|
export var DragAndDropInsertButton = injectIntl(InsertButtonForDragAndDrop);
|
|
121
123
|
var InsertButton = function InsertButton(_ref3) {
|
|
122
124
|
var onMouseDown = _ref3.onMouseDown,
|
|
@@ -168,4 +170,7 @@ var InsertButton = function InsertButton(_ref3) {
|
|
|
168
170
|
}, content))
|
|
169
171
|
);
|
|
170
172
|
};
|
|
171
|
-
|
|
173
|
+
|
|
174
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
175
|
+
var _default_1 = injectIntl(InsertButton);
|
|
176
|
+
export default _default_1;
|
|
@@ -225,5 +225,8 @@ export var FloatingInsertButton = /*#__PURE__*/function (_React$Component) {
|
|
|
225
225
|
}
|
|
226
226
|
}]);
|
|
227
227
|
}(React.Component);
|
|
228
|
+
|
|
229
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
228
230
|
_defineProperty(FloatingInsertButton, "displayName", 'FloatingInsertButton');
|
|
229
|
-
|
|
231
|
+
var _default_1 = injectIntl(FloatingInsertButton);
|
|
232
|
+
export default _default_1;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { useCallback } from 'react';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
/* eslint-disable @typescript-eslint/consistent-type-imports, @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766; jsx required at runtime for @jsxRuntime classic */
|
|
8
8
|
import { jsx } from '@emotion/react';
|
|
9
9
|
import { TableSelectorPopup } from '@atlaskit/editor-common/ui';
|
|
10
10
|
import { pluginKey } from '../../pm-plugins/table-size-selector';
|
|
@@ -101,5 +101,9 @@ var DragCornerControlsComponentWithSelection = function DragCornerControlsCompon
|
|
|
101
101
|
className: ClassName.DRAG_CORNER_BUTTON_INNER
|
|
102
102
|
}));
|
|
103
103
|
};
|
|
104
|
+
|
|
105
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
104
106
|
export var DragCornerControlsWithSelection = injectIntl(DragCornerControlsComponentWithSelection);
|
|
107
|
+
|
|
108
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
105
109
|
export var DragCornerControls = injectIntl(DragCornerControlsComponent);
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { Fragment, useCallback } from 'react';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
import {
|
|
7
|
+
/* eslint-disable @typescript-eslint/consistent-type-imports, @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766; jsx required at runtime for @jsxRuntime classic */
|
|
8
|
+
import { jsx, css } from '@emotion/react';
|
|
9
9
|
import { getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
10
10
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
11
11
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* @jsxRuntime classic
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
import {
|
|
5
|
+
/* eslint-disable @typescript-eslint/consistent-type-imports, @atlaskit/ui-styling-standard/no-global-styles, @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766; jsx required at runtime for @jsxRuntime classic */
|
|
6
|
+
import { jsx, Global } from '@emotion/react';
|
|
7
7
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
8
8
|
import { tableStyles } from './common-styles';
|
|
9
9
|
export var GlobalStylesWrapper = function GlobalStylesWrapper(_ref) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { IntlShape } from 'react-intl';
|
|
2
|
+
import type { IntlShape, WithIntlProps } from 'react-intl';
|
|
3
3
|
import type { TableColumnOrdering } from '@atlaskit/custom-steps';
|
|
4
4
|
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
@@ -42,7 +42,7 @@ interface ComponentProps {
|
|
|
42
42
|
tableActive: boolean;
|
|
43
43
|
view: EditorView;
|
|
44
44
|
}
|
|
45
|
-
declare const
|
|
45
|
+
declare const _default_1: React.FC<WithIntlProps<ComponentProps>> & {
|
|
46
46
|
WrappedComponent: React.ComponentType<ComponentProps>;
|
|
47
47
|
};
|
|
48
|
-
export default
|
|
48
|
+
export default _default_1;
|
|
@@ -15,6 +15,7 @@ interface TableResizerProps {
|
|
|
15
15
|
displayGuideline: (guideline: GuidelineConfig[]) => boolean;
|
|
16
16
|
editorView: EditorView;
|
|
17
17
|
getPos: () => number | undefined;
|
|
18
|
+
isChromelessEditor?: boolean;
|
|
18
19
|
isCommentEditor?: boolean;
|
|
19
20
|
isFullWidthModeEnabled?: boolean;
|
|
20
21
|
isTableAlignmentEnabled?: boolean;
|
|
@@ -31,5 +32,5 @@ interface TableResizerProps {
|
|
|
31
32
|
updateWidth: (width: number) => void;
|
|
32
33
|
width: number;
|
|
33
34
|
}
|
|
34
|
-
export declare const TableResizer: ({ children, width, maxWidth, containerWidth, lineLength, updateWidth, onResizeStop, onResizeStart, editorView, getPos, node, tableRef, displayGuideline, attachAnalyticsEvent, displayGapCursor, isTableScalingEnabled, allowFixedColumnWidthOption, isTableAlignmentEnabled, isWholeTableInDanger, shouldUseIncreasedScalingPercent, pluginInjectionApi, isFullWidthModeEnabled, isCommentEditor, disabled, }: PropsWithChildren<TableResizerProps>) => React.JSX.Element;
|
|
35
|
+
export declare const TableResizer: ({ children, width, maxWidth, containerWidth, lineLength, updateWidth, onResizeStop, onResizeStart, editorView, getPos, node, tableRef, displayGuideline, attachAnalyticsEvent, displayGapCursor, isTableScalingEnabled, allowFixedColumnWidthOption, isTableAlignmentEnabled, isWholeTableInDanger, shouldUseIncreasedScalingPercent, pluginInjectionApi, isFullWidthModeEnabled, isCommentEditor, isChromelessEditor, disabled, }: PropsWithChildren<TableResizerProps>) => React.JSX.Element;
|
|
35
36
|
export {};
|