@atlaskit/renderer 139.0.0 → 139.1.1
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 +31 -0
- package/dist/cjs/react/index.js +9 -7
- package/dist/cjs/react/nodes/embedCard.js +2 -2
- package/dist/cjs/react/nodes/extension.js +2 -2
- package/dist/cjs/react/nodes/inlineCard.js +3 -3
- package/dist/cjs/react/nodes/media/index.js +84 -23
- package/dist/cjs/ui/MediaCard.js +57 -44
- package/dist/cjs/ui/Renderer/RendererStyleContainer.js +7 -1
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/cjs/ui/collapsible-headings.js +10 -2
- package/dist/es2019/react/index.js +8 -7
- package/dist/es2019/react/nodes/embedCard.js +1 -1
- package/dist/es2019/react/nodes/extension.js +2 -2
- package/dist/es2019/react/nodes/inlineCard.js +1 -1
- package/dist/es2019/react/nodes/media/index.js +59 -7
- package/dist/es2019/ui/MediaCard.js +17 -4
- package/dist/es2019/ui/Renderer/RendererStyleContainer.js +9 -1
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/es2019/ui/collapsible-headings.js +10 -2
- package/dist/esm/react/index.js +9 -7
- package/dist/esm/react/nodes/embedCard.js +1 -1
- package/dist/esm/react/nodes/extension.js +2 -2
- package/dist/esm/react/nodes/inlineCard.js +1 -1
- package/dist/esm/react/nodes/media/index.js +84 -23
- package/dist/esm/ui/MediaCard.js +57 -44
- package/dist/esm/ui/Renderer/RendererStyleContainer.js +7 -1
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/dist/esm/ui/collapsible-headings.js +10 -2
- package/dist/types/react/nodes/media/index.d.ts +2 -0
- package/dist/types/types/mediaOptions.d.ts +16 -0
- package/dist/types/ui/MediaCard.d.ts +5 -1
- package/package.json +13 -12
|
@@ -25,6 +25,11 @@ import { useInlineCommentsFilter } from '../../../ui/annotations/hooks/use-inlin
|
|
|
25
25
|
import { useInlineCommentSubscriberContext } from '../../../ui/annotations/hooks/use-inline-comment-subscriber';
|
|
26
26
|
import { AnnotationUpdateEvent } from '@atlaskit/editor-common/types';
|
|
27
27
|
import { useAnnotationRangeState } from '../../../ui/annotations/contexts/AnnotationRangeContext';
|
|
28
|
+
const getDataConsumerMark = marks => marks.find(mark => {
|
|
29
|
+
var _mark$type;
|
|
30
|
+
return mark.type === 'dataConsumer' || ((_mark$type = mark.type) === null || _mark$type === void 0 ? void 0 : _mark$type.name) === 'dataConsumer';
|
|
31
|
+
});
|
|
32
|
+
const getRemixDataConsumerMark = marks => fg('cc-maui-add-mark-for-remix-generated-images') ? getDataConsumerMark(marks) : undefined;
|
|
28
33
|
const linkStyle = css({
|
|
29
34
|
position: 'absolute',
|
|
30
35
|
background: 'transparent',
|
|
@@ -212,12 +217,39 @@ const CommentBadgeWrapper = ({
|
|
|
212
217
|
// Ignored via go/ees005
|
|
213
218
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
214
219
|
class Media extends PureComponent {
|
|
215
|
-
constructor(
|
|
216
|
-
super(
|
|
217
|
-
_defineProperty(this, "
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
220
|
+
constructor(_props) {
|
|
221
|
+
super(_props);
|
|
222
|
+
_defineProperty(this, "mediaInstance", {});
|
|
223
|
+
_defineProperty(this, "getDataConsumerMark", () => getRemixDataConsumerMark(this.props.marks));
|
|
224
|
+
_defineProperty(this, "getDataConsumerSource", (props = this.props) => {
|
|
225
|
+
var _getDataConsumerMark, _getDataConsumerMark$;
|
|
226
|
+
return (_getDataConsumerMark = getDataConsumerMark(props.marks)) === null || _getDataConsumerMark === void 0 ? void 0 : (_getDataConsumerMark$ = _getDataConsumerMark.attrs.sources) === null || _getDataConsumerMark$ === void 0 ? void 0 : _getDataConsumerMark$[0];
|
|
227
|
+
});
|
|
228
|
+
_defineProperty(this, "emitMediaRenderEvent", (event, props = this.props) => {
|
|
229
|
+
var _props$onMediaRenderE;
|
|
230
|
+
(_props$onMediaRenderE = props.onMediaRenderEvent) === null || _props$onMediaRenderE === void 0 ? void 0 : _props$onMediaRenderE.call(props, {
|
|
231
|
+
...event,
|
|
232
|
+
dataConsumerSource: this.getDataConsumerSource(props),
|
|
233
|
+
mediaId: props.id,
|
|
234
|
+
mediaInstance: this.mediaInstance
|
|
235
|
+
});
|
|
236
|
+
});
|
|
237
|
+
_defineProperty(this, "onPreviewRender", renderedMediaId => {
|
|
238
|
+
var _this$props$onPreview, _this$props;
|
|
239
|
+
(_this$props$onPreview = (_this$props = this.props).onPreviewRender) === null || _this$props$onPreview === void 0 ? void 0 : _this$props$onPreview.call(_this$props, renderedMediaId);
|
|
240
|
+
this.emitMediaRenderEvent({
|
|
241
|
+
renderedMediaId,
|
|
242
|
+
type: 'preview-rendered'
|
|
243
|
+
});
|
|
244
|
+
});
|
|
245
|
+
_defineProperty(this, "onError", reason => {
|
|
246
|
+
var _this$props$onError, _this$props2;
|
|
247
|
+
(_this$props$onError = (_this$props2 = this.props).onError) === null || _this$props$onError === void 0 ? void 0 : _this$props$onError.call(_this$props2, reason);
|
|
248
|
+
this.emitMediaRenderEvent({
|
|
249
|
+
reason,
|
|
250
|
+
type: 'error'
|
|
251
|
+
});
|
|
252
|
+
});
|
|
221
253
|
_defineProperty(this, "renderCard", (providers = {}) => {
|
|
222
254
|
var _dataConsumerMark$att;
|
|
223
255
|
const {
|
|
@@ -287,7 +319,9 @@ class Media extends PureComponent {
|
|
|
287
319
|
alt: allowAltTextOnImages ? alt : undefined,
|
|
288
320
|
featureFlags: featureFlags,
|
|
289
321
|
shouldEnableDownloadButton: enableDownloadButton,
|
|
290
|
-
ssr: ssr
|
|
322
|
+
ssr: ssr,
|
|
323
|
+
onError: this.props.onMediaRenderEvent || this.props.onError ? this.onError : undefined,
|
|
324
|
+
onPreviewRender: this.props.onMediaRenderEvent || this.props.onPreviewRender ? this.onPreviewRender : undefined
|
|
291
325
|
}))))));
|
|
292
326
|
});
|
|
293
327
|
_defineProperty(this, "handleMediaLinkClick", event => {
|
|
@@ -320,6 +354,9 @@ class Media extends PureComponent {
|
|
|
320
354
|
}
|
|
321
355
|
componentDidMount() {
|
|
322
356
|
var _dataConsumerMark$att2;
|
|
357
|
+
this.emitMediaRenderEvent({
|
|
358
|
+
type: 'mounted'
|
|
359
|
+
});
|
|
323
360
|
const dataConsumerMark = this.getDataConsumerMark();
|
|
324
361
|
const infographicType = dataConsumerMark === null || dataConsumerMark === void 0 ? void 0 : (_dataConsumerMark$att2 = dataConsumerMark.attrs.sources) === null || _dataConsumerMark$att2 === void 0 ? void 0 : _dataConsumerMark$att2[0];
|
|
325
362
|
if (infographicType && this.props.fireAnalyticsEvent) {
|
|
@@ -336,6 +373,21 @@ class Media extends PureComponent {
|
|
|
336
373
|
});
|
|
337
374
|
}
|
|
338
375
|
}
|
|
376
|
+
componentDidUpdate(prevProps) {
|
|
377
|
+
if (prevProps.id !== this.props.id || this.getDataConsumerSource(prevProps) !== this.getDataConsumerSource() || prevProps.onMediaRenderEvent !== this.props.onMediaRenderEvent) {
|
|
378
|
+
this.emitMediaRenderEvent({
|
|
379
|
+
type: 'unmounted'
|
|
380
|
+
}, prevProps);
|
|
381
|
+
this.emitMediaRenderEvent({
|
|
382
|
+
type: 'mounted'
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
componentWillUnmount() {
|
|
387
|
+
this.emitMediaRenderEvent({
|
|
388
|
+
type: 'unmounted'
|
|
389
|
+
});
|
|
390
|
+
}
|
|
339
391
|
render() {
|
|
340
392
|
const {
|
|
341
393
|
providers
|
|
@@ -63,12 +63,13 @@ export class MediaCardView extends Component {
|
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
65
|
_defineProperty(this, "onError", reason => {
|
|
66
|
-
var _this$props$fireAnaly, _this$
|
|
66
|
+
var _this$props$onError, _this$props, _this$props$fireAnaly, _this$props2;
|
|
67
67
|
const {
|
|
68
68
|
nestedUnder,
|
|
69
69
|
rendererContext
|
|
70
70
|
} = this.props;
|
|
71
|
-
(_this$props$
|
|
71
|
+
(_this$props$onError = (_this$props = this.props).onError) === null || _this$props$onError === void 0 ? void 0 : _this$props$onError.call(_this$props, reason);
|
|
72
|
+
(_this$props$fireAnaly = (_this$props2 = this.props).fireAnalyticsEvent) === null || _this$props$fireAnaly === void 0 ? void 0 : _this$props$fireAnaly.call(_this$props2, {
|
|
72
73
|
action: ACTION.ERRORED,
|
|
73
74
|
actionSubject: ACTION_SUBJECT.RENDERER,
|
|
74
75
|
actionSubjectId: ACTION_SUBJECT_ID.MEDIA,
|
|
@@ -85,6 +86,16 @@ export class MediaCardView extends Component {
|
|
|
85
86
|
}
|
|
86
87
|
});
|
|
87
88
|
});
|
|
89
|
+
_defineProperty(this, "onConsumerError", reason => {
|
|
90
|
+
var _this$props$onError2, _this$props3;
|
|
91
|
+
(_this$props$onError2 = (_this$props3 = this.props).onError) === null || _this$props$onError2 === void 0 ? void 0 : _this$props$onError2.call(_this$props3, reason);
|
|
92
|
+
});
|
|
93
|
+
_defineProperty(this, "getMediaErrorHandler", () => {
|
|
94
|
+
if (expValEquals('platform_editor_media_error_analytics', 'isEnabled', true)) {
|
|
95
|
+
return this.onError;
|
|
96
|
+
}
|
|
97
|
+
return this.props.onError ? this.onConsumerError : undefined;
|
|
98
|
+
});
|
|
88
99
|
_defineProperty(this, "renderLoadingCard", () => {
|
|
89
100
|
const {
|
|
90
101
|
cardDimensions
|
|
@@ -218,7 +229,8 @@ export class MediaCardView extends Component {
|
|
|
218
229
|
featureFlags: featureFlags,
|
|
219
230
|
ssr: ssr === null || ssr === void 0 ? void 0 : ssr.mode,
|
|
220
231
|
shouldHideTooltip: false,
|
|
221
|
-
onError:
|
|
232
|
+
onError: this.getMediaErrorHandler(),
|
|
233
|
+
onPreviewRender: this.props.onPreviewRender
|
|
222
234
|
}))
|
|
223
235
|
);
|
|
224
236
|
}
|
|
@@ -316,7 +328,8 @@ export class MediaCardView extends Component {
|
|
|
316
328
|
shouldHideTooltip: isMobile,
|
|
317
329
|
mediaViewerExtensions: mediaViewerExtensions,
|
|
318
330
|
fallbackMediaNameFetcher: fallbackMediaNameFetcher,
|
|
319
|
-
onError:
|
|
331
|
+
onError: this.getMediaErrorHandler(),
|
|
332
|
+
onPreviewRender: this.props.onPreviewRender
|
|
320
333
|
}));
|
|
321
334
|
}
|
|
322
335
|
}
|
|
@@ -1278,6 +1278,14 @@ const centerWrapperStyles = css({
|
|
|
1278
1278
|
}
|
|
1279
1279
|
}
|
|
1280
1280
|
});
|
|
1281
|
+
|
|
1282
|
+
// Reset only Expands with no preceding content sibling. Streaming SSR style/script siblings
|
|
1283
|
+
// are ignored so moving them to the head on the client does not change the top margin.
|
|
1284
|
+
const expandSsrMarginStyles = css({
|
|
1285
|
+
[`.${RendererCssClassName.DOCUMENT} .${RendererCssClassName.STICKY_SAFE_BREAKOUT_INNER} > [data-node-type='expand']:not(:not(style, script) ~ *)`]: {
|
|
1286
|
+
marginTop: 0
|
|
1287
|
+
}
|
|
1288
|
+
});
|
|
1281
1289
|
const baseOtherStylesDuplicateAnchor = css({
|
|
1282
1290
|
'& .UnknownBlock': {
|
|
1283
1291
|
fontFamily: "var(--ds-font-family-body, \"Atlassian Sans\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
|
|
@@ -2919,7 +2927,7 @@ export const RendererStyleContainer = props => {
|
|
|
2919
2927
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
2920
2928
|
textHighlightPaddingStyles, tasksAndDecisionsStyles, expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) && headingPanelStyles, smartCardStyles, smartCardStylesAvatarFix, headerSmartCardStyles, smartCardStylesAvatarMarginFix, smartCardStylesAvatarListZeroMarginTop, fg('editor_inline_comments_on_inline_nodes') && (expValEquals('confluence_fe_renderer_inline_node_mark_color_fix', 'isEnabled', true) ? rendererAnnotationStyles : rendererAnnotationStylesOld),
|
|
2921
2929
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
2922
|
-
fg('editor_inline_comments_on_inline_nodes') && rendererAnnotationStylesCommentHeightFix, expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? baseOtherStyles : baseOtherStylesDuplicateAnchor,
|
|
2930
|
+
fg('editor_inline_comments_on_inline_nodes') && rendererAnnotationStylesCommentHeightFix, expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? baseOtherStyles : baseOtherStylesDuplicateAnchor, fg('platform_renderer_expand_ssr_margin_fix') && expandSsrMarginStyles,
|
|
2923
2931
|
// this should be placed after baseOtherStyles
|
|
2924
2932
|
expValEquals('platform_editor_render_bodied_extension_as_inline', 'isEnabled', true) && (expValEquals('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? extensionAsInlineStyle : oldExtensionAsInlineStyle), fg('platform_forge_inline_bodied_macro') && [migratedInlineBodiedFlowStyle, forgeInlineBodiedSpacingStyle], inlineExtensionRendererMarginFix, allowNestedHeaderLinks && (expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? alignedHeadingAnchorStyle : alignedHeadingAnchorStyleDuplicateAnchor), mediaSingleSharedStyle, firstWrappedMediaStyles, tableSharedStyle, expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) && roundedTableOuterBorderOverlayStyles, expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) && roundedTableRemixBlockHighlightStyles, expValEquals('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true) && tableContentModeScopedStyles, expValEquals('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true) && isExperimentEnabled('platform_editor_table_fit_to_content_patch_2') && tableContentModeExtensionContainmentStyles, expValEquals('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true) && tableContentModeNestedTableStyles, tableRendererHeaderStylesForTableCellOnly, fg('platform_editor_bordered_panel_nested_in_table') && tableRendererNestedPanelStyles, isBackgroundClipBrowserFixNeeded() && tableStylesBackGroundClipForGeckoForTableCellOnly, firstNodeWithNotMarginTopWithNestedDnD, rendererTableStyles, isStickyScrollbarOn && stickyScrollbarStyles, isStickyScrollbarOn && isExperimentEnabled('platform_editor_table_css_overflow_shadow') && stickyScrollbarOverflowShadowFixStyles, rendererTableHeaderEqualHeightStylesForTableCellOnly, allowColumnSorting && rendererTableSortableColumnStyles, allowColumnSorting && expValEqualsNoExposure('platform_editor_table_menu_updates', 'isEnabled', true) && rendererTableSortableColumnValignStyles, allowColumnSorting && allowNestedHeaderLinks && (expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinks : rendererTableHeaderEqualHeightStylesAllowNestedHeaderLinksDuplicateAnchor), rendererTableColumnStyles, stickyHeaderStyles, codeBlockAndLayoutStyles, columnLayoutSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveSharedStyle, isAdvancedLayoutsOn && columnLayoutResponsiveRendererStyles, isAdvancedLayoutsOn && layoutSectionForAdvancedLayoutsStyles, !useBlockRenderForCodeBlock && gridRenderForCodeBlockStyles, browser.safari && codeBlockInListSafariFixStyles, appearance === 'full-page' && !isPreviewPanelResponsivenessOn && responsiveBreakoutWidth, appearance === 'full-page' && isPreviewPanelResponsivenessOn && responsiveBreakoutWidthWithReducedPadding, (appearance === 'full-width' || appearance === 'max' && (expValEquals('editor_tinymce_full_width_mode', 'isEnabled', true) || expValEquals('confluence_max_width_content_appearance', 'isEnabled', true))) && responsiveBreakoutWidthFullWidth, expValEquals('platform_editor_lovability_emoji_scaling', 'isEnabled', true) ? contentMode === 'compact' ? scaledDenseEmojiStyles : scaledEmojiStyles : contentMode === 'compact' ? denseStyles : undefined, contentMode === 'compact' ? scaledDenseUnicodeEmojiStylesNew : scaledUnicodeEmojiStylesNew, syncBlockStyles, centerWrapperStyles, isInsideSyncBlock ? syncBlockRendererStyles : null, isInsideSyncBlock && tableFakeBorderStyles, isInsideSyncBlock && expValEquals('platform_editor_table_q4_loveability', 'isEnabled', true) ? roundedTableFakeBorderOverlayStyles : null, expValEquals('platform_editor_hide_extension_renderer_support', 'isEnabled', true) && hideExtensionStyles],
|
|
2925
2933
|
"data-testid": testId
|
|
@@ -59,7 +59,7 @@ export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
59
59
|
const TABLE_INFO_TIMEOUT = 10000;
|
|
60
60
|
const RENDER_EVENT_SAMPLE_RATE = 0.1;
|
|
61
61
|
const packageName = "@atlaskit/renderer";
|
|
62
|
-
const packageVersion = "139.
|
|
62
|
+
const packageVersion = "139.1.1";
|
|
63
63
|
const setAsQueryContainerStyles = css({
|
|
64
64
|
containerName: 'ak-renderer-wrapper',
|
|
65
65
|
containerType: 'inline-size'
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
2
2
|
import { bind } from 'bind-event-listener';
|
|
3
|
+
import isEqual from 'lodash/isEqual';
|
|
3
4
|
import { COLLAPSED_CONTENT_OWNERS_ATTRIBUTE, getCollapsedContentOwners, getOwnedRendererDocuments, reconcileCollapsedHeadingContent } from './collapsible-headings-dom';
|
|
4
5
|
import { buildTopLevelHeadingSections } from './collapsible-headings-section-model';
|
|
5
6
|
const CollapsibleHeadingsContext = /*#__PURE__*/React.createContext(null);
|
|
6
7
|
const emptyCollapsedHeadings = new Set();
|
|
7
8
|
function isSameDocument(currentDocument, nextDocument) {
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
if (currentDocument === nextDocument) {
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
if (!currentDocument || !nextDocument) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
// Node.eq compares node-type identity. The shared schema cache can be evicted by another
|
|
16
|
+
// renderer, producing different node types for identical content on the next render.
|
|
17
|
+
return currentDocument.type.schema === nextDocument.type.schema ? currentDocument.eq(nextDocument) : isEqual(currentDocument.toJSON(), nextDocument.toJSON());
|
|
10
18
|
}
|
|
11
19
|
function supportsHiddenUntilFound(rendererRef) {
|
|
12
20
|
var _rendererRef$current;
|
package/dist/esm/react/index.js
CHANGED
|
@@ -502,7 +502,8 @@ var ReactSerializer = /*#__PURE__*/function () {
|
|
|
502
502
|
_this$media,
|
|
503
503
|
_this$media2,
|
|
504
504
|
_this$media3,
|
|
505
|
-
_this$media4
|
|
505
|
+
_this$media4,
|
|
506
|
+
_this$media5;
|
|
506
507
|
var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
507
508
|
var _node$type$schema$mar = node.type.schema.marks,
|
|
508
509
|
annotation = _node$type$schema$mar.annotation,
|
|
@@ -539,6 +540,7 @@ var ReactSerializer = /*#__PURE__*/function () {
|
|
|
539
540
|
enableSyncMediaCard: (_this$media2 = this.media) === null || _this$media2 === void 0 ? void 0 : _this$media2.enableSyncMediaCard,
|
|
540
541
|
mediaViewerExtensions: (_this$media3 = this.media) === null || _this$media3 === void 0 ? void 0 : _this$media3.mediaViewerExtensions,
|
|
541
542
|
fallbackMediaNameFetcher: (_this$media4 = this.media) === null || _this$media4 === void 0 ? void 0 : _this$media4.fallbackMediaNameFetcher,
|
|
543
|
+
onMediaRenderEvent: (_this$media5 = this.media) === null || _this$media5 === void 0 ? void 0 : _this$media5.onMediaRenderEvent,
|
|
542
544
|
nestedUnder: nestedUnder
|
|
543
545
|
});
|
|
544
546
|
}
|
|
@@ -601,22 +603,22 @@ var ReactSerializer = /*#__PURE__*/function () {
|
|
|
601
603
|
}, {
|
|
602
604
|
key: "getMediaGroupProps",
|
|
603
605
|
value: function getMediaGroupProps(node) {
|
|
604
|
-
var _this$
|
|
606
|
+
var _this$media6, _this$media7;
|
|
605
607
|
return _objectSpread(_objectSpread({}, this.getProps(node)), {}, {
|
|
606
608
|
shouldOpenMediaViewer: this.shouldOpenMediaViewer,
|
|
607
609
|
allowAltTextOnImages: this.allowAltTextOnImages,
|
|
608
610
|
featureFlags: this.media && this.media.featureFlags,
|
|
609
|
-
enableDownloadButton: (_this$
|
|
610
|
-
ssr: (_this$
|
|
611
|
+
enableDownloadButton: (_this$media6 = this.media) === null || _this$media6 === void 0 ? void 0 : _this$media6.enableDownloadButton,
|
|
612
|
+
ssr: (_this$media7 = this.media) === null || _this$media7 === void 0 ? void 0 : _this$media7.ssr
|
|
611
613
|
});
|
|
612
614
|
}
|
|
613
615
|
}, {
|
|
614
616
|
key: "getMediaInlineProps",
|
|
615
617
|
value: function getMediaInlineProps(node) {
|
|
616
|
-
var _this$
|
|
618
|
+
var _this$media8, _this$media9;
|
|
617
619
|
return _objectSpread(_objectSpread({}, this.getProps(node)), {}, {
|
|
618
|
-
ssr: (_this$
|
|
619
|
-
fallbackMediaNameFetcher: (_this$
|
|
620
|
+
ssr: (_this$media8 = this.media) === null || _this$media8 === void 0 ? void 0 : _this$media8.ssr,
|
|
621
|
+
fallbackMediaNameFetcher: (_this$media9 = this.media) === null || _this$media9 === void 0 ? void 0 : _this$media9.fallbackMediaNameFetcher
|
|
620
622
|
});
|
|
621
623
|
}
|
|
622
624
|
}, {
|
|
@@ -10,7 +10,7 @@ import { jsx, css } from '@emotion/react';
|
|
|
10
10
|
import { useContext, useState, useRef } from 'react';
|
|
11
11
|
import { Card, EmbedResizeMessageListener } from '@atlaskit/smart-card';
|
|
12
12
|
import { CardSSR } from '@atlaskit/smart-card/ssr';
|
|
13
|
-
import { SmartCardContext } from '@atlaskit/link-provider';
|
|
13
|
+
import { SmartCardContext } from '@atlaskit/link-provider/context';
|
|
14
14
|
import { WidthConsumer, UnsupportedBlock, MediaSingle as UIMediaSingle, WidthContext } from '@atlaskit/editor-common/ui';
|
|
15
15
|
import { akEditorDefaultLayoutWidth, akEditorFullPageNarrowBreakout, akEditorFullWidthLayoutWidth, DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH } from '@atlaskit/editor-shared-styles';
|
|
16
16
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
@@ -169,7 +169,7 @@ export var renderExtension = function renderExtension(content, layout) {
|
|
|
169
169
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
170
170
|
,
|
|
171
171
|
className: "".concat(RendererCssClassName.EXTENSION_INNER_WRAPPER, " ").concat(overflowContainerClass),
|
|
172
|
-
css: [(!isInsideOfTable || isExperimentEnabled('platform_editor_table_fit_to_content_patch_2')) && !isInsideOfInlineExtension &&
|
|
172
|
+
css: [(!isInsideOfTable || isExperimentEnabled('platform_editor_table_fit_to_content_patch_2')) && !isInsideOfInlineExtension && containerStyle]
|
|
173
173
|
}, asInlineAnalytics, content));
|
|
174
174
|
return centerAlignClass ? jsx("div", {
|
|
175
175
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
@@ -201,7 +201,7 @@ export var renderExtension = function renderExtension(content, layout) {
|
|
|
201
201
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
202
202
|
,
|
|
203
203
|
className: "".concat(RendererCssClassName.EXTENSION_INNER_WRAPPER, " ").concat(overflowContainerClass),
|
|
204
|
-
css: [(!isInsideOfTable || isExperimentEnabled('platform_editor_table_fit_to_content_patch_2')) && !isInsideOfInlineExtension &&
|
|
204
|
+
css: [(!isInsideOfTable || isExperimentEnabled('platform_editor_table_fit_to_content_patch_2')) && !isInsideOfInlineExtension && containerStyle]
|
|
205
205
|
}, asInlineAnalytics, content));
|
|
206
206
|
return centerAlignClass ? jsx("div", {
|
|
207
207
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
@@ -8,7 +8,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
8
8
|
import { Fragment, useState, useMemo, useEffect } from 'react';
|
|
9
9
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
10
10
|
import { jsx } from '@emotion/react';
|
|
11
|
-
import { useSmartCardContext } from '@atlaskit/link-provider';
|
|
11
|
+
import { useSmartCardContext } from '@atlaskit/link-provider/use-smart-card-context';
|
|
12
12
|
import { Card, getObjectAri, getObjectIconUrl, getObjectName } from '@atlaskit/smart-card';
|
|
13
13
|
import { isWithinPreviewPanelIFrame } from '@atlaskit/linking-common/utils';
|
|
14
14
|
import { useSmartLinkActions } from '@atlaskit/smart-card/hooks';
|
|
@@ -37,6 +37,15 @@ import { useInlineCommentsFilter } from '../../../ui/annotations/hooks/use-inlin
|
|
|
37
37
|
import { useInlineCommentSubscriberContext } from '../../../ui/annotations/hooks/use-inline-comment-subscriber';
|
|
38
38
|
import { AnnotationUpdateEvent } from '@atlaskit/editor-common/types';
|
|
39
39
|
import { useAnnotationRangeState } from '../../../ui/annotations/contexts/AnnotationRangeContext';
|
|
40
|
+
var getDataConsumerMark = function getDataConsumerMark(marks) {
|
|
41
|
+
return marks.find(function (mark) {
|
|
42
|
+
var _mark$type;
|
|
43
|
+
return mark.type === 'dataConsumer' || ((_mark$type = mark.type) === null || _mark$type === void 0 ? void 0 : _mark$type.name) === 'dataConsumer';
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
var getRemixDataConsumerMark = function getRemixDataConsumerMark(marks) {
|
|
47
|
+
return fg('cc-maui-add-mark-for-remix-generated-images') ? getDataConsumerMark(marks) : undefined;
|
|
48
|
+
};
|
|
40
49
|
var linkStyle = css({
|
|
41
50
|
position: 'absolute',
|
|
42
51
|
background: 'transparent',
|
|
@@ -233,32 +242,60 @@ var CommentBadgeWrapper = function CommentBadgeWrapper(_ref5) {
|
|
|
233
242
|
// Ignored via go/ees005
|
|
234
243
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
235
244
|
var Media = /*#__PURE__*/function (_PureComponent) {
|
|
236
|
-
function Media(
|
|
245
|
+
function Media(_props) {
|
|
237
246
|
var _this;
|
|
238
247
|
_classCallCheck(this, Media);
|
|
239
|
-
_this = _callSuper(this, Media, [
|
|
248
|
+
_this = _callSuper(this, Media, [_props]);
|
|
249
|
+
_defineProperty(_this, "mediaInstance", {});
|
|
240
250
|
_defineProperty(_this, "getDataConsumerMark", function () {
|
|
241
|
-
return
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
251
|
+
return getRemixDataConsumerMark(_this.props.marks);
|
|
252
|
+
});
|
|
253
|
+
_defineProperty(_this, "getDataConsumerSource", function () {
|
|
254
|
+
var _getDataConsumerMark;
|
|
255
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.props;
|
|
256
|
+
return (_getDataConsumerMark = getDataConsumerMark(props.marks)) === null || _getDataConsumerMark === void 0 || (_getDataConsumerMark = _getDataConsumerMark.attrs.sources) === null || _getDataConsumerMark === void 0 ? void 0 : _getDataConsumerMark[0];
|
|
257
|
+
});
|
|
258
|
+
_defineProperty(_this, "emitMediaRenderEvent", function (event) {
|
|
259
|
+
var _props$onMediaRenderE;
|
|
260
|
+
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _this.props;
|
|
261
|
+
(_props$onMediaRenderE = props.onMediaRenderEvent) === null || _props$onMediaRenderE === void 0 || _props$onMediaRenderE.call(props, _objectSpread(_objectSpread({}, event), {}, {
|
|
262
|
+
dataConsumerSource: _this.getDataConsumerSource(props),
|
|
263
|
+
mediaId: props.id,
|
|
264
|
+
mediaInstance: _this.mediaInstance
|
|
265
|
+
}));
|
|
266
|
+
});
|
|
267
|
+
_defineProperty(_this, "onPreviewRender", function (renderedMediaId) {
|
|
268
|
+
var _this$props$onPreview, _this$props;
|
|
269
|
+
(_this$props$onPreview = (_this$props = _this.props).onPreviewRender) === null || _this$props$onPreview === void 0 || _this$props$onPreview.call(_this$props, renderedMediaId);
|
|
270
|
+
_this.emitMediaRenderEvent({
|
|
271
|
+
renderedMediaId: renderedMediaId,
|
|
272
|
+
type: 'preview-rendered'
|
|
273
|
+
});
|
|
274
|
+
});
|
|
275
|
+
_defineProperty(_this, "onError", function (reason) {
|
|
276
|
+
var _this$props$onError, _this$props2;
|
|
277
|
+
(_this$props$onError = (_this$props2 = _this.props).onError) === null || _this$props$onError === void 0 || _this$props$onError.call(_this$props2, reason);
|
|
278
|
+
_this.emitMediaRenderEvent({
|
|
279
|
+
reason: reason,
|
|
280
|
+
type: 'error'
|
|
281
|
+
});
|
|
245
282
|
});
|
|
246
283
|
_defineProperty(_this, "renderCard", function () {
|
|
247
284
|
var _dataConsumerMark$att;
|
|
248
285
|
var providers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
249
286
|
var contextIdentifierProvider = providers.contextIdentifierProvider;
|
|
250
|
-
var _this$
|
|
251
|
-
allowAltTextOnImages = _this$
|
|
252
|
-
alt = _this$
|
|
253
|
-
featureFlags = _this$
|
|
254
|
-
allowMediaViewer = _this$
|
|
255
|
-
enableDownloadButton = _this$
|
|
256
|
-
ssr = _this$
|
|
257
|
-
width = _this$
|
|
258
|
-
height = _this$
|
|
259
|
-
mediaSingleElement = _this$
|
|
260
|
-
_this$
|
|
261
|
-
isDrafting = _this$
|
|
287
|
+
var _this$props3 = _this.props,
|
|
288
|
+
allowAltTextOnImages = _this$props3.allowAltTextOnImages,
|
|
289
|
+
alt = _this$props3.alt,
|
|
290
|
+
featureFlags = _this$props3.featureFlags,
|
|
291
|
+
allowMediaViewer = _this$props3.shouldOpenMediaViewer,
|
|
292
|
+
enableDownloadButton = _this$props3.enableDownloadButton,
|
|
293
|
+
ssr = _this$props3.ssr,
|
|
294
|
+
width = _this$props3.width,
|
|
295
|
+
height = _this$props3.height,
|
|
296
|
+
mediaSingleElement = _this$props3.mediaSingleElement,
|
|
297
|
+
_this$props3$isDrafti = _this$props3.isDrafting,
|
|
298
|
+
isDrafting = _this$props3$isDrafti === void 0 ? false : _this$props3$isDrafti;
|
|
262
299
|
var annotationMarks = _this.props.isAnnotationMark ? _this.props.marks.filter(_this.props.isAnnotationMark) : undefined;
|
|
263
300
|
var borderMark = _this.props.marks.find(_this.props.isBorderMark);
|
|
264
301
|
var dataConsumerMark = _this.getDataConsumerMark();
|
|
@@ -310,14 +347,16 @@ var Media = /*#__PURE__*/function (_PureComponent) {
|
|
|
310
347
|
alt: allowAltTextOnImages ? alt : undefined,
|
|
311
348
|
featureFlags: featureFlags,
|
|
312
349
|
shouldEnableDownloadButton: enableDownloadButton,
|
|
313
|
-
ssr: ssr
|
|
350
|
+
ssr: ssr,
|
|
351
|
+
onError: _this.props.onMediaRenderEvent || _this.props.onError ? _this.onError : undefined,
|
|
352
|
+
onPreviewRender: _this.props.onMediaRenderEvent || _this.props.onPreviewRender ? _this.onPreviewRender : undefined
|
|
314
353
|
}))))));
|
|
315
354
|
});
|
|
316
355
|
_defineProperty(_this, "handleMediaLinkClick", function (event) {
|
|
317
|
-
var _this$
|
|
318
|
-
fireAnalyticsEvent = _this$
|
|
319
|
-
isLinkMark = _this$
|
|
320
|
-
marks = _this$
|
|
356
|
+
var _this$props4 = _this.props,
|
|
357
|
+
fireAnalyticsEvent = _this$props4.fireAnalyticsEvent,
|
|
358
|
+
isLinkMark = _this$props4.isLinkMark,
|
|
359
|
+
marks = _this$props4.marks;
|
|
321
360
|
if (fireAnalyticsEvent) {
|
|
322
361
|
fireAnalyticsEvent({
|
|
323
362
|
action: ACTION.VISITED,
|
|
@@ -346,6 +385,9 @@ var Media = /*#__PURE__*/function (_PureComponent) {
|
|
|
346
385
|
key: "componentDidMount",
|
|
347
386
|
value: function componentDidMount() {
|
|
348
387
|
var _dataConsumerMark$att2;
|
|
388
|
+
this.emitMediaRenderEvent({
|
|
389
|
+
type: 'mounted'
|
|
390
|
+
});
|
|
349
391
|
var dataConsumerMark = this.getDataConsumerMark();
|
|
350
392
|
var infographicType = dataConsumerMark === null || dataConsumerMark === void 0 || (_dataConsumerMark$att2 = dataConsumerMark.attrs.sources) === null || _dataConsumerMark$att2 === void 0 ? void 0 : _dataConsumerMark$att2[0];
|
|
351
393
|
if (infographicType && this.props.fireAnalyticsEvent) {
|
|
@@ -362,6 +404,25 @@ var Media = /*#__PURE__*/function (_PureComponent) {
|
|
|
362
404
|
});
|
|
363
405
|
}
|
|
364
406
|
}
|
|
407
|
+
}, {
|
|
408
|
+
key: "componentDidUpdate",
|
|
409
|
+
value: function componentDidUpdate(prevProps) {
|
|
410
|
+
if (prevProps.id !== this.props.id || this.getDataConsumerSource(prevProps) !== this.getDataConsumerSource() || prevProps.onMediaRenderEvent !== this.props.onMediaRenderEvent) {
|
|
411
|
+
this.emitMediaRenderEvent({
|
|
412
|
+
type: 'unmounted'
|
|
413
|
+
}, prevProps);
|
|
414
|
+
this.emitMediaRenderEvent({
|
|
415
|
+
type: 'mounted'
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
}, {
|
|
420
|
+
key: "componentWillUnmount",
|
|
421
|
+
value: function componentWillUnmount() {
|
|
422
|
+
this.emitMediaRenderEvent({
|
|
423
|
+
type: 'unmounted'
|
|
424
|
+
});
|
|
425
|
+
}
|
|
365
426
|
}, {
|
|
366
427
|
key: "render",
|
|
367
428
|
value: function render() {
|
package/dist/esm/ui/MediaCard.js
CHANGED
|
@@ -99,11 +99,12 @@ export var MediaCardView = /*#__PURE__*/function (_Component) {
|
|
|
99
99
|
};
|
|
100
100
|
}());
|
|
101
101
|
_defineProperty(_this, "onError", function (reason) {
|
|
102
|
-
var _this$props$fireAnaly, _this$
|
|
102
|
+
var _this$props$onError, _this$props3, _this$props$fireAnaly, _this$props4;
|
|
103
103
|
var _this$props2 = _this.props,
|
|
104
104
|
nestedUnder = _this$props2.nestedUnder,
|
|
105
105
|
rendererContext = _this$props2.rendererContext;
|
|
106
|
-
(_this$props$
|
|
106
|
+
(_this$props$onError = (_this$props3 = _this.props).onError) === null || _this$props$onError === void 0 || _this$props$onError.call(_this$props3, reason);
|
|
107
|
+
(_this$props$fireAnaly = (_this$props4 = _this.props).fireAnalyticsEvent) === null || _this$props$fireAnaly === void 0 || _this$props$fireAnaly.call(_this$props4, {
|
|
107
108
|
action: ACTION.ERRORED,
|
|
108
109
|
actionSubject: ACTION_SUBJECT.RENDERER,
|
|
109
110
|
actionSubjectId: ACTION_SUBJECT_ID.MEDIA,
|
|
@@ -118,6 +119,16 @@ export var MediaCardView = /*#__PURE__*/function (_Component) {
|
|
|
118
119
|
} : {})
|
|
119
120
|
});
|
|
120
121
|
});
|
|
122
|
+
_defineProperty(_this, "onConsumerError", function (reason) {
|
|
123
|
+
var _this$props$onError2, _this$props5;
|
|
124
|
+
(_this$props$onError2 = (_this$props5 = _this.props).onError) === null || _this$props$onError2 === void 0 || _this$props$onError2.call(_this$props5, reason);
|
|
125
|
+
});
|
|
126
|
+
_defineProperty(_this, "getMediaErrorHandler", function () {
|
|
127
|
+
if (expValEquals('platform_editor_media_error_analytics', 'isEnabled', true)) {
|
|
128
|
+
return _this.onError;
|
|
129
|
+
}
|
|
130
|
+
return _this.props.onError ? _this.onConsumerError : undefined;
|
|
131
|
+
});
|
|
121
132
|
_defineProperty(_this, "renderLoadingCard", function () {
|
|
122
133
|
var cardDimensions = _this.props.cardDimensions;
|
|
123
134
|
return /*#__PURE__*/React.createElement(CardLoading, {
|
|
@@ -151,11 +162,11 @@ export var MediaCardView = /*#__PURE__*/function (_Component) {
|
|
|
151
162
|
key: "componentDidMount",
|
|
152
163
|
value: function () {
|
|
153
164
|
var _componentDidMount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
154
|
-
var _this$
|
|
165
|
+
var _this$props6, rendererContext, contextIdentifierProvider, id, url, collectionName, nodeIsInCache, _t2, _t3;
|
|
155
166
|
return _regeneratorRuntime.wrap(function (_context2) {
|
|
156
167
|
while (1) switch (_context2.prev = _context2.next) {
|
|
157
168
|
case 0:
|
|
158
|
-
_this$
|
|
169
|
+
_this$props6 = this.props, rendererContext = _this$props6.rendererContext, contextIdentifierProvider = _this$props6.contextIdentifierProvider, id = _this$props6.id, url = _this$props6.url, collectionName = _this$props6.collection;
|
|
159
170
|
if (!contextIdentifierProvider) {
|
|
160
171
|
_context2.next = 2;
|
|
161
172
|
break;
|
|
@@ -206,9 +217,9 @@ export var MediaCardView = /*#__PURE__*/function (_Component) {
|
|
|
206
217
|
}, {
|
|
207
218
|
key: "componentWillUnmount",
|
|
208
219
|
value: function componentWillUnmount() {
|
|
209
|
-
var _this$
|
|
210
|
-
id = _this$
|
|
211
|
-
dataURI = _this$
|
|
220
|
+
var _this$props7 = this.props,
|
|
221
|
+
id = _this$props7.id,
|
|
222
|
+
dataURI = _this$props7.url;
|
|
212
223
|
if (id) {
|
|
213
224
|
mediaIdentifierMap.delete(id);
|
|
214
225
|
} else if (dataURI) {
|
|
@@ -218,20 +229,20 @@ export var MediaCardView = /*#__PURE__*/function (_Component) {
|
|
|
218
229
|
}, {
|
|
219
230
|
key: "renderExternal",
|
|
220
231
|
value: function renderExternal(shouldOpenMediaViewer) {
|
|
221
|
-
var _this$
|
|
222
|
-
cardDimensions = _this$
|
|
223
|
-
resizeMode = _this$
|
|
224
|
-
appearance = _this$
|
|
225
|
-
url = _this$
|
|
226
|
-
imageStatus = _this$
|
|
227
|
-
disableOverlay = _this$
|
|
228
|
-
alt = _this$
|
|
229
|
-
featureFlags = _this$
|
|
230
|
-
ssr = _this$
|
|
231
|
-
mediaClient = _this$
|
|
232
|
-
dataAttributes = _this$
|
|
233
|
-
enableSyncMediaCard = _this$
|
|
234
|
-
localId = _this$
|
|
232
|
+
var _this$props8 = this.props,
|
|
233
|
+
cardDimensions = _this$props8.cardDimensions,
|
|
234
|
+
resizeMode = _this$props8.resizeMode,
|
|
235
|
+
appearance = _this$props8.appearance,
|
|
236
|
+
url = _this$props8.url,
|
|
237
|
+
imageStatus = _this$props8.imageStatus,
|
|
238
|
+
disableOverlay = _this$props8.disableOverlay,
|
|
239
|
+
alt = _this$props8.alt,
|
|
240
|
+
featureFlags = _this$props8.featureFlags,
|
|
241
|
+
ssr = _this$props8.ssr,
|
|
242
|
+
mediaClient = _this$props8.mediaClient,
|
|
243
|
+
dataAttributes = _this$props8.dataAttributes,
|
|
244
|
+
enableSyncMediaCard = _this$props8.enableSyncMediaCard,
|
|
245
|
+
localId = _this$props8.localId;
|
|
235
246
|
if (imageStatus === 'loading' || !url) {
|
|
236
247
|
return this.renderLoadingCard();
|
|
237
248
|
}
|
|
@@ -269,7 +280,8 @@ export var MediaCardView = /*#__PURE__*/function (_Component) {
|
|
|
269
280
|
featureFlags: featureFlags,
|
|
270
281
|
ssr: ssr === null || ssr === void 0 ? void 0 : ssr.mode,
|
|
271
282
|
shouldHideTooltip: false,
|
|
272
|
-
onError:
|
|
283
|
+
onError: this.getMediaErrorHandler(),
|
|
284
|
+
onPreviewRender: this.props.onPreviewRender
|
|
273
285
|
}))
|
|
274
286
|
);
|
|
275
287
|
}
|
|
@@ -280,27 +292,27 @@ export var MediaCardView = /*#__PURE__*/function (_Component) {
|
|
|
280
292
|
var _this$state = this.state,
|
|
281
293
|
contextIdentifierProvider = _this$state.contextIdentifierProvider,
|
|
282
294
|
fileState = _this$state.fileState;
|
|
283
|
-
var _this$
|
|
284
|
-
id = _this$
|
|
285
|
-
alt = _this$
|
|
286
|
-
type = _this$
|
|
287
|
-
collection = _this$
|
|
288
|
-
occurrenceKey = _this$
|
|
289
|
-
cardDimensions = _this$
|
|
290
|
-
resizeMode = _this$
|
|
291
|
-
disableOverlay = _this$
|
|
292
|
-
useInlinePlayer = _this$
|
|
293
|
-
originalDimensions = _this$
|
|
294
|
-
forceOpenMediaViewer = _this$
|
|
295
|
-
featureFlags = _this$
|
|
296
|
-
shouldEnableDownloadButton = _this$
|
|
297
|
-
ssr = _this$
|
|
298
|
-
mediaClient = _this$
|
|
299
|
-
dataAttributes = _this$
|
|
300
|
-
enableSyncMediaCard = _this$
|
|
301
|
-
localId = _this$
|
|
302
|
-
mediaViewerExtensions = _this$
|
|
303
|
-
fallbackMediaNameFetcher = _this$
|
|
295
|
+
var _this$props9 = this.props,
|
|
296
|
+
id = _this$props9.id,
|
|
297
|
+
alt = _this$props9.alt,
|
|
298
|
+
type = _this$props9.type,
|
|
299
|
+
collection = _this$props9.collection,
|
|
300
|
+
occurrenceKey = _this$props9.occurrenceKey,
|
|
301
|
+
cardDimensions = _this$props9.cardDimensions,
|
|
302
|
+
resizeMode = _this$props9.resizeMode,
|
|
303
|
+
disableOverlay = _this$props9.disableOverlay,
|
|
304
|
+
useInlinePlayer = _this$props9.useInlinePlayer,
|
|
305
|
+
originalDimensions = _this$props9.originalDimensions,
|
|
306
|
+
forceOpenMediaViewer = _this$props9.shouldOpenMediaViewer,
|
|
307
|
+
featureFlags = _this$props9.featureFlags,
|
|
308
|
+
shouldEnableDownloadButton = _this$props9.shouldEnableDownloadButton,
|
|
309
|
+
ssr = _this$props9.ssr,
|
|
310
|
+
mediaClient = _this$props9.mediaClient,
|
|
311
|
+
dataAttributes = _this$props9.dataAttributes,
|
|
312
|
+
enableSyncMediaCard = _this$props9.enableSyncMediaCard,
|
|
313
|
+
localId = _this$props9.localId,
|
|
314
|
+
mediaViewerExtensions = _this$props9.mediaViewerExtensions,
|
|
315
|
+
fallbackMediaNameFetcher = _this$props9.fallbackMediaNameFetcher;
|
|
304
316
|
var isMobile = false;
|
|
305
317
|
var shouldPlayInline = useInlinePlayer !== undefined ? useInlinePlayer : true;
|
|
306
318
|
var isInlinePlayer = isMobile ? false : shouldPlayInline;
|
|
@@ -369,7 +381,8 @@ export var MediaCardView = /*#__PURE__*/function (_Component) {
|
|
|
369
381
|
shouldHideTooltip: isMobile,
|
|
370
382
|
mediaViewerExtensions: mediaViewerExtensions,
|
|
371
383
|
fallbackMediaNameFetcher: fallbackMediaNameFetcher,
|
|
372
|
-
onError:
|
|
384
|
+
onError: this.getMediaErrorHandler(),
|
|
385
|
+
onPreviewRender: this.props.onPreviewRender
|
|
373
386
|
}));
|
|
374
387
|
}
|
|
375
388
|
}]);
|