@atlaskit/renderer 138.1.9 → 139.1.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 +33 -0
- package/dist/cjs/react/index.js +10 -19
- package/dist/cjs/react/nodes/layoutSection.js +2 -2
- package/dist/cjs/react/nodes/media/index.js +84 -23
- package/dist/cjs/react/nodes/multiBodiedExtension.js +2 -3
- package/dist/cjs/react/nodes/orderedList.js +2 -2
- package/dist/cjs/ui/ExtensionRenderer.js +2 -3
- 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/es2019/react/index.js +9 -19
- package/dist/es2019/react/nodes/layoutSection.js +2 -2
- package/dist/es2019/react/nodes/media/index.js +59 -7
- package/dist/es2019/react/nodes/multiBodiedExtension.js +2 -3
- package/dist/es2019/react/nodes/orderedList.js +2 -2
- package/dist/es2019/ui/ExtensionRenderer.js +2 -3
- 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/esm/react/index.js +10 -19
- package/dist/esm/react/nodes/layoutSection.js +2 -2
- package/dist/esm/react/nodes/media/index.js +84 -23
- package/dist/esm/react/nodes/multiBodiedExtension.js +2 -3
- package/dist/esm/react/nodes/orderedList.js +2 -2
- package/dist/esm/ui/ExtensionRenderer.js +2 -3
- 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/types/react/nodes/bodiedExtension.d.ts +0 -1
- package/dist/types/react/nodes/extensionFrame.d.ts +0 -1
- package/dist/types/react/nodes/layoutSection.d.ts +0 -1
- package/dist/types/react/nodes/media/index.d.ts +2 -0
- package/dist/types/react/nodes/multiBodiedExtension.d.ts +0 -1
- package/dist/types/react/nodes/orderedList.d.ts +0 -1
- package/dist/types/react/nodes/taskItem.d.ts +1 -1
- package/dist/types/react/types.d.ts +4 -17
- package/dist/types/types/mediaOptions.d.ts +16 -0
- package/dist/types/ui/ExtensionRenderer.d.ts +0 -5
- package/dist/types/ui/MediaCard.d.ts +5 -1
- package/package.json +7 -4
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
|
}]);
|
|
@@ -1071,6 +1071,12 @@ var centerWrapperStyles = css(_defineProperty({}, ".".concat(RendererCssClassNam
|
|
|
1071
1071
|
flexShrink: 0
|
|
1072
1072
|
}
|
|
1073
1073
|
}));
|
|
1074
|
+
|
|
1075
|
+
// Reset only Expands with no preceding content sibling. Streaming SSR style/script siblings
|
|
1076
|
+
// are ignored so moving them to the head on the client does not change the top margin.
|
|
1077
|
+
var expandSsrMarginStyles = css(_defineProperty({}, ".".concat(RendererCssClassName.DOCUMENT, " .").concat(RendererCssClassName.STICKY_SAFE_BREAKOUT_INNER, " > [data-node-type='expand']:not(:not(style, script) ~ *)"), {
|
|
1078
|
+
marginTop: 0
|
|
1079
|
+
}));
|
|
1074
1080
|
var baseOtherStylesDuplicateAnchor = css(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
1075
1081
|
'& .UnknownBlock': {
|
|
1076
1082
|
fontFamily: "var(--ds-font-family-body, \"Atlassian Sans\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
|
|
@@ -2282,7 +2288,7 @@ export var RendererStyleContainer = function RendererStyleContainer(props) {
|
|
|
2282
2288
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
2283
2289
|
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),
|
|
2284
2290
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
2285
|
-
fg('editor_inline_comments_on_inline_nodes') && rendererAnnotationStylesCommentHeightFix, expValEquals('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? baseOtherStyles : baseOtherStylesDuplicateAnchor,
|
|
2291
|
+
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,
|
|
2286
2292
|
// this should be placed after baseOtherStyles
|
|
2287
2293
|
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],
|
|
2288
2294
|
"data-testid": testId
|
|
@@ -64,7 +64,7 @@ export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
64
64
|
var TABLE_INFO_TIMEOUT = 10000;
|
|
65
65
|
var RENDER_EVENT_SAMPLE_RATE = 0.1;
|
|
66
66
|
var packageName = "@atlaskit/renderer";
|
|
67
|
-
var packageVersion = "
|
|
67
|
+
var packageVersion = "139.0.0";
|
|
68
68
|
var setAsQueryContainerStyles = css({
|
|
69
69
|
containerName: 'ak-renderer-wrapper',
|
|
70
70
|
containerType: 'inline-size'
|
|
@@ -8,7 +8,6 @@ import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
|
8
8
|
import type { RendererAppearance } from '../../ui/Renderer/types';
|
|
9
9
|
import type { AnalyticsEventPayload } from '../../analytics/events';
|
|
10
10
|
interface Props {
|
|
11
|
-
content?: any;
|
|
12
11
|
extensionHandlers?: ExtensionHandlers;
|
|
13
12
|
extensionKey: string;
|
|
14
13
|
extensionType: string;
|
|
@@ -10,7 +10,6 @@ import type { Layout as ExtensionLayout } from '@atlaskit/adf-schema/extensions'
|
|
|
10
10
|
import type { ExtensionHandlers } from '@atlaskit/editor-common/extensions';
|
|
11
11
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
12
12
|
type Props = React.PropsWithChildren<{
|
|
13
|
-
content?: any;
|
|
14
13
|
extensionHandlers?: ExtensionHandlers;
|
|
15
14
|
extensionKey: string;
|
|
16
15
|
extensionType: string;
|
|
@@ -13,6 +13,7 @@ import type { BorderMarkDefinition } from '@atlaskit/adf-schema/border';
|
|
|
13
13
|
import type { AnnotationMarkDefinition } from '@atlaskit/adf-schema/annotation';
|
|
14
14
|
import type { DataConsumerDefinition } from '@atlaskit/adf-schema/data-consumer';
|
|
15
15
|
import type { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
16
|
+
import type { MediaRenderEvent } from '../../../types/mediaOptions';
|
|
16
17
|
import type { AnalyticsEventPayload } from '../../../analytics/events';
|
|
17
18
|
export type MediaProps = MediaCardProps & {
|
|
18
19
|
allowAltTextOnImages?: boolean;
|
|
@@ -30,6 +31,7 @@ export type MediaProps = MediaCardProps & {
|
|
|
30
31
|
isLinkMark: () => boolean;
|
|
31
32
|
marks: Array<LinkDefinition | BorderMarkDefinition | AnnotationMarkDefinition | DataConsumerDefinition>;
|
|
32
33
|
mediaSingleElement?: HTMLElement | null;
|
|
34
|
+
onMediaRenderEvent?: (event: MediaRenderEvent) => void;
|
|
33
35
|
providers?: ProviderFactory;
|
|
34
36
|
width?: number;
|
|
35
37
|
};
|
|
@@ -12,7 +12,6 @@ import type { ExtensionHandlers } from '@atlaskit/editor-common/extensions';
|
|
|
12
12
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
13
13
|
import type { RendererAppearance } from '../../ui/Renderer/types';
|
|
14
14
|
type Props = React.PropsWithChildren<{
|
|
15
|
-
content?: any;
|
|
16
15
|
extensionHandlers?: ExtensionHandlers;
|
|
17
16
|
extensionKey: string;
|
|
18
17
|
extensionType: string;
|
|
@@ -3,7 +3,6 @@ import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
|
3
3
|
import type { NodeContent } from '../types';
|
|
4
4
|
export default function OrderedList(props: {
|
|
5
5
|
children: React.ReactNode;
|
|
6
|
-
content?: NodeContent;
|
|
7
6
|
getContent?: () => NodeContent | undefined;
|
|
8
7
|
localId?: string;
|
|
9
8
|
order?: number;
|
|
@@ -11,7 +11,7 @@ export interface Props {
|
|
|
11
11
|
rendererContext?: RendererContext;
|
|
12
12
|
state?: string;
|
|
13
13
|
}
|
|
14
|
-
export default class TaskItem extends PureComponent<NodeProps<Props>,
|
|
14
|
+
export default class TaskItem extends PureComponent<NodeProps<Props>, object> {
|
|
15
15
|
private providerFactory;
|
|
16
16
|
constructor(props: NodeProps<Props>);
|
|
17
17
|
componentWillUnmount(): void;
|
|
@@ -31,14 +31,6 @@ export interface NodeMeta {
|
|
|
31
31
|
allowPlaceholderText?: boolean;
|
|
32
32
|
allowWrapCodeBlock?: boolean;
|
|
33
33
|
asInline?: 'on' | undefined;
|
|
34
|
-
/**
|
|
35
|
-
* Superseded by `getContent()`, and removed once `platform_editor_renderer_defer_content` ships.
|
|
36
|
-
* A recursive `Fragment.toJSON()` of the node's subtree, serialized on every render whether or
|
|
37
|
-
* not anything reads it — so the document was re-serialized once per ancestor node. While that
|
|
38
|
-
* experiment is enabled it is not provided on any node that has children; a childless node keeps
|
|
39
|
-
* the `null` both arms produce. Read `content ?? getContent?.()` so both arms are covered.
|
|
40
|
-
*/
|
|
41
|
-
content?: NodeContent;
|
|
42
34
|
dataAttributes: {
|
|
43
35
|
'data-renderer-start-pos': number;
|
|
44
36
|
};
|
|
@@ -46,13 +38,8 @@ export interface NodeMeta {
|
|
|
46
38
|
extensionHandlers?: ExtensionHandlers | undefined;
|
|
47
39
|
fireAnalyticsEvent?: (event: AnalyticsEventPayload) => void;
|
|
48
40
|
/**
|
|
49
|
-
* Serialized JSON of the node's
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* `ReactSerializer` attaches this to every node it builds props for, in both arms of
|
|
53
|
-
* `platform_editor_renderer_defer_content`. Read `content ?? getContent?.()`: with the experiment
|
|
54
|
-
* off `content` is already serialized and calling this adds nothing, and with it on `content` is
|
|
55
|
-
* the operand that is absent — so both sides of that expression stay live until `content` goes.
|
|
41
|
+
* Serialized JSON (`Fragment.toJSON()`) of the node's subtree, computed on first call and
|
|
42
|
+
* memoized, so a node whose content nothing reads costs nothing.
|
|
56
43
|
*/
|
|
57
44
|
getContent?: () => NodeContent | undefined;
|
|
58
45
|
hideExtensionKeysWhilePending?: string[];
|
|
@@ -85,8 +72,8 @@ export interface AnnotationMarkMeta extends MarkMeta {
|
|
|
85
72
|
isMediaInline?: boolean;
|
|
86
73
|
useBlockLevel?: boolean;
|
|
87
74
|
}
|
|
88
|
-
export type NodeProps<NodeAttrs =
|
|
89
|
-
export type MarkProps<MarkAttrs =
|
|
75
|
+
export type NodeProps<NodeAttrs = object> = NodeAttrs & PropsWithChildren<NodeMeta>;
|
|
76
|
+
export type MarkProps<MarkAttrs = object> = MarkAttrs & PropsWithChildren<MarkMeta>;
|
|
90
77
|
export type TextHighlighter = {
|
|
91
78
|
component: React.ComponentType<{
|
|
92
79
|
children: React.ReactNode;
|
|
@@ -13,6 +13,20 @@ export type MediaSSR = {
|
|
|
13
13
|
id?: string;
|
|
14
14
|
}>;
|
|
15
15
|
};
|
|
16
|
+
export type MediaRenderEventPayload = {
|
|
17
|
+
type: 'mounted' | 'unmounted';
|
|
18
|
+
} | {
|
|
19
|
+
renderedMediaId?: string;
|
|
20
|
+
type: 'preview-rendered';
|
|
21
|
+
} | {
|
|
22
|
+
reason: string;
|
|
23
|
+
type: 'error';
|
|
24
|
+
};
|
|
25
|
+
export type MediaRenderEvent = {
|
|
26
|
+
dataConsumerSource?: string;
|
|
27
|
+
mediaId?: string;
|
|
28
|
+
mediaInstance: object;
|
|
29
|
+
} & MediaRenderEventPayload;
|
|
16
30
|
export interface MediaOptions {
|
|
17
31
|
allowCaptions?: boolean;
|
|
18
32
|
allowLinking?: boolean;
|
|
@@ -27,5 +41,7 @@ export interface MediaOptions {
|
|
|
27
41
|
featureFlags?: MediaFeatureFlags;
|
|
28
42
|
/** Extensions for the media viewer header (e.g. comment navigation button). */
|
|
29
43
|
mediaViewerExtensions?: MediaViewerExtensions;
|
|
44
|
+
/** Receives lifecycle events for each rendered media node. */
|
|
45
|
+
onMediaRenderEvent?: (event: MediaRenderEvent) => void;
|
|
30
46
|
ssr?: MediaSSR;
|
|
31
47
|
}
|
|
@@ -16,11 +16,6 @@ interface Props {
|
|
|
16
16
|
node: ExtensionParams<Parameters>;
|
|
17
17
|
result?: JSX.Element | null;
|
|
18
18
|
}) => JSX.Element;
|
|
19
|
-
/**
|
|
20
|
-
* Read as `content ?? getContent?.()` — absent on nodes with children once the serializer defers
|
|
21
|
-
* serialization, and the already-serialized value otherwise.
|
|
22
|
-
*/
|
|
23
|
-
content?: any;
|
|
24
19
|
extensionHandlers?: ExtensionHandlers;
|
|
25
20
|
extensionKey: string;
|
|
26
21
|
extensionType: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import type { ADFEntity } from '@atlaskit/adf-utils/types';
|
|
3
|
-
import type { CardAppearance, CardDimensions, CardOnClickCallback, NumericalCardDimensions } from '@atlaskit/media-card';
|
|
3
|
+
import type { CardAppearance, CardDimensions, CardOnClickCallback, CardProps as AtlaskitMediaCardProps, NumericalCardDimensions } from '@atlaskit/media-card';
|
|
4
4
|
import type { MediaClientConfig } from '@atlaskit/media-core/auth';
|
|
5
5
|
import type { ImageResizeMode, Identifier, FileState, MediaClient } from '@atlaskit/media-client';
|
|
6
6
|
import type { MediaType } from '@atlaskit/adf-schema/media';
|
|
@@ -46,6 +46,8 @@ export interface MediaCardProps {
|
|
|
46
46
|
*/
|
|
47
47
|
nestedUnder?: string;
|
|
48
48
|
occurrenceKey?: string;
|
|
49
|
+
onError?: AtlaskitMediaCardProps['onError'];
|
|
50
|
+
onPreviewRender?: AtlaskitMediaCardProps['onPreviewRender'];
|
|
49
51
|
originalDimensions?: NumericalCardDimensions;
|
|
50
52
|
rendererAppearance?: RendererAppearance;
|
|
51
53
|
/**
|
|
@@ -77,6 +79,8 @@ export declare class MediaCardView extends Component<MediaCardProps & {
|
|
|
77
79
|
componentWillUnmount(): void;
|
|
78
80
|
saveFileState: (id: string) => Promise<void>;
|
|
79
81
|
private onError;
|
|
82
|
+
private onConsumerError;
|
|
83
|
+
private getMediaErrorHandler;
|
|
80
84
|
private renderLoadingCard;
|
|
81
85
|
private renderExternal;
|
|
82
86
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "139.1.0",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -66,11 +66,11 @@
|
|
|
66
66
|
"@atlaskit/pragmatic-drag-and-drop": "^3.1.0",
|
|
67
67
|
"@atlaskit/react-compiler-gating": "^0.2.0",
|
|
68
68
|
"@atlaskit/react-ufo": "^7.9.0",
|
|
69
|
-
"@atlaskit/smart-card": "^45.
|
|
69
|
+
"@atlaskit/smart-card": "^45.22.0",
|
|
70
70
|
"@atlaskit/status": "^5.9.0",
|
|
71
71
|
"@atlaskit/task-decision": "^21.9.0",
|
|
72
72
|
"@atlaskit/theme": "^28.2.0",
|
|
73
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
73
|
+
"@atlaskit/tmp-editor-statsig": "^187.0.0",
|
|
74
74
|
"@atlaskit/tokens": "^16.12.0",
|
|
75
75
|
"@atlaskit/tooltip": "^24.3.0",
|
|
76
76
|
"@atlaskit/visually-hidden": "^4.4.0",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"@af/visual-regression": "workspace:^",
|
|
98
98
|
"@atlaskit/analytics-gas-types": "^6.2.0",
|
|
99
99
|
"@atlaskit/checkbox": "^19.2.0",
|
|
100
|
-
"@atlaskit/editor-plugin-media": "^19.
|
|
100
|
+
"@atlaskit/editor-plugin-media": "^19.2.0",
|
|
101
101
|
"@atlaskit/editor-test-helpers": "workspace:^",
|
|
102
102
|
"@atlaskit/inline-edit": "^16.4.0",
|
|
103
103
|
"@atlaskit/json-ld-types": "^2.0.0",
|
|
@@ -143,6 +143,9 @@
|
|
|
143
143
|
"worker-plugin": "^4.0.2"
|
|
144
144
|
},
|
|
145
145
|
"platform-feature-flags": {
|
|
146
|
+
"platform_renderer_expand_ssr_margin_fix": {
|
|
147
|
+
"type": "boolean"
|
|
148
|
+
},
|
|
146
149
|
"platform_native_embeds_rollout_non_maui_experience": {
|
|
147
150
|
"type": "boolean"
|
|
148
151
|
},
|