@atlaskit/editor-plugin-table 20.0.0 → 22.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +59 -0
- package/dist/cjs/nodeviews/TableComponent.js +2 -2
- package/dist/cjs/nodeviews/TableResizer.js +2 -2
- package/dist/cjs/pm-plugins/keymap.js +12 -12
- package/dist/cjs/pm-plugins/main.js +3 -3
- package/dist/cjs/pm-plugins/utils/decoration.js +2 -2
- package/dist/cjs/pm-plugins/view-mode-sort/index.js +2 -2
- package/dist/cjs/tablePlugin.js +40 -45
- package/dist/cjs/ui/ColumnResizeWidget/index.js +2 -2
- package/dist/cjs/ui/ContentComponent.js +0 -1
- package/dist/cjs/ui/DragHandle/index.js +2 -2
- package/dist/cjs/ui/FloatingContextualButton/index.js +2 -2
- package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +2 -2
- package/dist/cjs/ui/FloatingDeleteButton/DeleteButton.js +2 -2
- package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +2 -2
- package/dist/cjs/ui/FloatingInsertButton/InsertButton.js +3 -3
- package/dist/cjs/ui/FloatingInsertButton/index.js +2 -2
- package/dist/cjs/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +2 -2
- package/dist/cjs/ui/TableFloatingControls/CornerControls/DragCornerControls.js +3 -3
- package/dist/cjs/ui/TableFloatingControls/RowControls/ClassicControls.js +2 -2
- package/dist/cjs/ui/TableFullWidthLabel/index.js +2 -2
- package/dist/cjs/ui/global-styles.js +1 -2
- package/dist/cjs/ui/toolbar.js +5 -11
- package/dist/es2019/nodeviews/TableComponent.js +1 -1
- package/dist/es2019/nodeviews/TableResizer.js +1 -1
- package/dist/es2019/pm-plugins/keymap.js +2 -2
- package/dist/es2019/pm-plugins/main.js +3 -3
- package/dist/es2019/pm-plugins/utils/decoration.js +1 -1
- package/dist/es2019/pm-plugins/view-mode-sort/index.js +1 -1
- package/dist/es2019/tablePlugin.js +4 -10
- package/dist/es2019/ui/ColumnResizeWidget/index.js +1 -1
- package/dist/es2019/ui/ContentComponent.js +0 -1
- package/dist/es2019/ui/DragHandle/index.js +1 -1
- package/dist/es2019/ui/FloatingContextualButton/index.js +1 -1
- package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +1 -1
- package/dist/es2019/ui/FloatingDeleteButton/DeleteButton.js +1 -1
- package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +1 -1
- package/dist/es2019/ui/FloatingInsertButton/InsertButton.js +1 -1
- package/dist/es2019/ui/FloatingInsertButton/index.js +1 -1
- package/dist/es2019/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +1 -1
- package/dist/es2019/ui/TableFloatingControls/CornerControls/DragCornerControls.js +1 -1
- package/dist/es2019/ui/TableFloatingControls/RowControls/ClassicControls.js +1 -1
- package/dist/es2019/ui/TableFullWidthLabel/index.js +1 -1
- package/dist/es2019/ui/global-styles.js +1 -2
- package/dist/es2019/ui/toolbar.js +4 -10
- package/dist/esm/nodeviews/TableComponent.js +1 -1
- package/dist/esm/nodeviews/TableResizer.js +1 -1
- package/dist/esm/pm-plugins/keymap.js +12 -12
- package/dist/esm/pm-plugins/main.js +3 -3
- package/dist/esm/pm-plugins/utils/decoration.js +1 -1
- package/dist/esm/pm-plugins/view-mode-sort/index.js +1 -1
- package/dist/esm/tablePlugin.js +40 -45
- package/dist/esm/ui/ColumnResizeWidget/index.js +1 -1
- package/dist/esm/ui/ContentComponent.js +0 -1
- package/dist/esm/ui/DragHandle/index.js +1 -1
- package/dist/esm/ui/FloatingContextualButton/index.js +1 -1
- package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +1 -1
- package/dist/esm/ui/FloatingDeleteButton/DeleteButton.js +1 -1
- package/dist/esm/ui/FloatingDragMenu/DragMenu.js +1 -1
- package/dist/esm/ui/FloatingInsertButton/InsertButton.js +1 -1
- package/dist/esm/ui/FloatingInsertButton/index.js +1 -1
- package/dist/esm/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +1 -1
- package/dist/esm/ui/TableFloatingControls/CornerControls/DragCornerControls.js +1 -1
- package/dist/esm/ui/TableFloatingControls/RowControls/ClassicControls.js +1 -1
- package/dist/esm/ui/TableFullWidthLabel/index.js +1 -1
- package/dist/esm/ui/global-styles.js +1 -2
- package/dist/esm/ui/toolbar.js +5 -11
- package/dist/types/nodeviews/TableComponent.d.ts +2 -2
- package/dist/types/pm-plugins/commands/column-resize.d.ts +1 -1
- package/dist/types/pm-plugins/commands/commands-with-analytics.d.ts +1 -1
- package/dist/types/pm-plugins/commands/go-to-next-cell.d.ts +1 -1
- package/dist/types/pm-plugins/commands/selection.d.ts +1 -1
- package/dist/types/pm-plugins/decorations/utils/column-resizing.d.ts +1 -1
- package/dist/types/pm-plugins/drag-and-drop/commands-with-analytics.d.ts +1 -1
- package/dist/types/pm-plugins/keymap.d.ts +2 -2
- package/dist/types/pm-plugins/main.d.ts +2 -2
- package/dist/types/pm-plugins/table-selection-keymap.d.ts +1 -1
- package/dist/types/pm-plugins/utils/decoration.d.ts +1 -1
- package/dist/types/pm-plugins/utils/table.d.ts +1 -1
- package/dist/types/tablePluginType.d.ts +0 -6
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/ui/DragHandle/index.d.ts +2 -2
- package/dist/types/ui/FloatingContextualMenu/ContextualMenu.d.ts +2 -2
- package/dist/types/ui/FloatingDeleteButton/DeleteButton.d.ts +2 -2
- package/dist/types/ui/FloatingDragMenu/DragMenu.d.ts +2 -2
- package/dist/types/ui/FloatingInsertButton/InsertButton.d.ts +3 -3
- package/dist/types/ui/FloatingInsertButton/index.d.ts +2 -2
- 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/global-styles.d.ts +1 -2
- package/dist/types-ts4.5/nodeviews/TableComponent.d.ts +2 -2
- package/dist/types-ts4.5/pm-plugins/commands/column-resize.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/commands/commands-with-analytics.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/commands/go-to-next-cell.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/commands/selection.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/decorations/utils/column-resizing.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/drag-and-drop/commands-with-analytics.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/keymap.d.ts +2 -2
- package/dist/types-ts4.5/pm-plugins/main.d.ts +2 -2
- package/dist/types-ts4.5/pm-plugins/table-selection-keymap.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/utils/decoration.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/utils/table.d.ts +1 -1
- package/dist/types-ts4.5/tablePluginType.d.ts +0 -6
- package/dist/types-ts4.5/types/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/DragHandle/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/FloatingContextualMenu/ContextualMenu.d.ts +2 -2
- package/dist/types-ts4.5/ui/FloatingDeleteButton/DeleteButton.d.ts +2 -2
- package/dist/types-ts4.5/ui/FloatingDragMenu/DragMenu.d.ts +2 -2
- package/dist/types-ts4.5/ui/FloatingInsertButton/InsertButton.d.ts +3 -3
- package/dist/types-ts4.5/ui/FloatingInsertButton/index.d.ts +2 -2
- 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/global-styles.d.ts +1 -2
- package/package.json +20 -17
- package/report.api.md +1 -1
|
@@ -15,7 +15,6 @@ var _commonStyles = require("./common-styles");
|
|
|
15
15
|
|
|
16
16
|
var GlobalStylesWrapper = exports.GlobalStylesWrapper = function GlobalStylesWrapper(_ref) {
|
|
17
17
|
var featureFlags = _ref.featureFlags,
|
|
18
|
-
isDragAndDropEnabledOption = _ref.isDragAndDropEnabledOption,
|
|
19
18
|
api = _ref.api;
|
|
20
19
|
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['editorViewMode'], function (states) {
|
|
21
20
|
var _states$editorViewMod;
|
|
@@ -28,7 +27,7 @@ var GlobalStylesWrapper = exports.GlobalStylesWrapper = function GlobalStylesWra
|
|
|
28
27
|
return (0, _react.jsx)(_react.Global, {
|
|
29
28
|
styles: (0, _commonStyles.tableStyles)({
|
|
30
29
|
featureFlags: featureFlags,
|
|
31
|
-
isDragAndDropEnabled:
|
|
30
|
+
isDragAndDropEnabled: !isLivePageViewMode
|
|
32
31
|
})
|
|
33
32
|
});
|
|
34
33
|
};
|
package/dist/cjs/ui/toolbar.js
CHANGED
|
@@ -419,17 +419,11 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(getE
|
|
|
419
419
|
var areAnyNewToolbarFlagsEnabled = (0, _toolbarFlagCheck.areToolbarFlagsEnabled)(Boolean(api === null || api === void 0 ? void 0 : api.toolbar));
|
|
420
420
|
if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')) {
|
|
421
421
|
var _api$editorViewMode;
|
|
422
|
-
var
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
isDragMenuOpen = _getDragDropPluginSta2 === void 0 ? false : _getDragDropPluginSta2,
|
|
428
|
-
_getDragDropPluginSta3 = _getDragDropPluginSta.isDragging,
|
|
429
|
-
isDragging = _getDragDropPluginSta3 === void 0 ? false : _getDragDropPluginSta3;
|
|
430
|
-
isDragHandleMenuOpened = isDragMenuOpen;
|
|
431
|
-
isTableRowOrColumnDragged = isDragging;
|
|
432
|
-
}
|
|
422
|
+
var _getDragDropPluginSta = (0, _pluginFactory.getPluginState)(state),
|
|
423
|
+
_getDragDropPluginSta2 = _getDragDropPluginSta.isDragMenuOpen,
|
|
424
|
+
isDragHandleMenuOpened = _getDragDropPluginSta2 === void 0 ? false : _getDragDropPluginSta2,
|
|
425
|
+
_getDragDropPluginSta3 = _getDragDropPluginSta.isDragging,
|
|
426
|
+
isTableRowOrColumnDragged = _getDragDropPluginSta3 === void 0 ? false : _getDragDropPluginSta3;
|
|
433
427
|
var isTableOrColumnResizing = !!(resizeState !== null && resizeState !== void 0 && resizeState.dragging || tableWidthState !== null && tableWidthState !== void 0 && tableWidthState.resizing);
|
|
434
428
|
var isTableMenuOpened = pluginState.isContextualMenuOpen || isDragHandleMenuOpened;
|
|
435
429
|
var isTableState = isTableRowOrColumnDragged || isTableOrColumnResizing || isTableMenuOpened;
|
|
@@ -2,7 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
4
|
import rafSchedule from 'raf-schd';
|
|
5
|
-
import { injectIntl } from 'react-intl
|
|
5
|
+
import { injectIntl } from 'react-intl';
|
|
6
6
|
import { getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
7
7
|
import { tintDirtyTransaction } from '@atlaskit/editor-common/collab';
|
|
8
8
|
import { getParentOfTypeCount } from '@atlaskit/editor-common/nesting';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
2
2
|
import rafSchd from 'raf-schd';
|
|
3
|
-
import { useIntl } from 'react-intl
|
|
3
|
+
import { useIntl } from 'react-intl';
|
|
4
4
|
import { CHANGE_ALIGNMENT_REASON, INPUT_METHOD, TABLE_OVERFLOW_CHANGE_TRIGGER } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import { getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
6
6
|
import { getGuidelinesWithHighlights } from '@atlaskit/editor-common/guideline';
|
|
@@ -10,7 +10,7 @@ import { activateNextResizeArea, initiateKeyboardColumnResizing, stopKeyboardCol
|
|
|
10
10
|
import { addRowAroundSelection, changeColumnWidthByStepWithAnalytics, deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut, deleteTableIfSelectedWithAnalytics, emptyMultipleCellsWithAnalytics } from './commands/commands-with-analytics';
|
|
11
11
|
import { goToNextCellVertical } from './commands/go-to-next-cell';
|
|
12
12
|
import { addColumnAfter as addColumnAfterCommand, addColumnBefore as addColumnBeforeCommand, insertTableWithNestingSupport } from './commands/insert';
|
|
13
|
-
export function keymapPlugin(getEditorContainerWidth, api, nodeViewPortalProviderAPI, editorAnalyticsAPI,
|
|
13
|
+
export function keymapPlugin(getEditorContainerWidth, api, nodeViewPortalProviderAPI, editorAnalyticsAPI, isTableScalingEnabled = false, isTableAlignmentEnabled = false, isFullWidthEnabled, pluginInjectionApi, getIntl, isTableFixedColumnWidthsOptionEnabled = false, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor, isTableResizingEnabled) {
|
|
14
14
|
var _pluginInjectionApi$a;
|
|
15
15
|
const list = {};
|
|
16
16
|
const ariaNotifyPlugin = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.accessibilityUtils) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions.ariaNotify;
|
|
@@ -82,7 +82,7 @@ export function keymapPlugin(getEditorContainerWidth, api, nodeViewPortalProvide
|
|
|
82
82
|
// Ignored via go/ees005
|
|
83
83
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
84
84
|
addColumnAfterVO.common, addColumnAfterCommand(api, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent), list);
|
|
85
|
-
if (
|
|
85
|
+
if (moveRowDown.common && moveRowUp.common && moveColumnLeft.common && moveColumnRight.common) {
|
|
86
86
|
const isNewKeyMapExperiment = expValEquals('editor-a11y-fy26-keyboard-move-row-column', 'isEnabled', true);
|
|
87
87
|
// Move row/column shortcuts
|
|
88
88
|
/**
|
|
@@ -26,7 +26,7 @@ import { replaceSelectedTable } from './transforms/replace-table';
|
|
|
26
26
|
import { findControlsHoverDecoration } from './utils/decoration';
|
|
27
27
|
import { transformSliceToCorrectEmptyTableCells, transformSliceToFixHardBreakProblemOnCopyFromCell, transformSliceToRemoveOpenTable, transformSliceToRemoveNestedTables, isHeaderRowRequired, transformSliceTableLayoutDefaultToCenter } from './utils/paste';
|
|
28
28
|
import { applyMeasuredWidthToAllTables, isContentModeSupported } from './utils/tableMode';
|
|
29
|
-
export const createPlugin = (dispatchAnalyticsEvent, dispatch, portalProviderAPI, nodeViewPortalProviderAPI, eventDispatcher, pluginConfig, getEditorContainerWidth, getEditorFeatureFlags, getIntl, fullWidthModeEnabled, previousFullWidthModeEnabled,
|
|
29
|
+
export const createPlugin = (dispatchAnalyticsEvent, dispatch, portalProviderAPI, nodeViewPortalProviderAPI, eventDispatcher, pluginConfig, getEditorContainerWidth, getEditorFeatureFlags, getIntl, fullWidthModeEnabled, previousFullWidthModeEnabled, editorAnalyticsAPI, pluginInjectionApi, isTableScalingEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor, allowFixedColumnWidthOption) => {
|
|
30
30
|
var _accessibilityUtils;
|
|
31
31
|
const state = createPluginState(dispatch, {
|
|
32
32
|
pluginConfig,
|
|
@@ -39,7 +39,7 @@ export const createPlugin = (dispatchAnalyticsEvent, dispatch, portalProviderAPI
|
|
|
39
39
|
wasFullWidthModeEnabled: previousFullWidthModeEnabled,
|
|
40
40
|
isHeaderRowEnabled: !!pluginConfig.allowHeaderRow,
|
|
41
41
|
isHeaderColumnEnabled: false,
|
|
42
|
-
isDragAndDropEnabled:
|
|
42
|
+
isDragAndDropEnabled: true,
|
|
43
43
|
isTableScalingEnabled: isTableScalingEnabled,
|
|
44
44
|
...defaultHoveredCell,
|
|
45
45
|
...defaultTableSelection,
|
|
@@ -73,7 +73,7 @@ export const createPlugin = (dispatchAnalyticsEvent, dispatch, portalProviderAPI
|
|
|
73
73
|
tableRow: tableRowView({
|
|
74
74
|
eventDispatcher,
|
|
75
75
|
pluginInjectionApi,
|
|
76
|
-
isDragAndDropEnabled:
|
|
76
|
+
isDragAndDropEnabled: true
|
|
77
77
|
}),
|
|
78
78
|
tableCell: tableCellView({
|
|
79
79
|
eventDispatcher,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createElement } from 'react';
|
|
2
|
-
import { RawIntlProvider } from 'react-intl
|
|
2
|
+
import { RawIntlProvider } from 'react-intl';
|
|
3
3
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
4
4
|
import uuid from 'uuid/v4';
|
|
5
5
|
import { nonNullable } from '@atlaskit/editor-common/utils';
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { createElement } from 'react';
|
|
8
|
-
import { RawIntlProvider } from 'react-intl
|
|
8
|
+
import { RawIntlProvider } from 'react-intl';
|
|
9
9
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
10
10
|
import uuid from 'uuid/v4';
|
|
11
11
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
@@ -63,7 +63,6 @@ const tablePlugin = ({
|
|
|
63
63
|
const options = {
|
|
64
64
|
...config,
|
|
65
65
|
tableOptions: (_config$tableOptions = config === null || config === void 0 ? void 0 : config.tableOptions) !== null && _config$tableOptions !== void 0 ? _config$tableOptions : {},
|
|
66
|
-
dragAndDropEnabled: (config === null || config === void 0 ? void 0 : config.dragAndDropEnabled) || fg('platform_editor_enable_table_dnd'),
|
|
67
66
|
isTableScalingEnabled: (config === null || config === void 0 ? void 0 : config.isTableScalingEnabled) || fg('platform_editor_enable_table_scaling')
|
|
68
67
|
};
|
|
69
68
|
const defaultGetEditorContainerWidth = () => {
|
|
@@ -280,12 +279,11 @@ const tablePlugin = ({
|
|
|
280
279
|
wasFullWidthEnabled,
|
|
281
280
|
tableOptions,
|
|
282
281
|
getEditorFeatureFlags,
|
|
283
|
-
dragAndDropEnabled,
|
|
284
282
|
isTableScalingEnabled,
|
|
285
283
|
isCommentEditor,
|
|
286
284
|
isChromelessEditor
|
|
287
285
|
} = options || {};
|
|
288
|
-
return createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, nodeViewPortalProviderAPI, eventDispatcher, pluginConfig(tableOptions), defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, getIntl, fullWidthEnabled, wasFullWidthEnabled,
|
|
286
|
+
return createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, nodeViewPortalProviderAPI, eventDispatcher, pluginConfig(tableOptions), defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, getIntl, fullWidthEnabled, wasFullWidthEnabled, editorAnalyticsAPI, api, isTableScalingEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor, options === null || options === void 0 ? void 0 : options.allowFixedColumnWidthOption);
|
|
289
287
|
}
|
|
290
288
|
}, {
|
|
291
289
|
name: 'tablePMColResizing',
|
|
@@ -319,14 +317,13 @@ const tablePlugin = ({
|
|
|
319
317
|
nodeViewPortalProviderAPI
|
|
320
318
|
}) => {
|
|
321
319
|
const {
|
|
322
|
-
dragAndDropEnabled,
|
|
323
320
|
isTableScalingEnabled = false,
|
|
324
321
|
fullWidthEnabled = false,
|
|
325
322
|
isCommentEditor = false,
|
|
326
323
|
isChromelessEditor = false,
|
|
327
324
|
tableOptions
|
|
328
325
|
} = options || {};
|
|
329
|
-
return keymapPlugin(defaultGetEditorContainerWidth, api, nodeViewPortalProviderAPI, editorAnalyticsAPI,
|
|
326
|
+
return keymapPlugin(defaultGetEditorContainerWidth, api, nodeViewPortalProviderAPI, editorAnalyticsAPI, isTableScalingEnabled, tableOptions === null || tableOptions === void 0 ? void 0 : tableOptions.allowTableAlignment, fullWidthEnabled, api, getIntl, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor, tableOptions === null || tableOptions === void 0 ? void 0 : tableOptions.allowTableResizing);
|
|
330
327
|
}
|
|
331
328
|
}, {
|
|
332
329
|
name: 'tableSelectionKeymap',
|
|
@@ -336,9 +333,6 @@ const tablePlugin = ({
|
|
|
336
333
|
}, {
|
|
337
334
|
name: 'tableEditing',
|
|
338
335
|
plugin: () => {
|
|
339
|
-
const {
|
|
340
|
-
dragAndDropEnabled
|
|
341
|
-
} = options || {};
|
|
342
336
|
return tableEditing({
|
|
343
337
|
reportFixedTable: ({
|
|
344
338
|
tr,
|
|
@@ -354,7 +348,7 @@ const tablePlugin = ({
|
|
|
354
348
|
eventType: EVENT_TYPE.TRACK
|
|
355
349
|
})(tr);
|
|
356
350
|
},
|
|
357
|
-
dragAndDropEnabled
|
|
351
|
+
dragAndDropEnabled: true
|
|
358
352
|
});
|
|
359
353
|
}
|
|
360
354
|
}, {
|
|
@@ -367,7 +361,7 @@ const tablePlugin = ({
|
|
|
367
361
|
plugin: ({
|
|
368
362
|
dispatch
|
|
369
363
|
}) => {
|
|
370
|
-
return
|
|
364
|
+
return createDragAndDropPlugin(dispatch, editorAnalyticsAPI, options === null || options === void 0 ? void 0 : options.isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, options.isCommentEditor, api);
|
|
371
365
|
}
|
|
372
366
|
}, {
|
|
373
367
|
name: 'tableViewModeSort',
|
|
@@ -5,7 +5,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
5
5
|
*/
|
|
6
6
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
7
|
import { jsx } from '@emotion/react';
|
|
8
|
-
import { useIntl } from 'react-intl
|
|
8
|
+
import { useIntl } from 'react-intl';
|
|
9
9
|
import { startColumnResizing, ToolTipContent } from '@atlaskit/editor-common/keymaps';
|
|
10
10
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
11
11
|
import Tooltip from '@atlaskit/tooltip';
|
|
@@ -215,7 +215,6 @@ export const ContentComponent = ({
|
|
|
215
215
|
fallbackComponent: null
|
|
216
216
|
}, /*#__PURE__*/React.createElement(GlobalStylesWrapper, {
|
|
217
217
|
featureFlags: api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState(),
|
|
218
|
-
isDragAndDropEnabledOption: options === null || options === void 0 ? void 0 : options.dragAndDropEnabled,
|
|
219
218
|
api: api
|
|
220
219
|
}), /*#__PURE__*/React.createElement(ContentComponentInternal, {
|
|
221
220
|
api: api,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
4
4
|
import classnames from 'classnames';
|
|
5
5
|
import ReactDOM from 'react-dom';
|
|
6
|
-
import { injectIntl } from 'react-intl
|
|
6
|
+
import { injectIntl } from 'react-intl';
|
|
7
7
|
import { getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
8
8
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
9
9
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import React, { useEffect } from 'react';
|
|
6
6
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
7
|
import { css, jsx } from '@emotion/react';
|
|
8
|
-
import { injectIntl } from 'react-intl
|
|
8
|
+
import { injectIntl } from 'react-intl';
|
|
9
9
|
import { ACTION_SUBJECT } from '@atlaskit/editor-common/analytics';
|
|
10
10
|
import { ErrorBoundary } from '@atlaskit/editor-common/error-boundary';
|
|
11
11
|
import { focusToContextMenuTrigger } from '@atlaskit/editor-common/keymaps';
|
|
@@ -7,7 +7,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
7
7
|
import React, { Component } from 'react';
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
9
|
import { jsx } from '@emotion/react';
|
|
10
|
-
import { injectIntl } from 'react-intl
|
|
10
|
+
import { injectIntl } from 'react-intl';
|
|
11
11
|
import { TableSortOrder as SortOrder } from '@atlaskit/custom-steps';
|
|
12
12
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
13
13
|
import { addColumnAfter, addRowAfter, backspace, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { injectIntl } from 'react-intl
|
|
2
|
+
import { injectIntl } from 'react-intl';
|
|
3
3
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
4
4
|
import { TableCssClassName as ClassName } from '../../types';
|
|
5
5
|
const DeleteButton = ({
|
|
@@ -8,7 +8,7 @@ import React, { useEffect, useState } from 'react';
|
|
|
8
8
|
|
|
9
9
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
10
10
|
import { jsx } from '@emotion/react';
|
|
11
|
-
import { injectIntl } from 'react-intl
|
|
11
|
+
import { injectIntl } from 'react-intl';
|
|
12
12
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
13
13
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
14
14
|
import { DropdownMenuSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import classnames from 'classnames';
|
|
5
|
-
import { injectIntl } from 'react-intl
|
|
5
|
+
import { injectIntl } from 'react-intl';
|
|
6
6
|
import { addColumnAfter, addRowAfter, ToolTipContent } from '@atlaskit/editor-common/keymaps';
|
|
7
7
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
8
8
|
import { tableMarginTop } from '@atlaskit/editor-common/styles';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import { injectIntl } from 'react-intl
|
|
4
|
+
import { injectIntl } from 'react-intl';
|
|
5
5
|
import { ACTION, ACTION_SUBJECT, CONTENT_COMPONENT, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
6
6
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
7
7
|
import { closestElement } from '@atlaskit/editor-common/utils';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import React, { Component } from 'react';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
|
-
import { injectIntl } from 'react-intl
|
|
4
|
+
import { injectIntl } from 'react-intl';
|
|
5
5
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
6
6
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
7
7
|
import { findTable, isTableSelected, selectTable } from '@atlaskit/editor-tables/utils';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
|
-
import { injectIntl } from 'react-intl
|
|
3
|
+
import { injectIntl } from 'react-intl';
|
|
4
4
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
5
5
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
6
6
|
import { findTable, isTableSelected, selectTable } from '@atlaskit/editor-tables/utils';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import React, { Component } from 'react';
|
|
3
|
-
import { injectIntl } from 'react-intl
|
|
3
|
+
import { injectIntl } from 'react-intl';
|
|
4
4
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
5
5
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
6
6
|
import { clearHoverSelection } from '../../../pm-plugins/commands';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { useIntl } from 'react-intl
|
|
2
|
+
import { useIntl } from 'react-intl';
|
|
3
3
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
4
4
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
5
5
|
import { Box, Inline, xcss } from '@atlaskit/primitives';
|
|
@@ -8,7 +8,6 @@ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks'
|
|
|
8
8
|
import { tableStyles } from './common-styles';
|
|
9
9
|
export const GlobalStylesWrapper = ({
|
|
10
10
|
featureFlags,
|
|
11
|
-
isDragAndDropEnabledOption,
|
|
12
11
|
api
|
|
13
12
|
}) => {
|
|
14
13
|
const {
|
|
@@ -23,7 +22,7 @@ export const GlobalStylesWrapper = ({
|
|
|
23
22
|
return jsx(Global, {
|
|
24
23
|
styles: tableStyles({
|
|
25
24
|
featureFlags,
|
|
26
|
-
isDragAndDropEnabled:
|
|
25
|
+
isDragAndDropEnabled: !isLivePageViewMode
|
|
27
26
|
})
|
|
28
27
|
});
|
|
29
28
|
};
|
|
@@ -397,16 +397,10 @@ export const getToolbarConfig = (getEditorContainerWidth, api, editorAnalyticsAP
|
|
|
397
397
|
const areAnyNewToolbarFlagsEnabled = areToolbarFlagsEnabled(Boolean(api === null || api === void 0 ? void 0 : api.toolbar));
|
|
398
398
|
if (editorExperiment('platform_editor_controls', 'variant1')) {
|
|
399
399
|
var _api$editorViewMode, _api$editorViewMode$s;
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
isDragMenuOpen = false,
|
|
405
|
-
isDragging = false
|
|
406
|
-
} = getDragDropPluginState(state);
|
|
407
|
-
isDragHandleMenuOpened = isDragMenuOpen;
|
|
408
|
-
isTableRowOrColumnDragged = isDragging;
|
|
409
|
-
}
|
|
400
|
+
const {
|
|
401
|
+
isDragMenuOpen: isDragHandleMenuOpened = false,
|
|
402
|
+
isDragging: isTableRowOrColumnDragged = false
|
|
403
|
+
} = getDragDropPluginState(state);
|
|
410
404
|
const isTableOrColumnResizing = !!(resizeState !== null && resizeState !== void 0 && resizeState.dragging || tableWidthState !== null && tableWidthState !== void 0 && tableWidthState.resizing);
|
|
411
405
|
const isTableMenuOpened = pluginState.isContextualMenuOpen || isDragHandleMenuOpened;
|
|
412
406
|
const isTableState = isTableRowOrColumnDragged || isTableOrColumnResizing || isTableMenuOpened;
|
|
@@ -15,7 +15,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
15
15
|
import React from 'react';
|
|
16
16
|
import classnames from 'classnames';
|
|
17
17
|
import rafSchedule from 'raf-schd';
|
|
18
|
-
import { injectIntl } from 'react-intl
|
|
18
|
+
import { injectIntl } from 'react-intl';
|
|
19
19
|
import { getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
20
20
|
import { tintDirtyTransaction } from '@atlaskit/editor-common/collab';
|
|
21
21
|
import { getParentOfTypeCount } from '@atlaskit/editor-common/nesting';
|
|
@@ -4,7 +4,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
5
|
import React, { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
6
6
|
import rafSchd from 'raf-schd';
|
|
7
|
-
import { useIntl } from 'react-intl
|
|
7
|
+
import { useIntl } from 'react-intl';
|
|
8
8
|
import { CHANGE_ALIGNMENT_REASON, INPUT_METHOD, TABLE_OVERFLOW_CHANGE_TRIGGER } from '@atlaskit/editor-common/analytics';
|
|
9
9
|
import { getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
10
10
|
import { getGuidelinesWithHighlights } from '@atlaskit/editor-common/guideline';
|
|
@@ -10,18 +10,18 @@ import { activateNextResizeArea, initiateKeyboardColumnResizing, stopKeyboardCol
|
|
|
10
10
|
import { addRowAroundSelection, changeColumnWidthByStepWithAnalytics, deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut, deleteTableIfSelectedWithAnalytics, emptyMultipleCellsWithAnalytics } from './commands/commands-with-analytics';
|
|
11
11
|
import { goToNextCellVertical } from './commands/go-to-next-cell';
|
|
12
12
|
import { addColumnAfter as addColumnAfterCommand, addColumnBefore as addColumnBeforeCommand, insertTableWithNestingSupport } from './commands/insert';
|
|
13
|
-
export function keymapPlugin(getEditorContainerWidth, api, nodeViewPortalProviderAPI, editorAnalyticsAPI
|
|
13
|
+
export function keymapPlugin(getEditorContainerWidth, api, nodeViewPortalProviderAPI, editorAnalyticsAPI) {
|
|
14
14
|
var _pluginInjectionApi$a;
|
|
15
|
-
var isTableScalingEnabled = arguments.length >
|
|
16
|
-
var isTableAlignmentEnabled = arguments.length >
|
|
17
|
-
var isFullWidthEnabled = arguments.length >
|
|
18
|
-
var pluginInjectionApi = arguments.length >
|
|
19
|
-
var getIntl = arguments.length >
|
|
20
|
-
var isTableFixedColumnWidthsOptionEnabled = arguments.length >
|
|
21
|
-
var shouldUseIncreasedScalingPercent = arguments.length >
|
|
22
|
-
var isCommentEditor = arguments.length >
|
|
23
|
-
var isChromelessEditor = arguments.length >
|
|
24
|
-
var isTableResizingEnabled = arguments.length >
|
|
15
|
+
var isTableScalingEnabled = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
16
|
+
var isTableAlignmentEnabled = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
|
|
17
|
+
var isFullWidthEnabled = arguments.length > 6 ? arguments[6] : undefined;
|
|
18
|
+
var pluginInjectionApi = arguments.length > 7 ? arguments[7] : undefined;
|
|
19
|
+
var getIntl = arguments.length > 8 ? arguments[8] : undefined;
|
|
20
|
+
var isTableFixedColumnWidthsOptionEnabled = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : false;
|
|
21
|
+
var shouldUseIncreasedScalingPercent = arguments.length > 10 ? arguments[10] : undefined;
|
|
22
|
+
var isCommentEditor = arguments.length > 11 ? arguments[11] : undefined;
|
|
23
|
+
var isChromelessEditor = arguments.length > 12 ? arguments[12] : undefined;
|
|
24
|
+
var isTableResizingEnabled = arguments.length > 13 ? arguments[13] : undefined;
|
|
25
25
|
var list = {};
|
|
26
26
|
var ariaNotifyPlugin = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.accessibilityUtils) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions.ariaNotify;
|
|
27
27
|
bindKeymapWithCommand(
|
|
@@ -92,7 +92,7 @@ export function keymapPlugin(getEditorContainerWidth, api, nodeViewPortalProvide
|
|
|
92
92
|
// Ignored via go/ees005
|
|
93
93
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
94
94
|
addColumnAfterVO.common, addColumnAfterCommand(api, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent), list);
|
|
95
|
-
if (
|
|
95
|
+
if (moveRowDown.common && moveRowUp.common && moveColumnLeft.common && moveColumnRight.common) {
|
|
96
96
|
var isNewKeyMapExperiment = expValEquals('editor-a11y-fy26-keyboard-move-row-column', 'isEnabled', true);
|
|
97
97
|
// Move row/column shortcuts
|
|
98
98
|
/**
|
|
@@ -29,7 +29,7 @@ import { replaceSelectedTable } from './transforms/replace-table';
|
|
|
29
29
|
import { findControlsHoverDecoration } from './utils/decoration';
|
|
30
30
|
import { transformSliceToCorrectEmptyTableCells, transformSliceToFixHardBreakProblemOnCopyFromCell, transformSliceToRemoveOpenTable, transformSliceToRemoveNestedTables, isHeaderRowRequired, transformSliceTableLayoutDefaultToCenter } from './utils/paste';
|
|
31
31
|
import { applyMeasuredWidthToAllTables, isContentModeSupported } from './utils/tableMode';
|
|
32
|
-
export var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, nodeViewPortalProviderAPI, eventDispatcher, pluginConfig, getEditorContainerWidth, getEditorFeatureFlags, getIntl, fullWidthModeEnabled, previousFullWidthModeEnabled,
|
|
32
|
+
export var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, nodeViewPortalProviderAPI, eventDispatcher, pluginConfig, getEditorContainerWidth, getEditorFeatureFlags, getIntl, fullWidthModeEnabled, previousFullWidthModeEnabled, editorAnalyticsAPI, pluginInjectionApi, isTableScalingEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor, allowFixedColumnWidthOption) {
|
|
33
33
|
var _accessibilityUtils;
|
|
34
34
|
var state = createPluginState(dispatch, _objectSpread(_objectSpread(_objectSpread({
|
|
35
35
|
pluginConfig: pluginConfig,
|
|
@@ -42,7 +42,7 @@ export var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch
|
|
|
42
42
|
wasFullWidthModeEnabled: previousFullWidthModeEnabled,
|
|
43
43
|
isHeaderRowEnabled: !!pluginConfig.allowHeaderRow,
|
|
44
44
|
isHeaderColumnEnabled: false,
|
|
45
|
-
isDragAndDropEnabled:
|
|
45
|
+
isDragAndDropEnabled: true,
|
|
46
46
|
isTableScalingEnabled: isTableScalingEnabled
|
|
47
47
|
}, defaultHoveredCell), defaultTableSelection), {}, {
|
|
48
48
|
getIntl: getIntl
|
|
@@ -75,7 +75,7 @@ export var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch
|
|
|
75
75
|
tableRow: tableRowView({
|
|
76
76
|
eventDispatcher: eventDispatcher,
|
|
77
77
|
pluginInjectionApi: pluginInjectionApi,
|
|
78
|
-
isDragAndDropEnabled:
|
|
78
|
+
isDragAndDropEnabled: true
|
|
79
79
|
}),
|
|
80
80
|
tableCell: tableCellView({
|
|
81
81
|
eventDispatcher: eventDispatcher,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import { createElement } from 'react';
|
|
3
|
-
import { RawIntlProvider } from 'react-intl
|
|
3
|
+
import { RawIntlProvider } from 'react-intl';
|
|
4
4
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
5
5
|
import uuid from 'uuid/v4';
|
|
6
6
|
import { nonNullable } from '@atlaskit/editor-common/utils';
|
|
@@ -13,7 +13,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import { createElement } from 'react';
|
|
16
|
-
import { RawIntlProvider } from 'react-intl
|
|
16
|
+
import { RawIntlProvider } from 'react-intl';
|
|
17
17
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
18
18
|
import uuid from 'uuid/v4';
|
|
19
19
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|