@atlaskit/renderer 92.0.0 → 93.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +75 -0
- package/dist/cjs/analytics/enums.js +1 -0
- package/dist/cjs/i18n/en.js +28 -0
- package/dist/cjs/i18n/en_GB.js +28 -0
- package/dist/cjs/i18n/pl.js +7 -1
- package/dist/cjs/i18n/pt_BR.js +1 -1
- package/dist/cjs/react/marks/alignment.js +11 -12
- package/dist/cjs/react/marks/breakout.js +7 -9
- package/dist/cjs/react/marks/link.js +13 -6
- package/dist/cjs/react/nodes/codeBlock.js +1 -1
- package/dist/cjs/react/nodes/codeBlockCopyButton.js +13 -11
- package/dist/cjs/react/nodes/embedCard.js +25 -33
- package/dist/cjs/react/nodes/heading-anchor.js +7 -6
- package/dist/cjs/react/nodes/mediaSingle/index.js +15 -4
- package/dist/cjs/react/nodes/mediaSingle/styles.js +7 -10
- package/dist/cjs/react/nodes/panel.js +36 -20
- package/dist/cjs/react/nodes/table/sticky.js +51 -54
- package/dist/cjs/react/nodes/table.js +2 -10
- package/dist/cjs/react/utils/performance/RenderTracking.js +52 -0
- package/dist/cjs/render-document.js +2 -2
- package/dist/cjs/text/index.js +2 -2
- package/dist/cjs/ui/Expand.js +40 -20
- package/dist/cjs/ui/MediaCard.js +4 -14
- package/dist/cjs/ui/Renderer/click-to-edit.js +4 -4
- package/dist/cjs/ui/Renderer/index.js +39 -50
- package/dist/cjs/ui/Renderer/style.js +58 -63
- package/dist/cjs/ui/Renderer/truncated-wrapper.js +19 -21
- package/dist/cjs/ui/SortingIcon.js +8 -9
- package/dist/cjs/ui/renderer-props.js +1 -3
- package/dist/cjs/utils.js +2 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/analytics/enums.js +1 -0
- package/dist/es2019/i18n/en.js +20 -0
- package/dist/es2019/i18n/en_GB.js +20 -0
- package/dist/es2019/i18n/pl.js +7 -1
- package/dist/es2019/i18n/pt_BR.js +1 -1
- package/dist/es2019/react/marks/alignment.js +15 -7
- package/dist/es2019/react/marks/breakout.js +6 -5
- package/dist/es2019/react/marks/link.js +8 -5
- package/dist/es2019/react/nodes/codeBlock.js +1 -1
- package/dist/es2019/react/nodes/codeBlockCopyButton.js +12 -9
- package/dist/es2019/react/nodes/embedCard.js +16 -16
- package/dist/es2019/react/nodes/heading-anchor.js +9 -6
- package/dist/es2019/react/nodes/mediaSingle/index.js +10 -6
- package/dist/es2019/react/nodes/mediaSingle/styles.js +6 -7
- package/dist/es2019/react/nodes/panel.js +38 -18
- package/dist/es2019/react/nodes/table/sticky.js +48 -41
- package/dist/es2019/react/nodes/table.js +2 -5
- package/dist/es2019/react/utils/performance/RenderTracking.js +37 -0
- package/dist/es2019/render-document.js +1 -1
- package/dist/es2019/text/index.js +1 -1
- package/dist/es2019/ui/Expand.js +52 -28
- package/dist/es2019/ui/MediaCard.js +3 -6
- package/dist/es2019/ui/Renderer/click-to-edit.js +1 -1
- package/dist/es2019/ui/Renderer/index.js +38 -43
- package/dist/es2019/ui/Renderer/style.js +363 -337
- package/dist/es2019/ui/Renderer/truncated-wrapper.js +26 -15
- package/dist/es2019/ui/SortingIcon.js +9 -7
- package/dist/es2019/ui/renderer-props.js +1 -1
- package/dist/es2019/utils.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/analytics/enums.js +1 -0
- package/dist/esm/i18n/en.js +20 -0
- package/dist/esm/i18n/en_GB.js +20 -0
- package/dist/esm/i18n/pl.js +7 -1
- package/dist/esm/i18n/pt_BR.js +1 -1
- package/dist/esm/react/marks/alignment.js +13 -6
- package/dist/esm/react/marks/breakout.js +6 -5
- package/dist/esm/react/marks/link.js +7 -5
- package/dist/esm/react/nodes/codeBlock.js +1 -1
- package/dist/esm/react/nodes/codeBlockCopyButton.js +10 -7
- package/dist/esm/react/nodes/embedCard.js +19 -19
- package/dist/esm/react/nodes/heading-anchor.js +8 -6
- package/dist/esm/react/nodes/mediaSingle/index.js +11 -6
- package/dist/esm/react/nodes/mediaSingle/styles.js +5 -7
- package/dist/esm/react/nodes/panel.js +34 -17
- package/dist/esm/react/nodes/table/sticky.js +53 -52
- package/dist/esm/react/nodes/table.js +2 -8
- package/dist/esm/react/utils/performance/RenderTracking.js +39 -0
- package/dist/esm/render-document.js +1 -1
- package/dist/esm/text/index.js +1 -1
- package/dist/esm/ui/Expand.js +45 -21
- package/dist/esm/ui/MediaCard.js +3 -9
- package/dist/esm/ui/Renderer/click-to-edit.js +1 -1
- package/dist/esm/ui/Renderer/index.js +39 -47
- package/dist/esm/ui/Renderer/style.js +56 -57
- package/dist/esm/ui/Renderer/truncated-wrapper.js +20 -14
- package/dist/esm/ui/SortingIcon.js +9 -7
- package/dist/esm/ui/renderer-props.js +1 -1
- package/dist/esm/utils.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/analytics/enums.d.ts +1 -0
- package/dist/types/analytics/events.d.ts +7 -2
- package/dist/types/i18n/en.d.ts +20 -0
- package/dist/types/i18n/en_GB.d.ts +20 -0
- package/dist/types/i18n/pl.d.ts +6 -0
- package/dist/types/react/marks/alignment.d.ts +2 -2
- package/dist/types/react/marks/breakout.d.ts +4 -3
- package/dist/types/react/marks/link.d.ts +2 -2
- package/dist/types/react/nodes/embedCard.d.ts +3 -2
- package/dist/types/react/nodes/heading-anchor.d.ts +1 -0
- package/dist/types/react/nodes/media.d.ts +1 -1
- package/dist/types/react/nodes/mediaSingle/index.d.ts +1 -0
- package/dist/types/react/nodes/mediaSingle/styles.d.ts +2 -3
- package/dist/types/react/nodes/panel.d.ts +3 -1
- package/dist/types/react/nodes/table/sticky.d.ts +4 -2
- package/dist/types/react/utils/performance/RenderTracking.d.ts +15 -0
- package/dist/types/ui/Expand.d.ts +2 -2
- package/dist/types/ui/MediaCard.d.ts +1 -3
- package/dist/types/ui/Renderer/index.d.ts +0 -25
- package/dist/types/ui/Renderer/style.d.ts +1 -4
- package/dist/types/ui/Renderer/truncated-wrapper.d.ts +3 -1
- package/dist/types/ui/SortingIcon.d.ts +3 -3
- package/dist/types/ui/renderer-props.d.ts +14 -2
- package/package.json +22 -24
|
@@ -1,28 +1,39 @@
|
|
|
1
|
-
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { css, jsx } from '@emotion/react';
|
|
2
3
|
import { Component } from 'react';
|
|
3
|
-
|
|
4
|
-
const
|
|
4
|
+
|
|
5
|
+
const fadeOutStyles = (maxHeight, top, backgroundColor) => css`
|
|
5
6
|
position: relative;
|
|
6
7
|
overflow-y: hidden;
|
|
7
|
-
max-height: ${
|
|
8
|
-
height
|
|
9
|
-
}) => height}px;
|
|
8
|
+
max-height: ${maxHeight}px;
|
|
10
9
|
&::after {
|
|
11
10
|
content: '';
|
|
12
11
|
position: absolute;
|
|
13
|
-
top: ${
|
|
14
|
-
height,
|
|
15
|
-
fadeHeight
|
|
16
|
-
}) => height - fadeHeight}px;
|
|
12
|
+
top: ${top}px;
|
|
17
13
|
bottom: 0;
|
|
18
14
|
left: 0;
|
|
19
15
|
right: 0;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
background-image: linear-gradient(
|
|
17
|
+
rgba(255, 255, 255, 0),
|
|
18
|
+
${backgroundColor}
|
|
19
|
+
);
|
|
24
20
|
}
|
|
25
21
|
`;
|
|
22
|
+
|
|
23
|
+
const FadeOut = props => {
|
|
24
|
+
const {
|
|
25
|
+
children,
|
|
26
|
+
backgroundColor,
|
|
27
|
+
fadeHeight,
|
|
28
|
+
height
|
|
29
|
+
} = props;
|
|
30
|
+
const top = height - fadeHeight;
|
|
31
|
+
const styles = fadeOutStyles(height, top, backgroundColor);
|
|
32
|
+
return jsx("div", {
|
|
33
|
+
css: styles
|
|
34
|
+
}, children);
|
|
35
|
+
};
|
|
36
|
+
|
|
26
37
|
export class TruncatedWrapper extends Component {
|
|
27
38
|
constructor(props) {
|
|
28
39
|
super(props);
|
|
@@ -35,7 +46,7 @@ export class TruncatedWrapper extends Component {
|
|
|
35
46
|
backgroundColor = 'white',
|
|
36
47
|
children
|
|
37
48
|
} = this.props;
|
|
38
|
-
return
|
|
49
|
+
return jsx(FadeOut, {
|
|
39
50
|
height: height,
|
|
40
51
|
fadeHeight: fadeHeight,
|
|
41
52
|
backgroundColor: backgroundColor
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { css, jsx } from '@emotion/react';
|
|
3
3
|
import Tooltip from '@atlaskit/tooltip';
|
|
4
4
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
5
5
|
import { N20, N30 } from '@atlaskit/theme/colors';
|
|
@@ -20,7 +20,7 @@ export let StatusClassNames;
|
|
|
20
20
|
StatusClassNames["SORTING_NOT_ALLOWED"] = "sorting-icon-svg__not-allowed";
|
|
21
21
|
})(StatusClassNames || (StatusClassNames = {}));
|
|
22
22
|
|
|
23
|
-
const
|
|
23
|
+
const wrapperStyles = css`
|
|
24
24
|
position: absolute;
|
|
25
25
|
display: flex;
|
|
26
26
|
height: 28px;
|
|
@@ -42,7 +42,7 @@ const Wrapper = styled.figure`
|
|
|
42
42
|
cursor: not-allowed;
|
|
43
43
|
}
|
|
44
44
|
`;
|
|
45
|
-
const
|
|
45
|
+
const tableSortingIconStyles = css`
|
|
46
46
|
width: 8px;
|
|
47
47
|
height: 12px;
|
|
48
48
|
transition: transform 0.3s cubic-bezier(0.15, 1, 0.3, 1);
|
|
@@ -105,13 +105,15 @@ const SortingIcon = ({
|
|
|
105
105
|
const activated = sortOrdered !== SortOrder.NO_ORDER;
|
|
106
106
|
const wrapperClassName = !isSortingAllowed ? StatusClassNames.SORTING_NOT_ALLOWED : '';
|
|
107
107
|
const content = getTooltipTitle(intl, isSortingAllowed, sortOrdered);
|
|
108
|
-
return
|
|
108
|
+
return jsx(Tooltip, {
|
|
109
109
|
delay: 0,
|
|
110
110
|
content: content,
|
|
111
111
|
position: "top"
|
|
112
|
-
},
|
|
112
|
+
}, jsx("figure", {
|
|
113
|
+
css: wrapperStyles,
|
|
113
114
|
className: wrapperClassName
|
|
114
|
-
},
|
|
115
|
+
}, jsx("div", {
|
|
116
|
+
css: tableSortingIconStyles,
|
|
115
117
|
className: `${getClassName(sortOrdered)} ${TABLE_SORTING_ICON_CLASS}-${activated ? 'active' : 'inactive'}`
|
|
116
118
|
})));
|
|
117
119
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import { ACTION_SUBJECT } from '../analytics/enums';
|
package/dist/es2019/utils.js
CHANGED
package/dist/es2019/version.json
CHANGED
|
@@ -12,6 +12,7 @@ export var ACTION;
|
|
|
12
12
|
(function (ACTION) {
|
|
13
13
|
ACTION["STARTED"] = "started";
|
|
14
14
|
ACTION["RENDERED"] = "rendered";
|
|
15
|
+
ACTION["RE_RENDERED"] = "reRendered";
|
|
15
16
|
ACTION["RENDERER_TTI"] = "tti";
|
|
16
17
|
ACTION["CRASHED"] = "unhandledErrorCaught";
|
|
17
18
|
ACTION["INVALID_PROSEMIRROR_DOCUMENT"] = "invalidProsemirrorDocument";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NOTE:
|
|
3
|
+
*
|
|
4
|
+
* This file is automatically generated by Traduki 2.0.
|
|
5
|
+
* DO NOT CHANGE IT BY HAND or your changes will be lost.
|
|
6
|
+
*/
|
|
7
|
+
//
|
|
8
|
+
export default {
|
|
9
|
+
'fabric.editor.codeBlockCopyButton.copiedToClipboard': 'Copied!',
|
|
10
|
+
'fabric.editor.codeBlockCopyButton.copyToClipboard': 'Copy',
|
|
11
|
+
'fabric.editor.headingLink.ascOrderLabel': 'Sort column Z to A',
|
|
12
|
+
'fabric.editor.headingLink.ascSortingLabel': 'ascending',
|
|
13
|
+
'fabric.editor.headingLink.copied': 'Copied!',
|
|
14
|
+
'fabric.editor.headingLink.copyAnchorLink': 'Copy link to heading',
|
|
15
|
+
'fabric.editor.headingLink.copyAriaLabel': 'Copy',
|
|
16
|
+
'fabric.editor.headingLink.descOrderLabel': "⚠️ You can't sort a table with merged cell",
|
|
17
|
+
'fabric.editor.headingLink.failedToCopy': 'Copy failed',
|
|
18
|
+
'fabric.editor.headingLink.noOrderLabel': 'Sort column A to Z',
|
|
19
|
+
'fabric.editor.headingLink.noneSortingLabel': 'descending'
|
|
20
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NOTE:
|
|
3
|
+
*
|
|
4
|
+
* This file is automatically generated by Traduki 2.0.
|
|
5
|
+
* DO NOT CHANGE IT BY HAND or your changes will be lost.
|
|
6
|
+
*/
|
|
7
|
+
//English (United Kingdom)
|
|
8
|
+
export default {
|
|
9
|
+
'fabric.editor.codeBlockCopyButton.copiedToClipboard': 'Copied!',
|
|
10
|
+
'fabric.editor.codeBlockCopyButton.copyToClipboard': 'Copy',
|
|
11
|
+
'fabric.editor.headingLink.ascOrderLabel': 'Sort column Z to A',
|
|
12
|
+
'fabric.editor.headingLink.ascSortingLabel': 'ascending',
|
|
13
|
+
'fabric.editor.headingLink.copied': 'Copied!',
|
|
14
|
+
'fabric.editor.headingLink.copyAnchorLink': 'Copy link to heading',
|
|
15
|
+
'fabric.editor.headingLink.copyAriaLabel': 'Copy',
|
|
16
|
+
'fabric.editor.headingLink.descOrderLabel': "⚠️ You can't sort a table with merged cell",
|
|
17
|
+
'fabric.editor.headingLink.failedToCopy': 'Copy failed',
|
|
18
|
+
'fabric.editor.headingLink.noOrderLabel': 'Sort column A to Z',
|
|
19
|
+
'fabric.editor.headingLink.noneSortingLabel': 'descending'
|
|
20
|
+
};
|
package/dist/esm/i18n/pl.js
CHANGED
|
@@ -8,7 +8,13 @@
|
|
|
8
8
|
export default {
|
|
9
9
|
'fabric.editor.codeBlockCopyButton.copiedToClipboard': 'Skopiowano!',
|
|
10
10
|
'fabric.editor.codeBlockCopyButton.copyToClipboard': 'Kopiuj',
|
|
11
|
+
'fabric.editor.headingLink.ascOrderLabel': 'Sortuj kolumnę od Z do A',
|
|
12
|
+
'fabric.editor.headingLink.ascSortingLabel': 'rosnąco',
|
|
11
13
|
'fabric.editor.headingLink.copied': 'Skopiowano!',
|
|
12
14
|
'fabric.editor.headingLink.copyAnchorLink': 'Skopiuj łącze do nagłówka',
|
|
13
|
-
'fabric.editor.headingLink.
|
|
15
|
+
'fabric.editor.headingLink.copyAriaLabel': 'Kopiuj',
|
|
16
|
+
'fabric.editor.headingLink.descOrderLabel': '⚠️ Nie można sortować tabeli ze scaloną komórką',
|
|
17
|
+
'fabric.editor.headingLink.failedToCopy': 'Kopiowanie nie powiodło się',
|
|
18
|
+
'fabric.editor.headingLink.noOrderLabel': 'Sortuj kolumnę od A do Z',
|
|
19
|
+
'fabric.editor.headingLink.noneSortingLabel': 'malejąco'
|
|
14
20
|
};
|
package/dist/esm/i18n/pt_BR.js
CHANGED
|
@@ -13,7 +13,7 @@ export default {
|
|
|
13
13
|
'fabric.editor.headingLink.copied': 'Copiado!',
|
|
14
14
|
'fabric.editor.headingLink.copyAnchorLink': 'Copiar link para cabeçalho',
|
|
15
15
|
'fabric.editor.headingLink.copyAriaLabel': 'Copiar',
|
|
16
|
-
'fabric.editor.headingLink.descOrderLabel': '
|
|
16
|
+
'fabric.editor.headingLink.descOrderLabel': '⚠️ Você não pode ordenar uma tabela com células mescladas',
|
|
17
17
|
'fabric.editor.headingLink.failedToCopy': 'Falha na cópia',
|
|
18
18
|
'fabric.editor.headingLink.noOrderLabel': 'Ordenar coluna de A a Z',
|
|
19
19
|
'fabric.editor.headingLink.noneSortingLabel': 'descendente'
|
|
@@ -1,15 +1,22 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
1
2
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
3
|
|
|
3
|
-
var _templateObject
|
|
4
|
+
var _templateObject;
|
|
4
5
|
|
|
6
|
+
/** @jsx jsx */
|
|
5
7
|
import React from 'react';
|
|
6
|
-
import
|
|
8
|
+
import { css, jsx } from '@emotion/react';
|
|
7
9
|
import { alignmentPositionMap } from '@atlaskit/adf-schema';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
|
|
11
|
+
var MarkWrapper = function MarkWrapper(props) {
|
|
12
|
+
var styles = props['data-align'] ? css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n text-align: ", ";\n "])), alignmentPositionMap[props['data-align']]) : '';
|
|
13
|
+
return jsx("div", _extends({
|
|
14
|
+
css: styles
|
|
15
|
+
}, props), props.children);
|
|
16
|
+
};
|
|
17
|
+
|
|
11
18
|
export default function Alignment(props) {
|
|
12
|
-
return
|
|
19
|
+
return jsx(MarkWrapper, {
|
|
13
20
|
className: "fabric-editor-block-mark",
|
|
14
21
|
"data-align": props.align
|
|
15
22
|
}, props.children);
|
|
@@ -2,16 +2,17 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
import
|
|
5
|
+
/** @jsx jsx */
|
|
6
|
+
import { css, jsx } from '@emotion/react';
|
|
7
7
|
import { WidthConsumer } from '@atlaskit/editor-common/ui';
|
|
8
8
|
import { calcBreakoutWidth } from '@atlaskit/editor-common/utils';
|
|
9
9
|
import { blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
|
|
10
|
-
export var
|
|
10
|
+
export var wrapperStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin: ", " 0;\n margin-left: 50%;\n transform: translateX(-50%);\n"])), blockNodesVerticalMargin);
|
|
11
11
|
export default function Breakout(props) {
|
|
12
|
-
return
|
|
12
|
+
return jsx(WidthConsumer, null, function (_ref) {
|
|
13
13
|
var width = _ref.width;
|
|
14
|
-
return
|
|
14
|
+
return jsx("div", {
|
|
15
|
+
css: wrapperStyles,
|
|
15
16
|
"data-mode": props.mode,
|
|
16
17
|
style: {
|
|
17
18
|
width: calcBreakoutWidth(props.mode, width)
|
|
@@ -3,13 +3,14 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
3
3
|
|
|
4
4
|
var _templateObject;
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
/** @jsx jsx */
|
|
7
|
+
import React, { Fragment } from 'react';
|
|
8
|
+
import { css, jsx } from '@emotion/react';
|
|
7
9
|
import { B400, B300 } from '@atlaskit/theme/colors';
|
|
8
|
-
import styled from 'styled-components';
|
|
9
10
|
import { getEventHandler } from '../../utils';
|
|
10
11
|
import { PLATFORM, MODE } from '../../analytics/events';
|
|
11
12
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../../analytics/enums';
|
|
12
|
-
var
|
|
13
|
+
var anchorStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n\n &:hover {\n color: ", ";\n text-decoration: underline;\n }\n"])), B400, B300);
|
|
13
14
|
export default function Link(props) {
|
|
14
15
|
var href = props.href,
|
|
15
16
|
target = props.target,
|
|
@@ -30,10 +31,11 @@ export default function Link(props) {
|
|
|
30
31
|
var handler = getEventHandler(eventHandlers, 'link');
|
|
31
32
|
|
|
32
33
|
if (isMediaLink) {
|
|
33
|
-
return
|
|
34
|
+
return jsx(Fragment, null, props.children);
|
|
34
35
|
}
|
|
35
36
|
|
|
36
|
-
return
|
|
37
|
+
return jsx("a", _extends({
|
|
38
|
+
css: anchorStyles,
|
|
37
39
|
onClick: function onClick(e) {
|
|
38
40
|
if (fireAnalyticsEvent) {
|
|
39
41
|
fireAnalyticsEvent({
|
|
@@ -15,7 +15,7 @@ import { useFeatureFlags } from '../../use-feature-flags';
|
|
|
15
15
|
import CopyButton from './codeBlockCopyButton';
|
|
16
16
|
|
|
17
17
|
var codeBlockStyle = function codeBlockStyle(props) {
|
|
18
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n tab-size: 4;\n [data-ds--code--code-block] {\n font-size: ", ";\n line-height: 1.5rem;\n background-image: ", ";\n background-attachment: local, scroll, scroll;\n background-position: 100% 0, 100% 0, 0 0;\n\n "])), relativeFontSizeToBase16(fontSize()), overflowShadow({
|
|
18
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n tab-size: 4;\n [data-ds--code--code-block] {\n font-size: ", ";\n line-height: 1.5rem;\n background-image: ", ";\n background-attachment: local, scroll, scroll;\n background-position: 100% 0, 100% 0, 0 0;\n }\n "])), relativeFontSizeToBase16(fontSize()), overflowShadow({
|
|
19
19
|
background: themed({
|
|
20
20
|
light: N20,
|
|
21
21
|
dark: DN50
|
|
@@ -3,16 +3,17 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
3
3
|
|
|
4
4
|
var _templateObject;
|
|
5
5
|
|
|
6
|
+
/** @jsx jsx */
|
|
7
|
+
import { css, jsx } from '@emotion/react';
|
|
6
8
|
import React, { useState } from 'react';
|
|
7
9
|
import { injectIntl } from 'react-intl-next';
|
|
8
|
-
import styled from 'styled-components';
|
|
9
10
|
import Tooltip from '@atlaskit/tooltip';
|
|
10
11
|
import Button from '@atlaskit/button/custom-theme-button';
|
|
11
12
|
import CopyIcon from '@atlaskit/icon/glyph/copy';
|
|
12
13
|
import { N20, N30, N700 } from '@atlaskit/theme/colors';
|
|
13
14
|
import { CopyTextConsumer } from './copy-text-provider';
|
|
14
15
|
import { codeBlockCopyButtonMessages } from '../../messages';
|
|
15
|
-
var
|
|
16
|
+
var copyButtonWrapperStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n position: sticky;\n justify-content: flex-end;\n top: 0;\n\n button {\n position: absolute;\n display: flex;\n justify-content: center;\n height: 32px;\n width: 32px;\n right: 6px;\n top: 4px;\n padding: 2px;\n opacity: 0;\n transition: opacity 0.2s ease 0s;\n border: 2px solid #fff;\n border-radius: 4px;\n background-color: ", ";\n color: rgb(66, 82, 110);\n }\n\n button:hover {\n background-color: ", ";\n }\n\n button.clicked {\n background-color: ", ";\n color: #fff !important;\n }\n"])), N20, N30, N700);
|
|
16
17
|
|
|
17
18
|
var CopyButton = function CopyButton(_ref) {
|
|
18
19
|
var content = _ref.content,
|
|
@@ -33,21 +34,23 @@ var CopyButton = function CopyButton(_ref) {
|
|
|
33
34
|
setClassName('copy-to-clipboard');
|
|
34
35
|
};
|
|
35
36
|
|
|
36
|
-
return
|
|
37
|
+
return jsx(CopyTextConsumer, null, function (_ref2) {
|
|
37
38
|
var copyTextToClipboard = _ref2.copyTextToClipboard;
|
|
38
|
-
return
|
|
39
|
+
return jsx("span", {
|
|
40
|
+
css: copyButtonWrapperStyles
|
|
41
|
+
}, jsx(Tooltip, {
|
|
39
42
|
content: tooltip,
|
|
40
43
|
hideTooltipOnClick: false,
|
|
41
44
|
position: "top"
|
|
42
|
-
},
|
|
45
|
+
}, jsx("div", {
|
|
43
46
|
onMouseLeave: onMouseLeave
|
|
44
|
-
},
|
|
47
|
+
}, jsx(Button, {
|
|
45
48
|
className: className,
|
|
46
49
|
"aria-label": tooltip,
|
|
47
50
|
spacing: "compact",
|
|
48
51
|
appearance: "subtle",
|
|
49
52
|
"aria-haspopup": true,
|
|
50
|
-
iconBefore:
|
|
53
|
+
iconBefore: jsx(CopyIcon, {
|
|
51
54
|
label: tooltip
|
|
52
55
|
}),
|
|
53
56
|
onClick: function onClick() {
|
|
@@ -4,22 +4,18 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
4
4
|
|
|
5
5
|
var _templateObject, _templateObject2;
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
/** @jsx jsx */
|
|
8
|
+
import { css, jsx } from '@emotion/react';
|
|
9
|
+
import { useMemo, useContext, useState, useRef } from 'react';
|
|
8
10
|
import { Card, Context as CardContext, EmbedResizeMessageListener } from '@atlaskit/smart-card';
|
|
9
11
|
import { WidthConsumer, mapBreakpointToLayoutMaxWidth, UnsupportedBlock, MediaSingle as UIMediaSingle } from '@atlaskit/editor-common/ui';
|
|
10
12
|
import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH, getAkEditorFullPageMaxWidth } from '@atlaskit/editor-shared-styles';
|
|
11
13
|
import { getPlatform } from '../../utils';
|
|
12
14
|
import { CardErrorBoundary } from './fallback';
|
|
13
|
-
import styled from 'styled-components';
|
|
14
15
|
import { FullPagePadding } from '../../ui/Renderer/style';
|
|
15
16
|
import { getCardClickHandler } from '../utils/getCardClickHandler';
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
var ExtendedEmbedCard = styled(UIMediaSingle)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n"])), function (_ref) {
|
|
19
|
-
var layout = _ref.layout;
|
|
20
|
-
return layout === 'full-width' || layout === 'wide' ? "\n margin-left: 50%;\n transform: translateX(-50%);\n " : "";
|
|
21
|
-
});
|
|
22
|
-
ExtendedEmbedCard.displayName = 'ExtendedEmbedCard';
|
|
17
|
+
var embedCardWrapperStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n height: 100%;\n\n > div {\n height: 100%;\n }\n\n .loader-wrapper {\n height: 100%;\n }\n\n margin: 0 auto;\n"])));
|
|
18
|
+
var uIMediaSingleLayoutStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin-left: 50%;\n transform: translateX(-50%);\n"])));
|
|
23
19
|
export default function EmbedCard(props) {
|
|
24
20
|
var url = props.url,
|
|
25
21
|
data = props.data,
|
|
@@ -87,8 +83,8 @@ export default function EmbedCard(props) {
|
|
|
87
83
|
|
|
88
84
|
var cardContext = useContext(CardContext);
|
|
89
85
|
|
|
90
|
-
var onResolve = function onResolve(
|
|
91
|
-
var resolvedAspectRatio =
|
|
86
|
+
var onResolve = function onResolve(_ref) {
|
|
87
|
+
var resolvedAspectRatio = _ref.aspectRatio;
|
|
92
88
|
var hasPreviewOnResolve = !!(cardContext && url && cardContext.extractors.getPreview(url, platform));
|
|
93
89
|
|
|
94
90
|
if (!hasPreviewOnResolve) {
|
|
@@ -98,9 +94,9 @@ export default function EmbedCard(props) {
|
|
|
98
94
|
setAspectRatio(resolvedAspectRatio);
|
|
99
95
|
};
|
|
100
96
|
|
|
101
|
-
return
|
|
102
|
-
var containerWidth =
|
|
103
|
-
breakpoint =
|
|
97
|
+
return jsx(WidthConsumer, null, function (_ref2) {
|
|
98
|
+
var containerWidth = _ref2.width,
|
|
99
|
+
breakpoint = _ref2.breakpoint;
|
|
104
100
|
var nonFullWidthSize = containerWidth;
|
|
105
101
|
var isFullWidth = rendererAppearance === 'full-width';
|
|
106
102
|
|
|
@@ -117,12 +113,14 @@ export default function EmbedCard(props) {
|
|
|
117
113
|
}
|
|
118
114
|
|
|
119
115
|
var lineLength = isFullWidth ? Math.min(akEditorFullWidthLayoutWidth, containerWidth - padding) : nonFullWidthSize;
|
|
120
|
-
|
|
116
|
+
var uiMediaSingleStyles = layout === 'full-width' || layout === 'wide' ? uIMediaSingleLayoutStyles : '';
|
|
117
|
+
return jsx(CardErrorBoundary, _extends({
|
|
121
118
|
unsupportedComponent: UnsupportedBlock
|
|
122
|
-
}, cardProps),
|
|
119
|
+
}, cardProps), jsx(EmbedResizeMessageListener, {
|
|
123
120
|
embedIframeRef: embedIframeRef,
|
|
124
121
|
onHeightUpdate: setLiveHeight
|
|
125
|
-
},
|
|
122
|
+
}, jsx(UIMediaSingle, {
|
|
123
|
+
css: uiMediaSingleStyles,
|
|
126
124
|
layout: layout,
|
|
127
125
|
width: originalWidth,
|
|
128
126
|
containerWidth: containerWidth,
|
|
@@ -132,7 +130,9 @@ export default function EmbedCard(props) {
|
|
|
132
130
|
nodeType: "embedCard",
|
|
133
131
|
lineLength: isInsideOfBlockNode ? containerWidth : lineLength,
|
|
134
132
|
hasFallbackContainer: hasPreview
|
|
135
|
-
},
|
|
133
|
+
}, jsx("div", {
|
|
134
|
+
css: embedCardWrapperStyles
|
|
135
|
+
}, jsx("div", {
|
|
136
136
|
className: "embedCardView-content-wrap",
|
|
137
137
|
"data-embed-card": true,
|
|
138
138
|
"data-layout": layout,
|
|
@@ -140,7 +140,7 @@ export default function EmbedCard(props) {
|
|
|
140
140
|
"data-card-data": data ? JSON.stringify(data) : undefined,
|
|
141
141
|
"data-card-url": url,
|
|
142
142
|
"data-card-original-height": originalHeight
|
|
143
|
-
},
|
|
143
|
+
}, jsx(Card, _extends({
|
|
144
144
|
appearance: "embed"
|
|
145
145
|
}, cardProps, {
|
|
146
146
|
onResolve: onResolve,
|
|
@@ -19,8 +19,9 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
19
19
|
|
|
20
20
|
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; } }
|
|
21
21
|
|
|
22
|
+
/** @jsx jsx */
|
|
22
23
|
import React from 'react';
|
|
23
|
-
import
|
|
24
|
+
import { css, jsx } from '@emotion/react';
|
|
24
25
|
import { N200, N500, B400 } from '@atlaskit/theme/colors';
|
|
25
26
|
import LinkIcon from '@atlaskit/icon/glyph/link';
|
|
26
27
|
import Tooltip from '@atlaskit/tooltip';
|
|
@@ -31,12 +32,12 @@ var CopyAnchorWrapperWithRef = /*#__PURE__*/React.forwardRef(function (props, re
|
|
|
31
32
|
var children = props.children,
|
|
32
33
|
rest = _objectWithoutProperties(props, _excluded);
|
|
33
34
|
|
|
34
|
-
return
|
|
35
|
+
return jsx("span", _extends({}, rest, {
|
|
35
36
|
className: HeadingAnchorWrapperClassName,
|
|
36
37
|
ref: ref
|
|
37
38
|
}), children);
|
|
38
39
|
});
|
|
39
|
-
var
|
|
40
|
+
var copyAnchorButtonStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline;\n outline: none;\n background-color: transparent;\n border: none;\n color: ", ";\n cursor: pointer;\n right: 0;\n"])), N500);
|
|
40
41
|
|
|
41
42
|
var HeadingAnchor = /*#__PURE__*/function (_React$PureComponent) {
|
|
42
43
|
_inherits(HeadingAnchor, _React$PureComponent);
|
|
@@ -117,11 +118,12 @@ var HeadingAnchor = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
117
118
|
});
|
|
118
119
|
|
|
119
120
|
_defineProperty(_assertThisInitialized(_this), "renderAnchorButton", function () {
|
|
120
|
-
return
|
|
121
|
+
return jsx("button", {
|
|
122
|
+
css: copyAnchorButtonStyles,
|
|
121
123
|
onMouseLeave: _this.resetMessage,
|
|
122
124
|
onClick: _this.copyToClipboard,
|
|
123
125
|
"aria-label": _this.state.tooltipMessage
|
|
124
|
-
},
|
|
126
|
+
}, jsx(LinkIcon, {
|
|
125
127
|
label: _this.getCopyAriaLabel(),
|
|
126
128
|
size: _this.props.level > 3 ? 'small' : 'medium',
|
|
127
129
|
primaryColor: _this.state.isClicked ? B400 : N200
|
|
@@ -145,7 +147,7 @@ var HeadingAnchor = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
145
147
|
// We set the key to the message to ensure it remounts when the message
|
|
146
148
|
// changes, so that it correctly repositions.
|
|
147
149
|
// @see https://ecosystem.atlassian.net/projects/AK/queues/issue/AK-6548
|
|
148
|
-
return
|
|
150
|
+
return jsx(Tooltip, {
|
|
149
151
|
tag: CopyAnchorWrapperWithRef,
|
|
150
152
|
content: tooltipMessage,
|
|
151
153
|
position: "top",
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
4
|
+
import { default as React, Fragment } from 'react';
|
|
5
|
+
import { jsx } from '@emotion/react';
|
|
3
6
|
import { injectIntl } from 'react-intl-next';
|
|
4
7
|
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
5
|
-
import { mapBreakpointToLayoutMaxWidth, getBreakpoint, WidthConsumer } from '@atlaskit/editor-common/ui';
|
|
8
|
+
import { mapBreakpointToLayoutMaxWidth, getBreakpoint, MediaSingle as UIMediaSingle, WidthConsumer } from '@atlaskit/editor-common/ui';
|
|
6
9
|
import { akEditorFullWidthLayoutWidth, getAkEditorFullPageMaxWidth, akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
7
10
|
import { FullPagePadding } from '../../../ui/Renderer/style';
|
|
8
11
|
import { useObservedWidth } from '../../hooks/use-observed-width';
|
|
9
|
-
import {
|
|
12
|
+
import { uiMediaSingleBaseStyles, uiMediaSingleLayoutStyles } from './styles';
|
|
10
13
|
var DEFAULT_WIDTH = 250;
|
|
11
14
|
var DEFAULT_HEIGHT = 200;
|
|
12
15
|
|
|
@@ -175,7 +178,9 @@ var MediaSingle = function MediaSingle(props) {
|
|
|
175
178
|
disableOverlay: true,
|
|
176
179
|
featureFlags: featureFlags
|
|
177
180
|
});
|
|
178
|
-
|
|
181
|
+
var uiMediaSingleStyles = layout === 'full-width' || layout === 'wide' ? [uiMediaSingleBaseStyles, uiMediaSingleLayoutStyles] : [uiMediaSingleBaseStyles];
|
|
182
|
+
return jsx(UIMediaSingle, {
|
|
183
|
+
css: uiMediaSingleStyles,
|
|
179
184
|
handleMediaSingleRef: ref,
|
|
180
185
|
layout: layout,
|
|
181
186
|
width: width,
|
|
@@ -184,10 +189,10 @@ var MediaSingle = function MediaSingle(props) {
|
|
|
184
189
|
containerWidth: containerWidth,
|
|
185
190
|
pctWidth: pctWidth,
|
|
186
191
|
fullWidthMode: isFullWidth
|
|
187
|
-
},
|
|
192
|
+
}, jsx(Fragment, null, mediaComponent), isCaptionsFlaggedOn && caption);
|
|
188
193
|
};
|
|
189
194
|
|
|
190
|
-
return observedWidthFlag ? renderMediaSingle(observedWidth || document.body.offsetWidth) :
|
|
195
|
+
return observedWidthFlag ? renderMediaSingle(observedWidth || document.body.offsetWidth) : jsx(WidthConsumer, null, function (_ref3) {
|
|
191
196
|
var width = _ref3.width,
|
|
192
197
|
breakpoint = _ref3.breakpoint;
|
|
193
198
|
return renderMediaSingle(width, breakpoint);
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
|
|
3
|
-
var _templateObject;
|
|
3
|
+
var _templateObject, _templateObject2;
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
export var
|
|
8
|
-
|
|
9
|
-
return layout === 'full-width' || layout === 'wide' ? "\n margin-left: 50%;\n transform: translateX(-50%);\n " : "";
|
|
10
|
-
});
|
|
5
|
+
/** @jsx jsx */
|
|
6
|
+
import { css } from '@emotion/react';
|
|
7
|
+
export var uiMediaSingleBaseStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n transition: all 0.1s linear;\n"])));
|
|
8
|
+
export var uiMediaSingleLayoutStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin-left: 50%;\n transform: translateX(-50%);\n"])));
|