@atlaskit/editor-plugin-table 7.21.2 → 7.21.4
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 +15 -0
- package/dist/cjs/commands/insert.js +6 -3
- package/dist/cjs/nodeviews/TableComponent.js +26 -10
- package/dist/cjs/nodeviews/TableContainer.js +9 -6
- package/dist/cjs/nodeviews/lazy-node-views.js +4 -3
- package/dist/cjs/nodeviews/table.js +8 -3
- package/dist/cjs/plugin.js +16 -7
- package/dist/cjs/pm-plugins/keymap.js +3 -1
- package/dist/cjs/pm-plugins/main.js +4 -3
- package/dist/cjs/toolbar.js +4 -1
- package/dist/cjs/ui/ColumnResizeWidget/index.js +4 -1
- package/dist/cjs/ui/FloatingAlignmentButtons/FloatingAlignmentButtons.js +4 -1
- package/dist/cjs/ui/FloatingContextualButton/index.js +4 -1
- package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +4 -1
- package/dist/cjs/ui/FloatingContextualMenu/index.js +4 -1
- package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +4 -1
- package/dist/cjs/utils/create.js +6 -1
- package/dist/es2019/commands/insert.js +6 -3
- package/dist/es2019/nodeviews/TableComponent.js +27 -11
- package/dist/es2019/nodeviews/TableContainer.js +9 -6
- package/dist/es2019/nodeviews/lazy-node-views.js +4 -3
- package/dist/es2019/nodeviews/table.js +8 -3
- package/dist/es2019/plugin.js +14 -7
- package/dist/es2019/pm-plugins/keymap.js +2 -2
- package/dist/es2019/pm-plugins/main.js +4 -3
- package/dist/es2019/toolbar.js +4 -1
- package/dist/es2019/ui/ColumnResizeWidget/index.js +4 -1
- package/dist/es2019/ui/FloatingAlignmentButtons/FloatingAlignmentButtons.js +4 -1
- package/dist/es2019/ui/FloatingContextualButton/index.js +4 -1
- package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +4 -1
- package/dist/es2019/ui/FloatingContextualMenu/index.js +4 -1
- package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +4 -1
- package/dist/es2019/utils/create.js +6 -1
- package/dist/esm/commands/insert.js +6 -3
- package/dist/esm/nodeviews/TableComponent.js +27 -11
- package/dist/esm/nodeviews/TableContainer.js +9 -6
- package/dist/esm/nodeviews/lazy-node-views.js +4 -3
- package/dist/esm/nodeviews/table.js +8 -3
- package/dist/esm/plugin.js +16 -7
- package/dist/esm/pm-plugins/keymap.js +3 -1
- package/dist/esm/pm-plugins/main.js +4 -3
- package/dist/esm/toolbar.js +4 -1
- package/dist/esm/ui/ColumnResizeWidget/index.js +4 -1
- package/dist/esm/ui/FloatingAlignmentButtons/FloatingAlignmentButtons.js +4 -1
- package/dist/esm/ui/FloatingContextualButton/index.js +4 -1
- package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +4 -1
- package/dist/esm/ui/FloatingContextualMenu/index.js +4 -1
- package/dist/esm/ui/FloatingDragMenu/DragMenu.js +4 -1
- package/dist/esm/utils/create.js +6 -1
- package/dist/types/commands/insert.d.ts +2 -2
- package/dist/types/nodeviews/TableContainer.d.ts +4 -2
- package/dist/types/nodeviews/lazy-node-views.d.ts +1 -0
- package/dist/types/nodeviews/table.d.ts +1 -1
- package/dist/types/nodeviews/types.d.ts +1 -0
- package/dist/types/plugin.d.ts +1 -0
- package/dist/types/pm-plugins/keymap.d.ts +1 -1
- package/dist/types/pm-plugins/main.d.ts +1 -1
- package/dist/types/ui/ColumnResizeWidget/index.d.ts +4 -1
- package/dist/types/ui/FloatingAlignmentButtons/FloatingAlignmentButtons.d.ts +4 -1
- package/dist/types/ui/FloatingContextualMenu/ContextualMenu.d.ts +4 -1
- package/dist/types/ui/FloatingContextualMenu/index.d.ts +4 -1
- package/dist/types/ui/FloatingDragMenu/DragMenu.d.ts +4 -1
- package/dist/types/utils/create.d.ts +3 -1
- package/dist/types-ts4.5/commands/insert.d.ts +2 -2
- package/dist/types-ts4.5/nodeviews/TableContainer.d.ts +4 -2
- package/dist/types-ts4.5/nodeviews/lazy-node-views.d.ts +1 -0
- package/dist/types-ts4.5/nodeviews/table.d.ts +1 -1
- package/dist/types-ts4.5/nodeviews/types.d.ts +1 -0
- package/dist/types-ts4.5/plugin.d.ts +1 -0
- 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/ui/ColumnResizeWidget/index.d.ts +4 -1
- package/dist/types-ts4.5/ui/FloatingAlignmentButtons/FloatingAlignmentButtons.d.ts +4 -1
- package/dist/types-ts4.5/ui/FloatingContextualMenu/ContextualMenu.d.ts +4 -1
- package/dist/types-ts4.5/ui/FloatingContextualMenu/index.d.ts +4 -1
- package/dist/types-ts4.5/ui/FloatingDragMenu/DragMenu.d.ts +4 -1
- package/dist/types-ts4.5/utils/create.d.ts +3 -1
- package/package.json +6 -3
- package/src/commands/insert.ts +6 -0
- package/src/nodeviews/TableComponent.tsx +23 -8
- package/src/nodeviews/TableContainer.tsx +15 -3
- package/src/nodeviews/lazy-node-views.ts +4 -0
- package/src/nodeviews/table.tsx +7 -1
- package/src/nodeviews/types.ts +1 -0
- package/src/plugin.tsx +12 -1
- package/src/pm-plugins/keymap.ts +4 -0
- package/src/pm-plugins/main.ts +5 -1
- package/src/toolbar.tsx +4 -1
- package/src/ui/ColumnResizeWidget/index.tsx +4 -1
- package/src/ui/FloatingAlignmentButtons/FloatingAlignmentButtons.tsx +4 -1
- package/src/ui/FloatingContextualButton/index.tsx +4 -1
- package/src/ui/FloatingContextualMenu/ContextualMenu.tsx +4 -1
- package/src/ui/FloatingContextualMenu/index.tsx +4 -1
- package/src/ui/FloatingDragMenu/DragMenu.tsx +4 -1
- package/src/utils/create.ts +9 -2
|
@@ -7,7 +7,7 @@ import TableRow from './TableRow';
|
|
|
7
7
|
export var lazyTableView = function lazyTableView(options) {
|
|
8
8
|
if (!fg('platform_editor_lazy-node-views')) {
|
|
9
9
|
return function (node, view, getPos) {
|
|
10
|
-
return createTableView(node, view, getPos, options.portalProviderAPI, options.eventDispatcher, options.getEditorContainerWidth, options.getEditorFeatureFlags, options.dispatchAnalyticsEvent, options.pluginInjectionApi, options.isTableAlignmentEnabled);
|
|
10
|
+
return createTableView(node, view, getPos, options.portalProviderAPI, options.eventDispatcher, options.getEditorContainerWidth, options.getEditorFeatureFlags, options.dispatchAnalyticsEvent, options.pluginInjectionApi, options.isTableAlignmentEnabled, options.isCommentEditor);
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
13
|
var loader = function loader() {
|
|
@@ -22,8 +22,9 @@ export var lazyTableView = function lazyTableView(options) {
|
|
|
22
22
|
getEditorFeatureFlags = _getNodeViewOptions.getEditorFeatureFlags,
|
|
23
23
|
dispatchAnalyticsEvent = _getNodeViewOptions.dispatchAnalyticsEvent,
|
|
24
24
|
pluginInjectionApi = _getNodeViewOptions.pluginInjectionApi,
|
|
25
|
-
isTableAlignmentEnabled = _getNodeViewOptions.isTableAlignmentEnabled
|
|
26
|
-
|
|
25
|
+
isTableAlignmentEnabled = _getNodeViewOptions.isTableAlignmentEnabled,
|
|
26
|
+
isCommentEditor = _getNodeViewOptions.isCommentEditor;
|
|
27
|
+
return createTableView(node, view, getPos, portalProviderAPI, eventDispatcher, getEditorContainerWidth, getEditorFeatureFlags, dispatchAnalyticsEvent, pluginInjectionApi, isTableAlignmentEnabled, isCommentEditor);
|
|
27
28
|
};
|
|
28
29
|
});
|
|
29
30
|
return result;
|
|
@@ -34,11 +34,15 @@ var tableAttributes = function tableAttributes(node) {
|
|
|
34
34
|
'data-layout': node.attrs.layout,
|
|
35
35
|
'data-autosize': node.attrs.__autoSize,
|
|
36
36
|
'data-table-local-id': node.attrs.localId || '',
|
|
37
|
-
'data-table-width': node.attrs.width,
|
|
37
|
+
'data-table-width': node.attrs.width || 'inherit',
|
|
38
38
|
'data-table-display-mode': node.attrs.displayMode
|
|
39
39
|
};
|
|
40
40
|
};
|
|
41
41
|
var getInlineWidth = function getInlineWidth(node, options, state, pos) {
|
|
42
|
+
if (!node.attrs.width && options !== null && options !== void 0 && options.isCommentEditor && options !== null && options !== void 0 && options.isTableResizingEnabled) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
|
|
42
46
|
// provide a width for tables when custom table width is supported
|
|
43
47
|
// this is to ensure 'responsive' tables (colgroup widths are undefined) become fixed to
|
|
44
48
|
// support screen size adjustments
|
|
@@ -280,7 +284,7 @@ var TableView = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
280
284
|
return TableView;
|
|
281
285
|
}(ReactNodeView);
|
|
282
286
|
export { TableView as default };
|
|
283
|
-
export var createTableView = function createTableView(node, view, getPos, portalProviderAPI, eventDispatcher, getEditorContainerWidth, getEditorFeatureFlags, dispatchAnalyticsEvent, pluginInjectionApi, isTableAlignmentEnabled) {
|
|
287
|
+
export var createTableView = function createTableView(node, view, getPos, portalProviderAPI, eventDispatcher, getEditorContainerWidth, getEditorFeatureFlags, dispatchAnalyticsEvent, pluginInjectionApi, isTableAlignmentEnabled, isCommentEditor) {
|
|
284
288
|
var _getPluginState2 = getPluginState(view.state),
|
|
285
289
|
pluginConfig = _getPluginState2.pluginConfig,
|
|
286
290
|
isFullWidthModeEnabled = _getPluginState2.isFullWidthModeEnabled,
|
|
@@ -306,7 +310,8 @@ export var createTableView = function createTableView(node, view, getPos, portal
|
|
|
306
310
|
isDragAndDropEnabled: isDragAndDropEnabled,
|
|
307
311
|
isTableScalingEnabled: isTableScalingEnabled,
|
|
308
312
|
// same as options.isTableScalingEnabled
|
|
309
|
-
isTableAlignmentEnabled: isTableAlignmentEnabled
|
|
313
|
+
isTableAlignmentEnabled: isTableAlignmentEnabled,
|
|
314
|
+
isCommentEditor: isCommentEditor
|
|
310
315
|
},
|
|
311
316
|
getEditorContainerWidth: getEditorContainerWidth,
|
|
312
317
|
getEditorFeatureFlags: getEditorFeatureFlags,
|
package/dist/esm/plugin.js
CHANGED
|
@@ -141,7 +141,9 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
141
141
|
var node = createTableWithWidth({
|
|
142
142
|
isTableScalingEnabled: options === null || options === void 0 ? void 0 : options.isTableScalingEnabled,
|
|
143
143
|
isTableAlignmentEnabled: options === null || options === void 0 ? void 0 : options.isTableAlignmentEnabled,
|
|
144
|
-
isFullWidthModeEnabled: options === null || options === void 0 ? void 0 : options.fullWidthEnabled
|
|
144
|
+
isFullWidthModeEnabled: options === null || options === void 0 ? void 0 : options.fullWidthEnabled,
|
|
145
|
+
isCommentEditor: options === null || options === void 0 ? void 0 : options.isCommentEditor,
|
|
146
|
+
isTableResizingEnabled: options === null || options === void 0 ? void 0 : options.tableResizingEnabled
|
|
145
147
|
})(state.schema);
|
|
146
148
|
return (_api$contentInsertion = api === null || api === void 0 || (_api$contentInsertion2 = api.contentInsertion) === null || _api$contentInsertion2 === void 0 || (_api$contentInsertion2 = _api$contentInsertion2.actions) === null || _api$contentInsertion2 === void 0 ? void 0 : _api$contentInsertion2.insert({
|
|
147
149
|
state: state,
|
|
@@ -194,8 +196,9 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
194
196
|
getEditorFeatureFlags = _ref3.getEditorFeatureFlags,
|
|
195
197
|
dragAndDropEnabled = _ref3.dragAndDropEnabled,
|
|
196
198
|
isTableScalingEnabled = _ref3.isTableScalingEnabled,
|
|
197
|
-
isTableAlignmentEnabled = _ref3.isTableAlignmentEnabled
|
|
198
|
-
|
|
199
|
+
isTableAlignmentEnabled = _ref3.isTableAlignmentEnabled,
|
|
200
|
+
isCommentEditor = _ref3.isCommentEditor;
|
|
201
|
+
return createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, eventDispatcher, pluginConfig(tableOptions), defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, getIntl, tableResizingEnabled, fullWidthEnabled, wasFullWidthEnabled, dragAndDropEnabled, editorAnalyticsAPI, api, isTableScalingEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, isCommentEditor);
|
|
199
202
|
}
|
|
200
203
|
}, {
|
|
201
204
|
name: 'tablePMColResizing',
|
|
@@ -233,8 +236,12 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
233
236
|
_ref7$isTableAlignmen = _ref7.isTableAlignmentEnabled,
|
|
234
237
|
isTableAlignmentEnabled = _ref7$isTableAlignmen === void 0 ? false : _ref7$isTableAlignmen,
|
|
235
238
|
_ref7$fullWidthEnable = _ref7.fullWidthEnabled,
|
|
236
|
-
fullWidthEnabled = _ref7$fullWidthEnable === void 0 ? false : _ref7$fullWidthEnable
|
|
237
|
-
|
|
239
|
+
fullWidthEnabled = _ref7$fullWidthEnable === void 0 ? false : _ref7$fullWidthEnable,
|
|
240
|
+
_ref7$isCommentEditor = _ref7.isCommentEditor,
|
|
241
|
+
isCommentEditor = _ref7$isCommentEditor === void 0 ? false : _ref7$isCommentEditor,
|
|
242
|
+
_ref7$tableResizingEn = _ref7.tableResizingEnabled,
|
|
243
|
+
tableResizingEnabled = _ref7$tableResizingEn === void 0 ? false : _ref7$tableResizingEn;
|
|
244
|
+
return keymapPlugin(defaultGetEditorContainerWidth, editorAnalyticsAPI, dragAndDropEnabled, isTableScalingEnabled, isTableAlignmentEnabled, fullWidthEnabled, api, getIntl, isCellBackgroundDuplicated, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, tableResizingEnabled);
|
|
238
245
|
}
|
|
239
246
|
}, {
|
|
240
247
|
name: 'tableSelectionKeymap',
|
|
@@ -296,7 +303,7 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
296
303
|
var _options$fullWidthEna, _options$isTableScali, _options$isTableAlign;
|
|
297
304
|
var dispatchAnalyticsEvent = _ref14.dispatchAnalyticsEvent,
|
|
298
305
|
dispatch = _ref14.dispatch;
|
|
299
|
-
return options !== null && options !== void 0 && options.tableResizingEnabled ? createTableWidthPlugin(dispatch, dispatchAnalyticsEvent, (_options$fullWidthEna = options === null || options === void 0 ? void 0 : options.fullWidthEnabled) !== null && _options$fullWidthEna !== void 0 ? _options$fullWidthEna : false, (_options$isTableScali = options === null || options === void 0 ? void 0 : options.isTableScalingEnabled) !== null && _options$isTableScali !== void 0 ? _options$isTableScali : false, (_options$isTableAlign = options === null || options === void 0 ? void 0 : options.isTableAlignmentEnabled) !== null && _options$isTableAlign !== void 0 ? _options$isTableAlign : false) : undefined;
|
|
306
|
+
return options !== null && options !== void 0 && options.tableResizingEnabled && !(options !== null && options !== void 0 && options.isCommentEditor) ? createTableWidthPlugin(dispatch, dispatchAnalyticsEvent, (_options$fullWidthEna = options === null || options === void 0 ? void 0 : options.fullWidthEnabled) !== null && _options$fullWidthEna !== void 0 ? _options$fullWidthEna : false, (_options$isTableScali = options === null || options === void 0 ? void 0 : options.isTableScalingEnabled) !== null && _options$isTableScali !== void 0 ? _options$isTableScali : false, (_options$isTableAlign = options === null || options === void 0 ? void 0 : options.isTableAlignmentEnabled) !== null && _options$isTableAlign !== void 0 ? _options$isTableAlign : false) : undefined;
|
|
300
307
|
}
|
|
301
308
|
},
|
|
302
309
|
// TODO: should be deprecated and eventually replaced with 'tableAnalyticsPlugin'
|
|
@@ -491,7 +498,9 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
491
498
|
var tableNode = createTableWithWidth({
|
|
492
499
|
isTableScalingEnabled: options === null || options === void 0 ? void 0 : options.isTableScalingEnabled,
|
|
493
500
|
isTableAlignmentEnabled: options === null || options === void 0 ? void 0 : options.isTableAlignmentEnabled,
|
|
494
|
-
isFullWidthModeEnabled: tableState === null || tableState === void 0 ? void 0 : tableState.isFullWidthModeEnabled
|
|
501
|
+
isFullWidthModeEnabled: tableState === null || tableState === void 0 ? void 0 : tableState.isFullWidthModeEnabled,
|
|
502
|
+
isCommentEditor: options === null || options === void 0 ? void 0 : options.isCommentEditor,
|
|
503
|
+
isTableResizingEnabled: options === null || options === void 0 ? void 0 : options.tableResizingEnabled
|
|
495
504
|
})(state.schema);
|
|
496
505
|
var tr = insert(tableNode);
|
|
497
506
|
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
|
|
@@ -18,11 +18,13 @@ export function keymapPlugin(getEditorContainerWidth, editorAnalyticsAPI, dragAn
|
|
|
18
18
|
var isCellBackgroundDuplicated = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : false;
|
|
19
19
|
var isTableFixedColumnWidthsOptionEnabled = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : false;
|
|
20
20
|
var shouldUseIncreasedScalingPercent = arguments.length > 10 ? arguments[10] : undefined;
|
|
21
|
+
var isCommentEditor = arguments.length > 11 ? arguments[11] : undefined;
|
|
22
|
+
var isTableResizingEnabled = arguments.length > 12 ? arguments[12] : undefined;
|
|
21
23
|
var list = {};
|
|
22
24
|
var ariaNotifyPlugin = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.accessibilityUtils) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions.ariaNotify;
|
|
23
25
|
bindKeymapWithCommand(nextCell.common, goToNextCell(editorAnalyticsAPI, ariaNotifyPlugin, getIntl)(1), list);
|
|
24
26
|
bindKeymapWithCommand(previousCell.common, goToNextCell(editorAnalyticsAPI, ariaNotifyPlugin, getIntl)(-1), list);
|
|
25
|
-
bindKeymapWithCommand(toggleTable.common, createTable(isTableScalingEnabled, isTableAlignmentEnabled, !!isFullWidthEnabled, editorAnalyticsAPI), list);
|
|
27
|
+
bindKeymapWithCommand(toggleTable.common, createTable(isTableScalingEnabled, isTableAlignmentEnabled, !!isFullWidthEnabled, editorAnalyticsAPI, isCommentEditor, isTableResizingEnabled), list);
|
|
26
28
|
bindKeymapWithCommand(backspace.common, chainCommands(deleteTableIfSelectedWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD), emptyMultipleCellsWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD)), list);
|
|
27
29
|
bindKeymapWithCommand(backspace.common, moveCursorBackward, list);
|
|
28
30
|
|
|
@@ -23,7 +23,7 @@ import { isHeaderRowRequired } from '../utils/paste';
|
|
|
23
23
|
import { defaultHoveredCell, defaultTableSelection } from './default-table-selection';
|
|
24
24
|
import { createPluginState, getPluginState } from './plugin-factory';
|
|
25
25
|
import { pluginKey } from './plugin-key';
|
|
26
|
-
export var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, eventDispatcher, pluginConfig, getEditorContainerWidth, getEditorFeatureFlags, getIntl, tableResizingEnabled, fullWidthModeEnabled, previousFullWidthModeEnabled, dragAndDropEnabled, editorAnalyticsAPI, pluginInjectionApi, isTableScalingEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent) {
|
|
26
|
+
export var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, eventDispatcher, pluginConfig, getEditorContainerWidth, getEditorFeatureFlags, getIntl, tableResizingEnabled, fullWidthModeEnabled, previousFullWidthModeEnabled, dragAndDropEnabled, editorAnalyticsAPI, pluginInjectionApi, isTableScalingEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, isCommentEditor) {
|
|
27
27
|
var _accessibilityUtils;
|
|
28
28
|
var state = createPluginState(dispatch, _objectSpread(_objectSpread(_objectSpread({
|
|
29
29
|
pluginConfig: pluginConfig,
|
|
@@ -256,7 +256,8 @@ export var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch
|
|
|
256
256
|
getEditorFeatureFlags: getEditorFeatureFlags,
|
|
257
257
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
258
258
|
pluginInjectionApi: pluginInjectionApi,
|
|
259
|
-
isTableAlignmentEnabled: isTableAlignmentEnabled
|
|
259
|
+
isTableAlignmentEnabled: isTableAlignmentEnabled,
|
|
260
|
+
isCommentEditor: isCommentEditor
|
|
260
261
|
}),
|
|
261
262
|
tableRow: lazyTableRowView({
|
|
262
263
|
eventDispatcher: eventDispatcher
|
|
@@ -274,7 +275,7 @@ export var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch
|
|
|
274
275
|
mousedown: withCellTracking(handleMouseDown),
|
|
275
276
|
mouseover: withCellTracking(whenTableInFocus(handleMouseOver)),
|
|
276
277
|
mouseleave: handleMouseLeave,
|
|
277
|
-
mouseout: whenTableInFocus(handleMouseOut),
|
|
278
|
+
mouseout: fg('editor_react_18_fix_table_delete_col_decorations') ? undefined : whenTableInFocus(handleMouseOut),
|
|
278
279
|
mousemove: whenTableInFocus(handleMouseMove),
|
|
279
280
|
mouseenter: handleMouseEnter,
|
|
280
281
|
mouseup: whenTableInFocus(handleMouseUp),
|
package/dist/esm/toolbar.js
CHANGED
|
@@ -3,7 +3,10 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
3
3
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
4
4
|
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; }
|
|
5
5
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* @jsxRuntime classic
|
|
8
|
+
* @jsx jsx
|
|
9
|
+
*/
|
|
7
10
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
11
|
import { jsx } from '@emotion/react';
|
|
9
12
|
import { TableSortOrder as SortOrder } from '@atlaskit/custom-steps';
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* @jsxRuntime classic
|
|
4
|
+
* @jsx jsx
|
|
5
|
+
*/
|
|
3
6
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
4
7
|
import { jsx } from '@emotion/react';
|
|
5
8
|
import { useIntl } from 'react-intl-next';
|
|
@@ -11,7 +11,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
11
11
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
12
12
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
13
13
|
/* eslint-disable @atlaskit/design-system/prefer-primitives */
|
|
14
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* @jsxRuntime classic
|
|
16
|
+
* @jsx jsx
|
|
17
|
+
*/
|
|
15
18
|
import React, { Component } from 'react';
|
|
16
19
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
17
20
|
import { jsx } from '@emotion/react';
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
3
|
/* eslint-disable @atlaskit/design-system/prefer-primitives */
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* @jsxRuntime classic
|
|
6
|
+
* @jsx jsx
|
|
7
|
+
*/
|
|
5
8
|
/** @jsxFrag */
|
|
6
9
|
import React, { useEffect, useState } from 'react';
|
|
7
10
|
|
package/dist/esm/utils/create.js
CHANGED
|
@@ -7,15 +7,20 @@ export var createTableWithWidth = function createTableWithWidth(_ref) {
|
|
|
7
7
|
var isTableScalingEnabled = _ref.isTableScalingEnabled,
|
|
8
8
|
isTableAlignmentEnabled = _ref.isTableAlignmentEnabled,
|
|
9
9
|
isFullWidthModeEnabled = _ref.isFullWidthModeEnabled,
|
|
10
|
+
isCommentEditor = _ref.isCommentEditor,
|
|
11
|
+
isTableResizingEnabled = _ref.isTableResizingEnabled,
|
|
10
12
|
createTableProps = _ref.createTableProps;
|
|
11
13
|
return function (schema) {
|
|
12
14
|
var attrsOverrides = {};
|
|
13
|
-
if (isTableScalingEnabled && isFullWidthModeEnabled) {
|
|
15
|
+
if (isTableScalingEnabled && isFullWidthModeEnabled && !isCommentEditor) {
|
|
14
16
|
attrsOverrides.tableWidth = TABLE_MAX_WIDTH;
|
|
15
17
|
}
|
|
16
18
|
if (isTableAlignmentEnabled && isFullWidthModeEnabled) {
|
|
17
19
|
attrsOverrides.layout = 'align-start';
|
|
18
20
|
}
|
|
21
|
+
if (isCommentEditor && isTableResizingEnabled) {
|
|
22
|
+
attrsOverrides.tableWidth = 'inherit';
|
|
23
|
+
}
|
|
19
24
|
return createTable(_objectSpread(_objectSpread({
|
|
20
25
|
schema: schema
|
|
21
26
|
}, createTableProps), attrsOverrides));
|
|
@@ -8,5 +8,5 @@ export declare const addColumnBefore: (isTableScalingEnabled?: boolean, isCellBa
|
|
|
8
8
|
export declare const addColumnAfter: (isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Command;
|
|
9
9
|
export declare const insertColumn: (isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (column: number) => Command;
|
|
10
10
|
export declare const insertRow: (row: number, moveCursorToTheNewRow: boolean, isCellBackgroundDuplicated?: boolean) => Command;
|
|
11
|
-
export declare const createTable: (isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isFullWidthModeEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined | null) => Command;
|
|
12
|
-
export declare const insertTableWithSize: (isFullWidthModeEnabled?: boolean, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI) => (rowsCount: number, colsCount: number, inputMethod?: INPUT_METHOD.PICKER) => EditorCommand;
|
|
11
|
+
export declare const createTable: (isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isFullWidthModeEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined | null, isCommentEditor?: boolean, isTableResizingEnabled?: boolean) => Command;
|
|
12
|
+
export declare const insertTableWithSize: (isFullWidthModeEnabled?: boolean, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, isCommentEditor?: boolean) => (rowsCount: number, colsCount: number, inputMethod?: INPUT_METHOD.PICKER) => EditorCommand;
|
|
@@ -31,8 +31,9 @@ type ResizableTableContainerProps = {
|
|
|
31
31
|
isTableWithFixedColumnWidthsOptionEnabled?: boolean;
|
|
32
32
|
isTableAlignmentEnabled?: boolean;
|
|
33
33
|
shouldUseIncreasedScalingPercent?: boolean;
|
|
34
|
+
isCommentEditor?: boolean;
|
|
34
35
|
};
|
|
35
|
-
export declare const ResizableTableContainer: React.MemoExoticComponent<({ children, className, node, containerWidth, lineLength, editorView, getPos, tableRef, isResizing, pluginInjectionApi, tableWrapperHeight, isWholeTableInDanger, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, }: PropsWithChildren<ResizableTableContainerProps>) => JSX.Element>;
|
|
36
|
+
export declare const ResizableTableContainer: React.MemoExoticComponent<({ children, className, node, containerWidth, lineLength, editorView, getPos, tableRef, isResizing, pluginInjectionApi, tableWrapperHeight, isWholeTableInDanger, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, }: PropsWithChildren<ResizableTableContainerProps>) => JSX.Element>;
|
|
36
37
|
type TableContainerProps = {
|
|
37
38
|
node: PMNode;
|
|
38
39
|
className: string;
|
|
@@ -50,6 +51,7 @@ type TableContainerProps = {
|
|
|
50
51
|
isTableWithFixedColumnWidthsOptionEnabled?: boolean;
|
|
51
52
|
isTableAlignmentEnabled?: boolean;
|
|
52
53
|
shouldUseIncreasedScalingPercent?: boolean;
|
|
54
|
+
isCommentEditor?: boolean;
|
|
53
55
|
};
|
|
54
|
-
export declare const TableContainer: ({ children, node, className, containerWidth: { width: editorWidth, lineLength }, editorView, getPos, tableRef, isNested, tableWrapperHeight, isResizing, pluginInjectionApi, isWholeTableInDanger, isTableResizingEnabled, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, }: PropsWithChildren<TableContainerProps>) => JSX.Element;
|
|
56
|
+
export declare const TableContainer: ({ children, node, className, containerWidth: { width: editorWidth, lineLength }, editorView, getPos, tableRef, isNested, tableWrapperHeight, isResizing, pluginInjectionApi, isWholeTableInDanger, isTableResizingEnabled, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, }: PropsWithChildren<TableContainerProps>) => JSX.Element;
|
|
55
57
|
export {};
|
|
@@ -15,6 +15,7 @@ type TableViewOptions = {
|
|
|
15
15
|
dispatchAnalyticsEvent: DispatchAnalyticsEvent;
|
|
16
16
|
pluginInjectionApi?: PluginInjectionAPI;
|
|
17
17
|
isTableAlignmentEnabled?: boolean;
|
|
18
|
+
isCommentEditor?: boolean;
|
|
18
19
|
};
|
|
19
20
|
export declare const lazyTableView: (options: TableViewOptions) => import("@atlaskit/editor-common/lazy-node-view").NodeViewConstructor;
|
|
20
21
|
type TableCellViewOptions = {
|
|
@@ -32,5 +32,5 @@ export default class TableView extends ReactNodeView<Props> {
|
|
|
32
32
|
}): boolean;
|
|
33
33
|
destroy(): void;
|
|
34
34
|
}
|
|
35
|
-
export declare const createTableView: (node: PmNode, view: EditorView, getPos: getPosHandler, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, dispatchAnalyticsEvent: DispatchAnalyticsEvent, pluginInjectionApi?: PluginInjectionAPI, isTableAlignmentEnabled?: boolean) => NodeView;
|
|
35
|
+
export declare const createTableView: (node: PmNode, view: EditorView, getPos: getPosHandler, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, dispatchAnalyticsEvent: DispatchAnalyticsEvent, pluginInjectionApi?: PluginInjectionAPI, isTableAlignmentEnabled?: boolean, isCommentEditor?: boolean) => NodeView;
|
|
36
36
|
export {};
|
package/dist/types/plugin.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export interface TablePluginOptions {
|
|
|
21
21
|
isTableScalingEnabled?: boolean;
|
|
22
22
|
isTableAlignmentEnabled?: boolean;
|
|
23
23
|
isNewColumnResizingEnabled?: boolean;
|
|
24
|
+
isCommentEditor?: boolean;
|
|
24
25
|
}
|
|
25
26
|
type InsertTableAction = (analyticsPayload: AnalyticsEventPayload) => Command;
|
|
26
27
|
type MediaPlugin = NextEditorPlugin<'media', {
|
|
@@ -3,5 +3,5 @@ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
|
3
3
|
import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
4
|
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
5
5
|
import type { PluginInjectionAPIWithA11y } from '../types';
|
|
6
|
-
export declare function keymapPlugin(getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, dragAndDropEnabled?: boolean, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isFullWidthEnabled?: boolean, pluginInjectionApi?: PluginInjectionAPIWithA11y, getIntl?: () => IntlShape, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean): SafePlugin;
|
|
6
|
+
export declare function keymapPlugin(getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, dragAndDropEnabled?: boolean, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isFullWidthEnabled?: boolean, pluginInjectionApi?: PluginInjectionAPIWithA11y, getIntl?: () => IntlShape, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean, isTableResizingEnabled?: boolean): SafePlugin;
|
|
7
7
|
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, eventDispatcher: EventDispatcher, pluginConfig: PluginConfig, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, getIntl: () => IntlShape, tableResizingEnabled?: boolean, fullWidthModeEnabled?: boolean, previousFullWidthModeEnabled?: boolean, dragAndDropEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, pluginInjectionApi?: PluginInjectionAPI, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => SafePlugin<import("../types").TablePluginState>;
|
|
8
|
+
export declare const createPlugin: (dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, pluginConfig: PluginConfig, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, getIntl: () => IntlShape, tableResizingEnabled?: boolean, fullWidthModeEnabled?: boolean, previousFullWidthModeEnabled?: boolean, dragAndDropEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, pluginInjectionApi?: PluginInjectionAPI, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean) => SafePlugin<import("../types").TablePluginState>;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
2
5
|
import { jsx } from '@emotion/react';
|
|
3
6
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
7
|
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
export declare const createTableWithWidth: ({ isTableScalingEnabled, isTableAlignmentEnabled, isFullWidthModeEnabled, createTableProps, }: {
|
|
2
|
+
export declare const createTableWithWidth: ({ isTableScalingEnabled, isTableAlignmentEnabled, isFullWidthModeEnabled, isCommentEditor, isTableResizingEnabled, createTableProps, }: {
|
|
3
3
|
isTableScalingEnabled?: boolean | undefined;
|
|
4
4
|
isTableAlignmentEnabled?: boolean | undefined;
|
|
5
5
|
isFullWidthModeEnabled?: boolean | undefined;
|
|
6
|
+
isCommentEditor?: boolean | undefined;
|
|
7
|
+
isTableResizingEnabled?: boolean | undefined;
|
|
6
8
|
createTableProps?: {
|
|
7
9
|
rowsCount?: number | undefined;
|
|
8
10
|
colsCount?: number | undefined;
|
|
@@ -8,5 +8,5 @@ export declare const addColumnBefore: (isTableScalingEnabled?: boolean, isCellBa
|
|
|
8
8
|
export declare const addColumnAfter: (isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Command;
|
|
9
9
|
export declare const insertColumn: (isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (column: number) => Command;
|
|
10
10
|
export declare const insertRow: (row: number, moveCursorToTheNewRow: boolean, isCellBackgroundDuplicated?: boolean) => Command;
|
|
11
|
-
export declare const createTable: (isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isFullWidthModeEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined | null) => Command;
|
|
12
|
-
export declare const insertTableWithSize: (isFullWidthModeEnabled?: boolean, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI) => (rowsCount: number, colsCount: number, inputMethod?: INPUT_METHOD.PICKER) => EditorCommand;
|
|
11
|
+
export declare const createTable: (isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isFullWidthModeEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined | null, isCommentEditor?: boolean, isTableResizingEnabled?: boolean) => Command;
|
|
12
|
+
export declare const insertTableWithSize: (isFullWidthModeEnabled?: boolean, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, isCommentEditor?: boolean) => (rowsCount: number, colsCount: number, inputMethod?: INPUT_METHOD.PICKER) => EditorCommand;
|
|
@@ -31,8 +31,9 @@ type ResizableTableContainerProps = {
|
|
|
31
31
|
isTableWithFixedColumnWidthsOptionEnabled?: boolean;
|
|
32
32
|
isTableAlignmentEnabled?: boolean;
|
|
33
33
|
shouldUseIncreasedScalingPercent?: boolean;
|
|
34
|
+
isCommentEditor?: boolean;
|
|
34
35
|
};
|
|
35
|
-
export declare const ResizableTableContainer: React.MemoExoticComponent<({ children, className, node, containerWidth, lineLength, editorView, getPos, tableRef, isResizing, pluginInjectionApi, tableWrapperHeight, isWholeTableInDanger, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, }: PropsWithChildren<ResizableTableContainerProps>) => JSX.Element>;
|
|
36
|
+
export declare const ResizableTableContainer: React.MemoExoticComponent<({ children, className, node, containerWidth, lineLength, editorView, getPos, tableRef, isResizing, pluginInjectionApi, tableWrapperHeight, isWholeTableInDanger, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, }: PropsWithChildren<ResizableTableContainerProps>) => JSX.Element>;
|
|
36
37
|
type TableContainerProps = {
|
|
37
38
|
node: PMNode;
|
|
38
39
|
className: string;
|
|
@@ -50,6 +51,7 @@ type TableContainerProps = {
|
|
|
50
51
|
isTableWithFixedColumnWidthsOptionEnabled?: boolean;
|
|
51
52
|
isTableAlignmentEnabled?: boolean;
|
|
52
53
|
shouldUseIncreasedScalingPercent?: boolean;
|
|
54
|
+
isCommentEditor?: boolean;
|
|
53
55
|
};
|
|
54
|
-
export declare const TableContainer: ({ children, node, className, containerWidth: { width: editorWidth, lineLength }, editorView, getPos, tableRef, isNested, tableWrapperHeight, isResizing, pluginInjectionApi, isWholeTableInDanger, isTableResizingEnabled, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, }: PropsWithChildren<TableContainerProps>) => JSX.Element;
|
|
56
|
+
export declare const TableContainer: ({ children, node, className, containerWidth: { width: editorWidth, lineLength }, editorView, getPos, tableRef, isNested, tableWrapperHeight, isResizing, pluginInjectionApi, isWholeTableInDanger, isTableResizingEnabled, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, }: PropsWithChildren<TableContainerProps>) => JSX.Element;
|
|
55
57
|
export {};
|
|
@@ -15,6 +15,7 @@ type TableViewOptions = {
|
|
|
15
15
|
dispatchAnalyticsEvent: DispatchAnalyticsEvent;
|
|
16
16
|
pluginInjectionApi?: PluginInjectionAPI;
|
|
17
17
|
isTableAlignmentEnabled?: boolean;
|
|
18
|
+
isCommentEditor?: boolean;
|
|
18
19
|
};
|
|
19
20
|
export declare const lazyTableView: (options: TableViewOptions) => import("@atlaskit/editor-common/lazy-node-view").NodeViewConstructor;
|
|
20
21
|
type TableCellViewOptions = {
|
|
@@ -32,5 +32,5 @@ export default class TableView extends ReactNodeView<Props> {
|
|
|
32
32
|
}): boolean;
|
|
33
33
|
destroy(): void;
|
|
34
34
|
}
|
|
35
|
-
export declare const createTableView: (node: PmNode, view: EditorView, getPos: getPosHandler, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, dispatchAnalyticsEvent: DispatchAnalyticsEvent, pluginInjectionApi?: PluginInjectionAPI, isTableAlignmentEnabled?: boolean) => NodeView;
|
|
35
|
+
export declare const createTableView: (node: PmNode, view: EditorView, getPos: getPosHandler, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, dispatchAnalyticsEvent: DispatchAnalyticsEvent, pluginInjectionApi?: PluginInjectionAPI, isTableAlignmentEnabled?: boolean, isCommentEditor?: boolean) => NodeView;
|
|
36
36
|
export {};
|
|
@@ -21,6 +21,7 @@ export interface TablePluginOptions {
|
|
|
21
21
|
isTableScalingEnabled?: boolean;
|
|
22
22
|
isTableAlignmentEnabled?: boolean;
|
|
23
23
|
isNewColumnResizingEnabled?: boolean;
|
|
24
|
+
isCommentEditor?: boolean;
|
|
24
25
|
}
|
|
25
26
|
type InsertTableAction = (analyticsPayload: AnalyticsEventPayload) => Command;
|
|
26
27
|
type MediaPlugin = NextEditorPlugin<'media', {
|
|
@@ -3,5 +3,5 @@ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
|
3
3
|
import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
4
|
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
5
5
|
import type { PluginInjectionAPIWithA11y } from '../types';
|
|
6
|
-
export declare function keymapPlugin(getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, dragAndDropEnabled?: boolean, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isFullWidthEnabled?: boolean, pluginInjectionApi?: PluginInjectionAPIWithA11y, getIntl?: () => IntlShape, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean): SafePlugin;
|
|
6
|
+
export declare function keymapPlugin(getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, dragAndDropEnabled?: boolean, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isFullWidthEnabled?: boolean, pluginInjectionApi?: PluginInjectionAPIWithA11y, getIntl?: () => IntlShape, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean, isTableResizingEnabled?: boolean): SafePlugin;
|
|
7
7
|
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, eventDispatcher: EventDispatcher, pluginConfig: PluginConfig, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, getIntl: () => IntlShape, tableResizingEnabled?: boolean, fullWidthModeEnabled?: boolean, previousFullWidthModeEnabled?: boolean, dragAndDropEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, pluginInjectionApi?: PluginInjectionAPI, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => SafePlugin<import("../types").TablePluginState>;
|
|
8
|
+
export declare const createPlugin: (dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, pluginConfig: PluginConfig, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, getIntl: () => IntlShape, tableResizingEnabled?: boolean, fullWidthModeEnabled?: boolean, previousFullWidthModeEnabled?: boolean, dragAndDropEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, pluginInjectionApi?: PluginInjectionAPI, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean) => SafePlugin<import("../types").TablePluginState>;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
2
5
|
import { jsx } from '@emotion/react';
|
|
3
6
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
7
|
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
export declare const createTableWithWidth: ({ isTableScalingEnabled, isTableAlignmentEnabled, isFullWidthModeEnabled, createTableProps, }: {
|
|
2
|
+
export declare const createTableWithWidth: ({ isTableScalingEnabled, isTableAlignmentEnabled, isFullWidthModeEnabled, isCommentEditor, isTableResizingEnabled, createTableProps, }: {
|
|
3
3
|
isTableScalingEnabled?: boolean | undefined;
|
|
4
4
|
isTableAlignmentEnabled?: boolean | undefined;
|
|
5
5
|
isFullWidthModeEnabled?: boolean | undefined;
|
|
6
|
+
isCommentEditor?: boolean | undefined;
|
|
7
|
+
isTableResizingEnabled?: boolean | undefined;
|
|
6
8
|
createTableProps?: {
|
|
7
9
|
rowsCount?: number | undefined;
|
|
8
10
|
colsCount?: number | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "7.21.
|
|
3
|
+
"version": "7.21.4",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@atlaskit/adf-schema": "^39.0.3",
|
|
32
32
|
"@atlaskit/button": "^19.0.0",
|
|
33
33
|
"@atlaskit/custom-steps": "^0.4.0",
|
|
34
|
-
"@atlaskit/editor-common": "^86.
|
|
34
|
+
"@atlaskit/editor-common": "^86.4.0",
|
|
35
35
|
"@atlaskit/editor-palette": "1.6.0",
|
|
36
36
|
"@atlaskit/editor-plugin-accessibility-utils": "^1.1.0",
|
|
37
37
|
"@atlaskit/editor-plugin-analytics": "^1.4.0",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@atlaskit/editor-prosemirror": "4.0.1",
|
|
44
44
|
"@atlaskit/editor-shared-styles": "^2.13.0",
|
|
45
45
|
"@atlaskit/editor-tables": "^2.7.0",
|
|
46
|
-
"@atlaskit/icon": "^22.
|
|
46
|
+
"@atlaskit/icon": "^22.7.0",
|
|
47
47
|
"@atlaskit/menu": "^2.8.0",
|
|
48
48
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
49
49
|
"@atlaskit/pragmatic-drag-and-drop": "^1.2.0",
|
|
@@ -128,6 +128,9 @@
|
|
|
128
128
|
},
|
|
129
129
|
"platform_editor_element_drag_and_drop_ed_24041": {
|
|
130
130
|
"type": "boolean"
|
|
131
|
+
},
|
|
132
|
+
"editor_react_18_fix_table_delete_col_decorations": {
|
|
133
|
+
"type": "boolean"
|
|
131
134
|
}
|
|
132
135
|
}
|
|
133
136
|
}
|