@atlaskit/renderer 114.7.3 → 114.7.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 +16 -0
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/cjs/ui/annotations/hooks/user-selection.js +21 -24
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/es2019/ui/annotations/hooks/user-selection.js +23 -26
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/dist/esm/ui/annotations/hooks/user-selection.js +21 -24
- package/package.json +3 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 114.7.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 114.7.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#136939](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/136939)
|
|
14
|
+
[`960086975117b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/960086975117b) -
|
|
15
|
+
EDITOR-566 Cleaned up platform_editor_allow_annotation_triple_click and defaulted to true
|
|
16
|
+
behaviour.
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 114.7.3
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -67,7 +67,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
67
67
|
var NORMAL_SEVERITY_THRESHOLD = exports.NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
68
68
|
var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
69
69
|
var packageName = "@atlaskit/renderer";
|
|
70
|
-
var packageVersion = "114.7.
|
|
70
|
+
var packageVersion = "114.7.5";
|
|
71
71
|
var setAsQueryContainerStyles = (0, _react2.css)({
|
|
72
72
|
containerName: 'ak-renderer-wrapper',
|
|
73
73
|
containerType: 'inline-size',
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.useUserSelectionRange = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
9
8
|
var _AnnotationRangeContext = require("../contexts/AnnotationRangeContext");
|
|
10
9
|
var _utils = require("./utils");
|
|
11
10
|
var _steps = require("../../../steps");
|
|
@@ -34,33 +33,31 @@ var useUserSelectionRange = exports.useUserSelectionRange = function useUserSele
|
|
|
34
33
|
}
|
|
35
34
|
var _range = sel.getRangeAt(0);
|
|
36
35
|
if (rendererDOM && (0, _utils.isRangeInsideOfRendererContainer)(rendererDOM, _range)) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
var parentNode = startContainer.parentNode;
|
|
36
|
+
var startContainer = _range.startContainer,
|
|
37
|
+
endContainer = _range.endContainer,
|
|
38
|
+
commonAncestorContainer = _range.commonAncestorContainer;
|
|
39
|
+
var parentNode = startContainer.parentNode;
|
|
42
40
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
// ED-23493
|
|
42
|
+
// On triple-click in Chrome and Safari, the native Selection API's range has endContainer as a non-text node
|
|
43
|
+
// and commonAncestorContainer as root level div.ak-renderer-document when the node is followed by div or hr.
|
|
46
44
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
// Triple clicks are the only case that can cause the endContainer to be a non-text node
|
|
46
|
+
// Same check for highlight range logic in confluence/next/packages/comments-util/src/domUtils.ts Line 180
|
|
47
|
+
var isTripleClick = endContainer.nodeType !== Node.TEXT_NODE;
|
|
50
48
|
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
// isAnnotationAllowedOnRange range validation is checking if the parent container is root element and disable the comment if it is.
|
|
50
|
+
// platform/packages/editor/renderer/src/steps/index.ts Line 180
|
|
53
51
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
52
|
+
// This workaround ensures the endContainer is set to a text node when endContainer is non-text and the parent container is the root element
|
|
53
|
+
if (isTripleClick && commonAncestorContainer && commonAncestorContainer.nodeType === Node.ELEMENT_NODE &&
|
|
54
|
+
// Ignored via go/ees005
|
|
55
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
56
|
+
(0, _steps.isRoot)(commonAncestorContainer) && (parentNode === null || parentNode === void 0 ? void 0 : parentNode.nodeName) === 'P' // ignore if the parent node is strong, em, etc.
|
|
57
|
+
) {
|
|
58
|
+
var _parentNode$lastChild, _parentNode$lastChild2;
|
|
59
|
+
var lastChild = parentNode !== null && parentNode !== void 0 && parentNode.lastChild && (parentNode === null || parentNode === void 0 || (_parentNode$lastChild = parentNode.lastChild) === null || _parentNode$lastChild === void 0 ? void 0 : _parentNode$lastChild.nodeType) === Node.TEXT_NODE ? parentNode === null || parentNode === void 0 ? void 0 : parentNode.lastChild : parentNode === null || parentNode === void 0 || (_parentNode$lastChild2 = parentNode.lastChild) === null || _parentNode$lastChild2 === void 0 ? void 0 : _parentNode$lastChild2.childNodes[0];
|
|
60
|
+
_range.setEnd(lastChild, lastChild.length || 0);
|
|
64
61
|
}
|
|
65
62
|
setRange(_range.cloneRange());
|
|
66
63
|
}
|
|
@@ -48,7 +48,7 @@ import { removeEmptySpaceAroundContent } from './rendererHelper';
|
|
|
48
48
|
export const NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
49
49
|
export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
50
50
|
const packageName = "@atlaskit/renderer";
|
|
51
|
-
const packageVersion = "114.7.
|
|
51
|
+
const packageVersion = "114.7.5";
|
|
52
52
|
const setAsQueryContainerStyles = css({
|
|
53
53
|
containerName: 'ak-renderer-wrapper',
|
|
54
54
|
containerType: 'inline-size',
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { useEffect, useRef } from 'react';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
2
|
import { useAnnotationRangeDispatch, useAnnotationRangeState } from '../contexts/AnnotationRangeContext';
|
|
4
3
|
import { isRangeInsideOfRendererContainer } from './utils';
|
|
5
4
|
import { isRoot } from '../../../steps';
|
|
@@ -34,35 +33,33 @@ export const useUserSelectionRange = props => {
|
|
|
34
33
|
}
|
|
35
34
|
const _range = sel.getRangeAt(0);
|
|
36
35
|
if (rendererDOM && isRangeInsideOfRendererContainer(rendererDOM, _range)) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const parentNode = startContainer.parentNode;
|
|
36
|
+
const {
|
|
37
|
+
startContainer,
|
|
38
|
+
endContainer,
|
|
39
|
+
commonAncestorContainer
|
|
40
|
+
} = _range;
|
|
41
|
+
const parentNode = startContainer.parentNode;
|
|
44
42
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
// ED-23493
|
|
44
|
+
// On triple-click in Chrome and Safari, the native Selection API's range has endContainer as a non-text node
|
|
45
|
+
// and commonAncestorContainer as root level div.ak-renderer-document when the node is followed by div or hr.
|
|
48
46
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
// Triple clicks are the only case that can cause the endContainer to be a non-text node
|
|
48
|
+
// Same check for highlight range logic in confluence/next/packages/comments-util/src/domUtils.ts Line 180
|
|
49
|
+
const isTripleClick = endContainer.nodeType !== Node.TEXT_NODE;
|
|
52
50
|
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
// isAnnotationAllowedOnRange range validation is checking if the parent container is root element and disable the comment if it is.
|
|
52
|
+
// platform/packages/editor/renderer/src/steps/index.ts Line 180
|
|
55
53
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
54
|
+
// This workaround ensures the endContainer is set to a text node when endContainer is non-text and the parent container is the root element
|
|
55
|
+
if (isTripleClick && commonAncestorContainer && commonAncestorContainer.nodeType === Node.ELEMENT_NODE &&
|
|
56
|
+
// Ignored via go/ees005
|
|
57
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
58
|
+
isRoot(commonAncestorContainer) && (parentNode === null || parentNode === void 0 ? void 0 : parentNode.nodeName) === 'P' // ignore if the parent node is strong, em, etc.
|
|
59
|
+
) {
|
|
60
|
+
var _parentNode$lastChild, _parentNode$lastChild2;
|
|
61
|
+
const lastChild = parentNode !== null && parentNode !== void 0 && parentNode.lastChild && (parentNode === null || parentNode === void 0 ? void 0 : (_parentNode$lastChild = parentNode.lastChild) === null || _parentNode$lastChild === void 0 ? void 0 : _parentNode$lastChild.nodeType) === Node.TEXT_NODE ? parentNode === null || parentNode === void 0 ? void 0 : parentNode.lastChild : parentNode === null || parentNode === void 0 ? void 0 : (_parentNode$lastChild2 = parentNode.lastChild) === null || _parentNode$lastChild2 === void 0 ? void 0 : _parentNode$lastChild2.childNodes[0];
|
|
62
|
+
_range.setEnd(lastChild, lastChild.length || 0);
|
|
66
63
|
}
|
|
67
64
|
setRange(_range.cloneRange());
|
|
68
65
|
}
|
|
@@ -57,7 +57,7 @@ import { removeEmptySpaceAroundContent } from './rendererHelper';
|
|
|
57
57
|
export var NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
58
58
|
export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
59
59
|
var packageName = "@atlaskit/renderer";
|
|
60
|
-
var packageVersion = "114.7.
|
|
60
|
+
var packageVersion = "114.7.5";
|
|
61
61
|
var setAsQueryContainerStyles = css({
|
|
62
62
|
containerName: 'ak-renderer-wrapper',
|
|
63
63
|
containerType: 'inline-size',
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { useEffect, useRef } from 'react';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
2
|
import { useAnnotationRangeDispatch, useAnnotationRangeState } from '../contexts/AnnotationRangeContext';
|
|
4
3
|
import { isRangeInsideOfRendererContainer } from './utils';
|
|
5
4
|
import { isRoot } from '../../../steps';
|
|
@@ -28,33 +27,31 @@ export var useUserSelectionRange = function useUserSelectionRange(props) {
|
|
|
28
27
|
}
|
|
29
28
|
var _range = sel.getRangeAt(0);
|
|
30
29
|
if (rendererDOM && isRangeInsideOfRendererContainer(rendererDOM, _range)) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
var parentNode = startContainer.parentNode;
|
|
30
|
+
var startContainer = _range.startContainer,
|
|
31
|
+
endContainer = _range.endContainer,
|
|
32
|
+
commonAncestorContainer = _range.commonAncestorContainer;
|
|
33
|
+
var parentNode = startContainer.parentNode;
|
|
36
34
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
// ED-23493
|
|
36
|
+
// On triple-click in Chrome and Safari, the native Selection API's range has endContainer as a non-text node
|
|
37
|
+
// and commonAncestorContainer as root level div.ak-renderer-document when the node is followed by div or hr.
|
|
40
38
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
// Triple clicks are the only case that can cause the endContainer to be a non-text node
|
|
40
|
+
// Same check for highlight range logic in confluence/next/packages/comments-util/src/domUtils.ts Line 180
|
|
41
|
+
var isTripleClick = endContainer.nodeType !== Node.TEXT_NODE;
|
|
44
42
|
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
// isAnnotationAllowedOnRange range validation is checking if the parent container is root element and disable the comment if it is.
|
|
44
|
+
// platform/packages/editor/renderer/src/steps/index.ts Line 180
|
|
47
45
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
46
|
+
// This workaround ensures the endContainer is set to a text node when endContainer is non-text and the parent container is the root element
|
|
47
|
+
if (isTripleClick && commonAncestorContainer && commonAncestorContainer.nodeType === Node.ELEMENT_NODE &&
|
|
48
|
+
// Ignored via go/ees005
|
|
49
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
50
|
+
isRoot(commonAncestorContainer) && (parentNode === null || parentNode === void 0 ? void 0 : parentNode.nodeName) === 'P' // ignore if the parent node is strong, em, etc.
|
|
51
|
+
) {
|
|
52
|
+
var _parentNode$lastChild, _parentNode$lastChild2;
|
|
53
|
+
var lastChild = parentNode !== null && parentNode !== void 0 && parentNode.lastChild && (parentNode === null || parentNode === void 0 || (_parentNode$lastChild = parentNode.lastChild) === null || _parentNode$lastChild === void 0 ? void 0 : _parentNode$lastChild.nodeType) === Node.TEXT_NODE ? parentNode === null || parentNode === void 0 ? void 0 : parentNode.lastChild : parentNode === null || parentNode === void 0 || (_parentNode$lastChild2 = parentNode.lastChild) === null || _parentNode$lastChild2 === void 0 ? void 0 : _parentNode$lastChild2.childNodes[0];
|
|
54
|
+
_range.setEnd(lastChild, lastChild.length || 0);
|
|
58
55
|
}
|
|
59
56
|
setRange(_range.cloneRange());
|
|
60
57
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "114.7.
|
|
3
|
+
"version": "114.7.5",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@atlaskit/analytics-next": "^11.0.0",
|
|
32
32
|
"@atlaskit/button": "^23.0.0",
|
|
33
33
|
"@atlaskit/code": "^17.0.0",
|
|
34
|
-
"@atlaskit/editor-common": "^
|
|
34
|
+
"@atlaskit/editor-common": "^103.0.0",
|
|
35
35
|
"@atlaskit/editor-json-transformer": "^8.24.0",
|
|
36
36
|
"@atlaskit/editor-palette": "^2.1.0",
|
|
37
37
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@atlaskit/task-decision": "^19.1.0",
|
|
56
56
|
"@atlaskit/theme": "^18.0.0",
|
|
57
57
|
"@atlaskit/tmp-editor-statsig": "^4.6.0",
|
|
58
|
-
"@atlaskit/tokens": "^4.
|
|
58
|
+
"@atlaskit/tokens": "^4.7.0",
|
|
59
59
|
"@atlaskit/tooltip": "^20.0.0",
|
|
60
60
|
"@atlaskit/visually-hidden": "^3.0.0",
|
|
61
61
|
"@babel/runtime": "^7.0.0",
|
|
@@ -141,9 +141,6 @@
|
|
|
141
141
|
"platform-fix-table-ssr-resizing": {
|
|
142
142
|
"type": "boolean"
|
|
143
143
|
},
|
|
144
|
-
"platform_editor_allow_annotation_triple_click": {
|
|
145
|
-
"type": "boolean"
|
|
146
|
-
},
|
|
147
144
|
"platform-component-visual-refresh": {
|
|
148
145
|
"type": "boolean"
|
|
149
146
|
},
|