@atlaskit/renderer 109.12.2 → 109.12.3

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/renderer
2
2
 
3
+ ## 109.12.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#85984](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/85984) [`3689328bd7c4`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3689328bd7c4) - Fix resolvePos for renderer TextHighlight
8
+
3
9
  ## 109.12.2
4
10
 
5
11
  ### Patch Changes
@@ -41,7 +41,7 @@ function isTextNode(node) {
41
41
  }
42
42
  function isHighlightTextNode(node) {
43
43
  var _dataset;
44
- return !!((_dataset = node.dataset) !== null && _dataset !== void 0 && _dataset.highlighted);
44
+ return !!(node !== null && node !== void 0 && (_dataset = node.dataset) !== null && _dataset !== void 0 && _dataset.highlighted);
45
45
  }
46
46
  function isNodeInlineMark(node) {
47
47
  return isElementNode(node) && Boolean(node.dataset.rendererMark);
@@ -70,7 +70,7 @@ function isRoot(element) {
70
70
  return !!element && element.classList.contains('ak-renderer-document');
71
71
  }
72
72
  function resolvePos(node, offset) {
73
- // If the passed node doesnt exist, we should abort
73
+ // If the passed node doesn't exist, we should abort
74
74
  if (!node) {
75
75
  return false;
76
76
  }
@@ -88,12 +88,12 @@ function resolvePos(node, offset) {
88
88
  var current = node;
89
89
  if (current.parentElement && current.parentElement !== parent) {
90
90
  // Find the parent element that is a direct child of the position pointer
91
- // the outter most element from our text position.
91
+ // the outer most element from our text position.
92
92
  var preParentPointer = findParentBeforePointer(current.parentElement);
93
93
  // If our range is inside an inline node
94
94
  // We need to move our pointers to parent element
95
- // since we dont want to count text inside inline nodes at all
96
- if (!isElementInlineMark(preParentPointer)) {
95
+ // since we don't want to count text inside inline nodes at all
96
+ if (!(isElementInlineMark(preParentPointer) || isHighlightTextNode(preParentPointer))) {
97
97
  current = current.parentElement;
98
98
  offset = 0;
99
99
  }
@@ -55,7 +55,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
55
55
  var NORMAL_SEVERITY_THRESHOLD = exports.NORMAL_SEVERITY_THRESHOLD = 2000;
56
56
  var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
57
57
  var packageName = "@atlaskit/renderer";
58
- var packageVersion = "109.12.2";
58
+ var packageVersion = "109.12.3";
59
59
  var Renderer = exports.Renderer = /*#__PURE__*/function (_PureComponent) {
60
60
  (0, _inherits2.default)(Renderer, _PureComponent);
61
61
  var _super = _createSuper(Renderer);
@@ -37,7 +37,7 @@ function isTextNode(node) {
37
37
  }
38
38
  function isHighlightTextNode(node) {
39
39
  var _dataset;
40
- return !!((_dataset = node.dataset) !== null && _dataset !== void 0 && _dataset.highlighted);
40
+ return !!(node !== null && node !== void 0 && (_dataset = node.dataset) !== null && _dataset !== void 0 && _dataset.highlighted);
41
41
  }
42
42
  function isNodeInlineMark(node) {
43
43
  return isElementNode(node) && Boolean(node.dataset.rendererMark);
@@ -66,7 +66,7 @@ function isRoot(element) {
66
66
  return !!element && element.classList.contains('ak-renderer-document');
67
67
  }
68
68
  export function resolvePos(node, offset) {
69
- // If the passed node doesnt exist, we should abort
69
+ // If the passed node doesn't exist, we should abort
70
70
  if (!node) {
71
71
  return false;
72
72
  }
@@ -84,12 +84,12 @@ export function resolvePos(node, offset) {
84
84
  let current = node;
85
85
  if (current.parentElement && current.parentElement !== parent) {
86
86
  // Find the parent element that is a direct child of the position pointer
87
- // the outter most element from our text position.
87
+ // the outer most element from our text position.
88
88
  const preParentPointer = findParentBeforePointer(current.parentElement);
89
89
  // If our range is inside an inline node
90
90
  // We need to move our pointers to parent element
91
- // since we dont want to count text inside inline nodes at all
92
- if (!isElementInlineMark(preParentPointer)) {
91
+ // since we don't want to count text inside inline nodes at all
92
+ if (!(isElementInlineMark(preParentPointer) || isHighlightTextNode(preParentPointer))) {
93
93
  current = current.parentElement;
94
94
  offset = 0;
95
95
  }
@@ -36,7 +36,7 @@ import { EditorMediaClientProvider } from '../../react/utils/EditorMediaClientPr
36
36
  export const NORMAL_SEVERITY_THRESHOLD = 2000;
37
37
  export const DEGRADED_SEVERITY_THRESHOLD = 3000;
38
38
  const packageName = "@atlaskit/renderer";
39
- const packageVersion = "109.12.2";
39
+ const packageVersion = "109.12.3";
40
40
  export class Renderer extends PureComponent {
41
41
  constructor(props) {
42
42
  super(props);
@@ -33,7 +33,7 @@ function isTextNode(node) {
33
33
  }
34
34
  function isHighlightTextNode(node) {
35
35
  var _dataset;
36
- return !!((_dataset = node.dataset) !== null && _dataset !== void 0 && _dataset.highlighted);
36
+ return !!(node !== null && node !== void 0 && (_dataset = node.dataset) !== null && _dataset !== void 0 && _dataset.highlighted);
37
37
  }
38
38
  function isNodeInlineMark(node) {
39
39
  return isElementNode(node) && Boolean(node.dataset.rendererMark);
@@ -62,7 +62,7 @@ function isRoot(element) {
62
62
  return !!element && element.classList.contains('ak-renderer-document');
63
63
  }
64
64
  export function resolvePos(node, offset) {
65
- // If the passed node doesnt exist, we should abort
65
+ // If the passed node doesn't exist, we should abort
66
66
  if (!node) {
67
67
  return false;
68
68
  }
@@ -80,12 +80,12 @@ export function resolvePos(node, offset) {
80
80
  var current = node;
81
81
  if (current.parentElement && current.parentElement !== parent) {
82
82
  // Find the parent element that is a direct child of the position pointer
83
- // the outter most element from our text position.
83
+ // the outer most element from our text position.
84
84
  var preParentPointer = findParentBeforePointer(current.parentElement);
85
85
  // If our range is inside an inline node
86
86
  // We need to move our pointers to parent element
87
- // since we dont want to count text inside inline nodes at all
88
- if (!isElementInlineMark(preParentPointer)) {
87
+ // since we don't want to count text inside inline nodes at all
88
+ if (!(isElementInlineMark(preParentPointer) || isHighlightTextNode(preParentPointer))) {
89
89
  current = current.parentElement;
90
90
  offset = 0;
91
91
  }
@@ -46,7 +46,7 @@ import { EditorMediaClientProvider } from '../../react/utils/EditorMediaClientPr
46
46
  export var NORMAL_SEVERITY_THRESHOLD = 2000;
47
47
  export var DEGRADED_SEVERITY_THRESHOLD = 3000;
48
48
  var packageName = "@atlaskit/renderer";
49
- var packageVersion = "109.12.2";
49
+ var packageVersion = "109.12.3";
50
50
  export var Renderer = /*#__PURE__*/function (_PureComponent) {
51
51
  _inherits(Renderer, _PureComponent);
52
52
  var _super = _createSuper(Renderer);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "109.12.2",
3
+ "version": "109.12.3",
4
4
  "description": "Renderer component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"