@atlaskit/renderer 133.8.2 → 133.8.4
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 +15 -0
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/cjs/ui/annotations/hooks/user-selection.js +17 -1
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/es2019/ui/annotations/hooks/user-selection.js +17 -1
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/dist/esm/ui/annotations/hooks/user-selection.js +17 -1
- package/package.json +22 -29
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 133.8.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`f6f7aba52cfe3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f6f7aba52cfe3) -
|
|
8
|
+
Register `confluence_comment_nudgebar_improvement` experiment and skip selection debounce during
|
|
9
|
+
nudge button clicks to ensure first-click comment draft creation works correctly.
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 133.8.3
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 133.8.2
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -72,7 +72,7 @@ var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
72
72
|
var TABLE_INFO_TIMEOUT = 10000;
|
|
73
73
|
var RENDER_EVENT_SAMPLE_RATE = 0.2;
|
|
74
74
|
var packageName = "@atlaskit/renderer";
|
|
75
|
-
var packageVersion = "133.8.
|
|
75
|
+
var packageVersion = "133.8.4";
|
|
76
76
|
var setAsQueryContainerStyles = (0, _react2.css)({
|
|
77
77
|
containerName: 'ak-renderer-wrapper',
|
|
78
78
|
containerType: 'inline-size'
|
|
@@ -8,6 +8,7 @@ var _react = require("react");
|
|
|
8
8
|
var _AnnotationRangeContext = require("../contexts/AnnotationRangeContext");
|
|
9
9
|
var _utils = require("./utils");
|
|
10
10
|
var _AnnotationManagerContext = require("../contexts/AnnotationManagerContext");
|
|
11
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
11
12
|
var useUserSelectionRange = exports.useUserSelectionRange = function useUserSelectionRange(props) {
|
|
12
13
|
var rendererDOM = props.rendererRef.current;
|
|
13
14
|
var selectionTimeoutRef = (0, _react.useRef)();
|
|
@@ -23,9 +24,24 @@ var useUserSelectionRange = exports.useUserSelectionRange = function useUserSele
|
|
|
23
24
|
var lastRangeRef = (0, _react.useRef)(null);
|
|
24
25
|
var isAnnotationManagerEnabled = !!annotationManager;
|
|
25
26
|
var onSelectionChange = (0, _react.useCallback)(function (_event) {
|
|
27
|
+
var _document$body;
|
|
26
28
|
if (selectionTimeoutRef.current) {
|
|
27
29
|
clearTimeout(selectionTimeoutRef.current);
|
|
28
30
|
}
|
|
31
|
+
|
|
32
|
+
/*
|
|
33
|
+
* The 100ms debounce batches rapid `selectionchange` events during user drag/extend
|
|
34
|
+
* operations into a single React update. When the nudge button triggers a programmatic
|
|
35
|
+
* `addRange`, it fires exactly ONE `selectionchange` — no batching needed. Skipping the
|
|
36
|
+
* debounce ensures annotation position is computed synchronously so the first click
|
|
37
|
+
* applies the yellow highlight immediately. `data-nudge-selection-active` is set
|
|
38
|
+
* exclusively by the Confluence comment nudge feature and is double-gated:
|
|
39
|
+
* (1) `expValEquals('confluence_comment_nudgebar_improvement', ...)` — explicit experiment
|
|
40
|
+
* gate; (2) `data-nudge-selection-active` — ensures 0ms only fires during an actual nudge
|
|
41
|
+
* click, not on every selectionchange for experiment-ON users. Zero behavioral change for
|
|
42
|
+
* other products or experiment-OFF users.
|
|
43
|
+
*/
|
|
44
|
+
var nudgeDelay = typeof document !== 'undefined' && ((_document$body = document.body) === null || _document$body === void 0 ? void 0 : _document$body.getAttribute('data-nudge-selection-active')) === 'true' && (0, _expValEquals.expValEquals)('confluence_comment_nudgebar_improvement', 'isEnabled', true) ? 0 : 100;
|
|
29
45
|
selectionTimeoutRef.current = setTimeout(function () {
|
|
30
46
|
var sel = document.getSelection();
|
|
31
47
|
if (!sel || sel.type !== 'Range' || sel.rangeCount !== 1) {
|
|
@@ -62,7 +78,7 @@ var useUserSelectionRange = exports.useUserSelectionRange = function useUserSele
|
|
|
62
78
|
setSelectionRange(_range.cloneRange());
|
|
63
79
|
lastRangeRef.current = _range;
|
|
64
80
|
}
|
|
65
|
-
},
|
|
81
|
+
}, nudgeDelay);
|
|
66
82
|
}, [rendererDOM, setSelectionRange, clearSelectionRange, isAnnotationManagerEnabled]);
|
|
67
83
|
(0, _react.useEffect)(function () {
|
|
68
84
|
if (!document || !rendererDOM) {
|
|
@@ -58,7 +58,7 @@ export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
58
58
|
const TABLE_INFO_TIMEOUT = 10000;
|
|
59
59
|
const RENDER_EVENT_SAMPLE_RATE = 0.2;
|
|
60
60
|
const packageName = "@atlaskit/renderer";
|
|
61
|
-
const packageVersion = "133.8.
|
|
61
|
+
const packageVersion = "133.8.4";
|
|
62
62
|
const setAsQueryContainerStyles = css({
|
|
63
63
|
containerName: 'ak-renderer-wrapper',
|
|
64
64
|
containerType: 'inline-size'
|
|
@@ -2,6 +2,7 @@ import { useEffect, useRef, useCallback } from 'react';
|
|
|
2
2
|
import { useAnnotationRangeDispatch, useAnnotationRangeState } from '../contexts/AnnotationRangeContext';
|
|
3
3
|
import { isRangeInsideOfRendererContainer } from './utils';
|
|
4
4
|
import { useAnnotationManagerDispatch } from '../contexts/AnnotationManagerContext';
|
|
5
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
5
6
|
export const useUserSelectionRange = props => {
|
|
6
7
|
const {
|
|
7
8
|
rendererRef: {
|
|
@@ -24,9 +25,24 @@ export const useUserSelectionRange = props => {
|
|
|
24
25
|
const lastRangeRef = useRef(null);
|
|
25
26
|
const isAnnotationManagerEnabled = !!annotationManager;
|
|
26
27
|
const onSelectionChange = useCallback(_event => {
|
|
28
|
+
var _document$body;
|
|
27
29
|
if (selectionTimeoutRef.current) {
|
|
28
30
|
clearTimeout(selectionTimeoutRef.current);
|
|
29
31
|
}
|
|
32
|
+
|
|
33
|
+
/*
|
|
34
|
+
* The 100ms debounce batches rapid `selectionchange` events during user drag/extend
|
|
35
|
+
* operations into a single React update. When the nudge button triggers a programmatic
|
|
36
|
+
* `addRange`, it fires exactly ONE `selectionchange` — no batching needed. Skipping the
|
|
37
|
+
* debounce ensures annotation position is computed synchronously so the first click
|
|
38
|
+
* applies the yellow highlight immediately. `data-nudge-selection-active` is set
|
|
39
|
+
* exclusively by the Confluence comment nudge feature and is double-gated:
|
|
40
|
+
* (1) `expValEquals('confluence_comment_nudgebar_improvement', ...)` — explicit experiment
|
|
41
|
+
* gate; (2) `data-nudge-selection-active` — ensures 0ms only fires during an actual nudge
|
|
42
|
+
* click, not on every selectionchange for experiment-ON users. Zero behavioral change for
|
|
43
|
+
* other products or experiment-OFF users.
|
|
44
|
+
*/
|
|
45
|
+
const nudgeDelay = typeof document !== 'undefined' && ((_document$body = document.body) === null || _document$body === void 0 ? void 0 : _document$body.getAttribute('data-nudge-selection-active')) === 'true' && expValEquals('confluence_comment_nudgebar_improvement', 'isEnabled', true) ? 0 : 100;
|
|
30
46
|
selectionTimeoutRef.current = setTimeout(() => {
|
|
31
47
|
const sel = document.getSelection();
|
|
32
48
|
if (!sel || sel.type !== 'Range' || sel.rangeCount !== 1) {
|
|
@@ -64,7 +80,7 @@ export const useUserSelectionRange = props => {
|
|
|
64
80
|
setSelectionRange(_range.cloneRange());
|
|
65
81
|
lastRangeRef.current = _range;
|
|
66
82
|
}
|
|
67
|
-
},
|
|
83
|
+
}, nudgeDelay);
|
|
68
84
|
}, [rendererDOM, setSelectionRange, clearSelectionRange, isAnnotationManagerEnabled]);
|
|
69
85
|
useEffect(() => {
|
|
70
86
|
if (!document || !rendererDOM) {
|
|
@@ -63,7 +63,7 @@ export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
63
63
|
var TABLE_INFO_TIMEOUT = 10000;
|
|
64
64
|
var RENDER_EVENT_SAMPLE_RATE = 0.2;
|
|
65
65
|
var packageName = "@atlaskit/renderer";
|
|
66
|
-
var packageVersion = "133.8.
|
|
66
|
+
var packageVersion = "133.8.4";
|
|
67
67
|
var setAsQueryContainerStyles = css({
|
|
68
68
|
containerName: 'ak-renderer-wrapper',
|
|
69
69
|
containerType: 'inline-size'
|
|
@@ -2,6 +2,7 @@ import { useEffect, useRef, useCallback } from 'react';
|
|
|
2
2
|
import { useAnnotationRangeDispatch, useAnnotationRangeState } from '../contexts/AnnotationRangeContext';
|
|
3
3
|
import { isRangeInsideOfRendererContainer } from './utils';
|
|
4
4
|
import { useAnnotationManagerDispatch } from '../contexts/AnnotationManagerContext';
|
|
5
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
5
6
|
export var useUserSelectionRange = function useUserSelectionRange(props) {
|
|
6
7
|
var rendererDOM = props.rendererRef.current;
|
|
7
8
|
var selectionTimeoutRef = useRef();
|
|
@@ -17,9 +18,24 @@ export var useUserSelectionRange = function useUserSelectionRange(props) {
|
|
|
17
18
|
var lastRangeRef = useRef(null);
|
|
18
19
|
var isAnnotationManagerEnabled = !!annotationManager;
|
|
19
20
|
var onSelectionChange = useCallback(function (_event) {
|
|
21
|
+
var _document$body;
|
|
20
22
|
if (selectionTimeoutRef.current) {
|
|
21
23
|
clearTimeout(selectionTimeoutRef.current);
|
|
22
24
|
}
|
|
25
|
+
|
|
26
|
+
/*
|
|
27
|
+
* The 100ms debounce batches rapid `selectionchange` events during user drag/extend
|
|
28
|
+
* operations into a single React update. When the nudge button triggers a programmatic
|
|
29
|
+
* `addRange`, it fires exactly ONE `selectionchange` — no batching needed. Skipping the
|
|
30
|
+
* debounce ensures annotation position is computed synchronously so the first click
|
|
31
|
+
* applies the yellow highlight immediately. `data-nudge-selection-active` is set
|
|
32
|
+
* exclusively by the Confluence comment nudge feature and is double-gated:
|
|
33
|
+
* (1) `expValEquals('confluence_comment_nudgebar_improvement', ...)` — explicit experiment
|
|
34
|
+
* gate; (2) `data-nudge-selection-active` — ensures 0ms only fires during an actual nudge
|
|
35
|
+
* click, not on every selectionchange for experiment-ON users. Zero behavioral change for
|
|
36
|
+
* other products or experiment-OFF users.
|
|
37
|
+
*/
|
|
38
|
+
var nudgeDelay = typeof document !== 'undefined' && ((_document$body = document.body) === null || _document$body === void 0 ? void 0 : _document$body.getAttribute('data-nudge-selection-active')) === 'true' && expValEquals('confluence_comment_nudgebar_improvement', 'isEnabled', true) ? 0 : 100;
|
|
23
39
|
selectionTimeoutRef.current = setTimeout(function () {
|
|
24
40
|
var sel = document.getSelection();
|
|
25
41
|
if (!sel || sel.type !== 'Range' || sel.rangeCount !== 1) {
|
|
@@ -56,7 +72,7 @@ export var useUserSelectionRange = function useUserSelectionRange(props) {
|
|
|
56
72
|
setSelectionRange(_range.cloneRange());
|
|
57
73
|
lastRangeRef.current = _range;
|
|
58
74
|
}
|
|
59
|
-
},
|
|
75
|
+
}, nudgeDelay);
|
|
60
76
|
}, [rendererDOM, setSelectionRange, clearSelectionRange, isAnnotationManagerEnabled]);
|
|
61
77
|
useEffect(function () {
|
|
62
78
|
if (!document || !rendererDOM) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "133.8.
|
|
3
|
+
"version": "133.8.4",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -12,9 +12,7 @@
|
|
|
12
12
|
"module": "dist/esm/index.js",
|
|
13
13
|
"module:es2019": "dist/es2019/index.js",
|
|
14
14
|
"types": "dist/types/index.d.ts",
|
|
15
|
-
"sideEffects": [
|
|
16
|
-
"*.compiled.css"
|
|
17
|
-
],
|
|
15
|
+
"sideEffects": ["*.compiled.css"],
|
|
18
16
|
"atlaskit:src": "src/index.ts",
|
|
19
17
|
"atlassian": {
|
|
20
18
|
"react-compiler": {
|
|
@@ -30,12 +28,12 @@
|
|
|
30
28
|
}
|
|
31
29
|
},
|
|
32
30
|
"dependencies": {
|
|
33
|
-
"@atlaskit/adf-schema": "^56.
|
|
34
|
-
"@atlaskit/adf-utils": "^20.
|
|
31
|
+
"@atlaskit/adf-schema": "^56.1.0",
|
|
32
|
+
"@atlaskit/adf-utils": "^20.3.0",
|
|
35
33
|
"@atlaskit/afm-i18n-platform-editor-renderer": "2.168.0",
|
|
36
34
|
"@atlaskit/analytics-listeners": "^11.1.0",
|
|
37
35
|
"@atlaskit/analytics-namespaced-context": "^8.1.0",
|
|
38
|
-
"@atlaskit/analytics-next": "^12.
|
|
36
|
+
"@atlaskit/analytics-next": "^12.2.0",
|
|
39
37
|
"@atlaskit/browser-apis": "^1.1.0",
|
|
40
38
|
"@atlaskit/button": "^24.3.0",
|
|
41
39
|
"@atlaskit/code": "^18.2.0",
|
|
@@ -46,29 +44,29 @@
|
|
|
46
44
|
"@atlaskit/editor-smart-link-draggable": "^1.1.0",
|
|
47
45
|
"@atlaskit/emoji": "^71.7.0",
|
|
48
46
|
"@atlaskit/feature-gate-js-client": "^6.0.0",
|
|
49
|
-
"@atlaskit/icon": "^36.
|
|
47
|
+
"@atlaskit/icon": "^36.2.0",
|
|
50
48
|
"@atlaskit/link": "^4.1.0",
|
|
51
49
|
"@atlaskit/link-datasource": "^6.1.0",
|
|
52
50
|
"@atlaskit/link-extractors": "^3.2.0",
|
|
53
51
|
"@atlaskit/linking-common": "^11.0.0",
|
|
54
|
-
"@atlaskit/media-card": "^81.
|
|
55
|
-
"@atlaskit/media-client": "^37.
|
|
52
|
+
"@atlaskit/media-card": "^81.3.0",
|
|
53
|
+
"@atlaskit/media-client": "^37.2.0",
|
|
56
54
|
"@atlaskit/media-client-react": "^6.1.0",
|
|
57
|
-
"@atlaskit/media-common": "^14.
|
|
55
|
+
"@atlaskit/media-common": "^14.3.0",
|
|
58
56
|
"@atlaskit/media-filmstrip": "^52.2.0",
|
|
59
|
-
"@atlaskit/media-ui": "^30.
|
|
60
|
-
"@atlaskit/media-viewer": "^54.
|
|
57
|
+
"@atlaskit/media-ui": "^30.6.0",
|
|
58
|
+
"@atlaskit/media-viewer": "^54.4.0",
|
|
61
59
|
"@atlaskit/platform-feature-flags": "^2.0.0",
|
|
62
60
|
"@atlaskit/platform-feature-flags-react": "^1.1.0",
|
|
63
61
|
"@atlaskit/pragmatic-drag-and-drop": "^2.0.0",
|
|
64
62
|
"@atlaskit/react-compiler-gating": "^0.2.0",
|
|
65
63
|
"@atlaskit/react-ufo": "^7.3.0",
|
|
66
|
-
"@atlaskit/smart-card": "^45.
|
|
64
|
+
"@atlaskit/smart-card": "^45.7.0",
|
|
67
65
|
"@atlaskit/status": "^5.4.0",
|
|
68
66
|
"@atlaskit/task-decision": "^21.4.0",
|
|
69
67
|
"@atlaskit/theme": "^26.1.0",
|
|
70
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
71
|
-
"@atlaskit/tokens": "^15.
|
|
68
|
+
"@atlaskit/tmp-editor-statsig": "^121.3.0",
|
|
69
|
+
"@atlaskit/tokens": "^15.4.0",
|
|
72
70
|
"@atlaskit/tooltip": "^23.1.0",
|
|
73
71
|
"@atlaskit/visually-hidden": "^4.1.0",
|
|
74
72
|
"@babel/runtime": "^7.0.0",
|
|
@@ -82,8 +80,8 @@
|
|
|
82
80
|
"uuid": "^3.1.0"
|
|
83
81
|
},
|
|
84
82
|
"peerDependencies": {
|
|
85
|
-
"@atlaskit/editor-common": "^116.
|
|
86
|
-
"@atlaskit/link-provider": "^5.
|
|
83
|
+
"@atlaskit/editor-common": "^116.23.0",
|
|
84
|
+
"@atlaskit/link-provider": "^5.2.0",
|
|
87
85
|
"@atlaskit/media-core": "^38.0.0",
|
|
88
86
|
"react": "^18.2.0",
|
|
89
87
|
"react-dom": "^18.2.0",
|
|
@@ -95,14 +93,14 @@
|
|
|
95
93
|
"@atlaskit/analytics-gas-types": "^6.0.0",
|
|
96
94
|
"@atlaskit/checkbox": "^18.1.0",
|
|
97
95
|
"@atlaskit/editor-card-provider": "^7.0.0",
|
|
98
|
-
"@atlaskit/link-provider": "^5.
|
|
96
|
+
"@atlaskit/link-provider": "^5.2.0",
|
|
99
97
|
"@atlaskit/link-test-helpers": "^11.0.0",
|
|
100
98
|
"@atlaskit/media-core": "^38.0.0",
|
|
101
99
|
"@atlaskit/media-integration-test-helpers": "workspace:^",
|
|
102
|
-
"@atlaskit/media-test-helpers": "^42.
|
|
100
|
+
"@atlaskit/media-test-helpers": "^42.2.0",
|
|
103
101
|
"@atlaskit/mention": "^27.5.0",
|
|
104
102
|
"@atlaskit/modal-dialog": "^16.1.0",
|
|
105
|
-
"@atlaskit/navigation-system": "^10.
|
|
103
|
+
"@atlaskit/navigation-system": "^10.4.0",
|
|
106
104
|
"@atlaskit/profilecard": "^26.8.0",
|
|
107
105
|
"@atlaskit/side-nav-items": "^2.2.0",
|
|
108
106
|
"@atlaskit/util-data-test": "^19.1.0",
|
|
@@ -110,7 +108,7 @@
|
|
|
110
108
|
"@atlassian/a11y-playwright-testing": "^0.10.0",
|
|
111
109
|
"@atlassian/feature-flags-test-utils": "^1.1.0",
|
|
112
110
|
"@atlassian/structured-docs-types": "workspace:^",
|
|
113
|
-
"@atlassian/testing-library": "^0.
|
|
111
|
+
"@atlassian/testing-library": "^0.10.0",
|
|
114
112
|
"@testing-library/react": "^16.3.0",
|
|
115
113
|
"@testing-library/user-event": "^14.4.3",
|
|
116
114
|
"@types/react-loadable": "^5.4.1",
|
|
@@ -133,14 +131,9 @@
|
|
|
133
131
|
},
|
|
134
132
|
"techstack": {
|
|
135
133
|
"@repo/internal": {
|
|
136
|
-
"design-tokens": [
|
|
137
|
-
"color"
|
|
138
|
-
],
|
|
134
|
+
"design-tokens": ["color"],
|
|
139
135
|
"deprecation": "no-deprecated-imports",
|
|
140
|
-
"styling": [
|
|
141
|
-
"compiled",
|
|
142
|
-
"emotion"
|
|
143
|
-
]
|
|
136
|
+
"styling": ["compiled", "emotion"]
|
|
144
137
|
}
|
|
145
138
|
},
|
|
146
139
|
"platform-feature-flags": {
|