@atlaskit/editor-core 192.4.5 → 192.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +4 -0
- package/CHANGELOG.md +19 -0
- package/dist/cjs/ui/Appearance/Comment/Comment.js +2 -2
- package/dist/cjs/ui/Appearance/Comment/Toolbar.js +1 -2
- package/dist/cjs/ui/Appearance/FullPage/StyledComponents.js +108 -12
- package/dist/cjs/ui/ContentStyles/index.js +1 -1
- package/dist/cjs/ui/ContentStyles/layout.js +1 -1
- package/dist/cjs/ui/Toolbar/ToolbarWithSizeDetector.js +12 -4
- package/dist/cjs/ui/ToolbarFeedback/styles.js +50 -9
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/ui/Appearance/Comment/Comment.js +4 -5
- package/dist/es2019/ui/Appearance/Comment/Toolbar.js +0 -1
- package/dist/es2019/ui/Appearance/FullPage/StyledComponents.js +99 -124
- package/dist/es2019/ui/ContentStyles/index.js +2 -2
- package/dist/es2019/ui/ContentStyles/layout.js +1 -1
- package/dist/es2019/ui/Toolbar/ToolbarWithSizeDetector.js +9 -9
- package/dist/es2019/ui/ToolbarFeedback/styles.js +49 -49
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/ui/Appearance/Comment/Comment.js +3 -3
- package/dist/esm/ui/Appearance/Comment/Toolbar.js +0 -1
- package/dist/esm/ui/Appearance/FullPage/StyledComponents.js +108 -12
- package/dist/esm/ui/ContentStyles/index.js +2 -2
- package/dist/esm/ui/ContentStyles/layout.js +1 -1
- package/dist/esm/ui/Toolbar/ToolbarWithSizeDetector.js +10 -3
- package/dist/esm/ui/ToolbarFeedback/styles.js +50 -8
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/create-editor/create-preset.d.ts +4 -0
- package/dist/types/presets/universal.d.ts +4 -0
- package/dist/types/presets/useUniversalPreset.d.ts +4 -0
- package/dist/types/ui/Addon/ClickAreaBlock/index.d.ts +2 -3
- package/dist/types/ui/Addon/ClickAreaInline/index.d.ts +3 -1
- package/dist/types/ui/Appearance/Comment/Toolbar.d.ts +3 -2
- package/dist/types-ts4.5/create-editor/create-preset.d.ts +4 -0
- package/dist/types-ts4.5/presets/universal.d.ts +4 -0
- package/dist/types-ts4.5/presets/useUniversalPreset.d.ts +4 -0
- package/dist/types-ts4.5/ui/Addon/ClickAreaBlock/index.d.ts +2 -3
- package/dist/types-ts4.5/ui/Addon/ClickAreaInline/index.d.ts +3 -1
- package/dist/types-ts4.5/ui/Appearance/Comment/Toolbar.d.ts +3 -2
- package/package.json +6 -6
|
@@ -7,151 +7,126 @@ import { createEditorContentStyle } from '../../ContentStyles';
|
|
|
7
7
|
import { scrollbarStyles } from '../../styles';
|
|
8
8
|
const SWOOP_ANIMATION = `0.5s ${akEditorSwoopCubicBezier}`;
|
|
9
9
|
const TOTAL_PADDING = akEditorGutterPadding * 2;
|
|
10
|
-
export const fullPageEditorWrapper = css
|
|
11
|
-
|
|
12
|
-
height: 100
|
|
13
|
-
display: flex
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const scrollStyles = css
|
|
18
|
-
|
|
19
|
-
height: 100
|
|
20
|
-
|
|
21
|
-
position: relative
|
|
22
|
-
display: flex
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
`;
|
|
10
|
+
export const fullPageEditorWrapper = css({
|
|
11
|
+
minWidth: '340px',
|
|
12
|
+
height: '100%',
|
|
13
|
+
display: 'flex',
|
|
14
|
+
flexDirection: 'column',
|
|
15
|
+
boxSizing: 'border-box'
|
|
16
|
+
});
|
|
17
|
+
const scrollStyles = css({
|
|
18
|
+
flexGrow: 1,
|
|
19
|
+
height: '100%',
|
|
20
|
+
overflowY: 'scroll',
|
|
21
|
+
position: 'relative',
|
|
22
|
+
display: 'flex',
|
|
23
|
+
flexDirection: 'column',
|
|
24
|
+
scrollBehavior: 'smooth'
|
|
25
|
+
}, scrollbarStyles);
|
|
27
26
|
export const ScrollContainer = createEditorContentStyle(scrollStyles);
|
|
28
27
|
ScrollContainer.displayName = 'ScrollContainer';
|
|
29
28
|
|
|
30
29
|
// transition used to match scrollbar with config panel opening animation
|
|
31
30
|
// only use animation when opening as there is a bug with floating toolbars.
|
|
32
|
-
export const positionedOverEditorStyle = css
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
.fabric-editor-popup-scroll-parent {
|
|
37
|
-
|
|
38
|
-
|
|
31
|
+
export const positionedOverEditorStyle = css({
|
|
32
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
33
|
+
paddingRight: `${akEditorContextPanelWidth}px`,
|
|
34
|
+
transition: `padding 500ms ${akEditorSwoopCubicBezier}`,
|
|
35
|
+
'.fabric-editor-popup-scroll-parent': {
|
|
36
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
37
|
+
paddingLeft: `${akEditorContextPanelWidth}px`,
|
|
38
|
+
transition: `padding 500ms ${akEditorSwoopCubicBezier}`
|
|
39
39
|
}
|
|
40
|
-
|
|
41
|
-
export const contentArea = css
|
|
42
|
-
display: flex
|
|
43
|
-
|
|
44
|
-
height: calc(100% - ${ATLASSIAN_NAVIGATION_HEIGHT})
|
|
45
|
-
|
|
46
|
-
margin: 0
|
|
47
|
-
padding: 0
|
|
48
|
-
transition: padding 0ms ${akEditorSwoopCubicBezier}
|
|
49
|
-
|
|
50
|
-
export const sidebarArea = css
|
|
51
|
-
height: 100
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
40
|
+
});
|
|
41
|
+
export const contentArea = css({
|
|
42
|
+
display: 'flex',
|
|
43
|
+
flexDirection: 'row',
|
|
44
|
+
height: `calc(100% - ${ATLASSIAN_NAVIGATION_HEIGHT})`,
|
|
45
|
+
boxSizing: 'border-box',
|
|
46
|
+
margin: 0,
|
|
47
|
+
padding: 0,
|
|
48
|
+
transition: `padding 0ms ${akEditorSwoopCubicBezier}`
|
|
49
|
+
});
|
|
50
|
+
export const sidebarArea = css({
|
|
51
|
+
height: '100%',
|
|
52
|
+
boxSizing: 'border-box',
|
|
53
|
+
alignSelf: 'flex-end'
|
|
54
|
+
});
|
|
55
55
|
|
|
56
56
|
// initially hide until we have a containerWidth and can properly size them,
|
|
57
57
|
// otherwise they can cause the editor width to extend which is non-recoverable
|
|
58
|
-
export const editorContentAreaHideContainer = css
|
|
59
|
-
.fabric-editor--full-width-mode {
|
|
60
|
-
.pm-table-container,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
.multiBodiedExtension--container {
|
|
66
|
-
display: none;
|
|
58
|
+
export const editorContentAreaHideContainer = css({
|
|
59
|
+
'.fabric-editor--full-width-mode': {
|
|
60
|
+
'.pm-table-container, .code-block, .extension-container': {
|
|
61
|
+
display: 'none'
|
|
62
|
+
},
|
|
63
|
+
'.multiBodiedExtension--container': {
|
|
64
|
+
display: 'none'
|
|
67
65
|
}
|
|
68
66
|
}
|
|
69
|
-
|
|
67
|
+
});
|
|
70
68
|
|
|
71
69
|
/* Prevent horizontal scroll on page in full width mode */
|
|
72
|
-
const editorContentAreaContainerStyle = containerWidth => css
|
|
73
|
-
.fabric-editor--full-width-mode {
|
|
74
|
-
.pm-table-container,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
[data-layout-section] {
|
|
84
|
-
max-width: ${containerWidth - TOTAL_PADDING + akLayoutGutterOffset * 2}px;
|
|
70
|
+
const editorContentAreaContainerStyle = containerWidth => css({
|
|
71
|
+
'.fabric-editor--full-width-mode': {
|
|
72
|
+
'.pm-table-container, .code-block, .extension-container': {
|
|
73
|
+
maxWidth: `${containerWidth - TOTAL_PADDING - tableMarginFullWidthMode * 2}px`
|
|
74
|
+
},
|
|
75
|
+
'.multiBodiedExtension--container': {
|
|
76
|
+
maxWidth: `${containerWidth - TOTAL_PADDING - tableMarginFullWidthMode * 2}px`
|
|
77
|
+
},
|
|
78
|
+
'[data-layout-section]': {
|
|
79
|
+
maxWidth: `${containerWidth - TOTAL_PADDING + akLayoutGutterOffset * 2}px`
|
|
85
80
|
}
|
|
86
81
|
}
|
|
87
|
-
|
|
82
|
+
});
|
|
88
83
|
export const editorContentAreaStyle = ({
|
|
89
84
|
layoutMaxWidth,
|
|
90
85
|
fullWidthMode,
|
|
91
86
|
containerWidth
|
|
92
87
|
}) => [editorContentArea, !fullWidthMode && editorContentAreaWithLayoutWith(layoutMaxWidth), containerWidth ? editorContentAreaContainerStyle(containerWidth) : editorContentAreaHideContainer];
|
|
93
|
-
const editorContentAreaWithLayoutWith = layoutMaxWidth => css
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
const editorContentArea = css
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
width: 100
|
|
104
|
-
margin: auto
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
max-width
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
> p,
|
|
121
|
-
> ul,
|
|
122
|
-
> ol:not(${taskListSelector}):not(${decisionListSelector}),
|
|
123
|
-
> h1,
|
|
124
|
-
> h2,
|
|
125
|
-
> h3,
|
|
126
|
-
> h4,
|
|
127
|
-
> h5,
|
|
128
|
-
> h6 {
|
|
129
|
-
/* deliberately allow wrapping of text based nodes, just in case any are adjacent floated content */
|
|
130
|
-
clear: none;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
> p:last-child {
|
|
134
|
-
margin-bottom: ${"var(--ds-space-300, 24px)"};
|
|
88
|
+
const editorContentAreaWithLayoutWith = layoutMaxWidth => css({
|
|
89
|
+
maxWidth: `${layoutMaxWidth + TOTAL_PADDING}px`
|
|
90
|
+
});
|
|
91
|
+
const editorContentArea = css({
|
|
92
|
+
lineHeight: '24px',
|
|
93
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
94
|
+
paddingTop: '50px',
|
|
95
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
96
|
+
paddingBottom: '55px',
|
|
97
|
+
height: 'calc( 100% - 105px )',
|
|
98
|
+
width: '100%',
|
|
99
|
+
margin: 'auto',
|
|
100
|
+
flexDirection: 'column',
|
|
101
|
+
flexGrow: 1,
|
|
102
|
+
maxWidth: `${akEditorFullWidthLayoutWidth + TOTAL_PADDING}px`,
|
|
103
|
+
transition: `max-width ${SWOOP_ANIMATION}`,
|
|
104
|
+
'& .ProseMirror': {
|
|
105
|
+
flexGrow: 1,
|
|
106
|
+
boxSizing: 'border-box',
|
|
107
|
+
'& > *': {
|
|
108
|
+
clear: 'both'
|
|
109
|
+
},
|
|
110
|
+
[`> p, > ul, > ol:not(${taskListSelector}):not(${decisionListSelector}), > h1, > h2, > h3, > h4, > h5, > h6`]: {
|
|
111
|
+
clear: 'none'
|
|
112
|
+
},
|
|
113
|
+
'> p:last-child': {
|
|
114
|
+
marginBottom: "var(--ds-space-300, 24px)"
|
|
135
115
|
}
|
|
136
116
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
.fabric-editor-breakout-mark
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
.fabric-editor-breakout-mark {
|
|
149
|
-
margin-left: unset !important;
|
|
150
|
-
transform: none !important;
|
|
117
|
+
}, tableFullPageEditorStyles, {
|
|
118
|
+
'.fabric-editor--full-width-mode': {
|
|
119
|
+
'.fabric-editor-breakout-mark, .extension-container.block, .pm-table-container': {
|
|
120
|
+
width: '100% !important'
|
|
121
|
+
},
|
|
122
|
+
'.fabric-editor-breakout-mark': {
|
|
123
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
124
|
+
marginLeft: 'unset !important',
|
|
125
|
+
transform: 'none !important'
|
|
151
126
|
}
|
|
152
127
|
}
|
|
153
|
-
|
|
154
|
-
export const editorContentGutterStyle = css
|
|
155
|
-
|
|
156
|
-
padding: 0 ${
|
|
157
|
-
|
|
128
|
+
});
|
|
129
|
+
export const editorContentGutterStyle = css({
|
|
130
|
+
boxSizing: 'border-box',
|
|
131
|
+
padding: `0 ${"var(--ds-space-400, 32px)"}`
|
|
132
|
+
});
|
|
@@ -14,7 +14,7 @@ import { findReplaceStyles } from '@atlaskit/editor-plugins/find-replace/styles'
|
|
|
14
14
|
import { textHighlightStyle } from '@atlaskit/editor-plugins/paste-options-toolbar/styles';
|
|
15
15
|
import { placeholderTextStyles } from '@atlaskit/editor-plugins/placeholder-text/styles';
|
|
16
16
|
import { tableStyles } from '@atlaskit/editor-plugins/table/ui/common-styles';
|
|
17
|
-
import { akEditorDeleteBackgroundWithOpacity, akEditorDeleteBorder,
|
|
17
|
+
import { akEditorDeleteBackgroundWithOpacity, akEditorDeleteBorder, akEditorSelectedBorderColor, akEditorSelectedBorderSize, akEditorSelectedNodeClassName, blockNodesVerticalMargin, editorFontSize, getSelectionStyles, SelectionStyle } from '@atlaskit/editor-shared-styles';
|
|
18
18
|
import { N200, N30A, N500 } from '@atlaskit/theme/colors';
|
|
19
19
|
import { InlineNodeViewSharedStyles } from '../../nodeviews/getInlineNodeViewProducer.styles';
|
|
20
20
|
import { codeBlockStyles } from './code-block';
|
|
@@ -38,7 +38,7 @@ const ruleStyles = () => css`
|
|
|
38
38
|
hr {
|
|
39
39
|
cursor: pointer;
|
|
40
40
|
padding: ${"var(--ds-space-050, 4px)"} 0;
|
|
41
|
-
margin:
|
|
41
|
+
margin: ${"var(--ds-space-300, 24px)"} 0;
|
|
42
42
|
background-clip: content-box;
|
|
43
43
|
|
|
44
44
|
&.${akEditorSelectedNodeClassName} {
|
|
@@ -10,7 +10,7 @@ export const layoutStyles = css`
|
|
|
10
10
|
${columnLayoutSharedStyle} [data-layout-section] {
|
|
11
11
|
// TODO: Migrate away from gridSize
|
|
12
12
|
// Recommendation: Replace directly with 7px
|
|
13
|
-
margin: ${
|
|
13
|
+
margin: ${"var(--ds-space-100, 8px)"} -${akLayoutGutterOffset}px 0;
|
|
14
14
|
transition: border-color 0.3s ${akEditorSwoopCubicBezier};
|
|
15
15
|
cursor: pointer;
|
|
16
16
|
|
|
@@ -9,16 +9,16 @@ import { useElementWidth } from './hooks';
|
|
|
9
9
|
import { Toolbar } from './Toolbar';
|
|
10
10
|
import { toolbarSizeToWidth, widthToToolbarSize } from './toolbar-size';
|
|
11
11
|
import { ToolbarSize } from './types';
|
|
12
|
-
const toolbar = css
|
|
13
|
-
width: 100
|
|
14
|
-
position: relative
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
width: calc(100% - 30px)
|
|
19
|
-
margin: 0
|
|
12
|
+
const toolbar = css({
|
|
13
|
+
width: '100%',
|
|
14
|
+
position: 'relative',
|
|
15
|
+
[`@media (max-width: ${akEditorMobileMaxWidth}px)`]: {
|
|
16
|
+
gridColumn: '1 / 2',
|
|
17
|
+
gridRow: 2,
|
|
18
|
+
width: 'calc(100% - 30px)',
|
|
19
|
+
margin: `0 ${"var(--ds-space-200, 16px)"}`
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
});
|
|
22
22
|
export const ToolbarWithSizeDetector = props => {
|
|
23
23
|
const ref = /*#__PURE__*/React.createRef();
|
|
24
24
|
const [width, setWidth] = React.useState(undefined);
|
|
@@ -2,53 +2,53 @@ import { css } from '@emotion/react';
|
|
|
2
2
|
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
3
3
|
import { N400, N60A, P400 } from '@atlaskit/theme/colors';
|
|
4
4
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
5
|
-
export const buttonContent = css
|
|
6
|
-
display: flex
|
|
7
|
-
height: 24px
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export const wrapper = css
|
|
12
|
-
display: flex
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export const confirmationPopup = css
|
|
16
|
-
background:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
display: flex
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
overflow: auto
|
|
23
|
-
|
|
24
|
-
height: 410px
|
|
25
|
-
width: 280px
|
|
26
|
-
|
|
27
|
-
export const confirmationText = css
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
color:
|
|
32
|
-
|
|
33
|
-
padding:
|
|
34
|
-
& > div {
|
|
35
|
-
width: 240px
|
|
5
|
+
export const buttonContent = css({
|
|
6
|
+
display: 'flex',
|
|
7
|
+
height: '24px',
|
|
8
|
+
lineHeight: '24px',
|
|
9
|
+
minWidth: '70px'
|
|
10
|
+
});
|
|
11
|
+
export const wrapper = css({
|
|
12
|
+
display: 'flex',
|
|
13
|
+
marginRight: 0
|
|
14
|
+
});
|
|
15
|
+
export const confirmationPopup = css({
|
|
16
|
+
background: "var(--ds-surface-overlay, #fff)",
|
|
17
|
+
borderRadius: `${borderRadius()}px`,
|
|
18
|
+
boxShadow: `var(--ds-shadow-overlay, ${`0 4px 8px -2px ${N60A}, 0 0 1px ${N60A}`})`,
|
|
19
|
+
display: 'flex',
|
|
20
|
+
flexDirection: 'column',
|
|
21
|
+
boxSizing: 'border-box',
|
|
22
|
+
overflow: 'auto',
|
|
23
|
+
maxHeight: 'none',
|
|
24
|
+
height: '410px',
|
|
25
|
+
width: '280px'
|
|
26
|
+
});
|
|
27
|
+
export const confirmationText = css({
|
|
28
|
+
fontSize: relativeFontSizeToBase16(14),
|
|
29
|
+
wordSpacing: '4px',
|
|
30
|
+
lineHeight: '22px',
|
|
31
|
+
color: `var(--ds-text-subtle, ${N400})`,
|
|
32
|
+
marginTop: "var(--ds-space-400, 32px)",
|
|
33
|
+
padding: "var(--ds-space-250, 20px)",
|
|
34
|
+
'& > div': {
|
|
35
|
+
width: '240px'
|
|
36
|
+
},
|
|
37
|
+
'& > div:first-of-type': {
|
|
38
|
+
marginBottom: "var(--ds-space-150, 12px)"
|
|
39
|
+
},
|
|
40
|
+
'& > div:nth-of-type(2)': {
|
|
41
|
+
marginBottom: "var(--ds-space-250, 20px)"
|
|
36
42
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
export const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
`;
|
|
50
|
-
export const confirmationImg = css`
|
|
51
|
-
width: 100px;
|
|
52
|
-
display: block;
|
|
53
|
-
margin: 25px auto 0 auto;
|
|
54
|
-
`;
|
|
43
|
+
});
|
|
44
|
+
export const confirmationHeader = css({
|
|
45
|
+
backgroundColor: `var(--ds-background-discovery-bold, ${P400})`,
|
|
46
|
+
height: '100px',
|
|
47
|
+
width: '100%',
|
|
48
|
+
display: 'inline-block'
|
|
49
|
+
});
|
|
50
|
+
export const confirmationImg = css({
|
|
51
|
+
width: '100px',
|
|
52
|
+
display: 'block',
|
|
53
|
+
margin: `${"var(--ds-space-250, 24px)"} auto 0 auto`
|
|
54
|
+
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "192.
|
|
2
|
+
export const version = "192.5.0";
|
|
@@ -32,12 +32,12 @@ import { createEditorContentStyle } from '../../ContentStyles';
|
|
|
32
32
|
import PluginSlot from '../../PluginSlot';
|
|
33
33
|
import Toolbar from '../../Toolbar';
|
|
34
34
|
import WithFlash from '../../WithFlash';
|
|
35
|
-
import { MainToolbar, mainToolbarCustomComponentsSlotStyle
|
|
35
|
+
import { MainToolbar, mainToolbarCustomComponentsSlotStyle } from './Toolbar';
|
|
36
36
|
var CommentEditorMargin = 14;
|
|
37
37
|
var commentEditorStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n\n .less-margin .ProseMirror {\n margin: ", " ", "\n ", ";\n }\n\n min-width: 272px;\n /* Border + Toolbar + Footer + (Paragraph + ((Paragraph + Margin) * (DefaultLines - 1)) */\n /* calc(2px + 40px + 24px + ( 20px + (32px * 2))) */\n\n height: auto;\n background-color: ", ";\n border: 1px solid ", ";\n box-sizing: border-box;\n border-radius: ", "px;\n\n max-width: inherit;\n word-wrap: break-word;\n"])), "var(--ds-space-150, 12px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", "var(--ds-background-input, white)", "var(--ds-border, ".concat(N40, ")"), borderRadius());
|
|
38
|
-
var ContentArea = createEditorContentStyle(css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n flex-grow: 1;\n overflow-x: ", ";\n line-height: 24px;\n\n /** Hack for Bitbucket to ensure entire editorView gets drop event; see ED-3294 **/\n /** Hack for table controls. Otherwise margin collapse and controls are misplaced. **/\n .ProseMirror {\n margin: ", "
|
|
38
|
+
var ContentArea = createEditorContentStyle(css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n flex-grow: 1;\n overflow-x: ", ";\n line-height: 24px;\n\n /** Hack for Bitbucket to ensure entire editorView gets drop event; see ED-3294 **/\n /** Hack for table controls. Otherwise margin collapse and controls are misplaced. **/\n .ProseMirror {\n margin: ", ";\n }\n\n .gridParent {\n margin-left: ", "px;\n margin-right: ", "px;\n width: calc(100% + ", "px);\n }\n\n padding: ", ";\n\n ", ";\n"])), getBooleanFF('platform.editor.table-sticky-scrollbar') ? 'clip' : 'hidden', "var(--ds-space-150, 12px)", CommentEditorMargin - GRID_GUTTER, CommentEditorMargin - GRID_GUTTER, CommentEditorMargin - GRID_GUTTER, "var(--ds-space-250, 20px)", tableCommentEditorStyles));
|
|
39
39
|
ContentArea.displayName = 'ContentArea';
|
|
40
|
-
var secondaryToolbarStyle = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n box-sizing: border-box;\n justify-content: flex-end;\n align-items: center;\n display: flex;\n padding: ", "
|
|
40
|
+
var secondaryToolbarStyle = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n box-sizing: border-box;\n justify-content: flex-end;\n align-items: center;\n display: flex;\n padding: ", " ", ";\n"])), "var(--ds-space-150, 12px)", "var(--ds-space-025, 2px)");
|
|
41
41
|
var Editor = /*#__PURE__*/function (_React$Component) {
|
|
42
42
|
_inherits(Editor, _React$Component);
|
|
43
43
|
var _super = _createSuper(Editor);
|
|
@@ -8,7 +8,6 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
|
8
8
|
import React, { useEffect, useState } from 'react';
|
|
9
9
|
import { css, jsx } from '@emotion/react';
|
|
10
10
|
import { akEditorMenuZIndex, akEditorToolbarKeylineHeight } from '@atlaskit/editor-shared-styles';
|
|
11
|
-
export var TableControlsPadding = 20;
|
|
12
11
|
var MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT = 490;
|
|
13
12
|
var mainToolbarWrapperStyle = function mainToolbarWrapperStyle() {
|
|
14
13
|
var isTwoLineEditorToolbar = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
var
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
var _ProseMirror;
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import { decisionListSelector, taskListSelector } from '@atlaskit/adf-schema';
|
|
5
5
|
import { tableFullPageEditorStyles } from '@atlaskit/editor-plugins/table/ui/common-styles';
|
|
@@ -9,24 +9,80 @@ import { createEditorContentStyle } from '../../ContentStyles';
|
|
|
9
9
|
import { scrollbarStyles } from '../../styles';
|
|
10
10
|
var SWOOP_ANIMATION = "0.5s ".concat(akEditorSwoopCubicBezier);
|
|
11
11
|
var TOTAL_PADDING = akEditorGutterPadding * 2;
|
|
12
|
-
export var fullPageEditorWrapper = css(
|
|
13
|
-
|
|
12
|
+
export var fullPageEditorWrapper = css({
|
|
13
|
+
minWidth: '340px',
|
|
14
|
+
height: '100%',
|
|
15
|
+
display: 'flex',
|
|
16
|
+
flexDirection: 'column',
|
|
17
|
+
boxSizing: 'border-box'
|
|
18
|
+
});
|
|
19
|
+
var scrollStyles = css({
|
|
20
|
+
flexGrow: 1,
|
|
21
|
+
height: '100%',
|
|
22
|
+
overflowY: 'scroll',
|
|
23
|
+
position: 'relative',
|
|
24
|
+
display: 'flex',
|
|
25
|
+
flexDirection: 'column',
|
|
26
|
+
scrollBehavior: 'smooth'
|
|
27
|
+
}, scrollbarStyles);
|
|
14
28
|
export var ScrollContainer = createEditorContentStyle(scrollStyles);
|
|
15
29
|
ScrollContainer.displayName = 'ScrollContainer';
|
|
16
30
|
|
|
17
31
|
// transition used to match scrollbar with config panel opening animation
|
|
18
32
|
// only use animation when opening as there is a bug with floating toolbars.
|
|
19
|
-
export var positionedOverEditorStyle = css(
|
|
20
|
-
|
|
21
|
-
|
|
33
|
+
export var positionedOverEditorStyle = css({
|
|
34
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
35
|
+
paddingRight: "".concat(akEditorContextPanelWidth, "px"),
|
|
36
|
+
transition: "padding 500ms ".concat(akEditorSwoopCubicBezier),
|
|
37
|
+
'.fabric-editor-popup-scroll-parent': {
|
|
38
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
39
|
+
paddingLeft: "".concat(akEditorContextPanelWidth, "px"),
|
|
40
|
+
transition: "padding 500ms ".concat(akEditorSwoopCubicBezier)
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
export var contentArea = css({
|
|
44
|
+
display: 'flex',
|
|
45
|
+
flexDirection: 'row',
|
|
46
|
+
height: "calc(100% - ".concat(ATLASSIAN_NAVIGATION_HEIGHT, ")"),
|
|
47
|
+
boxSizing: 'border-box',
|
|
48
|
+
margin: 0,
|
|
49
|
+
padding: 0,
|
|
50
|
+
transition: "padding 0ms ".concat(akEditorSwoopCubicBezier)
|
|
51
|
+
});
|
|
52
|
+
export var sidebarArea = css({
|
|
53
|
+
height: '100%',
|
|
54
|
+
boxSizing: 'border-box',
|
|
55
|
+
alignSelf: 'flex-end'
|
|
56
|
+
});
|
|
22
57
|
|
|
23
58
|
// initially hide until we have a containerWidth and can properly size them,
|
|
24
59
|
// otherwise they can cause the editor width to extend which is non-recoverable
|
|
25
|
-
export var editorContentAreaHideContainer = css(
|
|
60
|
+
export var editorContentAreaHideContainer = css({
|
|
61
|
+
'.fabric-editor--full-width-mode': {
|
|
62
|
+
'.pm-table-container, .code-block, .extension-container': {
|
|
63
|
+
display: 'none'
|
|
64
|
+
},
|
|
65
|
+
'.multiBodiedExtension--container': {
|
|
66
|
+
display: 'none'
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
});
|
|
26
70
|
|
|
27
71
|
/* Prevent horizontal scroll on page in full width mode */
|
|
28
72
|
var editorContentAreaContainerStyle = function editorContentAreaContainerStyle(containerWidth) {
|
|
29
|
-
return css(
|
|
73
|
+
return css({
|
|
74
|
+
'.fabric-editor--full-width-mode': {
|
|
75
|
+
'.pm-table-container, .code-block, .extension-container': {
|
|
76
|
+
maxWidth: "".concat(containerWidth - TOTAL_PADDING - tableMarginFullWidthMode * 2, "px")
|
|
77
|
+
},
|
|
78
|
+
'.multiBodiedExtension--container': {
|
|
79
|
+
maxWidth: "".concat(containerWidth - TOTAL_PADDING - tableMarginFullWidthMode * 2, "px")
|
|
80
|
+
},
|
|
81
|
+
'[data-layout-section]': {
|
|
82
|
+
maxWidth: "".concat(containerWidth - TOTAL_PADDING + akLayoutGutterOffset * 2, "px")
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
});
|
|
30
86
|
};
|
|
31
87
|
export var editorContentAreaStyle = function editorContentAreaStyle(_ref) {
|
|
32
88
|
var layoutMaxWidth = _ref.layoutMaxWidth,
|
|
@@ -35,7 +91,47 @@ export var editorContentAreaStyle = function editorContentAreaStyle(_ref) {
|
|
|
35
91
|
return [editorContentArea, !fullWidthMode && editorContentAreaWithLayoutWith(layoutMaxWidth), containerWidth ? editorContentAreaContainerStyle(containerWidth) : editorContentAreaHideContainer];
|
|
36
92
|
};
|
|
37
93
|
var editorContentAreaWithLayoutWith = function editorContentAreaWithLayoutWith(layoutMaxWidth) {
|
|
38
|
-
return css(
|
|
94
|
+
return css({
|
|
95
|
+
maxWidth: "".concat(layoutMaxWidth + TOTAL_PADDING, "px")
|
|
96
|
+
});
|
|
39
97
|
};
|
|
40
|
-
var editorContentArea = css(
|
|
41
|
-
|
|
98
|
+
var editorContentArea = css({
|
|
99
|
+
lineHeight: '24px',
|
|
100
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
101
|
+
paddingTop: '50px',
|
|
102
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
103
|
+
paddingBottom: '55px',
|
|
104
|
+
height: 'calc( 100% - 105px )',
|
|
105
|
+
width: '100%',
|
|
106
|
+
margin: 'auto',
|
|
107
|
+
flexDirection: 'column',
|
|
108
|
+
flexGrow: 1,
|
|
109
|
+
maxWidth: "".concat(akEditorFullWidthLayoutWidth + TOTAL_PADDING, "px"),
|
|
110
|
+
transition: "max-width ".concat(SWOOP_ANIMATION),
|
|
111
|
+
'& .ProseMirror': (_ProseMirror = {
|
|
112
|
+
flexGrow: 1,
|
|
113
|
+
boxSizing: 'border-box',
|
|
114
|
+
'& > *': {
|
|
115
|
+
clear: 'both'
|
|
116
|
+
}
|
|
117
|
+
}, _defineProperty(_ProseMirror, "> p, > ul, > ol:not(".concat(taskListSelector, "):not(").concat(decisionListSelector, "), > h1, > h2, > h3, > h4, > h5, > h6"), {
|
|
118
|
+
clear: 'none'
|
|
119
|
+
}), _defineProperty(_ProseMirror, '> p:last-child', {
|
|
120
|
+
marginBottom: "var(--ds-space-300, 24px)"
|
|
121
|
+
}), _ProseMirror)
|
|
122
|
+
}, tableFullPageEditorStyles, {
|
|
123
|
+
'.fabric-editor--full-width-mode': {
|
|
124
|
+
'.fabric-editor-breakout-mark, .extension-container.block, .pm-table-container': {
|
|
125
|
+
width: '100% !important'
|
|
126
|
+
},
|
|
127
|
+
'.fabric-editor-breakout-mark': {
|
|
128
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
129
|
+
marginLeft: 'unset !important',
|
|
130
|
+
transform: 'none !important'
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
export var editorContentGutterStyle = css({
|
|
135
|
+
boxSizing: 'border-box',
|
|
136
|
+
padding: "0 ".concat("var(--ds-space-400, 32px)")
|
|
137
|
+
});
|
|
@@ -16,7 +16,7 @@ import { findReplaceStyles } from '@atlaskit/editor-plugins/find-replace/styles'
|
|
|
16
16
|
import { textHighlightStyle } from '@atlaskit/editor-plugins/paste-options-toolbar/styles';
|
|
17
17
|
import { placeholderTextStyles } from '@atlaskit/editor-plugins/placeholder-text/styles';
|
|
18
18
|
import { tableStyles } from '@atlaskit/editor-plugins/table/ui/common-styles';
|
|
19
|
-
import { akEditorDeleteBackgroundWithOpacity, akEditorDeleteBorder,
|
|
19
|
+
import { akEditorDeleteBackgroundWithOpacity, akEditorDeleteBorder, akEditorSelectedBorderColor, akEditorSelectedBorderSize, akEditorSelectedNodeClassName, blockNodesVerticalMargin, editorFontSize, getSelectionStyles, SelectionStyle } from '@atlaskit/editor-shared-styles';
|
|
20
20
|
import { N200, N30A, N500 } from '@atlaskit/theme/colors';
|
|
21
21
|
import { InlineNodeViewSharedStyles } from '../../nodeviews/getInlineNodeViewProducer.styles';
|
|
22
22
|
import { codeBlockStyles } from './code-block';
|
|
@@ -30,7 +30,7 @@ import { statusStyles } from './status';
|
|
|
30
30
|
import { taskDecisionStyles } from './tasks-and-decisions';
|
|
31
31
|
export var linkStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ProseMirror {\n ", "\n }\n"])), linkSharedStyle);
|
|
32
32
|
var ruleStyles = function ruleStyles() {
|
|
33
|
-
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .ProseMirror {\n ", ";\n\n hr {\n cursor: pointer;\n padding: ", " 0;\n margin:
|
|
33
|
+
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .ProseMirror {\n ", ";\n\n hr {\n cursor: pointer;\n padding: ", " 0;\n margin: ", " 0;\n background-clip: content-box;\n\n &.", " {\n outline: none;\n background-color: ", ";\n }\n }\n }\n"])), ruleSharedStyles(), "var(--ds-space-050, 4px)", "var(--ds-space-300, 24px)", akEditorSelectedNodeClassName, "var(--ds-border-selected, ".concat(akEditorSelectedBorderColor, ")"));
|
|
34
34
|
};
|
|
35
35
|
var mentionsStyles = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .", " {\n &.", " [data-mention-id] > span {\n ", "\n\n /* need to specify dark text colour because personal mentions\n (in dark blue) have white text by default */\n color: ", ";\n }\n }\n\n .danger {\n .", ".", "\n > span\n > span\n > span {\n box-shadow: 0 0 0 ", "px ", ";\n background-color: ", ";\n }\n .", " > span > span > span {\n background-color: ", ";\n color: ", ";\n }\n }\n"])), MentionSharedCssClassName.MENTION_CONTAINER, akEditorSelectedNodeClassName, getSelectionStyles([SelectionStyle.BoxShadow, SelectionStyle.Background]), "var(--ds-text-subtle, ".concat(N500, ")"), MentionSharedCssClassName.MENTION_CONTAINER, akEditorSelectedNodeClassName, akEditorSelectedBorderSize, akEditorDeleteBorder, "var(--ds-background-danger, ".concat(akEditorDeleteBackgroundWithOpacity, ")"), MentionSharedCssClassName.MENTION_CONTAINER, "var(--ds-background-neutral, ".concat(N30A, ")"), "var(--ds-text-subtle, ".concat(N500, ")"));
|
|
36
36
|
var listsStyles = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n .ProseMirror {\n li {\n position: relative;\n\n > p:not(:first-child) {\n margin: ", " 0 0 0;\n }\n\n // In SSR the above rule will apply to all p tags because first-child would be a style tag.\n // The following rule resets the first p tag back to its original margin\n // defined in packages/editor/editor-common/src/styles/shared/paragraph.ts\n > style:first-child + p {\n margin-top: ", ";\n }\n }\n\n &:not([data-node-type='decisionList']) > li,\n // This prevents https://product-fabric.atlassian.net/browse/ED-20924\n &:not(.", ") > li {\n ", "\n }\n }\n"])), "var(--ds-space-050, 4px)", blockNodesVerticalMargin, SmartCardSharedCssClassName.BLOCK_CARD_CONTAINER, browser.safari ? codeBlockInListSafariFix : '');
|