@atlaskit/editor-plugin-table 10.6.10 → 10.6.11
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 +6 -0
- package/dist/cjs/ui/toolbar.js +5 -1
- package/dist/es2019/ui/toolbar.js +5 -1
- package/dist/esm/ui/toolbar.js +5 -1
- package/package.json +2 -2
- package/src/ui/toolbar.tsx +5 -6
package/CHANGELOG.md
CHANGED
package/dist/cjs/ui/toolbar.js
CHANGED
|
@@ -389,8 +389,12 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(getE
|
|
|
389
389
|
}
|
|
390
390
|
var isTableOrColumnResizing = !!(resizeState !== null && resizeState !== void 0 && resizeState.dragging || tableWidthState !== null && tableWidthState !== void 0 && tableWidthState.resizing);
|
|
391
391
|
var isTableMenuOpened = pluginState.isContextualMenuOpen || isDragHandleMenuOpened;
|
|
392
|
+
var isTableState = isTableRowOrColumnDragged || isTableOrColumnResizing || isTableMenuOpened;
|
|
392
393
|
var isViewMode = (api === null || api === void 0 || (_api$editorViewMode = api.editorViewMode) === null || _api$editorViewMode === void 0 || (_api$editorViewMode = _api$editorViewMode.sharedState.currentState()) === null || _api$editorViewMode === void 0 ? void 0 : _api$editorViewMode.mode) === 'view';
|
|
393
|
-
|
|
394
|
+
|
|
395
|
+
// Note: when focus is in codeblocks, pluginState.editorHasFocus is false, so the codeblocks toolbar
|
|
396
|
+
// won't be suppressed.
|
|
397
|
+
var shouldSuppressAllToolbars = isTableState && pluginState.editorHasFocus && !isViewMode;
|
|
394
398
|
if (shouldSuppressAllToolbars) {
|
|
395
399
|
return {
|
|
396
400
|
title: toolbarTitle,
|
|
@@ -367,8 +367,12 @@ export const getToolbarConfig = (getEditorContainerWidth, api, editorAnalyticsAP
|
|
|
367
367
|
}
|
|
368
368
|
const isTableOrColumnResizing = !!(resizeState !== null && resizeState !== void 0 && resizeState.dragging || tableWidthState !== null && tableWidthState !== void 0 && tableWidthState.resizing);
|
|
369
369
|
const isTableMenuOpened = pluginState.isContextualMenuOpen || isDragHandleMenuOpened;
|
|
370
|
+
const isTableState = isTableRowOrColumnDragged || isTableOrColumnResizing || isTableMenuOpened;
|
|
370
371
|
const isViewMode = (api === null || api === void 0 ? void 0 : (_api$editorViewMode = api.editorViewMode) === null || _api$editorViewMode === void 0 ? void 0 : (_api$editorViewMode$s = _api$editorViewMode.sharedState.currentState()) === null || _api$editorViewMode$s === void 0 ? void 0 : _api$editorViewMode$s.mode) === 'view';
|
|
371
|
-
|
|
372
|
+
|
|
373
|
+
// Note: when focus is in codeblocks, pluginState.editorHasFocus is false, so the codeblocks toolbar
|
|
374
|
+
// won't be suppressed.
|
|
375
|
+
const shouldSuppressAllToolbars = isTableState && pluginState.editorHasFocus && !isViewMode;
|
|
372
376
|
if (shouldSuppressAllToolbars) {
|
|
373
377
|
return {
|
|
374
378
|
title: toolbarTitle,
|
package/dist/esm/ui/toolbar.js
CHANGED
|
@@ -381,8 +381,12 @@ export var getToolbarConfig = function getToolbarConfig(getEditorContainerWidth,
|
|
|
381
381
|
}
|
|
382
382
|
var isTableOrColumnResizing = !!(resizeState !== null && resizeState !== void 0 && resizeState.dragging || tableWidthState !== null && tableWidthState !== void 0 && tableWidthState.resizing);
|
|
383
383
|
var isTableMenuOpened = pluginState.isContextualMenuOpen || isDragHandleMenuOpened;
|
|
384
|
+
var isTableState = isTableRowOrColumnDragged || isTableOrColumnResizing || isTableMenuOpened;
|
|
384
385
|
var isViewMode = (api === null || api === void 0 || (_api$editorViewMode = api.editorViewMode) === null || _api$editorViewMode === void 0 || (_api$editorViewMode = _api$editorViewMode.sharedState.currentState()) === null || _api$editorViewMode === void 0 ? void 0 : _api$editorViewMode.mode) === 'view';
|
|
385
|
-
|
|
386
|
+
|
|
387
|
+
// Note: when focus is in codeblocks, pluginState.editorHasFocus is false, so the codeblocks toolbar
|
|
388
|
+
// won't be suppressed.
|
|
389
|
+
var shouldSuppressAllToolbars = isTableState && pluginState.editorHasFocus && !isViewMode;
|
|
386
390
|
if (shouldSuppressAllToolbars) {
|
|
387
391
|
return {
|
|
388
392
|
title: toolbarTitle,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "10.6.
|
|
3
|
+
"version": "10.6.11",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@atlaskit/editor-plugin-batch-attribute-updates": "^2.1.0",
|
|
40
40
|
"@atlaskit/editor-plugin-content-insertion": "^2.1.0",
|
|
41
41
|
"@atlaskit/editor-plugin-editor-viewmode": "^3.0.0",
|
|
42
|
-
"@atlaskit/editor-plugin-extension": "5.2.
|
|
42
|
+
"@atlaskit/editor-plugin-extension": "5.2.3",
|
|
43
43
|
"@atlaskit/editor-plugin-guideline": "^2.0.0",
|
|
44
44
|
"@atlaskit/editor-plugin-selection": "^2.1.0",
|
|
45
45
|
"@atlaskit/editor-plugin-width": "^3.0.0",
|
package/src/ui/toolbar.tsx
CHANGED
|
@@ -508,14 +508,13 @@ export const getToolbarConfig =
|
|
|
508
508
|
|
|
509
509
|
const isTableOrColumnResizing = !!(resizeState?.dragging || tableWidthState?.resizing);
|
|
510
510
|
const isTableMenuOpened = pluginState.isContextualMenuOpen || isDragHandleMenuOpened;
|
|
511
|
+
const isTableState =
|
|
512
|
+
isTableRowOrColumnDragged || isTableOrColumnResizing || isTableMenuOpened;
|
|
511
513
|
const isViewMode = api?.editorViewMode?.sharedState.currentState()?.mode === 'view';
|
|
512
514
|
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
isTableOrColumnResizing ||
|
|
517
|
-
isTableRowOrColumnDragged;
|
|
518
|
-
|
|
515
|
+
// Note: when focus is in codeblocks, pluginState.editorHasFocus is false, so the codeblocks toolbar
|
|
516
|
+
// won't be suppressed.
|
|
517
|
+
const shouldSuppressAllToolbars = isTableState && pluginState.editorHasFocus && !isViewMode;
|
|
519
518
|
if (shouldSuppressAllToolbars) {
|
|
520
519
|
return {
|
|
521
520
|
title: toolbarTitle,
|