@atlaskit/renderer 109.32.4 → 109.32.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 +10 -0
- package/dist/cjs/react/nodes/media/index.js +10 -8
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/es2019/react/nodes/media/index.js +9 -7
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/esm/react/nodes/media/index.js +10 -8
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/package.json +11 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 109.32.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#110948](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/110948)
|
|
8
|
+
[`6567f4bf996b3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6567f4bf996b3) -
|
|
9
|
+
[ux] When we select caption comment, the comment badge should not be active (with FF) and rename
|
|
10
|
+
prop name to mediaSingleElement
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
3
13
|
## 109.32.4
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
|
@@ -35,7 +35,8 @@ var _mediaSingle = require("@atlaskit/editor-common/media-single");
|
|
|
35
35
|
var _reactIntlNext = require("react-intl-next");
|
|
36
36
|
var _hooks = require("../../../ui/annotations/hooks");
|
|
37
37
|
var _types = require("@atlaskit/editor-common/types");
|
|
38
|
-
var
|
|
38
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
39
|
+
var _excluded = ["marks", "mediaSingleElement", "isDrafting"];
|
|
39
40
|
var _templateObject, _templateObject2;
|
|
40
41
|
/** @jsx jsx */
|
|
41
42
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
@@ -131,7 +132,7 @@ var CommentBadge = (0, _reactIntlNext.injectIntl)(_mediaSingle.CommentBadge);
|
|
|
131
132
|
var CommentBadgeWrapper = function CommentBadgeWrapper(_ref5) {
|
|
132
133
|
var _marks$map;
|
|
133
134
|
var marks = _ref5.marks,
|
|
134
|
-
|
|
135
|
+
mediaSingleElement = _ref5.mediaSingleElement,
|
|
135
136
|
_ref5$isDrafting = _ref5.isDrafting,
|
|
136
137
|
isDrafting = _ref5$isDrafting === void 0 ? false : _ref5$isDrafting,
|
|
137
138
|
rest = (0, _objectWithoutProperties2.default)(_ref5, _excluded);
|
|
@@ -155,15 +156,16 @@ var CommentBadgeWrapper = function CommentBadgeWrapper(_ref5) {
|
|
|
155
156
|
(0, _react.useEffect)(function () {
|
|
156
157
|
var observer = new MutationObserver(function (mutationList) {
|
|
157
158
|
mutationList.forEach(function (mutation) {
|
|
159
|
+
var parentNode = mutation.target.parentNode;
|
|
158
160
|
if (mutation.attributeName === 'data-has-focus') {
|
|
159
|
-
var
|
|
160
|
-
var elementHasFocus =
|
|
161
|
+
var isMediaCaption = parentNode === null || parentNode === void 0 ? void 0 : parentNode.closest('[data-media-caption="true"]');
|
|
162
|
+
var elementHasFocus = (parentNode === null || parentNode === void 0 ? void 0 : parentNode.querySelector('[data-has-focus="true"]')) && (!(0, _platformFeatureFlags.getBooleanFF)('platform.comments-on-media.bug.incorrect-badge-highlight') || !isMediaCaption);
|
|
161
163
|
elementHasFocus ? setStatus('active') : setStatus('default');
|
|
162
164
|
}
|
|
163
165
|
});
|
|
164
166
|
});
|
|
165
|
-
if (
|
|
166
|
-
observer.observe(
|
|
167
|
+
if (mediaSingleElement) {
|
|
168
|
+
observer.observe(mediaSingleElement, {
|
|
167
169
|
attributes: true,
|
|
168
170
|
subtree: true,
|
|
169
171
|
attributeFilter: ['data-has-focus']
|
|
@@ -172,7 +174,7 @@ var CommentBadgeWrapper = function CommentBadgeWrapper(_ref5) {
|
|
|
172
174
|
return function () {
|
|
173
175
|
observer.disconnect();
|
|
174
176
|
};
|
|
175
|
-
}, [
|
|
177
|
+
}, [mediaSingleElement, setStatus]);
|
|
176
178
|
if (!isDrafting && !activeParentIds.length) {
|
|
177
179
|
return null;
|
|
178
180
|
}
|
|
@@ -243,7 +245,7 @@ var Media = /*#__PURE__*/function (_PureComponent) {
|
|
|
243
245
|
})
|
|
244
246
|
}, showCommentBadge && (0, _react2.jsx)(CommentBadgeWrapper, {
|
|
245
247
|
marks: annotationMarks,
|
|
246
|
-
|
|
248
|
+
mediaSingleElement: mediaSingleElement,
|
|
247
249
|
width: width,
|
|
248
250
|
height: height,
|
|
249
251
|
isDrafting: isDrafting
|
|
@@ -56,7 +56,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
56
56
|
var NORMAL_SEVERITY_THRESHOLD = exports.NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
57
57
|
var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
58
58
|
var packageName = "@atlaskit/renderer";
|
|
59
|
-
var packageVersion = "109.32.
|
|
59
|
+
var packageVersion = "109.32.5";
|
|
60
60
|
var defaultNodeComponents = exports.defaultNodeComponents = _nodes.nodeToReact;
|
|
61
61
|
var Renderer = exports.Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
62
62
|
(0, _inherits2.default)(Renderer, _PureComponent);
|
|
@@ -20,6 +20,7 @@ import { CommentBadge as CommentBadgeComponent } from '@atlaskit/editor-common/m
|
|
|
20
20
|
import { injectIntl } from 'react-intl-next';
|
|
21
21
|
import { useInlineCommentSubscriberContext, useInlineCommentsFilter } from '../../../ui/annotations/hooks';
|
|
22
22
|
import { AnnotationUpdateEvent } from '@atlaskit/editor-common/types';
|
|
23
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
23
24
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css, @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
24
25
|
export const linkStyle = css`
|
|
25
26
|
position: absolute;
|
|
@@ -123,7 +124,7 @@ const MediaAnnotations = ({
|
|
|
123
124
|
const CommentBadge = injectIntl(CommentBadgeComponent);
|
|
124
125
|
const CommentBadgeWrapper = ({
|
|
125
126
|
marks,
|
|
126
|
-
|
|
127
|
+
mediaSingleElement,
|
|
127
128
|
isDrafting = false,
|
|
128
129
|
...rest
|
|
129
130
|
}) => {
|
|
@@ -140,15 +141,16 @@ const CommentBadgeWrapper = ({
|
|
|
140
141
|
useEffect(() => {
|
|
141
142
|
const observer = new MutationObserver(mutationList => {
|
|
142
143
|
mutationList.forEach(mutation => {
|
|
144
|
+
const parentNode = mutation.target.parentNode;
|
|
143
145
|
if (mutation.attributeName === 'data-has-focus') {
|
|
144
|
-
|
|
145
|
-
const elementHasFocus =
|
|
146
|
+
const isMediaCaption = parentNode === null || parentNode === void 0 ? void 0 : parentNode.closest('[data-media-caption="true"]');
|
|
147
|
+
const elementHasFocus = (parentNode === null || parentNode === void 0 ? void 0 : parentNode.querySelector('[data-has-focus="true"]')) && (!getBooleanFF('platform.comments-on-media.bug.incorrect-badge-highlight') || !isMediaCaption);
|
|
146
148
|
elementHasFocus ? setStatus('active') : setStatus('default');
|
|
147
149
|
}
|
|
148
150
|
});
|
|
149
151
|
});
|
|
150
|
-
if (
|
|
151
|
-
observer.observe(
|
|
152
|
+
if (mediaSingleElement) {
|
|
153
|
+
observer.observe(mediaSingleElement, {
|
|
152
154
|
attributes: true,
|
|
153
155
|
subtree: true,
|
|
154
156
|
attributeFilter: ['data-has-focus']
|
|
@@ -157,7 +159,7 @@ const CommentBadgeWrapper = ({
|
|
|
157
159
|
return () => {
|
|
158
160
|
observer.disconnect();
|
|
159
161
|
};
|
|
160
|
-
}, [
|
|
162
|
+
}, [mediaSingleElement, setStatus]);
|
|
161
163
|
if (!isDrafting && !activeParentIds.length) {
|
|
162
164
|
return null;
|
|
163
165
|
}
|
|
@@ -223,7 +225,7 @@ class Media extends PureComponent {
|
|
|
223
225
|
}
|
|
224
226
|
}, showCommentBadge && jsx(CommentBadgeWrapper, {
|
|
225
227
|
marks: annotationMarks,
|
|
226
|
-
|
|
228
|
+
mediaSingleElement: mediaSingleElement,
|
|
227
229
|
width: width,
|
|
228
230
|
height: height,
|
|
229
231
|
isDrafting: isDrafting
|
|
@@ -37,7 +37,7 @@ import { nodeToReact } from '../../react/nodes';
|
|
|
37
37
|
export const NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
38
38
|
export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
39
39
|
const packageName = "@atlaskit/renderer";
|
|
40
|
-
const packageVersion = "109.32.
|
|
40
|
+
const packageVersion = "109.32.5";
|
|
41
41
|
export const defaultNodeComponents = nodeToReact;
|
|
42
42
|
export class Renderer extends PureComponent {
|
|
43
43
|
constructor(props) {
|
|
@@ -9,7 +9,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
9
9
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
10
10
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
11
11
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
12
|
-
var _excluded = ["marks", "
|
|
12
|
+
var _excluded = ["marks", "mediaSingleElement", "isDrafting"];
|
|
13
13
|
var _templateObject, _templateObject2;
|
|
14
14
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
15
15
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -35,6 +35,7 @@ import { CommentBadge as CommentBadgeComponent } from '@atlaskit/editor-common/m
|
|
|
35
35
|
import { injectIntl } from 'react-intl-next';
|
|
36
36
|
import { useInlineCommentSubscriberContext, useInlineCommentsFilter } from '../../../ui/annotations/hooks';
|
|
37
37
|
import { AnnotationUpdateEvent } from '@atlaskit/editor-common/types';
|
|
38
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
38
39
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css, @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
39
40
|
export var linkStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\tposition: absolute;\n\tbackground: transparent;\n\ttop: 0;\n\tright: 0;\n\tbottom: 0;\n\tleft: 0;\n\tcursor: pointer;\n\twidth: 100% !important;\n\theight: 100% !important;\n"])));
|
|
40
41
|
|
|
@@ -122,7 +123,7 @@ var CommentBadge = injectIntl(CommentBadgeComponent);
|
|
|
122
123
|
var CommentBadgeWrapper = function CommentBadgeWrapper(_ref5) {
|
|
123
124
|
var _marks$map;
|
|
124
125
|
var marks = _ref5.marks,
|
|
125
|
-
|
|
126
|
+
mediaSingleElement = _ref5.mediaSingleElement,
|
|
126
127
|
_ref5$isDrafting = _ref5.isDrafting,
|
|
127
128
|
isDrafting = _ref5$isDrafting === void 0 ? false : _ref5$isDrafting,
|
|
128
129
|
rest = _objectWithoutProperties(_ref5, _excluded);
|
|
@@ -146,15 +147,16 @@ var CommentBadgeWrapper = function CommentBadgeWrapper(_ref5) {
|
|
|
146
147
|
useEffect(function () {
|
|
147
148
|
var observer = new MutationObserver(function (mutationList) {
|
|
148
149
|
mutationList.forEach(function (mutation) {
|
|
150
|
+
var parentNode = mutation.target.parentNode;
|
|
149
151
|
if (mutation.attributeName === 'data-has-focus') {
|
|
150
|
-
var
|
|
151
|
-
var elementHasFocus =
|
|
152
|
+
var isMediaCaption = parentNode === null || parentNode === void 0 ? void 0 : parentNode.closest('[data-media-caption="true"]');
|
|
153
|
+
var elementHasFocus = (parentNode === null || parentNode === void 0 ? void 0 : parentNode.querySelector('[data-has-focus="true"]')) && (!getBooleanFF('platform.comments-on-media.bug.incorrect-badge-highlight') || !isMediaCaption);
|
|
152
154
|
elementHasFocus ? setStatus('active') : setStatus('default');
|
|
153
155
|
}
|
|
154
156
|
});
|
|
155
157
|
});
|
|
156
|
-
if (
|
|
157
|
-
observer.observe(
|
|
158
|
+
if (mediaSingleElement) {
|
|
159
|
+
observer.observe(mediaSingleElement, {
|
|
158
160
|
attributes: true,
|
|
159
161
|
subtree: true,
|
|
160
162
|
attributeFilter: ['data-has-focus']
|
|
@@ -163,7 +165,7 @@ var CommentBadgeWrapper = function CommentBadgeWrapper(_ref5) {
|
|
|
163
165
|
return function () {
|
|
164
166
|
observer.disconnect();
|
|
165
167
|
};
|
|
166
|
-
}, [
|
|
168
|
+
}, [mediaSingleElement, setStatus]);
|
|
167
169
|
if (!isDrafting && !activeParentIds.length) {
|
|
168
170
|
return null;
|
|
169
171
|
}
|
|
@@ -234,7 +236,7 @@ var Media = /*#__PURE__*/function (_PureComponent) {
|
|
|
234
236
|
})
|
|
235
237
|
}, showCommentBadge && jsx(CommentBadgeWrapper, {
|
|
236
238
|
marks: annotationMarks,
|
|
237
|
-
|
|
239
|
+
mediaSingleElement: mediaSingleElement,
|
|
238
240
|
width: width,
|
|
239
241
|
height: height,
|
|
240
242
|
isDrafting: isDrafting
|
|
@@ -47,7 +47,7 @@ import { nodeToReact } from '../../react/nodes';
|
|
|
47
47
|
export var NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
48
48
|
export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
49
49
|
var packageName = "@atlaskit/renderer";
|
|
50
|
-
var packageVersion = "109.32.
|
|
50
|
+
var packageVersion = "109.32.5";
|
|
51
51
|
export var defaultNodeComponents = nodeToReact;
|
|
52
52
|
export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
53
53
|
_inherits(Renderer, _PureComponent);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "109.32.
|
|
3
|
+
"version": "109.32.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": "^9.3.0",
|
|
32
32
|
"@atlaskit/button": "^17.17.0",
|
|
33
33
|
"@atlaskit/code": "^15.2.0",
|
|
34
|
-
"@atlaskit/editor-common": "^82.
|
|
34
|
+
"@atlaskit/editor-common": "^82.8.0",
|
|
35
35
|
"@atlaskit/editor-json-transformer": "^8.13.0",
|
|
36
36
|
"@atlaskit/editor-palette": "1.6.0",
|
|
37
37
|
"@atlaskit/editor-prosemirror": "4.0.1",
|
|
@@ -107,9 +107,13 @@
|
|
|
107
107
|
},
|
|
108
108
|
"techstack": {
|
|
109
109
|
"@repo/internal": {
|
|
110
|
-
"design-tokens": [
|
|
110
|
+
"design-tokens": [
|
|
111
|
+
"color"
|
|
112
|
+
],
|
|
111
113
|
"deprecation": "no-deprecated-imports",
|
|
112
|
-
"styling": [
|
|
114
|
+
"styling": [
|
|
115
|
+
"emotion"
|
|
116
|
+
]
|
|
113
117
|
}
|
|
114
118
|
},
|
|
115
119
|
"platform-feature-flags": {
|
|
@@ -140,6 +144,9 @@
|
|
|
140
144
|
},
|
|
141
145
|
"platform.editor.table.allow-table-alignment": {
|
|
142
146
|
"type": "boolean"
|
|
147
|
+
},
|
|
148
|
+
"platform.comments-on-media.bug.incorrect-badge-highlight": {
|
|
149
|
+
"type": "boolean"
|
|
143
150
|
}
|
|
144
151
|
},
|
|
145
152
|
"af:exports": {
|