@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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 139.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`d3a7f9016da28`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d3a7f9016da28) -
|
|
8
|
+
Add media render lifecycle callbacks for Remix-generated media behind
|
|
9
|
+
cc-maui-add-mark-for-remix-generated-images.
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`f07b2560158eb`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f07b2560158eb) -
|
|
14
|
+
Fix Expand top-margin shifts during streaming SSR hydration behind
|
|
15
|
+
platform_renderer_expand_ssr_margin_fix.
|
|
16
|
+
|
|
17
|
+
## 139.0.0
|
|
18
|
+
|
|
19
|
+
### Major Changes
|
|
20
|
+
|
|
21
|
+
- [`8774ea3d3d0fb`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8774ea3d3d0fb) -
|
|
22
|
+
Cleanup experiment `platform_editor_renderer_defer_content`. This is a breaking change: the
|
|
23
|
+
`content` prop is removed from `NodeMeta` and the `bodiedExtension`, `extensionFrame`,
|
|
24
|
+
`layoutSection`, `multiBodiedExtension`, and `orderedList` props.
|
|
25
|
+
|
|
26
|
+
To migrate, replace reads of `content` with `getContent?.()`. Consumers that construct node props
|
|
27
|
+
and need to provide content should supply a `getContent` callback instead, for example
|
|
28
|
+
`getContent: () => content`. The callback remains optional in the prop types. The
|
|
29
|
+
serializer-provided getter serializes the node's subtree on first call and memoizes the result.
|
|
30
|
+
`ExtensionParams.content` handed to extension handlers is unaffected.
|
|
31
|
+
|
|
32
|
+
### Patch Changes
|
|
33
|
+
|
|
34
|
+
- Updated dependencies
|
|
35
|
+
|
|
3
36
|
## 138.1.9
|
|
4
37
|
|
|
5
38
|
### Patch Changes
|
package/dist/cjs/react/index.js
CHANGED
|
@@ -509,7 +509,8 @@ var ReactSerializer = exports.default = /*#__PURE__*/function () {
|
|
|
509
509
|
_this$media,
|
|
510
510
|
_this$media2,
|
|
511
511
|
_this$media3,
|
|
512
|
-
_this$media4
|
|
512
|
+
_this$media4,
|
|
513
|
+
_this$media5;
|
|
513
514
|
var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
514
515
|
var _node$type$schema$mar = node.type.schema.marks,
|
|
515
516
|
annotation = _node$type$schema$mar.annotation,
|
|
@@ -546,6 +547,7 @@ var ReactSerializer = exports.default = /*#__PURE__*/function () {
|
|
|
546
547
|
enableSyncMediaCard: (_this$media2 = this.media) === null || _this$media2 === void 0 ? void 0 : _this$media2.enableSyncMediaCard,
|
|
547
548
|
mediaViewerExtensions: (_this$media3 = this.media) === null || _this$media3 === void 0 ? void 0 : _this$media3.mediaViewerExtensions,
|
|
548
549
|
fallbackMediaNameFetcher: (_this$media4 = this.media) === null || _this$media4 === void 0 ? void 0 : _this$media4.fallbackMediaNameFetcher,
|
|
550
|
+
onMediaRenderEvent: (_this$media5 = this.media) === null || _this$media5 === void 0 ? void 0 : _this$media5.onMediaRenderEvent,
|
|
549
551
|
nestedUnder: nestedUnder
|
|
550
552
|
});
|
|
551
553
|
}
|
|
@@ -608,22 +610,22 @@ var ReactSerializer = exports.default = /*#__PURE__*/function () {
|
|
|
608
610
|
}, {
|
|
609
611
|
key: "getMediaGroupProps",
|
|
610
612
|
value: function getMediaGroupProps(node) {
|
|
611
|
-
var _this$
|
|
613
|
+
var _this$media6, _this$media7;
|
|
612
614
|
return _objectSpread(_objectSpread({}, this.getProps(node)), {}, {
|
|
613
615
|
shouldOpenMediaViewer: this.shouldOpenMediaViewer,
|
|
614
616
|
allowAltTextOnImages: this.allowAltTextOnImages,
|
|
615
617
|
featureFlags: this.media && this.media.featureFlags,
|
|
616
|
-
enableDownloadButton: (_this$
|
|
617
|
-
ssr: (_this$
|
|
618
|
+
enableDownloadButton: (_this$media6 = this.media) === null || _this$media6 === void 0 ? void 0 : _this$media6.enableDownloadButton,
|
|
619
|
+
ssr: (_this$media7 = this.media) === null || _this$media7 === void 0 ? void 0 : _this$media7.ssr
|
|
618
620
|
});
|
|
619
621
|
}
|
|
620
622
|
}, {
|
|
621
623
|
key: "getMediaInlineProps",
|
|
622
624
|
value: function getMediaInlineProps(node) {
|
|
623
|
-
var _this$
|
|
625
|
+
var _this$media8, _this$media9;
|
|
624
626
|
return _objectSpread(_objectSpread({}, this.getProps(node)), {}, {
|
|
625
|
-
ssr: (_this$
|
|
626
|
-
fallbackMediaNameFetcher: (_this$
|
|
627
|
+
ssr: (_this$media8 = this.media) === null || _this$media8 === void 0 ? void 0 : _this$media8.ssr,
|
|
628
|
+
fallbackMediaNameFetcher: (_this$media9 = this.media) === null || _this$media9 === void 0 ? void 0 : _this$media9.fallbackMediaNameFetcher
|
|
627
629
|
});
|
|
628
630
|
}
|
|
629
631
|
}, {
|
|
@@ -671,18 +673,8 @@ var ReactSerializer = exports.default = /*#__PURE__*/function () {
|
|
|
671
673
|
}, {
|
|
672
674
|
key: "getProps",
|
|
673
675
|
value: function getProps(node) {
|
|
674
|
-
var _node$content;
|
|
675
676
|
var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
676
677
|
var startPos = this.startPos + path.length;
|
|
677
|
-
|
|
678
|
-
// `content` is a recursive Fragment.toJSON() attached to every node, so the document is
|
|
679
|
-
// re-serialized once per ancestor — O(depth x size) overall, and a table paid it again for
|
|
680
|
-
// every row and cell. Consumers read `getContent()` instead, which serializes at most once.
|
|
681
|
-
// Experiment call last, so exposure only fires for nodes that have content to serialize.
|
|
682
|
-
var skipEagerContent = !!((_node$content = node.content) !== null && _node$content !== void 0 && _node$content.childCount) && (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_renderer_defer_content');
|
|
683
|
-
|
|
684
|
-
// Shared so the `content` prop and `getContent()` never serialize the subtree twice.
|
|
685
|
-
var getContent = (0, _contentGetter.createContentGetter)(node.content);
|
|
686
678
|
return _objectSpread({
|
|
687
679
|
asInline: this.inlinePositions.has(startPos) ? 'on' : undefined,
|
|
688
680
|
text: node.text,
|
|
@@ -692,8 +684,7 @@ var ReactSerializer = exports.default = /*#__PURE__*/function () {
|
|
|
692
684
|
portal: this.portal,
|
|
693
685
|
rendererContext: this.rendererContext,
|
|
694
686
|
serializer: this,
|
|
695
|
-
|
|
696
|
-
getContent: getContent,
|
|
687
|
+
getContent: (0, _contentGetter.createContentGetter)(node.content),
|
|
697
688
|
allowHeadingAnchorLinks: this.allowHeadingAnchorLinks,
|
|
698
689
|
allowCopyToClipboard: this.allowCopyToClipboard,
|
|
699
690
|
allowDownloadCodeBlock: this.allowDownloadCodeBlock,
|
|
@@ -8,8 +8,8 @@ exports.default = LayoutSection;
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
10
10
|
function LayoutSection(props) {
|
|
11
|
-
var
|
|
12
|
-
var columnCount = (
|
|
11
|
+
var _props$getContent;
|
|
12
|
+
var columnCount = (_props$getContent = props.getContent) === null || _props$getContent === void 0 || (_props$getContent = _props$getContent.call(props)) === null || _props$getContent === void 0 ? void 0 : _props$getContent.length;
|
|
13
13
|
return (0, _editorExperiment.editorExperiment)('advanced_layouts', true) ?
|
|
14
14
|
/*#__PURE__*/
|
|
15
15
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
@@ -45,6 +45,15 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
45
45
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
46
46
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
47
47
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
48
|
+
var getDataConsumerMark = function getDataConsumerMark(marks) {
|
|
49
|
+
return marks.find(function (mark) {
|
|
50
|
+
var _mark$type;
|
|
51
|
+
return mark.type === 'dataConsumer' || ((_mark$type = mark.type) === null || _mark$type === void 0 ? void 0 : _mark$type.name) === 'dataConsumer';
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
var getRemixDataConsumerMark = function getRemixDataConsumerMark(marks) {
|
|
55
|
+
return (0, _fg.fg)('cc-maui-add-mark-for-remix-generated-images') ? getDataConsumerMark(marks) : undefined;
|
|
56
|
+
};
|
|
48
57
|
var linkStyle = (0, _react2.css)({
|
|
49
58
|
position: 'absolute',
|
|
50
59
|
background: 'transparent',
|
|
@@ -241,32 +250,60 @@ var CommentBadgeWrapper = function CommentBadgeWrapper(_ref5) {
|
|
|
241
250
|
// Ignored via go/ees005
|
|
242
251
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
243
252
|
var Media = /*#__PURE__*/function (_PureComponent) {
|
|
244
|
-
function Media(
|
|
253
|
+
function Media(_props) {
|
|
245
254
|
var _this;
|
|
246
255
|
(0, _classCallCheck2.default)(this, Media);
|
|
247
|
-
_this = _callSuper(this, Media, [
|
|
256
|
+
_this = _callSuper(this, Media, [_props]);
|
|
257
|
+
(0, _defineProperty2.default)(_this, "mediaInstance", {});
|
|
248
258
|
(0, _defineProperty2.default)(_this, "getDataConsumerMark", function () {
|
|
249
|
-
return (
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
259
|
+
return getRemixDataConsumerMark(_this.props.marks);
|
|
260
|
+
});
|
|
261
|
+
(0, _defineProperty2.default)(_this, "getDataConsumerSource", function () {
|
|
262
|
+
var _getDataConsumerMark;
|
|
263
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.props;
|
|
264
|
+
return (_getDataConsumerMark = getDataConsumerMark(props.marks)) === null || _getDataConsumerMark === void 0 || (_getDataConsumerMark = _getDataConsumerMark.attrs.sources) === null || _getDataConsumerMark === void 0 ? void 0 : _getDataConsumerMark[0];
|
|
265
|
+
});
|
|
266
|
+
(0, _defineProperty2.default)(_this, "emitMediaRenderEvent", function (event) {
|
|
267
|
+
var _props$onMediaRenderE;
|
|
268
|
+
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _this.props;
|
|
269
|
+
(_props$onMediaRenderE = props.onMediaRenderEvent) === null || _props$onMediaRenderE === void 0 || _props$onMediaRenderE.call(props, _objectSpread(_objectSpread({}, event), {}, {
|
|
270
|
+
dataConsumerSource: _this.getDataConsumerSource(props),
|
|
271
|
+
mediaId: props.id,
|
|
272
|
+
mediaInstance: _this.mediaInstance
|
|
273
|
+
}));
|
|
274
|
+
});
|
|
275
|
+
(0, _defineProperty2.default)(_this, "onPreviewRender", function (renderedMediaId) {
|
|
276
|
+
var _this$props$onPreview, _this$props;
|
|
277
|
+
(_this$props$onPreview = (_this$props = _this.props).onPreviewRender) === null || _this$props$onPreview === void 0 || _this$props$onPreview.call(_this$props, renderedMediaId);
|
|
278
|
+
_this.emitMediaRenderEvent({
|
|
279
|
+
renderedMediaId: renderedMediaId,
|
|
280
|
+
type: 'preview-rendered'
|
|
281
|
+
});
|
|
282
|
+
});
|
|
283
|
+
(0, _defineProperty2.default)(_this, "onError", function (reason) {
|
|
284
|
+
var _this$props$onError, _this$props2;
|
|
285
|
+
(_this$props$onError = (_this$props2 = _this.props).onError) === null || _this$props$onError === void 0 || _this$props$onError.call(_this$props2, reason);
|
|
286
|
+
_this.emitMediaRenderEvent({
|
|
287
|
+
reason: reason,
|
|
288
|
+
type: 'error'
|
|
289
|
+
});
|
|
253
290
|
});
|
|
254
291
|
(0, _defineProperty2.default)(_this, "renderCard", function () {
|
|
255
292
|
var _dataConsumerMark$att;
|
|
256
293
|
var providers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
257
294
|
var contextIdentifierProvider = providers.contextIdentifierProvider;
|
|
258
|
-
var _this$
|
|
259
|
-
allowAltTextOnImages = _this$
|
|
260
|
-
alt = _this$
|
|
261
|
-
featureFlags = _this$
|
|
262
|
-
allowMediaViewer = _this$
|
|
263
|
-
enableDownloadButton = _this$
|
|
264
|
-
ssr = _this$
|
|
265
|
-
width = _this$
|
|
266
|
-
height = _this$
|
|
267
|
-
mediaSingleElement = _this$
|
|
268
|
-
_this$
|
|
269
|
-
isDrafting = _this$
|
|
295
|
+
var _this$props3 = _this.props,
|
|
296
|
+
allowAltTextOnImages = _this$props3.allowAltTextOnImages,
|
|
297
|
+
alt = _this$props3.alt,
|
|
298
|
+
featureFlags = _this$props3.featureFlags,
|
|
299
|
+
allowMediaViewer = _this$props3.shouldOpenMediaViewer,
|
|
300
|
+
enableDownloadButton = _this$props3.enableDownloadButton,
|
|
301
|
+
ssr = _this$props3.ssr,
|
|
302
|
+
width = _this$props3.width,
|
|
303
|
+
height = _this$props3.height,
|
|
304
|
+
mediaSingleElement = _this$props3.mediaSingleElement,
|
|
305
|
+
_this$props3$isDrafti = _this$props3.isDrafting,
|
|
306
|
+
isDrafting = _this$props3$isDrafti === void 0 ? false : _this$props3$isDrafti;
|
|
270
307
|
var annotationMarks = _this.props.isAnnotationMark ? _this.props.marks.filter(_this.props.isAnnotationMark) : undefined;
|
|
271
308
|
var borderMark = _this.props.marks.find(_this.props.isBorderMark);
|
|
272
309
|
var dataConsumerMark = _this.getDataConsumerMark();
|
|
@@ -318,14 +355,16 @@ var Media = /*#__PURE__*/function (_PureComponent) {
|
|
|
318
355
|
alt: allowAltTextOnImages ? alt : undefined,
|
|
319
356
|
featureFlags: featureFlags,
|
|
320
357
|
shouldEnableDownloadButton: enableDownloadButton,
|
|
321
|
-
ssr: ssr
|
|
358
|
+
ssr: ssr,
|
|
359
|
+
onError: _this.props.onMediaRenderEvent || _this.props.onError ? _this.onError : undefined,
|
|
360
|
+
onPreviewRender: _this.props.onMediaRenderEvent || _this.props.onPreviewRender ? _this.onPreviewRender : undefined
|
|
322
361
|
}))))));
|
|
323
362
|
});
|
|
324
363
|
(0, _defineProperty2.default)(_this, "handleMediaLinkClick", function (event) {
|
|
325
|
-
var _this$
|
|
326
|
-
fireAnalyticsEvent = _this$
|
|
327
|
-
isLinkMark = _this$
|
|
328
|
-
marks = _this$
|
|
364
|
+
var _this$props4 = _this.props,
|
|
365
|
+
fireAnalyticsEvent = _this$props4.fireAnalyticsEvent,
|
|
366
|
+
isLinkMark = _this$props4.isLinkMark,
|
|
367
|
+
marks = _this$props4.marks;
|
|
329
368
|
if (fireAnalyticsEvent) {
|
|
330
369
|
fireAnalyticsEvent({
|
|
331
370
|
action: _analytics.ACTION.VISITED,
|
|
@@ -354,6 +393,9 @@ var Media = /*#__PURE__*/function (_PureComponent) {
|
|
|
354
393
|
key: "componentDidMount",
|
|
355
394
|
value: function componentDidMount() {
|
|
356
395
|
var _dataConsumerMark$att2;
|
|
396
|
+
this.emitMediaRenderEvent({
|
|
397
|
+
type: 'mounted'
|
|
398
|
+
});
|
|
357
399
|
var dataConsumerMark = this.getDataConsumerMark();
|
|
358
400
|
var infographicType = dataConsumerMark === null || dataConsumerMark === void 0 || (_dataConsumerMark$att2 = dataConsumerMark.attrs.sources) === null || _dataConsumerMark$att2 === void 0 ? void 0 : _dataConsumerMark$att2[0];
|
|
359
401
|
if (infographicType && this.props.fireAnalyticsEvent) {
|
|
@@ -370,6 +412,25 @@ var Media = /*#__PURE__*/function (_PureComponent) {
|
|
|
370
412
|
});
|
|
371
413
|
}
|
|
372
414
|
}
|
|
415
|
+
}, {
|
|
416
|
+
key: "componentDidUpdate",
|
|
417
|
+
value: function componentDidUpdate(prevProps) {
|
|
418
|
+
if (prevProps.id !== this.props.id || this.getDataConsumerSource(prevProps) !== this.getDataConsumerSource() || prevProps.onMediaRenderEvent !== this.props.onMediaRenderEvent) {
|
|
419
|
+
this.emitMediaRenderEvent({
|
|
420
|
+
type: 'unmounted'
|
|
421
|
+
}, prevProps);
|
|
422
|
+
this.emitMediaRenderEvent({
|
|
423
|
+
type: 'mounted'
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
}, {
|
|
428
|
+
key: "componentWillUnmount",
|
|
429
|
+
value: function componentWillUnmount() {
|
|
430
|
+
this.emitMediaRenderEvent({
|
|
431
|
+
type: 'unmounted'
|
|
432
|
+
});
|
|
433
|
+
}
|
|
373
434
|
}, {
|
|
374
435
|
key: "render",
|
|
375
436
|
value: function render() {
|
|
@@ -139,7 +139,6 @@ var MultiBodiedExtension = function MultiBodiedExtension(props) {
|
|
|
139
139
|
extensionType = props.extensionType,
|
|
140
140
|
extensionKey = props.extensionKey,
|
|
141
141
|
extensionHandlers = props.extensionHandlers,
|
|
142
|
-
content = props.content,
|
|
143
142
|
getContent = props.getContent,
|
|
144
143
|
marks = props.marks,
|
|
145
144
|
localId = props.localId,
|
|
@@ -183,7 +182,7 @@ var MultiBodiedExtension = function MultiBodiedExtension(props) {
|
|
|
183
182
|
extensionKey: extensionKey,
|
|
184
183
|
extensionType: extensionType,
|
|
185
184
|
parameters: parameters,
|
|
186
|
-
content:
|
|
185
|
+
content: getContent === null || getContent === void 0 ? void 0 : getContent(),
|
|
187
186
|
localId: localId,
|
|
188
187
|
fragmentLocalId: fragmentLocalId
|
|
189
188
|
};
|
|
@@ -200,7 +199,7 @@ var MultiBodiedExtension = function MultiBodiedExtension(props) {
|
|
|
200
199
|
activeChildIndex: activeChildIndex
|
|
201
200
|
}, children));
|
|
202
201
|
}
|
|
203
|
-
}, [activeChildIndex, loading, extensionContext, marks, extensionKey, extensionType, parameters,
|
|
202
|
+
}, [activeChildIndex, loading, extensionContext, marks, extensionKey, extensionType, parameters, getContent, localId, actions, children]);
|
|
204
203
|
|
|
205
204
|
// make the frame visible
|
|
206
205
|
var containerActiveFrameStyles = getContainerActiveFrameStyles(activeChildIndex);
|
|
@@ -12,11 +12,11 @@ var _styles = require("@atlaskit/editor-common/styles");
|
|
|
12
12
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
13
13
|
var _lists = require("../utils/lists");
|
|
14
14
|
function OrderedList(props) {
|
|
15
|
-
var
|
|
15
|
+
var _props$getContent;
|
|
16
16
|
var extraProps = {};
|
|
17
17
|
|
|
18
18
|
// Item count drives the marker column width, so losing it narrows the gutter by a digit.
|
|
19
|
-
var itemsCount = (
|
|
19
|
+
var itemsCount = (_props$getContent = props.getContent) === null || _props$getContent === void 0 || (_props$getContent = _props$getContent.call(props)) === null || _props$getContent === void 0 ? void 0 : _props$getContent.length;
|
|
20
20
|
var itemCounterDigitsSize = (0, _utils.getItemCounterDigitsSize)({
|
|
21
21
|
order: props.order,
|
|
22
22
|
itemsCount: itemsCount
|
|
@@ -53,7 +53,6 @@ function ExtensionRenderer(props) {
|
|
|
53
53
|
extensionType = props.extensionType,
|
|
54
54
|
extensionKey = props.extensionKey,
|
|
55
55
|
parameters = props.parameters,
|
|
56
|
-
content = props.content,
|
|
57
56
|
getContent = props.getContent,
|
|
58
57
|
text = props.text,
|
|
59
58
|
type = props.type,
|
|
@@ -100,7 +99,7 @@ function ExtensionRenderer(props) {
|
|
|
100
99
|
extensionKey: extensionKey,
|
|
101
100
|
extensionType: extensionType,
|
|
102
101
|
parameters: parameters,
|
|
103
|
-
content: (
|
|
102
|
+
content: (getContent === null || getContent === void 0 ? void 0 : getContent()) || text,
|
|
104
103
|
localId: localId,
|
|
105
104
|
fragmentLocalId: fragmentLocalId
|
|
106
105
|
};
|
|
@@ -139,7 +138,7 @@ function ExtensionRenderer(props) {
|
|
|
139
138
|
node: node,
|
|
140
139
|
result: result
|
|
141
140
|
});
|
|
142
|
-
}, [actions, children,
|
|
141
|
+
}, [actions, children, getContent, extensionHandlers, extensionKey, extensionType, localGetNodeRenderer, localId, marks, parameters, rendererContext === null || rendererContext === void 0 ? void 0 : rendererContext.adDoc, text, type]);
|
|
143
142
|
var setupAndRenderExtensionNode = _react2.default.useCallback(function (providers) {
|
|
144
143
|
if (extensionProvider === null && providers.extensionProvider) {
|
|
145
144
|
handleProvider('extensionProvider', providers.extensionProvider);
|
package/dist/cjs/ui/MediaCard.js
CHANGED
|
@@ -108,11 +108,12 @@ var MediaCardView = exports.MediaCardView = /*#__PURE__*/function (_Component) {
|
|
|
108
108
|
};
|
|
109
109
|
}());
|
|
110
110
|
(0, _defineProperty2.default)(_this, "onError", function (reason) {
|
|
111
|
-
var _this$props$fireAnaly, _this$
|
|
111
|
+
var _this$props$onError, _this$props3, _this$props$fireAnaly, _this$props4;
|
|
112
112
|
var _this$props2 = _this.props,
|
|
113
113
|
nestedUnder = _this$props2.nestedUnder,
|
|
114
114
|
rendererContext = _this$props2.rendererContext;
|
|
115
|
-
(_this$props$
|
|
115
|
+
(_this$props$onError = (_this$props3 = _this.props).onError) === null || _this$props$onError === void 0 || _this$props$onError.call(_this$props3, reason);
|
|
116
|
+
(_this$props$fireAnaly = (_this$props4 = _this.props).fireAnalyticsEvent) === null || _this$props$fireAnaly === void 0 || _this$props$fireAnaly.call(_this$props4, {
|
|
116
117
|
action: _analytics.ACTION.ERRORED,
|
|
117
118
|
actionSubject: _analytics.ACTION_SUBJECT.RENDERER,
|
|
118
119
|
actionSubjectId: _analytics.ACTION_SUBJECT_ID.MEDIA,
|
|
@@ -127,6 +128,16 @@ var MediaCardView = exports.MediaCardView = /*#__PURE__*/function (_Component) {
|
|
|
127
128
|
} : {})
|
|
128
129
|
});
|
|
129
130
|
});
|
|
131
|
+
(0, _defineProperty2.default)(_this, "onConsumerError", function (reason) {
|
|
132
|
+
var _this$props$onError2, _this$props5;
|
|
133
|
+
(_this$props$onError2 = (_this$props5 = _this.props).onError) === null || _this$props$onError2 === void 0 || _this$props$onError2.call(_this$props5, reason);
|
|
134
|
+
});
|
|
135
|
+
(0, _defineProperty2.default)(_this, "getMediaErrorHandler", function () {
|
|
136
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_media_error_analytics', 'isEnabled', true)) {
|
|
137
|
+
return _this.onError;
|
|
138
|
+
}
|
|
139
|
+
return _this.props.onError ? _this.onConsumerError : undefined;
|
|
140
|
+
});
|
|
130
141
|
(0, _defineProperty2.default)(_this, "renderLoadingCard", function () {
|
|
131
142
|
var cardDimensions = _this.props.cardDimensions;
|
|
132
143
|
return /*#__PURE__*/_react.default.createElement(_mediaCard.CardLoading, {
|
|
@@ -160,11 +171,11 @@ var MediaCardView = exports.MediaCardView = /*#__PURE__*/function (_Component) {
|
|
|
160
171
|
key: "componentDidMount",
|
|
161
172
|
value: function () {
|
|
162
173
|
var _componentDidMount = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
163
|
-
var _this$
|
|
174
|
+
var _this$props6, rendererContext, contextIdentifierProvider, id, url, collectionName, nodeIsInCache, _t2, _t3;
|
|
164
175
|
return _regenerator.default.wrap(function (_context2) {
|
|
165
176
|
while (1) switch (_context2.prev = _context2.next) {
|
|
166
177
|
case 0:
|
|
167
|
-
_this$
|
|
178
|
+
_this$props6 = this.props, rendererContext = _this$props6.rendererContext, contextIdentifierProvider = _this$props6.contextIdentifierProvider, id = _this$props6.id, url = _this$props6.url, collectionName = _this$props6.collection;
|
|
168
179
|
if (!contextIdentifierProvider) {
|
|
169
180
|
_context2.next = 2;
|
|
170
181
|
break;
|
|
@@ -215,9 +226,9 @@ var MediaCardView = exports.MediaCardView = /*#__PURE__*/function (_Component) {
|
|
|
215
226
|
}, {
|
|
216
227
|
key: "componentWillUnmount",
|
|
217
228
|
value: function componentWillUnmount() {
|
|
218
|
-
var _this$
|
|
219
|
-
id = _this$
|
|
220
|
-
dataURI = _this$
|
|
229
|
+
var _this$props7 = this.props,
|
|
230
|
+
id = _this$props7.id,
|
|
231
|
+
dataURI = _this$props7.url;
|
|
221
232
|
if (id) {
|
|
222
233
|
mediaIdentifierMap.delete(id);
|
|
223
234
|
} else if (dataURI) {
|
|
@@ -227,20 +238,20 @@ var MediaCardView = exports.MediaCardView = /*#__PURE__*/function (_Component) {
|
|
|
227
238
|
}, {
|
|
228
239
|
key: "renderExternal",
|
|
229
240
|
value: function renderExternal(shouldOpenMediaViewer) {
|
|
230
|
-
var _this$
|
|
231
|
-
cardDimensions = _this$
|
|
232
|
-
resizeMode = _this$
|
|
233
|
-
appearance = _this$
|
|
234
|
-
url = _this$
|
|
235
|
-
imageStatus = _this$
|
|
236
|
-
disableOverlay = _this$
|
|
237
|
-
alt = _this$
|
|
238
|
-
featureFlags = _this$
|
|
239
|
-
ssr = _this$
|
|
240
|
-
mediaClient = _this$
|
|
241
|
-
dataAttributes = _this$
|
|
242
|
-
enableSyncMediaCard = _this$
|
|
243
|
-
localId = _this$
|
|
241
|
+
var _this$props8 = this.props,
|
|
242
|
+
cardDimensions = _this$props8.cardDimensions,
|
|
243
|
+
resizeMode = _this$props8.resizeMode,
|
|
244
|
+
appearance = _this$props8.appearance,
|
|
245
|
+
url = _this$props8.url,
|
|
246
|
+
imageStatus = _this$props8.imageStatus,
|
|
247
|
+
disableOverlay = _this$props8.disableOverlay,
|
|
248
|
+
alt = _this$props8.alt,
|
|
249
|
+
featureFlags = _this$props8.featureFlags,
|
|
250
|
+
ssr = _this$props8.ssr,
|
|
251
|
+
mediaClient = _this$props8.mediaClient,
|
|
252
|
+
dataAttributes = _this$props8.dataAttributes,
|
|
253
|
+
enableSyncMediaCard = _this$props8.enableSyncMediaCard,
|
|
254
|
+
localId = _this$props8.localId;
|
|
244
255
|
if (imageStatus === 'loading' || !url) {
|
|
245
256
|
return this.renderLoadingCard();
|
|
246
257
|
}
|
|
@@ -278,7 +289,8 @@ var MediaCardView = exports.MediaCardView = /*#__PURE__*/function (_Component) {
|
|
|
278
289
|
featureFlags: featureFlags,
|
|
279
290
|
ssr: ssr === null || ssr === void 0 ? void 0 : ssr.mode,
|
|
280
291
|
shouldHideTooltip: false,
|
|
281
|
-
onError: (
|
|
292
|
+
onError: this.getMediaErrorHandler(),
|
|
293
|
+
onPreviewRender: this.props.onPreviewRender
|
|
282
294
|
}))
|
|
283
295
|
);
|
|
284
296
|
}
|
|
@@ -289,27 +301,27 @@ var MediaCardView = exports.MediaCardView = /*#__PURE__*/function (_Component) {
|
|
|
289
301
|
var _this$state = this.state,
|
|
290
302
|
contextIdentifierProvider = _this$state.contextIdentifierProvider,
|
|
291
303
|
fileState = _this$state.fileState;
|
|
292
|
-
var _this$
|
|
293
|
-
id = _this$
|
|
294
|
-
alt = _this$
|
|
295
|
-
type = _this$
|
|
296
|
-
collection = _this$
|
|
297
|
-
occurrenceKey = _this$
|
|
298
|
-
cardDimensions = _this$
|
|
299
|
-
resizeMode = _this$
|
|
300
|
-
disableOverlay = _this$
|
|
301
|
-
useInlinePlayer = _this$
|
|
302
|
-
originalDimensions = _this$
|
|
303
|
-
forceOpenMediaViewer = _this$
|
|
304
|
-
featureFlags = _this$
|
|
305
|
-
shouldEnableDownloadButton = _this$
|
|
306
|
-
ssr = _this$
|
|
307
|
-
mediaClient = _this$
|
|
308
|
-
dataAttributes = _this$
|
|
309
|
-
enableSyncMediaCard = _this$
|
|
310
|
-
localId = _this$
|
|
311
|
-
mediaViewerExtensions = _this$
|
|
312
|
-
fallbackMediaNameFetcher = _this$
|
|
304
|
+
var _this$props9 = this.props,
|
|
305
|
+
id = _this$props9.id,
|
|
306
|
+
alt = _this$props9.alt,
|
|
307
|
+
type = _this$props9.type,
|
|
308
|
+
collection = _this$props9.collection,
|
|
309
|
+
occurrenceKey = _this$props9.occurrenceKey,
|
|
310
|
+
cardDimensions = _this$props9.cardDimensions,
|
|
311
|
+
resizeMode = _this$props9.resizeMode,
|
|
312
|
+
disableOverlay = _this$props9.disableOverlay,
|
|
313
|
+
useInlinePlayer = _this$props9.useInlinePlayer,
|
|
314
|
+
originalDimensions = _this$props9.originalDimensions,
|
|
315
|
+
forceOpenMediaViewer = _this$props9.shouldOpenMediaViewer,
|
|
316
|
+
featureFlags = _this$props9.featureFlags,
|
|
317
|
+
shouldEnableDownloadButton = _this$props9.shouldEnableDownloadButton,
|
|
318
|
+
ssr = _this$props9.ssr,
|
|
319
|
+
mediaClient = _this$props9.mediaClient,
|
|
320
|
+
dataAttributes = _this$props9.dataAttributes,
|
|
321
|
+
enableSyncMediaCard = _this$props9.enableSyncMediaCard,
|
|
322
|
+
localId = _this$props9.localId,
|
|
323
|
+
mediaViewerExtensions = _this$props9.mediaViewerExtensions,
|
|
324
|
+
fallbackMediaNameFetcher = _this$props9.fallbackMediaNameFetcher;
|
|
313
325
|
var isMobile = false;
|
|
314
326
|
var shouldPlayInline = useInlinePlayer !== undefined ? useInlinePlayer : true;
|
|
315
327
|
var isInlinePlayer = isMobile ? false : shouldPlayInline;
|
|
@@ -378,7 +390,8 @@ var MediaCardView = exports.MediaCardView = /*#__PURE__*/function (_Component) {
|
|
|
378
390
|
shouldHideTooltip: isMobile,
|
|
379
391
|
mediaViewerExtensions: mediaViewerExtensions,
|
|
380
392
|
fallbackMediaNameFetcher: fallbackMediaNameFetcher,
|
|
381
|
-
onError: (
|
|
393
|
+
onError: this.getMediaErrorHandler(),
|
|
394
|
+
onPreviewRender: this.props.onPreviewRender
|
|
382
395
|
}));
|
|
383
396
|
}
|
|
384
397
|
}]);
|
|
@@ -1078,6 +1078,12 @@ var centerWrapperStyles = (0, _react.css)((0, _defineProperty2.default)({}, ".".
|
|
|
1078
1078
|
flexShrink: 0
|
|
1079
1079
|
}
|
|
1080
1080
|
}));
|
|
1081
|
+
|
|
1082
|
+
// Reset only Expands with no preceding content sibling. Streaming SSR style/script siblings
|
|
1083
|
+
// are ignored so moving them to the head on the client does not change the top margin.
|
|
1084
|
+
var expandSsrMarginStyles = (0, _react.css)((0, _defineProperty2.default)({}, ".".concat(_consts.RendererCssClassName.DOCUMENT, " .").concat(_consts.RendererCssClassName.STICKY_SAFE_BREAKOUT_INNER, " > [data-node-type='expand']:not(:not(style, script) ~ *)"), {
|
|
1085
|
+
marginTop: 0
|
|
1086
|
+
}));
|
|
1081
1087
|
var baseOtherStylesDuplicateAnchor = (0, _react.css)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({
|
|
1082
1088
|
'& .UnknownBlock': {
|
|
1083
1089
|
fontFamily: "var(--ds-font-family-body, \"Atlassian Sans\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, \"Helvetica Neue\", sans-serif)",
|
|
@@ -2289,7 +2295,7 @@ var RendererStyleContainer = exports.RendererStyleContainer = function RendererS
|
|
|
2289
2295
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
2290
2296
|
textHighlightPaddingStyles, tasksAndDecisionsStyles, (0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) && headingPanelStyles, smartCardStyles, smartCardStylesAvatarFix, headerSmartCardStyles, smartCardStylesAvatarMarginFix, smartCardStylesAvatarListZeroMarginTop, (0, _fg.fg)('editor_inline_comments_on_inline_nodes') && ((0, _expValEquals.expValEquals)('confluence_fe_renderer_inline_node_mark_color_fix', 'isEnabled', true) ? rendererAnnotationStyles : rendererAnnotationStylesOld),
|
|
2291
2297
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
2292
|
-
(0, _fg.fg)('editor_inline_comments_on_inline_nodes') && rendererAnnotationStylesCommentHeightFix, (0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? baseOtherStyles : baseOtherStylesDuplicateAnchor,
|
|
2298
|
+
(0, _fg.fg)('editor_inline_comments_on_inline_nodes') && rendererAnnotationStylesCommentHeightFix, (0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? baseOtherStyles : baseOtherStylesDuplicateAnchor, (0, _fg.fg)('platform_renderer_expand_ssr_margin_fix') && expandSsrMarginStyles,
|
|
2293
2299
|
// this should be placed after baseOtherStyles
|
|
2294
2300
|
(0, _expValEquals.expValEquals)('platform_editor_render_bodied_extension_as_inline', 'isEnabled', true) && ((0, _expValEquals.expValEquals)('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? extensionAsInlineStyle : oldExtensionAsInlineStyle), (0, _fg.fg)('platform_forge_inline_bodied_macro') && [migratedInlineBodiedFlowStyle, forgeInlineBodiedSpacingStyle], inlineExtensionRendererMarginFix, allowNestedHeaderLinks && ((0, _expValEquals.expValEquals)('platform_editor_copy_link_a11y_inconsistency_fix', 'isEnabled', true) ? alignedHeadingAnchorStyle : alignedHeadingAnchorStyleDuplicateAnchor), mediaSingleSharedStyle, firstWrappedMediaStyles, tableSharedStyle, (0, _expValEquals.expValEquals)('platform_editor_table_q4_loveability', 'isEnabled', true) && roundedTableOuterBorderOverlayStyles, (0, _expValEquals.expValEquals)('platform_editor_table_q4_loveability', 'isEnabled', true) && roundedTableRemixBlockHighlightStyles, (0, _expValEquals.expValEquals)('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true) && tableContentModeScopedStyles, (0, _expValEquals.expValEquals)('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true) && (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_table_fit_to_content_patch_2') && tableContentModeExtensionContainmentStyles, (0, _expValEquals.expValEquals)('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true) && tableContentModeNestedTableStyles, tableRendererHeaderStylesForTableCellOnly, (0, _fg.fg)('platform_editor_bordered_panel_nested_in_table') && tableRendererNestedPanelStyles, isBackgroundClipBrowserFixNeeded() && tableStylesBackGroundClipForGeckoForTableCellOnly, firstNodeWithNotMarginTopWithNestedDnD, rendererTableStyles, isStickyScrollbarOn && stickyScrollbarStyles, isStickyScrollbarOn && (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_table_css_overflow_shadow') && stickyScrollbarOverflowShadowFixStyles, rendererTableHeaderEqualHeightStylesForTableCellOnly, allowColumnSorting && rendererTableSortableColumnStyles, allowColumnSorting && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_table_menu_updates', 'isEnabled', true) && rendererTableSortableColumnValignStyles, allowColumnSorting && allowNestedHeaderLinks && ((0, _expValEquals.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' && ((0, _expValEquals.expValEquals)('editor_tinymce_full_width_mode', 'isEnabled', true) || (0, _expValEquals.expValEquals)('confluence_max_width_content_appearance', 'isEnabled', true))) && responsiveBreakoutWidthFullWidth, (0, _expValEquals.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 && (0, _expValEquals.expValEquals)('platform_editor_table_q4_loveability', 'isEnabled', true) ? roundedTableFakeBorderOverlayStyles : null, (0, _expValEquals.expValEquals)('platform_editor_hide_extension_renderer_support', 'isEnabled', true) && hideExtensionStyles],
|
|
2295
2301
|
"data-testid": testId
|
|
@@ -73,7 +73,7 @@ var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
73
73
|
var TABLE_INFO_TIMEOUT = 10000;
|
|
74
74
|
var RENDER_EVENT_SAMPLE_RATE = 0.1;
|
|
75
75
|
var packageName = "@atlaskit/renderer";
|
|
76
|
-
var packageVersion = "
|
|
76
|
+
var packageVersion = "139.0.0";
|
|
77
77
|
var setAsQueryContainerStyles = (0, _react2.css)({
|
|
78
78
|
containerName: 'ak-renderer-wrapper',
|
|
79
79
|
containerType: 'inline-size'
|
|
@@ -464,7 +464,7 @@ export default class ReactSerializer {
|
|
|
464
464
|
};
|
|
465
465
|
}
|
|
466
466
|
getMediaProps(node, path = []) {
|
|
467
|
-
var _this$media, _this$media2, _this$media3, _this$media4;
|
|
467
|
+
var _this$media, _this$media2, _this$media3, _this$media4, _this$media5;
|
|
468
468
|
const {
|
|
469
469
|
marks: {
|
|
470
470
|
annotation,
|
|
@@ -496,6 +496,7 @@ export default class ReactSerializer {
|
|
|
496
496
|
enableSyncMediaCard: (_this$media2 = this.media) === null || _this$media2 === void 0 ? void 0 : _this$media2.enableSyncMediaCard,
|
|
497
497
|
mediaViewerExtensions: (_this$media3 = this.media) === null || _this$media3 === void 0 ? void 0 : _this$media3.mediaViewerExtensions,
|
|
498
498
|
fallbackMediaNameFetcher: (_this$media4 = this.media) === null || _this$media4 === void 0 ? void 0 : _this$media4.fallbackMediaNameFetcher,
|
|
499
|
+
onMediaRenderEvent: (_this$media5 = this.media) === null || _this$media5 === void 0 ? void 0 : _this$media5.onMediaRenderEvent,
|
|
499
500
|
nestedUnder
|
|
500
501
|
};
|
|
501
502
|
}
|
|
@@ -544,22 +545,22 @@ export default class ReactSerializer {
|
|
|
544
545
|
};
|
|
545
546
|
}
|
|
546
547
|
getMediaGroupProps(node) {
|
|
547
|
-
var _this$
|
|
548
|
+
var _this$media6, _this$media7;
|
|
548
549
|
return {
|
|
549
550
|
...this.getProps(node),
|
|
550
551
|
shouldOpenMediaViewer: this.shouldOpenMediaViewer,
|
|
551
552
|
allowAltTextOnImages: this.allowAltTextOnImages,
|
|
552
553
|
featureFlags: this.media && this.media.featureFlags,
|
|
553
|
-
enableDownloadButton: (_this$
|
|
554
|
-
ssr: (_this$
|
|
554
|
+
enableDownloadButton: (_this$media6 = this.media) === null || _this$media6 === void 0 ? void 0 : _this$media6.enableDownloadButton,
|
|
555
|
+
ssr: (_this$media7 = this.media) === null || _this$media7 === void 0 ? void 0 : _this$media7.ssr
|
|
555
556
|
};
|
|
556
557
|
}
|
|
557
558
|
getMediaInlineProps(node) {
|
|
558
|
-
var _this$
|
|
559
|
+
var _this$media8, _this$media9;
|
|
559
560
|
return {
|
|
560
561
|
...this.getProps(node),
|
|
561
|
-
ssr: (_this$
|
|
562
|
-
fallbackMediaNameFetcher: (_this$
|
|
562
|
+
ssr: (_this$media8 = this.media) === null || _this$media8 === void 0 ? void 0 : _this$media8.ssr,
|
|
563
|
+
fallbackMediaNameFetcher: (_this$media9 = this.media) === null || _this$media9 === void 0 ? void 0 : _this$media9.fallbackMediaNameFetcher
|
|
563
564
|
};
|
|
564
565
|
}
|
|
565
566
|
getTaskItemProps(node, path = []) {
|
|
@@ -599,17 +600,7 @@ export default class ReactSerializer {
|
|
|
599
600
|
};
|
|
600
601
|
}
|
|
601
602
|
getProps(node, path = []) {
|
|
602
|
-
var _node$content;
|
|
603
603
|
const startPos = this.startPos + path.length;
|
|
604
|
-
|
|
605
|
-
// `content` is a recursive Fragment.toJSON() attached to every node, so the document is
|
|
606
|
-
// re-serialized once per ancestor — O(depth x size) overall, and a table paid it again for
|
|
607
|
-
// every row and cell. Consumers read `getContent()` instead, which serializes at most once.
|
|
608
|
-
// Experiment call last, so exposure only fires for nodes that have content to serialize.
|
|
609
|
-
const skipEagerContent = !!((_node$content = node.content) !== null && _node$content !== void 0 && _node$content.childCount) && isExperimentEnabled('platform_editor_renderer_defer_content');
|
|
610
|
-
|
|
611
|
-
// Shared so the `content` prop and `getContent()` never serialize the subtree twice.
|
|
612
|
-
const getContent = createContentGetter(node.content);
|
|
613
604
|
return {
|
|
614
605
|
asInline: this.inlinePositions.has(startPos) ? 'on' : undefined,
|
|
615
606
|
text: node.text,
|
|
@@ -619,8 +610,7 @@ export default class ReactSerializer {
|
|
|
619
610
|
portal: this.portal,
|
|
620
611
|
rendererContext: this.rendererContext,
|
|
621
612
|
serializer: this,
|
|
622
|
-
|
|
623
|
-
getContent,
|
|
613
|
+
getContent: createContentGetter(node.content),
|
|
624
614
|
allowHeadingAnchorLinks: this.allowHeadingAnchorLinks,
|
|
625
615
|
allowCopyToClipboard: this.allowCopyToClipboard,
|
|
626
616
|
allowDownloadCodeBlock: this.allowDownloadCodeBlock,
|