@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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 108.19.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#58884](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/58884) [`a149612dc46d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a149612dc46d) - [ux] Added support for Media Inline Image Card in Editor and Renderer
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- [#59147](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/59147) [`f12e489f23b0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f12e489f23b0) - Re-build and deploy packages to NPM to resolve React/Compiled not found error (HOT-106483).
|
|
12
|
+
- [#58527](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/58527) [`900c6892df7e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/900c6892df7e) - Small fix on Renderer example page
|
|
13
|
+
|
|
3
14
|
## 108.18.0
|
|
4
15
|
|
|
5
16
|
### Minor Changes
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../../../tsconfig.entry-points.confluence.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"declaration": true,
|
|
5
|
+
"target": "es5",
|
|
6
|
+
"composite": true,
|
|
7
|
+
"outDir": "../dist",
|
|
8
|
+
"rootDir": "../",
|
|
9
|
+
"baseUrl": "../"
|
|
10
|
+
},
|
|
11
|
+
"include": [
|
|
12
|
+
"../src/**/*.ts",
|
|
13
|
+
"../src/**/*.tsx"
|
|
14
|
+
],
|
|
15
|
+
"exclude": [
|
|
16
|
+
"../src/**/__tests__/*",
|
|
17
|
+
"../src/**/*.test.*",
|
|
18
|
+
"../src/**/test.*"
|
|
19
|
+
],
|
|
20
|
+
"references": [
|
|
21
|
+
{
|
|
22
|
+
"path": "../../adf-utils/afm-cc/tsconfig.json"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"path": "../../../analytics/analytics-listeners/afm-cc/tsconfig.json"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"path": "../../../analytics/analytics-namespaced-context/afm-cc/tsconfig.json"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"path": "../../../analytics/analytics-next/afm-cc/tsconfig.json"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"path": "../../../design-system/button/afm-cc/tsconfig.json"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"path": "../../../design-system/code/afm-cc/tsconfig.json"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"path": "../../editor-common/afm-cc/tsconfig.json"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"path": "../../editor-json-transformer/afm-cc/tsconfig.json"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"path": "../../editor-palette/afm-cc/tsconfig.json"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"path": "../../editor-shared-styles/afm-cc/tsconfig.json"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"path": "../../../elements/emoji/afm-cc/tsconfig.json"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"path": "../../../design-system/icon/afm-cc/tsconfig.json"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"path": "../../../linking-platform/link-datasource/afm-cc/tsconfig.json"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"path": "../../../media/media-card/afm-cc/tsconfig.json"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"path": "../../../media/media-client/afm-cc/tsconfig.json"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"path": "../../../media/media-client-react/afm-cc/tsconfig.json"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"path": "../../../media/media-common/afm-cc/tsconfig.json"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"path": "../../../media/media-filmstrip/afm-cc/tsconfig.json"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"path": "../../../media/media-ui/afm-cc/tsconfig.json"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"path": "../../../media/media-viewer/afm-cc/tsconfig.json"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"path": "../../../platform/feature-flags/afm-cc/tsconfig.json"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"path": "../../../linking-platform/smart-card/afm-cc/tsconfig.json"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"path": "../../../elements/status/afm-cc/tsconfig.json"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"path": "../../../elements/task-decision/afm-cc/tsconfig.json"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"path": "../../../design-system/theme/afm-cc/tsconfig.json"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"path": "../../../design-system/tokens/afm-cc/tsconfig.json"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"path": "../../../design-system/tooltip/afm-cc/tsconfig.json"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"path": "../../../linking-platform/link-provider/afm-cc/tsconfig.json"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"path": "../../../media/media-core/afm-cc/tsconfig.json"
|
|
107
|
+
}
|
|
108
|
+
]
|
|
109
|
+
}
|
|
@@ -11,14 +11,15 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
11
11
|
var _react2 = require("@emotion/react");
|
|
12
12
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
13
13
|
var _templateObject;
|
|
14
|
+
/** @jsx jsx */
|
|
14
15
|
var MarkWrapper = function MarkWrapper(props) {
|
|
15
16
|
var styles = props['data-align'] ? (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n text-align: ", ";\n "])), _adfSchema.alignmentPositionMap[props['data-align']]) : '';
|
|
16
|
-
return
|
|
17
|
+
return (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
17
18
|
css: styles
|
|
18
19
|
}, props), props.children);
|
|
19
20
|
};
|
|
20
21
|
function Alignment(props) {
|
|
21
|
-
return
|
|
22
|
+
return (0, _react2.jsx)(MarkWrapper, {
|
|
22
23
|
className: "fabric-editor-block-mark fabric-editor-alignment",
|
|
23
24
|
"data-align": props.align
|
|
24
25
|
}, props.children);
|
|
@@ -12,11 +12,12 @@ var _ui = require("@atlaskit/editor-common/ui");
|
|
|
12
12
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
13
13
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
14
14
|
var _templateObject;
|
|
15
|
+
/** @jsx jsx */
|
|
15
16
|
var wrapperStyles = exports.wrapperStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n margin: ", " 0;\n margin-left: 50%;\n transform: translateX(-50%);\n"])), _editorSharedStyles.blockNodesVerticalMargin);
|
|
16
17
|
function Breakout(props) {
|
|
17
|
-
return
|
|
18
|
+
return (0, _react.jsx)(_ui.WidthConsumer, null, function (_ref) {
|
|
18
19
|
var width = _ref.width;
|
|
19
|
-
return
|
|
20
|
+
return (0, _react.jsx)("div", {
|
|
20
21
|
css: wrapperStyles,
|
|
21
22
|
"data-mode": props.mode,
|
|
22
23
|
style: {
|
|
@@ -17,6 +17,7 @@ var _analytics = require("@atlaskit/editor-common/analytics");
|
|
|
17
17
|
var _linkUrl = _interopRequireDefault(require("@atlaskit/smart-card/link-url"));
|
|
18
18
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
19
19
|
var _templateObject;
|
|
20
|
+
/** @jsx jsx */
|
|
20
21
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
22
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
22
23
|
var anchorStyles = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n\n &:hover {\n color: ", ";\n text-decoration: underline;\n }\n\n &:active {\n color: ", ";\n }\n"])), "var(--ds-link, ".concat(_colors.B400, ")"), "var(--ds-link, ".concat(_colors.B300, ")"), "var(--ds-link-pressed, ".concat(_colors.B500, ")"));
|
|
@@ -37,7 +38,7 @@ function Link(props) {
|
|
|
37
38
|
}
|
|
38
39
|
var handler = (0, _utils.getEventHandler)(eventHandlers, 'link');
|
|
39
40
|
if (isMediaLink) {
|
|
40
|
-
return
|
|
41
|
+
return (0, _react2.jsx)(_react.Fragment, null, props.children);
|
|
41
42
|
}
|
|
42
43
|
var analyticsData = {
|
|
43
44
|
attributes: {
|
|
@@ -46,9 +47,9 @@ function Link(props) {
|
|
|
46
47
|
// Below is added for the future implementation of Linking Platform namespaced analytic context
|
|
47
48
|
location: 'renderer'
|
|
48
49
|
};
|
|
49
|
-
return
|
|
50
|
+
return (0, _react2.jsx)(_analyticsNext.AnalyticsContext, {
|
|
50
51
|
data: analyticsData
|
|
51
|
-
},
|
|
52
|
+
}, (0, _react2.jsx)(_linkUrl.default, (0, _extends2.default)({
|
|
52
53
|
css: anchorStyles,
|
|
53
54
|
onClick: function onClick(e) {
|
|
54
55
|
if (fireAnalyticsEvent) {
|
|
@@ -18,6 +18,8 @@ var _analyticsNext = require("@atlaskit/analytics-next");
|
|
|
18
18
|
var _linkDatasource = require("@atlaskit/link-datasource");
|
|
19
19
|
var _colors = require("@atlaskit/theme/colors");
|
|
20
20
|
var _utils2 = require("@atlaskit/editor-common/utils");
|
|
21
|
+
/** @jsx jsx */
|
|
22
|
+
|
|
21
23
|
// Temporary, until we add aspect ratio to the datasource table
|
|
22
24
|
var datasourceContainerStyle = (0, _react2.css)({
|
|
23
25
|
borderRadius: "var(--ds-border-radius-200, 8px)",
|
|
@@ -60,7 +62,7 @@ function BlockCard(props) {
|
|
|
60
62
|
};
|
|
61
63
|
if (props.datasource) {
|
|
62
64
|
if (platform === 'mobile') {
|
|
63
|
-
return
|
|
65
|
+
return (0, _react2.jsx)(_inlineCard.default, props);
|
|
64
66
|
}
|
|
65
67
|
var views = props.datasource.views;
|
|
66
68
|
var tableView = views.find(function (view) {
|
|
@@ -83,18 +85,18 @@ function BlockCard(props) {
|
|
|
83
85
|
var columnCustomSizes = columnCustomSizesEntries !== null && columnCustomSizesEntries !== void 0 && columnCustomSizesEntries.length ? Object.fromEntries(columnCustomSizesEntries) : undefined;
|
|
84
86
|
var datasource = props.datasource,
|
|
85
87
|
layout = props.layout;
|
|
86
|
-
return
|
|
88
|
+
return (0, _react2.jsx)(_analyticsNext.AnalyticsContext, {
|
|
87
89
|
data: analyticsData
|
|
88
|
-
},
|
|
90
|
+
}, (0, _react2.jsx)(_fallback.CardErrorBoundary, (0, _extends2.default)({
|
|
89
91
|
unsupportedComponent: _ui.UnsupportedInline
|
|
90
|
-
}, cardProps),
|
|
92
|
+
}, cardProps), (0, _react2.jsx)(_ui.WidthConsumer, null, function (_ref5) {
|
|
91
93
|
var width = _ref5.width;
|
|
92
|
-
return
|
|
94
|
+
return (0, _react2.jsx)("div", {
|
|
93
95
|
css: datasourceContainerStyle,
|
|
94
96
|
style: {
|
|
95
97
|
width: (0, _utils2.calcBreakoutWidth)(layout, width)
|
|
96
98
|
}
|
|
97
|
-
},
|
|
99
|
+
}, (0, _react2.jsx)(_linkDatasource.DatasourceTableView, {
|
|
98
100
|
datasourceId: datasource.id,
|
|
99
101
|
parameters: datasource.parameters,
|
|
100
102
|
visibleColumnKeys: visibleColumnKeys,
|
|
@@ -103,21 +105,21 @@ function BlockCard(props) {
|
|
|
103
105
|
}));
|
|
104
106
|
})));
|
|
105
107
|
}
|
|
106
|
-
return
|
|
108
|
+
return (0, _react2.jsx)(_inlineCard.default, {
|
|
107
109
|
data: data,
|
|
108
110
|
url: url
|
|
109
111
|
});
|
|
110
112
|
}
|
|
111
|
-
return
|
|
113
|
+
return (0, _react2.jsx)(_analyticsNext.AnalyticsContext, {
|
|
112
114
|
data: analyticsData
|
|
113
|
-
},
|
|
115
|
+
}, (0, _react2.jsx)("div", {
|
|
114
116
|
className: "blockCardView-content-wrap",
|
|
115
117
|
"data-block-card": true,
|
|
116
118
|
"data-card-data": data ? JSON.stringify(data) : undefined,
|
|
117
119
|
"data-card-url": url
|
|
118
|
-
},
|
|
120
|
+
}, (0, _react2.jsx)(_fallback.CardErrorBoundary, (0, _extends2.default)({
|
|
119
121
|
unsupportedComponent: _ui.UnsupportedBlock
|
|
120
|
-
}, cardProps),
|
|
122
|
+
}, cardProps), (0, _react2.jsx)(_smartCard.Card, (0, _extends2.default)({
|
|
121
123
|
appearance: "block",
|
|
122
124
|
showActions: rendererAppearance !== 'mobile',
|
|
123
125
|
platform: platform,
|
|
@@ -7,11 +7,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
9
|
var _react = require("react");
|
|
10
|
+
var _react2 = require("@emotion/react");
|
|
10
11
|
var _reactIntlNext = require("react-intl-next");
|
|
11
12
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
12
13
|
var _code = require("@atlaskit/code");
|
|
13
14
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
14
15
|
var _codeBlockContainer = _interopRequireDefault(require("./components/codeBlockContainer"));
|
|
16
|
+
/** @jsx jsx */
|
|
17
|
+
|
|
15
18
|
function CodeBlock(props) {
|
|
16
19
|
var text = props.text,
|
|
17
20
|
language = props.language,
|
|
@@ -26,14 +29,14 @@ function CodeBlock(props) {
|
|
|
26
29
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
27
30
|
wrapLongLines = _useState2[0],
|
|
28
31
|
setWrapLongLines = _useState2[1];
|
|
29
|
-
return
|
|
32
|
+
return (0, _react2.jsx)(_codeBlockContainer.default, {
|
|
30
33
|
allowCopyToClipboard: allowCopyToClipboard,
|
|
31
34
|
allowWrapCodeBlock: allowWrapCodeBlock,
|
|
32
35
|
className: className,
|
|
33
36
|
setWrapLongLines: setWrapLongLines,
|
|
34
37
|
text: text,
|
|
35
38
|
wrapLongLines: wrapLongLines
|
|
36
|
-
},
|
|
39
|
+
}, (0, _react2.jsx)(_code.CodeBlock, {
|
|
37
40
|
language: language,
|
|
38
41
|
text: text,
|
|
39
42
|
codeBidiWarningLabel: codeBidiWarningLabel,
|
|
@@ -9,6 +9,8 @@ var _react = require("@emotion/react");
|
|
|
9
9
|
var _codeBlockCopyButton = _interopRequireDefault(require("./codeBlockCopyButton"));
|
|
10
10
|
var _codeBlockWrapButton = _interopRequireDefault(require("./codeBlockWrapButton"));
|
|
11
11
|
var _colors = require("@atlaskit/theme/colors");
|
|
12
|
+
/** @jsx jsx */
|
|
13
|
+
|
|
12
14
|
var codeBlockButtonsWrapper = (0, _react.css)({
|
|
13
15
|
position: 'sticky',
|
|
14
16
|
top: '0px',
|
|
@@ -51,14 +53,14 @@ var CodeBlockButtonContainer = function CodeBlockButtonContainer(_ref) {
|
|
|
51
53
|
setWrapLongLines = _ref.setWrapLongLines,
|
|
52
54
|
text = _ref.text,
|
|
53
55
|
wrapLongLines = _ref.wrapLongLines;
|
|
54
|
-
return
|
|
56
|
+
return (0, _react.jsx)("div", {
|
|
55
57
|
css: codeBlockButtonsWrapper
|
|
56
|
-
},
|
|
58
|
+
}, (0, _react.jsx)("div", {
|
|
57
59
|
css: codeBlockButtonsStyle
|
|
58
|
-
}, allowWrapCodeBlock &&
|
|
60
|
+
}, allowWrapCodeBlock && (0, _react.jsx)(_codeBlockWrapButton.default, {
|
|
59
61
|
setWrapLongLines: setWrapLongLines,
|
|
60
62
|
wrapLongLines: wrapLongLines
|
|
61
|
-
}), allowCopyToClipboard &&
|
|
63
|
+
}), allowCopyToClipboard && (0, _react.jsx)(_codeBlockCopyButton.default, {
|
|
62
64
|
content: text
|
|
63
65
|
})));
|
|
64
66
|
};
|
|
@@ -14,6 +14,7 @@ var _constants = require("@atlaskit/theme/constants");
|
|
|
14
14
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
15
15
|
var _codeBlockButtonContainer = _interopRequireDefault(require("./codeBlockButtonContainer"));
|
|
16
16
|
var _templateObject;
|
|
17
|
+
/** @jsx jsx */
|
|
17
18
|
var codeBlockStyleOverrides = function codeBlockStyleOverrides(props) {
|
|
18
19
|
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n tab-size: 4;\n background-color: ", ";\n\n &:hover {\n button {\n opacity: 1;\n }\n }\n\n button {\n opacity: 0;\n transition: opacity 0.2s ease 0s;\n }\n\n ", " {\n font-size: ", ";\n line-height: 1.5rem;\n background-image: ", ";\n background-attachment: local, local, local, local, scroll, scroll, scroll,\n scroll;\n background-position: 0 0, 0 0, 100% 0, 100% 0, 100% 0, 100% 0, 0 0, 0 0;\n }\n "])), (0, _components.themed)({
|
|
19
20
|
light: "var(--ds-surface-raised, ".concat(_colors.N20, ")"),
|
|
@@ -34,10 +35,10 @@ var CodeBlockContainer = function CodeBlockContainer(_ref) {
|
|
|
34
35
|
setWrapLongLines = _ref.setWrapLongLines,
|
|
35
36
|
text = _ref.text,
|
|
36
37
|
wrapLongLines = _ref.wrapLongLines;
|
|
37
|
-
return
|
|
38
|
+
return (0, _react.jsx)("div", {
|
|
38
39
|
className: className,
|
|
39
40
|
css: codeBlockStyleOverrides
|
|
40
|
-
},
|
|
41
|
+
}, (0, _react.jsx)(_codeBlockButtonContainer.default, {
|
|
41
42
|
allowCopyToClipboard: allowCopyToClipboard,
|
|
42
43
|
allowWrapCodeBlock: allowWrapCodeBlock,
|
|
43
44
|
setWrapLongLines: setWrapLongLines,
|
|
@@ -7,7 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
|
-
var _react =
|
|
10
|
+
var _react = require("@emotion/react");
|
|
11
|
+
var _react2 = _interopRequireWildcard(require("react"));
|
|
11
12
|
var _reactIntlNext = require("react-intl-next");
|
|
12
13
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
13
14
|
var _customThemeButton = _interopRequireDefault(require("@atlaskit/button/custom-theme-button"));
|
|
@@ -18,14 +19,16 @@ var _enums = require("../../../../analytics/enums");
|
|
|
18
19
|
var _analyticsContext = _interopRequireDefault(require("../../../../analytics/analyticsContext"));
|
|
19
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
20
21
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
22
|
+
/** @jsx jsx */
|
|
23
|
+
|
|
21
24
|
var CopyButton = function CopyButton(_ref) {
|
|
22
25
|
var content = _ref.content,
|
|
23
26
|
intl = _ref.intl;
|
|
24
|
-
var _useState = (0,
|
|
27
|
+
var _useState = (0, _react2.useState)(intl.formatMessage(_messages.codeBlockButtonMessages.copyCodeToClipboard)),
|
|
25
28
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
26
29
|
tooltip = _useState2[0],
|
|
27
30
|
setTooltip = _useState2[1];
|
|
28
|
-
var _useState3 = (0,
|
|
31
|
+
var _useState3 = (0, _react2.useState)('copy-to-clipboard'),
|
|
29
32
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
30
33
|
className = _useState4[0],
|
|
31
34
|
setClassName = _useState4[1];
|
|
@@ -33,20 +36,20 @@ var CopyButton = function CopyButton(_ref) {
|
|
|
33
36
|
setTooltip(intl.formatMessage(_messages.codeBlockButtonMessages.copyCodeToClipboard));
|
|
34
37
|
setClassName('copy-to-clipboard');
|
|
35
38
|
};
|
|
36
|
-
return
|
|
39
|
+
return (0, _react.jsx)(_analyticsContext.default.Consumer, null, function (_ref2) {
|
|
37
40
|
var fireAnalyticsEvent = _ref2.fireAnalyticsEvent;
|
|
38
|
-
return
|
|
41
|
+
return (0, _react.jsx)("span", null, (0, _react.jsx)(_tooltip.default, {
|
|
39
42
|
content: tooltip,
|
|
40
43
|
hideTooltipOnClick: false,
|
|
41
44
|
position: "top"
|
|
42
|
-
},
|
|
45
|
+
}, (0, _react.jsx)("div", {
|
|
43
46
|
onMouseLeave: onMouseLeave
|
|
44
|
-
},
|
|
47
|
+
}, (0, _react.jsx)(_customThemeButton.default, {
|
|
45
48
|
appearance: "subtle",
|
|
46
49
|
"aria-haspopup": true,
|
|
47
50
|
"aria-label": tooltip,
|
|
48
51
|
className: className,
|
|
49
|
-
iconBefore:
|
|
52
|
+
iconBefore: (0, _react.jsx)(_copy.default, {
|
|
50
53
|
label: tooltip
|
|
51
54
|
}),
|
|
52
55
|
onClick: function onClick(event) {
|
|
@@ -5,7 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = require("@emotion/react");
|
|
9
|
+
var _react2 = _interopRequireDefault(require("react"));
|
|
9
10
|
var _reactIntlNext = require("react-intl-next");
|
|
10
11
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
11
12
|
var _customThemeButton = _interopRequireDefault(require("@atlaskit/button/custom-theme-button"));
|
|
@@ -13,16 +14,18 @@ var _icon = _interopRequireDefault(require("@atlaskit/icon"));
|
|
|
13
14
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
14
15
|
var _enums = require("../../../../analytics/enums");
|
|
15
16
|
var _analyticsContext = _interopRequireDefault(require("../../../../analytics/analyticsContext"));
|
|
17
|
+
/** @jsx jsx */
|
|
18
|
+
|
|
16
19
|
var WrapIcon = function WrapIcon() {
|
|
17
|
-
return
|
|
20
|
+
return (0, _react.jsx)("svg", {
|
|
18
21
|
width: "24",
|
|
19
22
|
height: "24",
|
|
20
23
|
fill: "none",
|
|
21
24
|
viewBox: "0 0 24 24"
|
|
22
|
-
},
|
|
25
|
+
}, (0, _react.jsx)("g", {
|
|
23
26
|
fill: "currentColor",
|
|
24
27
|
clipPath: "url(#clip0_654_431)"
|
|
25
|
-
},
|
|
28
|
+
}, (0, _react.jsx)("path", {
|
|
26
29
|
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",
|
|
27
30
|
clipRule: "evenodd",
|
|
28
31
|
fillRule: "evenodd"
|
|
@@ -33,18 +36,18 @@ var CodeBlockWrapButton = function CodeBlockWrapButton(_ref) {
|
|
|
33
36
|
wrapLongLines = _ref.wrapLongLines,
|
|
34
37
|
intl = _ref.intl;
|
|
35
38
|
var wrapMessage = intl.formatMessage(wrapLongLines ? _messages.codeBlockButtonMessages.unwrapCode : _messages.codeBlockButtonMessages.wrapCode);
|
|
36
|
-
return
|
|
39
|
+
return (0, _react.jsx)(_analyticsContext.default.Consumer, null, function (_ref2) {
|
|
37
40
|
var fireAnalyticsEvent = _ref2.fireAnalyticsEvent;
|
|
38
|
-
return
|
|
41
|
+
return (0, _react.jsx)("span", null, (0, _react.jsx)(_tooltip.default, {
|
|
39
42
|
content: wrapMessage,
|
|
40
43
|
hideTooltipOnClick: false,
|
|
41
44
|
position: "top"
|
|
42
|
-
},
|
|
45
|
+
}, (0, _react.jsx)(_customThemeButton.default, {
|
|
43
46
|
appearance: "subtle",
|
|
44
47
|
"aria-haspopup": true,
|
|
45
48
|
"aria-label": wrapMessage,
|
|
46
49
|
className: "wrap-code ".concat(wrapLongLines ? 'clicked' : ''),
|
|
47
|
-
iconBefore:
|
|
50
|
+
iconBefore: (0, _react.jsx)(_icon.default, {
|
|
48
51
|
glyph: WrapIcon,
|
|
49
52
|
label: ""
|
|
50
53
|
}),
|
|
@@ -14,6 +14,7 @@ var _styles = require("@atlaskit/editor-common/styles");
|
|
|
14
14
|
var _useBidiWarnings2 = require("../../../hooks/use-bidi-warnings");
|
|
15
15
|
var _consts = require("../../../../consts");
|
|
16
16
|
var _templateObject, _templateObject2;
|
|
17
|
+
/** @jsx jsx */
|
|
17
18
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
18
19
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
20
|
var lightWeightCodeBlockStyles = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n cursor: text;\n }\n"])), _styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER);
|
|
@@ -43,22 +44,22 @@ var LightWeightCodeBlock = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, r
|
|
|
43
44
|
}),
|
|
44
45
|
renderBidiWarnings = _useBidiWarnings.renderBidiWarnings;
|
|
45
46
|
var classNames = [LightWeightCodeBlockCssClassName.CONTAINER, className].join(' ');
|
|
46
|
-
return
|
|
47
|
+
return (0, _react2.jsx)("div", {
|
|
47
48
|
className: classNames,
|
|
48
49
|
ref: ref,
|
|
49
50
|
css: [(0, _styles.codeBlockSharedStyles)(theme), lightWeightCodeBlockStyles]
|
|
50
|
-
},
|
|
51
|
+
}, (0, _react2.jsx)("div", {
|
|
51
52
|
className: _styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER
|
|
52
|
-
},
|
|
53
|
+
}, (0, _react2.jsx)("div", {
|
|
53
54
|
className: _styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER
|
|
54
|
-
},
|
|
55
|
+
}, (0, _react2.jsx)("div", {
|
|
55
56
|
className: _styles.CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER
|
|
56
57
|
}, textRows.map(function (_, index) {
|
|
57
|
-
return
|
|
58
|
+
return (0, _react2.jsx)("span", {
|
|
58
59
|
key: index
|
|
59
60
|
});
|
|
60
|
-
})),
|
|
61
|
+
})), (0, _react2.jsx)("div", {
|
|
61
62
|
className: _styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTENT
|
|
62
|
-
},
|
|
63
|
+
}, (0, _react2.jsx)("code", null, renderBidiWarnings(text))))));
|
|
63
64
|
});
|
|
64
65
|
var _default = exports.default = LightWeightCodeBlock;
|
|
@@ -10,13 +10,14 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))
|
|
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
11
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
12
12
|
var _react = require("react");
|
|
13
|
+
var _react2 = require("@emotion/react");
|
|
13
14
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
14
15
|
var _useInViewport2 = require("../../hooks/use-in-viewport");
|
|
15
16
|
var _useBidiWarnings2 = require("../../hooks/use-bidi-warnings");
|
|
16
17
|
var _lightWeightCodeBlock = _interopRequireDefault(require("./components/lightWeightCodeBlock"));
|
|
17
18
|
var _codeBlockContainer = _interopRequireDefault(require("./components/codeBlockContainer"));
|
|
18
19
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
20
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } /** @jsx jsx */
|
|
20
21
|
var LazyAkCodeBlock = /*#__PURE__*/(0, _react.lazy)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
21
22
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
22
23
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -54,7 +55,7 @@ var WindowedCodeBlock = function WindowedCodeBlock(_ref2) {
|
|
|
54
55
|
isInViewport = _useInViewport.isInViewport,
|
|
55
56
|
trackingRef = _useInViewport.trackingRef;
|
|
56
57
|
var className = joinWithSpaces(_styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER, rootClassName);
|
|
57
|
-
var memoizedLightWeightCodeBlock =
|
|
58
|
+
var memoizedLightWeightCodeBlock = (0, _react2.jsx)(MemoizedLightWeightCodeBlock, {
|
|
58
59
|
ref: trackingRef,
|
|
59
60
|
text: text,
|
|
60
61
|
codeBidiWarningTooltipEnabled: codeBidiWarningTooltipEnabled,
|
|
@@ -64,16 +65,16 @@ var WindowedCodeBlock = function WindowedCodeBlock(_ref2) {
|
|
|
64
65
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
65
66
|
wrapLongLines = _useState2[0],
|
|
66
67
|
setWrapLongLines = _useState2[1];
|
|
67
|
-
return isInViewport ?
|
|
68
|
+
return isInViewport ? (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(_react.Suspense, {
|
|
68
69
|
fallback: memoizedLightWeightCodeBlock
|
|
69
|
-
},
|
|
70
|
+
}, (0, _react2.jsx)(_codeBlockContainer.default, {
|
|
70
71
|
allowCopyToClipboard: allowCopyToClipboard,
|
|
71
72
|
allowWrapCodeBlock: allowWrapCodeBlock,
|
|
72
73
|
className: className,
|
|
73
74
|
setWrapLongLines: setWrapLongLines,
|
|
74
75
|
text: text,
|
|
75
76
|
wrapLongLines: wrapLongLines
|
|
76
|
-
},
|
|
77
|
+
}, (0, _react2.jsx)(LazyAkCodeBlock, {
|
|
77
78
|
language: language,
|
|
78
79
|
text: text,
|
|
79
80
|
codeBidiWarningLabel: warningLabel,
|
|
@@ -20,6 +20,7 @@ var _style = require("../../ui/Renderer/style");
|
|
|
20
20
|
var _getCardClickHandler = require("../utils/getCardClickHandler");
|
|
21
21
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
22
22
|
var _templateObject, _templateObject2;
|
|
23
|
+
/** @jsx jsx */
|
|
23
24
|
var embedCardWrapperStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\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"])));
|
|
24
25
|
var uIMediaSingleLayoutStyles = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n margin-left: 50%;\n transform: translateX(-50%);\n"])));
|
|
25
26
|
function EmbedCard(props) {
|
|
@@ -99,9 +100,9 @@ function EmbedCard(props) {
|
|
|
99
100
|
// Below is added for the future implementation of Linking Platform namespaced analytic context
|
|
100
101
|
location: 'renderer'
|
|
101
102
|
};
|
|
102
|
-
return
|
|
103
|
+
return (0, _react.jsx)(_analyticsNext.AnalyticsContext, {
|
|
103
104
|
data: analyticsData
|
|
104
|
-
},
|
|
105
|
+
}, (0, _react.jsx)(_ui.WidthConsumer, null, function (_ref2) {
|
|
105
106
|
var documentWidth = _ref2.width;
|
|
106
107
|
var isFullWidth = rendererAppearance === 'full-width';
|
|
107
108
|
var containerWidth = documentWidth;
|
|
@@ -126,12 +127,12 @@ function EmbedCard(props) {
|
|
|
126
127
|
throw err;
|
|
127
128
|
}
|
|
128
129
|
};
|
|
129
|
-
return
|
|
130
|
+
return (0, _react.jsx)(_fallback.CardErrorBoundary, (0, _extends2.default)({
|
|
130
131
|
unsupportedComponent: _ui.UnsupportedBlock
|
|
131
|
-
}, cardProps),
|
|
132
|
+
}, cardProps), (0, _react.jsx)(_smartCard.EmbedResizeMessageListener, {
|
|
132
133
|
embedIframeRef: embedIframeRef,
|
|
133
134
|
onHeightUpdate: setLiveHeight
|
|
134
|
-
},
|
|
135
|
+
}, (0, _react.jsx)(_ui.MediaSingle, {
|
|
135
136
|
css: uiMediaSingleStyles,
|
|
136
137
|
layout: layout,
|
|
137
138
|
width: originalWidth,
|
|
@@ -142,9 +143,9 @@ function EmbedCard(props) {
|
|
|
142
143
|
nodeType: "embedCard",
|
|
143
144
|
lineLength: isInsideOfBlockNode ? containerWidth : lineLength,
|
|
144
145
|
hasFallbackContainer: hasPreview
|
|
145
|
-
},
|
|
146
|
+
}, (0, _react.jsx)("div", {
|
|
146
147
|
css: embedCardWrapperStyles
|
|
147
|
-
},
|
|
148
|
+
}, (0, _react.jsx)("div", {
|
|
148
149
|
className: "embedCardView-content-wrap",
|
|
149
150
|
"data-embed-card": true,
|
|
150
151
|
"data-layout": layout,
|
|
@@ -152,7 +153,7 @@ function EmbedCard(props) {
|
|
|
152
153
|
"data-card-data": data ? JSON.stringify(data) : undefined,
|
|
153
154
|
"data-card-url": url,
|
|
154
155
|
"data-card-original-height": originalHeight
|
|
155
|
-
},
|
|
156
|
+
}, (0, _react.jsx)(_smartCard.Card, (0, _extends2.default)({
|
|
156
157
|
appearance: "embed"
|
|
157
158
|
}, cardProps, {
|
|
158
159
|
onResolve: onResolve,
|