@atlaskit/editor-plugin-table 7.25.13 → 7.25.14
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 +8 -0
- package/dist/cjs/commands/insert.js +4 -2
- package/dist/cjs/plugin.js +5 -1
- package/dist/cjs/pm-plugins/keymap.js +3 -2
- package/dist/cjs/utils/create.js +2 -1
- package/dist/es2019/commands/insert.js +4 -2
- package/dist/es2019/plugin.js +4 -1
- package/dist/es2019/pm-plugins/keymap.js +2 -2
- package/dist/es2019/utils/create.js +2 -1
- package/dist/esm/commands/insert.js +4 -2
- package/dist/esm/plugin.js +5 -1
- package/dist/esm/pm-plugins/keymap.js +3 -2
- package/dist/esm/utils/create.js +2 -1
- package/dist/types/commands/insert.d.ts +2 -2
- package/dist/types/pm-plugins/keymap.d.ts +1 -1
- package/dist/types/utils/create.d.ts +2 -1
- package/dist/types-ts4.5/commands/insert.d.ts +2 -2
- package/dist/types-ts4.5/pm-plugins/keymap.d.ts +1 -1
- package/dist/types-ts4.5/utils/create.d.ts +2 -1
- package/package.json +2 -2
- package/src/commands/insert.ts +4 -0
- package/src/plugin.tsx +4 -0
- package/src/pm-plugins/keymap.ts +2 -0
- package/src/utils/create.ts +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 7.25.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#134066](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/134066)
|
|
8
|
+
[`43a1d7aed352b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/43a1d7aed352b) -
|
|
9
|
+
ED-24576: UNSTABLE_allowTableResizing in renderer added
|
|
10
|
+
|
|
3
11
|
## 7.25.13
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -153,13 +153,14 @@ var insertRow = exports.insertRow = function insertRow(row, moveCursorToTheNewRo
|
|
|
153
153
|
return true;
|
|
154
154
|
};
|
|
155
155
|
};
|
|
156
|
-
var createTable = exports.createTable = function createTable(isTableScalingEnabled, isTableAlignmentEnabled, isFullWidthModeEnabled, editorAnalyticsAPI, isCommentEditor, isTableResizingEnabled) {
|
|
156
|
+
var createTable = exports.createTable = function createTable(isTableScalingEnabled, isTableAlignmentEnabled, isFullWidthModeEnabled, editorAnalyticsAPI, isCommentEditor, isChromelessEditor, isTableResizingEnabled) {
|
|
157
157
|
return function (state, dispatch) {
|
|
158
158
|
var table = (0, _utils3.createTableWithWidth)({
|
|
159
159
|
isTableScalingEnabled: isTableScalingEnabled,
|
|
160
160
|
isTableAlignmentEnabled: isTableAlignmentEnabled,
|
|
161
161
|
isFullWidthModeEnabled: isFullWidthModeEnabled,
|
|
162
162
|
isCommentEditor: isCommentEditor,
|
|
163
|
+
isChromelessEditor: isChromelessEditor,
|
|
163
164
|
isTableResizingEnabled: isTableResizingEnabled
|
|
164
165
|
})(state.schema);
|
|
165
166
|
if (dispatch) {
|
|
@@ -180,7 +181,7 @@ var createTable = exports.createTable = function createTable(isTableScalingEnabl
|
|
|
180
181
|
return true;
|
|
181
182
|
};
|
|
182
183
|
};
|
|
183
|
-
var insertTableWithSize = exports.insertTableWithSize = function insertTableWithSize(isFullWidthModeEnabled, isTableScalingEnabled, isTableAlignmentEnabled, editorAnalyticsAPI, isCommentEditor) {
|
|
184
|
+
var insertTableWithSize = exports.insertTableWithSize = function insertTableWithSize(isFullWidthModeEnabled, isTableScalingEnabled, isTableAlignmentEnabled, editorAnalyticsAPI, isCommentEditor, isChromelessEditor) {
|
|
184
185
|
return function (rowsCount, colsCount, inputMethod) {
|
|
185
186
|
return function (_ref) {
|
|
186
187
|
var tr = _ref.tr;
|
|
@@ -189,6 +190,7 @@ var insertTableWithSize = exports.insertTableWithSize = function insertTableWith
|
|
|
189
190
|
isFullWidthModeEnabled: isFullWidthModeEnabled,
|
|
190
191
|
isTableAlignmentEnabled: isTableAlignmentEnabled,
|
|
191
192
|
isCommentEditor: isCommentEditor,
|
|
193
|
+
isChromelessEditor: isChromelessEditor,
|
|
192
194
|
createTableProps: {
|
|
193
195
|
rowsCount: rowsCount,
|
|
194
196
|
colsCount: colsCount
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -117,6 +117,7 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
117
117
|
isTableAlignmentEnabled: options === null || options === void 0 ? void 0 : options.isTableAlignmentEnabled,
|
|
118
118
|
isFullWidthModeEnabled: options === null || options === void 0 ? void 0 : options.fullWidthEnabled,
|
|
119
119
|
isCommentEditor: options === null || options === void 0 ? void 0 : options.isCommentEditor,
|
|
120
|
+
isChromelessEditor: options === null || options === void 0 ? void 0 : options.isChromelessEditor,
|
|
120
121
|
isTableResizingEnabled: options === null || options === void 0 ? void 0 : options.tableResizingEnabled
|
|
121
122
|
})(state.schema);
|
|
122
123
|
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({
|
|
@@ -220,9 +221,11 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
220
221
|
fullWidthEnabled = _ref7$fullWidthEnable === void 0 ? false : _ref7$fullWidthEnable,
|
|
221
222
|
_ref7$isCommentEditor = _ref7.isCommentEditor,
|
|
222
223
|
isCommentEditor = _ref7$isCommentEditor === void 0 ? false : _ref7$isCommentEditor,
|
|
224
|
+
_ref7$isChromelessEdi = _ref7.isChromelessEditor,
|
|
225
|
+
isChromelessEditor = _ref7$isChromelessEdi === void 0 ? false : _ref7$isChromelessEdi,
|
|
223
226
|
_ref7$tableResizingEn = _ref7.tableResizingEnabled,
|
|
224
227
|
tableResizingEnabled = _ref7$tableResizingEn === void 0 ? false : _ref7$tableResizingEn;
|
|
225
|
-
return (0, _keymap.keymapPlugin)(defaultGetEditorContainerWidth, api, editorAnalyticsAPI, dragAndDropEnabled, isTableScalingEnabled, isTableAlignmentEnabled, fullWidthEnabled, api, getIntl, isCellBackgroundDuplicated, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, tableResizingEnabled);
|
|
228
|
+
return (0, _keymap.keymapPlugin)(defaultGetEditorContainerWidth, api, editorAnalyticsAPI, dragAndDropEnabled, isTableScalingEnabled, isTableAlignmentEnabled, fullWidthEnabled, api, getIntl, isCellBackgroundDuplicated, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor, tableResizingEnabled);
|
|
226
229
|
}
|
|
227
230
|
}, {
|
|
228
231
|
name: 'tableSelectionKeymap',
|
|
@@ -489,6 +492,7 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
489
492
|
isTableAlignmentEnabled: options === null || options === void 0 ? void 0 : options.isTableAlignmentEnabled,
|
|
490
493
|
isFullWidthModeEnabled: tableState === null || tableState === void 0 ? void 0 : tableState.isFullWidthModeEnabled,
|
|
491
494
|
isCommentEditor: options === null || options === void 0 ? void 0 : options.isCommentEditor,
|
|
495
|
+
isChromelessEditor: options === null || options === void 0 ? void 0 : options.isChromelessEditor,
|
|
492
496
|
isTableResizingEnabled: options === null || options === void 0 ? void 0 : options.tableResizingEnabled
|
|
493
497
|
})(state.schema);
|
|
494
498
|
var tr = insert(tableNode);
|
|
@@ -26,12 +26,13 @@ function keymapPlugin(getEditorContainerWidth, api, editorAnalyticsAPI, dragAndD
|
|
|
26
26
|
var isTableFixedColumnWidthsOptionEnabled = arguments.length > 10 && arguments[10] !== undefined ? arguments[10] : false;
|
|
27
27
|
var shouldUseIncreasedScalingPercent = arguments.length > 11 ? arguments[11] : undefined;
|
|
28
28
|
var isCommentEditor = arguments.length > 12 ? arguments[12] : undefined;
|
|
29
|
-
var
|
|
29
|
+
var isChromelessEditor = arguments.length > 13 ? arguments[13] : undefined;
|
|
30
|
+
var isTableResizingEnabled = arguments.length > 14 ? arguments[14] : undefined;
|
|
30
31
|
var list = {};
|
|
31
32
|
var ariaNotifyPlugin = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.accessibilityUtils) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions.ariaNotify;
|
|
32
33
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.nextCell.common, (0, _commands2.goToNextCell)(editorAnalyticsAPI, ariaNotifyPlugin, getIntl)(1), list);
|
|
33
34
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.previousCell.common, (0, _commands2.goToNextCell)(editorAnalyticsAPI, ariaNotifyPlugin, getIntl)(-1), list);
|
|
34
|
-
(0, _keymaps.bindKeymapWithCommand)(_keymaps.toggleTable.common, (0, _insert.createTable)(isTableScalingEnabled, isTableAlignmentEnabled, !!isFullWidthEnabled, editorAnalyticsAPI, isCommentEditor, isTableResizingEnabled), list);
|
|
35
|
+
(0, _keymaps.bindKeymapWithCommand)(_keymaps.toggleTable.common, (0, _insert.createTable)(isTableScalingEnabled, isTableAlignmentEnabled, !!isFullWidthEnabled, editorAnalyticsAPI, isCommentEditor, isChromelessEditor, isTableResizingEnabled), list);
|
|
35
36
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.backspace.common, (0, _commands.chainCommands)((0, _commandsWithAnalytics.deleteTableIfSelectedWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.KEYBOARD), (0, _commandsWithAnalytics.emptyMultipleCellsWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.KEYBOARD)), list);
|
|
36
37
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.backspace.common, _commands2.moveCursorBackward, list);
|
|
37
38
|
|
package/dist/cjs/utils/create.js
CHANGED
|
@@ -15,6 +15,7 @@ var createTableWithWidth = exports.createTableWithWidth = function createTableWi
|
|
|
15
15
|
isTableAlignmentEnabled = _ref.isTableAlignmentEnabled,
|
|
16
16
|
isFullWidthModeEnabled = _ref.isFullWidthModeEnabled,
|
|
17
17
|
isCommentEditor = _ref.isCommentEditor,
|
|
18
|
+
isChromelessEditor = _ref.isChromelessEditor,
|
|
18
19
|
isTableResizingEnabled = _ref.isTableResizingEnabled,
|
|
19
20
|
createTableProps = _ref.createTableProps;
|
|
20
21
|
return function (schema) {
|
|
@@ -25,7 +26,7 @@ var createTableWithWidth = exports.createTableWithWidth = function createTableWi
|
|
|
25
26
|
if (isTableAlignmentEnabled && (isFullWidthModeEnabled || isCommentEditor)) {
|
|
26
27
|
attrsOverrides.layout = 'align-start';
|
|
27
28
|
}
|
|
28
|
-
if (isCommentEditor && isTableResizingEnabled) {
|
|
29
|
+
if (isCommentEditor && isTableResizingEnabled || isChromelessEditor) {
|
|
29
30
|
attrsOverrides.tableWidth = 'inherit';
|
|
30
31
|
}
|
|
31
32
|
return (0, _utils.createTable)(_objectSpread(_objectSpread({
|
|
@@ -119,12 +119,13 @@ export const insertRow = (row, moveCursorToTheNewRow, isCellBackgroundDuplicated
|
|
|
119
119
|
}
|
|
120
120
|
return true;
|
|
121
121
|
};
|
|
122
|
-
export const createTable = (isTableScalingEnabled, isTableAlignmentEnabled, isFullWidthModeEnabled, editorAnalyticsAPI, isCommentEditor, isTableResizingEnabled) => (state, dispatch) => {
|
|
122
|
+
export const createTable = (isTableScalingEnabled, isTableAlignmentEnabled, isFullWidthModeEnabled, editorAnalyticsAPI, isCommentEditor, isChromelessEditor, isTableResizingEnabled) => (state, dispatch) => {
|
|
123
123
|
const table = createTableWithWidth({
|
|
124
124
|
isTableScalingEnabled,
|
|
125
125
|
isTableAlignmentEnabled,
|
|
126
126
|
isFullWidthModeEnabled,
|
|
127
127
|
isCommentEditor,
|
|
128
|
+
isChromelessEditor,
|
|
128
129
|
isTableResizingEnabled
|
|
129
130
|
})(state.schema);
|
|
130
131
|
if (dispatch) {
|
|
@@ -144,7 +145,7 @@ export const createTable = (isTableScalingEnabled, isTableAlignmentEnabled, isFu
|
|
|
144
145
|
}
|
|
145
146
|
return true;
|
|
146
147
|
};
|
|
147
|
-
export const insertTableWithSize = (isFullWidthModeEnabled, isTableScalingEnabled, isTableAlignmentEnabled, editorAnalyticsAPI, isCommentEditor) => (rowsCount, colsCount, inputMethod) => {
|
|
148
|
+
export const insertTableWithSize = (isFullWidthModeEnabled, isTableScalingEnabled, isTableAlignmentEnabled, editorAnalyticsAPI, isCommentEditor, isChromelessEditor) => (rowsCount, colsCount, inputMethod) => {
|
|
148
149
|
return ({
|
|
149
150
|
tr
|
|
150
151
|
}) => {
|
|
@@ -153,6 +154,7 @@ export const insertTableWithSize = (isFullWidthModeEnabled, isTableScalingEnable
|
|
|
153
154
|
isFullWidthModeEnabled,
|
|
154
155
|
isTableAlignmentEnabled,
|
|
155
156
|
isCommentEditor,
|
|
157
|
+
isChromelessEditor,
|
|
156
158
|
createTableProps: {
|
|
157
159
|
rowsCount: rowsCount,
|
|
158
160
|
colsCount: colsCount
|
package/dist/es2019/plugin.js
CHANGED
|
@@ -105,6 +105,7 @@ const tablesPlugin = ({
|
|
|
105
105
|
isTableAlignmentEnabled: options === null || options === void 0 ? void 0 : options.isTableAlignmentEnabled,
|
|
106
106
|
isFullWidthModeEnabled: options === null || options === void 0 ? void 0 : options.fullWidthEnabled,
|
|
107
107
|
isCommentEditor: options === null || options === void 0 ? void 0 : options.isCommentEditor,
|
|
108
|
+
isChromelessEditor: options === null || options === void 0 ? void 0 : options.isChromelessEditor,
|
|
108
109
|
isTableResizingEnabled: options === null || options === void 0 ? void 0 : options.tableResizingEnabled
|
|
109
110
|
})(state.schema);
|
|
110
111
|
return (_api$contentInsertion = api === null || api === void 0 ? void 0 : (_api$contentInsertion2 = api.contentInsertion) === null || _api$contentInsertion2 === void 0 ? void 0 : (_api$contentInsertion3 = _api$contentInsertion2.actions) === null || _api$contentInsertion3 === void 0 ? void 0 : _api$contentInsertion3.insert({
|
|
@@ -210,9 +211,10 @@ const tablesPlugin = ({
|
|
|
210
211
|
isTableAlignmentEnabled = false,
|
|
211
212
|
fullWidthEnabled = false,
|
|
212
213
|
isCommentEditor = false,
|
|
214
|
+
isChromelessEditor = false,
|
|
213
215
|
tableResizingEnabled = false
|
|
214
216
|
} = options || {};
|
|
215
|
-
return keymapPlugin(defaultGetEditorContainerWidth, api, editorAnalyticsAPI, dragAndDropEnabled, isTableScalingEnabled, isTableAlignmentEnabled, fullWidthEnabled, api, getIntl, isCellBackgroundDuplicated, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, tableResizingEnabled);
|
|
217
|
+
return keymapPlugin(defaultGetEditorContainerWidth, api, editorAnalyticsAPI, dragAndDropEnabled, isTableScalingEnabled, isTableAlignmentEnabled, fullWidthEnabled, api, getIntl, isCellBackgroundDuplicated, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor, tableResizingEnabled);
|
|
216
218
|
}
|
|
217
219
|
}, {
|
|
218
220
|
name: 'tableSelectionKeymap',
|
|
@@ -481,6 +483,7 @@ const tablesPlugin = ({
|
|
|
481
483
|
isTableAlignmentEnabled: options === null || options === void 0 ? void 0 : options.isTableAlignmentEnabled,
|
|
482
484
|
isFullWidthModeEnabled: tableState === null || tableState === void 0 ? void 0 : tableState.isFullWidthModeEnabled,
|
|
483
485
|
isCommentEditor: options === null || options === void 0 ? void 0 : options.isCommentEditor,
|
|
486
|
+
isChromelessEditor: options === null || options === void 0 ? void 0 : options.isChromelessEditor,
|
|
484
487
|
isTableResizingEnabled: options === null || options === void 0 ? void 0 : options.tableResizingEnabled
|
|
485
488
|
})(state.schema);
|
|
486
489
|
const tr = insert(tableNode);
|
|
@@ -8,13 +8,13 @@ import { addRowAroundSelection, changeColumnWidthByStepWithAnalytics, deleteSele
|
|
|
8
8
|
import { activateNextResizeArea, initiateKeyboardColumnResizing, stopKeyboardColumnResizing } from '../commands/column-resize';
|
|
9
9
|
import { addColumnAfter as addColumnAfterCommand, addColumnBefore as addColumnBeforeCommand, createTable } from '../commands/insert';
|
|
10
10
|
import { moveSourceWithAnalyticsViaShortcut } from '../pm-plugins/drag-and-drop/commands-with-analytics';
|
|
11
|
-
export function keymapPlugin(getEditorContainerWidth, api, editorAnalyticsAPI, dragAndDropEnabled, isTableScalingEnabled = false, isTableAlignmentEnabled = false, isFullWidthEnabled, pluginInjectionApi, getIntl, isCellBackgroundDuplicated = false, isTableFixedColumnWidthsOptionEnabled = false, shouldUseIncreasedScalingPercent, isCommentEditor, isTableResizingEnabled) {
|
|
11
|
+
export function keymapPlugin(getEditorContainerWidth, api, editorAnalyticsAPI, dragAndDropEnabled, isTableScalingEnabled = false, isTableAlignmentEnabled = false, isFullWidthEnabled, pluginInjectionApi, getIntl, isCellBackgroundDuplicated = false, isTableFixedColumnWidthsOptionEnabled = false, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor, isTableResizingEnabled) {
|
|
12
12
|
var _pluginInjectionApi$a;
|
|
13
13
|
const list = {};
|
|
14
14
|
const ariaNotifyPlugin = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.accessibilityUtils) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions.ariaNotify;
|
|
15
15
|
bindKeymapWithCommand(nextCell.common, goToNextCell(editorAnalyticsAPI, ariaNotifyPlugin, getIntl)(1), list);
|
|
16
16
|
bindKeymapWithCommand(previousCell.common, goToNextCell(editorAnalyticsAPI, ariaNotifyPlugin, getIntl)(-1), list);
|
|
17
|
-
bindKeymapWithCommand(toggleTable.common, createTable(isTableScalingEnabled, isTableAlignmentEnabled, !!isFullWidthEnabled, editorAnalyticsAPI, isCommentEditor, isTableResizingEnabled), list);
|
|
17
|
+
bindKeymapWithCommand(toggleTable.common, createTable(isTableScalingEnabled, isTableAlignmentEnabled, !!isFullWidthEnabled, editorAnalyticsAPI, isCommentEditor, isChromelessEditor, isTableResizingEnabled), list);
|
|
18
18
|
bindKeymapWithCommand(backspace.common, chainCommands(deleteTableIfSelectedWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD), emptyMultipleCellsWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD)), list);
|
|
19
19
|
bindKeymapWithCommand(backspace.common, moveCursorBackward, list);
|
|
20
20
|
|
|
@@ -5,6 +5,7 @@ export const createTableWithWidth = ({
|
|
|
5
5
|
isTableAlignmentEnabled,
|
|
6
6
|
isFullWidthModeEnabled,
|
|
7
7
|
isCommentEditor,
|
|
8
|
+
isChromelessEditor,
|
|
8
9
|
isTableResizingEnabled,
|
|
9
10
|
createTableProps
|
|
10
11
|
}) => schema => {
|
|
@@ -15,7 +16,7 @@ export const createTableWithWidth = ({
|
|
|
15
16
|
if (isTableAlignmentEnabled && (isFullWidthModeEnabled || isCommentEditor)) {
|
|
16
17
|
attrsOverrides.layout = 'align-start';
|
|
17
18
|
}
|
|
18
|
-
if (isCommentEditor && isTableResizingEnabled) {
|
|
19
|
+
if (isCommentEditor && isTableResizingEnabled || isChromelessEditor) {
|
|
19
20
|
attrsOverrides.tableWidth = 'inherit';
|
|
20
21
|
}
|
|
21
22
|
return createTable({
|
|
@@ -144,13 +144,14 @@ export var insertRow = function insertRow(row, moveCursorToTheNewRow, isCellBack
|
|
|
144
144
|
return true;
|
|
145
145
|
};
|
|
146
146
|
};
|
|
147
|
-
export var createTable = function createTable(isTableScalingEnabled, isTableAlignmentEnabled, isFullWidthModeEnabled, editorAnalyticsAPI, isCommentEditor, isTableResizingEnabled) {
|
|
147
|
+
export var createTable = function createTable(isTableScalingEnabled, isTableAlignmentEnabled, isFullWidthModeEnabled, editorAnalyticsAPI, isCommentEditor, isChromelessEditor, isTableResizingEnabled) {
|
|
148
148
|
return function (state, dispatch) {
|
|
149
149
|
var table = createTableWithWidth({
|
|
150
150
|
isTableScalingEnabled: isTableScalingEnabled,
|
|
151
151
|
isTableAlignmentEnabled: isTableAlignmentEnabled,
|
|
152
152
|
isFullWidthModeEnabled: isFullWidthModeEnabled,
|
|
153
153
|
isCommentEditor: isCommentEditor,
|
|
154
|
+
isChromelessEditor: isChromelessEditor,
|
|
154
155
|
isTableResizingEnabled: isTableResizingEnabled
|
|
155
156
|
})(state.schema);
|
|
156
157
|
if (dispatch) {
|
|
@@ -171,7 +172,7 @@ export var createTable = function createTable(isTableScalingEnabled, isTableAlig
|
|
|
171
172
|
return true;
|
|
172
173
|
};
|
|
173
174
|
};
|
|
174
|
-
export var insertTableWithSize = function insertTableWithSize(isFullWidthModeEnabled, isTableScalingEnabled, isTableAlignmentEnabled, editorAnalyticsAPI, isCommentEditor) {
|
|
175
|
+
export var insertTableWithSize = function insertTableWithSize(isFullWidthModeEnabled, isTableScalingEnabled, isTableAlignmentEnabled, editorAnalyticsAPI, isCommentEditor, isChromelessEditor) {
|
|
175
176
|
return function (rowsCount, colsCount, inputMethod) {
|
|
176
177
|
return function (_ref) {
|
|
177
178
|
var tr = _ref.tr;
|
|
@@ -180,6 +181,7 @@ export var insertTableWithSize = function insertTableWithSize(isFullWidthModeEna
|
|
|
180
181
|
isFullWidthModeEnabled: isFullWidthModeEnabled,
|
|
181
182
|
isTableAlignmentEnabled: isTableAlignmentEnabled,
|
|
182
183
|
isCommentEditor: isCommentEditor,
|
|
184
|
+
isChromelessEditor: isChromelessEditor,
|
|
183
185
|
createTableProps: {
|
|
184
186
|
rowsCount: rowsCount,
|
|
185
187
|
colsCount: colsCount
|
package/dist/esm/plugin.js
CHANGED
|
@@ -110,6 +110,7 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
110
110
|
isTableAlignmentEnabled: options === null || options === void 0 ? void 0 : options.isTableAlignmentEnabled,
|
|
111
111
|
isFullWidthModeEnabled: options === null || options === void 0 ? void 0 : options.fullWidthEnabled,
|
|
112
112
|
isCommentEditor: options === null || options === void 0 ? void 0 : options.isCommentEditor,
|
|
113
|
+
isChromelessEditor: options === null || options === void 0 ? void 0 : options.isChromelessEditor,
|
|
113
114
|
isTableResizingEnabled: options === null || options === void 0 ? void 0 : options.tableResizingEnabled
|
|
114
115
|
})(state.schema);
|
|
115
116
|
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({
|
|
@@ -213,9 +214,11 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
213
214
|
fullWidthEnabled = _ref7$fullWidthEnable === void 0 ? false : _ref7$fullWidthEnable,
|
|
214
215
|
_ref7$isCommentEditor = _ref7.isCommentEditor,
|
|
215
216
|
isCommentEditor = _ref7$isCommentEditor === void 0 ? false : _ref7$isCommentEditor,
|
|
217
|
+
_ref7$isChromelessEdi = _ref7.isChromelessEditor,
|
|
218
|
+
isChromelessEditor = _ref7$isChromelessEdi === void 0 ? false : _ref7$isChromelessEdi,
|
|
216
219
|
_ref7$tableResizingEn = _ref7.tableResizingEnabled,
|
|
217
220
|
tableResizingEnabled = _ref7$tableResizingEn === void 0 ? false : _ref7$tableResizingEn;
|
|
218
|
-
return keymapPlugin(defaultGetEditorContainerWidth, api, editorAnalyticsAPI, dragAndDropEnabled, isTableScalingEnabled, isTableAlignmentEnabled, fullWidthEnabled, api, getIntl, isCellBackgroundDuplicated, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, tableResizingEnabled);
|
|
221
|
+
return keymapPlugin(defaultGetEditorContainerWidth, api, editorAnalyticsAPI, dragAndDropEnabled, isTableScalingEnabled, isTableAlignmentEnabled, fullWidthEnabled, api, getIntl, isCellBackgroundDuplicated, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor, tableResizingEnabled);
|
|
219
222
|
}
|
|
220
223
|
}, {
|
|
221
224
|
name: 'tableSelectionKeymap',
|
|
@@ -482,6 +485,7 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
482
485
|
isTableAlignmentEnabled: options === null || options === void 0 ? void 0 : options.isTableAlignmentEnabled,
|
|
483
486
|
isFullWidthModeEnabled: tableState === null || tableState === void 0 ? void 0 : tableState.isFullWidthModeEnabled,
|
|
484
487
|
isCommentEditor: options === null || options === void 0 ? void 0 : options.isCommentEditor,
|
|
488
|
+
isChromelessEditor: options === null || options === void 0 ? void 0 : options.isChromelessEditor,
|
|
485
489
|
isTableResizingEnabled: options === null || options === void 0 ? void 0 : options.tableResizingEnabled
|
|
486
490
|
})(state.schema);
|
|
487
491
|
var tr = insert(tableNode);
|
|
@@ -19,12 +19,13 @@ export function keymapPlugin(getEditorContainerWidth, api, editorAnalyticsAPI, d
|
|
|
19
19
|
var isTableFixedColumnWidthsOptionEnabled = arguments.length > 10 && arguments[10] !== undefined ? arguments[10] : false;
|
|
20
20
|
var shouldUseIncreasedScalingPercent = arguments.length > 11 ? arguments[11] : undefined;
|
|
21
21
|
var isCommentEditor = arguments.length > 12 ? arguments[12] : undefined;
|
|
22
|
-
var
|
|
22
|
+
var isChromelessEditor = arguments.length > 13 ? arguments[13] : undefined;
|
|
23
|
+
var isTableResizingEnabled = arguments.length > 14 ? arguments[14] : undefined;
|
|
23
24
|
var list = {};
|
|
24
25
|
var ariaNotifyPlugin = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.accessibilityUtils) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions.ariaNotify;
|
|
25
26
|
bindKeymapWithCommand(nextCell.common, goToNextCell(editorAnalyticsAPI, ariaNotifyPlugin, getIntl)(1), list);
|
|
26
27
|
bindKeymapWithCommand(previousCell.common, goToNextCell(editorAnalyticsAPI, ariaNotifyPlugin, getIntl)(-1), list);
|
|
27
|
-
bindKeymapWithCommand(toggleTable.common, createTable(isTableScalingEnabled, isTableAlignmentEnabled, !!isFullWidthEnabled, editorAnalyticsAPI, isCommentEditor, isTableResizingEnabled), list);
|
|
28
|
+
bindKeymapWithCommand(toggleTable.common, createTable(isTableScalingEnabled, isTableAlignmentEnabled, !!isFullWidthEnabled, editorAnalyticsAPI, isCommentEditor, isChromelessEditor, isTableResizingEnabled), list);
|
|
28
29
|
bindKeymapWithCommand(backspace.common, chainCommands(deleteTableIfSelectedWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD), emptyMultipleCellsWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD)), list);
|
|
29
30
|
bindKeymapWithCommand(backspace.common, moveCursorBackward, list);
|
|
30
31
|
|
package/dist/esm/utils/create.js
CHANGED
|
@@ -8,6 +8,7 @@ export var createTableWithWidth = function createTableWithWidth(_ref) {
|
|
|
8
8
|
isTableAlignmentEnabled = _ref.isTableAlignmentEnabled,
|
|
9
9
|
isFullWidthModeEnabled = _ref.isFullWidthModeEnabled,
|
|
10
10
|
isCommentEditor = _ref.isCommentEditor,
|
|
11
|
+
isChromelessEditor = _ref.isChromelessEditor,
|
|
11
12
|
isTableResizingEnabled = _ref.isTableResizingEnabled,
|
|
12
13
|
createTableProps = _ref.createTableProps;
|
|
13
14
|
return function (schema) {
|
|
@@ -18,7 +19,7 @@ export var createTableWithWidth = function createTableWithWidth(_ref) {
|
|
|
18
19
|
if (isTableAlignmentEnabled && (isFullWidthModeEnabled || isCommentEditor)) {
|
|
19
20
|
attrsOverrides.layout = 'align-start';
|
|
20
21
|
}
|
|
21
|
-
if (isCommentEditor && isTableResizingEnabled) {
|
|
22
|
+
if (isCommentEditor && isTableResizingEnabled || isChromelessEditor) {
|
|
22
23
|
attrsOverrides.tableWidth = 'inherit';
|
|
23
24
|
}
|
|
24
25
|
return createTable(_objectSpread(_objectSpread({
|
|
@@ -9,5 +9,5 @@ export declare const addColumnBefore: (api: PluginInjectionAPI | undefined | nul
|
|
|
9
9
|
export declare const addColumnAfter: (api: PluginInjectionAPI | undefined | null, isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean) => Command;
|
|
10
10
|
export declare const insertColumn: (api: PluginInjectionAPI | undefined | null, isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean) => (column: number) => Command;
|
|
11
11
|
export declare const insertRow: (row: number, moveCursorToTheNewRow: boolean, isCellBackgroundDuplicated?: boolean) => Command;
|
|
12
|
-
export declare const createTable: (isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isFullWidthModeEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined | null, isCommentEditor?: boolean, isTableResizingEnabled?: boolean) => Command;
|
|
13
|
-
export declare const insertTableWithSize: (isFullWidthModeEnabled?: boolean, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, isCommentEditor?: boolean) => (rowsCount: number, colsCount: number, inputMethod?: INPUT_METHOD.PICKER) => EditorCommand;
|
|
12
|
+
export declare const createTable: (isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isFullWidthModeEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined | null, isCommentEditor?: boolean, isChromelessEditor?: boolean, isTableResizingEnabled?: boolean) => Command;
|
|
13
|
+
export declare const insertTableWithSize: (isFullWidthModeEnabled?: boolean, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, isCommentEditor?: boolean, isChromelessEditor?: boolean) => (rowsCount: number, colsCount: number, inputMethod?: INPUT_METHOD.PICKER) => EditorCommand;
|
|
@@ -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 { PluginInjectionAPI, PluginInjectionAPIWithA11y } from '../types';
|
|
6
|
-
export declare function keymapPlugin(getEditorContainerWidth: GetEditorContainerWidth, api: PluginInjectionAPI | undefined | null, 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;
|
|
6
|
+
export declare function keymapPlugin(getEditorContainerWidth: GetEditorContainerWidth, api: PluginInjectionAPI | undefined | null, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, dragAndDropEnabled?: boolean, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isFullWidthEnabled?: boolean, pluginInjectionApi?: PluginInjectionAPIWithA11y, getIntl?: () => IntlShape, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean, isChromelessEditor?: boolean, isTableResizingEnabled?: boolean): SafePlugin;
|
|
7
7
|
export default keymapPlugin;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
export declare const createTableWithWidth: ({ isTableScalingEnabled, isTableAlignmentEnabled, isFullWidthModeEnabled, isCommentEditor, isTableResizingEnabled, createTableProps, }: {
|
|
2
|
+
export declare const createTableWithWidth: ({ isTableScalingEnabled, isTableAlignmentEnabled, isFullWidthModeEnabled, isCommentEditor, isChromelessEditor, isTableResizingEnabled, createTableProps, }: {
|
|
3
3
|
isTableScalingEnabled?: boolean | undefined;
|
|
4
4
|
isTableAlignmentEnabled?: boolean | undefined;
|
|
5
5
|
isFullWidthModeEnabled?: boolean | undefined;
|
|
6
6
|
isCommentEditor?: boolean | undefined;
|
|
7
|
+
isChromelessEditor?: boolean | undefined;
|
|
7
8
|
isTableResizingEnabled?: boolean | undefined;
|
|
8
9
|
createTableProps?: {
|
|
9
10
|
rowsCount?: number | undefined;
|
|
@@ -9,5 +9,5 @@ export declare const addColumnBefore: (api: PluginInjectionAPI | undefined | nul
|
|
|
9
9
|
export declare const addColumnAfter: (api: PluginInjectionAPI | undefined | null, isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean) => Command;
|
|
10
10
|
export declare const insertColumn: (api: PluginInjectionAPI | undefined | null, isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean) => (column: number) => Command;
|
|
11
11
|
export declare const insertRow: (row: number, moveCursorToTheNewRow: boolean, isCellBackgroundDuplicated?: boolean) => Command;
|
|
12
|
-
export declare const createTable: (isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isFullWidthModeEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined | null, isCommentEditor?: boolean, isTableResizingEnabled?: boolean) => Command;
|
|
13
|
-
export declare const insertTableWithSize: (isFullWidthModeEnabled?: boolean, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, isCommentEditor?: boolean) => (rowsCount: number, colsCount: number, inputMethod?: INPUT_METHOD.PICKER) => EditorCommand;
|
|
12
|
+
export declare const createTable: (isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isFullWidthModeEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined | null, isCommentEditor?: boolean, isChromelessEditor?: boolean, isTableResizingEnabled?: boolean) => Command;
|
|
13
|
+
export declare const insertTableWithSize: (isFullWidthModeEnabled?: boolean, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, isCommentEditor?: boolean, isChromelessEditor?: boolean) => (rowsCount: number, colsCount: number, inputMethod?: INPUT_METHOD.PICKER) => EditorCommand;
|
|
@@ -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 { PluginInjectionAPI, PluginInjectionAPIWithA11y } from '../types';
|
|
6
|
-
export declare function keymapPlugin(getEditorContainerWidth: GetEditorContainerWidth, api: PluginInjectionAPI | undefined | null, 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;
|
|
6
|
+
export declare function keymapPlugin(getEditorContainerWidth: GetEditorContainerWidth, api: PluginInjectionAPI | undefined | null, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, dragAndDropEnabled?: boolean, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isFullWidthEnabled?: boolean, pluginInjectionApi?: PluginInjectionAPIWithA11y, getIntl?: () => IntlShape, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean, isChromelessEditor?: boolean, isTableResizingEnabled?: boolean): SafePlugin;
|
|
7
7
|
export default keymapPlugin;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
export declare const createTableWithWidth: ({ isTableScalingEnabled, isTableAlignmentEnabled, isFullWidthModeEnabled, isCommentEditor, isTableResizingEnabled, createTableProps, }: {
|
|
2
|
+
export declare const createTableWithWidth: ({ isTableScalingEnabled, isTableAlignmentEnabled, isFullWidthModeEnabled, isCommentEditor, isChromelessEditor, isTableResizingEnabled, createTableProps, }: {
|
|
3
3
|
isTableScalingEnabled?: boolean | undefined;
|
|
4
4
|
isTableAlignmentEnabled?: boolean | undefined;
|
|
5
5
|
isFullWidthModeEnabled?: boolean | undefined;
|
|
6
6
|
isCommentEditor?: boolean | undefined;
|
|
7
|
+
isChromelessEditor?: boolean | undefined;
|
|
7
8
|
isTableResizingEnabled?: boolean | undefined;
|
|
8
9
|
createTableProps?: {
|
|
9
10
|
rowsCount?: number | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "7.25.
|
|
3
|
+
"version": "7.25.14",
|
|
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": "^40.9.0",
|
|
32
32
|
"@atlaskit/button": "^20.1.0",
|
|
33
33
|
"@atlaskit/custom-steps": "^0.7.0",
|
|
34
|
-
"@atlaskit/editor-common": "^88.
|
|
34
|
+
"@atlaskit/editor-common": "^88.3.0",
|
|
35
35
|
"@atlaskit/editor-palette": "1.6.0",
|
|
36
36
|
"@atlaskit/editor-plugin-accessibility-utils": "^1.2.0",
|
|
37
37
|
"@atlaskit/editor-plugin-analytics": "^1.8.0",
|
package/src/commands/insert.ts
CHANGED
|
@@ -249,6 +249,7 @@ export const createTable =
|
|
|
249
249
|
isFullWidthModeEnabled?: boolean,
|
|
250
250
|
editorAnalyticsAPI?: EditorAnalyticsAPI | undefined | null,
|
|
251
251
|
isCommentEditor?: boolean,
|
|
252
|
+
isChromelessEditor?: boolean,
|
|
252
253
|
isTableResizingEnabled?: boolean,
|
|
253
254
|
): Command =>
|
|
254
255
|
(state, dispatch) => {
|
|
@@ -257,6 +258,7 @@ export const createTable =
|
|
|
257
258
|
isTableAlignmentEnabled,
|
|
258
259
|
isFullWidthModeEnabled,
|
|
259
260
|
isCommentEditor,
|
|
261
|
+
isChromelessEditor,
|
|
260
262
|
isTableResizingEnabled,
|
|
261
263
|
})(state.schema);
|
|
262
264
|
|
|
@@ -284,6 +286,7 @@ export const insertTableWithSize =
|
|
|
284
286
|
isTableAlignmentEnabled?: boolean,
|
|
285
287
|
editorAnalyticsAPI?: EditorAnalyticsAPI,
|
|
286
288
|
isCommentEditor?: boolean,
|
|
289
|
+
isChromelessEditor?: boolean,
|
|
287
290
|
) =>
|
|
288
291
|
(rowsCount: number, colsCount: number, inputMethod?: INPUT_METHOD.PICKER): EditorCommand => {
|
|
289
292
|
return ({ tr }) => {
|
|
@@ -292,6 +295,7 @@ export const insertTableWithSize =
|
|
|
292
295
|
isFullWidthModeEnabled,
|
|
293
296
|
isTableAlignmentEnabled,
|
|
294
297
|
isCommentEditor,
|
|
298
|
+
isChromelessEditor,
|
|
295
299
|
createTableProps: {
|
|
296
300
|
rowsCount: rowsCount,
|
|
297
301
|
colsCount: colsCount,
|
package/src/plugin.tsx
CHANGED
|
@@ -218,6 +218,7 @@ const tablesPlugin: TablePlugin = ({ config: options, api }) => {
|
|
|
218
218
|
isTableAlignmentEnabled: options?.isTableAlignmentEnabled,
|
|
219
219
|
isFullWidthModeEnabled: options?.fullWidthEnabled,
|
|
220
220
|
isCommentEditor: options?.isCommentEditor,
|
|
221
|
+
isChromelessEditor: options?.isChromelessEditor,
|
|
221
222
|
isTableResizingEnabled: options?.tableResizingEnabled,
|
|
222
223
|
})(state.schema);
|
|
223
224
|
|
|
@@ -360,6 +361,7 @@ const tablesPlugin: TablePlugin = ({ config: options, api }) => {
|
|
|
360
361
|
isTableAlignmentEnabled = false,
|
|
361
362
|
fullWidthEnabled = false,
|
|
362
363
|
isCommentEditor = false,
|
|
364
|
+
isChromelessEditor = false,
|
|
363
365
|
tableResizingEnabled = false,
|
|
364
366
|
} = options || ({} as TablePluginOptions);
|
|
365
367
|
|
|
@@ -377,6 +379,7 @@ const tablesPlugin: TablePlugin = ({ config: options, api }) => {
|
|
|
377
379
|
isTableFixedColumnWidthsOptionEnabled,
|
|
378
380
|
shouldUseIncreasedScalingPercent,
|
|
379
381
|
isCommentEditor,
|
|
382
|
+
isChromelessEditor,
|
|
380
383
|
tableResizingEnabled,
|
|
381
384
|
);
|
|
382
385
|
},
|
|
@@ -705,6 +708,7 @@ const tablesPlugin: TablePlugin = ({ config: options, api }) => {
|
|
|
705
708
|
isTableAlignmentEnabled: options?.isTableAlignmentEnabled,
|
|
706
709
|
isFullWidthModeEnabled: tableState?.isFullWidthModeEnabled,
|
|
707
710
|
isCommentEditor: options?.isCommentEditor,
|
|
711
|
+
isChromelessEditor: options?.isChromelessEditor,
|
|
708
712
|
isTableResizingEnabled: options?.tableResizingEnabled,
|
|
709
713
|
})(state.schema);
|
|
710
714
|
|
package/src/pm-plugins/keymap.ts
CHANGED
|
@@ -71,6 +71,7 @@ export function keymapPlugin(
|
|
|
71
71
|
isTableFixedColumnWidthsOptionEnabled = false,
|
|
72
72
|
shouldUseIncreasedScalingPercent?: boolean,
|
|
73
73
|
isCommentEditor?: boolean,
|
|
74
|
+
isChromelessEditor?: boolean,
|
|
74
75
|
isTableResizingEnabled?: boolean,
|
|
75
76
|
): SafePlugin {
|
|
76
77
|
const list = {};
|
|
@@ -95,6 +96,7 @@ export function keymapPlugin(
|
|
|
95
96
|
!!isFullWidthEnabled,
|
|
96
97
|
editorAnalyticsAPI,
|
|
97
98
|
isCommentEditor,
|
|
99
|
+
isChromelessEditor,
|
|
98
100
|
isTableResizingEnabled,
|
|
99
101
|
),
|
|
100
102
|
list,
|
package/src/utils/create.ts
CHANGED
|
@@ -15,6 +15,7 @@ export const createTableWithWidth =
|
|
|
15
15
|
isTableAlignmentEnabled,
|
|
16
16
|
isFullWidthModeEnabled,
|
|
17
17
|
isCommentEditor,
|
|
18
|
+
isChromelessEditor,
|
|
18
19
|
isTableResizingEnabled,
|
|
19
20
|
createTableProps,
|
|
20
21
|
}: {
|
|
@@ -22,6 +23,7 @@ export const createTableWithWidth =
|
|
|
22
23
|
isTableAlignmentEnabled?: boolean;
|
|
23
24
|
isFullWidthModeEnabled?: boolean;
|
|
24
25
|
isCommentEditor?: boolean;
|
|
26
|
+
isChromelessEditor?: boolean;
|
|
25
27
|
isTableResizingEnabled?: boolean;
|
|
26
28
|
createTableProps?: {
|
|
27
29
|
rowsCount?: number;
|
|
@@ -36,7 +38,7 @@ export const createTableWithWidth =
|
|
|
36
38
|
if (isTableAlignmentEnabled && (isFullWidthModeEnabled || isCommentEditor)) {
|
|
37
39
|
attrsOverrides.layout = 'align-start';
|
|
38
40
|
}
|
|
39
|
-
if (isCommentEditor && isTableResizingEnabled) {
|
|
41
|
+
if ((isCommentEditor && isTableResizingEnabled) || isChromelessEditor) {
|
|
40
42
|
attrsOverrides.tableWidth = 'inherit';
|
|
41
43
|
}
|
|
42
44
|
|