@atlaskit/renderer 109.29.6 → 109.30.0
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 +9 -0
- package/dist/cjs/react/nodes/media/index.js +4 -10
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/es2019/react/nodes/media/index.js +4 -10
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/esm/react/nodes/media/index.js +4 -10
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/dist/types/react/nodes/media/index.d.ts +0 -1
- package/dist/types-ts4.5/react/nodes/media/index.d.ts +0 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 109.30.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#101591](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/101591)
|
|
8
|
+
[`0fd18de5a2e3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0fd18de5a2e3) -
|
|
9
|
+
[ux] removing the isInPageInclude prop in renderer and will access isInPageInclude directly in
|
|
10
|
+
HoverComponent
|
|
11
|
+
|
|
3
12
|
## 109.29.6
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -215,14 +215,14 @@ var Media = /*#__PURE__*/function (_PureComponent) {
|
|
|
215
215
|
height = _this$props.height,
|
|
216
216
|
mediaSingleElement = _this$props.mediaSingleElement,
|
|
217
217
|
_this$props$isDraftin = _this$props.isDrafting,
|
|
218
|
-
isDrafting = _this$props$isDraftin === void 0 ? false : _this$props$isDraftin
|
|
219
|
-
isInPageInclude = _this$props.isInPageInclude;
|
|
218
|
+
isDrafting = _this$props$isDraftin === void 0 ? false : _this$props$isDraftin;
|
|
220
219
|
var annotationMarks = _this.props.isAnnotationMark ? _this.props.marks.filter(_this.props.isAnnotationMark) : undefined;
|
|
221
220
|
var borderMark = _this.props.marks.find(_this.props.isBorderMark);
|
|
222
221
|
var linkMark = _this.props.marks.find(_this.props.isLinkMark);
|
|
223
222
|
var linkHref = linkMark === null || linkMark === void 0 ? void 0 : linkMark.attrs.href;
|
|
224
223
|
var eventHandlers = linkHref ? undefined : _this.props.eventHandlers;
|
|
225
224
|
var shouldOpenMediaViewer = !linkHref && allowMediaViewer;
|
|
225
|
+
var isInPageInclude = mediaSingleElement === null || mediaSingleElement === void 0 ? void 0 : mediaSingleElement.closest('[data-node-type="include"]');
|
|
226
226
|
var showCommentBadge = !!annotationMarks && (featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.commentsOnMedia) && (!(featureFlags !== null && featureFlags !== void 0 && featureFlags.commentsOnMediaIncludePage) || !isInPageInclude);
|
|
227
227
|
return (0, _react2.jsx)(MediaLink, {
|
|
228
228
|
mark: linkMark,
|
|
@@ -302,11 +302,6 @@ var MediaWithDraftAnnotation = function MediaWithDraftAnnotation(props) {
|
|
|
302
302
|
var isCommentsOnMediaBugFixEnabled = !!(providers !== null && providers !== void 0 && providers.inlineComment.isCommentsOnMediaBugFixEnabled);
|
|
303
303
|
var dataAttributes = props.dataAttributes;
|
|
304
304
|
var pos = dataAttributes && dataAttributes['data-renderer-start-pos'];
|
|
305
|
-
var parentElementClosest;
|
|
306
|
-
if (typeof document !== "undefined") {
|
|
307
|
-
var elementAtPos = pos && document.querySelector("[data-renderer-start-pos=\"".concat(pos, "\"]"));
|
|
308
|
-
parentElementClosest = elementAtPos instanceof Element ? elementAtPos.closest('[data-node-type="include"]') : null;
|
|
309
|
-
}
|
|
310
305
|
var _useState5 = (0, _react.useState)(),
|
|
311
306
|
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
312
307
|
position = _useState6[0],
|
|
@@ -328,7 +323,7 @@ var MediaWithDraftAnnotation = function MediaWithDraftAnnotation(props) {
|
|
|
328
323
|
setShouldApplyDraftAnnotation(false);
|
|
329
324
|
setPosition(undefined);
|
|
330
325
|
}
|
|
331
|
-
}, [draftPosition,
|
|
326
|
+
}, [draftPosition, pos, shouldApplyDraftAnnotation, isCommentsOnMediaBugFixEnabled]);
|
|
332
327
|
var applyDraftAnnotation = props.allowAnnotationsDraftMode && shouldApplyDraftAnnotation && position !== undefined;
|
|
333
328
|
var dataAttributesWithDraftAnnotation = (0, _react.useMemo)(function () {
|
|
334
329
|
return applyDraftAnnotation ? _objectSpread(_objectSpread({}, dataAttributes), {}, {
|
|
@@ -338,8 +333,7 @@ var MediaWithDraftAnnotation = function MediaWithDraftAnnotation(props) {
|
|
|
338
333
|
}, [applyDraftAnnotation, dataAttributes]);
|
|
339
334
|
return (0, _react2.jsx)(Media, (0, _extends2.default)({}, props, {
|
|
340
335
|
dataAttributes: dataAttributesWithDraftAnnotation,
|
|
341
|
-
isDrafting: shouldApplyDraftAnnotation
|
|
342
|
-
isInPageInclude: !!parentElementClosest
|
|
336
|
+
isDrafting: shouldApplyDraftAnnotation
|
|
343
337
|
}));
|
|
344
338
|
};
|
|
345
339
|
var _default = exports.default = MediaWithDraftAnnotation;
|
|
@@ -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.
|
|
59
|
+
var packageVersion = "109.30.0";
|
|
60
60
|
var defaultNodeComponents = exports.defaultNodeComponents = _nodes.nodeToReact;
|
|
61
61
|
var Renderer = exports.Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
62
62
|
(0, _inherits2.default)(Renderer, _PureComponent);
|
|
@@ -192,8 +192,7 @@ class Media extends PureComponent {
|
|
|
192
192
|
width,
|
|
193
193
|
height,
|
|
194
194
|
mediaSingleElement,
|
|
195
|
-
isDrafting = false
|
|
196
|
-
isInPageInclude
|
|
195
|
+
isDrafting = false
|
|
197
196
|
} = this.props;
|
|
198
197
|
const annotationMarks = this.props.isAnnotationMark ? this.props.marks.filter(this.props.isAnnotationMark) : undefined;
|
|
199
198
|
const borderMark = this.props.marks.find(this.props.isBorderMark);
|
|
@@ -201,6 +200,7 @@ class Media extends PureComponent {
|
|
|
201
200
|
const linkHref = linkMark === null || linkMark === void 0 ? void 0 : linkMark.attrs.href;
|
|
202
201
|
const eventHandlers = linkHref ? undefined : this.props.eventHandlers;
|
|
203
202
|
const shouldOpenMediaViewer = !linkHref && allowMediaViewer;
|
|
203
|
+
const isInPageInclude = mediaSingleElement === null || mediaSingleElement === void 0 ? void 0 : mediaSingleElement.closest('[data-node-type="include"]');
|
|
204
204
|
const showCommentBadge = !!annotationMarks && (featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.commentsOnMedia) && (!(featureFlags !== null && featureFlags !== void 0 && featureFlags.commentsOnMediaIncludePage) || !isInPageInclude);
|
|
205
205
|
return jsx(MediaLink, {
|
|
206
206
|
mark: linkMark,
|
|
@@ -282,11 +282,6 @@ const MediaWithDraftAnnotation = props => {
|
|
|
282
282
|
dataAttributes
|
|
283
283
|
} = props;
|
|
284
284
|
const pos = dataAttributes && dataAttributes['data-renderer-start-pos'];
|
|
285
|
-
let parentElementClosest;
|
|
286
|
-
if (typeof document !== "undefined") {
|
|
287
|
-
const elementAtPos = pos && document.querySelector(`[data-renderer-start-pos="${pos}"]`);
|
|
288
|
-
parentElementClosest = elementAtPos instanceof Element ? elementAtPos.closest('[data-node-type="include"]') : null;
|
|
289
|
-
}
|
|
290
285
|
const [position, setPosition] = useState();
|
|
291
286
|
const [shouldApplyDraftAnnotation, setShouldApplyDraftAnnotation] = useState(false);
|
|
292
287
|
useEffect(() => {
|
|
@@ -302,7 +297,7 @@ const MediaWithDraftAnnotation = props => {
|
|
|
302
297
|
setShouldApplyDraftAnnotation(false);
|
|
303
298
|
setPosition(undefined);
|
|
304
299
|
}
|
|
305
|
-
}, [draftPosition,
|
|
300
|
+
}, [draftPosition, pos, shouldApplyDraftAnnotation, isCommentsOnMediaBugFixEnabled]);
|
|
306
301
|
const applyDraftAnnotation = props.allowAnnotationsDraftMode && shouldApplyDraftAnnotation && position !== undefined;
|
|
307
302
|
const dataAttributesWithDraftAnnotation = useMemo(() => applyDraftAnnotation ? {
|
|
308
303
|
...dataAttributes,
|
|
@@ -311,8 +306,7 @@ const MediaWithDraftAnnotation = props => {
|
|
|
311
306
|
} : dataAttributes, [applyDraftAnnotation, dataAttributes]);
|
|
312
307
|
return jsx(Media, _extends({}, props, {
|
|
313
308
|
dataAttributes: dataAttributesWithDraftAnnotation,
|
|
314
|
-
isDrafting: shouldApplyDraftAnnotation
|
|
315
|
-
isInPageInclude: !!parentElementClosest
|
|
309
|
+
isDrafting: shouldApplyDraftAnnotation
|
|
316
310
|
}));
|
|
317
311
|
};
|
|
318
312
|
export default MediaWithDraftAnnotation;
|
|
@@ -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.
|
|
40
|
+
const packageVersion = "109.30.0";
|
|
41
41
|
export const defaultNodeComponents = nodeToReact;
|
|
42
42
|
export class Renderer extends PureComponent {
|
|
43
43
|
constructor(props) {
|
|
@@ -206,14 +206,14 @@ var Media = /*#__PURE__*/function (_PureComponent) {
|
|
|
206
206
|
height = _this$props.height,
|
|
207
207
|
mediaSingleElement = _this$props.mediaSingleElement,
|
|
208
208
|
_this$props$isDraftin = _this$props.isDrafting,
|
|
209
|
-
isDrafting = _this$props$isDraftin === void 0 ? false : _this$props$isDraftin
|
|
210
|
-
isInPageInclude = _this$props.isInPageInclude;
|
|
209
|
+
isDrafting = _this$props$isDraftin === void 0 ? false : _this$props$isDraftin;
|
|
211
210
|
var annotationMarks = _this.props.isAnnotationMark ? _this.props.marks.filter(_this.props.isAnnotationMark) : undefined;
|
|
212
211
|
var borderMark = _this.props.marks.find(_this.props.isBorderMark);
|
|
213
212
|
var linkMark = _this.props.marks.find(_this.props.isLinkMark);
|
|
214
213
|
var linkHref = linkMark === null || linkMark === void 0 ? void 0 : linkMark.attrs.href;
|
|
215
214
|
var eventHandlers = linkHref ? undefined : _this.props.eventHandlers;
|
|
216
215
|
var shouldOpenMediaViewer = !linkHref && allowMediaViewer;
|
|
216
|
+
var isInPageInclude = mediaSingleElement === null || mediaSingleElement === void 0 ? void 0 : mediaSingleElement.closest('[data-node-type="include"]');
|
|
217
217
|
var showCommentBadge = !!annotationMarks && (featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.commentsOnMedia) && (!(featureFlags !== null && featureFlags !== void 0 && featureFlags.commentsOnMediaIncludePage) || !isInPageInclude);
|
|
218
218
|
return jsx(MediaLink, {
|
|
219
219
|
mark: linkMark,
|
|
@@ -293,11 +293,6 @@ var MediaWithDraftAnnotation = function MediaWithDraftAnnotation(props) {
|
|
|
293
293
|
var isCommentsOnMediaBugFixEnabled = !!(providers !== null && providers !== void 0 && providers.inlineComment.isCommentsOnMediaBugFixEnabled);
|
|
294
294
|
var dataAttributes = props.dataAttributes;
|
|
295
295
|
var pos = dataAttributes && dataAttributes['data-renderer-start-pos'];
|
|
296
|
-
var parentElementClosest;
|
|
297
|
-
if (typeof document !== "undefined") {
|
|
298
|
-
var elementAtPos = pos && document.querySelector("[data-renderer-start-pos=\"".concat(pos, "\"]"));
|
|
299
|
-
parentElementClosest = elementAtPos instanceof Element ? elementAtPos.closest('[data-node-type="include"]') : null;
|
|
300
|
-
}
|
|
301
296
|
var _useState5 = useState(),
|
|
302
297
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
303
298
|
position = _useState6[0],
|
|
@@ -319,7 +314,7 @@ var MediaWithDraftAnnotation = function MediaWithDraftAnnotation(props) {
|
|
|
319
314
|
setShouldApplyDraftAnnotation(false);
|
|
320
315
|
setPosition(undefined);
|
|
321
316
|
}
|
|
322
|
-
}, [draftPosition,
|
|
317
|
+
}, [draftPosition, pos, shouldApplyDraftAnnotation, isCommentsOnMediaBugFixEnabled]);
|
|
323
318
|
var applyDraftAnnotation = props.allowAnnotationsDraftMode && shouldApplyDraftAnnotation && position !== undefined;
|
|
324
319
|
var dataAttributesWithDraftAnnotation = useMemo(function () {
|
|
325
320
|
return applyDraftAnnotation ? _objectSpread(_objectSpread({}, dataAttributes), {}, {
|
|
@@ -329,8 +324,7 @@ var MediaWithDraftAnnotation = function MediaWithDraftAnnotation(props) {
|
|
|
329
324
|
}, [applyDraftAnnotation, dataAttributes]);
|
|
330
325
|
return jsx(Media, _extends({}, props, {
|
|
331
326
|
dataAttributes: dataAttributesWithDraftAnnotation,
|
|
332
|
-
isDrafting: shouldApplyDraftAnnotation
|
|
333
|
-
isInPageInclude: !!parentElementClosest
|
|
327
|
+
isDrafting: shouldApplyDraftAnnotation
|
|
334
328
|
}));
|
|
335
329
|
};
|
|
336
330
|
export default MediaWithDraftAnnotation;
|
|
@@ -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.
|
|
50
|
+
var packageVersion = "109.30.0";
|
|
51
51
|
export var defaultNodeComponents = nodeToReact;
|
|
52
52
|
export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
53
53
|
_inherits(Renderer, _PureComponent);
|
|
@@ -26,7 +26,6 @@ export type MediaProps = MediaCardProps & {
|
|
|
26
26
|
width?: number;
|
|
27
27
|
height?: number;
|
|
28
28
|
isDrafting: boolean;
|
|
29
|
-
isInPageInclude?: boolean;
|
|
30
29
|
};
|
|
31
30
|
export declare const linkStyle: import("@emotion/react").SerializedStyles;
|
|
32
31
|
export declare const borderStyle: (color: string, width: number) => import("@emotion/react").SerializedStyles;
|
|
@@ -26,7 +26,6 @@ export type MediaProps = MediaCardProps & {
|
|
|
26
26
|
width?: number;
|
|
27
27
|
height?: number;
|
|
28
28
|
isDrafting: boolean;
|
|
29
|
-
isInPageInclude?: boolean;
|
|
30
29
|
};
|
|
31
30
|
export declare const linkStyle: import("@emotion/react").SerializedStyles;
|
|
32
31
|
export declare const borderStyle: (color: string, width: number) => import("@emotion/react").SerializedStyles;
|