@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
|
@@ -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 = "139.
|
|
67
|
+
var packageVersion = "139.1.1";
|
|
68
68
|
var setAsQueryContainerStyles = css({
|
|
69
69
|
containerName: 'ak-renderer-wrapper',
|
|
70
70
|
containerType: 'inline-size'
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
3
3
|
import { bind } from 'bind-event-listener';
|
|
4
|
+
import isEqual from 'lodash/isEqual';
|
|
4
5
|
import { COLLAPSED_CONTENT_OWNERS_ATTRIBUTE, getCollapsedContentOwners, getOwnedRendererDocuments, reconcileCollapsedHeadingContent } from './collapsible-headings-dom';
|
|
5
6
|
import { buildTopLevelHeadingSections } from './collapsible-headings-section-model';
|
|
6
7
|
var CollapsibleHeadingsContext = /*#__PURE__*/React.createContext(null);
|
|
7
8
|
var emptyCollapsedHeadings = new Set();
|
|
8
9
|
function isSameDocument(currentDocument, nextDocument) {
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
if (currentDocument === nextDocument) {
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
if (!currentDocument || !nextDocument) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
// Node.eq compares node-type identity. The shared schema cache can be evicted by another
|
|
17
|
+
// renderer, producing different node types for identical content on the next render.
|
|
18
|
+
return currentDocument.type.schema === nextDocument.type.schema ? currentDocument.eq(nextDocument) : isEqual(currentDocument.toJSON(), nextDocument.toJSON());
|
|
11
19
|
}
|
|
12
20
|
function supportsHiddenUntilFound(rendererRef) {
|
|
13
21
|
var _rendererRef$current;
|
|
@@ -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
|
};
|
|
@@ -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
|
}
|
|
@@ -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": "139.
|
|
3
|
+
"version": "139.1.1",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -65,12 +65,12 @@
|
|
|
65
65
|
"@atlaskit/platform-feature-flags-react": "^1.2.0",
|
|
66
66
|
"@atlaskit/pragmatic-drag-and-drop": "^3.1.0",
|
|
67
67
|
"@atlaskit/react-compiler-gating": "^0.2.0",
|
|
68
|
-
"@atlaskit/react-ufo": "^7.
|
|
69
|
-
"@atlaskit/smart-card": "^45.
|
|
68
|
+
"@atlaskit/react-ufo": "^7.10.0",
|
|
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": "^188.0.0",
|
|
74
74
|
"@atlaskit/tokens": "^16.12.0",
|
|
75
75
|
"@atlaskit/tooltip": "^24.3.0",
|
|
76
76
|
"@atlaskit/visually-hidden": "^4.4.0",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"uuid": "^11.1.1"
|
|
86
86
|
},
|
|
87
87
|
"peerDependencies": {
|
|
88
|
-
"@atlaskit/editor-common": "^121.
|
|
88
|
+
"@atlaskit/editor-common": "^121.5.0",
|
|
89
89
|
"@atlaskit/link-provider": "^5.6.0",
|
|
90
90
|
"@atlaskit/media-core": "^38.2.0",
|
|
91
91
|
"react": "^18.2.0 || ^19.2.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",
|
|
@@ -105,12 +105,13 @@
|
|
|
105
105
|
"@atlaskit/link-test-helpers": "^11.2.0",
|
|
106
106
|
"@atlaskit/media-core": "^38.2.0",
|
|
107
107
|
"@atlaskit/media-integration-test-helpers": "workspace:^",
|
|
108
|
+
"@atlaskit/media-state": "^3.2.0",
|
|
108
109
|
"@atlaskit/media-test-helpers": "^42.4.0",
|
|
109
|
-
"@atlaskit/mention": "^
|
|
110
|
+
"@atlaskit/mention": "^29.0.0",
|
|
110
111
|
"@atlaskit/modal-dialog": "^16.6.0",
|
|
111
112
|
"@atlaskit/navigation-system": "^10.16.0",
|
|
112
113
|
"@atlaskit/primitives": "^22.5.0",
|
|
113
|
-
"@atlaskit/profilecard": "^26.
|
|
114
|
+
"@atlaskit/profilecard": "^26.23.0",
|
|
114
115
|
"@atlaskit/radio": "^10.2.0",
|
|
115
116
|
"@atlaskit/range": "^12.2.0",
|
|
116
117
|
"@atlaskit/section-message": "^10.2.0",
|
|
@@ -129,7 +130,7 @@
|
|
|
129
130
|
"@testing-library/user-event": "^14.4.3",
|
|
130
131
|
"@types/react-loadable": "^5.4.1",
|
|
131
132
|
"ajv": "^6.12.6",
|
|
132
|
-
"jsdom": "
|
|
133
|
+
"jsdom": "26.1.0",
|
|
133
134
|
"mockdate": "^3.0.5",
|
|
134
135
|
"puppeteer": "13.7.0",
|
|
135
136
|
"react": "^19.2.0",
|
|
@@ -143,6 +144,9 @@
|
|
|
143
144
|
"worker-plugin": "^4.0.2"
|
|
144
145
|
},
|
|
145
146
|
"platform-feature-flags": {
|
|
147
|
+
"platform_renderer_expand_ssr_margin_fix": {
|
|
148
|
+
"type": "boolean"
|
|
149
|
+
},
|
|
146
150
|
"platform_native_embeds_rollout_non_maui_experience": {
|
|
147
151
|
"type": "boolean"
|
|
148
152
|
},
|
|
@@ -208,9 +212,6 @@
|
|
|
208
212
|
"media-perf-uplift-mutation-fix": {
|
|
209
213
|
"type": "boolean"
|
|
210
214
|
},
|
|
211
|
-
"platform_fix_macro_renders_in_layouts": {
|
|
212
|
-
"type": "boolean"
|
|
213
|
-
},
|
|
214
215
|
"confluence_ttvc_inline_extensions": {
|
|
215
216
|
"type": "boolean"
|
|
216
217
|
},
|