@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 +6 -0
- package/dist/cjs/steps/index.js +5 -5
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/es2019/steps/index.js +5 -5
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/esm/steps/index.js +5 -5
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/package.json +1 -1
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
|
package/dist/cjs/steps/index.js
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
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.
|
|
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
|
|
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
|
|
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
|
|
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.
|
|
39
|
+
const packageVersion = "109.12.3";
|
|
40
40
|
export class Renderer extends PureComponent {
|
|
41
41
|
constructor(props) {
|
|
42
42
|
super(props);
|
package/dist/esm/steps/index.js
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
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.
|
|
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);
|