@atlaskit/renderer 92.0.1 → 93.0.2
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 +76 -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/actions/index.d.ts +1 -4
- 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/copy-text-provider.d.ts +1 -1
- package/dist/types/react/nodes/embedCard.d.ts +3 -2
- package/dist/types/react/nodes/extension.d.ts +2 -2
- package/dist/types/react/nodes/fallback.d.ts +1 -1
- package/dist/types/react/nodes/heading-anchor.d.ts +1 -0
- package/dist/types/react/nodes/index.d.ts +20 -38
- package/dist/types/react/nodes/inlineCard.d.ts +20 -20
- package/dist/types/react/nodes/media.d.ts +1 -1
- package/dist/types/react/nodes/mediaGroup.d.ts +3 -3
- 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/nodes/table.d.ts +80 -80
- 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 +2 -4
- 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/SmartCardStorage.d.ts +21 -20
- package/dist/types/ui/SortingIcon.d.ts +8 -6
- package/dist/types/ui/renderer-props.d.ts +14 -2
- package/dist/types/utils.d.ts +1 -1
- package/package.json +23 -25
|
@@ -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/es2019/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
|
};
|
|
@@ -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,13 +1,21 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
1
4
|
import React from 'react';
|
|
2
|
-
import
|
|
5
|
+
import { css, jsx } from '@emotion/react';
|
|
3
6
|
import { alignmentPositionMap } from '@atlaskit/adf-schema';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
|
|
8
|
+
const MarkWrapper = props => {
|
|
9
|
+
const styles = props['data-align'] ? css`
|
|
10
|
+
text-align: ${alignmentPositionMap[props['data-align']]};
|
|
11
|
+
` : '';
|
|
12
|
+
return jsx("div", _extends({
|
|
13
|
+
css: styles
|
|
14
|
+
}, props), props.children);
|
|
15
|
+
};
|
|
16
|
+
|
|
9
17
|
export default function Alignment(props) {
|
|
10
|
-
return
|
|
18
|
+
return jsx(MarkWrapper, {
|
|
11
19
|
className: "fabric-editor-block-mark",
|
|
12
20
|
"data-align": props.align
|
|
13
21
|
}, props.children);
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { css, jsx } from '@emotion/react';
|
|
3
3
|
import { WidthConsumer } from '@atlaskit/editor-common/ui';
|
|
4
4
|
import { calcBreakoutWidth } from '@atlaskit/editor-common/utils';
|
|
5
5
|
import { blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
|
|
6
|
-
export const
|
|
6
|
+
export const wrapperStyles = css`
|
|
7
7
|
margin: ${blockNodesVerticalMargin} 0;
|
|
8
8
|
margin-left: 50%;
|
|
9
9
|
transform: translateX(-50%);
|
|
10
10
|
`;
|
|
11
11
|
export default function Breakout(props) {
|
|
12
|
-
return
|
|
12
|
+
return jsx(WidthConsumer, null, ({
|
|
13
13
|
width
|
|
14
|
-
}) =>
|
|
14
|
+
}) => jsx("div", {
|
|
15
|
+
css: wrapperStyles,
|
|
15
16
|
"data-mode": props.mode,
|
|
16
17
|
style: {
|
|
17
18
|
width: calcBreakoutWidth(props.mode, width)
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
4
|
+
import React, { Fragment } from 'react';
|
|
5
|
+
import { css, jsx } from '@emotion/react';
|
|
3
6
|
import { B400, B300 } from '@atlaskit/theme/colors';
|
|
4
|
-
import styled from 'styled-components';
|
|
5
7
|
import { getEventHandler } from '../../utils';
|
|
6
8
|
import { PLATFORM, MODE } from '../../analytics/events';
|
|
7
9
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../../analytics/enums';
|
|
8
|
-
const
|
|
10
|
+
const anchorStyles = css`
|
|
9
11
|
color: ${B400};
|
|
10
12
|
|
|
11
13
|
&:hover {
|
|
@@ -35,10 +37,11 @@ export default function Link(props) {
|
|
|
35
37
|
const handler = getEventHandler(eventHandlers, 'link');
|
|
36
38
|
|
|
37
39
|
if (isMediaLink) {
|
|
38
|
-
return
|
|
40
|
+
return jsx(Fragment, null, props.children);
|
|
39
41
|
}
|
|
40
42
|
|
|
41
|
-
return
|
|
43
|
+
return jsx("a", _extends({
|
|
44
|
+
css: anchorStyles,
|
|
42
45
|
onClick: e => {
|
|
43
46
|
if (fireAnalyticsEvent) {
|
|
44
47
|
fireAnalyticsEvent({
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { css, jsx } from '@emotion/react';
|
|
1
3
|
import React, { useState } from 'react';
|
|
2
4
|
import { injectIntl } from 'react-intl-next';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
5
|
import Tooltip from '@atlaskit/tooltip';
|
|
5
6
|
import Button from '@atlaskit/button/custom-theme-button';
|
|
6
7
|
import CopyIcon from '@atlaskit/icon/glyph/copy';
|
|
7
8
|
import { N20, N30, N700 } from '@atlaskit/theme/colors';
|
|
8
9
|
import { CopyTextConsumer } from './copy-text-provider';
|
|
9
10
|
import { codeBlockCopyButtonMessages } from '../../messages';
|
|
10
|
-
const
|
|
11
|
+
const copyButtonWrapperStyles = css`
|
|
11
12
|
display: flex;
|
|
12
13
|
position: sticky;
|
|
13
14
|
justify-content: flex-end;
|
|
@@ -24,7 +25,7 @@ const CopyButtonWrapper = styled.span`
|
|
|
24
25
|
padding: 2px;
|
|
25
26
|
opacity: 0;
|
|
26
27
|
transition: opacity 0.2s ease 0s;
|
|
27
|
-
border: 2px solid #
|
|
28
|
+
border: 2px solid #fff;
|
|
28
29
|
border-radius: 4px;
|
|
29
30
|
background-color: ${N20};
|
|
30
31
|
color: rgb(66, 82, 110);
|
|
@@ -36,7 +37,7 @@ const CopyButtonWrapper = styled.span`
|
|
|
36
37
|
|
|
37
38
|
button.clicked {
|
|
38
39
|
background-color: ${N700};
|
|
39
|
-
color: #
|
|
40
|
+
color: #fff !important;
|
|
40
41
|
}
|
|
41
42
|
`;
|
|
42
43
|
|
|
@@ -52,22 +53,24 @@ const CopyButton = ({
|
|
|
52
53
|
setClassName('copy-to-clipboard');
|
|
53
54
|
};
|
|
54
55
|
|
|
55
|
-
return
|
|
56
|
+
return jsx(CopyTextConsumer, null, ({
|
|
56
57
|
copyTextToClipboard
|
|
57
58
|
}) => {
|
|
58
|
-
return
|
|
59
|
+
return jsx("span", {
|
|
60
|
+
css: copyButtonWrapperStyles
|
|
61
|
+
}, jsx(Tooltip, {
|
|
59
62
|
content: tooltip,
|
|
60
63
|
hideTooltipOnClick: false,
|
|
61
64
|
position: "top"
|
|
62
|
-
},
|
|
65
|
+
}, jsx("div", {
|
|
63
66
|
onMouseLeave: onMouseLeave
|
|
64
|
-
},
|
|
67
|
+
}, jsx(Button, {
|
|
65
68
|
className: className,
|
|
66
69
|
"aria-label": tooltip,
|
|
67
70
|
spacing: "compact",
|
|
68
71
|
appearance: "subtle",
|
|
69
72
|
"aria-haspopup": true,
|
|
70
|
-
iconBefore:
|
|
73
|
+
iconBefore: jsx(CopyIcon, {
|
|
71
74
|
label: tooltip
|
|
72
75
|
}),
|
|
73
76
|
onClick: () => {
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
4
|
+
import { css, jsx } from '@emotion/react';
|
|
5
|
+
import { useMemo, useContext, useState, useRef } from 'react';
|
|
3
6
|
import { Card, Context as CardContext, EmbedResizeMessageListener } from '@atlaskit/smart-card';
|
|
4
7
|
import { WidthConsumer, mapBreakpointToLayoutMaxWidth, UnsupportedBlock, MediaSingle as UIMediaSingle } from '@atlaskit/editor-common/ui';
|
|
5
8
|
import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH, getAkEditorFullPageMaxWidth } from '@atlaskit/editor-shared-styles';
|
|
6
9
|
import { getPlatform } from '../../utils';
|
|
7
10
|
import { CardErrorBoundary } from './fallback';
|
|
8
|
-
import styled from 'styled-components';
|
|
9
11
|
import { FullPagePadding } from '../../ui/Renderer/style';
|
|
10
12
|
import { getCardClickHandler } from '../utils/getCardClickHandler';
|
|
11
|
-
const
|
|
13
|
+
const embedCardWrapperStyles = css`
|
|
12
14
|
width: 100%;
|
|
13
15
|
height: 100%;
|
|
14
16
|
|
|
@@ -22,16 +24,10 @@ const EmbedCardWrapper = styled.div`
|
|
|
22
24
|
|
|
23
25
|
margin: 0 auto;
|
|
24
26
|
`;
|
|
25
|
-
|
|
26
|
-
const ExtendedEmbedCard = styled(UIMediaSingle)`
|
|
27
|
-
${({
|
|
28
|
-
layout
|
|
29
|
-
}) => layout === 'full-width' || layout === 'wide' ? `
|
|
27
|
+
const uIMediaSingleLayoutStyles = css`
|
|
30
28
|
margin-left: 50%;
|
|
31
29
|
transform: translateX(-50%);
|
|
32
|
-
` : ``}
|
|
33
30
|
`;
|
|
34
|
-
ExtendedEmbedCard.displayName = 'ExtendedEmbedCard';
|
|
35
31
|
export default function EmbedCard(props) {
|
|
36
32
|
const {
|
|
37
33
|
url,
|
|
@@ -97,7 +93,7 @@ export default function EmbedCard(props) {
|
|
|
97
93
|
setAspectRatio(resolvedAspectRatio);
|
|
98
94
|
};
|
|
99
95
|
|
|
100
|
-
return
|
|
96
|
+
return jsx(WidthConsumer, null, ({
|
|
101
97
|
width: containerWidth,
|
|
102
98
|
breakpoint
|
|
103
99
|
}) => {
|
|
@@ -117,12 +113,14 @@ export default function EmbedCard(props) {
|
|
|
117
113
|
}
|
|
118
114
|
|
|
119
115
|
const lineLength = isFullWidth ? Math.min(akEditorFullWidthLayoutWidth, containerWidth - padding) : nonFullWidthSize;
|
|
120
|
-
|
|
116
|
+
const 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,
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
|
|
4
|
+
/** @jsx jsx */
|
|
3
5
|
import React from 'react';
|
|
4
|
-
import
|
|
6
|
+
import { css, jsx } from '@emotion/react';
|
|
5
7
|
import { N200, N500, B400 } from '@atlaskit/theme/colors';
|
|
6
8
|
import LinkIcon from '@atlaskit/icon/glyph/link';
|
|
7
9
|
import Tooltip from '@atlaskit/tooltip';
|
|
@@ -13,12 +15,12 @@ const CopyAnchorWrapperWithRef = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
13
15
|
children,
|
|
14
16
|
...rest
|
|
15
17
|
} = props;
|
|
16
|
-
return
|
|
18
|
+
return jsx("span", _extends({}, rest, {
|
|
17
19
|
className: HeadingAnchorWrapperClassName,
|
|
18
20
|
ref: ref
|
|
19
21
|
}), children);
|
|
20
22
|
});
|
|
21
|
-
const
|
|
23
|
+
const copyAnchorButtonStyles = css`
|
|
22
24
|
display: inline;
|
|
23
25
|
outline: none;
|
|
24
26
|
background-color: transparent;
|
|
@@ -72,11 +74,12 @@ class HeadingAnchor extends React.PureComponent {
|
|
|
72
74
|
});
|
|
73
75
|
|
|
74
76
|
_defineProperty(this, "renderAnchorButton", () => {
|
|
75
|
-
return
|
|
77
|
+
return jsx("button", {
|
|
78
|
+
css: copyAnchorButtonStyles,
|
|
76
79
|
onMouseLeave: this.resetMessage,
|
|
77
80
|
onClick: this.copyToClipboard,
|
|
78
81
|
"aria-label": this.state.tooltipMessage
|
|
79
|
-
},
|
|
82
|
+
}, jsx(LinkIcon, {
|
|
80
83
|
label: this.getCopyAriaLabel(),
|
|
81
84
|
size: this.props.level > 3 ? 'small' : 'medium',
|
|
82
85
|
primaryColor: this.state.isClicked ? B400 : N200
|
|
@@ -97,7 +100,7 @@ class HeadingAnchor extends React.PureComponent {
|
|
|
97
100
|
// We set the key to the message to ensure it remounts when the message
|
|
98
101
|
// changes, so that it correctly repositions.
|
|
99
102
|
// @see https://ecosystem.atlassian.net/projects/AK/queues/issue/AK-6548
|
|
100
|
-
return
|
|
103
|
+
return jsx(Tooltip, {
|
|
101
104
|
tag: CopyAnchorWrapperWithRef,
|
|
102
105
|
content: tooltipMessage,
|
|
103
106
|
position: "top",
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { default as React, Fragment } from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
2
4
|
import { injectIntl } from 'react-intl-next';
|
|
3
5
|
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
4
|
-
import { mapBreakpointToLayoutMaxWidth, getBreakpoint, WidthConsumer } from '@atlaskit/editor-common/ui';
|
|
6
|
+
import { mapBreakpointToLayoutMaxWidth, getBreakpoint, MediaSingle as UIMediaSingle, WidthConsumer } from '@atlaskit/editor-common/ui';
|
|
5
7
|
import { akEditorFullWidthLayoutWidth, getAkEditorFullPageMaxWidth, akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
6
8
|
import { FullPagePadding } from '../../../ui/Renderer/style';
|
|
7
9
|
import { useObservedWidth } from '../../hooks/use-observed-width';
|
|
8
|
-
import {
|
|
10
|
+
import { uiMediaSingleBaseStyles, uiMediaSingleLayoutStyles } from './styles';
|
|
9
11
|
const DEFAULT_WIDTH = 250;
|
|
10
12
|
const DEFAULT_HEIGHT = 200;
|
|
11
13
|
|
|
@@ -166,7 +168,9 @@ const MediaSingle = props => {
|
|
|
166
168
|
disableOverlay: true,
|
|
167
169
|
featureFlags
|
|
168
170
|
});
|
|
169
|
-
|
|
171
|
+
const uiMediaSingleStyles = layout === 'full-width' || layout === 'wide' ? [uiMediaSingleBaseStyles, uiMediaSingleLayoutStyles] : [uiMediaSingleBaseStyles];
|
|
172
|
+
return jsx(UIMediaSingle, {
|
|
173
|
+
css: uiMediaSingleStyles,
|
|
170
174
|
handleMediaSingleRef: ref,
|
|
171
175
|
layout: layout,
|
|
172
176
|
width: width,
|
|
@@ -175,10 +179,10 @@ const MediaSingle = props => {
|
|
|
175
179
|
containerWidth: containerWidth,
|
|
176
180
|
pctWidth: pctWidth,
|
|
177
181
|
fullWidthMode: isFullWidth
|
|
178
|
-
},
|
|
182
|
+
}, jsx(Fragment, null, mediaComponent), isCaptionsFlaggedOn && caption);
|
|
179
183
|
};
|
|
180
184
|
|
|
181
|
-
return observedWidthFlag ? renderMediaSingle(observedWidth || document.body.offsetWidth) :
|
|
185
|
+
return observedWidthFlag ? renderMediaSingle(observedWidth || document.body.offsetWidth) : jsx(WidthConsumer, null, ({
|
|
182
186
|
width,
|
|
183
187
|
breakpoint
|
|
184
188
|
}) => {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
export const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { css } from '@emotion/react';
|
|
3
|
+
export const uiMediaSingleBaseStyles = css`
|
|
4
|
+
transition: all 0.1s linear;
|
|
5
|
+
`;
|
|
6
|
+
export const uiMediaSingleLayoutStyles = css`
|
|
7
7
|
margin-left: 50%;
|
|
8
8
|
transform: translateX(-50%);
|
|
9
|
-
` : ``} transition: all 0.1s linear;
|
|
10
9
|
`;
|
|
@@ -1,32 +1,52 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
1
4
|
import React from 'react';
|
|
2
|
-
import
|
|
5
|
+
import { css, jsx } from '@emotion/react';
|
|
3
6
|
import TipIcon from '@atlaskit/icon/glyph/editor/hint';
|
|
4
7
|
import { PanelType } from '@atlaskit/adf-schema';
|
|
5
|
-
import { PanelSharedCssClassName } from '@atlaskit/editor-common/
|
|
8
|
+
import { getPanelBackgroundDarkModeColors, panelSharedStylesWithoutPrefix, PanelSharedCssClassName } from '@atlaskit/editor-common/panel';
|
|
6
9
|
import EmojiIcon from '@atlaskit/icon/glyph/editor/emoji';
|
|
7
10
|
import EmojiItem from './emoji'; // AFP-2532 TODO: Fix automatic suppressions below
|
|
8
11
|
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
9
12
|
|
|
10
13
|
import { themed } from '@atlaskit/theme';
|
|
11
|
-
import { getPanelBackgroundDarkModeColors } from '@atlaskit/editor-common/styles';
|
|
12
14
|
import { PanelInfoIcon, PanelSuccessIcon, PanelNoteIcon, PanelWarningIcon, PanelErrorIcon } from '@atlaskit/editor-common/icons';
|
|
13
|
-
const PanelStyled = styled.div`
|
|
14
|
-
${props => {
|
|
15
|
-
if (props['data-panel-type'] !== PanelType.CUSTOM || !props.backgroundColor) {
|
|
16
|
-
return '';
|
|
17
|
-
} // Similar to mainDynamicStyles()
|
|
18
15
|
|
|
16
|
+
const PanelStyled = props => {
|
|
17
|
+
let styles = theme => css`
|
|
18
|
+
&.${PanelSharedCssClassName.prefix} {
|
|
19
|
+
${panelSharedStylesWithoutPrefix({
|
|
20
|
+
theme
|
|
21
|
+
})}
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
if (props['data-panel-type'] === PanelType.CUSTOM && props.backgroundColor) {
|
|
26
|
+
styles = theme => css`
|
|
27
|
+
&.${PanelSharedCssClassName.prefix} {
|
|
28
|
+
${panelSharedStylesWithoutPrefix({
|
|
29
|
+
theme
|
|
30
|
+
})}
|
|
31
|
+
}
|
|
19
32
|
|
|
20
|
-
return `
|
|
21
33
|
&[data-panel-type=${PanelType.CUSTOM}] {
|
|
22
34
|
background-color: ${props.backgroundColor};
|
|
23
35
|
${themed({
|
|
24
|
-
|
|
25
|
-
|
|
36
|
+
dark: getPanelBackgroundDarkModeColors
|
|
37
|
+
})({
|
|
38
|
+
theme
|
|
39
|
+
})};
|
|
26
40
|
}
|
|
27
41
|
`;
|
|
28
|
-
}
|
|
29
|
-
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return jsx("div", _extends({
|
|
45
|
+
css: styles
|
|
46
|
+
}, props), props.children);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
PanelStyled.displayName = 'PanelStyled';
|
|
30
50
|
const panelIcons = {
|
|
31
51
|
info: PanelInfoIcon,
|
|
32
52
|
success: PanelSuccessIcon,
|
|
@@ -55,7 +75,7 @@ const Panel = props => {
|
|
|
55
75
|
const getIcon = () => {
|
|
56
76
|
if (panelType === PanelType.CUSTOM) {
|
|
57
77
|
if (panelIcon && providers) {
|
|
58
|
-
return
|
|
78
|
+
return jsx(EmojiItem, {
|
|
59
79
|
id: panelIconId,
|
|
60
80
|
text: panelIconText,
|
|
61
81
|
shortName: panelIcon,
|
|
@@ -67,7 +87,7 @@ const Panel = props => {
|
|
|
67
87
|
}
|
|
68
88
|
|
|
69
89
|
const Icon = panelIcons[panelType];
|
|
70
|
-
return
|
|
90
|
+
return jsx(Icon, {
|
|
71
91
|
label: `Panel ${panelType}`
|
|
72
92
|
});
|
|
73
93
|
};
|
|
@@ -76,13 +96,13 @@ const Panel = props => {
|
|
|
76
96
|
const icon = getIcon();
|
|
77
97
|
|
|
78
98
|
if (icon) {
|
|
79
|
-
return
|
|
99
|
+
return jsx("div", {
|
|
80
100
|
className: PanelSharedCssClassName.icon
|
|
81
101
|
}, icon);
|
|
82
102
|
}
|
|
83
103
|
};
|
|
84
104
|
|
|
85
|
-
return
|
|
105
|
+
return jsx(PanelStyled, {
|
|
86
106
|
className: PanelSharedCssClassName.prefix,
|
|
87
107
|
"data-panel-type": panelType,
|
|
88
108
|
"data-panel-color": panelColor,
|
|
@@ -90,7 +110,7 @@ const Panel = props => {
|
|
|
90
110
|
"data-panel-icon-id": panelIconId,
|
|
91
111
|
"data-panel-icon-text": panelIconText,
|
|
92
112
|
backgroundColor: panelColor
|
|
93
|
-
}, renderIcon(),
|
|
113
|
+
}, renderIcon(), jsx("div", {
|
|
94
114
|
className: PanelSharedCssClassName.content
|
|
95
115
|
}, children));
|
|
96
116
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
1
2
|
import React from 'react';
|
|
2
|
-
import
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
3
4
|
import { TableSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
4
5
|
import { akEditorStickyHeaderZIndex } from '@atlaskit/editor-shared-styles';
|
|
5
6
|
import * as colors from '@atlaskit/theme/colors';
|
|
@@ -10,38 +11,30 @@ import { findHorizontalOverflowScrollParent } from '../../../utils';
|
|
|
10
11
|
import { Table } from './table';
|
|
11
12
|
import { recursivelyInjectProps } from '../../utils/inject-props';
|
|
12
13
|
export const tableStickyPadding = 8;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
left,
|
|
18
|
-
top
|
|
19
|
-
}) => ({
|
|
20
|
-
left: left && left < 0 ? left : undefined,
|
|
21
|
-
top
|
|
22
|
-
})
|
|
23
|
-
})`
|
|
24
|
-
position: relative;
|
|
25
|
-
`;
|
|
26
|
-
export const FixedTableDiv = styled.div.attrs({
|
|
27
|
-
style: ({
|
|
28
|
-
top,
|
|
29
|
-
wrapperWidth
|
|
30
|
-
}) => ({
|
|
31
|
-
top,
|
|
32
|
-
width: wrapperWidth
|
|
33
|
-
})
|
|
34
|
-
})`
|
|
35
|
-
${props => props.mode === 'stick' ? 'position: fixed' : ''};
|
|
36
|
-
${props => props.mode === 'pin-bottom' ? 'position: absolute' : ''};
|
|
37
|
-
${props => props.mode === 'none' ? 'display: none' : ''};
|
|
14
|
+
const fixedTableDivModeToPosition = {
|
|
15
|
+
stick: 'fixed',
|
|
16
|
+
'pin-bottom': 'absolute'
|
|
17
|
+
};
|
|
38
18
|
|
|
39
|
-
|
|
19
|
+
const getModeSpecificStyles = mode => {
|
|
20
|
+
if (mode === 'none') {
|
|
21
|
+
return css`
|
|
22
|
+
display: none;
|
|
23
|
+
`;
|
|
24
|
+
} else {
|
|
25
|
+
return css`
|
|
26
|
+
position: ${fixedTableDivModeToPosition[mode]};
|
|
27
|
+
`;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
40
30
|
|
|
41
|
-
|
|
42
|
-
|
|
31
|
+
const fixedTableDivStaticStyles = (top, width) => css`
|
|
32
|
+
top: ${top}px;
|
|
33
|
+
width: ${width}px;
|
|
34
|
+
z-index: ${akEditorStickyHeaderZIndex};
|
|
35
|
+
&
|
|
43
36
|
.${TableSharedCssClassName.TABLE_CONTAINER},
|
|
44
|
-
|
|
37
|
+
&
|
|
45
38
|
.${TableSharedCssClassName.TABLE_STICKY_WRAPPER}
|
|
46
39
|
> table {
|
|
47
40
|
margin-top: 0;
|
|
@@ -56,15 +49,26 @@ export const FixedTableDiv = styled.div.attrs({
|
|
|
56
49
|
display: none;
|
|
57
50
|
}
|
|
58
51
|
|
|
59
|
-
|
|
52
|
+
&
|
|
60
53
|
.${TableSharedCssClassName.TABLE_CONTAINER}.right-shadow::after,
|
|
61
|
-
|
|
54
|
+
&
|
|
62
55
|
.${TableSharedCssClassName.TABLE_CONTAINER}.left-shadow::before {
|
|
63
56
|
top: 0px;
|
|
64
57
|
height: 100%;
|
|
65
58
|
}
|
|
66
59
|
`;
|
|
67
|
-
|
|
60
|
+
|
|
61
|
+
export const FixedTableDiv = props => {
|
|
62
|
+
const {
|
|
63
|
+
top,
|
|
64
|
+
wrapperWidth,
|
|
65
|
+
mode
|
|
66
|
+
} = props;
|
|
67
|
+
const fixedTableCss = [fixedTableDivStaticStyles(top, wrapperWidth), getModeSpecificStyles(mode)];
|
|
68
|
+
return jsx("div", {
|
|
69
|
+
css: fixedTableCss
|
|
70
|
+
}, props.children);
|
|
71
|
+
};
|
|
68
72
|
export const StickyTable = ({
|
|
69
73
|
top,
|
|
70
74
|
left,
|
|
@@ -81,26 +85,29 @@ export const StickyTable = ({
|
|
|
81
85
|
allowDynamicTextSizing,
|
|
82
86
|
rowHeight
|
|
83
87
|
}) => {
|
|
84
|
-
return
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
+
return jsx("div", {
|
|
89
|
+
css: {
|
|
90
|
+
left: left && left < 0 ? left : undefined,
|
|
91
|
+
top: mode === 'pin-bottom' ? top : undefined,
|
|
92
|
+
position: 'relative'
|
|
93
|
+
}
|
|
94
|
+
}, jsx(FixedTableDiv, {
|
|
88
95
|
top: mode === 'stick' ? top : undefined,
|
|
89
96
|
mode: rowHeight > 300 ? 'none' : mode,
|
|
90
97
|
wrapperWidth: wrapperWidth
|
|
91
|
-
},
|
|
98
|
+
}, jsx("div", {
|
|
92
99
|
className: `${TableSharedCssClassName.TABLE_CONTAINER} ${shadowClassNames}`,
|
|
93
100
|
"data-layout": layout,
|
|
94
101
|
style: {
|
|
95
102
|
width: tableWidth
|
|
96
103
|
}
|
|
97
|
-
},
|
|
98
|
-
|
|
104
|
+
}, jsx("div", {
|
|
105
|
+
ref: innerRef,
|
|
99
106
|
className: `${TableSharedCssClassName.TABLE_STICKY_WRAPPER}`,
|
|
100
107
|
style: {
|
|
101
108
|
overflow: 'hidden'
|
|
102
109
|
}
|
|
103
|
-
},
|
|
110
|
+
}, jsx(Table, {
|
|
104
111
|
columnWidths: columnWidths,
|
|
105
112
|
layout: layout,
|
|
106
113
|
isNumberColumnEnabled: isNumberColumnEnabled,
|