@atlaskit/renderer 108.17.3 → 108.18.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 +12 -0
- package/dist/cjs/react/marks/alignment.js +2 -3
- package/dist/cjs/react/marks/breakout.js +2 -3
- package/dist/cjs/react/marks/link.js +3 -4
- package/dist/cjs/react/nodes/blockCard.js +11 -13
- package/dist/cjs/react/nodes/codeBlock/codeBlock.js +2 -5
- package/dist/cjs/react/nodes/codeBlock/components/codeBlockButtonContainer.js +4 -6
- package/dist/cjs/react/nodes/codeBlock/components/codeBlockContainer.js +2 -3
- package/dist/cjs/react/nodes/codeBlock/components/codeBlockCopyButton.js +8 -11
- package/dist/cjs/react/nodes/codeBlock/components/codeBlockWrapButton.js +8 -11
- package/dist/cjs/react/nodes/codeBlock/components/lightWeightCodeBlock.js +7 -8
- package/dist/cjs/react/nodes/codeBlock/windowedCodeBlock.js +5 -6
- package/dist/cjs/react/nodes/embedCard.js +8 -9
- package/dist/cjs/react/nodes/heading-anchor.js +4 -5
- package/dist/cjs/react/nodes/layoutColumn.js +2 -3
- package/dist/cjs/react/nodes/media/index.js +8 -11
- package/dist/cjs/react/nodes/mediaInline.js +20 -47
- package/dist/cjs/react/nodes/mediaSingle/index.js +3 -6
- package/dist/cjs/react/nodes/mediaSingle/styles.js +0 -1
- package/dist/cjs/react/nodes/panel.js +7 -9
- package/dist/cjs/react/nodes/table/sticky.js +6 -7
- package/dist/cjs/react/utils/EditorMediaClientProvider.js +40 -0
- package/dist/cjs/ui/Expand.js +16 -18
- package/dist/cjs/ui/MediaCard.js +71 -74
- package/dist/cjs/ui/Renderer/index.js +35 -28
- package/dist/cjs/ui/Renderer/truncated-wrapper.js +2 -3
- package/dist/cjs/ui/SortingIcon.js +4 -5
- package/dist/cjs/ui/annotations/draft/component.js +8 -9
- package/dist/cjs/ui/annotations/element/mark.js +1 -2
- package/dist/es2019/react/marks/alignment.js +3 -4
- package/dist/es2019/react/marks/breakout.js +3 -4
- package/dist/es2019/react/marks/link.js +4 -5
- package/dist/es2019/react/nodes/blockCard.js +12 -13
- package/dist/es2019/react/nodes/codeBlock/codeBlock.js +2 -4
- package/dist/es2019/react/nodes/codeBlock/components/codeBlockButtonContainer.js +5 -6
- package/dist/es2019/react/nodes/codeBlock/components/codeBlockContainer.js +3 -4
- package/dist/es2019/react/nodes/codeBlock/components/codeBlockCopyButton.js +5 -7
- package/dist/es2019/react/nodes/codeBlock/components/codeBlockWrapButton.js +7 -9
- package/dist/es2019/react/nodes/codeBlock/components/lightWeightCodeBlock.js +8 -9
- package/dist/es2019/react/nodes/codeBlock/windowedCodeBlock.js +4 -6
- package/dist/es2019/react/nodes/embedCard.js +9 -10
- package/dist/es2019/react/nodes/heading-anchor.js +5 -6
- package/dist/es2019/react/nodes/layoutColumn.js +3 -4
- package/dist/es2019/react/nodes/media/index.js +7 -13
- package/dist/es2019/react/nodes/mediaInline.js +12 -20
- package/dist/es2019/react/nodes/mediaSingle/index.js +3 -6
- package/dist/es2019/react/nodes/mediaSingle/styles.js +0 -1
- package/dist/es2019/react/nodes/panel.js +7 -8
- package/dist/es2019/react/nodes/table/sticky.js +7 -8
- package/dist/es2019/react/utils/EditorMediaClientProvider.js +27 -0
- package/dist/es2019/ui/Expand.js +16 -17
- package/dist/es2019/ui/MediaCard.js +25 -29
- package/dist/es2019/ui/Renderer/index.js +36 -31
- package/dist/es2019/ui/Renderer/truncated-wrapper.js +3 -4
- package/dist/es2019/ui/SortingIcon.js +5 -6
- package/dist/es2019/ui/annotations/draft/component.js +9 -10
- package/dist/es2019/ui/annotations/element/mark.js +2 -3
- package/dist/esm/react/marks/alignment.js +3 -4
- package/dist/esm/react/marks/breakout.js +3 -4
- package/dist/esm/react/marks/link.js +4 -5
- package/dist/esm/react/nodes/blockCard.js +12 -13
- package/dist/esm/react/nodes/codeBlock/codeBlock.js +2 -4
- package/dist/esm/react/nodes/codeBlock/components/codeBlockButtonContainer.js +5 -6
- package/dist/esm/react/nodes/codeBlock/components/codeBlockContainer.js +3 -4
- package/dist/esm/react/nodes/codeBlock/components/codeBlockCopyButton.js +5 -7
- package/dist/esm/react/nodes/codeBlock/components/codeBlockWrapButton.js +7 -9
- package/dist/esm/react/nodes/codeBlock/components/lightWeightCodeBlock.js +8 -9
- package/dist/esm/react/nodes/codeBlock/windowedCodeBlock.js +4 -6
- package/dist/esm/react/nodes/embedCard.js +9 -10
- package/dist/esm/react/nodes/heading-anchor.js +5 -6
- package/dist/esm/react/nodes/layoutColumn.js +3 -4
- package/dist/esm/react/nodes/media/index.js +8 -14
- package/dist/esm/react/nodes/mediaInline.js +21 -48
- package/dist/esm/react/nodes/mediaSingle/index.js +3 -6
- package/dist/esm/react/nodes/mediaSingle/styles.js +0 -1
- package/dist/esm/react/nodes/panel.js +7 -8
- package/dist/esm/react/nodes/table/sticky.js +7 -8
- package/dist/esm/react/utils/EditorMediaClientProvider.js +30 -0
- package/dist/esm/ui/Expand.js +16 -17
- package/dist/esm/ui/MediaCard.js +71 -74
- package/dist/esm/ui/Renderer/index.js +36 -31
- package/dist/esm/ui/Renderer/truncated-wrapper.js +3 -4
- package/dist/esm/ui/SortingIcon.js +5 -6
- package/dist/esm/ui/annotations/draft/component.js +9 -10
- package/dist/esm/ui/annotations/element/mark.js +2 -3
- package/dist/types/react/nodes/media/index.d.ts +2 -3
- package/dist/types/react/nodes/mediaInline.d.ts +2 -1
- package/dist/types/react/utils/EditorMediaClientProvider.d.ts +5 -0
- package/dist/types/ui/MediaCard.d.ts +6 -5
- package/dist/types/ui/Renderer/index.d.ts +2 -1
- package/dist/types-ts4.5/react/nodes/media/index.d.ts +2 -3
- package/dist/types-ts4.5/react/nodes/mediaInline.d.ts +2 -1
- package/dist/types-ts4.5/react/utils/EditorMediaClientProvider.d.ts +5 -0
- package/dist/types-ts4.5/ui/MediaCard.d.ts +6 -5
- package/dist/types-ts4.5/ui/Renderer/index.d.ts +2 -1
- package/package.json +3 -3
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { css, jsx } from '@emotion/react';
|
|
1
|
+
import { css } from '@emotion/react';
|
|
3
2
|
import { WidthConsumer } from '@atlaskit/editor-common/ui';
|
|
4
3
|
import { calcBreakoutWidth } from '@atlaskit/editor-common/utils';
|
|
5
4
|
import { blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
|
|
@@ -9,9 +8,9 @@ export const wrapperStyles = css`
|
|
|
9
8
|
transform: translateX(-50%);
|
|
10
9
|
`;
|
|
11
10
|
export default function Breakout(props) {
|
|
12
|
-
return
|
|
11
|
+
return /*#__PURE__*/React.createElement(WidthConsumer, null, ({
|
|
13
12
|
width
|
|
14
|
-
}) =>
|
|
13
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
15
14
|
css: wrapperStyles,
|
|
16
15
|
"data-mode": props.mode,
|
|
17
16
|
style: {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
/** @jsx jsx */
|
|
3
2
|
import React, { Fragment } from 'react';
|
|
4
|
-
import { css
|
|
3
|
+
import { css } from '@emotion/react';
|
|
5
4
|
import { B400, B300, B500 } from '@atlaskit/theme/colors';
|
|
6
5
|
import { getEventHandler } from '../../utils';
|
|
7
6
|
import { PLATFORM, MODE } from '../../analytics/events';
|
|
@@ -39,7 +38,7 @@ export default function Link(props) {
|
|
|
39
38
|
}
|
|
40
39
|
const handler = getEventHandler(eventHandlers, 'link');
|
|
41
40
|
if (isMediaLink) {
|
|
42
|
-
return
|
|
41
|
+
return /*#__PURE__*/React.createElement(Fragment, null, props.children);
|
|
43
42
|
}
|
|
44
43
|
const analyticsData = {
|
|
45
44
|
attributes: {
|
|
@@ -48,9 +47,9 @@ export default function Link(props) {
|
|
|
48
47
|
// Below is added for the future implementation of Linking Platform namespaced analytic context
|
|
49
48
|
location: 'renderer'
|
|
50
49
|
};
|
|
51
|
-
return
|
|
50
|
+
return /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
52
51
|
data: analyticsData
|
|
53
|
-
},
|
|
52
|
+
}, /*#__PURE__*/React.createElement(LinkUrl, _extends({
|
|
54
53
|
css: anchorStyles,
|
|
55
54
|
onClick: e => {
|
|
56
55
|
if (fireAnalyticsEvent) {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
/** @jsx jsx */
|
|
3
2
|
import { useMemo } from 'react';
|
|
4
|
-
import { css
|
|
3
|
+
import { css } from '@emotion/react';
|
|
5
4
|
import { Card } from '@atlaskit/smart-card';
|
|
6
5
|
import { UnsupportedBlock, UnsupportedInline, WidthConsumer } from '@atlaskit/editor-common/ui';
|
|
7
6
|
import { getPlatform } from '../../utils';
|
|
@@ -57,7 +56,7 @@ export default function BlockCard(props) {
|
|
|
57
56
|
};
|
|
58
57
|
if (props.datasource) {
|
|
59
58
|
if (platform === 'mobile') {
|
|
60
|
-
return
|
|
59
|
+
return /*#__PURE__*/React.createElement(InlineCard, props);
|
|
61
60
|
}
|
|
62
61
|
const views = props.datasource.views;
|
|
63
62
|
const tableView = views.find(view => view.type === 'table');
|
|
@@ -76,18 +75,18 @@ export default function BlockCard(props) {
|
|
|
76
75
|
datasource,
|
|
77
76
|
layout
|
|
78
77
|
} = props;
|
|
79
|
-
return
|
|
78
|
+
return /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
80
79
|
data: analyticsData
|
|
81
|
-
},
|
|
80
|
+
}, /*#__PURE__*/React.createElement(CardErrorBoundary, _extends({
|
|
82
81
|
unsupportedComponent: UnsupportedInline
|
|
83
|
-
}, cardProps),
|
|
82
|
+
}, cardProps), /*#__PURE__*/React.createElement(WidthConsumer, null, ({
|
|
84
83
|
width
|
|
85
|
-
}) =>
|
|
84
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
86
85
|
css: datasourceContainerStyle,
|
|
87
86
|
style: {
|
|
88
87
|
width: calcBreakoutWidth(layout, width)
|
|
89
88
|
}
|
|
90
|
-
},
|
|
89
|
+
}, /*#__PURE__*/React.createElement(DatasourceTableView, {
|
|
91
90
|
datasourceId: datasource.id,
|
|
92
91
|
parameters: datasource.parameters,
|
|
93
92
|
visibleColumnKeys: visibleColumnKeys,
|
|
@@ -95,21 +94,21 @@ export default function BlockCard(props) {
|
|
|
95
94
|
url: url
|
|
96
95
|
})))));
|
|
97
96
|
}
|
|
98
|
-
return
|
|
97
|
+
return /*#__PURE__*/React.createElement(InlineCard, {
|
|
99
98
|
data: data,
|
|
100
99
|
url: url
|
|
101
100
|
});
|
|
102
101
|
}
|
|
103
|
-
return
|
|
102
|
+
return /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
104
103
|
data: analyticsData
|
|
105
|
-
},
|
|
104
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
106
105
|
className: "blockCardView-content-wrap",
|
|
107
106
|
"data-block-card": true,
|
|
108
107
|
"data-card-data": data ? JSON.stringify(data) : undefined,
|
|
109
108
|
"data-card-url": url
|
|
110
|
-
},
|
|
109
|
+
}, /*#__PURE__*/React.createElement(CardErrorBoundary, _extends({
|
|
111
110
|
unsupportedComponent: UnsupportedBlock
|
|
112
|
-
}, cardProps),
|
|
111
|
+
}, cardProps), /*#__PURE__*/React.createElement(Card, _extends({
|
|
113
112
|
appearance: "block",
|
|
114
113
|
showActions: rendererAppearance !== 'mobile',
|
|
115
114
|
platform: platform,
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
1
|
import { useState } from 'react';
|
|
3
|
-
import { jsx } from '@emotion/react';
|
|
4
2
|
import { injectIntl } from 'react-intl-next';
|
|
5
3
|
import { CodeBlockSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
6
4
|
import { CodeBlock as AkCodeBlock } from '@atlaskit/code';
|
|
@@ -17,14 +15,14 @@ function CodeBlock(props) {
|
|
|
17
15
|
const codeBidiWarningLabel = props.intl.formatMessage(codeBidiWarningMessages.label);
|
|
18
16
|
const className = [CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER, props.className].join(' ');
|
|
19
17
|
const [wrapLongLines, setWrapLongLines] = useState(false);
|
|
20
|
-
return
|
|
18
|
+
return /*#__PURE__*/React.createElement(CodeBlockContainer, {
|
|
21
19
|
allowCopyToClipboard: allowCopyToClipboard,
|
|
22
20
|
allowWrapCodeBlock: allowWrapCodeBlock,
|
|
23
21
|
className: className,
|
|
24
22
|
setWrapLongLines: setWrapLongLines,
|
|
25
23
|
text: text,
|
|
26
24
|
wrapLongLines: wrapLongLines
|
|
27
|
-
},
|
|
25
|
+
}, /*#__PURE__*/React.createElement(AkCodeBlock, {
|
|
28
26
|
language: language,
|
|
29
27
|
text: text,
|
|
30
28
|
codeBidiWarningLabel: codeBidiWarningLabel,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { jsx, css } from '@emotion/react';
|
|
1
|
+
import { css } from '@emotion/react';
|
|
3
2
|
import CopyButton from './codeBlockCopyButton';
|
|
4
3
|
import CodeWrapButton from './codeBlockWrapButton';
|
|
5
4
|
import { N0, N20, N30, N700 } from '@atlaskit/theme/colors';
|
|
@@ -46,14 +45,14 @@ const CodeBlockButtonContainer = ({
|
|
|
46
45
|
text,
|
|
47
46
|
wrapLongLines
|
|
48
47
|
}) => {
|
|
49
|
-
return
|
|
48
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
50
49
|
css: codeBlockButtonsWrapper
|
|
51
|
-
},
|
|
50
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
52
51
|
css: codeBlockButtonsStyle
|
|
53
|
-
}, allowWrapCodeBlock &&
|
|
52
|
+
}, allowWrapCodeBlock && /*#__PURE__*/React.createElement(CodeWrapButton, {
|
|
54
53
|
setWrapLongLines: setWrapLongLines,
|
|
55
54
|
wrapLongLines: wrapLongLines
|
|
56
|
-
}), allowCopyToClipboard &&
|
|
55
|
+
}), allowCopyToClipboard && /*#__PURE__*/React.createElement(CopyButton, {
|
|
57
56
|
content: text
|
|
58
57
|
})));
|
|
59
58
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { jsx, css } from '@emotion/react';
|
|
1
|
+
import { css } from '@emotion/react';
|
|
3
2
|
import { overflowShadow, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
4
3
|
import { N20, DN50 } from '@atlaskit/theme/colors';
|
|
5
4
|
import { themed } from '@atlaskit/theme/components';
|
|
@@ -48,10 +47,10 @@ const CodeBlockContainer = ({
|
|
|
48
47
|
text,
|
|
49
48
|
wrapLongLines
|
|
50
49
|
}) => {
|
|
51
|
-
return
|
|
50
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
52
51
|
className: className,
|
|
53
52
|
css: codeBlockStyleOverrides
|
|
54
|
-
},
|
|
53
|
+
}, /*#__PURE__*/React.createElement(CodeBlockButtonContainer, {
|
|
55
54
|
allowCopyToClipboard: allowCopyToClipboard,
|
|
56
55
|
allowWrapCodeBlock: allowWrapCodeBlock,
|
|
57
56
|
setWrapLongLines: setWrapLongLines,
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { jsx } from '@emotion/react';
|
|
3
1
|
import React, { useState } from 'react';
|
|
4
2
|
import { injectIntl } from 'react-intl-next';
|
|
5
3
|
import Tooltip from '@atlaskit/tooltip';
|
|
@@ -19,20 +17,20 @@ const CopyButton = ({
|
|
|
19
17
|
setTooltip(intl.formatMessage(codeBlockButtonMessages.copyCodeToClipboard));
|
|
20
18
|
setClassName('copy-to-clipboard');
|
|
21
19
|
};
|
|
22
|
-
return
|
|
20
|
+
return /*#__PURE__*/React.createElement(AnalyticsContext.Consumer, null, ({
|
|
23
21
|
fireAnalyticsEvent
|
|
24
|
-
}) =>
|
|
22
|
+
}) => /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Tooltip, {
|
|
25
23
|
content: tooltip,
|
|
26
24
|
hideTooltipOnClick: false,
|
|
27
25
|
position: "top"
|
|
28
|
-
},
|
|
26
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
29
27
|
onMouseLeave: onMouseLeave
|
|
30
|
-
},
|
|
28
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
31
29
|
appearance: "subtle",
|
|
32
30
|
"aria-haspopup": true,
|
|
33
31
|
"aria-label": tooltip,
|
|
34
32
|
className: className,
|
|
35
|
-
iconBefore:
|
|
33
|
+
iconBefore: /*#__PURE__*/React.createElement(CopyIcon, {
|
|
36
34
|
label: tooltip
|
|
37
35
|
}),
|
|
38
36
|
onClick: event => {
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { jsx } from '@emotion/react';
|
|
3
1
|
import React from 'react';
|
|
4
2
|
import { injectIntl } from 'react-intl-next';
|
|
5
3
|
import Tooltip from '@atlaskit/tooltip';
|
|
@@ -9,15 +7,15 @@ import { codeBlockButtonMessages } from '@atlaskit/editor-common/messages';
|
|
|
9
7
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../../../../analytics/enums';
|
|
10
8
|
import AnalyticsContext from '../../../../analytics/analyticsContext';
|
|
11
9
|
const WrapIcon = () => {
|
|
12
|
-
return
|
|
10
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
13
11
|
width: "24",
|
|
14
12
|
height: "24",
|
|
15
13
|
fill: "none",
|
|
16
14
|
viewBox: "0 0 24 24"
|
|
17
|
-
},
|
|
15
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
18
16
|
fill: "currentColor",
|
|
19
17
|
clipPath: "url(#clip0_654_431)"
|
|
20
|
-
},
|
|
18
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
21
19
|
d: "M20 4h-1v16h1V4ZM3 8a1 1 0 0 1 1-1h9.5a4.5 4.5 0 1 1 0 9h-2.086l.293.293a1 1 0 0 1-1.414 1.414l-2-2a1 1 0 0 1 0-1.414l2-2a1 1 0 0 1 1.414 1.414l-.293.293H13.5a2.5 2.5 0 0 0 0-5H4a1 1 0 0 1-1-1Z",
|
|
22
20
|
clipRule: "evenodd",
|
|
23
21
|
fillRule: "evenodd"
|
|
@@ -29,18 +27,18 @@ const CodeBlockWrapButton = ({
|
|
|
29
27
|
intl
|
|
30
28
|
}) => {
|
|
31
29
|
const wrapMessage = intl.formatMessage(wrapLongLines ? codeBlockButtonMessages.unwrapCode : codeBlockButtonMessages.wrapCode);
|
|
32
|
-
return
|
|
30
|
+
return /*#__PURE__*/React.createElement(AnalyticsContext.Consumer, null, ({
|
|
33
31
|
fireAnalyticsEvent
|
|
34
|
-
}) =>
|
|
32
|
+
}) => /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Tooltip, {
|
|
35
33
|
content: wrapMessage,
|
|
36
34
|
hideTooltipOnClick: false,
|
|
37
35
|
position: "top"
|
|
38
|
-
},
|
|
36
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
39
37
|
appearance: "subtle",
|
|
40
38
|
"aria-haspopup": true,
|
|
41
39
|
"aria-label": wrapMessage,
|
|
42
40
|
className: `wrap-code ${wrapLongLines ? 'clicked' : ''}`,
|
|
43
|
-
iconBefore:
|
|
41
|
+
iconBefore: /*#__PURE__*/React.createElement(Icon, {
|
|
44
42
|
glyph: WrapIcon,
|
|
45
43
|
label: ""
|
|
46
44
|
}),
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
1
|
import React, { forwardRef, useMemo } from 'react';
|
|
3
|
-
import { css,
|
|
2
|
+
import { css, useTheme } from '@emotion/react';
|
|
4
3
|
import { blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
|
|
5
4
|
import { codeBlockSharedStyles, CodeBlockSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
6
5
|
import { useBidiWarnings } from '../../../hooks/use-bidi-warnings';
|
|
@@ -41,20 +40,20 @@ const LightWeightCodeBlock = /*#__PURE__*/forwardRef(({
|
|
|
41
40
|
enableWarningTooltip: codeBidiWarningTooltipEnabled
|
|
42
41
|
});
|
|
43
42
|
const classNames = [LightWeightCodeBlockCssClassName.CONTAINER, className].join(' ');
|
|
44
|
-
return
|
|
43
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
45
44
|
className: classNames,
|
|
46
45
|
ref: ref,
|
|
47
46
|
css: [codeBlockSharedStyles(theme), lightWeightCodeBlockStyles]
|
|
48
|
-
},
|
|
47
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
49
48
|
className: CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER
|
|
50
|
-
},
|
|
49
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
51
50
|
className: CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER
|
|
52
|
-
},
|
|
51
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
53
52
|
className: CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER
|
|
54
|
-
}, textRows.map((_, index) =>
|
|
53
|
+
}, textRows.map((_, index) => /*#__PURE__*/React.createElement("span", {
|
|
55
54
|
key: index
|
|
56
|
-
}))),
|
|
55
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
57
56
|
className: CodeBlockSharedCssClassName.CODEBLOCK_CONTENT
|
|
58
|
-
},
|
|
57
|
+
}, /*#__PURE__*/React.createElement("code", null, renderBidiWarnings(text))))));
|
|
59
58
|
});
|
|
60
59
|
export default LightWeightCodeBlock;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
1
|
import { Fragment, lazy, memo, Suspense, useState } from 'react';
|
|
3
|
-
import { jsx } from '@emotion/react';
|
|
4
2
|
import { CodeBlockSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
5
3
|
import { useInViewport } from '../../hooks/use-in-viewport';
|
|
6
4
|
import { useBidiWarnings } from '../../hooks/use-bidi-warnings';
|
|
@@ -28,23 +26,23 @@ const WindowedCodeBlock = ({
|
|
|
28
26
|
trackingRef
|
|
29
27
|
} = useInViewport();
|
|
30
28
|
const className = joinWithSpaces(CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER, rootClassName);
|
|
31
|
-
const memoizedLightWeightCodeBlock =
|
|
29
|
+
const memoizedLightWeightCodeBlock = /*#__PURE__*/React.createElement(MemoizedLightWeightCodeBlock, {
|
|
32
30
|
ref: trackingRef,
|
|
33
31
|
text: text,
|
|
34
32
|
codeBidiWarningTooltipEnabled: codeBidiWarningTooltipEnabled,
|
|
35
33
|
className: rootClassName
|
|
36
34
|
});
|
|
37
35
|
const [wrapLongLines, setWrapLongLines] = useState(false);
|
|
38
|
-
return isInViewport ?
|
|
36
|
+
return isInViewport ? /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Suspense, {
|
|
39
37
|
fallback: memoizedLightWeightCodeBlock
|
|
40
|
-
},
|
|
38
|
+
}, /*#__PURE__*/React.createElement(CodeBlockContainer, {
|
|
41
39
|
allowCopyToClipboard: allowCopyToClipboard,
|
|
42
40
|
allowWrapCodeBlock: allowWrapCodeBlock,
|
|
43
41
|
className: className,
|
|
44
42
|
setWrapLongLines: setWrapLongLines,
|
|
45
43
|
text: text,
|
|
46
44
|
wrapLongLines: wrapLongLines
|
|
47
|
-
},
|
|
45
|
+
}, /*#__PURE__*/React.createElement(LazyAkCodeBlock, {
|
|
48
46
|
language: language,
|
|
49
47
|
text: text,
|
|
50
48
|
codeBidiWarningLabel: warningLabel,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
|
|
3
|
-
import { css, jsx } from '@emotion/react';
|
|
2
|
+
import { css } from '@emotion/react';
|
|
4
3
|
import { useMemo, useContext, useState, useRef } from 'react';
|
|
5
4
|
import { Card, EmbedResizeMessageListener } from '@atlaskit/smart-card';
|
|
6
5
|
import { SmartCardContext } from '@atlaskit/link-provider';
|
|
@@ -98,9 +97,9 @@ export default function EmbedCard(props) {
|
|
|
98
97
|
// Below is added for the future implementation of Linking Platform namespaced analytic context
|
|
99
98
|
location: 'renderer'
|
|
100
99
|
};
|
|
101
|
-
return
|
|
100
|
+
return /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
102
101
|
data: analyticsData
|
|
103
|
-
},
|
|
102
|
+
}, /*#__PURE__*/React.createElement(WidthConsumer, null, ({
|
|
104
103
|
width: documentWidth
|
|
105
104
|
}) => {
|
|
106
105
|
const isFullWidth = rendererAppearance === 'full-width';
|
|
@@ -127,12 +126,12 @@ export default function EmbedCard(props) {
|
|
|
127
126
|
throw err;
|
|
128
127
|
}
|
|
129
128
|
};
|
|
130
|
-
return
|
|
129
|
+
return /*#__PURE__*/React.createElement(CardErrorBoundary, _extends({
|
|
131
130
|
unsupportedComponent: UnsupportedBlock
|
|
132
|
-
}, cardProps),
|
|
131
|
+
}, cardProps), /*#__PURE__*/React.createElement(EmbedResizeMessageListener, {
|
|
133
132
|
embedIframeRef: embedIframeRef,
|
|
134
133
|
onHeightUpdate: setLiveHeight
|
|
135
|
-
},
|
|
134
|
+
}, /*#__PURE__*/React.createElement(UIMediaSingle, {
|
|
136
135
|
css: uiMediaSingleStyles,
|
|
137
136
|
layout: layout,
|
|
138
137
|
width: originalWidth,
|
|
@@ -143,9 +142,9 @@ export default function EmbedCard(props) {
|
|
|
143
142
|
nodeType: "embedCard",
|
|
144
143
|
lineLength: isInsideOfBlockNode ? containerWidth : lineLength,
|
|
145
144
|
hasFallbackContainer: hasPreview
|
|
146
|
-
},
|
|
145
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
147
146
|
css: embedCardWrapperStyles
|
|
148
|
-
},
|
|
147
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
149
148
|
className: "embedCardView-content-wrap",
|
|
150
149
|
"data-embed-card": true,
|
|
151
150
|
"data-layout": layout,
|
|
@@ -153,7 +152,7 @@ export default function EmbedCard(props) {
|
|
|
153
152
|
"data-card-data": data ? JSON.stringify(data) : undefined,
|
|
154
153
|
"data-card-url": url,
|
|
155
154
|
"data-card-original-height": originalHeight
|
|
156
|
-
},
|
|
155
|
+
}, /*#__PURE__*/React.createElement(Card, _extends({
|
|
157
156
|
appearance: "embed"
|
|
158
157
|
}, cardProps, {
|
|
159
158
|
onResolve: onResolve,
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
-
/** @jsx jsx */
|
|
4
3
|
import React from 'react';
|
|
5
|
-
import { css
|
|
4
|
+
import { css } from '@emotion/react';
|
|
6
5
|
import { N200, N500, B400 } from '@atlaskit/theme/colors';
|
|
7
6
|
import LinkIcon from '@atlaskit/icon/glyph/link';
|
|
8
7
|
import Tooltip from '@atlaskit/tooltip';
|
|
@@ -14,7 +13,7 @@ const CopyAnchorWrapperWithRef = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
14
13
|
children,
|
|
15
14
|
...rest
|
|
16
15
|
} = props;
|
|
17
|
-
return
|
|
16
|
+
return /*#__PURE__*/React.createElement("span", _extends({}, rest, {
|
|
18
17
|
className: HeadingAnchorWrapperClassName,
|
|
19
18
|
ref: ref
|
|
20
19
|
}), children);
|
|
@@ -65,12 +64,12 @@ class HeadingAnchor extends React.PureComponent {
|
|
|
65
64
|
this.setTooltipState(headingAnchorLinkMessages.copyHeadingLinkToClipboard);
|
|
66
65
|
});
|
|
67
66
|
_defineProperty(this, "renderAnchorButton", () => {
|
|
68
|
-
return
|
|
67
|
+
return /*#__PURE__*/React.createElement("button", {
|
|
69
68
|
css: copyAnchorButtonStyles,
|
|
70
69
|
onMouseLeave: this.resetMessage,
|
|
71
70
|
onClick: this.copyToClipboard,
|
|
72
71
|
"aria-label": this.state.tooltipMessage
|
|
73
|
-
},
|
|
72
|
+
}, /*#__PURE__*/React.createElement(LinkIcon, {
|
|
74
73
|
label: this.getCopyAriaLabel(),
|
|
75
74
|
size: this.props.level > 3 ? 'small' : 'medium',
|
|
76
75
|
primaryColor: this.state.isClicked ? `var(--ds-icon-selected, ${B400})` : `var(--ds-icon-subtle, ${N200})`
|
|
@@ -88,7 +87,7 @@ class HeadingAnchor extends React.PureComponent {
|
|
|
88
87
|
// We set the key to the message to ensure it remounts when the message
|
|
89
88
|
// changes, so that it correctly repositions.
|
|
90
89
|
// @see https://ecosystem.atlassian.net/projects/AK/queues/issue/AK-6548
|
|
91
|
-
return
|
|
90
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
92
91
|
tag: CopyAnchorWrapperWithRef,
|
|
93
92
|
content: tooltipMessage,
|
|
94
93
|
position: "top",
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
1
|
import React from 'react';
|
|
3
|
-
import {
|
|
2
|
+
import { css } from '@emotion/react';
|
|
4
3
|
import { WidthProvider, clearNextSiblingMarginTopStyle, clearNextSiblingBlockMarkMarginTopStyle } from '@atlaskit/editor-common/ui';
|
|
5
4
|
const layoutColumnClearMarginTopStyles = css`
|
|
6
5
|
${clearNextSiblingMarginTopStyle}
|
|
7
6
|
${clearNextSiblingBlockMarkMarginTopStyle}
|
|
8
7
|
`;
|
|
9
8
|
export default function LayoutSection(props) {
|
|
10
|
-
return
|
|
9
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
11
10
|
"data-layout-column": true,
|
|
12
11
|
"data-column-width": props.width,
|
|
13
12
|
style: {
|
|
14
13
|
flexBasis: `${props.width}%`
|
|
15
14
|
}
|
|
16
|
-
},
|
|
15
|
+
}, /*#__PURE__*/React.createElement(WidthProvider, null, /*#__PURE__*/React.createElement("div", {
|
|
17
16
|
css: layoutColumnClearMarginTopStyles
|
|
18
17
|
}), props.children));
|
|
19
18
|
}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import { PureComponent } from 'react';
|
|
7
|
-
import { jsx } from '@emotion/react';
|
|
3
|
+
import React, { PureComponent } from 'react';
|
|
8
4
|
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
9
5
|
import { MEDIA_CONTEXT } from '@atlaskit/analytics-namespaced-context';
|
|
10
6
|
import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
@@ -21,7 +17,6 @@ export default class Media extends PureComponent {
|
|
|
21
17
|
_defineProperty(this, "renderCard", (providers = {}) => {
|
|
22
18
|
var _borderMark$attrs$col, _borderMark$attrs$siz;
|
|
23
19
|
const {
|
|
24
|
-
mediaProvider,
|
|
25
20
|
contextIdentifierProvider
|
|
26
21
|
} = providers;
|
|
27
22
|
const {
|
|
@@ -39,14 +34,13 @@ export default class Media extends PureComponent {
|
|
|
39
34
|
const linkHref = linkMark === null || linkMark === void 0 ? void 0 : linkMark.attrs.href;
|
|
40
35
|
const eventHandlers = linkHref ? undefined : this.props.eventHandlers;
|
|
41
36
|
const shouldOpenMediaViewer = !linkHref && allowMediaViewer;
|
|
42
|
-
const mediaComponent =
|
|
37
|
+
const mediaComponent = /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
43
38
|
data: {
|
|
44
39
|
[MEDIA_CONTEXT]: {
|
|
45
40
|
border: !!borderMark
|
|
46
41
|
}
|
|
47
42
|
}
|
|
48
|
-
},
|
|
49
|
-
mediaProvider: mediaProvider,
|
|
43
|
+
}, /*#__PURE__*/React.createElement(MediaCard, _extends({
|
|
50
44
|
contextIdentifierProvider: contextIdentifierProvider
|
|
51
45
|
}, this.props, {
|
|
52
46
|
shouldOpenMediaViewer: shouldOpenMediaViewer,
|
|
@@ -57,15 +51,15 @@ export default class Media extends PureComponent {
|
|
|
57
51
|
ssr: ssr
|
|
58
52
|
})));
|
|
59
53
|
const paletteColorValue = hexToEditorBorderPaletteColor(borderColor) || borderColor;
|
|
60
|
-
const mediaComponentWithBorder = borderMark ?
|
|
54
|
+
const mediaComponentWithBorder = borderMark ? /*#__PURE__*/React.createElement("div", {
|
|
61
55
|
"data-mark-type": "border",
|
|
62
56
|
"data-color": borderColor,
|
|
63
57
|
"data-size": borderWidth,
|
|
64
58
|
css: borderStyle(paletteColorValue, borderWidth)
|
|
65
|
-
},
|
|
59
|
+
}, /*#__PURE__*/React.createElement(MediaBorderGapFiller, {
|
|
66
60
|
borderColor: borderColor
|
|
67
61
|
}), mediaComponent) : mediaComponent;
|
|
68
|
-
return linkHref ?
|
|
62
|
+
return linkHref ? /*#__PURE__*/React.createElement("a", {
|
|
69
63
|
href: linkHref,
|
|
70
64
|
rel: "noreferrer noopener",
|
|
71
65
|
onClick: this.handleMediaLinkClick,
|
|
@@ -107,7 +101,7 @@ export default class Media extends PureComponent {
|
|
|
107
101
|
if (!providers) {
|
|
108
102
|
return this.renderCard();
|
|
109
103
|
}
|
|
110
|
-
return
|
|
104
|
+
return /*#__PURE__*/React.createElement(WithProviders, {
|
|
111
105
|
providers: ['mediaProvider', 'contextIdentifierProvider'],
|
|
112
106
|
providerFactory: providers,
|
|
113
107
|
renderNode: this.renderCard
|
|
@@ -3,7 +3,7 @@ import React, { useEffect, useState, useCallback } from 'react';
|
|
|
3
3
|
import { MediaInlineCard } from '@atlaskit/media-card';
|
|
4
4
|
import { MediaInlineCardErroredView, MediaInlineCardLoadingView, messages } from '@atlaskit/media-ui';
|
|
5
5
|
import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
6
|
-
import {
|
|
6
|
+
import { MediaClientContext } from '@atlaskit/media-client-react';
|
|
7
7
|
import { getClipboardAttrs, mediaIdentifierMap } from '../../ui/MediaCard';
|
|
8
8
|
import { createIntl, injectIntl } from 'react-intl-next';
|
|
9
9
|
export const RenderMediaInline = ({
|
|
@@ -12,31 +12,31 @@ export const RenderMediaInline = ({
|
|
|
12
12
|
clipboardAttrs,
|
|
13
13
|
mediaInlineProviders,
|
|
14
14
|
collection: collectionName,
|
|
15
|
-
featureFlags,
|
|
16
15
|
eventHandlers,
|
|
17
16
|
identifier
|
|
18
17
|
}) => {
|
|
19
18
|
const [contextIdentifierProvider, setContextIdentifierProvider] = useState();
|
|
20
|
-
const [viewMediaClientConfigState, setViewMediaClientConfigState] = useState();
|
|
21
19
|
const [fileState, setFileState] = useState();
|
|
20
|
+
const mediaClient = React.useContext(MediaClientContext);
|
|
22
21
|
const updateContext = async contextIdentifierProvider => {
|
|
23
22
|
if (contextIdentifierProvider) {
|
|
24
23
|
const resolvedContextID = await contextIdentifierProvider;
|
|
25
24
|
setContextIdentifierProvider(resolvedContextID);
|
|
26
25
|
}
|
|
27
26
|
};
|
|
28
|
-
const updateFileState = useCallback(async
|
|
29
|
-
const mediaClient = getMediaClient(mediaClientConfig);
|
|
27
|
+
const updateFileState = useCallback(async id => {
|
|
30
28
|
const options = {
|
|
31
29
|
collectionName
|
|
32
30
|
};
|
|
33
31
|
try {
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
if (mediaClient) {
|
|
33
|
+
const fileState = await mediaClient.file.getCurrentState(id, options);
|
|
34
|
+
setFileState(fileState);
|
|
35
|
+
}
|
|
36
36
|
} catch (error) {
|
|
37
37
|
// do not set state on error
|
|
38
38
|
}
|
|
39
|
-
}, [collectionName]);
|
|
39
|
+
}, [collectionName, mediaClient]);
|
|
40
40
|
useEffect(() => {
|
|
41
41
|
const {
|
|
42
42
|
id
|
|
@@ -54,28 +54,20 @@ export const RenderMediaInline = ({
|
|
|
54
54
|
}, [identifier, collectionName]);
|
|
55
55
|
useEffect(() => {
|
|
56
56
|
const {
|
|
57
|
-
mediaProvider,
|
|
58
57
|
contextIdentifierProvider
|
|
59
58
|
} = mediaInlineProviders;
|
|
60
59
|
const {
|
|
61
60
|
id
|
|
62
61
|
} = clipboardAttrs;
|
|
63
|
-
updateViewMediaClientConfigState(mediaProvider);
|
|
64
62
|
updateContext(contextIdentifierProvider);
|
|
65
|
-
id &&
|
|
66
|
-
}, [mediaInlineProviders, contextIdentifierProvider, clipboardAttrs,
|
|
67
|
-
const updateViewMediaClientConfigState = async mediaProvider => {
|
|
68
|
-
if (mediaProvider) {
|
|
69
|
-
const mediaClientConfig = await mediaProvider;
|
|
70
|
-
setViewMediaClientConfigState(mediaClientConfig.viewMediaClientConfig);
|
|
71
|
-
}
|
|
72
|
-
};
|
|
63
|
+
id && updateFileState(id);
|
|
64
|
+
}, [mediaInlineProviders, contextIdentifierProvider, clipboardAttrs, updateFileState]);
|
|
73
65
|
|
|
74
66
|
/*
|
|
75
67
|
* Only show the loading view if the media provider is not ready
|
|
76
68
|
* prevents calling the media API before the provider is ready
|
|
77
69
|
*/
|
|
78
|
-
if (!
|
|
70
|
+
if (!mediaClient) {
|
|
79
71
|
return /*#__PURE__*/React.createElement(MediaInlineCardLoadingView, {
|
|
80
72
|
message: "",
|
|
81
73
|
isSelected: false
|
|
@@ -109,7 +101,7 @@ export const RenderMediaInline = ({
|
|
|
109
101
|
onClick: handleMediaInlineClick,
|
|
110
102
|
shouldOpenMediaViewer: shouldOpenMediaViewer,
|
|
111
103
|
shouldDisplayToolTip: shouldDisplayToolTip,
|
|
112
|
-
mediaClientConfig:
|
|
104
|
+
mediaClientConfig: mediaClient.mediaClientConfig,
|
|
113
105
|
mediaViewerItems: Array.from(mediaIdentifierMap.values())
|
|
114
106
|
}) : /*#__PURE__*/React.createElement(MediaInlineCardErroredView, {
|
|
115
107
|
message: (intl || createIntl({
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
|
|
3
1
|
import { default as React, Fragment } from 'react';
|
|
4
|
-
import { jsx } from '@emotion/react';
|
|
5
2
|
import { injectIntl } from 'react-intl-next';
|
|
6
3
|
import { MediaSingle as UIMediaSingle, WidthConsumer } from '@atlaskit/editor-common/ui';
|
|
7
4
|
import { akEditorFullWidthLayoutWidth, akEditorDefaultLayoutWidth, akEditorWideLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
@@ -153,7 +150,7 @@ const MediaSingle = props => {
|
|
|
153
150
|
featureFlags
|
|
154
151
|
});
|
|
155
152
|
const uiMediaSingleStyles = layout === 'full-width' || layout === 'wide' ? [uiMediaSingleBaseStyles, uiMediaSingleLayoutStyles] : [uiMediaSingleBaseStyles];
|
|
156
|
-
return
|
|
153
|
+
return /*#__PURE__*/React.createElement(UIMediaSingle, {
|
|
157
154
|
css: uiMediaSingleStyles,
|
|
158
155
|
handleMediaSingleRef: ref,
|
|
159
156
|
layout: layout,
|
|
@@ -166,9 +163,9 @@ const MediaSingle = props => {
|
|
|
166
163
|
widthType
|
|
167
164
|
},
|
|
168
165
|
fullWidthMode: isFullWidth
|
|
169
|
-
},
|
|
166
|
+
}, /*#__PURE__*/React.createElement(Fragment, null, mediaComponent), allowCaptions && caption);
|
|
170
167
|
};
|
|
171
|
-
return
|
|
168
|
+
return /*#__PURE__*/React.createElement(WidthConsumer, null, ({
|
|
172
169
|
width
|
|
173
170
|
}) => {
|
|
174
171
|
// Note: in SSR mode the `window` object is not defined,
|