@atlaskit/editor-core 187.3.4 → 187.3.5

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-core
2
2
 
3
+ ## 187.3.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [`f10d32545d2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f10d32545d2) - Fix bug where clicking anything in column picker inside Datasource table triggers editor focus toggling
8
+
3
9
  ## 187.3.4
4
10
 
5
11
  ### Patch Changes
@@ -74,12 +74,15 @@ var clickAreaClickHandler = function clickAreaClickHandler(view, event) {
74
74
  var isButtonClicked = Boolean((0, _dom.closestElement)(event.currentTarget, 'button')) || Boolean((0, _dom.closestElement)(target, 'button')) || ((_event$currentTarget = event.currentTarget) === null || _event$currentTarget === void 0 ? void 0 : _event$currentTarget.nodeName) === 'BUTTON' || target.nodeName === 'BUTTON';
75
75
  var isTargetInsideContentArea = Boolean(isTargetChildOfContentArea);
76
76
  var isBetweenContentAreaAndEditableContent = isTargetInsideContentArea && !isTargetInsideEditableArea;
77
+
78
+ // Column Picker dropdown in Datasources table
79
+ var isDatasourcePopupClicked = !!(target !== null && target !== void 0 && target.closest('#column-picker-popup'));
77
80
  var edgeCaseScenario1 = (isBetweenContentAreaAndEditableContent || !isEventComingFromContentArea) && !isEditorFocused;
78
81
  var edgeCaseScenario2 = !isTargetInsideContentArea && isEditorFocused;
79
82
  var edgeCaseScenario3 = isTargetContentArea && !isTargetInsideContentArea && !isEditorFocused;
80
83
  var edgeCaseScenario4 = isEventComingFromContentArea && !isTargetContentArea && !isTargetInsideContentArea && !isEditorFocused;
81
84
  var edgeCases = edgeCaseScenario1 || edgeCaseScenario2 || edgeCaseScenario3 || edgeCaseScenario4;
82
- var isClickOutsideEditor = edgeCases && !isEventComingFromInlineCommentPopup && !isButtonClicked && !isInputClicked && !isTextAreaClicked && !isPopupClicked && !isBreadcrumbClicked && !isEditorPopupTextSelected && checkForModal(target);
85
+ var isClickOutsideEditor = edgeCases && !isDatasourcePopupClicked && !isEventComingFromInlineCommentPopup && !isButtonClicked && !isInputClicked && !isTextAreaClicked && !isPopupClicked && !isBreadcrumbClicked && !isEditorPopupTextSelected && checkForModal(target);
83
86
 
84
87
  // click was within editor container and focus should be brought to input
85
88
  if (isClickOutsideEditor && view) {
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.version = exports.nextMajorVersion = exports.name = void 0;
7
7
  var name = "@atlaskit/editor-core";
8
8
  exports.name = name;
9
- var version = "187.3.4";
9
+ var version = "187.3.5";
10
10
  exports.version = version;
11
11
  var nextMajorVersion = function nextMajorVersion() {
12
12
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "187.3.4",
3
+ "version": "187.3.5",
4
4
  "sideEffects": false
5
5
  }
@@ -68,12 +68,15 @@ const clickAreaClickHandler = (view, event) => {
68
68
  const isButtonClicked = Boolean(closestElement(event.currentTarget, 'button')) || Boolean(closestElement(target, 'button')) || ((_event$currentTarget = event.currentTarget) === null || _event$currentTarget === void 0 ? void 0 : _event$currentTarget.nodeName) === 'BUTTON' || target.nodeName === 'BUTTON';
69
69
  const isTargetInsideContentArea = Boolean(isTargetChildOfContentArea);
70
70
  const isBetweenContentAreaAndEditableContent = isTargetInsideContentArea && !isTargetInsideEditableArea;
71
+
72
+ // Column Picker dropdown in Datasources table
73
+ const isDatasourcePopupClicked = !!(target !== null && target !== void 0 && target.closest('#column-picker-popup'));
71
74
  const edgeCaseScenario1 = (isBetweenContentAreaAndEditableContent || !isEventComingFromContentArea) && !isEditorFocused;
72
75
  const edgeCaseScenario2 = !isTargetInsideContentArea && isEditorFocused;
73
76
  const edgeCaseScenario3 = isTargetContentArea && !isTargetInsideContentArea && !isEditorFocused;
74
77
  const edgeCaseScenario4 = isEventComingFromContentArea && !isTargetContentArea && !isTargetInsideContentArea && !isEditorFocused;
75
78
  const edgeCases = edgeCaseScenario1 || edgeCaseScenario2 || edgeCaseScenario3 || edgeCaseScenario4;
76
- const isClickOutsideEditor = edgeCases && !isEventComingFromInlineCommentPopup && !isButtonClicked && !isInputClicked && !isTextAreaClicked && !isPopupClicked && !isBreadcrumbClicked && !isEditorPopupTextSelected && checkForModal(target);
79
+ const isClickOutsideEditor = edgeCases && !isDatasourcePopupClicked && !isEventComingFromInlineCommentPopup && !isButtonClicked && !isInputClicked && !isTextAreaClicked && !isPopupClicked && !isBreadcrumbClicked && !isEditorPopupTextSelected && checkForModal(target);
77
80
 
78
81
  // click was within editor container and focus should be brought to input
79
82
  if (isClickOutsideEditor && view) {
@@ -1,5 +1,5 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "187.3.4";
2
+ export const version = "187.3.5";
3
3
  export const nextMajorVersion = () => {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "187.3.4",
3
+ "version": "187.3.5",
4
4
  "sideEffects": false
5
5
  }
@@ -68,12 +68,15 @@ var clickAreaClickHandler = function clickAreaClickHandler(view, event) {
68
68
  var isButtonClicked = Boolean(closestElement(event.currentTarget, 'button')) || Boolean(closestElement(target, 'button')) || ((_event$currentTarget = event.currentTarget) === null || _event$currentTarget === void 0 ? void 0 : _event$currentTarget.nodeName) === 'BUTTON' || target.nodeName === 'BUTTON';
69
69
  var isTargetInsideContentArea = Boolean(isTargetChildOfContentArea);
70
70
  var isBetweenContentAreaAndEditableContent = isTargetInsideContentArea && !isTargetInsideEditableArea;
71
+
72
+ // Column Picker dropdown in Datasources table
73
+ var isDatasourcePopupClicked = !!(target !== null && target !== void 0 && target.closest('#column-picker-popup'));
71
74
  var edgeCaseScenario1 = (isBetweenContentAreaAndEditableContent || !isEventComingFromContentArea) && !isEditorFocused;
72
75
  var edgeCaseScenario2 = !isTargetInsideContentArea && isEditorFocused;
73
76
  var edgeCaseScenario3 = isTargetContentArea && !isTargetInsideContentArea && !isEditorFocused;
74
77
  var edgeCaseScenario4 = isEventComingFromContentArea && !isTargetContentArea && !isTargetInsideContentArea && !isEditorFocused;
75
78
  var edgeCases = edgeCaseScenario1 || edgeCaseScenario2 || edgeCaseScenario3 || edgeCaseScenario4;
76
- var isClickOutsideEditor = edgeCases && !isEventComingFromInlineCommentPopup && !isButtonClicked && !isInputClicked && !isTextAreaClicked && !isPopupClicked && !isBreadcrumbClicked && !isEditorPopupTextSelected && checkForModal(target);
79
+ var isClickOutsideEditor = edgeCases && !isDatasourcePopupClicked && !isEventComingFromInlineCommentPopup && !isButtonClicked && !isInputClicked && !isTextAreaClicked && !isPopupClicked && !isBreadcrumbClicked && !isEditorPopupTextSelected && checkForModal(target);
77
80
 
78
81
  // click was within editor container and focus should be brought to input
79
82
  if (isClickOutsideEditor && view) {
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "187.3.4";
2
+ export var version = "187.3.5";
3
3
  export var nextMajorVersion = function nextMajorVersion() {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "187.3.4",
3
+ "version": "187.3.5",
4
4
  "sideEffects": false
5
5
  }
@@ -1,4 +1,4 @@
1
- import { EditorView } from 'prosemirror-view';
1
+ import type { EditorView } from 'prosemirror-view';
2
2
  /**
3
3
  * @see ED-14699 - check if editor is inside a modal to continue to bring cursor to input when
4
4
  * any part of the editor container is clicked
@@ -1,4 +1,4 @@
1
- import { EditorView } from 'prosemirror-view';
1
+ import type { EditorView } from 'prosemirror-view';
2
2
  /**
3
3
  * @see ED-14699 - check if editor is inside a modal to continue to bring cursor to input when
4
4
  * any part of the editor container is clicked
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "187.3.4",
3
+ "version": "187.3.5",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"