@atlaskit/editor-plugin-table 21.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 +40 -0
- package/dist/cjs/pm-plugins/keymap.js +12 -12
- package/dist/cjs/pm-plugins/main.js +3 -3
- 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/pm-plugins/keymap.js +2 -2
- package/dist/es2019/pm-plugins/main.js +3 -3
- 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/pm-plugins/keymap.js +12 -12
- package/dist/esm/pm-plugins/main.js +3 -3
- 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/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/tablePluginType.d.ts +0 -6
- package/dist/types-ts4.5/ui/global-styles.d.ts +1 -2
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 22.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [`b47ee185c5ac4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b47ee185c5ac4) -
|
|
8
|
+
Remove deprecated dragAndDropEnabled plugin option Drag and drop table rows/ columns and advanced
|
|
9
|
+
table controls used to be toggled with dragAndDropEnabled table plugin option however we're
|
|
10
|
+
deprecating this prop to make this the default behaviour.
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
// Before - to turn on drag and drop:
|
|
14
|
+
|
|
15
|
+
const createPreset = () =>
|
|
16
|
+
createDefaultPreset({ featureFlags: {}, paste: {} })
|
|
17
|
+
.add([tablePlugin, {tableOptions: {}, dragAndDropEnabled: true}])
|
|
18
|
+
|
|
19
|
+
const { preset } = usePreset(createPreset);
|
|
20
|
+
|
|
21
|
+
// Now - drag and drop enabled even without prop
|
|
22
|
+
const createPreset = () =>
|
|
23
|
+
createDefaultPreset({ featureFlags: {}, paste: {} })
|
|
24
|
+
.add([tablePlugin, {tableOptions: {}}])
|
|
25
|
+
|
|
26
|
+
const { preset } = usePreset(createPreset);
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
The `dragAndDropEnabled` property has also been removed from the `TablePluginOptions` TypeScript
|
|
30
|
+
interface.
|
|
31
|
+
|
|
32
|
+
**Note:** If you previously set `dragAndDropEnabled: false` to explicitly disable drag and drop,
|
|
33
|
+
this is no longer supported — drag and drop is now always enabled and cannot be turned off via
|
|
34
|
+
this option.
|
|
35
|
+
|
|
36
|
+
If issues occur when bumping editor package, please check if dragAndDropEnabled is still present
|
|
37
|
+
in editor integration.
|
|
38
|
+
|
|
39
|
+
### Patch Changes
|
|
40
|
+
|
|
41
|
+
- Updated dependencies
|
|
42
|
+
|
|
3
43
|
## 21.0.0
|
|
4
44
|
|
|
5
45
|
### Major Changes
|
|
@@ -17,18 +17,18 @@ var _columnResize = require("./commands/column-resize");
|
|
|
17
17
|
var _commandsWithAnalytics2 = require("./commands/commands-with-analytics");
|
|
18
18
|
var _goToNextCell = require("./commands/go-to-next-cell");
|
|
19
19
|
var _insert = require("./commands/insert");
|
|
20
|
-
function keymapPlugin(getEditorContainerWidth, api, nodeViewPortalProviderAPI, editorAnalyticsAPI
|
|
20
|
+
function keymapPlugin(getEditorContainerWidth, api, nodeViewPortalProviderAPI, editorAnalyticsAPI) {
|
|
21
21
|
var _pluginInjectionApi$a;
|
|
22
|
-
var isTableScalingEnabled = arguments.length >
|
|
23
|
-
var isTableAlignmentEnabled = arguments.length >
|
|
24
|
-
var isFullWidthEnabled = arguments.length >
|
|
25
|
-
var pluginInjectionApi = arguments.length >
|
|
26
|
-
var getIntl = arguments.length >
|
|
27
|
-
var isTableFixedColumnWidthsOptionEnabled = arguments.length >
|
|
28
|
-
var shouldUseIncreasedScalingPercent = arguments.length >
|
|
29
|
-
var isCommentEditor = arguments.length >
|
|
30
|
-
var isChromelessEditor = arguments.length >
|
|
31
|
-
var isTableResizingEnabled = arguments.length >
|
|
22
|
+
var isTableScalingEnabled = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
23
|
+
var isTableAlignmentEnabled = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
|
|
24
|
+
var isFullWidthEnabled = arguments.length > 6 ? arguments[6] : undefined;
|
|
25
|
+
var pluginInjectionApi = arguments.length > 7 ? arguments[7] : undefined;
|
|
26
|
+
var getIntl = arguments.length > 8 ? arguments[8] : undefined;
|
|
27
|
+
var isTableFixedColumnWidthsOptionEnabled = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : false;
|
|
28
|
+
var shouldUseIncreasedScalingPercent = arguments.length > 10 ? arguments[10] : undefined;
|
|
29
|
+
var isCommentEditor = arguments.length > 11 ? arguments[11] : undefined;
|
|
30
|
+
var isChromelessEditor = arguments.length > 12 ? arguments[12] : undefined;
|
|
31
|
+
var isTableResizingEnabled = arguments.length > 13 ? arguments[13] : undefined;
|
|
32
32
|
var list = {};
|
|
33
33
|
var ariaNotifyPlugin = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.accessibilityUtils) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions.ariaNotify;
|
|
34
34
|
(0, _keymaps.bindKeymapWithCommand)(
|
|
@@ -99,7 +99,7 @@ function keymapPlugin(getEditorContainerWidth, api, nodeViewPortalProviderAPI, e
|
|
|
99
99
|
// Ignored via go/ees005
|
|
100
100
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
101
101
|
_keymaps.addColumnAfterVO.common, (0, _insert.addColumnAfter)(api, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent), list);
|
|
102
|
-
if (
|
|
102
|
+
if (_keymaps.moveRowDown.common && _keymaps.moveRowUp.common && _keymaps.moveColumnLeft.common && _keymaps.moveColumnRight.common) {
|
|
103
103
|
var isNewKeyMapExperiment = (0, _expValEquals.expValEquals)('editor-a11y-fy26-keyboard-move-row-column', 'isEnabled', true);
|
|
104
104
|
// Move row/column shortcuts
|
|
105
105
|
/**
|
|
@@ -36,7 +36,7 @@ var _paste = require("./utils/paste");
|
|
|
36
36
|
var _tableMode = require("./utils/tableMode");
|
|
37
37
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
38
38
|
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) { (0, _defineProperty2.default)(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; }
|
|
39
|
-
var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, nodeViewPortalProviderAPI, eventDispatcher, pluginConfig, getEditorContainerWidth, getEditorFeatureFlags, getIntl, fullWidthModeEnabled, previousFullWidthModeEnabled,
|
|
39
|
+
var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, nodeViewPortalProviderAPI, eventDispatcher, pluginConfig, getEditorContainerWidth, getEditorFeatureFlags, getIntl, fullWidthModeEnabled, previousFullWidthModeEnabled, editorAnalyticsAPI, pluginInjectionApi, isTableScalingEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor, allowFixedColumnWidthOption) {
|
|
40
40
|
var _accessibilityUtils;
|
|
41
41
|
var state = (0, _pluginFactory.createPluginState)(dispatch, _objectSpread(_objectSpread(_objectSpread({
|
|
42
42
|
pluginConfig: pluginConfig,
|
|
@@ -49,7 +49,7 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalytic
|
|
|
49
49
|
wasFullWidthModeEnabled: previousFullWidthModeEnabled,
|
|
50
50
|
isHeaderRowEnabled: !!pluginConfig.allowHeaderRow,
|
|
51
51
|
isHeaderColumnEnabled: false,
|
|
52
|
-
isDragAndDropEnabled:
|
|
52
|
+
isDragAndDropEnabled: true,
|
|
53
53
|
isTableScalingEnabled: isTableScalingEnabled
|
|
54
54
|
}, _defaultTableSelection.defaultHoveredCell), _defaultTableSelection.defaultTableSelection), {}, {
|
|
55
55
|
getIntl: getIntl
|
|
@@ -82,7 +82,7 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalytic
|
|
|
82
82
|
tableRow: (0, _tableNodeViews.tableRowView)({
|
|
83
83
|
eventDispatcher: eventDispatcher,
|
|
84
84
|
pluginInjectionApi: pluginInjectionApi,
|
|
85
|
-
isDragAndDropEnabled:
|
|
85
|
+
isDragAndDropEnabled: true
|
|
86
86
|
}),
|
|
87
87
|
tableCell: (0, _tableNodeViews.tableCellView)({
|
|
88
88
|
eventDispatcher: eventDispatcher,
|
package/dist/cjs/tablePlugin.js
CHANGED
|
@@ -75,7 +75,6 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
75
75
|
};
|
|
76
76
|
var options = _objectSpread(_objectSpread({}, config), {}, {
|
|
77
77
|
tableOptions: (_config$tableOptions = config === null || config === void 0 ? void 0 : config.tableOptions) !== null && _config$tableOptions !== void 0 ? _config$tableOptions : {},
|
|
78
|
-
dragAndDropEnabled: (config === null || config === void 0 ? void 0 : config.dragAndDropEnabled) || (0, _platformFeatureFlags.fg)('platform_editor_enable_table_dnd'),
|
|
79
78
|
isTableScalingEnabled: (config === null || config === void 0 ? void 0 : config.isTableScalingEnabled) || (0, _platformFeatureFlags.fg)('platform_editor_enable_table_scaling')
|
|
80
79
|
});
|
|
81
80
|
var defaultGetEditorContainerWidth = function defaultGetEditorContainerWidth() {
|
|
@@ -292,11 +291,10 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
292
291
|
wasFullWidthEnabled = _ref3.wasFullWidthEnabled,
|
|
293
292
|
tableOptions = _ref3.tableOptions,
|
|
294
293
|
getEditorFeatureFlags = _ref3.getEditorFeatureFlags,
|
|
295
|
-
dragAndDropEnabled = _ref3.dragAndDropEnabled,
|
|
296
294
|
isTableScalingEnabled = _ref3.isTableScalingEnabled,
|
|
297
295
|
isCommentEditor = _ref3.isCommentEditor,
|
|
298
296
|
isChromelessEditor = _ref3.isChromelessEditor;
|
|
299
|
-
return (0, _main.createPlugin)(dispatchAnalyticsEvent, dispatch, portalProviderAPI, nodeViewPortalProviderAPI, eventDispatcher, (0, _createPluginConfig.pluginConfig)(tableOptions), defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, getIntl, fullWidthEnabled, wasFullWidthEnabled,
|
|
297
|
+
return (0, _main.createPlugin)(dispatchAnalyticsEvent, dispatch, portalProviderAPI, nodeViewPortalProviderAPI, eventDispatcher, (0, _createPluginConfig.pluginConfig)(tableOptions), defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, getIntl, fullWidthEnabled, wasFullWidthEnabled, editorAnalyticsAPI, api, isTableScalingEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor, options === null || options === void 0 ? void 0 : options.allowFixedColumnWidthOption);
|
|
300
298
|
}
|
|
301
299
|
}, {
|
|
302
300
|
name: 'tablePMColResizing',
|
|
@@ -328,7 +326,6 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
328
326
|
var getIntl = _ref6.getIntl,
|
|
329
327
|
nodeViewPortalProviderAPI = _ref6.nodeViewPortalProviderAPI;
|
|
330
328
|
var _ref7 = options || {},
|
|
331
|
-
dragAndDropEnabled = _ref7.dragAndDropEnabled,
|
|
332
329
|
_ref7$isTableScalingE = _ref7.isTableScalingEnabled,
|
|
333
330
|
isTableScalingEnabled = _ref7$isTableScalingE === void 0 ? false : _ref7$isTableScalingE,
|
|
334
331
|
_ref7$fullWidthEnable = _ref7.fullWidthEnabled,
|
|
@@ -338,7 +335,7 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
338
335
|
_ref7$isChromelessEdi = _ref7.isChromelessEditor,
|
|
339
336
|
isChromelessEditor = _ref7$isChromelessEdi === void 0 ? false : _ref7$isChromelessEdi,
|
|
340
337
|
tableOptions = _ref7.tableOptions;
|
|
341
|
-
return (0, _keymap.keymapPlugin)(defaultGetEditorContainerWidth, api, nodeViewPortalProviderAPI, editorAnalyticsAPI,
|
|
338
|
+
return (0, _keymap.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);
|
|
342
339
|
}
|
|
343
340
|
}, {
|
|
344
341
|
name: 'tableSelectionKeymap',
|
|
@@ -349,12 +346,10 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
349
346
|
}, {
|
|
350
347
|
name: 'tableEditing',
|
|
351
348
|
plugin: function plugin() {
|
|
352
|
-
var _ref9 = options || {},
|
|
353
|
-
dragAndDropEnabled = _ref9.dragAndDropEnabled;
|
|
354
349
|
return (0, _pmPlugins.tableEditing)({
|
|
355
|
-
reportFixedTable: function reportFixedTable(
|
|
356
|
-
var tr =
|
|
357
|
-
reason =
|
|
350
|
+
reportFixedTable: function reportFixedTable(_ref9) {
|
|
351
|
+
var tr = _ref9.tr,
|
|
352
|
+
reason = _ref9.reason;
|
|
358
353
|
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
|
|
359
354
|
action: _analytics.TABLE_ACTION.FIXED,
|
|
360
355
|
actionSubject: _analytics.ACTION_SUBJECT.TABLE,
|
|
@@ -365,71 +360,71 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
365
360
|
eventType: _analytics.EVENT_TYPE.TRACK
|
|
366
361
|
})(tr);
|
|
367
362
|
},
|
|
368
|
-
dragAndDropEnabled:
|
|
363
|
+
dragAndDropEnabled: true
|
|
369
364
|
});
|
|
370
365
|
}
|
|
371
366
|
}, {
|
|
372
367
|
name: 'tableStickyHeaders',
|
|
373
|
-
plugin: function plugin(
|
|
374
|
-
var dispatch =
|
|
368
|
+
plugin: function plugin(_ref0) {
|
|
369
|
+
var dispatch = _ref0.dispatch;
|
|
375
370
|
return options && options.tableOptions.stickyHeaders ? (0, _plugin4.createPlugin)(dispatch, function () {
|
|
376
371
|
return [];
|
|
377
372
|
}) : undefined;
|
|
378
373
|
}
|
|
379
374
|
}, {
|
|
380
375
|
name: 'tableDragAndDrop',
|
|
381
|
-
plugin: function plugin(
|
|
382
|
-
var dispatch =
|
|
383
|
-
return
|
|
376
|
+
plugin: function plugin(_ref1) {
|
|
377
|
+
var dispatch = _ref1.dispatch;
|
|
378
|
+
return (0, _plugin3.createPlugin)(dispatch, editorAnalyticsAPI, options === null || options === void 0 ? void 0 : options.isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, options.isCommentEditor, api);
|
|
384
379
|
}
|
|
385
380
|
}, {
|
|
386
381
|
name: 'tableViewModeSort',
|
|
387
|
-
plugin: function plugin(
|
|
388
|
-
var nodeViewPortalProviderAPI =
|
|
382
|
+
plugin: function plugin(_ref10) {
|
|
383
|
+
var nodeViewPortalProviderAPI = _ref10.nodeViewPortalProviderAPI;
|
|
389
384
|
return api !== null && api !== void 0 && api.editorViewMode ? (0, _viewModeSort.createPlugin)(api, nodeViewPortalProviderAPI) : undefined;
|
|
390
385
|
}
|
|
391
386
|
}, {
|
|
392
387
|
name: 'tableLocalId',
|
|
393
|
-
plugin: function plugin(
|
|
394
|
-
var dispatch =
|
|
388
|
+
plugin: function plugin(_ref11) {
|
|
389
|
+
var dispatch = _ref11.dispatch;
|
|
395
390
|
return !(0, _platformFeatureFlags.fg)('platform_editor_adf_with_localid') ? (0, _tableLocalId.createPlugin)(dispatch) : undefined;
|
|
396
391
|
}
|
|
397
392
|
}, {
|
|
398
393
|
name: 'tableWidth',
|
|
399
|
-
plugin: function plugin(
|
|
394
|
+
plugin: function plugin(_ref12) {
|
|
400
395
|
var _options$fullWidthEna, _options$maxWidthEnab, _options$isTableScali, _options$tableOptions3, _options$isCommentEdi;
|
|
401
|
-
var dispatchAnalyticsEvent =
|
|
402
|
-
dispatch =
|
|
396
|
+
var dispatchAnalyticsEvent = _ref12.dispatchAnalyticsEvent,
|
|
397
|
+
dispatch = _ref12.dispatch;
|
|
403
398
|
return options !== null && options !== void 0 && options.tableOptions.allowTableResizing ? (0, _tableWidth.createPlugin)(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;
|
|
404
399
|
}
|
|
405
400
|
}, {
|
|
406
401
|
name: 'tableWidthInCommentFix',
|
|
407
|
-
plugin: function plugin(
|
|
402
|
+
plugin: function plugin(_ref13) {
|
|
408
403
|
var _options$tableOptions4;
|
|
409
|
-
var dispatch =
|
|
404
|
+
var dispatch = _ref13.dispatch;
|
|
410
405
|
return options !== null && options !== void 0 && options.tableOptions.allowTableResizing && options !== null && options !== void 0 && options.isCommentEditor ? (0, _tableWidthInCommentFix.createPlugin)(dispatch, (_options$tableOptions4 = options.tableOptions.allowTableAlignment) !== null && _options$tableOptions4 !== void 0 ? _options$tableOptions4 : false) : undefined;
|
|
411
406
|
}
|
|
412
407
|
},
|
|
413
408
|
// TODO: ED-26961 - should be deprecated and eventually replaced with 'tableAnalyticsPlugin'
|
|
414
409
|
{
|
|
415
410
|
name: 'tableOverflowAnalyticsPlugin',
|
|
416
|
-
plugin: function plugin(
|
|
411
|
+
plugin: function plugin(_ref14) {
|
|
417
412
|
var _options$tableOptions5;
|
|
418
|
-
var dispatch =
|
|
419
|
-
dispatchAnalyticsEvent =
|
|
413
|
+
var dispatch = _ref14.dispatch,
|
|
414
|
+
dispatchAnalyticsEvent = _ref14.dispatchAnalyticsEvent;
|
|
420
415
|
return (0, _tableAnalytics.createPlugin)(dispatch, dispatchAnalyticsEvent, (_options$tableOptions5 = options === null || options === void 0 ? void 0 : options.tableOptions.allowTableResizing) !== null && _options$tableOptions5 !== void 0 ? _options$tableOptions5 : false);
|
|
421
416
|
}
|
|
422
417
|
}, {
|
|
423
418
|
name: 'tableAnalyticsPlugin',
|
|
424
|
-
plugin: function plugin(
|
|
425
|
-
var dispatch =
|
|
426
|
-
dispatchAnalyticsEvent =
|
|
419
|
+
plugin: function plugin(_ref15) {
|
|
420
|
+
var dispatch = _ref15.dispatch,
|
|
421
|
+
dispatchAnalyticsEvent = _ref15.dispatchAnalyticsEvent;
|
|
427
422
|
return (0, _plugin.createPlugin)(dispatch, dispatchAnalyticsEvent);
|
|
428
423
|
}
|
|
429
424
|
}, {
|
|
430
425
|
name: 'tableGetEditorViewReferencePlugin',
|
|
431
|
-
plugin: function plugin(
|
|
432
|
-
var dispatchAnalyticsEvent =
|
|
426
|
+
plugin: function plugin(_ref16) {
|
|
427
|
+
var dispatchAnalyticsEvent = _ref16.dispatchAnalyticsEvent;
|
|
433
428
|
return new _safePlugin.SafePlugin({
|
|
434
429
|
view: function view(editorView) {
|
|
435
430
|
editorViewRef.current = editorView;
|
|
@@ -483,8 +478,8 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
483
478
|
}
|
|
484
479
|
}, {
|
|
485
480
|
name: 'tableSizeSelectorPlugin',
|
|
486
|
-
plugin: function plugin(
|
|
487
|
-
var dispatch =
|
|
481
|
+
plugin: function plugin(_ref17) {
|
|
482
|
+
var dispatch = _ref17.dispatch;
|
|
488
483
|
return isTableSelectorEnabled ? (0, _tableSizeSelector.createPlugin)(dispatch) : undefined;
|
|
489
484
|
}
|
|
490
485
|
}, {
|
|
@@ -515,12 +510,12 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
515
510
|
}
|
|
516
511
|
return plugins;
|
|
517
512
|
},
|
|
518
|
-
contentComponent: function contentComponent(
|
|
519
|
-
var editorView =
|
|
520
|
-
popupsMountPoint =
|
|
521
|
-
popupsBoundariesElement =
|
|
522
|
-
popupsScrollableElement =
|
|
523
|
-
dispatchAnalyticsEvent =
|
|
513
|
+
contentComponent: function contentComponent(_ref18) {
|
|
514
|
+
var editorView = _ref18.editorView,
|
|
515
|
+
popupsMountPoint = _ref18.popupsMountPoint,
|
|
516
|
+
popupsBoundariesElement = _ref18.popupsBoundariesElement,
|
|
517
|
+
popupsScrollableElement = _ref18.popupsScrollableElement,
|
|
518
|
+
dispatchAnalyticsEvent = _ref18.dispatchAnalyticsEvent;
|
|
524
519
|
return /*#__PURE__*/_react.default.createElement(_ContentComponent.ContentComponent, {
|
|
525
520
|
api: api,
|
|
526
521
|
editorView: editorView,
|
|
@@ -535,8 +530,8 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
535
530
|
});
|
|
536
531
|
},
|
|
537
532
|
pluginsOptions: {
|
|
538
|
-
quickInsert: function quickInsert(
|
|
539
|
-
var formatMessage =
|
|
533
|
+
quickInsert: function quickInsert(_ref19) {
|
|
534
|
+
var formatMessage = _ref19.formatMessage;
|
|
540
535
|
return [{
|
|
541
536
|
id: 'table',
|
|
542
537
|
title: formatMessage(_messages.toolbarInsertBlockMessages.table),
|
|
@@ -606,8 +601,8 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
606
601
|
return editorViewRef.current;
|
|
607
602
|
}, options, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent)((0, _createPluginConfig.pluginConfig)(options === null || options === void 0 ? void 0 : options.tableOptions))
|
|
608
603
|
},
|
|
609
|
-
usePluginHook: function usePluginHook(
|
|
610
|
-
var editorView =
|
|
604
|
+
usePluginHook: function usePluginHook(_ref20) {
|
|
605
|
+
var editorView = _ref20.editorView;
|
|
611
606
|
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['editorViewMode'], function (states) {
|
|
612
607
|
var _states$editorViewMod;
|
|
613
608
|
return {
|
|
@@ -219,7 +219,6 @@ var ContentComponent = exports.ContentComponent = function ContentComponent(_ref
|
|
|
219
219
|
fallbackComponent: null
|
|
220
220
|
}, /*#__PURE__*/_react.default.createElement(_globalStyles.GlobalStylesWrapper, {
|
|
221
221
|
featureFlags: api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState(),
|
|
222
|
-
isDragAndDropEnabledOption: options === null || options === void 0 ? void 0 : options.dragAndDropEnabled,
|
|
223
222
|
api: api
|
|
224
223
|
}), /*#__PURE__*/_react.default.createElement(ContentComponentInternal, {
|
|
225
224
|
api: api,
|
|
@@ -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;
|
|
@@ -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,
|
|
@@ -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',
|
|
@@ -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,
|
|
@@ -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;
|
|
@@ -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,
|
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>;
|
|
@@ -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>;
|
|
@@ -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.0.0",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -52,7 +52,7 @@
|
|
|
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",
|
|
@@ -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.1.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"
|