@atlaskit/editor-plugin-table 21.0.0 → 22.1.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 +52 -0
- package/dist/cjs/nodeviews/TableComponent.js +20 -4
- package/dist/cjs/nodeviews/table.js +15 -13
- package/dist/cjs/nodeviews/toDOM.js +8 -5
- package/dist/cjs/pm-plugins/keymap.js +12 -12
- package/dist/cjs/pm-plugins/main.js +3 -3
- package/dist/cjs/pm-plugins/table-width.js +8 -5
- package/dist/cjs/pm-plugins/utils/tableMode.js +15 -34
- package/dist/cjs/tablePlugin.js +40 -45
- package/dist/cjs/ui/ContentComponent.js +0 -1
- package/dist/cjs/ui/global-styles.js +1 -2
- package/dist/cjs/ui/toolbar.js +5 -11
- package/dist/es2019/nodeviews/TableComponent.js +18 -2
- package/dist/es2019/nodeviews/table.js +14 -14
- package/dist/es2019/nodeviews/toDOM.js +8 -5
- package/dist/es2019/pm-plugins/keymap.js +2 -2
- package/dist/es2019/pm-plugins/main.js +3 -3
- package/dist/es2019/pm-plugins/table-width.js +8 -5
- package/dist/es2019/pm-plugins/utils/tableMode.js +6 -24
- package/dist/es2019/tablePlugin.js +4 -10
- package/dist/es2019/ui/ContentComponent.js +0 -1
- package/dist/es2019/ui/global-styles.js +1 -2
- package/dist/es2019/ui/toolbar.js +4 -10
- package/dist/esm/nodeviews/TableComponent.js +18 -2
- package/dist/esm/nodeviews/table.js +16 -14
- package/dist/esm/nodeviews/toDOM.js +8 -5
- package/dist/esm/pm-plugins/keymap.js +12 -12
- package/dist/esm/pm-plugins/main.js +3 -3
- package/dist/esm/pm-plugins/table-width.js +8 -5
- package/dist/esm/pm-plugins/utils/tableMode.js +14 -33
- package/dist/esm/tablePlugin.js +40 -45
- package/dist/esm/ui/ContentComponent.js +0 -1
- package/dist/esm/ui/global-styles.js +1 -2
- package/dist/esm/ui/toolbar.js +5 -11
- package/dist/types/pm-plugins/keymap.d.ts +1 -1
- package/dist/types/pm-plugins/main.d.ts +1 -1
- package/dist/types/pm-plugins/utils/tableMode.d.ts +3 -6
- package/dist/types/tablePluginType.d.ts +0 -6
- package/dist/types/ui/global-styles.d.ts +1 -2
- package/dist/types-ts4.5/pm-plugins/keymap.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/main.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/utils/tableMode.d.ts +3 -6
- package/dist/types-ts4.5/tablePluginType.d.ts +0 -6
- package/dist/types-ts4.5/ui/global-styles.d.ts +1 -2
- package/package.json +4 -4
|
@@ -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,
|
|
@@ -11,13 +11,14 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
11
11
|
|
|
12
12
|
import { SetAttrsStep } from '@atlaskit/adf-schema/steps';
|
|
13
13
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
14
|
+
import { isTableInContentMode } from '@atlaskit/editor-common/table';
|
|
14
15
|
import { isReplaceDocOperation } from '@atlaskit/editor-common/utils/document';
|
|
15
16
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
16
17
|
import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorMaxWidthLayoutWidth, akEditorWideLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
17
18
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
18
19
|
import { TABLE_MAX_WIDTH, TABLE_FULL_WIDTH } from './table-resizing/utils/consts';
|
|
19
20
|
import { ALIGN_START } from './utils/alignment';
|
|
20
|
-
import {
|
|
21
|
+
import { isContentModeSupported } from './utils/tableMode';
|
|
21
22
|
export var pluginKey = new PluginKey('tableWidthPlugin');
|
|
22
23
|
var createPlugin = function createPlugin(dispatch, dispatchAnalyticsEvent, fullWidthEnabled, maxWidthEnabled, isTableScalingEnabled, isTableAlignmentEnabled, isCommentEditor) {
|
|
23
24
|
return new SafePlugin({
|
|
@@ -65,10 +66,12 @@ var createPlugin = function createPlugin(dispatch, dispatchAnalyticsEvent, fullW
|
|
|
65
66
|
if (isReplaceDocumentOperation && !isCommentEditor) {
|
|
66
67
|
newState.doc.forEach(function (node, offset) {
|
|
67
68
|
if (isTableInContentMode({
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
tableNode: node,
|
|
70
|
+
isSupported: isContentModeSupported({
|
|
71
|
+
allowColumnResizing: true,
|
|
72
|
+
allowTableResizing: true,
|
|
73
|
+
isFullPageEditor: true
|
|
74
|
+
}),
|
|
72
75
|
isTableNested: false
|
|
73
76
|
})) {
|
|
74
77
|
return;
|
|
@@ -1,37 +1,14 @@
|
|
|
1
1
|
import { ACTION_SUBJECT, EVENT_TYPE, TABLE_ACTION } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import { TableSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
3
|
+
import { hasTableBeenResized } from '@atlaskit/editor-common/table';
|
|
3
4
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
4
|
-
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
5
|
-
import { hasTableColumnBeenResized } from '../table-resizing/utils/colgroup';
|
|
6
5
|
import { applyTableMeasurement, getTableMeasurement } from '../transforms/content-mode';
|
|
7
|
-
|
|
8
|
-
export var isTableInContentMode = function isTableInContentMode(_ref) {
|
|
6
|
+
export var isContentModeSupported = function isContentModeSupported(_ref) {
|
|
9
7
|
var allowColumnResizing = _ref.allowColumnResizing,
|
|
10
8
|
allowTableResizing = _ref.allowTableResizing,
|
|
11
|
-
isFullPageEditor = _ref.isFullPageEditor
|
|
12
|
-
isTableNested = _ref.isTableNested,
|
|
13
|
-
node = _ref.node;
|
|
14
|
-
if (!expValEqualsNoExposure('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true)) {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
if (!node || isTableNested) {
|
|
18
|
-
return false;
|
|
19
|
-
}
|
|
20
|
-
return isContentModeSupported({
|
|
21
|
-
allowColumnResizing: allowColumnResizing,
|
|
22
|
-
allowTableResizing: allowTableResizing,
|
|
23
|
-
isFullPageEditor: isFullPageEditor
|
|
24
|
-
}) && !hasTableBeenResized(node) && node.attrs.layout === ALIGN_START;
|
|
25
|
-
};
|
|
26
|
-
export var isContentModeSupported = function isContentModeSupported(_ref2) {
|
|
27
|
-
var allowColumnResizing = _ref2.allowColumnResizing,
|
|
28
|
-
allowTableResizing = _ref2.allowTableResizing,
|
|
29
|
-
isFullPageEditor = _ref2.isFullPageEditor;
|
|
9
|
+
isFullPageEditor = _ref.isFullPageEditor;
|
|
30
10
|
return allowColumnResizing && allowTableResizing && isFullPageEditor;
|
|
31
11
|
};
|
|
32
|
-
export var hasTableBeenResized = function hasTableBeenResized(node) {
|
|
33
|
-
return node.attrs.width !== null || hasTableColumnBeenResized(node);
|
|
34
|
-
};
|
|
35
12
|
|
|
36
13
|
/**
|
|
37
14
|
* Iterates all top-level tables in the document, and for those in content mode,
|
|
@@ -49,7 +26,7 @@ export var applyMeasuredWidthToAllTables = function applyMeasuredWidthToAllTable
|
|
|
49
26
|
|
|
50
27
|
// modify only top-level tables
|
|
51
28
|
doc.forEach(function (node, offset) {
|
|
52
|
-
if (node.type !== table || hasTableBeenResized(node) && node.attrs.layout !==
|
|
29
|
+
if (node.type !== table || hasTableBeenResized(node) && node.attrs.layout !== 'align-start') {
|
|
53
30
|
return;
|
|
54
31
|
}
|
|
55
32
|
var domNode = view.domAtPos(offset + 1).node;
|
|
@@ -64,10 +41,10 @@ export var applyMeasuredWidthToAllTables = function applyMeasuredWidthToAllTable
|
|
|
64
41
|
measurement: getTableMeasurement(tableRef)
|
|
65
42
|
});
|
|
66
43
|
});
|
|
67
|
-
measuredTables.forEach(function (
|
|
68
|
-
var node =
|
|
69
|
-
offset =
|
|
70
|
-
measurement =
|
|
44
|
+
measuredTables.forEach(function (_ref2) {
|
|
45
|
+
var node = _ref2.node,
|
|
46
|
+
offset = _ref2.offset,
|
|
47
|
+
measurement = _ref2.measurement;
|
|
71
48
|
tr = applyTableMeasurement(tr, node, measurement, offset);
|
|
72
49
|
modified = true;
|
|
73
50
|
});
|
|
@@ -81,8 +58,8 @@ export var applyMeasuredWidthToAllTables = function applyMeasuredWidthToAllTable
|
|
|
81
58
|
attributes: {
|
|
82
59
|
editorContainerWidth: (_pluginInjectionApi$w = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$w2 = pluginInjectionApi.width) === null || _pluginInjectionApi$w2 === void 0 || (_pluginInjectionApi$w2 = _pluginInjectionApi$w2.sharedState.currentState()) === null || _pluginInjectionApi$w2 === void 0 ? void 0 : _pluginInjectionApi$w2.width) !== null && _pluginInjectionApi$w !== void 0 ? _pluginInjectionApi$w : 0,
|
|
83
60
|
totalTablesResized: measuredTables.length,
|
|
84
|
-
measurements: measuredTables.map(function (
|
|
85
|
-
var measurement =
|
|
61
|
+
measurements: measuredTables.map(function (_ref3) {
|
|
62
|
+
var measurement = _ref3.measurement;
|
|
86
63
|
return {
|
|
87
64
|
tableWidth: measurement.tableWidth,
|
|
88
65
|
totalColumnCount: measurement.colWidths.length
|
|
@@ -93,6 +70,10 @@ export var applyMeasuredWidthToAllTables = function applyMeasuredWidthToAllTable
|
|
|
93
70
|
view.dispatch(tr.setMeta('addToHistory', false));
|
|
94
71
|
}
|
|
95
72
|
};
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Used to measure a selected table width with it's content being laid out natively by the browser
|
|
76
|
+
*/
|
|
96
77
|
export var applyMeasuredWidthToSelectedTable = function applyMeasuredWidthToSelectedTable(view, api) {
|
|
97
78
|
var _api$analytics, _api$width$sharedStat, _api$width;
|
|
98
79
|
var tableObject = findTable(view.state.selection);
|
package/dist/esm/tablePlugin.js
CHANGED
|
@@ -66,7 +66,6 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
66
66
|
};
|
|
67
67
|
var options = _objectSpread(_objectSpread({}, config), {}, {
|
|
68
68
|
tableOptions: (_config$tableOptions = config === null || config === void 0 ? void 0 : config.tableOptions) !== null && _config$tableOptions !== void 0 ? _config$tableOptions : {},
|
|
69
|
-
dragAndDropEnabled: (config === null || config === void 0 ? void 0 : config.dragAndDropEnabled) || fg('platform_editor_enable_table_dnd'),
|
|
70
69
|
isTableScalingEnabled: (config === null || config === void 0 ? void 0 : config.isTableScalingEnabled) || fg('platform_editor_enable_table_scaling')
|
|
71
70
|
});
|
|
72
71
|
var defaultGetEditorContainerWidth = function defaultGetEditorContainerWidth() {
|
|
@@ -283,11 +282,10 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
283
282
|
wasFullWidthEnabled = _ref3.wasFullWidthEnabled,
|
|
284
283
|
tableOptions = _ref3.tableOptions,
|
|
285
284
|
getEditorFeatureFlags = _ref3.getEditorFeatureFlags,
|
|
286
|
-
dragAndDropEnabled = _ref3.dragAndDropEnabled,
|
|
287
285
|
isTableScalingEnabled = _ref3.isTableScalingEnabled,
|
|
288
286
|
isCommentEditor = _ref3.isCommentEditor,
|
|
289
287
|
isChromelessEditor = _ref3.isChromelessEditor;
|
|
290
|
-
return createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, nodeViewPortalProviderAPI, eventDispatcher, pluginConfig(tableOptions), defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, getIntl, fullWidthEnabled, wasFullWidthEnabled,
|
|
288
|
+
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);
|
|
291
289
|
}
|
|
292
290
|
}, {
|
|
293
291
|
name: 'tablePMColResizing',
|
|
@@ -319,7 +317,6 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
319
317
|
var getIntl = _ref6.getIntl,
|
|
320
318
|
nodeViewPortalProviderAPI = _ref6.nodeViewPortalProviderAPI;
|
|
321
319
|
var _ref7 = options || {},
|
|
322
|
-
dragAndDropEnabled = _ref7.dragAndDropEnabled,
|
|
323
320
|
_ref7$isTableScalingE = _ref7.isTableScalingEnabled,
|
|
324
321
|
isTableScalingEnabled = _ref7$isTableScalingE === void 0 ? false : _ref7$isTableScalingE,
|
|
325
322
|
_ref7$fullWidthEnable = _ref7.fullWidthEnabled,
|
|
@@ -329,7 +326,7 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
329
326
|
_ref7$isChromelessEdi = _ref7.isChromelessEditor,
|
|
330
327
|
isChromelessEditor = _ref7$isChromelessEdi === void 0 ? false : _ref7$isChromelessEdi,
|
|
331
328
|
tableOptions = _ref7.tableOptions;
|
|
332
|
-
return keymapPlugin(defaultGetEditorContainerWidth, api, nodeViewPortalProviderAPI, editorAnalyticsAPI,
|
|
329
|
+
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);
|
|
333
330
|
}
|
|
334
331
|
}, {
|
|
335
332
|
name: 'tableSelectionKeymap',
|
|
@@ -340,12 +337,10 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
340
337
|
}, {
|
|
341
338
|
name: 'tableEditing',
|
|
342
339
|
plugin: function plugin() {
|
|
343
|
-
var _ref9 = options || {},
|
|
344
|
-
dragAndDropEnabled = _ref9.dragAndDropEnabled;
|
|
345
340
|
return tableEditing({
|
|
346
|
-
reportFixedTable: function reportFixedTable(
|
|
347
|
-
var tr =
|
|
348
|
-
reason =
|
|
341
|
+
reportFixedTable: function reportFixedTable(_ref9) {
|
|
342
|
+
var tr = _ref9.tr,
|
|
343
|
+
reason = _ref9.reason;
|
|
349
344
|
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
|
|
350
345
|
action: TABLE_ACTION.FIXED,
|
|
351
346
|
actionSubject: ACTION_SUBJECT.TABLE,
|
|
@@ -356,71 +351,71 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
356
351
|
eventType: EVENT_TYPE.TRACK
|
|
357
352
|
})(tr);
|
|
358
353
|
},
|
|
359
|
-
dragAndDropEnabled:
|
|
354
|
+
dragAndDropEnabled: true
|
|
360
355
|
});
|
|
361
356
|
}
|
|
362
357
|
}, {
|
|
363
358
|
name: 'tableStickyHeaders',
|
|
364
|
-
plugin: function plugin(
|
|
365
|
-
var dispatch =
|
|
359
|
+
plugin: function plugin(_ref0) {
|
|
360
|
+
var dispatch = _ref0.dispatch;
|
|
366
361
|
return options && options.tableOptions.stickyHeaders ? createStickyHeadersPlugin(dispatch, function () {
|
|
367
362
|
return [];
|
|
368
363
|
}) : undefined;
|
|
369
364
|
}
|
|
370
365
|
}, {
|
|
371
366
|
name: 'tableDragAndDrop',
|
|
372
|
-
plugin: function plugin(
|
|
373
|
-
var dispatch =
|
|
374
|
-
return
|
|
367
|
+
plugin: function plugin(_ref1) {
|
|
368
|
+
var dispatch = _ref1.dispatch;
|
|
369
|
+
return createDragAndDropPlugin(dispatch, editorAnalyticsAPI, options === null || options === void 0 ? void 0 : options.isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, options.isCommentEditor, api);
|
|
375
370
|
}
|
|
376
371
|
}, {
|
|
377
372
|
name: 'tableViewModeSort',
|
|
378
|
-
plugin: function plugin(
|
|
379
|
-
var nodeViewPortalProviderAPI =
|
|
373
|
+
plugin: function plugin(_ref10) {
|
|
374
|
+
var nodeViewPortalProviderAPI = _ref10.nodeViewPortalProviderAPI;
|
|
380
375
|
return api !== null && api !== void 0 && api.editorViewMode ? createViewModeSortPlugin(api, nodeViewPortalProviderAPI) : undefined;
|
|
381
376
|
}
|
|
382
377
|
}, {
|
|
383
378
|
name: 'tableLocalId',
|
|
384
|
-
plugin: function plugin(
|
|
385
|
-
var dispatch =
|
|
379
|
+
plugin: function plugin(_ref11) {
|
|
380
|
+
var dispatch = _ref11.dispatch;
|
|
386
381
|
return !fg('platform_editor_adf_with_localid') ? createTableLocalIdPlugin(dispatch) : undefined;
|
|
387
382
|
}
|
|
388
383
|
}, {
|
|
389
384
|
name: 'tableWidth',
|
|
390
|
-
plugin: function plugin(
|
|
385
|
+
plugin: function plugin(_ref12) {
|
|
391
386
|
var _options$fullWidthEna, _options$maxWidthEnab, _options$isTableScali, _options$tableOptions3, _options$isCommentEdi;
|
|
392
|
-
var dispatchAnalyticsEvent =
|
|
393
|
-
dispatch =
|
|
387
|
+
var dispatchAnalyticsEvent = _ref12.dispatchAnalyticsEvent,
|
|
388
|
+
dispatch = _ref12.dispatch;
|
|
394
389
|
return options !== null && options !== void 0 && options.tableOptions.allowTableResizing ? createTableWidthPlugin(dispatch, dispatchAnalyticsEvent, (_options$fullWidthEna = options.fullWidthEnabled) !== null && _options$fullWidthEna !== void 0 ? _options$fullWidthEna : false, (_options$maxWidthEnab = options.maxWidthEnabled) !== null && _options$maxWidthEnab !== void 0 ? _options$maxWidthEnab : false, (_options$isTableScali = options.isTableScalingEnabled) !== null && _options$isTableScali !== void 0 ? _options$isTableScali : false, (_options$tableOptions3 = options.tableOptions.allowTableResizing) !== null && _options$tableOptions3 !== void 0 ? _options$tableOptions3 : false, (_options$isCommentEdi = options.isCommentEditor) !== null && _options$isCommentEdi !== void 0 ? _options$isCommentEdi : false) : undefined;
|
|
395
390
|
}
|
|
396
391
|
}, {
|
|
397
392
|
name: 'tableWidthInCommentFix',
|
|
398
|
-
plugin: function plugin(
|
|
393
|
+
plugin: function plugin(_ref13) {
|
|
399
394
|
var _options$tableOptions4;
|
|
400
|
-
var dispatch =
|
|
395
|
+
var dispatch = _ref13.dispatch;
|
|
401
396
|
return options !== null && options !== void 0 && options.tableOptions.allowTableResizing && options !== null && options !== void 0 && options.isCommentEditor ? createTableWidthInCommentFixPlugin(dispatch, (_options$tableOptions4 = options.tableOptions.allowTableAlignment) !== null && _options$tableOptions4 !== void 0 ? _options$tableOptions4 : false) : undefined;
|
|
402
397
|
}
|
|
403
398
|
},
|
|
404
399
|
// TODO: ED-26961 - should be deprecated and eventually replaced with 'tableAnalyticsPlugin'
|
|
405
400
|
{
|
|
406
401
|
name: 'tableOverflowAnalyticsPlugin',
|
|
407
|
-
plugin: function plugin(
|
|
402
|
+
plugin: function plugin(_ref14) {
|
|
408
403
|
var _options$tableOptions5;
|
|
409
|
-
var dispatch =
|
|
410
|
-
dispatchAnalyticsEvent =
|
|
404
|
+
var dispatch = _ref14.dispatch,
|
|
405
|
+
dispatchAnalyticsEvent = _ref14.dispatchAnalyticsEvent;
|
|
411
406
|
return createTableOverflowAnalyticsPlugin(dispatch, dispatchAnalyticsEvent, (_options$tableOptions5 = options === null || options === void 0 ? void 0 : options.tableOptions.allowTableResizing) !== null && _options$tableOptions5 !== void 0 ? _options$tableOptions5 : false);
|
|
412
407
|
}
|
|
413
408
|
}, {
|
|
414
409
|
name: 'tableAnalyticsPlugin',
|
|
415
|
-
plugin: function plugin(
|
|
416
|
-
var dispatch =
|
|
417
|
-
dispatchAnalyticsEvent =
|
|
410
|
+
plugin: function plugin(_ref15) {
|
|
411
|
+
var dispatch = _ref15.dispatch,
|
|
412
|
+
dispatchAnalyticsEvent = _ref15.dispatchAnalyticsEvent;
|
|
418
413
|
return createTableAnalyticsPlugin(dispatch, dispatchAnalyticsEvent);
|
|
419
414
|
}
|
|
420
415
|
}, {
|
|
421
416
|
name: 'tableGetEditorViewReferencePlugin',
|
|
422
|
-
plugin: function plugin(
|
|
423
|
-
var dispatchAnalyticsEvent =
|
|
417
|
+
plugin: function plugin(_ref16) {
|
|
418
|
+
var dispatchAnalyticsEvent = _ref16.dispatchAnalyticsEvent;
|
|
424
419
|
return new SafePlugin({
|
|
425
420
|
view: function view(editorView) {
|
|
426
421
|
editorViewRef.current = editorView;
|
|
@@ -474,8 +469,8 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
474
469
|
}
|
|
475
470
|
}, {
|
|
476
471
|
name: 'tableSizeSelectorPlugin',
|
|
477
|
-
plugin: function plugin(
|
|
478
|
-
var dispatch =
|
|
472
|
+
plugin: function plugin(_ref17) {
|
|
473
|
+
var dispatch = _ref17.dispatch;
|
|
479
474
|
return isTableSelectorEnabled ? createSizeSelectorPlugin(dispatch) : undefined;
|
|
480
475
|
}
|
|
481
476
|
}, {
|
|
@@ -506,12 +501,12 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
506
501
|
}
|
|
507
502
|
return plugins;
|
|
508
503
|
},
|
|
509
|
-
contentComponent: function contentComponent(
|
|
510
|
-
var editorView =
|
|
511
|
-
popupsMountPoint =
|
|
512
|
-
popupsBoundariesElement =
|
|
513
|
-
popupsScrollableElement =
|
|
514
|
-
dispatchAnalyticsEvent =
|
|
504
|
+
contentComponent: function contentComponent(_ref18) {
|
|
505
|
+
var editorView = _ref18.editorView,
|
|
506
|
+
popupsMountPoint = _ref18.popupsMountPoint,
|
|
507
|
+
popupsBoundariesElement = _ref18.popupsBoundariesElement,
|
|
508
|
+
popupsScrollableElement = _ref18.popupsScrollableElement,
|
|
509
|
+
dispatchAnalyticsEvent = _ref18.dispatchAnalyticsEvent;
|
|
515
510
|
return /*#__PURE__*/React.createElement(ContentComponent, {
|
|
516
511
|
api: api,
|
|
517
512
|
editorView: editorView,
|
|
@@ -526,8 +521,8 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
526
521
|
});
|
|
527
522
|
},
|
|
528
523
|
pluginsOptions: {
|
|
529
|
-
quickInsert: function quickInsert(
|
|
530
|
-
var formatMessage =
|
|
524
|
+
quickInsert: function quickInsert(_ref19) {
|
|
525
|
+
var formatMessage = _ref19.formatMessage;
|
|
531
526
|
return [{
|
|
532
527
|
id: 'table',
|
|
533
528
|
title: formatMessage(messages.table),
|
|
@@ -597,8 +592,8 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
597
592
|
return editorViewRef.current;
|
|
598
593
|
}, options, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent)(pluginConfig(options === null || options === void 0 ? void 0 : options.tableOptions))
|
|
599
594
|
},
|
|
600
|
-
usePluginHook: function usePluginHook(
|
|
601
|
-
var editorView =
|
|
595
|
+
usePluginHook: function usePluginHook(_ref20) {
|
|
596
|
+
var editorView = _ref20.editorView;
|
|
602
597
|
var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['editorViewMode'], function (states) {
|
|
603
598
|
var _states$editorViewMod;
|
|
604
599
|
return {
|
|
@@ -211,7 +211,6 @@ export var ContentComponent = function ContentComponent(_ref3) {
|
|
|
211
211
|
fallbackComponent: null
|
|
212
212
|
}, /*#__PURE__*/React.createElement(GlobalStylesWrapper, {
|
|
213
213
|
featureFlags: api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState(),
|
|
214
|
-
isDragAndDropEnabledOption: options === null || options === void 0 ? void 0 : options.dragAndDropEnabled,
|
|
215
214
|
api: api
|
|
216
215
|
}), /*#__PURE__*/React.createElement(ContentComponentInternal, {
|
|
217
216
|
api: api,
|
|
@@ -8,7 +8,6 @@ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks'
|
|
|
8
8
|
import { tableStyles } from './common-styles';
|
|
9
9
|
export var GlobalStylesWrapper = function GlobalStylesWrapper(_ref) {
|
|
10
10
|
var featureFlags = _ref.featureFlags,
|
|
11
|
-
isDragAndDropEnabledOption = _ref.isDragAndDropEnabledOption,
|
|
12
11
|
api = _ref.api;
|
|
13
12
|
var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['editorViewMode'], function (states) {
|
|
14
13
|
var _states$editorViewMod;
|
|
@@ -21,7 +20,7 @@ export var GlobalStylesWrapper = function GlobalStylesWrapper(_ref) {
|
|
|
21
20
|
return jsx(Global, {
|
|
22
21
|
styles: tableStyles({
|
|
23
22
|
featureFlags: featureFlags,
|
|
24
|
-
isDragAndDropEnabled:
|
|
23
|
+
isDragAndDropEnabled: !isLivePageViewMode
|
|
25
24
|
})
|
|
26
25
|
});
|
|
27
26
|
};
|
package/dist/esm/ui/toolbar.js
CHANGED
|
@@ -412,17 +412,11 @@ export var getToolbarConfig = function getToolbarConfig(getEditorContainerWidth,
|
|
|
412
412
|
var areAnyNewToolbarFlagsEnabled = areToolbarFlagsEnabled(Boolean(api === null || api === void 0 ? void 0 : api.toolbar));
|
|
413
413
|
if (editorExperiment('platform_editor_controls', 'variant1')) {
|
|
414
414
|
var _api$editorViewMode;
|
|
415
|
-
var
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
isDragMenuOpen = _getDragDropPluginSta2 === void 0 ? false : _getDragDropPluginSta2,
|
|
421
|
-
_getDragDropPluginSta3 = _getDragDropPluginSta.isDragging,
|
|
422
|
-
isDragging = _getDragDropPluginSta3 === void 0 ? false : _getDragDropPluginSta3;
|
|
423
|
-
isDragHandleMenuOpened = isDragMenuOpen;
|
|
424
|
-
isTableRowOrColumnDragged = isDragging;
|
|
425
|
-
}
|
|
415
|
+
var _getDragDropPluginSta = getDragDropPluginState(state),
|
|
416
|
+
_getDragDropPluginSta2 = _getDragDropPluginSta.isDragMenuOpen,
|
|
417
|
+
isDragHandleMenuOpened = _getDragDropPluginSta2 === void 0 ? false : _getDragDropPluginSta2,
|
|
418
|
+
_getDragDropPluginSta3 = _getDragDropPluginSta.isDragging,
|
|
419
|
+
isTableRowOrColumnDragged = _getDragDropPluginSta3 === void 0 ? false : _getDragDropPluginSta3;
|
|
426
420
|
var isTableOrColumnResizing = !!(resizeState !== null && resizeState !== void 0 && resizeState.dragging || tableWidthState !== null && tableWidthState !== void 0 && tableWidthState.resizing);
|
|
427
421
|
var isTableMenuOpened = pluginState.isContextualMenuOpen || isDragHandleMenuOpened;
|
|
428
422
|
var isTableState = isTableRowOrColumnDragged || isTableOrColumnResizing || isTableMenuOpened;
|
|
@@ -4,5 +4,5 @@ import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
|
4
4
|
import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
5
5
|
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
6
6
|
import type { PluginInjectionAPI, PluginInjectionAPIWithA11y } from '../types';
|
|
7
|
-
export declare function keymapPlugin(getEditorContainerWidth: GetEditorContainerWidth, api: PluginInjectionAPI | undefined | null, nodeViewPortalProviderAPI: PortalProviderAPI, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null,
|
|
7
|
+
export declare function keymapPlugin(getEditorContainerWidth: GetEditorContainerWidth, api: PluginInjectionAPI | undefined | null, nodeViewPortalProviderAPI: PortalProviderAPI, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isFullWidthEnabled?: boolean, pluginInjectionApi?: PluginInjectionAPIWithA11y, getIntl?: () => IntlShape, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean, isChromelessEditor?: boolean, isTableResizingEnabled?: boolean): SafePlugin;
|
|
8
8
|
export default keymapPlugin;
|
|
@@ -5,4 +5,4 @@ import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
|
5
5
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
6
6
|
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
7
7
|
import type { PluginConfig, PluginInjectionAPI } from '../types';
|
|
8
|
-
export declare const createPlugin: (dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, portalProviderAPI: PortalProviderAPI, nodeViewPortalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, pluginConfig: PluginConfig, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, getIntl: () => IntlShape, fullWidthModeEnabled?: boolean, previousFullWidthModeEnabled?: boolean,
|
|
8
|
+
export declare const createPlugin: (dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, portalProviderAPI: PortalProviderAPI, nodeViewPortalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, pluginConfig: PluginConfig, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, getIntl: () => IntlShape, fullWidthModeEnabled?: boolean, previousFullWidthModeEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, pluginInjectionApi?: PluginInjectionAPI, isTableScalingEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean, isChromelessEditor?: boolean, allowFixedColumnWidthOption?: boolean) => SafePlugin<import("../types").TablePluginState>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
1
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
2
|
import type { PluginInjectionAPI } from '../../types';
|
|
4
3
|
type ContentModePluginOptions = {
|
|
@@ -6,17 +5,15 @@ type ContentModePluginOptions = {
|
|
|
6
5
|
allowTableResizing: boolean;
|
|
7
6
|
isFullPageEditor: boolean;
|
|
8
7
|
};
|
|
9
|
-
export declare const isTableInContentMode: ({ allowColumnResizing, allowTableResizing, isFullPageEditor, isTableNested, node, }: ContentModePluginOptions & {
|
|
10
|
-
isTableNested?: boolean;
|
|
11
|
-
node?: PMNode;
|
|
12
|
-
}) => boolean;
|
|
13
8
|
export declare const isContentModeSupported: ({ allowColumnResizing, allowTableResizing, isFullPageEditor, }: ContentModePluginOptions) => boolean;
|
|
14
|
-
export declare const hasTableBeenResized: (node: PMNode) => boolean;
|
|
15
9
|
/**
|
|
16
10
|
* Iterates all top-level tables in the document, and for those in content mode,
|
|
17
11
|
* measures rendered column widths and sets colwidth + table width attributes
|
|
18
12
|
* in a single batched transaction.
|
|
19
13
|
*/
|
|
20
14
|
export declare const applyMeasuredWidthToAllTables: (view: EditorView, pluginInjectionApi?: PluginInjectionAPI) => void;
|
|
15
|
+
/**
|
|
16
|
+
* Used to measure a selected table width with it's content being laid out natively by the browser
|
|
17
|
+
*/
|
|
21
18
|
export declare const applyMeasuredWidthToSelectedTable: (view: EditorView, api?: PluginInjectionAPI) => void;
|
|
22
19
|
export {};
|
|
@@ -23,12 +23,6 @@ export interface TablePluginOptions {
|
|
|
23
23
|
* Note: This feature requires ADF schema changes to be supported.
|
|
24
24
|
*/
|
|
25
25
|
allowFixedColumnWidthOption?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-49683 Internal documentation for deprecation (no external access)}
|
|
28
|
-
* Deprecating this prop to enable drag and drop in tables by default.
|
|
29
|
-
* See {@link https://hello.atlassian.net/wiki/spaces/EDITOR/pages/6312469305/Deprecating+legacy+table+controls} for rollout plan
|
|
30
|
-
**/
|
|
31
|
-
dragAndDropEnabled?: boolean;
|
|
32
26
|
fullWidthEnabled?: boolean;
|
|
33
27
|
getEditorFeatureFlags?: GetEditorFeatureFlags;
|
|
34
28
|
isChromelessEditor?: boolean;
|
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
import { jsx } from '@emotion/react';
|
|
6
6
|
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
7
7
|
import type { PluginInjectionAPI } from '../types';
|
|
8
|
-
export declare const GlobalStylesWrapper: ({ featureFlags,
|
|
8
|
+
export declare const GlobalStylesWrapper: ({ featureFlags, api, }: {
|
|
9
9
|
api?: PluginInjectionAPI;
|
|
10
10
|
featureFlags: FeatureFlags | undefined;
|
|
11
|
-
isDragAndDropEnabledOption?: boolean;
|
|
12
11
|
}) => jsx.JSX.Element;
|
|
@@ -4,5 +4,5 @@ import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
|
4
4
|
import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
5
5
|
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
6
6
|
import type { PluginInjectionAPI, PluginInjectionAPIWithA11y } from '../types';
|
|
7
|
-
export declare function keymapPlugin(getEditorContainerWidth: GetEditorContainerWidth, api: PluginInjectionAPI | undefined | null, nodeViewPortalProviderAPI: PortalProviderAPI, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null,
|
|
7
|
+
export declare function keymapPlugin(getEditorContainerWidth: GetEditorContainerWidth, api: PluginInjectionAPI | undefined | null, nodeViewPortalProviderAPI: PortalProviderAPI, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isFullWidthEnabled?: boolean, pluginInjectionApi?: PluginInjectionAPIWithA11y, getIntl?: () => IntlShape, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean, isChromelessEditor?: boolean, isTableResizingEnabled?: boolean): SafePlugin;
|
|
8
8
|
export default keymapPlugin;
|
|
@@ -5,4 +5,4 @@ import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
|
5
5
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
6
6
|
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
7
7
|
import type { PluginConfig, PluginInjectionAPI } from '../types';
|
|
8
|
-
export declare const createPlugin: (dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, portalProviderAPI: PortalProviderAPI, nodeViewPortalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, pluginConfig: PluginConfig, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, getIntl: () => IntlShape, fullWidthModeEnabled?: boolean, previousFullWidthModeEnabled?: boolean,
|
|
8
|
+
export declare const createPlugin: (dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, portalProviderAPI: PortalProviderAPI, nodeViewPortalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, pluginConfig: PluginConfig, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, getIntl: () => IntlShape, fullWidthModeEnabled?: boolean, previousFullWidthModeEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, pluginInjectionApi?: PluginInjectionAPI, isTableScalingEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean, isChromelessEditor?: boolean, allowFixedColumnWidthOption?: boolean) => SafePlugin<import("../types").TablePluginState>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
1
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
2
|
import type { PluginInjectionAPI } from '../../types';
|
|
4
3
|
type ContentModePluginOptions = {
|
|
@@ -6,17 +5,15 @@ type ContentModePluginOptions = {
|
|
|
6
5
|
allowTableResizing: boolean;
|
|
7
6
|
isFullPageEditor: boolean;
|
|
8
7
|
};
|
|
9
|
-
export declare const isTableInContentMode: ({ allowColumnResizing, allowTableResizing, isFullPageEditor, isTableNested, node, }: ContentModePluginOptions & {
|
|
10
|
-
isTableNested?: boolean;
|
|
11
|
-
node?: PMNode;
|
|
12
|
-
}) => boolean;
|
|
13
8
|
export declare const isContentModeSupported: ({ allowColumnResizing, allowTableResizing, isFullPageEditor, }: ContentModePluginOptions) => boolean;
|
|
14
|
-
export declare const hasTableBeenResized: (node: PMNode) => boolean;
|
|
15
9
|
/**
|
|
16
10
|
* Iterates all top-level tables in the document, and for those in content mode,
|
|
17
11
|
* measures rendered column widths and sets colwidth + table width attributes
|
|
18
12
|
* in a single batched transaction.
|
|
19
13
|
*/
|
|
20
14
|
export declare const applyMeasuredWidthToAllTables: (view: EditorView, pluginInjectionApi?: PluginInjectionAPI) => void;
|
|
15
|
+
/**
|
|
16
|
+
* Used to measure a selected table width with it's content being laid out natively by the browser
|
|
17
|
+
*/
|
|
21
18
|
export declare const applyMeasuredWidthToSelectedTable: (view: EditorView, api?: PluginInjectionAPI) => void;
|
|
22
19
|
export {};
|
|
@@ -23,12 +23,6 @@ export interface TablePluginOptions {
|
|
|
23
23
|
* Note: This feature requires ADF schema changes to be supported.
|
|
24
24
|
*/
|
|
25
25
|
allowFixedColumnWidthOption?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-49683 Internal documentation for deprecation (no external access)}
|
|
28
|
-
* Deprecating this prop to enable drag and drop in tables by default.
|
|
29
|
-
* See {@link https://hello.atlassian.net/wiki/spaces/EDITOR/pages/6312469305/Deprecating+legacy+table+controls} for rollout plan
|
|
30
|
-
**/
|
|
31
|
-
dragAndDropEnabled?: boolean;
|
|
32
26
|
fullWidthEnabled?: boolean;
|
|
33
27
|
getEditorFeatureFlags?: GetEditorFeatureFlags;
|
|
34
28
|
isChromelessEditor?: boolean;
|
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
import { jsx } from '@emotion/react';
|
|
6
6
|
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
7
7
|
import type { PluginInjectionAPI } from '../types';
|
|
8
|
-
export declare const GlobalStylesWrapper: ({ featureFlags,
|
|
8
|
+
export declare const GlobalStylesWrapper: ({ featureFlags, api, }: {
|
|
9
9
|
api?: PluginInjectionAPI;
|
|
10
10
|
featureFlags: FeatureFlags | undefined;
|
|
11
|
-
isDragAndDropEnabledOption?: boolean;
|
|
12
11
|
}) => jsx.JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "22.1.0",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -52,11 +52,11 @@
|
|
|
52
52
|
"@atlaskit/insm": "^0.4.0",
|
|
53
53
|
"@atlaskit/menu": "^8.5.0",
|
|
54
54
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
55
|
-
"@atlaskit/pragmatic-drag-and-drop": "^1.
|
|
55
|
+
"@atlaskit/pragmatic-drag-and-drop": "^1.8.0",
|
|
56
56
|
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
|
|
57
57
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.1.0",
|
|
58
58
|
"@atlaskit/primitives": "^19.0.0",
|
|
59
|
-
"@atlaskit/tmp-editor-statsig": "^62.
|
|
59
|
+
"@atlaskit/tmp-editor-statsig": "^62.8.0",
|
|
60
60
|
"@atlaskit/toggle": "^15.6.0",
|
|
61
61
|
"@atlaskit/tokens": "^13.0.0",
|
|
62
62
|
"@atlaskit/tooltip": "^21.1.0",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"uuid": "^3.1.0"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
|
-
"@atlaskit/editor-common": "^114.
|
|
73
|
+
"@atlaskit/editor-common": "^114.2.0",
|
|
74
74
|
"react": "^18.2.0",
|
|
75
75
|
"react-dom": "^18.2.0",
|
|
76
76
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|