@atlaskit/renderer 109.19.3 → 109.19.5
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 +14 -0
- package/dist/cjs/actions/index.js +1 -1
- package/dist/cjs/react/marks/alignment.js +8 -4
- package/dist/cjs/react/marks/breakout.js +7 -4
- package/dist/cjs/react/marks/link.js +12 -4
- package/dist/cjs/react/nodes/codeBlock/components/codeBlockContainer.js +1 -0
- package/dist/cjs/react/nodes/codeBlock/components/lightWeightCodeBlock.js +2 -0
- package/dist/cjs/react/nodes/heading-anchor.js +9 -3
- package/dist/cjs/react/nodes/layoutColumn.js +2 -3
- package/dist/cjs/react/nodes/media/index.js +2 -2
- package/dist/cjs/react/nodes/mediaSingle/styles.js +9 -5
- package/dist/cjs/react/nodes/multiBodiedExtension.js +6 -1
- package/dist/cjs/steps/index.js +53 -27
- package/dist/cjs/ui/Expand.js +41 -15
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/cjs/ui/Renderer/style.js +2 -1
- package/dist/cjs/ui/Renderer/truncated-wrapper.js +16 -5
- package/dist/cjs/ui/SortingIcon.js +24 -3
- package/dist/es2019/actions/index.js +1 -1
- package/dist/es2019/react/marks/alignment.js +9 -4
- package/dist/es2019/react/marks/breakout.js +6 -5
- package/dist/es2019/react/marks/link.js +9 -11
- package/dist/es2019/react/nodes/codeBlock/components/codeBlockContainer.js +2 -0
- package/dist/es2019/react/nodes/codeBlock/components/lightWeightCodeBlock.js +2 -0
- package/dist/es2019/react/nodes/heading-anchor.js +9 -9
- package/dist/es2019/react/nodes/layoutColumn.js +1 -4
- package/dist/es2019/react/nodes/media/index.js +2 -2
- package/dist/es2019/react/nodes/mediaSingle/styles.js +8 -7
- package/dist/es2019/react/nodes/multiBodiedExtension.js +6 -1
- package/dist/es2019/steps/index.js +51 -29
- package/dist/es2019/ui/Expand.js +37 -22
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/es2019/ui/Renderer/style.js +2 -1
- package/dist/es2019/ui/Renderer/truncated-wrapper.js +14 -16
- package/dist/es2019/ui/SortingIcon.js +23 -23
- package/dist/esm/actions/index.js +1 -1
- package/dist/esm/react/marks/alignment.js +8 -4
- package/dist/esm/react/marks/breakout.js +6 -3
- package/dist/esm/react/marks/link.js +10 -3
- package/dist/esm/react/nodes/codeBlock/components/codeBlockContainer.js +2 -0
- package/dist/esm/react/nodes/codeBlock/components/lightWeightCodeBlock.js +2 -0
- package/dist/esm/react/nodes/heading-anchor.js +9 -3
- package/dist/esm/react/nodes/layoutColumn.js +1 -3
- package/dist/esm/react/nodes/media/index.js +2 -2
- package/dist/esm/react/nodes/mediaSingle/styles.js +8 -4
- package/dist/esm/react/nodes/multiBodiedExtension.js +6 -1
- package/dist/esm/steps/index.js +53 -27
- package/dist/esm/ui/Expand.js +41 -15
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/dist/esm/ui/Renderer/style.js +2 -1
- package/dist/esm/ui/Renderer/truncated-wrapper.js +15 -3
- package/dist/esm/ui/SortingIcon.js +25 -2
- package/dist/types/react/marks/alignment.d.ts +2 -2
- package/dist/types/react/marks/breakout.d.ts +2 -2
- package/dist/types/react/marks/link.d.ts +2 -2
- package/dist/types-ts4.5/react/marks/alignment.d.ts +2 -2
- package/dist/types-ts4.5/react/marks/breakout.d.ts +2 -2
- package/dist/types-ts4.5/react/marks/link.d.ts +2 -2
- package/package.json +6 -6
|
@@ -4,12 +4,17 @@ import React from 'react';
|
|
|
4
4
|
import { css, jsx } from '@emotion/react';
|
|
5
5
|
import { alignmentPositionMap } from '@atlaskit/adf-schema';
|
|
6
6
|
const MarkWrapper = props => {
|
|
7
|
-
const styles = props['data-align'] ?
|
|
7
|
+
const styles = props['data-align'] ?
|
|
8
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
9
|
+
css`
|
|
8
10
|
text-align: ${alignmentPositionMap[props['data-align']]};
|
|
9
11
|
` : '';
|
|
10
|
-
return
|
|
11
|
-
css
|
|
12
|
-
|
|
12
|
+
return (
|
|
13
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
14
|
+
jsx("div", _extends({
|
|
15
|
+
css: styles
|
|
16
|
+
}, props), props.children)
|
|
17
|
+
);
|
|
13
18
|
};
|
|
14
19
|
export default function Alignment(props) {
|
|
15
20
|
return jsx(MarkWrapper, {
|
|
@@ -3,11 +3,12 @@ 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 wrapperStyles = css
|
|
7
|
-
margin:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
export const wrapperStyles = css({
|
|
7
|
+
margin: `${blockNodesVerticalMargin} 0`,
|
|
8
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
9
|
+
marginLeft: '50%',
|
|
10
|
+
transform: 'translateX(-50%)'
|
|
11
|
+
});
|
|
11
12
|
export default function Breakout(props) {
|
|
12
13
|
return jsx(WidthConsumer, null, ({
|
|
13
14
|
width
|
|
@@ -8,18 +8,16 @@ import { PLATFORM, MODE } from '../../analytics/events';
|
|
|
8
8
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
9
9
|
import LinkUrl from '@atlaskit/smart-card/link-url';
|
|
10
10
|
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
11
|
-
const anchorStyles = css
|
|
12
|
-
color:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
const anchorStyles = css({
|
|
12
|
+
color: `var(--ds-link, ${B400})`,
|
|
13
|
+
'&:hover': {
|
|
14
|
+
color: `var(--ds-link, ${B300})`,
|
|
15
|
+
textDecoration: 'underline'
|
|
16
|
+
},
|
|
17
|
+
'&:active': {
|
|
18
|
+
color: `var(--ds-link-pressed, ${B500})`
|
|
17
19
|
}
|
|
18
|
-
|
|
19
|
-
&:active {
|
|
20
|
-
color: ${`var(--ds-link-pressed, ${B500})`};
|
|
21
|
-
}
|
|
22
|
-
`;
|
|
20
|
+
});
|
|
23
21
|
export default function Link(props) {
|
|
24
22
|
const {
|
|
25
23
|
href,
|
|
@@ -5,6 +5,8 @@ import { N20 } from '@atlaskit/theme/colors';
|
|
|
5
5
|
import { fontSize } from '@atlaskit/theme/constants';
|
|
6
6
|
import { CodeBlockSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
7
7
|
import CodeBlockButtonContainer from './codeBlockButtonContainer';
|
|
8
|
+
|
|
9
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
8
10
|
const codeBlockStyleOverrides = css`
|
|
9
11
|
tab-size: 4;
|
|
10
12
|
background-color: ${`var(--ds-surface-raised, ${N20})`};
|
|
@@ -5,6 +5,7 @@ import { blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
|
|
|
5
5
|
import { codeBlockSharedStyles, CodeBlockSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
6
6
|
import { useBidiWarnings } from '../../../hooks/use-bidi-warnings';
|
|
7
7
|
import { RendererCssClassName } from '../../../../consts';
|
|
8
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
8
9
|
const lightWeightCodeBlockStyles = css`
|
|
9
10
|
.${CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER} {
|
|
10
11
|
cursor: text;
|
|
@@ -20,6 +21,7 @@ export const getLightWeightCodeBlockStylesForRootRendererStyleSheet = () => {
|
|
|
20
21
|
// lightweight codeblock containers will not be targeted.
|
|
21
22
|
// NOTE: This must be added after other .code-block styles in the root
|
|
22
23
|
// Renderer stylesheet.
|
|
24
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
23
25
|
return css`
|
|
24
26
|
.${RendererCssClassName.DOCUMENT}
|
|
25
27
|
> .${LightWeightCodeBlockCssClassName.CONTAINER}
|
|
@@ -20,15 +20,15 @@ const CopyAnchorWrapperWithRef = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
20
20
|
ref: ref
|
|
21
21
|
}), children);
|
|
22
22
|
});
|
|
23
|
-
const copyAnchorButtonStyles = css
|
|
24
|
-
display: inline
|
|
25
|
-
outline: none
|
|
26
|
-
|
|
27
|
-
border: none
|
|
28
|
-
color:
|
|
29
|
-
cursor: pointer
|
|
30
|
-
right: 0
|
|
31
|
-
|
|
23
|
+
const copyAnchorButtonStyles = css({
|
|
24
|
+
display: 'inline',
|
|
25
|
+
outline: 'none',
|
|
26
|
+
backgroundColor: 'transparent',
|
|
27
|
+
border: 'none',
|
|
28
|
+
color: `var(--ds-icon, ${N500})`,
|
|
29
|
+
cursor: 'pointer',
|
|
30
|
+
right: 0
|
|
31
|
+
});
|
|
32
32
|
class HeadingAnchor extends React.PureComponent {
|
|
33
33
|
constructor(...args) {
|
|
34
34
|
super(...args);
|
|
@@ -2,10 +2,7 @@
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { jsx, css } from '@emotion/react';
|
|
4
4
|
import { WidthProvider, clearNextSiblingMarginTopStyle, clearNextSiblingBlockMarkMarginTopStyle } from '@atlaskit/editor-common/ui';
|
|
5
|
-
const layoutColumnClearMarginTopStyles = css
|
|
6
|
-
${clearNextSiblingMarginTopStyle}
|
|
7
|
-
${clearNextSiblingBlockMarkMarginTopStyle}
|
|
8
|
-
`;
|
|
5
|
+
const layoutColumnClearMarginTopStyles = css(clearNextSiblingMarginTopStyle, clearNextSiblingBlockMarkMarginTopStyle);
|
|
9
6
|
export default function LayoutSection(props) {
|
|
10
7
|
return jsx("div", {
|
|
11
8
|
"data-layout-column": true,
|
|
@@ -281,9 +281,9 @@ const MediaWithDraftAnnotation = props => {
|
|
|
281
281
|
if (pos === undefined) {
|
|
282
282
|
return;
|
|
283
283
|
}
|
|
284
|
-
if (draftPosition !== null && draftPosition.from
|
|
284
|
+
if (draftPosition !== null && draftPosition.from === pos) {
|
|
285
285
|
setShouldApplyDraftAnnotation(true);
|
|
286
|
-
setPosition(
|
|
286
|
+
setPosition(draftPosition === null || draftPosition === void 0 ? void 0 : draftPosition.from);
|
|
287
287
|
} else if (draftPosition === null && shouldApplyDraftAnnotation) {
|
|
288
288
|
setShouldApplyDraftAnnotation(false);
|
|
289
289
|
setPosition(undefined);
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { css } from '@emotion/react';
|
|
3
|
-
export const uiMediaSingleBaseStyles = css
|
|
4
|
-
transition: all 0.1s linear
|
|
5
|
-
|
|
6
|
-
export const uiMediaSingleLayoutStyles = css
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
export const uiMediaSingleBaseStyles = css({
|
|
4
|
+
transition: 'all 0.1s linear'
|
|
5
|
+
});
|
|
6
|
+
export const uiMediaSingleLayoutStyles = css({
|
|
7
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
8
|
+
marginLeft: '50%',
|
|
9
|
+
transform: 'translateX(-50%)'
|
|
10
|
+
});
|
|
@@ -40,6 +40,8 @@ const useMultiBodiedExtensionActions = ({
|
|
|
40
40
|
}, [updateActiveChild, children]);
|
|
41
41
|
return actions;
|
|
42
42
|
};
|
|
43
|
+
|
|
44
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
43
45
|
const navigationCssExtended = css`
|
|
44
46
|
${sharedMultiBodiedExtensionStyles.mbeNavigation};
|
|
45
47
|
margin-left: 0 !important;
|
|
@@ -71,6 +73,7 @@ const MultiBodiedExtension = props => {
|
|
|
71
73
|
updateActiveChild,
|
|
72
74
|
children
|
|
73
75
|
});
|
|
76
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
74
77
|
const containerCssExtended = css`
|
|
75
78
|
${sharedMultiBodiedExtensionStyles.mbeExtensionContainer};
|
|
76
79
|
.ak-renderer-extension {
|
|
@@ -132,7 +135,9 @@ const MultiBodiedExtension = props => {
|
|
|
132
135
|
}, children));
|
|
133
136
|
}
|
|
134
137
|
return jsx("section", {
|
|
135
|
-
className: "multiBodiedExtension--container"
|
|
138
|
+
className: "multiBodiedExtension--container"
|
|
139
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
140
|
+
,
|
|
136
141
|
css: containerCssExtended,
|
|
137
142
|
"data-testid": "multiBodiedExtension--container",
|
|
138
143
|
"data-active-child-index": activeChildIndex,
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
1
2
|
import { AddMarkStep } from '@atlaskit/editor-prosemirror/transform';
|
|
2
3
|
function getStartPos(element) {
|
|
3
4
|
return parseInt(element.dataset.rendererStartPos || '-1', 10);
|
|
4
5
|
}
|
|
6
|
+
const getNodeType = element => element.dataset.nodeType;
|
|
5
7
|
function isPositionPointer(element) {
|
|
6
8
|
return getStartPos(element) > -1;
|
|
7
9
|
}
|
|
@@ -17,18 +19,6 @@ function findParent(element) {
|
|
|
17
19
|
}
|
|
18
20
|
return findParent(parentElement);
|
|
19
21
|
}
|
|
20
|
-
function findMediaParent(element) {
|
|
21
|
-
const {
|
|
22
|
-
parentElement
|
|
23
|
-
} = element;
|
|
24
|
-
if (!parentElement || isRoot(parentElement)) {
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
27
|
-
if (parentElement.dataset.nodeType === 'mediaSingle') {
|
|
28
|
-
return parentElement;
|
|
29
|
-
}
|
|
30
|
-
return findParent(parentElement);
|
|
31
|
-
}
|
|
32
22
|
function findParentBeforePointer(element) {
|
|
33
23
|
const {
|
|
34
24
|
parentElement
|
|
@@ -57,22 +47,39 @@ function isNodeInlineMark(node) {
|
|
|
57
47
|
function isElementInlineMark(element) {
|
|
58
48
|
return !!element && Boolean(element.dataset.rendererMark);
|
|
59
49
|
}
|
|
50
|
+
function isNodeInlineTextMark(node) {
|
|
51
|
+
if (node === null) {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
const isInlineMark = isElementNode(node) && Boolean(node.dataset.rendererMark);
|
|
55
|
+
if (!isInlineMark) {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* This checks if the element has any descendents with the data-inline-card
|
|
61
|
+
* attribute set to 'true'. If it does, we should not consider it as an
|
|
62
|
+
* inline text mark.
|
|
63
|
+
**/
|
|
64
|
+
|
|
65
|
+
if (hasInlineCardDescendant(node)) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
60
70
|
|
|
61
71
|
/**
|
|
62
|
-
* This
|
|
63
|
-
*
|
|
72
|
+
* This checks all the descendents of a node and returns true if it reaches
|
|
73
|
+
* a descendant with the data-inline-card attribute set to 'true'.
|
|
64
74
|
*/
|
|
65
|
-
function
|
|
66
|
-
if (isTextNode(node)) {
|
|
67
|
-
return node.textContent;
|
|
68
|
-
}
|
|
75
|
+
function hasInlineCardDescendant(node) {
|
|
69
76
|
if (isElementNode(node)) {
|
|
70
77
|
if (node.dataset.inlineCard === 'true') {
|
|
71
|
-
return
|
|
78
|
+
return true;
|
|
72
79
|
}
|
|
73
|
-
return Array.from(node.childNodes).
|
|
80
|
+
return Array.from(node.childNodes).some(hasInlineCardDescendant);
|
|
74
81
|
}
|
|
75
|
-
return
|
|
82
|
+
return false;
|
|
76
83
|
}
|
|
77
84
|
function resolveNodePos(node) {
|
|
78
85
|
let resolvedPos = 0;
|
|
@@ -81,10 +88,18 @@ function resolveNodePos(node) {
|
|
|
81
88
|
if (prev && (isTextNode(prev) || isHighlightTextNode(prev))) {
|
|
82
89
|
resolvedPos += (prev.textContent || '').length;
|
|
83
90
|
} else if (prev) {
|
|
84
|
-
if (
|
|
85
|
-
|
|
91
|
+
if (getBooleanFF('platform.editor.allow-inline-comments-for-inline-nodes')) {
|
|
92
|
+
if (isNodeInlineTextMark(prev) && prev.textContent) {
|
|
93
|
+
resolvedPos += prev.textContent.length;
|
|
94
|
+
} else {
|
|
95
|
+
resolvedPos += 1;
|
|
96
|
+
}
|
|
86
97
|
} else {
|
|
87
|
-
|
|
98
|
+
if (isNodeInlineMark(prev) && prev.textContent) {
|
|
99
|
+
resolvedPos += prev.textContent.length;
|
|
100
|
+
} else {
|
|
101
|
+
resolvedPos += 1;
|
|
102
|
+
}
|
|
88
103
|
}
|
|
89
104
|
}
|
|
90
105
|
prev = prev.previousSibling;
|
|
@@ -118,9 +133,16 @@ export function resolvePos(node, offset) {
|
|
|
118
133
|
// If our range is inside an inline node
|
|
119
134
|
// We need to move our pointers to parent element
|
|
120
135
|
// since we don't want to count text inside inline nodes at all
|
|
121
|
-
if (
|
|
122
|
-
|
|
123
|
-
|
|
136
|
+
if (getBooleanFF('platform.editor.allow-inline-comments-for-inline-nodes')) {
|
|
137
|
+
if (!(isNodeInlineTextMark(preParentPointer) || isHighlightTextNode(preParentPointer))) {
|
|
138
|
+
current = current.parentElement;
|
|
139
|
+
offset = 0;
|
|
140
|
+
}
|
|
141
|
+
} else {
|
|
142
|
+
if (!(isElementInlineMark(preParentPointer) || isHighlightTextNode(preParentPointer))) {
|
|
143
|
+
current = current.parentElement;
|
|
144
|
+
offset = 0;
|
|
145
|
+
}
|
|
124
146
|
}
|
|
125
147
|
resolvedPos += resolveNodePos(current);
|
|
126
148
|
while (current && current.parentElement !== parent) {
|
|
@@ -142,8 +164,8 @@ export function getPosFromRange(range) {
|
|
|
142
164
|
endContainer,
|
|
143
165
|
endOffset
|
|
144
166
|
} = range;
|
|
145
|
-
const parent =
|
|
146
|
-
if (parent) {
|
|
167
|
+
const parent = findParent(startContainer);
|
|
168
|
+
if (parent && getNodeType(parent) === 'media') {
|
|
147
169
|
const pos = getStartPos(parent);
|
|
148
170
|
return {
|
|
149
171
|
from: pos,
|
package/dist/es2019/ui/Expand.js
CHANGED
|
@@ -14,32 +14,39 @@ import { injectIntl } from 'react-intl-next';
|
|
|
14
14
|
import { MODE, PLATFORM } from '../analytics/events';
|
|
15
15
|
import { getPlatform } from '../utils';
|
|
16
16
|
import { ActiveHeaderIdConsumer } from './active-header-id-provider';
|
|
17
|
-
const titleStyles = css
|
|
18
|
-
outline: none
|
|
19
|
-
border: none
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
display: flex
|
|
24
|
-
flex: 1
|
|
25
|
-
margin: 0
|
|
26
|
-
padding: 0 0 0 ${"var(--ds-space-050, 4px)"}
|
|
27
|
-
|
|
28
|
-
|
|
17
|
+
const titleStyles = css({
|
|
18
|
+
outline: 'none',
|
|
19
|
+
border: 'none',
|
|
20
|
+
fontSize: relativeFontSizeToBase16(fontSize()),
|
|
21
|
+
lineHeight: akEditorLineHeight,
|
|
22
|
+
fontWeight: 'normal',
|
|
23
|
+
display: 'flex',
|
|
24
|
+
flex: 1,
|
|
25
|
+
margin: 0,
|
|
26
|
+
padding: `0 0 0 ${"var(--ds-space-050, 4px)"}`,
|
|
27
|
+
textAlign: 'left'
|
|
28
|
+
});
|
|
29
29
|
const Container = props => {
|
|
30
30
|
const paddingBottom = props.expanded ? "var(--ds-space-100, 8px)" : "var(--ds-space-0, 0px)";
|
|
31
31
|
const sharedContainerStyles = sharedExpandStyles.containerStyles(props);
|
|
32
|
+
|
|
33
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
32
34
|
const styles = () => css`
|
|
33
35
|
${sharedContainerStyles()}
|
|
34
36
|
padding: 0;
|
|
35
37
|
padding-bottom: ${paddingBottom};
|
|
36
38
|
`;
|
|
37
|
-
return
|
|
38
|
-
css
|
|
39
|
-
|
|
39
|
+
return (
|
|
40
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
41
|
+
jsx("div", _extends({
|
|
42
|
+
css: styles
|
|
43
|
+
}, props), props.children)
|
|
44
|
+
);
|
|
40
45
|
};
|
|
41
46
|
const TitleContainer = props => {
|
|
42
47
|
const paddingBottom = !props.expanded ? "var(--ds-space-100, 8px)" : "var(--ds-space-0, 0px)";
|
|
48
|
+
|
|
49
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
43
50
|
const styles = () => css`
|
|
44
51
|
${sharedExpandStyles.titleContainerStyles()}
|
|
45
52
|
padding: ${"var(--ds-space-100, 8px)"};
|
|
@@ -49,24 +56,32 @@ const TitleContainer = props => {
|
|
|
49
56
|
expanded,
|
|
50
57
|
...buttonProps
|
|
51
58
|
} = props;
|
|
52
|
-
return
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
59
|
+
return (
|
|
60
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
61
|
+
jsx("button", _extends({
|
|
62
|
+
type: "button",
|
|
63
|
+
css: styles
|
|
64
|
+
}, buttonProps), props.children)
|
|
65
|
+
);
|
|
56
66
|
};
|
|
57
67
|
TitleContainer.displayName = 'TitleContainerButton';
|
|
58
68
|
const ContentContainer = props => {
|
|
59
69
|
const sharedContentStyles = sharedExpandStyles.contentStyles(props);
|
|
60
70
|
const visibility = props.expanded ? 'visible' : 'hidden';
|
|
71
|
+
|
|
72
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
61
73
|
const styles = () => css`
|
|
62
74
|
${sharedContentStyles()};
|
|
63
75
|
padding-right: ${"var(--ds-space-200, 16px)"};
|
|
64
76
|
padding-left: ${"var(--ds-space-400, 32px)"};
|
|
65
77
|
visibility: ${visibility};
|
|
66
78
|
`;
|
|
67
|
-
return
|
|
68
|
-
css
|
|
69
|
-
|
|
79
|
+
return (
|
|
80
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
81
|
+
jsx("div", _extends({
|
|
82
|
+
css: styles
|
|
83
|
+
}, props), props.children)
|
|
84
|
+
);
|
|
70
85
|
};
|
|
71
86
|
function fireExpandToggleAnalytics(nodeType, expanded, fireAnalyticsEvent) {
|
|
72
87
|
if (!fireAnalyticsEvent) {
|
|
@@ -36,7 +36,7 @@ import { EditorMediaClientProvider } from '../../react/utils/EditorMediaClientPr
|
|
|
36
36
|
export const NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
37
37
|
export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
38
38
|
const packageName = "@atlaskit/renderer";
|
|
39
|
-
const packageVersion = "109.19.
|
|
39
|
+
const packageVersion = "109.19.5";
|
|
40
40
|
export class Renderer extends PureComponent {
|
|
41
41
|
constructor(props) {
|
|
42
42
|
super(props);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation */
|
|
1
2
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
2
3
|
|
|
3
4
|
import { css } from '@emotion/react';
|
|
@@ -24,7 +25,7 @@ const telepointerStyles = () => {
|
|
|
24
25
|
colorMode
|
|
25
26
|
} = getGlobalTheme();
|
|
26
27
|
|
|
27
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
28
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
28
29
|
return css`
|
|
29
30
|
#${TELEPOINTER_ID} {
|
|
30
31
|
display: inline-block;
|
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { css, jsx } from '@emotion/react';
|
|
3
3
|
import { Component } from 'react';
|
|
4
|
-
const fadeOutStyles = (maxHeight, top, backgroundColor) => css
|
|
5
|
-
position: relative
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
&::after {
|
|
9
|
-
content: ''
|
|
10
|
-
position: absolute
|
|
11
|
-
top:
|
|
12
|
-
bottom: 0
|
|
13
|
-
left: 0
|
|
14
|
-
right: 0
|
|
15
|
-
|
|
16
|
-
${"var(--ds-background-neutral-subtle, rgba(255, 255, 255, 0))"},
|
|
17
|
-
${backgroundColor}
|
|
18
|
-
);
|
|
4
|
+
const fadeOutStyles = (maxHeight, top, backgroundColor) => css({
|
|
5
|
+
position: 'relative',
|
|
6
|
+
overflowY: 'hidden',
|
|
7
|
+
maxHeight: `${maxHeight}px`,
|
|
8
|
+
'&::after': {
|
|
9
|
+
content: "''",
|
|
10
|
+
position: 'absolute',
|
|
11
|
+
top: `${top}px`,
|
|
12
|
+
bottom: 0,
|
|
13
|
+
left: 0,
|
|
14
|
+
right: 0,
|
|
15
|
+
backgroundImage: `linear-gradient( ${"var(--ds-background-neutral-subtle, rgba(255, 255, 255, 0))"}, ${backgroundColor} )`
|
|
19
16
|
}
|
|
20
|
-
|
|
17
|
+
});
|
|
21
18
|
const FadeOut = props => {
|
|
22
19
|
const {
|
|
23
20
|
children,
|
|
@@ -27,6 +24,7 @@ const FadeOut = props => {
|
|
|
27
24
|
} = props;
|
|
28
25
|
const top = height - fadeHeight;
|
|
29
26
|
const styles = fadeOutStyles(height, top, backgroundColor);
|
|
27
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
30
28
|
return jsx("div", {
|
|
31
29
|
css: styles
|
|
32
30
|
}, children);
|
|
@@ -13,6 +13,8 @@ export let StatusClassNames = /*#__PURE__*/function (StatusClassNames) {
|
|
|
13
13
|
StatusClassNames["SORTING_NOT_ALLOWED"] = "sorting-icon-svg__not-allowed";
|
|
14
14
|
return StatusClassNames;
|
|
15
15
|
}({});
|
|
16
|
+
|
|
17
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
16
18
|
const buttonStyles = css`
|
|
17
19
|
position: absolute;
|
|
18
20
|
display: flex;
|
|
@@ -40,6 +42,8 @@ const buttonStyles = css`
|
|
|
40
42
|
cursor: not-allowed;
|
|
41
43
|
}
|
|
42
44
|
`;
|
|
45
|
+
|
|
46
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
43
47
|
const iconWrapperStyles = css`
|
|
44
48
|
width: 8px;
|
|
45
49
|
height: 12px;
|
|
@@ -60,30 +64,26 @@ const iconWrapperStyles = css`
|
|
|
60
64
|
// The icon is created with CSS due to the following Firefox issue: https://product-fabric.atlassian.net/browse/ED-8001
|
|
61
65
|
// The TL;DR is that svg's in tables mess up how HTML is copied in Firefox. Using a styled div instead solves the problem.
|
|
62
66
|
// For this reason, svg's should be avoided in tables until this issue is fixed: https://bugzilla.mozilla.org/show_bug.cgi?id=1664350
|
|
63
|
-
const iconStyles = css
|
|
64
|
-
height: 100
|
|
65
|
-
width: 2px
|
|
66
|
-
|
|
67
|
-
background:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
&::
|
|
80
|
-
transform: rotate(45deg) translate(
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
&::after {
|
|
84
|
-
transform: rotate(-45deg) translate(-6.3px, 5.7px);
|
|
67
|
+
const iconStyles = css({
|
|
68
|
+
height: '100%',
|
|
69
|
+
width: '2px',
|
|
70
|
+
borderRadius: '50px',
|
|
71
|
+
background: "var(--ds-icon, #42526E)",
|
|
72
|
+
'&::before, &::after': {
|
|
73
|
+
background: "var(--ds-icon, #42526E)",
|
|
74
|
+
content: "''",
|
|
75
|
+
height: '2px',
|
|
76
|
+
width: '6px',
|
|
77
|
+
position: 'absolute',
|
|
78
|
+
borderRadius: '50px'
|
|
79
|
+
},
|
|
80
|
+
'&::before': {
|
|
81
|
+
transform: 'rotate(45deg) translate(3.4px, 8.5px)'
|
|
82
|
+
},
|
|
83
|
+
'&::after': {
|
|
84
|
+
transform: 'rotate(-45deg) translate(-6.3px, 5.7px)'
|
|
85
85
|
}
|
|
86
|
-
|
|
86
|
+
});
|
|
87
87
|
const getIconClassName = (isSortingAllowed, sortOrdered) => {
|
|
88
88
|
const activated = sortOrdered !== SortOrder.NO_ORDER;
|
|
89
89
|
const activeStatusClass = `${RendererCssClassName.SORTABLE_COLUMN_ICON}-${activated ? 'active' : 'inactive'}`;
|
|
@@ -223,7 +223,7 @@ var RendererActions = /*#__PURE__*/function () {
|
|
|
223
223
|
|
|
224
224
|
// If from points to a node position,
|
|
225
225
|
// we need to 1 position before it for nodeAt to return the node itself
|
|
226
|
-
var beforeNodePos = Math.max(from, 0);
|
|
226
|
+
var beforeNodePos = Math.max(from - 1, 0);
|
|
227
227
|
var possibleNode = this.doc.nodeAt(beforeNodePos);
|
|
228
228
|
if ((possibleNode === null || possibleNode === void 0 ? void 0 : possibleNode.type.name) === 'media') {
|
|
229
229
|
step = new AddNodeMarkStep(beforeNodePos, this.schema.marks.annotation.create({
|
|
@@ -6,10 +6,14 @@ import React from 'react';
|
|
|
6
6
|
import { css, jsx } from '@emotion/react';
|
|
7
7
|
import { alignmentPositionMap } from '@atlaskit/adf-schema';
|
|
8
8
|
var MarkWrapper = function MarkWrapper(props) {
|
|
9
|
-
var styles = props['data-align'] ?
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
var styles = props['data-align'] ? // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
10
|
+
css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n text-align: ", ";\n "])), alignmentPositionMap[props['data-align']]) : '';
|
|
11
|
+
return (
|
|
12
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
13
|
+
jsx("div", _extends({
|
|
14
|
+
css: styles
|
|
15
|
+
}, props), props.children)
|
|
16
|
+
);
|
|
13
17
|
};
|
|
14
18
|
export default function Alignment(props) {
|
|
15
19
|
return jsx(MarkWrapper, {
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject;
|
|
3
1
|
/** @jsx jsx */
|
|
4
2
|
import { css, jsx } from '@emotion/react';
|
|
5
3
|
import { WidthConsumer } from '@atlaskit/editor-common/ui';
|
|
6
4
|
import { calcBreakoutWidth } from '@atlaskit/editor-common/utils';
|
|
7
5
|
import { blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
|
|
8
|
-
export var wrapperStyles = css(
|
|
6
|
+
export var wrapperStyles = css({
|
|
7
|
+
margin: "".concat(blockNodesVerticalMargin, " 0"),
|
|
8
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
9
|
+
marginLeft: '50%',
|
|
10
|
+
transform: 'translateX(-50%)'
|
|
11
|
+
});
|
|
9
12
|
export default function Breakout(props) {
|
|
10
13
|
return jsx(WidthConsumer, null, function (_ref) {
|
|
11
14
|
var width = _ref.width;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
|
-
var _templateObject;
|
|
4
2
|
/** @jsx jsx */
|
|
5
3
|
import React, { Fragment } from 'react';
|
|
6
4
|
import { css, jsx } from '@emotion/react';
|
|
@@ -10,7 +8,16 @@ import { PLATFORM, MODE } from '../../analytics/events';
|
|
|
10
8
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
11
9
|
import LinkUrl from '@atlaskit/smart-card/link-url';
|
|
12
10
|
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
13
|
-
var anchorStyles = css(
|
|
11
|
+
var anchorStyles = css({
|
|
12
|
+
color: "var(--ds-link, ".concat(B400, ")"),
|
|
13
|
+
'&:hover': {
|
|
14
|
+
color: "var(--ds-link, ".concat(B300, ")"),
|
|
15
|
+
textDecoration: 'underline'
|
|
16
|
+
},
|
|
17
|
+
'&:active': {
|
|
18
|
+
color: "var(--ds-link-pressed, ".concat(B500, ")")
|
|
19
|
+
}
|
|
20
|
+
});
|
|
14
21
|
export default function Link(props) {
|
|
15
22
|
var href = props.href,
|
|
16
23
|
target = props.target,
|
|
@@ -7,6 +7,8 @@ import { N20 } from '@atlaskit/theme/colors';
|
|
|
7
7
|
import { fontSize } from '@atlaskit/theme/constants';
|
|
8
8
|
import { CodeBlockSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
9
9
|
import CodeBlockButtonContainer from './codeBlockButtonContainer';
|
|
10
|
+
|
|
11
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
10
12
|
var codeBlockStyleOverrides = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\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"])), "var(--ds-surface-raised, ".concat(N20, ")"), CodeBlockSharedCssClassName.DS_CODEBLOCK, relativeFontSizeToBase16(fontSize()), overflowShadow({
|
|
11
13
|
leftCoverWidth: "var(--ds-space-300, 24px)"
|
|
12
14
|
}));
|