@atlaskit/renderer 108.0.1 → 108.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 +22 -0
- package/dist/cjs/react/marks/link.js +12 -2
- package/dist/cjs/react/nodes/blockCard.js +12 -2
- package/dist/cjs/react/nodes/codeBlock/components/codeBlockContainer.js +1 -1
- package/dist/cjs/react/nodes/embedCard.js +12 -2
- package/dist/cjs/react/nodes/inlineCard.js +16 -4
- package/dist/cjs/ui/Expand.js +8 -7
- package/dist/cjs/ui/Renderer/ErrorBoundary.js +8 -1
- package/dist/cjs/ui/Renderer/index.js +34 -23
- package/dist/cjs/ui/Renderer/style.js +11 -4
- package/dist/cjs/ui/SortingIcon.js +1 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/react/marks/link.js +12 -2
- package/dist/es2019/react/nodes/blockCard.js +12 -2
- package/dist/es2019/react/nodes/codeBlock/components/codeBlockContainer.js +2 -2
- package/dist/es2019/react/nodes/embedCard.js +12 -2
- package/dist/es2019/react/nodes/inlineCard.js +16 -4
- package/dist/es2019/ui/Expand.js +8 -5
- package/dist/es2019/ui/Renderer/ErrorBoundary.js +8 -1
- package/dist/es2019/ui/Renderer/index.js +34 -23
- package/dist/es2019/ui/Renderer/style.js +33 -16
- package/dist/es2019/ui/SortingIcon.js +1 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/react/marks/link.js +12 -2
- package/dist/esm/react/nodes/blockCard.js +12 -2
- package/dist/esm/react/nodes/codeBlock/components/codeBlockContainer.js +2 -2
- package/dist/esm/react/nodes/embedCard.js +12 -2
- package/dist/esm/react/nodes/inlineCard.js +16 -4
- package/dist/esm/ui/Expand.js +8 -7
- package/dist/esm/ui/Renderer/ErrorBoundary.js +8 -1
- package/dist/esm/ui/Renderer/index.js +34 -23
- package/dist/esm/ui/Renderer/style.js +11 -4
- package/dist/esm/ui/SortingIcon.js +1 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/ui/Renderer/ErrorBoundary.d.ts +1 -1
- package/dist/types/ui/Renderer/style.d.ts +1 -0
- package/dist/types-ts4.5/actions/index.d.ts +61 -0
- package/dist/types-ts4.5/actions/matches-utils.d.ts +7 -0
- package/dist/types-ts4.5/actions.d.ts +3 -0
- package/dist/types-ts4.5/analytics/analyticsContext.d.ts +6 -0
- package/dist/types-ts4.5/analytics/enums.d.ts +58 -0
- package/dist/types-ts4.5/analytics/events.d.ts +118 -0
- package/dist/types-ts4.5/analytics/unsupported-content.d.ts +10 -0
- package/dist/types-ts4.5/consts.d.ts +12 -0
- package/dist/types-ts4.5/i18n/cs.d.ts +20 -0
- package/dist/types-ts4.5/i18n/da.d.ts +20 -0
- package/dist/types-ts4.5/i18n/de.d.ts +20 -0
- package/dist/types-ts4.5/i18n/en.d.ts +20 -0
- package/dist/types-ts4.5/i18n/en_GB.d.ts +20 -0
- package/dist/types-ts4.5/i18n/en_ZZ.d.ts +20 -0
- package/dist/types-ts4.5/i18n/es.d.ts +20 -0
- package/dist/types-ts4.5/i18n/et.d.ts +8 -0
- package/dist/types-ts4.5/i18n/fi.d.ts +20 -0
- package/dist/types-ts4.5/i18n/fr.d.ts +20 -0
- package/dist/types-ts4.5/i18n/hu.d.ts +20 -0
- package/dist/types-ts4.5/i18n/index.d.ts +31 -0
- package/dist/types-ts4.5/i18n/it.d.ts +20 -0
- package/dist/types-ts4.5/i18n/ja.d.ts +20 -0
- package/dist/types-ts4.5/i18n/ko.d.ts +20 -0
- package/dist/types-ts4.5/i18n/nb.d.ts +20 -0
- package/dist/types-ts4.5/i18n/nl.d.ts +20 -0
- package/dist/types-ts4.5/i18n/pl.d.ts +20 -0
- package/dist/types-ts4.5/i18n/pt_BR.d.ts +20 -0
- package/dist/types-ts4.5/i18n/pt_PT.d.ts +8 -0
- package/dist/types-ts4.5/i18n/ru.d.ts +20 -0
- package/dist/types-ts4.5/i18n/sk.d.ts +8 -0
- package/dist/types-ts4.5/i18n/sv.d.ts +20 -0
- package/dist/types-ts4.5/i18n/th.d.ts +20 -0
- package/dist/types-ts4.5/i18n/tr.d.ts +20 -0
- package/dist/types-ts4.5/i18n/uk.d.ts +20 -0
- package/dist/types-ts4.5/i18n/vi.d.ts +20 -0
- package/dist/types-ts4.5/i18n/zh.d.ts +20 -0
- package/dist/types-ts4.5/i18n/zh_TW.d.ts +20 -0
- package/dist/types-ts4.5/index.d.ts +11 -0
- package/dist/types-ts4.5/messages.d.ts +61 -0
- package/dist/types-ts4.5/react/hooks/use-bidi-warnings.d.ts +10 -0
- package/dist/types-ts4.5/react/hooks/use-in-viewport.d.ts +5 -0
- package/dist/types-ts4.5/react/hooks/use-observed-width.d.ts +3 -0
- package/dist/types-ts4.5/react/index.d.ts +124 -0
- package/dist/types-ts4.5/react/marks/alignment.d.ts +4 -0
- package/dist/types-ts4.5/react/marks/annotation.d.ts +6 -0
- package/dist/types-ts4.5/react/marks/breakout.d.ts +6 -0
- package/dist/types-ts4.5/react/marks/code.d.ts +16 -0
- package/dist/types-ts4.5/react/marks/confluence-inline-comment.d.ts +8 -0
- package/dist/types-ts4.5/react/marks/data-consumer.d.ts +4 -0
- package/dist/types-ts4.5/react/marks/em.d.ts +3 -0
- package/dist/types-ts4.5/react/marks/fragment.d.ts +4 -0
- package/dist/types-ts4.5/react/marks/indentation.d.ts +4 -0
- package/dist/types-ts4.5/react/marks/index.d.ts +21 -0
- package/dist/types-ts4.5/react/marks/link.d.ts +9 -0
- package/dist/types-ts4.5/react/marks/strike.d.ts +3 -0
- package/dist/types-ts4.5/react/marks/strong.d.ts +3 -0
- package/dist/types-ts4.5/react/marks/subsup.d.ts +4 -0
- package/dist/types-ts4.5/react/marks/textColor.d.ts +4 -0
- package/dist/types-ts4.5/react/marks/underline.d.ts +3 -0
- package/dist/types-ts4.5/react/marks/unsupportedMark.d.ts +3 -0
- package/dist/types-ts4.5/react/marks/unsupportedNodeAttribute.d.ts +3 -0
- package/dist/types-ts4.5/react/nodes/blockCard.d.ts +12 -0
- package/dist/types-ts4.5/react/nodes/blockquote.d.ts +2 -0
- package/dist/types-ts4.5/react/nodes/bodiedExtension.d.ts +24 -0
- package/dist/types-ts4.5/react/nodes/bulletList.d.ts +5 -0
- package/dist/types-ts4.5/react/nodes/caption.d.ts +4 -0
- package/dist/types-ts4.5/react/nodes/codeBlock/codeBlock.d.ts +15 -0
- package/dist/types-ts4.5/react/nodes/codeBlock/components/codeBlockButtonContainer.d.ts +12 -0
- package/dist/types-ts4.5/react/nodes/codeBlock/components/codeBlockContainer.d.ts +10 -0
- package/dist/types-ts4.5/react/nodes/codeBlock/components/codeBlockCopyButton.d.ts +9 -0
- package/dist/types-ts4.5/react/nodes/codeBlock/components/codeBlockWrapButton.d.ts +11 -0
- package/dist/types-ts4.5/react/nodes/codeBlock/components/lightWeightCodeBlock.d.ts +9 -0
- package/dist/types-ts4.5/react/nodes/codeBlock/windowedCodeBlock.d.ts +4 -0
- package/dist/types-ts4.5/react/nodes/date.d.ts +11 -0
- package/dist/types-ts4.5/react/nodes/decisionItem.d.ts +3 -0
- package/dist/types-ts4.5/react/nodes/decisionList.d.ts +7 -0
- package/dist/types-ts4.5/react/nodes/doc.d.ts +3 -0
- package/dist/types-ts4.5/react/nodes/embedCard.d.ts +17 -0
- package/dist/types-ts4.5/react/nodes/emoji.d.ts +12 -0
- package/dist/types-ts4.5/react/nodes/extension.d.ts +113 -0
- package/dist/types-ts4.5/react/nodes/fallback.d.ts +16 -0
- package/dist/types-ts4.5/react/nodes/hardBreak.d.ts +6 -0
- package/dist/types-ts4.5/react/nodes/heading-anchor.d.ts +14 -0
- package/dist/types-ts4.5/react/nodes/heading.d.ts +14 -0
- package/dist/types-ts4.5/react/nodes/index.d.ts +95 -0
- package/dist/types-ts4.5/react/nodes/inline.d.ts +1 -0
- package/dist/types-ts4.5/react/nodes/inlineCard.d.ts +65 -0
- package/dist/types-ts4.5/react/nodes/inlineExtension.d.ts +18 -0
- package/dist/types-ts4.5/react/nodes/layoutColumn.d.ts +6 -0
- package/dist/types-ts4.5/react/nodes/layoutSection.d.ts +2 -0
- package/dist/types-ts4.5/react/nodes/listItem.d.ts +2 -0
- package/dist/types-ts4.5/react/nodes/media.d.ts +28 -0
- package/dist/types-ts4.5/react/nodes/mediaGroup.d.ts +29 -0
- package/dist/types-ts4.5/react/nodes/mediaInline.d.ts +26 -0
- package/dist/types-ts4.5/react/nodes/mediaSingle/index.d.ts +23 -0
- package/dist/types-ts4.5/react/nodes/mediaSingle/styles.d.ts +2 -0
- package/dist/types-ts4.5/react/nodes/mention.d.ts +13 -0
- package/dist/types-ts4.5/react/nodes/orderedList.d.ts +9 -0
- package/dist/types-ts4.5/react/nodes/panel.d.ts +17 -0
- package/dist/types-ts4.5/react/nodes/paragraph.d.ts +3 -0
- package/dist/types-ts4.5/react/nodes/placeholder.d.ts +6 -0
- package/dist/types-ts4.5/react/nodes/rule.d.ts +2 -0
- package/dist/types-ts4.5/react/nodes/status.d.ts +10 -0
- package/dist/types-ts4.5/react/nodes/table/colgroup.d.ts +9 -0
- package/dist/types-ts4.5/react/nodes/table/sticky.d.ts +38 -0
- package/dist/types-ts4.5/react/nodes/table/table.d.ts +7 -0
- package/dist/types-ts4.5/react/nodes/table/types.d.ts +7 -0
- package/dist/types-ts4.5/react/nodes/table.d.ts +269 -0
- package/dist/types-ts4.5/react/nodes/tableCell.d.ts +81 -0
- package/dist/types-ts4.5/react/nodes/tableRow.d.ts +24 -0
- package/dist/types-ts4.5/react/nodes/task-item-with-providers.d.ts +29 -0
- package/dist/types-ts4.5/react/nodes/taskItem.d.ts +19 -0
- package/dist/types-ts4.5/react/nodes/taskList.d.ts +8 -0
- package/dist/types-ts4.5/react/nodes/text-wrapper.d.ts +8 -0
- package/dist/types-ts4.5/react/nodes/unknownBlock.d.ts +2 -0
- package/dist/types-ts4.5/react/renderer-node.d.ts +4 -0
- package/dist/types-ts4.5/react/types.d.ts +58 -0
- package/dist/types-ts4.5/react/utils/clipboard.d.ts +1 -0
- package/dist/types-ts4.5/react/utils/element-selection.d.ts +9 -0
- package/dist/types-ts4.5/react/utils/getCardClickHandler.d.ts +2 -0
- package/dist/types-ts4.5/react/utils/inject-props.d.ts +6 -0
- package/dist/types-ts4.5/react/utils/links.d.ts +3 -0
- package/dist/types-ts4.5/react/utils/lists.d.ts +2 -0
- package/dist/types-ts4.5/react/utils/performance/RenderTracking.d.ts +15 -0
- package/dist/types-ts4.5/react/utils/use-select-all-trap.d.ts +2 -0
- package/dist/types-ts4.5/render-document.d.ts +23 -0
- package/dist/types-ts4.5/renderer-context.d.ts +7 -0
- package/dist/types-ts4.5/serializer.d.ts +4 -0
- package/dist/types-ts4.5/steps/index.d.ts +14 -0
- package/dist/types-ts4.5/text/index.d.ts +8 -0
- package/dist/types-ts4.5/text/nodes/blockquote.d.ts +3 -0
- package/dist/types-ts4.5/text/nodes/bulletList.d.ts +3 -0
- package/dist/types-ts4.5/text/nodes/date.d.ts +3 -0
- package/dist/types-ts4.5/text/nodes/decisionItem.d.ts +3 -0
- package/dist/types-ts4.5/text/nodes/hardBreak.d.ts +3 -0
- package/dist/types-ts4.5/text/nodes/heading.d.ts +3 -0
- package/dist/types-ts4.5/text/nodes/index.d.ts +6 -0
- package/dist/types-ts4.5/text/nodes/inlineCard.d.ts +3 -0
- package/dist/types-ts4.5/text/nodes/listItem.d.ts +3 -0
- package/dist/types-ts4.5/text/nodes/mediaGroup.d.ts +3 -0
- package/dist/types-ts4.5/text/nodes/mention.d.ts +3 -0
- package/dist/types-ts4.5/text/nodes/orderedList.d.ts +3 -0
- package/dist/types-ts4.5/text/nodes/panel.d.ts +3 -0
- package/dist/types-ts4.5/text/nodes/paragraph.d.ts +3 -0
- package/dist/types-ts4.5/text/nodes/rule.d.ts +3 -0
- package/dist/types-ts4.5/text/nodes/status.d.ts +3 -0
- package/dist/types-ts4.5/text/nodes/table.d.ts +3 -0
- package/dist/types-ts4.5/text/nodes/taskItem.d.ts +3 -0
- package/dist/types-ts4.5/text/nodes/unknown.d.ts +3 -0
- package/dist/types-ts4.5/text-serializer.d.ts +1 -0
- package/dist/types-ts4.5/types/i18n.d.ts +5 -0
- package/dist/types-ts4.5/types/mediaOptions.d.ts +12 -0
- package/dist/types-ts4.5/types/smartLinksOptions.d.ts +5 -0
- package/dist/types-ts4.5/ui/Expand.d.ts +23 -0
- package/dist/types-ts4.5/ui/ExtensionRenderer.d.ts +42 -0
- package/dist/types-ts4.5/ui/MediaCard.d.ts +77 -0
- package/dist/types-ts4.5/ui/Renderer/ErrorBoundary.d.ts +24 -0
- package/dist/types-ts4.5/ui/Renderer/breakout-ssr.d.ts +11 -0
- package/dist/types-ts4.5/ui/Renderer/click-to-edit.d.ts +6 -0
- package/dist/types-ts4.5/ui/Renderer/index.d.ts +38 -0
- package/dist/types-ts4.5/ui/Renderer/style.d.ts +16 -0
- package/dist/types-ts4.5/ui/Renderer/truncated-wrapper.d.ts +12 -0
- package/dist/types-ts4.5/ui/Renderer/types.d.ts +16 -0
- package/dist/types-ts4.5/ui/RendererActionsContext/WithRendererActions.d.ts +6 -0
- package/dist/types-ts4.5/ui/RendererActionsContext/index.d.ts +9 -0
- package/dist/types-ts4.5/ui/SmartCardStorage.d.ts +60 -0
- package/dist/types-ts4.5/ui/SortingIcon.d.ts +23 -0
- package/dist/types-ts4.5/ui/TaskItemsFormatContext/TaskItemsFormatContext.d.ts +15 -0
- package/dist/types-ts4.5/ui/TaskItemsFormatContext/index.d.ts +2 -0
- package/dist/types-ts4.5/ui/active-header-id-provider.d.ts +18 -0
- package/dist/types-ts4.5/ui/annotations/context.d.ts +27 -0
- package/dist/types-ts4.5/ui/annotations/draft/component.d.ts +20 -0
- package/dist/types-ts4.5/ui/annotations/draft/dom.d.ts +7 -0
- package/dist/types-ts4.5/ui/annotations/draft/index.d.ts +2 -0
- package/dist/types-ts4.5/ui/annotations/draft/position.d.ts +2 -0
- package/dist/types-ts4.5/ui/annotations/draft/text.d.ts +11 -0
- package/dist/types-ts4.5/ui/annotations/element/index.d.ts +10 -0
- package/dist/types-ts4.5/ui/annotations/element/mark.d.ts +14 -0
- package/dist/types-ts4.5/ui/annotations/hooks/index.d.ts +3 -0
- package/dist/types-ts4.5/ui/annotations/hooks/use-events.d.ts +18 -0
- package/dist/types-ts4.5/ui/annotations/hooks/use-inline-comment-subscriber.d.ts +1 -0
- package/dist/types-ts4.5/ui/annotations/hooks/use-inline-comments-filter.d.ts +9 -0
- package/dist/types-ts4.5/ui/annotations/hooks/use-load-annotations.d.ts +6 -0
- package/dist/types-ts4.5/ui/annotations/hooks/user-selection.d.ts +9 -0
- package/dist/types-ts4.5/ui/annotations/hooks/utils.d.ts +2 -0
- package/dist/types-ts4.5/ui/annotations/index.d.ts +5 -0
- package/dist/types-ts4.5/ui/annotations/selection/index.d.ts +1 -0
- package/dist/types-ts4.5/ui/annotations/selection/mounter.d.ts +20 -0
- package/dist/types-ts4.5/ui/annotations/selection/range-validator.d.ts +13 -0
- package/dist/types-ts4.5/ui/annotations/selection/wrapper.d.ts +8 -0
- package/dist/types-ts4.5/ui/annotations/types.d.ts +22 -0
- package/dist/types-ts4.5/ui/annotations/view/index.d.ts +7 -0
- package/dist/types-ts4.5/ui/index.d.ts +1 -0
- package/dist/types-ts4.5/ui/renderer-props.d.ts +104 -0
- package/dist/types-ts4.5/use-feature-flags.d.ts +2 -0
- package/dist/types-ts4.5/utils.d.ts +24 -0
- package/package.json +17 -10
- package/report.api.md +4 -6
|
@@ -7,6 +7,7 @@ import { CardErrorBoundary } from './fallback';
|
|
|
7
7
|
import { withSmartCardStorage } from '../../ui/SmartCardStorage';
|
|
8
8
|
import { getCardClickHandler } from '../utils/getCardClickHandler';
|
|
9
9
|
import { useFeatureFlags } from '../../use-feature-flags';
|
|
10
|
+
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
10
11
|
const InlineCard = props => {
|
|
11
12
|
const {
|
|
12
13
|
url,
|
|
@@ -28,15 +29,26 @@ const InlineCard = props => {
|
|
|
28
29
|
showServerActions,
|
|
29
30
|
ssr
|
|
30
31
|
} = smartLinks || {};
|
|
32
|
+
const analyticsData = {
|
|
33
|
+
attributes: {
|
|
34
|
+
location: 'renderer'
|
|
35
|
+
},
|
|
36
|
+
// Below is added for the future implementation of Linking Platform namespaced analytic context
|
|
37
|
+
location: 'renderer'
|
|
38
|
+
};
|
|
31
39
|
if (ssr && url) {
|
|
32
|
-
return /*#__PURE__*/React.createElement(
|
|
40
|
+
return /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
41
|
+
data: analyticsData
|
|
42
|
+
}, /*#__PURE__*/React.createElement(CardSSR, {
|
|
33
43
|
appearance: "inline",
|
|
34
44
|
url: url,
|
|
35
45
|
showAuthTooltip: showAuthTooltip,
|
|
36
46
|
showServerActions: showServerActions
|
|
37
|
-
});
|
|
47
|
+
}));
|
|
38
48
|
}
|
|
39
|
-
return /*#__PURE__*/React.createElement(
|
|
49
|
+
return /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
50
|
+
data: analyticsData
|
|
51
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
40
52
|
"data-inline-card": true,
|
|
41
53
|
"data-card-data": data ? JSON.stringify(data) : undefined,
|
|
42
54
|
"data-card-url": url
|
|
@@ -54,6 +66,6 @@ const InlineCard = props => {
|
|
|
54
66
|
}
|
|
55
67
|
props.smartCardStorage.set(data.url, data.title);
|
|
56
68
|
}
|
|
57
|
-
}))));
|
|
69
|
+
})))));
|
|
58
70
|
};
|
|
59
71
|
export default withSmartCardStorage(InlineCard);
|
package/dist/es2019/ui/Expand.js
CHANGED
|
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
/** @jsx jsx */
|
|
3
3
|
import React, { useRef, useCallback, useMemo } from 'react';
|
|
4
4
|
import { css, jsx } from '@emotion/react';
|
|
5
|
+
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
5
6
|
import { gridSize, fontSize } from '@atlaskit/theme/constants';
|
|
6
7
|
import ChevronRightIcon from '@atlaskit/icon/glyph/chevron-right';
|
|
7
8
|
import Tooltip from '@atlaskit/tooltip';
|
|
@@ -22,11 +23,11 @@ const titleStyles = css`
|
|
|
22
23
|
display: flex;
|
|
23
24
|
flex: 1;
|
|
24
25
|
margin: 0;
|
|
25
|
-
padding: 0 0 0 ${
|
|
26
|
+
padding: 0 0 0 ${"var(--ds-space-050, 4px)"};
|
|
26
27
|
text-align: left;
|
|
27
28
|
`;
|
|
28
29
|
const Container = props => {
|
|
29
|
-
const paddingBottom =
|
|
30
|
+
const paddingBottom = props.expanded ? "var(--ds-space-100, 8px)" : "var(--ds-space-0, 0px)";
|
|
30
31
|
const sharedContainerStyles = sharedExpandStyles.containerStyles(props);
|
|
31
32
|
const styles = themeProps => css`
|
|
32
33
|
${sharedContainerStyles({
|
|
@@ -40,12 +41,12 @@ const Container = props => {
|
|
|
40
41
|
}, props), props.children);
|
|
41
42
|
};
|
|
42
43
|
const TitleContainer = props => {
|
|
43
|
-
const paddingBottom =
|
|
44
|
+
const paddingBottom = !props.expanded ? "var(--ds-space-100, 8px)" : "var(--ds-space-0, 0px)";
|
|
44
45
|
const styles = themeProps => css`
|
|
45
46
|
${sharedExpandStyles.titleContainerStyles({
|
|
46
47
|
theme: themeProps
|
|
47
48
|
})}
|
|
48
|
-
padding: ${
|
|
49
|
+
padding: ${"var(--ds-space-100, 8px)"};
|
|
49
50
|
padding-bottom: ${paddingBottom};
|
|
50
51
|
`;
|
|
51
52
|
return jsx("button", _extends({
|
|
@@ -60,7 +61,9 @@ const ContentContainer = props => {
|
|
|
60
61
|
${sharedContentStyles({
|
|
61
62
|
theme: themeProps
|
|
62
63
|
})};
|
|
63
|
-
padding-right: ${
|
|
64
|
+
padding-right: ${"var(--ds-space-200, 16px)"};
|
|
65
|
+
// TODO: Migrate away from gridSize
|
|
66
|
+
// Recommendation: Replace gridSize with 8, or directly replace with 36px
|
|
64
67
|
padding-left: ${gridSize() * 5 - gridSize() / 2}px;
|
|
65
68
|
visibility: ${visibility};
|
|
66
69
|
`;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { PLATFORM } from '../../analytics/events';
|
|
4
3
|
import { ACTION, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
5
4
|
import { FabricChannel } from '@atlaskit/analytics-listeners';
|
|
5
|
+
import { logException } from '@atlaskit/editor-common/monitoring';
|
|
6
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
7
|
+
import { PLATFORM } from '../../analytics/events';
|
|
6
8
|
export class ErrorBoundary extends React.Component {
|
|
7
9
|
constructor(...args) {
|
|
8
10
|
super(...args);
|
|
@@ -41,6 +43,11 @@ export class ErrorBoundary extends React.Component {
|
|
|
41
43
|
errorStack: error === null || error === void 0 ? void 0 : error.stack
|
|
42
44
|
}
|
|
43
45
|
});
|
|
46
|
+
if (getBooleanFF('platform.editor.sentry-error-monitoring_6bksu')) {
|
|
47
|
+
logException(error, {
|
|
48
|
+
location: 'renderer'
|
|
49
|
+
});
|
|
50
|
+
}
|
|
44
51
|
if (this.hasFallback()) {
|
|
45
52
|
this.setState({
|
|
46
53
|
errorCaptured: true
|
|
@@ -35,7 +35,7 @@ import { RenderTracking } from '../../react/utils/performance/RenderTracking';
|
|
|
35
35
|
export const NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
36
36
|
export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
37
37
|
const packageName = "@atlaskit/renderer";
|
|
38
|
-
const packageVersion = "108.
|
|
38
|
+
const packageVersion = "108.1.1";
|
|
39
39
|
export class Renderer extends PureComponent {
|
|
40
40
|
constructor(props) {
|
|
41
41
|
super(props);
|
|
@@ -174,28 +174,35 @@ export class Renderer extends PureComponent {
|
|
|
174
174
|
});
|
|
175
175
|
this.rafID = requestAnimationFrame(() => {
|
|
176
176
|
stopMeasure(`Renderer Render Time: ${this.id}`, duration => {
|
|
177
|
-
var _analyticsEventSeveri, _analyticsEventSeveri2;
|
|
177
|
+
var _analyticsEventSeveri, _analyticsEventSeveri2, _this$props, _this$props$analytics;
|
|
178
178
|
const {
|
|
179
179
|
analyticsEventSeverityTracking
|
|
180
180
|
} = this.props;
|
|
181
181
|
const forceSeverityTracking = typeof analyticsEventSeverityTracking === 'undefined' && shouldForceTracking();
|
|
182
182
|
const severity = !!forceSeverityTracking || analyticsEventSeverityTracking !== null && analyticsEventSeverityTracking !== void 0 && analyticsEventSeverityTracking.enabled ? getAnalyticsEventSeverity(duration, (_analyticsEventSeveri = analyticsEventSeverityTracking === null || analyticsEventSeverityTracking === void 0 ? void 0 : analyticsEventSeverityTracking.severityNormalThreshold) !== null && _analyticsEventSeveri !== void 0 ? _analyticsEventSeveri : NORMAL_SEVERITY_THRESHOLD, (_analyticsEventSeveri2 = analyticsEventSeverityTracking === null || analyticsEventSeverityTracking === void 0 ? void 0 : analyticsEventSeverityTracking.severityDegradedThreshold) !== null && _analyticsEventSeveri2 !== void 0 ? _analyticsEventSeveri2 : DEGRADED_SEVERITY_THRESHOLD) : undefined;
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
183
|
+
|
|
184
|
+
// ED-16320: Check for explicit disable so that by default
|
|
185
|
+
// it will still be enabled as it currently is. Then we can
|
|
186
|
+
// progressively opt out synthetic tenants.
|
|
187
|
+
const isTTRTrackingExplicitlyDisabled = ((_this$props = this.props) === null || _this$props === void 0 ? void 0 : (_this$props$analytics = _this$props.analyticsEventSeverityTracking) === null || _this$props$analytics === void 0 ? void 0 : _this$props$analytics.enabled) === false;
|
|
188
|
+
if (!isTTRTrackingExplicitlyDisabled) {
|
|
189
|
+
this.fireAnalyticsEvent({
|
|
190
|
+
action: ACTION.RENDERED,
|
|
191
|
+
actionSubject: ACTION_SUBJECT.RENDERER,
|
|
192
|
+
attributes: {
|
|
193
|
+
platform: PLATFORM.WEB,
|
|
194
|
+
duration,
|
|
195
|
+
distortedDuration: this.renderedMeasurementDistortedDurationMonitor.distortedDuration,
|
|
196
|
+
ttfb: getResponseEndTime(),
|
|
197
|
+
nodes: reduce(this.props.document, (acc, node) => {
|
|
198
|
+
acc[node.type] = (acc[node.type] || 0) + 1;
|
|
199
|
+
return acc;
|
|
200
|
+
}, {}),
|
|
201
|
+
severity
|
|
202
|
+
},
|
|
203
|
+
eventType: EVENT_TYPE.OPERATIONAL
|
|
204
|
+
});
|
|
205
|
+
}
|
|
199
206
|
this.renderedMeasurementDistortedDurationMonitor.cleanup();
|
|
200
207
|
delete this.renderedMeasurementDistortedDurationMonitor;
|
|
201
208
|
});
|
|
@@ -320,7 +327,7 @@ export class Renderer extends PureComponent {
|
|
|
320
327
|
}
|
|
321
328
|
};
|
|
322
329
|
try {
|
|
323
|
-
var _featureFlags$feature, _this$featureFlags, _this$featureFlags$fe, _this$featureFlags$fe2;
|
|
330
|
+
var _featureFlags$feature, _featureFlags$feature2, _this$featureFlags, _this$featureFlags$fe, _this$featureFlags$fe2;
|
|
324
331
|
const schema = this.getSchema(this.props.schema, this.props.adfStage);
|
|
325
332
|
const {
|
|
326
333
|
result,
|
|
@@ -347,6 +354,7 @@ export class Renderer extends PureComponent {
|
|
|
347
354
|
allowCustomPanels: allowCustomPanels,
|
|
348
355
|
allowPlaceholderText: allowPlaceholderText,
|
|
349
356
|
useFragmentMarkBreakoutWidthStylingFix: (_featureFlags$feature = featureFlags.featureFlags.useFragmentMarkBreakoutWidthStylingFix) !== null && _featureFlags$feature !== void 0 ? _featureFlags$feature : true,
|
|
357
|
+
useBlockRenderForCodeBlock: (_featureFlags$feature2 = featureFlags.featureFlags.useBlockRenderForCodeBlock) !== null && _featureFlags$feature2 !== void 0 ? _featureFlags$feature2 : true,
|
|
350
358
|
innerRef: this.editorRef,
|
|
351
359
|
onClick: handleWrapperOnClick,
|
|
352
360
|
onMouseDown: this.onMouseDownEditView
|
|
@@ -369,7 +377,7 @@ export class Renderer extends PureComponent {
|
|
|
369
377
|
});
|
|
370
378
|
return jsx(Fragment, null, reRenderTracking, rendererResult);
|
|
371
379
|
} catch (e) {
|
|
372
|
-
var _featureFlags$
|
|
380
|
+
var _featureFlags$feature3, _featureFlags$feature4;
|
|
373
381
|
if (onError) {
|
|
374
382
|
onError(e);
|
|
375
383
|
}
|
|
@@ -380,7 +388,8 @@ export class Renderer extends PureComponent {
|
|
|
380
388
|
allowPlaceholderText: allowPlaceholderText,
|
|
381
389
|
allowColumnSorting: allowColumnSorting,
|
|
382
390
|
allowNestedHeaderLinks: allowNestedHeaderLinks,
|
|
383
|
-
useFragmentMarkBreakoutWidthStylingFix: (_featureFlags$
|
|
391
|
+
useFragmentMarkBreakoutWidthStylingFix: (_featureFlags$feature3 = featureFlags.featureFlags.useFragmentMarkBreakoutWidthStylingFix) !== null && _featureFlags$feature3 !== void 0 ? _featureFlags$feature3 : true,
|
|
392
|
+
useBlockRenderForCodeBlock: (_featureFlags$feature4 = featureFlags.featureFlags.useBlockRenderForCodeBlock) !== null && _featureFlags$feature4 !== void 0 ? _featureFlags$feature4 : true,
|
|
384
393
|
onClick: handleWrapperOnClick
|
|
385
394
|
}, jsx(UnsupportedBlock, null));
|
|
386
395
|
}
|
|
@@ -430,7 +439,8 @@ const RendererWrapper = /*#__PURE__*/React.memo(props => {
|
|
|
430
439
|
children,
|
|
431
440
|
onClick,
|
|
432
441
|
onMouseDown,
|
|
433
|
-
useFragmentMarkBreakoutWidthStylingFix
|
|
442
|
+
useFragmentMarkBreakoutWidthStylingFix,
|
|
443
|
+
useBlockRenderForCodeBlock
|
|
434
444
|
} = props;
|
|
435
445
|
return jsx(WidthProvider, {
|
|
436
446
|
className: "ak-renderer-wrapper"
|
|
@@ -444,7 +454,8 @@ const RendererWrapper = /*#__PURE__*/React.memo(props => {
|
|
|
444
454
|
appearance,
|
|
445
455
|
allowNestedHeaderLinks,
|
|
446
456
|
allowColumnSorting: !!allowColumnSorting,
|
|
447
|
-
useFragmentMarkBreakoutWidthStylingFix
|
|
457
|
+
useFragmentMarkBreakoutWidthStylingFix,
|
|
458
|
+
useBlockRenderForCodeBlock
|
|
448
459
|
})
|
|
449
460
|
}, children)));
|
|
450
461
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
import { themed } from '@atlaskit/theme/components';
|
|
3
|
-
import {
|
|
3
|
+
import { fontFamily, fontSize } from '@atlaskit/theme/constants';
|
|
4
4
|
import * as colors from '@atlaskit/theme/colors';
|
|
5
5
|
import { headingSizes as headingSizesImport } from '@atlaskit/theme/typography';
|
|
6
6
|
import { tableSharedStyle, columnLayoutSharedStyle, blockquoteSharedStyles, headingsSharedStyles, ruleSharedStyles, whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, mediaSingleSharedStyle, TableSharedCssClassName, tableMarginTop, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, richMediaClassName, tasksAndDecisionsStyles, smartCardSharedStyles, tableCellPadding, textColorStyles, codeBlockInListSafariFix } from '@atlaskit/editor-common/styles';
|
|
@@ -302,6 +302,9 @@ export const rendererStyles = wrapperProps => theme => {
|
|
|
302
302
|
const themeProps = {
|
|
303
303
|
theme
|
|
304
304
|
};
|
|
305
|
+
const {
|
|
306
|
+
useBlockRenderForCodeBlock
|
|
307
|
+
} = wrapperProps;
|
|
305
308
|
return css`
|
|
306
309
|
font-size: ${editorFontSize(themeProps)}px;
|
|
307
310
|
line-height: 1.5rem;
|
|
@@ -419,7 +422,7 @@ export const rendererStyles = wrapperProps => theme => {
|
|
|
419
422
|
& .renderer-image {
|
|
420
423
|
max-width: 100%;
|
|
421
424
|
display: block;
|
|
422
|
-
margin: ${
|
|
425
|
+
margin: ${"var(--ds-space-300, 24px)"} 0;
|
|
423
426
|
}
|
|
424
427
|
|
|
425
428
|
.${richMediaClassName}.rich-media-wrapped
|
|
@@ -633,12 +636,9 @@ export const rendererStyles = wrapperProps => theme => {
|
|
|
633
636
|
max-width: 100%;
|
|
634
637
|
/* -ms- properties are necessary until MS supports the latest version of the grid spec */
|
|
635
638
|
/* stylelint-disable value-no-vendor-prefix, declaration-block-no-duplicate-properties */
|
|
636
|
-
display:
|
|
637
|
-
display: grid;
|
|
638
|
-
-ms-grid-columns: auto 1fr;
|
|
639
|
+
display: block;
|
|
639
640
|
/* stylelint-enable */
|
|
640
641
|
|
|
641
|
-
grid-template-columns: minmax(0, 1fr);
|
|
642
642
|
position: relative;
|
|
643
643
|
border-radius: ${"var(--ds-radius-100, 3px)"};
|
|
644
644
|
|
|
@@ -647,14 +647,6 @@ export const rendererStyles = wrapperProps => theme => {
|
|
|
647
647
|
* code block line numbers in Safari / iOS.
|
|
648
648
|
*/
|
|
649
649
|
word-wrap: normal;
|
|
650
|
-
|
|
651
|
-
& > span {
|
|
652
|
-
/* stylelint-disable value-no-vendor-prefix */
|
|
653
|
-
-ms-grid-row: 1;
|
|
654
|
-
-ms-grid-column: 2;
|
|
655
|
-
/* stylelint-enable */
|
|
656
|
-
grid-column: 1;
|
|
657
|
-
}
|
|
658
650
|
}
|
|
659
651
|
|
|
660
652
|
& .MediaGroup,
|
|
@@ -666,13 +658,15 @@ export const rendererStyles = wrapperProps => theme => {
|
|
|
666
658
|
}
|
|
667
659
|
}
|
|
668
660
|
|
|
661
|
+
${useGridRenderForCodeBlock(useBlockRenderForCodeBlock)}
|
|
662
|
+
|
|
669
663
|
${getLightWeightCodeBlockStylesForRootRendererStyleSheet()}
|
|
670
664
|
|
|
671
665
|
${columnLayoutSharedStyle};
|
|
672
666
|
& [data-layout-section] {
|
|
673
|
-
margin-top: ${
|
|
667
|
+
margin-top: ${"var(--ds-space-250, 20px)"};
|
|
674
668
|
& > div + div {
|
|
675
|
-
margin-left: ${
|
|
669
|
+
margin-left: ${"var(--ds-space-400, 32px)"};
|
|
676
670
|
}
|
|
677
671
|
|
|
678
672
|
@media screen and (max-width: ${gridMediumMaxWidth}px) {
|
|
@@ -708,4 +702,27 @@ export const rendererStyles = wrapperProps => theme => {
|
|
|
708
702
|
${browser.safari ? codeBlockInListSafariFix : ''}
|
|
709
703
|
}
|
|
710
704
|
`;
|
|
705
|
+
};
|
|
706
|
+
const useGridRenderForCodeBlock = codeBlockRenderAsBlock => {
|
|
707
|
+
if (codeBlockRenderAsBlock) {
|
|
708
|
+
return '';
|
|
709
|
+
}
|
|
710
|
+
return `& .code-block {
|
|
711
|
+
/* -ms- properties are necessary until MS supports the latest version of the grid spec */
|
|
712
|
+
/* stylelint-disable value-no-vendor-prefix, declaration-block-no-duplicate-properties */
|
|
713
|
+
display: -ms-grid;
|
|
714
|
+
display: grid;
|
|
715
|
+
-ms-grid-columns: auto 1fr;
|
|
716
|
+
/* stylelint-enable */
|
|
717
|
+
|
|
718
|
+
grid-template-columns: minmax(0, 1fr);
|
|
719
|
+
|
|
720
|
+
& > span {
|
|
721
|
+
/* stylelint-disable value-no-vendor-prefix */
|
|
722
|
+
-ms-grid-row: 1;
|
|
723
|
+
-ms-grid-column: 2;
|
|
724
|
+
/* stylelint-enable */
|
|
725
|
+
grid-column: 1;
|
|
726
|
+
}
|
|
727
|
+
}`;
|
|
711
728
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { css, jsx } from '@emotion/react';
|
|
3
3
|
import Tooltip from '@atlaskit/tooltip';
|
|
4
|
-
import { gridSize } from '@atlaskit/theme/constants';
|
|
5
4
|
import { N20, N30 } from '@atlaskit/theme/colors';
|
|
6
5
|
import { SortOrder } from '@atlaskit/editor-common/types';
|
|
7
6
|
import { sortingIconMessages } from '../messages';
|
|
@@ -23,7 +22,7 @@ const buttonStyles = css`
|
|
|
23
22
|
right: 0;
|
|
24
23
|
top: 0;
|
|
25
24
|
border: 2px solid ${"var(--ds-border, #fff)"};
|
|
26
|
-
border-radius: ${
|
|
25
|
+
border-radius: ${"var(--ds-radius-100, 4px)"};
|
|
27
26
|
background-color: ${`var(--ds-surface-overlay, ${N20})`};
|
|
28
27
|
justify-content: center;
|
|
29
28
|
align-items: center;
|
package/dist/es2019/version.json
CHANGED
|
@@ -9,6 +9,7 @@ import { getEventHandler } from '../../utils';
|
|
|
9
9
|
import { PLATFORM, MODE } from '../../analytics/events';
|
|
10
10
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
11
11
|
import LinkUrl from '@atlaskit/smart-card/link-url';
|
|
12
|
+
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
12
13
|
var anchorStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n\n &:hover {\n color: ", ";\n text-decoration: underline;\n }\n\n &:active {\n color: ", ";\n }\n"])), "var(--ds-link, ".concat(B400, ")"), "var(--ds-link, ".concat(B300, ")"), "var(--ds-link-pressed, ".concat(B500, ")"));
|
|
13
14
|
export default function Link(props) {
|
|
14
15
|
var href = props.href,
|
|
@@ -29,7 +30,16 @@ export default function Link(props) {
|
|
|
29
30
|
if (isMediaLink) {
|
|
30
31
|
return jsx(Fragment, null, props.children);
|
|
31
32
|
}
|
|
32
|
-
|
|
33
|
+
var analyticsData = {
|
|
34
|
+
attributes: {
|
|
35
|
+
location: 'renderer'
|
|
36
|
+
},
|
|
37
|
+
// Below is added for the future implementation of Linking Platform namespaced analytic context
|
|
38
|
+
location: 'renderer'
|
|
39
|
+
};
|
|
40
|
+
return jsx(AnalyticsContext, {
|
|
41
|
+
data: analyticsData
|
|
42
|
+
}, jsx(LinkUrl, _extends({
|
|
33
43
|
css: anchorStyles,
|
|
34
44
|
onClick: function onClick(e) {
|
|
35
45
|
if (fireAnalyticsEvent) {
|
|
@@ -47,5 +57,5 @@ export default function Link(props) {
|
|
|
47
57
|
handler(e, href);
|
|
48
58
|
}
|
|
49
59
|
}
|
|
50
|
-
}, anchorProps, dataAttributes), props.children);
|
|
60
|
+
}, anchorProps, dataAttributes), props.children));
|
|
51
61
|
}
|
|
@@ -5,6 +5,7 @@ import { UnsupportedBlock } from '@atlaskit/editor-common/ui';
|
|
|
5
5
|
import { getPlatform } from '../../utils';
|
|
6
6
|
import { CardErrorBoundary } from './fallback';
|
|
7
7
|
import { getCardClickHandler } from '../utils/getCardClickHandler';
|
|
8
|
+
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
8
9
|
export default function BlockCard(props) {
|
|
9
10
|
var url = props.url,
|
|
10
11
|
data = props.data,
|
|
@@ -24,7 +25,16 @@ export default function BlockCard(props) {
|
|
|
24
25
|
onClick: onClick,
|
|
25
26
|
container: portal
|
|
26
27
|
};
|
|
27
|
-
|
|
28
|
+
var analyticsData = {
|
|
29
|
+
attributes: {
|
|
30
|
+
location: 'renderer'
|
|
31
|
+
},
|
|
32
|
+
// Below is added for the future implementation of Linking Platform namespaced analytic context
|
|
33
|
+
location: 'renderer'
|
|
34
|
+
};
|
|
35
|
+
return /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
36
|
+
data: analyticsData
|
|
37
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
28
38
|
className: "blockCardView-content-wrap",
|
|
29
39
|
"data-block-card": true,
|
|
30
40
|
"data-card-data": data ? JSON.stringify(data) : undefined,
|
|
@@ -36,5 +46,5 @@ export default function BlockCard(props) {
|
|
|
36
46
|
showActions: rendererAppearance !== 'mobile',
|
|
37
47
|
platform: platform,
|
|
38
48
|
showServerActions: showServerActions
|
|
39
|
-
}, cardProps))));
|
|
49
|
+
}, cardProps)))));
|
|
40
50
|
}
|
|
@@ -5,7 +5,7 @@ import { jsx, css } from '@emotion/react';
|
|
|
5
5
|
import { overflowShadow, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
6
6
|
import { N20, DN50 } from '@atlaskit/theme/colors';
|
|
7
7
|
import { themed } from '@atlaskit/theme/components';
|
|
8
|
-
import { fontSize
|
|
8
|
+
import { fontSize } from '@atlaskit/theme/constants';
|
|
9
9
|
import { CodeBlockSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
10
10
|
import CodeBlockButtonContainer from './codeBlockButtonContainer';
|
|
11
11
|
var codeBlockStyleOverrides = function codeBlockStyleOverrides(props) {
|
|
@@ -17,7 +17,7 @@ var codeBlockStyleOverrides = function codeBlockStyleOverrides(props) {
|
|
|
17
17
|
light: "var(--ds-background-neutral, ".concat(N20, ")"),
|
|
18
18
|
dark: "var(--ds-background-neutral, ".concat(DN50, ")")
|
|
19
19
|
})(props),
|
|
20
|
-
leftCoverWidth: "
|
|
20
|
+
leftCoverWidth: "var(--ds-space-300, 24px)"
|
|
21
21
|
}));
|
|
22
22
|
};
|
|
23
23
|
var CodeBlockContainer = function CodeBlockContainer(_ref) {
|
|
@@ -13,6 +13,7 @@ import { getPlatform } from '../../utils';
|
|
|
13
13
|
import { CardErrorBoundary } from './fallback';
|
|
14
14
|
import { FullPagePadding } from '../../ui/Renderer/style';
|
|
15
15
|
import { getCardClickHandler } from '../utils/getCardClickHandler';
|
|
16
|
+
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
16
17
|
var embedCardWrapperStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n height: 100%;\n\n > div {\n height: 100%;\n }\n\n .loader-wrapper {\n height: 100%;\n }\n\n margin: 0 auto;\n"])));
|
|
17
18
|
var uIMediaSingleLayoutStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin-left: 50%;\n transform: translateX(-50%);\n"])));
|
|
18
19
|
export default function EmbedCard(props) {
|
|
@@ -83,7 +84,16 @@ export default function EmbedCard(props) {
|
|
|
83
84
|
}
|
|
84
85
|
setAspectRatio(resolvedAspectRatio);
|
|
85
86
|
};
|
|
86
|
-
|
|
87
|
+
var analyticsData = {
|
|
88
|
+
attributes: {
|
|
89
|
+
location: 'renderer'
|
|
90
|
+
},
|
|
91
|
+
// Below is added for the future implementation of Linking Platform namespaced analytic context
|
|
92
|
+
location: 'renderer'
|
|
93
|
+
};
|
|
94
|
+
return jsx(AnalyticsContext, {
|
|
95
|
+
data: analyticsData
|
|
96
|
+
}, jsx(WidthConsumer, null, function (_ref2) {
|
|
87
97
|
var containerWidth = _ref2.width,
|
|
88
98
|
breakpoint = _ref2.breakpoint;
|
|
89
99
|
var nonFullWidthSize = containerWidth;
|
|
@@ -131,5 +141,5 @@ export default function EmbedCard(props) {
|
|
|
131
141
|
inheritDimensions: true,
|
|
132
142
|
embedIframeRef: embedIframeRef
|
|
133
143
|
})))))));
|
|
134
|
-
});
|
|
144
|
+
}));
|
|
135
145
|
}
|
|
@@ -7,6 +7,7 @@ import { CardErrorBoundary } from './fallback';
|
|
|
7
7
|
import { withSmartCardStorage } from '../../ui/SmartCardStorage';
|
|
8
8
|
import { getCardClickHandler } from '../utils/getCardClickHandler';
|
|
9
9
|
import { useFeatureFlags } from '../../use-feature-flags';
|
|
10
|
+
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
10
11
|
var InlineCard = function InlineCard(props) {
|
|
11
12
|
var url = props.url,
|
|
12
13
|
data = props.data,
|
|
@@ -25,15 +26,26 @@ var InlineCard = function InlineCard(props) {
|
|
|
25
26
|
showAuthTooltip = _ref.showAuthTooltip,
|
|
26
27
|
showServerActions = _ref.showServerActions,
|
|
27
28
|
ssr = _ref.ssr;
|
|
29
|
+
var analyticsData = {
|
|
30
|
+
attributes: {
|
|
31
|
+
location: 'renderer'
|
|
32
|
+
},
|
|
33
|
+
// Below is added for the future implementation of Linking Platform namespaced analytic context
|
|
34
|
+
location: 'renderer'
|
|
35
|
+
};
|
|
28
36
|
if (ssr && url) {
|
|
29
|
-
return /*#__PURE__*/React.createElement(
|
|
37
|
+
return /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
38
|
+
data: analyticsData
|
|
39
|
+
}, /*#__PURE__*/React.createElement(CardSSR, {
|
|
30
40
|
appearance: "inline",
|
|
31
41
|
url: url,
|
|
32
42
|
showAuthTooltip: showAuthTooltip,
|
|
33
43
|
showServerActions: showServerActions
|
|
34
|
-
});
|
|
44
|
+
}));
|
|
35
45
|
}
|
|
36
|
-
return /*#__PURE__*/React.createElement(
|
|
46
|
+
return /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
47
|
+
data: analyticsData
|
|
48
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
37
49
|
"data-inline-card": true,
|
|
38
50
|
"data-card-data": data ? JSON.stringify(data) : undefined,
|
|
39
51
|
"data-card-url": url
|
|
@@ -51,6 +63,6 @@ var InlineCard = function InlineCard(props) {
|
|
|
51
63
|
}
|
|
52
64
|
props.smartCardStorage.set(data.url, data.title);
|
|
53
65
|
}
|
|
54
|
-
}))));
|
|
66
|
+
})))));
|
|
55
67
|
};
|
|
56
68
|
export default withSmartCardStorage(InlineCard);
|
package/dist/esm/ui/Expand.js
CHANGED
|
@@ -5,6 +5,7 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
|
5
5
|
/** @jsx jsx */
|
|
6
6
|
import React, { useRef, useCallback, useMemo } from 'react';
|
|
7
7
|
import { css, jsx } from '@emotion/react';
|
|
8
|
+
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
8
9
|
import { gridSize, fontSize } from '@atlaskit/theme/constants';
|
|
9
10
|
import ChevronRightIcon from '@atlaskit/icon/glyph/chevron-right';
|
|
10
11
|
import Tooltip from '@atlaskit/tooltip';
|
|
@@ -16,9 +17,9 @@ import { injectIntl } from 'react-intl-next';
|
|
|
16
17
|
import { ActiveHeaderIdConsumer } from './active-header-id-provider';
|
|
17
18
|
import _uniqueId from 'lodash/uniqueId';
|
|
18
19
|
import { getPlatform } from '../utils';
|
|
19
|
-
var titleStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n outline: none;\n border: none;\n font-size: ", ";\n line-height: ", ";\n font-weight: normal;\n display: flex;\n flex: 1;\n margin: 0;\n padding: 0 0 0 ", "
|
|
20
|
+
var titleStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n outline: none;\n border: none;\n font-size: ", ";\n line-height: ", ";\n font-weight: normal;\n display: flex;\n flex: 1;\n margin: 0;\n padding: 0 0 0 ", ";\n text-align: left;\n"])), relativeFontSizeToBase16(fontSize()), akEditorLineHeight, "var(--ds-space-050, 4px)");
|
|
20
21
|
var Container = function Container(props) {
|
|
21
|
-
var paddingBottom =
|
|
22
|
+
var paddingBottom = props.expanded ? "var(--ds-space-100, 8px)" : "var(--ds-space-0, 0px)";
|
|
22
23
|
var sharedContainerStyles = sharedExpandStyles.containerStyles(props);
|
|
23
24
|
var styles = function styles(themeProps) {
|
|
24
25
|
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n padding: 0;\n padding-bottom: ", ";\n "])), sharedContainerStyles({
|
|
@@ -30,11 +31,11 @@ var Container = function Container(props) {
|
|
|
30
31
|
}, props), props.children);
|
|
31
32
|
};
|
|
32
33
|
var TitleContainer = function TitleContainer(props) {
|
|
33
|
-
var paddingBottom =
|
|
34
|
+
var paddingBottom = !props.expanded ? "var(--ds-space-100, 8px)" : "var(--ds-space-0, 0px)";
|
|
34
35
|
var styles = function styles(themeProps) {
|
|
35
|
-
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", "\n padding: ", "
|
|
36
|
+
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", "\n padding: ", ";\n padding-bottom: ", ";\n "])), sharedExpandStyles.titleContainerStyles({
|
|
36
37
|
theme: themeProps
|
|
37
|
-
}),
|
|
38
|
+
}), "var(--ds-space-100, 8px)", paddingBottom);
|
|
38
39
|
};
|
|
39
40
|
return jsx("button", _extends({
|
|
40
41
|
css: styles
|
|
@@ -45,9 +46,9 @@ var ContentContainer = function ContentContainer(props) {
|
|
|
45
46
|
var sharedContentStyles = sharedExpandStyles.contentStyles(props);
|
|
46
47
|
var visibility = props.expanded ? 'visible' : 'hidden';
|
|
47
48
|
var styles = function styles(themeProps) {
|
|
48
|
-
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n ", ";\n padding-right: ", "
|
|
49
|
+
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n ", ";\n padding-right: ", ";\n // TODO: Migrate away from gridSize\n // Recommendation: Replace gridSize with 8, or directly replace with 36px\n padding-left: ", "px;\n visibility: ", ";\n "])), sharedContentStyles({
|
|
49
50
|
theme: themeProps
|
|
50
|
-
}),
|
|
51
|
+
}), "var(--ds-space-200, 16px)", gridSize() * 5 - gridSize() / 2, visibility);
|
|
51
52
|
};
|
|
52
53
|
return jsx("div", _extends({
|
|
53
54
|
css: styles
|
|
@@ -8,9 +8,11 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
8
8
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
9
9
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
10
10
|
import React from 'react';
|
|
11
|
-
import { PLATFORM } from '../../analytics/events';
|
|
12
11
|
import { ACTION, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
13
12
|
import { FabricChannel } from '@atlaskit/analytics-listeners';
|
|
13
|
+
import { logException } from '@atlaskit/editor-common/monitoring';
|
|
14
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
15
|
+
import { PLATFORM } from '../../analytics/events';
|
|
14
16
|
export var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
15
17
|
_inherits(ErrorBoundary, _React$Component);
|
|
16
18
|
var _super = _createSuper(ErrorBoundary);
|
|
@@ -64,6 +66,11 @@ export var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
|
64
66
|
errorStack: error === null || error === void 0 ? void 0 : error.stack
|
|
65
67
|
}
|
|
66
68
|
});
|
|
69
|
+
if (getBooleanFF('platform.editor.sentry-error-monitoring_6bksu')) {
|
|
70
|
+
logException(error, {
|
|
71
|
+
location: 'renderer'
|
|
72
|
+
});
|
|
73
|
+
}
|
|
67
74
|
if (this.hasFallback()) {
|
|
68
75
|
this.setState({
|
|
69
76
|
errorCaptured: true
|