@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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 10.6.11
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
3
9
  ## 10.6.10
4
10
 
5
11
  ### Patch Changes
@@ -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
- var shouldSuppressAllToolbars = !pluginState.editorHasFocus && !isViewMode || isTableMenuOpened || isTableOrColumnResizing || isTableRowOrColumnDragged;
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
- const shouldSuppressAllToolbars = !pluginState.editorHasFocus && !isViewMode || isTableMenuOpened || isTableOrColumnResizing || isTableRowOrColumnDragged;
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,
@@ -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
- var shouldSuppressAllToolbars = !pluginState.editorHasFocus && !isViewMode || isTableMenuOpened || isTableOrColumnResizing || isTableRowOrColumnDragged;
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.10",
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.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",
@@ -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
- const shouldSuppressAllToolbars =
514
- (!pluginState.editorHasFocus && !isViewMode) ||
515
- isTableMenuOpened ||
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,