@atlaskit/renderer 92.0.0 → 93.0.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 +75 -0
- package/dist/cjs/analytics/enums.js +1 -0
- package/dist/cjs/i18n/en.js +28 -0
- package/dist/cjs/i18n/en_GB.js +28 -0
- package/dist/cjs/i18n/pl.js +7 -1
- package/dist/cjs/i18n/pt_BR.js +1 -1
- package/dist/cjs/react/marks/alignment.js +11 -12
- package/dist/cjs/react/marks/breakout.js +7 -9
- package/dist/cjs/react/marks/link.js +13 -6
- package/dist/cjs/react/nodes/codeBlock.js +1 -1
- package/dist/cjs/react/nodes/codeBlockCopyButton.js +13 -11
- package/dist/cjs/react/nodes/embedCard.js +25 -33
- package/dist/cjs/react/nodes/heading-anchor.js +7 -6
- package/dist/cjs/react/nodes/mediaSingle/index.js +15 -4
- package/dist/cjs/react/nodes/mediaSingle/styles.js +7 -10
- package/dist/cjs/react/nodes/panel.js +36 -20
- package/dist/cjs/react/nodes/table/sticky.js +51 -54
- package/dist/cjs/react/nodes/table.js +2 -10
- package/dist/cjs/react/utils/performance/RenderTracking.js +52 -0
- package/dist/cjs/render-document.js +2 -2
- package/dist/cjs/text/index.js +2 -2
- package/dist/cjs/ui/Expand.js +40 -20
- package/dist/cjs/ui/MediaCard.js +4 -14
- package/dist/cjs/ui/Renderer/click-to-edit.js +4 -4
- package/dist/cjs/ui/Renderer/index.js +39 -50
- package/dist/cjs/ui/Renderer/style.js +58 -63
- package/dist/cjs/ui/Renderer/truncated-wrapper.js +19 -21
- package/dist/cjs/ui/SortingIcon.js +8 -9
- package/dist/cjs/ui/renderer-props.js +1 -3
- package/dist/cjs/utils.js +2 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/analytics/enums.js +1 -0
- package/dist/es2019/i18n/en.js +20 -0
- package/dist/es2019/i18n/en_GB.js +20 -0
- package/dist/es2019/i18n/pl.js +7 -1
- package/dist/es2019/i18n/pt_BR.js +1 -1
- package/dist/es2019/react/marks/alignment.js +15 -7
- package/dist/es2019/react/marks/breakout.js +6 -5
- package/dist/es2019/react/marks/link.js +8 -5
- package/dist/es2019/react/nodes/codeBlock.js +1 -1
- package/dist/es2019/react/nodes/codeBlockCopyButton.js +12 -9
- package/dist/es2019/react/nodes/embedCard.js +16 -16
- package/dist/es2019/react/nodes/heading-anchor.js +9 -6
- package/dist/es2019/react/nodes/mediaSingle/index.js +10 -6
- package/dist/es2019/react/nodes/mediaSingle/styles.js +6 -7
- package/dist/es2019/react/nodes/panel.js +38 -18
- package/dist/es2019/react/nodes/table/sticky.js +48 -41
- package/dist/es2019/react/nodes/table.js +2 -5
- package/dist/es2019/react/utils/performance/RenderTracking.js +37 -0
- package/dist/es2019/render-document.js +1 -1
- package/dist/es2019/text/index.js +1 -1
- package/dist/es2019/ui/Expand.js +52 -28
- package/dist/es2019/ui/MediaCard.js +3 -6
- package/dist/es2019/ui/Renderer/click-to-edit.js +1 -1
- package/dist/es2019/ui/Renderer/index.js +38 -43
- package/dist/es2019/ui/Renderer/style.js +363 -337
- package/dist/es2019/ui/Renderer/truncated-wrapper.js +26 -15
- package/dist/es2019/ui/SortingIcon.js +9 -7
- package/dist/es2019/ui/renderer-props.js +1 -1
- package/dist/es2019/utils.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/analytics/enums.js +1 -0
- package/dist/esm/i18n/en.js +20 -0
- package/dist/esm/i18n/en_GB.js +20 -0
- package/dist/esm/i18n/pl.js +7 -1
- package/dist/esm/i18n/pt_BR.js +1 -1
- package/dist/esm/react/marks/alignment.js +13 -6
- package/dist/esm/react/marks/breakout.js +6 -5
- package/dist/esm/react/marks/link.js +7 -5
- package/dist/esm/react/nodes/codeBlock.js +1 -1
- package/dist/esm/react/nodes/codeBlockCopyButton.js +10 -7
- package/dist/esm/react/nodes/embedCard.js +19 -19
- package/dist/esm/react/nodes/heading-anchor.js +8 -6
- package/dist/esm/react/nodes/mediaSingle/index.js +11 -6
- package/dist/esm/react/nodes/mediaSingle/styles.js +5 -7
- package/dist/esm/react/nodes/panel.js +34 -17
- package/dist/esm/react/nodes/table/sticky.js +53 -52
- package/dist/esm/react/nodes/table.js +2 -8
- package/dist/esm/react/utils/performance/RenderTracking.js +39 -0
- package/dist/esm/render-document.js +1 -1
- package/dist/esm/text/index.js +1 -1
- package/dist/esm/ui/Expand.js +45 -21
- package/dist/esm/ui/MediaCard.js +3 -9
- package/dist/esm/ui/Renderer/click-to-edit.js +1 -1
- package/dist/esm/ui/Renderer/index.js +39 -47
- package/dist/esm/ui/Renderer/style.js +56 -57
- package/dist/esm/ui/Renderer/truncated-wrapper.js +20 -14
- package/dist/esm/ui/SortingIcon.js +9 -7
- package/dist/esm/ui/renderer-props.js +1 -1
- package/dist/esm/utils.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/analytics/enums.d.ts +1 -0
- package/dist/types/analytics/events.d.ts +7 -2
- package/dist/types/i18n/en.d.ts +20 -0
- package/dist/types/i18n/en_GB.d.ts +20 -0
- package/dist/types/i18n/pl.d.ts +6 -0
- package/dist/types/react/marks/alignment.d.ts +2 -2
- package/dist/types/react/marks/breakout.d.ts +4 -3
- package/dist/types/react/marks/link.d.ts +2 -2
- package/dist/types/react/nodes/embedCard.d.ts +3 -2
- package/dist/types/react/nodes/heading-anchor.d.ts +1 -0
- package/dist/types/react/nodes/media.d.ts +1 -1
- package/dist/types/react/nodes/mediaSingle/index.d.ts +1 -0
- package/dist/types/react/nodes/mediaSingle/styles.d.ts +2 -3
- package/dist/types/react/nodes/panel.d.ts +3 -1
- package/dist/types/react/nodes/table/sticky.d.ts +4 -2
- package/dist/types/react/utils/performance/RenderTracking.d.ts +15 -0
- package/dist/types/ui/Expand.d.ts +2 -2
- package/dist/types/ui/MediaCard.d.ts +1 -3
- package/dist/types/ui/Renderer/index.d.ts +0 -25
- package/dist/types/ui/Renderer/style.d.ts +1 -4
- package/dist/types/ui/Renderer/truncated-wrapper.d.ts +3 -1
- package/dist/types/ui/SortingIcon.d.ts +3 -3
- package/dist/types/ui/renderer-props.d.ts +14 -2
- package/package.json +22 -24
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import styled from 'styled-components';
|
|
5
4
|
import { calcTableWidth, TableSharedCssClassName, tableMarginTop } from '@atlaskit/editor-common/styles';
|
|
6
5
|
import { WidthConsumer, overflowShadow } from '@atlaskit/editor-common/ui';
|
|
7
6
|
import { createCompareNodes, convertProsemirrorTableNodeToArrayOfRows, hasMergedCell, compose } from '@atlaskit/editor-common/utils';
|
|
@@ -102,8 +101,6 @@ const tableCanBeSticky = (node, children) => {
|
|
|
102
101
|
return isHeaderRowEnabled(children) && node && node.firstChild && !hasRowspan(node.firstChild);
|
|
103
102
|
};
|
|
104
103
|
|
|
105
|
-
const MainTableContainer = styled.div``;
|
|
106
|
-
|
|
107
104
|
const canUseLinelength = appearance => appearance === 'full-page' || appearance === 'mobile';
|
|
108
105
|
|
|
109
106
|
export class TableContainer extends React.Component {
|
|
@@ -290,10 +287,10 @@ export class TableContainer extends React.Component {
|
|
|
290
287
|
columnWidths: columnWidths,
|
|
291
288
|
rowHeight: this.headerRowHeight,
|
|
292
289
|
allowDynamicTextSizing: allowDynamicTextSizing
|
|
293
|
-
}, [children && children[0]]), /*#__PURE__*/React.createElement(
|
|
290
|
+
}, [children && children[0]]), /*#__PURE__*/React.createElement("div", {
|
|
294
291
|
className: `${TableSharedCssClassName.TABLE_CONTAINER} ${this.props.shadowClassNames}`,
|
|
295
292
|
"data-layout": layout,
|
|
296
|
-
|
|
293
|
+
ref: this.props.handleRef,
|
|
297
294
|
style: {
|
|
298
295
|
width: tableWidth,
|
|
299
296
|
left: left && left < 0 ? left : undefined
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import debounce from 'lodash/debounce';
|
|
3
|
+
import { useComponentRenderTracking } from '@atlaskit/editor-common/utils';
|
|
4
|
+
import { EVENT_TYPE } from '../../../analytics/enums';
|
|
5
|
+
export function RenderTracking(props) {
|
|
6
|
+
const debouncedHandleAnalyticsEvent = useMemo(() => debounce(props.handleAnalyticsEvent, 500), [props.handleAnalyticsEvent]);
|
|
7
|
+
useComponentRenderTracking({
|
|
8
|
+
onRender: ({
|
|
9
|
+
renderCount,
|
|
10
|
+
propsDifference,
|
|
11
|
+
componentId
|
|
12
|
+
}) => {
|
|
13
|
+
if (!renderCount) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
debouncedHandleAnalyticsEvent({
|
|
18
|
+
action: props.action,
|
|
19
|
+
actionSubject: props.actionSubject,
|
|
20
|
+
attributes: {
|
|
21
|
+
count: renderCount,
|
|
22
|
+
propsDifference: propsDifference,
|
|
23
|
+
componentId
|
|
24
|
+
},
|
|
25
|
+
eventType: EVENT_TYPE.OPERATIONAL
|
|
26
|
+
});
|
|
27
|
+
},
|
|
28
|
+
propsDiffingOptions: {
|
|
29
|
+
enabled: true,
|
|
30
|
+
props: props.componentProps,
|
|
31
|
+
propsToIgnore: props.propsToIgnore,
|
|
32
|
+
useShallow: props.useShallow
|
|
33
|
+
},
|
|
34
|
+
zeroBasedCount: true
|
|
35
|
+
});
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defaultSchema } from '@atlaskit/adf-schema';
|
|
1
|
+
import { defaultSchema } from '@atlaskit/adf-schema/schema-default';
|
|
2
2
|
import { getValidDocument } from '@atlaskit/editor-common/validator';
|
|
3
3
|
import { validateADFEntity, findAndTrackUnsupportedContentNodes } from '@atlaskit/editor-common/utils';
|
|
4
4
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from './analytics/enums';
|
package/dist/es2019/ui/Expand.js
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
|
|
3
3
|
/** @jsx jsx */
|
|
4
|
-
import React, {
|
|
5
|
-
import { jsx } from '@emotion/react';
|
|
6
|
-
import styled from 'styled-components';
|
|
4
|
+
import React, { useRef, useCallback } from 'react';
|
|
5
|
+
import { css, jsx } from '@emotion/react';
|
|
7
6
|
import { gridSize, fontSize } from '@atlaskit/theme/constants';
|
|
8
7
|
import ChevronRightIcon from '@atlaskit/icon/glyph/chevron-right';
|
|
9
8
|
import Tooltip from '@atlaskit/tooltip';
|
|
10
|
-
import { expandMessages, sharedExpandStyles, WidthProvider, ExpandIconWrapper,
|
|
9
|
+
import { expandMessages, sharedExpandStyles, WidthProvider, ExpandIconWrapper, clearNextSiblingMarginTopStyle, ExpandLayoutWrapperWithRef } from '@atlaskit/editor-common/ui';
|
|
11
10
|
import { akEditorLineHeight, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
12
11
|
import { PLATFORM, MODE } from '../analytics/events';
|
|
13
12
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../analytics/enums';
|
|
14
13
|
import { injectIntl } from 'react-intl-next';
|
|
15
14
|
import { ActiveHeaderIdConsumer } from './active-header-id-provider';
|
|
16
15
|
import _uniqueId from 'lodash/uniqueId';
|
|
17
|
-
const
|
|
16
|
+
const titleStyles = css`
|
|
18
17
|
outline: none;
|
|
19
18
|
border: none;
|
|
20
19
|
font-size: ${relativeFontSizeToBase16(fontSize())};
|
|
@@ -26,29 +25,53 @@ const Title = styled.span`
|
|
|
26
25
|
padding: 0 0 0 ${gridSize() / 2}px;
|
|
27
26
|
text-align: left;
|
|
28
27
|
`;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
`;
|
|
28
|
+
|
|
29
|
+
const Container = props => {
|
|
30
|
+
const paddingBottom = `${props.expanded ? gridSize() : 0}px`;
|
|
31
|
+
const sharedContainerStyles = sharedExpandStyles.containerStyles(props);
|
|
32
|
+
|
|
33
|
+
const styles = themeProps => css`
|
|
34
|
+
${sharedContainerStyles(themeProps)}
|
|
35
|
+
padding: 0;
|
|
36
|
+
padding-bottom: ${paddingBottom};
|
|
37
|
+
`;
|
|
38
|
+
|
|
39
|
+
return jsx("div", _extends({
|
|
40
|
+
css: styles
|
|
41
|
+
}, props), props.children);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const TitleContainer = props => {
|
|
45
|
+
const paddingBottom = `${!props.expanded ? gridSize() : 0}px`;
|
|
46
|
+
|
|
47
|
+
const styles = themeProps => css`
|
|
48
|
+
${sharedExpandStyles.titleContainerStyles(themeProps)}
|
|
49
|
+
padding: ${gridSize()}px;
|
|
50
|
+
padding-bottom: ${paddingBottom};
|
|
51
|
+
`;
|
|
52
|
+
|
|
53
|
+
return jsx("button", _extends({
|
|
54
|
+
css: styles
|
|
55
|
+
}, props), props.children);
|
|
56
|
+
};
|
|
57
|
+
|
|
39
58
|
TitleContainer.displayName = 'TitleContainerButton';
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
59
|
+
|
|
60
|
+
const ContentContainer = props => {
|
|
61
|
+
const sharedContentStyles = sharedExpandStyles.contentStyles(props);
|
|
62
|
+
const visibility = props.expanded ? 'visible' : 'hidden';
|
|
63
|
+
|
|
64
|
+
const styles = themeProps => css`
|
|
65
|
+
${sharedContentStyles(themeProps)};
|
|
66
|
+
padding-right: ${gridSize() * 2}px;
|
|
67
|
+
padding-left: ${gridSize() * 5 - gridSize() / 2}px;
|
|
68
|
+
visibility: ${visibility};
|
|
69
|
+
`;
|
|
70
|
+
|
|
71
|
+
return jsx("div", _extends({
|
|
72
|
+
css: styles
|
|
73
|
+
}, props), props.children);
|
|
74
|
+
};
|
|
52
75
|
|
|
53
76
|
function fireExpandToggleAnalytics(nodeType, expanded, fireAnalyticsEvent) {
|
|
54
77
|
if (!fireAnalyticsEvent) {
|
|
@@ -115,7 +138,8 @@ function Expand({
|
|
|
115
138
|
expanded: expanded
|
|
116
139
|
}, jsx(ChevronRightIcon, {
|
|
117
140
|
label: label
|
|
118
|
-
}))), jsx(
|
|
141
|
+
}))), jsx("span", {
|
|
142
|
+
css: titleStyles,
|
|
119
143
|
id: id
|
|
120
144
|
}, title || intl.formatMessage(expandMessages.expandDefaultTitle))), jsx(ContentContainer, {
|
|
121
145
|
expanded: expanded
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { Component } from 'react';
|
|
2
|
+
import React, { Component } from 'react';
|
|
4
3
|
import { filter } from '@atlaskit/adf-utils';
|
|
5
4
|
import { Card, CardLoading, CardError } from '@atlaskit/media-card';
|
|
6
5
|
import { getMediaClient } from '@atlaskit/media-client';
|
|
7
6
|
import { withImageLoader } from '@atlaskit/editor-common/utils';
|
|
8
|
-
import styled from 'styled-components';
|
|
9
7
|
const mediaIdentifierMap = new Map();
|
|
10
8
|
export const getListOfIdentifiersFromDoc = doc => {
|
|
11
9
|
if (!doc) {
|
|
@@ -269,7 +267,7 @@ export class MediaCardInternal extends Component {
|
|
|
269
267
|
collectionName: collection,
|
|
270
268
|
occurrenceKey
|
|
271
269
|
};
|
|
272
|
-
return /*#__PURE__*/React.createElement(
|
|
270
|
+
return /*#__PURE__*/React.createElement("div", getClipboardAttrs({
|
|
273
271
|
id,
|
|
274
272
|
alt,
|
|
275
273
|
collection,
|
|
@@ -298,8 +296,7 @@ export class MediaCardInternal extends Component {
|
|
|
298
296
|
}));
|
|
299
297
|
}
|
|
300
298
|
|
|
301
|
-
}
|
|
302
|
-
export const CardWrapper = styled.div``; // Needed for copy & paste
|
|
299
|
+
} // Needed for copy & paste
|
|
303
300
|
|
|
304
301
|
export const getClipboardAttrs = ({
|
|
305
302
|
id,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { fileCardImageViewSelector } from '@atlaskit/media-card';
|
|
1
|
+
import { fileCardImageViewSelector } from '@atlaskit/media-card/classnames';
|
|
2
2
|
import { mediaViewerPopupClass } from '@atlaskit/media-viewer/classnames';
|
|
3
3
|
/**
|
|
4
4
|
* Check if an element is interactive (or otherwise if clicking on it shouldn't transition the
|
|
@@ -2,22 +2,21 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
|
|
4
4
|
/** @jsx jsx */
|
|
5
|
-
import React, { useContext, useLayoutEffect, useRef } from 'react';
|
|
5
|
+
import React, { Fragment, useContext, useLayoutEffect, useRef } from 'react';
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
7
|
import { PureComponent } from 'react';
|
|
8
|
-
import { getSchemaBasedOnStage } from '@atlaskit/adf-schema';
|
|
8
|
+
import { getSchemaBasedOnStage } from '@atlaskit/adf-schema/schema-default';
|
|
9
9
|
import { reduce } from '@atlaskit/adf-utils';
|
|
10
10
|
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
11
|
-
import { UnsupportedBlock, BaseTheme, WidthProvider, WithCreateAnalyticsEvent,
|
|
11
|
+
import { UnsupportedBlock, BaseTheme, WidthProvider, WithCreateAnalyticsEvent, IntlErrorBoundary } from '@atlaskit/editor-common/ui';
|
|
12
12
|
import { getAnalyticsAppearance, getAnalyticsEventSeverity, getResponseEndTime, startMeasure, stopMeasure, shouldForceTracking, measureTTI } from '@atlaskit/editor-common/utils';
|
|
13
13
|
import { normalizeFeatureFlags } from '@atlaskit/editor-common/normalize-feature-flags';
|
|
14
14
|
import { akEditorFullPageDefaultFontSize } from '@atlaskit/editor-shared-styles';
|
|
15
|
-
import { IframeWidthObserverFallbackWrapper, IframeWrapperConsumer } from '@atlaskit/width-detector';
|
|
16
15
|
import { FabricChannel } from '@atlaskit/analytics-listeners';
|
|
17
16
|
import { FabricEditorAnalyticsContext } from '@atlaskit/analytics-namespaced-context';
|
|
18
17
|
import uuid from 'uuid/v4';
|
|
19
18
|
import { ReactSerializer, renderDocument } from '../../';
|
|
20
|
-
import {
|
|
19
|
+
import { rendererStyles } from './style';
|
|
21
20
|
import { TruncatedWrapper } from './truncated-wrapper';
|
|
22
21
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../../analytics/enums';
|
|
23
22
|
import { PLATFORM, MODE } from '../../analytics/events';
|
|
@@ -35,15 +34,21 @@ import { isInteractiveElement } from './click-to-edit';
|
|
|
35
34
|
import { RendererContextProvider } from '../../renderer-context';
|
|
36
35
|
import memoizeOne from 'memoize-one';
|
|
37
36
|
import { ErrorBoundary } from './ErrorBoundary';
|
|
37
|
+
import { RenderTracking } from '../../react/utils/performance/RenderTracking';
|
|
38
38
|
export const NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
39
39
|
export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
40
40
|
export class Renderer extends PureComponent {
|
|
41
41
|
constructor(props) {
|
|
42
42
|
super(props);
|
|
43
43
|
|
|
44
|
-
_defineProperty(this, "featureFlags", memoizeOne(featureFlags =>
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
_defineProperty(this, "featureFlags", memoizeOne(featureFlags => {
|
|
45
|
+
const normalizedFeatureFlags = normalizeFeatureFlags(featureFlags, {
|
|
46
|
+
objectFlagKeys: ['rendererRenderTracking']
|
|
47
|
+
});
|
|
48
|
+
return {
|
|
49
|
+
featureFlags: normalizedFeatureFlags
|
|
50
|
+
};
|
|
51
|
+
}));
|
|
47
52
|
|
|
48
53
|
_defineProperty(this, "fireAnalyticsEvent", event => {
|
|
49
54
|
const {
|
|
@@ -276,6 +281,8 @@ export class Renderer extends PureComponent {
|
|
|
276
281
|
};
|
|
277
282
|
|
|
278
283
|
try {
|
|
284
|
+
var _this$featureFlags, _this$featureFlags$fe, _this$featureFlags$fe2;
|
|
285
|
+
|
|
279
286
|
const schema = this.getSchema();
|
|
280
287
|
const {
|
|
281
288
|
result,
|
|
@@ -291,7 +298,7 @@ export class Renderer extends PureComponent {
|
|
|
291
298
|
value: this.featureFlags(this.props.featureFlags)
|
|
292
299
|
}, jsx(CopyTextProvider, null, jsx(ActiveHeaderIdProvider, {
|
|
293
300
|
value: getActiveHeadingId(allowHeadingAnchorLinks)
|
|
294
|
-
}, jsx(
|
|
301
|
+
}, jsx(AnalyticsContext.Provider, {
|
|
295
302
|
value: {
|
|
296
303
|
fireAnalyticsEvent: event => this.fireAnalyticsEvent(event)
|
|
297
304
|
}
|
|
@@ -312,11 +319,20 @@ export class Renderer extends PureComponent {
|
|
|
312
319
|
doc: pmDoc,
|
|
313
320
|
schema: schema,
|
|
314
321
|
onAnalyticsEvent: this.fireAnalyticsEvent
|
|
315
|
-
}, result)))))))
|
|
316
|
-
|
|
322
|
+
}, result)))))));
|
|
323
|
+
let rendererResult = truncated ? jsx(TruncatedWrapper, {
|
|
317
324
|
height: maxHeight,
|
|
318
325
|
fadeHeight: fadeOutHeight
|
|
319
326
|
}, rendererOutput) : rendererOutput;
|
|
327
|
+
const rendererRenderTracking = (_this$featureFlags = this.featureFlags(this.props.featureFlags)) === null || _this$featureFlags === void 0 ? void 0 : (_this$featureFlags$fe = _this$featureFlags.featureFlags) === null || _this$featureFlags$fe === void 0 ? void 0 : (_this$featureFlags$fe2 = _this$featureFlags$fe.rendererRenderTracking) === null || _this$featureFlags$fe2 === void 0 ? void 0 : _this$featureFlags$fe2[ACTION_SUBJECT.RENDERER];
|
|
328
|
+
const reRenderTracking = (rendererRenderTracking === null || rendererRenderTracking === void 0 ? void 0 : rendererRenderTracking.enabled) && jsx(RenderTracking, {
|
|
329
|
+
componentProps: this.props,
|
|
330
|
+
action: ACTION.RE_RENDERED,
|
|
331
|
+
actionSubject: ACTION_SUBJECT.RENDERER,
|
|
332
|
+
handleAnalyticsEvent: this.fireAnalyticsEvent,
|
|
333
|
+
useShallow: rendererRenderTracking.useShallow
|
|
334
|
+
});
|
|
335
|
+
return jsx(Fragment, null, reRenderTracking, rendererResult);
|
|
320
336
|
} catch (e) {
|
|
321
337
|
if (onError) {
|
|
322
338
|
onError(e);
|
|
@@ -361,18 +377,18 @@ const RendererWithAnalytics = /*#__PURE__*/React.memo(props => jsx(FabricEditorA
|
|
|
361
377
|
}
|
|
362
378
|
}, jsx(WithCreateAnalyticsEvent, {
|
|
363
379
|
render: createAnalyticsEvent => {
|
|
364
|
-
// `
|
|
380
|
+
// `IntlErrorBoundary` only captures Internationalisation errors, leaving others for `ErrorBoundary`.
|
|
365
381
|
return jsx(ErrorBoundary, {
|
|
366
382
|
component: ACTION_SUBJECT.RENDERER,
|
|
367
383
|
rethrowError: true,
|
|
368
384
|
fallbackComponent: null,
|
|
369
385
|
createAnalyticsEvent: createAnalyticsEvent
|
|
370
|
-
}, jsx(
|
|
386
|
+
}, jsx(IntlErrorBoundary, null, jsx(Renderer, _extends({}, props, {
|
|
371
387
|
createAnalyticsEvent: createAnalyticsEvent
|
|
372
388
|
}))));
|
|
373
389
|
}
|
|
374
390
|
})));
|
|
375
|
-
const
|
|
391
|
+
const RendererWrapper = /*#__PURE__*/React.memo(props => {
|
|
376
392
|
const {
|
|
377
393
|
allowColumnSorting,
|
|
378
394
|
dynamicTextSizing,
|
|
@@ -380,46 +396,25 @@ const RendererWithIframeFallbackWrapper = /*#__PURE__*/React.memo(props => {
|
|
|
380
396
|
innerRef,
|
|
381
397
|
appearance,
|
|
382
398
|
children,
|
|
383
|
-
subscribe,
|
|
384
399
|
onClick,
|
|
385
400
|
onMouseDown
|
|
386
401
|
} = props;
|
|
387
|
-
|
|
402
|
+
return jsx(WidthProvider, {
|
|
388
403
|
className: "ak-renderer-wrapper"
|
|
389
404
|
}, jsx(BaseTheme, {
|
|
390
405
|
dynamicTextSizing: dynamicTextSizing,
|
|
391
406
|
baseFontSize: !dynamicTextSizing && appearance && appearance !== 'comment' ? akEditorFullPageDefaultFontSize : undefined
|
|
392
|
-
}, jsx(
|
|
393
|
-
|
|
394
|
-
appearance: appearance,
|
|
395
|
-
allowNestedHeaderLinks: allowNestedHeaderLinks,
|
|
396
|
-
allowColumnSorting: !!allowColumnSorting,
|
|
407
|
+
}, jsx("div", {
|
|
408
|
+
ref: innerRef,
|
|
397
409
|
onClick: onClick,
|
|
398
410
|
onMouseDown: onMouseDown,
|
|
399
|
-
css: rendererStyles
|
|
411
|
+
css: rendererStyles({
|
|
412
|
+
appearance,
|
|
413
|
+
allowNestedHeaderLinks,
|
|
414
|
+
allowColumnSorting: !!allowColumnSorting
|
|
415
|
+
})
|
|
400
416
|
}, children)));
|
|
401
|
-
|
|
402
|
-
if (!subscribe) {
|
|
403
|
-
return jsx(IframeWidthObserverFallbackWrapper, null, renderer);
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
return renderer;
|
|
407
417
|
});
|
|
408
|
-
/**
|
|
409
|
-
* When the product doesn't provide a IframeWidthObserverFallbackWrapper,
|
|
410
|
-
* we will give one to the renderer,
|
|
411
|
-
*
|
|
412
|
-
* so if we have more than one `WidthProvider` on the content,
|
|
413
|
-
* only one iframe will be created on the older browsers.
|
|
414
|
-
*/
|
|
415
|
-
|
|
416
|
-
export function RendererWrapper(props) {
|
|
417
|
-
return jsx(IframeWrapperConsumer, null, ({
|
|
418
|
-
subscribe
|
|
419
|
-
}) => jsx(RendererWithIframeFallbackWrapper, _extends({}, props, {
|
|
420
|
-
subscribe: subscribe
|
|
421
|
-
})));
|
|
422
|
-
}
|
|
423
418
|
|
|
424
419
|
function RendererActionsInternalUpdater({
|
|
425
420
|
children,
|