@atlaskit/renderer 108.18.0 → 108.19.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 +11 -0
- package/afm-cc/tsconfig.json +109 -0
- package/dist/cjs/react/marks/alignment.js +3 -2
- package/dist/cjs/react/marks/breakout.js +3 -2
- package/dist/cjs/react/marks/link.js +4 -3
- package/dist/cjs/react/nodes/blockCard.js +13 -11
- package/dist/cjs/react/nodes/codeBlock/codeBlock.js +5 -2
- package/dist/cjs/react/nodes/codeBlock/components/codeBlockButtonContainer.js +6 -4
- package/dist/cjs/react/nodes/codeBlock/components/codeBlockContainer.js +3 -2
- package/dist/cjs/react/nodes/codeBlock/components/codeBlockCopyButton.js +11 -8
- package/dist/cjs/react/nodes/codeBlock/components/codeBlockWrapButton.js +11 -8
- package/dist/cjs/react/nodes/codeBlock/components/lightWeightCodeBlock.js +8 -7
- package/dist/cjs/react/nodes/codeBlock/windowedCodeBlock.js +6 -5
- package/dist/cjs/react/nodes/embedCard.js +9 -8
- package/dist/cjs/react/nodes/heading-anchor.js +5 -4
- package/dist/cjs/react/nodes/layoutColumn.js +3 -2
- package/dist/cjs/react/nodes/media/index.js +8 -7
- package/dist/cjs/react/nodes/mediaInline.js +26 -3
- package/dist/cjs/react/nodes/mediaSingle/index.js +6 -3
- package/dist/cjs/react/nodes/mediaSingle/styles.js +1 -0
- package/dist/cjs/react/nodes/panel.js +9 -7
- package/dist/cjs/react/nodes/table/sticky.js +7 -6
- package/dist/cjs/ui/Expand.js +18 -16
- package/dist/cjs/ui/Renderer/index.js +25 -24
- package/dist/cjs/ui/Renderer/truncated-wrapper.js +3 -2
- package/dist/cjs/ui/SortingIcon.js +5 -4
- package/dist/cjs/ui/annotations/draft/component.js +9 -8
- package/dist/cjs/ui/annotations/element/mark.js +2 -1
- package/dist/es2019/react/marks/alignment.js +4 -3
- package/dist/es2019/react/marks/breakout.js +4 -3
- package/dist/es2019/react/marks/link.js +5 -4
- package/dist/es2019/react/nodes/blockCard.js +13 -12
- package/dist/es2019/react/nodes/codeBlock/codeBlock.js +4 -2
- package/dist/es2019/react/nodes/codeBlock/components/codeBlockButtonContainer.js +6 -5
- package/dist/es2019/react/nodes/codeBlock/components/codeBlockContainer.js +4 -3
- package/dist/es2019/react/nodes/codeBlock/components/codeBlockCopyButton.js +7 -5
- package/dist/es2019/react/nodes/codeBlock/components/codeBlockWrapButton.js +9 -7
- package/dist/es2019/react/nodes/codeBlock/components/lightWeightCodeBlock.js +9 -8
- package/dist/es2019/react/nodes/codeBlock/windowedCodeBlock.js +6 -4
- package/dist/es2019/react/nodes/embedCard.js +10 -9
- package/dist/es2019/react/nodes/heading-anchor.js +6 -5
- package/dist/es2019/react/nodes/layoutColumn.js +4 -3
- package/dist/es2019/react/nodes/media/index.js +9 -6
- package/dist/es2019/react/nodes/mediaInline.js +25 -3
- package/dist/es2019/react/nodes/mediaSingle/index.js +6 -3
- package/dist/es2019/react/nodes/mediaSingle/styles.js +1 -0
- package/dist/es2019/react/nodes/panel.js +8 -7
- package/dist/es2019/react/nodes/table/sticky.js +8 -7
- package/dist/es2019/ui/Expand.js +17 -16
- package/dist/es2019/ui/Renderer/index.js +25 -23
- package/dist/es2019/ui/Renderer/truncated-wrapper.js +4 -3
- package/dist/es2019/ui/SortingIcon.js +6 -5
- package/dist/es2019/ui/annotations/draft/component.js +10 -9
- package/dist/es2019/ui/annotations/element/mark.js +3 -2
- package/dist/esm/react/marks/alignment.js +4 -3
- package/dist/esm/react/marks/breakout.js +4 -3
- package/dist/esm/react/marks/link.js +5 -4
- package/dist/esm/react/nodes/blockCard.js +13 -12
- package/dist/esm/react/nodes/codeBlock/codeBlock.js +4 -2
- package/dist/esm/react/nodes/codeBlock/components/codeBlockButtonContainer.js +6 -5
- package/dist/esm/react/nodes/codeBlock/components/codeBlockContainer.js +4 -3
- package/dist/esm/react/nodes/codeBlock/components/codeBlockCopyButton.js +7 -5
- package/dist/esm/react/nodes/codeBlock/components/codeBlockWrapButton.js +9 -7
- package/dist/esm/react/nodes/codeBlock/components/lightWeightCodeBlock.js +9 -8
- package/dist/esm/react/nodes/codeBlock/windowedCodeBlock.js +6 -4
- package/dist/esm/react/nodes/embedCard.js +10 -9
- package/dist/esm/react/nodes/heading-anchor.js +6 -5
- package/dist/esm/react/nodes/layoutColumn.js +4 -3
- package/dist/esm/react/nodes/media/index.js +9 -6
- package/dist/esm/react/nodes/mediaInline.js +26 -3
- package/dist/esm/react/nodes/mediaSingle/index.js +6 -3
- package/dist/esm/react/nodes/mediaSingle/styles.js +1 -0
- package/dist/esm/react/nodes/panel.js +8 -7
- package/dist/esm/react/nodes/table/sticky.js +8 -7
- package/dist/esm/ui/Expand.js +17 -16
- package/dist/esm/ui/Renderer/index.js +25 -23
- package/dist/esm/ui/Renderer/truncated-wrapper.js +4 -3
- package/dist/esm/ui/SortingIcon.js +6 -5
- package/dist/esm/ui/annotations/draft/component.js +10 -9
- package/dist/esm/ui/annotations/element/mark.js +3 -2
- package/dist/types/react/nodes/index.d.ts +1 -1
- package/dist/types/react/nodes/mediaInline.d.ts +4 -3
- package/dist/types-ts4.5/react/nodes/index.d.ts +1 -1
- package/dist/types-ts4.5/react/nodes/mediaInline.d.ts +4 -3
- package/package.json +2 -1
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
3
|
var _templateObject;
|
|
4
|
+
/** @jsx jsx */
|
|
4
5
|
import React from 'react';
|
|
5
|
-
import { css } from '@emotion/react';
|
|
6
|
+
import { css, jsx } from '@emotion/react';
|
|
6
7
|
import { alignmentPositionMap } from '@atlaskit/adf-schema';
|
|
7
8
|
var MarkWrapper = function MarkWrapper(props) {
|
|
8
9
|
var styles = props['data-align'] ? css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n text-align: ", ";\n "])), alignmentPositionMap[props['data-align']]) : '';
|
|
9
|
-
return
|
|
10
|
+
return jsx("div", _extends({
|
|
10
11
|
css: styles
|
|
11
12
|
}, props), props.children);
|
|
12
13
|
};
|
|
13
14
|
export default function Alignment(props) {
|
|
14
|
-
return
|
|
15
|
+
return jsx(MarkWrapper, {
|
|
15
16
|
className: "fabric-editor-block-mark fabric-editor-alignment",
|
|
16
17
|
"data-align": props.align
|
|
17
18
|
}, props.children);
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
var _templateObject;
|
|
3
|
-
|
|
3
|
+
/** @jsx jsx */
|
|
4
|
+
import { css, jsx } from '@emotion/react';
|
|
4
5
|
import { WidthConsumer } from '@atlaskit/editor-common/ui';
|
|
5
6
|
import { calcBreakoutWidth } from '@atlaskit/editor-common/utils';
|
|
6
7
|
import { blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
|
|
7
8
|
export var wrapperStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin: ", " 0;\n margin-left: 50%;\n transform: translateX(-50%);\n"])), blockNodesVerticalMargin);
|
|
8
9
|
export default function Breakout(props) {
|
|
9
|
-
return
|
|
10
|
+
return jsx(WidthConsumer, null, function (_ref) {
|
|
10
11
|
var width = _ref.width;
|
|
11
|
-
return
|
|
12
|
+
return jsx("div", {
|
|
12
13
|
css: wrapperStyles,
|
|
13
14
|
"data-mode": props.mode,
|
|
14
15
|
style: {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
3
|
var _templateObject;
|
|
4
|
+
/** @jsx jsx */
|
|
4
5
|
import React, { Fragment } from 'react';
|
|
5
|
-
import { css } from '@emotion/react';
|
|
6
|
+
import { css, jsx } from '@emotion/react';
|
|
6
7
|
import { B400, B300, B500 } from '@atlaskit/theme/colors';
|
|
7
8
|
import { getEventHandler } from '../../utils';
|
|
8
9
|
import { PLATFORM, MODE } from '../../analytics/events';
|
|
@@ -27,7 +28,7 @@ export default function Link(props) {
|
|
|
27
28
|
}
|
|
28
29
|
var handler = getEventHandler(eventHandlers, 'link');
|
|
29
30
|
if (isMediaLink) {
|
|
30
|
-
return
|
|
31
|
+
return jsx(Fragment, null, props.children);
|
|
31
32
|
}
|
|
32
33
|
var analyticsData = {
|
|
33
34
|
attributes: {
|
|
@@ -36,9 +37,9 @@ export default function Link(props) {
|
|
|
36
37
|
// Below is added for the future implementation of Linking Platform namespaced analytic context
|
|
37
38
|
location: 'renderer'
|
|
38
39
|
};
|
|
39
|
-
return
|
|
40
|
+
return jsx(AnalyticsContext, {
|
|
40
41
|
data: analyticsData
|
|
41
|
-
},
|
|
42
|
+
}, jsx(LinkUrl, _extends({
|
|
42
43
|
css: anchorStyles,
|
|
43
44
|
onClick: function onClick(e) {
|
|
44
45
|
if (fireAnalyticsEvent) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
/** @jsx jsx */
|
|
2
3
|
import { useMemo } from 'react';
|
|
3
|
-
import { css } from '@emotion/react';
|
|
4
|
+
import { css, jsx } from '@emotion/react';
|
|
4
5
|
import { Card } from '@atlaskit/smart-card';
|
|
5
6
|
import { UnsupportedBlock, UnsupportedInline, WidthConsumer } from '@atlaskit/editor-common/ui';
|
|
6
7
|
import { getPlatform } from '../../utils';
|
|
@@ -54,7 +55,7 @@ export default function BlockCard(props) {
|
|
|
54
55
|
};
|
|
55
56
|
if (props.datasource) {
|
|
56
57
|
if (platform === 'mobile') {
|
|
57
|
-
return
|
|
58
|
+
return jsx(InlineCard, props);
|
|
58
59
|
}
|
|
59
60
|
var views = props.datasource.views;
|
|
60
61
|
var tableView = views.find(function (view) {
|
|
@@ -77,18 +78,18 @@ export default function BlockCard(props) {
|
|
|
77
78
|
var columnCustomSizes = columnCustomSizesEntries !== null && columnCustomSizesEntries !== void 0 && columnCustomSizesEntries.length ? Object.fromEntries(columnCustomSizesEntries) : undefined;
|
|
78
79
|
var datasource = props.datasource,
|
|
79
80
|
layout = props.layout;
|
|
80
|
-
return
|
|
81
|
+
return jsx(AnalyticsContext, {
|
|
81
82
|
data: analyticsData
|
|
82
|
-
},
|
|
83
|
+
}, jsx(CardErrorBoundary, _extends({
|
|
83
84
|
unsupportedComponent: UnsupportedInline
|
|
84
|
-
}, cardProps),
|
|
85
|
+
}, cardProps), jsx(WidthConsumer, null, function (_ref5) {
|
|
85
86
|
var width = _ref5.width;
|
|
86
|
-
return
|
|
87
|
+
return jsx("div", {
|
|
87
88
|
css: datasourceContainerStyle,
|
|
88
89
|
style: {
|
|
89
90
|
width: calcBreakoutWidth(layout, width)
|
|
90
91
|
}
|
|
91
|
-
},
|
|
92
|
+
}, jsx(DatasourceTableView, {
|
|
92
93
|
datasourceId: datasource.id,
|
|
93
94
|
parameters: datasource.parameters,
|
|
94
95
|
visibleColumnKeys: visibleColumnKeys,
|
|
@@ -97,21 +98,21 @@ export default function BlockCard(props) {
|
|
|
97
98
|
}));
|
|
98
99
|
})));
|
|
99
100
|
}
|
|
100
|
-
return
|
|
101
|
+
return jsx(InlineCard, {
|
|
101
102
|
data: data,
|
|
102
103
|
url: url
|
|
103
104
|
});
|
|
104
105
|
}
|
|
105
|
-
return
|
|
106
|
+
return jsx(AnalyticsContext, {
|
|
106
107
|
data: analyticsData
|
|
107
|
-
},
|
|
108
|
+
}, jsx("div", {
|
|
108
109
|
className: "blockCardView-content-wrap",
|
|
109
110
|
"data-block-card": true,
|
|
110
111
|
"data-card-data": data ? JSON.stringify(data) : undefined,
|
|
111
112
|
"data-card-url": url
|
|
112
|
-
},
|
|
113
|
+
}, jsx(CardErrorBoundary, _extends({
|
|
113
114
|
unsupportedComponent: UnsupportedBlock
|
|
114
|
-
}, cardProps),
|
|
115
|
+
}, cardProps), jsx(Card, _extends({
|
|
115
116
|
appearance: "block",
|
|
116
117
|
showActions: rendererAppearance !== 'mobile',
|
|
117
118
|
platform: platform,
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
/** @jsx jsx */
|
|
2
3
|
import { useState } from 'react';
|
|
4
|
+
import { jsx } from '@emotion/react';
|
|
3
5
|
import { injectIntl } from 'react-intl-next';
|
|
4
6
|
import { CodeBlockSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
5
7
|
import { CodeBlock as AkCodeBlock } from '@atlaskit/code';
|
|
@@ -19,14 +21,14 @@ function CodeBlock(props) {
|
|
|
19
21
|
_useState2 = _slicedToArray(_useState, 2),
|
|
20
22
|
wrapLongLines = _useState2[0],
|
|
21
23
|
setWrapLongLines = _useState2[1];
|
|
22
|
-
return
|
|
24
|
+
return jsx(CodeBlockContainer, {
|
|
23
25
|
allowCopyToClipboard: allowCopyToClipboard,
|
|
24
26
|
allowWrapCodeBlock: allowWrapCodeBlock,
|
|
25
27
|
className: className,
|
|
26
28
|
setWrapLongLines: setWrapLongLines,
|
|
27
29
|
text: text,
|
|
28
30
|
wrapLongLines: wrapLongLines
|
|
29
|
-
},
|
|
31
|
+
}, jsx(AkCodeBlock, {
|
|
30
32
|
language: language,
|
|
31
33
|
text: text,
|
|
32
34
|
codeBidiWarningLabel: codeBidiWarningLabel,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx, css } from '@emotion/react';
|
|
2
3
|
import CopyButton from './codeBlockCopyButton';
|
|
3
4
|
import CodeWrapButton from './codeBlockWrapButton';
|
|
4
5
|
import { N0, N20, N30, N700 } from '@atlaskit/theme/colors';
|
|
@@ -44,14 +45,14 @@ var CodeBlockButtonContainer = function CodeBlockButtonContainer(_ref) {
|
|
|
44
45
|
setWrapLongLines = _ref.setWrapLongLines,
|
|
45
46
|
text = _ref.text,
|
|
46
47
|
wrapLongLines = _ref.wrapLongLines;
|
|
47
|
-
return
|
|
48
|
+
return jsx("div", {
|
|
48
49
|
css: codeBlockButtonsWrapper
|
|
49
|
-
},
|
|
50
|
+
}, jsx("div", {
|
|
50
51
|
css: codeBlockButtonsStyle
|
|
51
|
-
}, allowWrapCodeBlock &&
|
|
52
|
+
}, allowWrapCodeBlock && jsx(CodeWrapButton, {
|
|
52
53
|
setWrapLongLines: setWrapLongLines,
|
|
53
54
|
wrapLongLines: wrapLongLines
|
|
54
|
-
}), allowCopyToClipboard &&
|
|
55
|
+
}), allowCopyToClipboard && jsx(CopyButton, {
|
|
55
56
|
content: text
|
|
56
57
|
})));
|
|
57
58
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
var _templateObject;
|
|
3
|
-
|
|
3
|
+
/** @jsx jsx */
|
|
4
|
+
import { jsx, css } from '@emotion/react';
|
|
4
5
|
import { overflowShadow, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
5
6
|
import { N20, DN50 } from '@atlaskit/theme/colors';
|
|
6
7
|
import { themed } from '@atlaskit/theme/components';
|
|
@@ -27,10 +28,10 @@ var CodeBlockContainer = function CodeBlockContainer(_ref) {
|
|
|
27
28
|
setWrapLongLines = _ref.setWrapLongLines,
|
|
28
29
|
text = _ref.text,
|
|
29
30
|
wrapLongLines = _ref.wrapLongLines;
|
|
30
|
-
return
|
|
31
|
+
return jsx("div", {
|
|
31
32
|
className: className,
|
|
32
33
|
css: codeBlockStyleOverrides
|
|
33
|
-
},
|
|
34
|
+
}, jsx(CodeBlockButtonContainer, {
|
|
34
35
|
allowCopyToClipboard: allowCopyToClipboard,
|
|
35
36
|
allowWrapCodeBlock: allowWrapCodeBlock,
|
|
36
37
|
setWrapLongLines: setWrapLongLines,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
/** @jsx jsx */
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
2
4
|
import React, { useState } from 'react';
|
|
3
5
|
import { injectIntl } from 'react-intl-next';
|
|
4
6
|
import Tooltip from '@atlaskit/tooltip';
|
|
@@ -23,20 +25,20 @@ var CopyButton = function CopyButton(_ref) {
|
|
|
23
25
|
setTooltip(intl.formatMessage(codeBlockButtonMessages.copyCodeToClipboard));
|
|
24
26
|
setClassName('copy-to-clipboard');
|
|
25
27
|
};
|
|
26
|
-
return
|
|
28
|
+
return jsx(AnalyticsContext.Consumer, null, function (_ref2) {
|
|
27
29
|
var fireAnalyticsEvent = _ref2.fireAnalyticsEvent;
|
|
28
|
-
return
|
|
30
|
+
return jsx("span", null, jsx(Tooltip, {
|
|
29
31
|
content: tooltip,
|
|
30
32
|
hideTooltipOnClick: false,
|
|
31
33
|
position: "top"
|
|
32
|
-
},
|
|
34
|
+
}, jsx("div", {
|
|
33
35
|
onMouseLeave: onMouseLeave
|
|
34
|
-
},
|
|
36
|
+
}, jsx(Button, {
|
|
35
37
|
appearance: "subtle",
|
|
36
38
|
"aria-haspopup": true,
|
|
37
39
|
"aria-label": tooltip,
|
|
38
40
|
className: className,
|
|
39
|
-
iconBefore:
|
|
41
|
+
iconBefore: jsx(CopyIcon, {
|
|
40
42
|
label: tooltip
|
|
41
43
|
}),
|
|
42
44
|
onClick: function onClick(event) {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
1
3
|
import React from 'react';
|
|
2
4
|
import { injectIntl } from 'react-intl-next';
|
|
3
5
|
import Tooltip from '@atlaskit/tooltip';
|
|
@@ -7,15 +9,15 @@ import { codeBlockButtonMessages } from '@atlaskit/editor-common/messages';
|
|
|
7
9
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../../../../analytics/enums';
|
|
8
10
|
import AnalyticsContext from '../../../../analytics/analyticsContext';
|
|
9
11
|
var WrapIcon = function WrapIcon() {
|
|
10
|
-
return
|
|
12
|
+
return jsx("svg", {
|
|
11
13
|
width: "24",
|
|
12
14
|
height: "24",
|
|
13
15
|
fill: "none",
|
|
14
16
|
viewBox: "0 0 24 24"
|
|
15
|
-
},
|
|
17
|
+
}, jsx("g", {
|
|
16
18
|
fill: "currentColor",
|
|
17
19
|
clipPath: "url(#clip0_654_431)"
|
|
18
|
-
},
|
|
20
|
+
}, jsx("path", {
|
|
19
21
|
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",
|
|
20
22
|
clipRule: "evenodd",
|
|
21
23
|
fillRule: "evenodd"
|
|
@@ -26,18 +28,18 @@ var CodeBlockWrapButton = function CodeBlockWrapButton(_ref) {
|
|
|
26
28
|
wrapLongLines = _ref.wrapLongLines,
|
|
27
29
|
intl = _ref.intl;
|
|
28
30
|
var wrapMessage = intl.formatMessage(wrapLongLines ? codeBlockButtonMessages.unwrapCode : codeBlockButtonMessages.wrapCode);
|
|
29
|
-
return
|
|
31
|
+
return jsx(AnalyticsContext.Consumer, null, function (_ref2) {
|
|
30
32
|
var fireAnalyticsEvent = _ref2.fireAnalyticsEvent;
|
|
31
|
-
return
|
|
33
|
+
return jsx("span", null, jsx(Tooltip, {
|
|
32
34
|
content: wrapMessage,
|
|
33
35
|
hideTooltipOnClick: false,
|
|
34
36
|
position: "top"
|
|
35
|
-
},
|
|
37
|
+
}, jsx(Button, {
|
|
36
38
|
appearance: "subtle",
|
|
37
39
|
"aria-haspopup": true,
|
|
38
40
|
"aria-label": wrapMessage,
|
|
39
41
|
className: "wrap-code ".concat(wrapLongLines ? 'clicked' : ''),
|
|
40
|
-
iconBefore:
|
|
42
|
+
iconBefore: jsx(Icon, {
|
|
41
43
|
glyph: WrapIcon,
|
|
42
44
|
label: ""
|
|
43
45
|
}),
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
var _templateObject, _templateObject2;
|
|
3
|
+
/** @jsx jsx */
|
|
3
4
|
import React, { forwardRef, useMemo } from 'react';
|
|
4
|
-
import { css, useTheme } from '@emotion/react';
|
|
5
|
+
import { css, jsx, useTheme } from '@emotion/react';
|
|
5
6
|
import { blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
|
|
6
7
|
import { codeBlockSharedStyles, CodeBlockSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
7
8
|
import { useBidiWarnings } from '../../../hooks/use-bidi-warnings';
|
|
@@ -33,22 +34,22 @@ var LightWeightCodeBlock = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
33
34
|
}),
|
|
34
35
|
renderBidiWarnings = _useBidiWarnings.renderBidiWarnings;
|
|
35
36
|
var classNames = [LightWeightCodeBlockCssClassName.CONTAINER, className].join(' ');
|
|
36
|
-
return
|
|
37
|
+
return jsx("div", {
|
|
37
38
|
className: classNames,
|
|
38
39
|
ref: ref,
|
|
39
40
|
css: [codeBlockSharedStyles(theme), lightWeightCodeBlockStyles]
|
|
40
|
-
},
|
|
41
|
+
}, jsx("div", {
|
|
41
42
|
className: CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER
|
|
42
|
-
},
|
|
43
|
+
}, jsx("div", {
|
|
43
44
|
className: CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER
|
|
44
|
-
},
|
|
45
|
+
}, jsx("div", {
|
|
45
46
|
className: CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER
|
|
46
47
|
}, textRows.map(function (_, index) {
|
|
47
|
-
return
|
|
48
|
+
return jsx("span", {
|
|
48
49
|
key: index
|
|
49
50
|
});
|
|
50
|
-
})),
|
|
51
|
+
})), jsx("div", {
|
|
51
52
|
className: CodeBlockSharedCssClassName.CODEBLOCK_CONTENT
|
|
52
|
-
},
|
|
53
|
+
}, jsx("code", null, renderBidiWarnings(text))))));
|
|
53
54
|
});
|
|
54
55
|
export default LightWeightCodeBlock;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
|
+
/** @jsx jsx */
|
|
4
5
|
import { Fragment, lazy, memo, Suspense, useState } from 'react';
|
|
6
|
+
import { jsx } from '@emotion/react';
|
|
5
7
|
import { CodeBlockSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
6
8
|
import { useInViewport } from '../../hooks/use-in-viewport';
|
|
7
9
|
import { useBidiWarnings } from '../../hooks/use-bidi-warnings';
|
|
@@ -42,7 +44,7 @@ var WindowedCodeBlock = function WindowedCodeBlock(_ref2) {
|
|
|
42
44
|
isInViewport = _useInViewport.isInViewport,
|
|
43
45
|
trackingRef = _useInViewport.trackingRef;
|
|
44
46
|
var className = joinWithSpaces(CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER, rootClassName);
|
|
45
|
-
var memoizedLightWeightCodeBlock =
|
|
47
|
+
var memoizedLightWeightCodeBlock = jsx(MemoizedLightWeightCodeBlock, {
|
|
46
48
|
ref: trackingRef,
|
|
47
49
|
text: text,
|
|
48
50
|
codeBidiWarningTooltipEnabled: codeBidiWarningTooltipEnabled,
|
|
@@ -52,16 +54,16 @@ var WindowedCodeBlock = function WindowedCodeBlock(_ref2) {
|
|
|
52
54
|
_useState2 = _slicedToArray(_useState, 2),
|
|
53
55
|
wrapLongLines = _useState2[0],
|
|
54
56
|
setWrapLongLines = _useState2[1];
|
|
55
|
-
return isInViewport ?
|
|
57
|
+
return isInViewport ? jsx(Fragment, null, jsx(Suspense, {
|
|
56
58
|
fallback: memoizedLightWeightCodeBlock
|
|
57
|
-
},
|
|
59
|
+
}, jsx(CodeBlockContainer, {
|
|
58
60
|
allowCopyToClipboard: allowCopyToClipboard,
|
|
59
61
|
allowWrapCodeBlock: allowWrapCodeBlock,
|
|
60
62
|
className: className,
|
|
61
63
|
setWrapLongLines: setWrapLongLines,
|
|
62
64
|
text: text,
|
|
63
65
|
wrapLongLines: wrapLongLines
|
|
64
|
-
},
|
|
66
|
+
}, jsx(LazyAkCodeBlock, {
|
|
65
67
|
language: language,
|
|
66
68
|
text: text,
|
|
67
69
|
codeBidiWarningLabel: warningLabel,
|
|
@@ -2,7 +2,8 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
4
4
|
var _templateObject, _templateObject2;
|
|
5
|
-
|
|
5
|
+
/** @jsx jsx */
|
|
6
|
+
import { css, jsx } from '@emotion/react';
|
|
6
7
|
import { useMemo, useContext, useState, useRef } from 'react';
|
|
7
8
|
import { Card, EmbedResizeMessageListener } from '@atlaskit/smart-card';
|
|
8
9
|
import { SmartCardContext } from '@atlaskit/link-provider';
|
|
@@ -92,9 +93,9 @@ export default function EmbedCard(props) {
|
|
|
92
93
|
// Below is added for the future implementation of Linking Platform namespaced analytic context
|
|
93
94
|
location: 'renderer'
|
|
94
95
|
};
|
|
95
|
-
return
|
|
96
|
+
return jsx(AnalyticsContext, {
|
|
96
97
|
data: analyticsData
|
|
97
|
-
},
|
|
98
|
+
}, jsx(WidthConsumer, null, function (_ref2) {
|
|
98
99
|
var documentWidth = _ref2.width;
|
|
99
100
|
var isFullWidth = rendererAppearance === 'full-width';
|
|
100
101
|
var containerWidth = documentWidth;
|
|
@@ -119,12 +120,12 @@ export default function EmbedCard(props) {
|
|
|
119
120
|
throw err;
|
|
120
121
|
}
|
|
121
122
|
};
|
|
122
|
-
return
|
|
123
|
+
return jsx(CardErrorBoundary, _extends({
|
|
123
124
|
unsupportedComponent: UnsupportedBlock
|
|
124
|
-
}, cardProps),
|
|
125
|
+
}, cardProps), jsx(EmbedResizeMessageListener, {
|
|
125
126
|
embedIframeRef: embedIframeRef,
|
|
126
127
|
onHeightUpdate: setLiveHeight
|
|
127
|
-
},
|
|
128
|
+
}, jsx(UIMediaSingle, {
|
|
128
129
|
css: uiMediaSingleStyles,
|
|
129
130
|
layout: layout,
|
|
130
131
|
width: originalWidth,
|
|
@@ -135,9 +136,9 @@ export default function EmbedCard(props) {
|
|
|
135
136
|
nodeType: "embedCard",
|
|
136
137
|
lineLength: isInsideOfBlockNode ? containerWidth : lineLength,
|
|
137
138
|
hasFallbackContainer: hasPreview
|
|
138
|
-
},
|
|
139
|
+
}, jsx("div", {
|
|
139
140
|
css: embedCardWrapperStyles
|
|
140
|
-
},
|
|
141
|
+
}, jsx("div", {
|
|
141
142
|
className: "embedCardView-content-wrap",
|
|
142
143
|
"data-embed-card": true,
|
|
143
144
|
"data-layout": layout,
|
|
@@ -145,7 +146,7 @@ export default function EmbedCard(props) {
|
|
|
145
146
|
"data-card-data": data ? JSON.stringify(data) : undefined,
|
|
146
147
|
"data-card-url": url,
|
|
147
148
|
"data-card-original-height": originalHeight
|
|
148
|
-
},
|
|
149
|
+
}, jsx(Card, _extends({
|
|
149
150
|
appearance: "embed"
|
|
150
151
|
}, cardProps, {
|
|
151
152
|
onResolve: onResolve,
|
|
@@ -14,8 +14,9 @@ var _excluded = ["children"];
|
|
|
14
14
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
15
15
|
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); }; }
|
|
16
16
|
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; } }
|
|
17
|
+
/** @jsx jsx */
|
|
17
18
|
import React from 'react';
|
|
18
|
-
import { css } from '@emotion/react';
|
|
19
|
+
import { css, jsx } from '@emotion/react';
|
|
19
20
|
import { N200, N500, B400 } from '@atlaskit/theme/colors';
|
|
20
21
|
import LinkIcon from '@atlaskit/icon/glyph/link';
|
|
21
22
|
import Tooltip from '@atlaskit/tooltip';
|
|
@@ -25,7 +26,7 @@ export var HeadingAnchorWrapperClassName = 'heading-anchor-wrapper';
|
|
|
25
26
|
var CopyAnchorWrapperWithRef = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
26
27
|
var children = props.children,
|
|
27
28
|
rest = _objectWithoutProperties(props, _excluded);
|
|
28
|
-
return
|
|
29
|
+
return jsx("span", _extends({}, rest, {
|
|
29
30
|
className: HeadingAnchorWrapperClassName,
|
|
30
31
|
ref: ref
|
|
31
32
|
}), children);
|
|
@@ -90,12 +91,12 @@ var HeadingAnchor = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
90
91
|
_this.setTooltipState(headingAnchorLinkMessages.copyHeadingLinkToClipboard);
|
|
91
92
|
});
|
|
92
93
|
_defineProperty(_assertThisInitialized(_this), "renderAnchorButton", function () {
|
|
93
|
-
return
|
|
94
|
+
return jsx("button", {
|
|
94
95
|
css: copyAnchorButtonStyles,
|
|
95
96
|
onMouseLeave: _this.resetMessage,
|
|
96
97
|
onClick: _this.copyToClipboard,
|
|
97
98
|
"aria-label": _this.state.tooltipMessage
|
|
98
|
-
},
|
|
99
|
+
}, jsx(LinkIcon, {
|
|
99
100
|
label: _this.getCopyAriaLabel(),
|
|
100
101
|
size: _this.props.level > 3 ? 'small' : 'medium',
|
|
101
102
|
primaryColor: _this.state.isClicked ? "var(--ds-icon-selected, ".concat(B400, ")") : "var(--ds-icon-subtle, ".concat(N200, ")")
|
|
@@ -116,7 +117,7 @@ var HeadingAnchor = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
116
117
|
// We set the key to the message to ensure it remounts when the message
|
|
117
118
|
// changes, so that it correctly repositions.
|
|
118
119
|
// @see https://ecosystem.atlassian.net/projects/AK/queues/issue/AK-6548
|
|
119
|
-
return
|
|
120
|
+
return jsx(Tooltip, {
|
|
120
121
|
tag: CopyAnchorWrapperWithRef,
|
|
121
122
|
content: tooltipMessage,
|
|
122
123
|
position: "top",
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
var _templateObject;
|
|
3
|
+
/** @jsx jsx */
|
|
3
4
|
import React from 'react';
|
|
4
|
-
import { css } from '@emotion/react';
|
|
5
|
+
import { jsx, css } from '@emotion/react';
|
|
5
6
|
import { WidthProvider, clearNextSiblingMarginTopStyle, clearNextSiblingBlockMarkMarginTopStyle } from '@atlaskit/editor-common/ui';
|
|
6
7
|
var layoutColumnClearMarginTopStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n ", "\n"])), clearNextSiblingMarginTopStyle, clearNextSiblingBlockMarkMarginTopStyle);
|
|
7
8
|
export default function LayoutSection(props) {
|
|
8
|
-
return
|
|
9
|
+
return jsx("div", {
|
|
9
10
|
"data-layout-column": true,
|
|
10
11
|
"data-column-width": props.width,
|
|
11
12
|
style: {
|
|
12
13
|
flexBasis: "".concat(props.width, "%")
|
|
13
14
|
}
|
|
14
|
-
},
|
|
15
|
+
}, jsx(WidthProvider, null, jsx("div", {
|
|
15
16
|
css: layoutColumnClearMarginTopStyles
|
|
16
17
|
}), props.children));
|
|
17
18
|
}
|
|
@@ -8,7 +8,10 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
9
|
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); }; }
|
|
10
10
|
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; } }
|
|
11
|
+
/** @jsx jsx */
|
|
12
|
+
|
|
11
13
|
import React, { PureComponent } from 'react';
|
|
14
|
+
import { jsx } from '@emotion/react';
|
|
12
15
|
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
13
16
|
import { MEDIA_CONTEXT } from '@atlaskit/analytics-namespaced-context';
|
|
14
17
|
import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
@@ -47,11 +50,11 @@ var Media = /*#__PURE__*/function (_PureComponent) {
|
|
|
47
50
|
var linkHref = linkMark === null || linkMark === void 0 ? void 0 : linkMark.attrs.href;
|
|
48
51
|
var eventHandlers = linkHref ? undefined : _this.props.eventHandlers;
|
|
49
52
|
var shouldOpenMediaViewer = !linkHref && allowMediaViewer;
|
|
50
|
-
var mediaComponent =
|
|
53
|
+
var mediaComponent = jsx(AnalyticsContext, {
|
|
51
54
|
data: _defineProperty({}, MEDIA_CONTEXT, {
|
|
52
55
|
border: !!borderMark
|
|
53
56
|
})
|
|
54
|
-
},
|
|
57
|
+
}, jsx(MediaCard, _extends({
|
|
55
58
|
contextIdentifierProvider: contextIdentifierProvider
|
|
56
59
|
}, _this.props, {
|
|
57
60
|
shouldOpenMediaViewer: shouldOpenMediaViewer,
|
|
@@ -62,15 +65,15 @@ var Media = /*#__PURE__*/function (_PureComponent) {
|
|
|
62
65
|
ssr: ssr
|
|
63
66
|
})));
|
|
64
67
|
var paletteColorValue = hexToEditorBorderPaletteColor(borderColor) || borderColor;
|
|
65
|
-
var mediaComponentWithBorder = borderMark ?
|
|
68
|
+
var mediaComponentWithBorder = borderMark ? jsx("div", {
|
|
66
69
|
"data-mark-type": "border",
|
|
67
70
|
"data-color": borderColor,
|
|
68
71
|
"data-size": borderWidth,
|
|
69
72
|
css: borderStyle(paletteColorValue, borderWidth)
|
|
70
|
-
},
|
|
73
|
+
}, jsx(MediaBorderGapFiller, {
|
|
71
74
|
borderColor: borderColor
|
|
72
75
|
}), mediaComponent) : mediaComponent;
|
|
73
|
-
return linkHref ?
|
|
76
|
+
return linkHref ? jsx("a", {
|
|
74
77
|
href: linkHref,
|
|
75
78
|
rel: "noreferrer noopener",
|
|
76
79
|
onClick: _this.handleMediaLinkClick,
|
|
@@ -112,7 +115,7 @@ var Media = /*#__PURE__*/function (_PureComponent) {
|
|
|
112
115
|
if (!providers) {
|
|
113
116
|
return this.renderCard();
|
|
114
117
|
}
|
|
115
|
-
return
|
|
118
|
+
return jsx(WithProviders, {
|
|
116
119
|
providers: ['mediaProvider', 'contextIdentifierProvider'],
|
|
117
120
|
providerFactory: providers,
|
|
118
121
|
renderNode: this.renderCard
|
|
@@ -12,6 +12,7 @@ import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
|
12
12
|
import { MediaClientContext } from '@atlaskit/media-client-react';
|
|
13
13
|
import { getClipboardAttrs, mediaIdentifierMap } from '../../ui/MediaCard';
|
|
14
14
|
import { createIntl, injectIntl } from 'react-intl-next';
|
|
15
|
+
import { shouldShowInlineImage, MediaInlineImageCard } from '@atlaskit/editor-common/media-inline';
|
|
15
16
|
export var RenderMediaInline = function RenderMediaInline(_ref) {
|
|
16
17
|
var rendererAppearance = _ref.rendererAppearance,
|
|
17
18
|
intl = _ref.intl,
|
|
@@ -19,7 +20,12 @@ export var RenderMediaInline = function RenderMediaInline(_ref) {
|
|
|
19
20
|
mediaInlineProviders = _ref.mediaInlineProviders,
|
|
20
21
|
collectionName = _ref.collection,
|
|
21
22
|
eventHandlers = _ref.eventHandlers,
|
|
22
|
-
identifier = _ref.identifier
|
|
23
|
+
identifier = _ref.identifier,
|
|
24
|
+
alt = _ref.alt,
|
|
25
|
+
width = _ref.width,
|
|
26
|
+
height = _ref.height,
|
|
27
|
+
_ref$type = _ref.type,
|
|
28
|
+
type = _ref$type === void 0 ? '' : _ref$type;
|
|
23
29
|
var _useState = useState(),
|
|
24
30
|
_useState2 = _slicedToArray(_useState, 2),
|
|
25
31
|
contextIdentifierProvider = _useState2[0],
|
|
@@ -130,6 +136,15 @@ export var RenderMediaInline = function RenderMediaInline(_ref) {
|
|
|
130
136
|
var mediaProvider = mediaInlineProviders.mediaProvider;
|
|
131
137
|
var id = clipboardAttrs.id,
|
|
132
138
|
collection = clipboardAttrs.collection;
|
|
139
|
+
if (shouldShowInlineImage(type)) {
|
|
140
|
+
return /*#__PURE__*/React.createElement(MediaInlineImageCard, {
|
|
141
|
+
mediaClient: mediaClient,
|
|
142
|
+
identifier: identifier,
|
|
143
|
+
alt: alt,
|
|
144
|
+
width: width,
|
|
145
|
+
height: height
|
|
146
|
+
});
|
|
147
|
+
}
|
|
133
148
|
return /*#__PURE__*/React.createElement("span", _extends({}, getClipboardAttrs({
|
|
134
149
|
id: id,
|
|
135
150
|
collection: collection,
|
|
@@ -156,7 +171,11 @@ var MediaInline = function MediaInline(props) {
|
|
|
156
171
|
providerFactory = props.providers,
|
|
157
172
|
intl = props.intl,
|
|
158
173
|
rendererAppearance = props.rendererAppearance,
|
|
159
|
-
featureFlags = props.featureFlags
|
|
174
|
+
featureFlags = props.featureFlags,
|
|
175
|
+
fileType = props.type,
|
|
176
|
+
alt = props.alt,
|
|
177
|
+
width = props.width,
|
|
178
|
+
height = props.height;
|
|
160
179
|
var clipboardAttrs = {
|
|
161
180
|
id: id,
|
|
162
181
|
collection: collection
|
|
@@ -178,7 +197,11 @@ var MediaInline = function MediaInline(props) {
|
|
|
178
197
|
intl: intl,
|
|
179
198
|
mediaInlineProviders: mediaInlineProviders,
|
|
180
199
|
collection: collection,
|
|
181
|
-
featureFlags: featureFlags
|
|
200
|
+
featureFlags: featureFlags,
|
|
201
|
+
type: fileType,
|
|
202
|
+
alt: alt,
|
|
203
|
+
width: width,
|
|
204
|
+
height: height
|
|
182
205
|
});
|
|
183
206
|
}
|
|
184
207
|
});
|