@atlaskit/editor-core 221.2.0 → 221.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/afm-cc/tsconfig.json +3 -0
- package/afm-products/tsconfig.json +3 -0
- package/dist/cjs/ui/Appearance/Comment/FixedToolbar-compiled.compiled.css +20 -0
- package/dist/cjs/ui/Appearance/Comment/FixedToolbar-compiled.js +35 -0
- package/dist/cjs/ui/Appearance/Comment/FixedToolbar-emotion.js +94 -0
- package/dist/cjs/ui/Appearance/Comment/StickyToolbar-compiled.compiled.css +25 -0
- package/dist/cjs/ui/Appearance/Comment/StickyToolbar-compiled.js +66 -0
- package/dist/cjs/ui/Appearance/Comment/StickyToolbar-emotion.js +131 -0
- package/dist/cjs/ui/Appearance/Comment/Toolbar.js +14 -134
- package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea.js +50 -3
- package/dist/cjs/ui/Toolbar/ToolbarComponentsWrapper-compiled.compiled.css +2 -0
- package/dist/cjs/ui/Toolbar/ToolbarComponentsWrapper-compiled.js +29 -0
- package/dist/cjs/ui/Toolbar/ToolbarComponentsWrapper-emotion.js +36 -0
- package/dist/cjs/ui/Toolbar/ToolbarInner.js +9 -14
- package/dist/cjs/ui/Toolbar/ToolbarSizeDetectorWrapper-compiled.compiled.css +2 -0
- package/dist/cjs/ui/Toolbar/ToolbarSizeDetectorWrapper-compiled.js +29 -0
- package/dist/cjs/ui/Toolbar/ToolbarSizeDetectorWrapper-emotion.js +32 -0
- package/dist/cjs/ui/Toolbar/ToolbarWithSizeDetector.js +21 -19
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/ui/Appearance/Comment/FixedToolbar-compiled.compiled.css +20 -0
- package/dist/es2019/ui/Appearance/Comment/FixedToolbar-compiled.js +26 -0
- package/dist/es2019/ui/Appearance/Comment/FixedToolbar-emotion.js +91 -0
- package/dist/es2019/ui/Appearance/Comment/StickyToolbar-compiled.compiled.css +25 -0
- package/dist/es2019/ui/Appearance/Comment/StickyToolbar-compiled.js +51 -0
- package/dist/es2019/ui/Appearance/Comment/StickyToolbar-emotion.js +128 -0
- package/dist/es2019/ui/Appearance/Comment/Toolbar.js +10 -133
- package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea.js +50 -3
- package/dist/es2019/ui/Toolbar/ToolbarComponentsWrapper-compiled.compiled.css +2 -0
- package/dist/es2019/ui/Toolbar/ToolbarComponentsWrapper-compiled.js +20 -0
- package/dist/es2019/ui/Toolbar/ToolbarComponentsWrapper-emotion.js +28 -0
- package/dist/es2019/ui/Toolbar/ToolbarInner.js +6 -17
- package/dist/es2019/ui/Toolbar/ToolbarSizeDetectorWrapper-compiled.compiled.css +2 -0
- package/dist/es2019/ui/Toolbar/ToolbarSizeDetectorWrapper-compiled.js +20 -0
- package/dist/es2019/ui/Toolbar/ToolbarSizeDetectorWrapper-emotion.js +24 -0
- package/dist/es2019/ui/Toolbar/ToolbarWithSizeDetector.js +18 -19
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/ui/Appearance/Comment/FixedToolbar-compiled.compiled.css +20 -0
- package/dist/esm/ui/Appearance/Comment/FixedToolbar-compiled.js +28 -0
- package/dist/esm/ui/Appearance/Comment/FixedToolbar-emotion.js +86 -0
- package/dist/esm/ui/Appearance/Comment/StickyToolbar-compiled.compiled.css +25 -0
- package/dist/esm/ui/Appearance/Comment/StickyToolbar-compiled.js +58 -0
- package/dist/esm/ui/Appearance/Comment/StickyToolbar-emotion.js +124 -0
- package/dist/esm/ui/Appearance/Comment/Toolbar.js +14 -132
- package/dist/esm/ui/Appearance/FullPage/FullPageContentArea.js +50 -3
- package/dist/esm/ui/Toolbar/ToolbarComponentsWrapper-compiled.compiled.css +2 -0
- package/dist/esm/ui/Toolbar/ToolbarComponentsWrapper-compiled.js +21 -0
- package/dist/esm/ui/Toolbar/ToolbarComponentsWrapper-emotion.js +28 -0
- package/dist/esm/ui/Toolbar/ToolbarInner.js +8 -16
- package/dist/esm/ui/Toolbar/ToolbarSizeDetectorWrapper-compiled.compiled.css +2 -0
- package/dist/esm/ui/Toolbar/ToolbarSizeDetectorWrapper-compiled.js +21 -0
- package/dist/esm/ui/Toolbar/ToolbarSizeDetectorWrapper-emotion.js +25 -0
- package/dist/esm/ui/Toolbar/ToolbarWithSizeDetector.js +21 -18
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/ui/Appearance/Comment/FixedToolbar-compiled.d.ts +20 -0
- package/dist/types/ui/Appearance/Comment/FixedToolbar-emotion.d.ts +19 -0
- package/dist/types/ui/Appearance/Comment/StickyToolbar-compiled.d.ts +22 -0
- package/dist/types/ui/Appearance/Comment/StickyToolbar-emotion.d.ts +21 -0
- package/dist/types/ui/Appearance/Comment/Toolbar.d.ts +1 -2
- package/dist/types/ui/Toolbar/ToolbarComponentsWrapper-compiled.d.ts +17 -0
- package/dist/types/ui/Toolbar/ToolbarComponentsWrapper-emotion.d.ts +17 -0
- package/dist/types/ui/Toolbar/ToolbarInner.d.ts +1 -6
- package/dist/types/ui/Toolbar/ToolbarSizeDetectorWrapper-compiled.d.ts +17 -0
- package/dist/types/ui/Toolbar/ToolbarSizeDetectorWrapper-emotion.d.ts +17 -0
- package/dist/types/ui/Toolbar/ToolbarWithSizeDetector.d.ts +2 -2
- package/package.json +10 -10
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Emotion fallback branch of the `platform_editor_core_non_ecc_static_css` experiment.
|
|
7
|
+
* Used via `componentWithCondition` in `Toolbar.tsx`.
|
|
8
|
+
*
|
|
9
|
+
* Cleanup: delete this file once the experiment has shipped.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { useEffect, useState } from 'react';
|
|
13
|
+
|
|
14
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- intentional: emotion fallback for compiled migration
|
|
15
|
+
import { css, jsx } from '@emotion/react';
|
|
16
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
18
|
+
const MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT = 490;
|
|
19
|
+
const akEditorMenuZIndex = 500;
|
|
20
|
+
const akEditorToolbarKeylineHeight = 2;
|
|
21
|
+
const mainToolbarWrapperStyleNew = css({
|
|
22
|
+
position: 'relative',
|
|
23
|
+
alignItems: 'center',
|
|
24
|
+
padding: `${"var(--ds-space-100, 8px)"} ${"var(--ds-space-100, 8px)"} 0`,
|
|
25
|
+
display: 'flex',
|
|
26
|
+
height: 'auto',
|
|
27
|
+
backgroundColor: "var(--ds-surface, #FFFFFF)",
|
|
28
|
+
boxShadow: 'none',
|
|
29
|
+
paddingLeft: "var(--ds-space-250, 20px)",
|
|
30
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
31
|
+
'> div': {
|
|
32
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
33
|
+
'> div:first-of-type:not(style), > style:first-of-type + *': {
|
|
34
|
+
marginLeft: 0
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
38
|
+
'.block-type-btn': {
|
|
39
|
+
paddingLeft: 0
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
const mainToolbarWithPadding = css({
|
|
43
|
+
padding: `${"var(--ds-space-100, 8px)"}`
|
|
44
|
+
});
|
|
45
|
+
const mainToolbarTwoLineStylesNew = css({
|
|
46
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
47
|
+
'& > div': {
|
|
48
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
49
|
+
[`@media (max-width: ${MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT}px)`]: {
|
|
50
|
+
flexDirection: 'column-reverse',
|
|
51
|
+
alignItems: 'end',
|
|
52
|
+
display: 'flex',
|
|
53
|
+
justifyContent: 'flex-end'
|
|
54
|
+
},
|
|
55
|
+
/* make this more explicit for a toolbar */
|
|
56
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
57
|
+
'> div:first-of-type': {
|
|
58
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
59
|
+
[`@media (max-width: ${MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT}px)`]: {
|
|
60
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
61
|
+
'> div:nth-of-type(2)': {
|
|
62
|
+
justifyContent: 'flex-end',
|
|
63
|
+
display: 'flex'
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
const mainToolbarWrapperStylesVisualRefresh = css({
|
|
70
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
71
|
+
'span svg': {
|
|
72
|
+
maxWidth: '100%'
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
const mainToolbarWithRadiusStyle = css({
|
|
76
|
+
borderRadius: `${"var(--ds-radius-small, 3px)"} ${"var(--ds-radius-small, 3px)"} 0 0`
|
|
77
|
+
});
|
|
78
|
+
const mainToolbarRadius = css({
|
|
79
|
+
borderRadius: `${"var(--ds-radius-medium, 6px)"} ${"var(--ds-radius-medium, 6px)"} 0 0`
|
|
80
|
+
});
|
|
81
|
+
const editorModernisationToolbarStyle = css({
|
|
82
|
+
borderRadius: `${"var(--ds-radius-xlarge, 12px)"} ${"var(--ds-radius-xlarge, 12px)"} 0 0`,
|
|
83
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
84
|
+
'&.show-keyline': {
|
|
85
|
+
boxShadow: 'none'
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
const stickyToolbarWrapperStyleNew = css({
|
|
89
|
+
position: 'sticky',
|
|
90
|
+
paddingBottom: "var(--ds-space-100, 8px)",
|
|
91
|
+
zIndex: akEditorMenuZIndex,
|
|
92
|
+
transition: 'box-shadow ease-in-out 0.2s',
|
|
93
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
94
|
+
'&.show-keyline': {
|
|
95
|
+
boxShadow: `0 ${akEditorToolbarKeylineHeight}px 0 0 ${"var(--ds-background-accent-gray-subtlest, #F0F1F2)"}`
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
export const StickyToolbarEmotion = props => {
|
|
99
|
+
const [top, setTop] = useState(0);
|
|
100
|
+
|
|
101
|
+
// ED-15802: if externalToolbarRef is passed in, set top to externalToolbarRef?.current?.clientHeight
|
|
102
|
+
// else if offsetTop is a number set top to offsetTop
|
|
103
|
+
// otherwise top is 0 as initial state
|
|
104
|
+
useEffect(() => {
|
|
105
|
+
var _props$externalToolba, _props$externalToolba2;
|
|
106
|
+
if ((_props$externalToolba = props.externalToolbarRef) !== null && _props$externalToolba !== void 0 && (_props$externalToolba2 = _props$externalToolba.current) !== null && _props$externalToolba2 !== void 0 && _props$externalToolba2.clientHeight) {
|
|
107
|
+
setTop(props.externalToolbarRef.current.clientHeight);
|
|
108
|
+
} else {
|
|
109
|
+
setTop(props.offsetTop || 0);
|
|
110
|
+
}
|
|
111
|
+
}, [props.externalToolbarRef, props.offsetTop]);
|
|
112
|
+
const wrapperStyle = {
|
|
113
|
+
top: `${top}px`
|
|
114
|
+
};
|
|
115
|
+
return (
|
|
116
|
+
// eslint-disable-next-line @atlaskit/design-system/prefer-primitives
|
|
117
|
+
jsx("div", {
|
|
118
|
+
css: [mainToolbarWrapperStyleNew, props.twoLineEditorToolbar && mainToolbarTwoLineStylesNew, mainToolbarWrapperStylesVisualRefresh, stickyToolbarWrapperStyleNew, props.isNewToolbarEnabled && mainToolbarWithPadding, expValEquals('platform_editor_comment_editor_border_radius', 'isEnabled', true) && mainToolbarRadius, !expValEquals('platform_editor_comment_editor_border_radius', 'isEnabled', true) && fg('platform_editor_comments_border_radius') && mainToolbarWithRadiusStyle, props.isEditorModernisationEnabled && editorModernisationToolbarStyle]
|
|
119
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/ui-styling-standard/enforce-style-prop -- top is computed dynamically from externalToolbarRef height / offsetTop and cannot be a static css value
|
|
120
|
+
,
|
|
121
|
+
style: wrapperStyle,
|
|
122
|
+
"data-testid": "ak-editor-main-toolbar"
|
|
123
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
124
|
+
,
|
|
125
|
+
className: 'show-keyline'
|
|
126
|
+
}, props.children)
|
|
127
|
+
);
|
|
128
|
+
};
|
|
@@ -1,136 +1,13 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* @jsx jsx
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import React, { useEffect, useState } from 'react';
|
|
8
|
-
|
|
9
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- Ignored via go/DSP-18766; jsx required at runtime for @jsxRuntime classic
|
|
10
|
-
import { css, jsx } from '@emotion/react';
|
|
11
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
|
|
12
4
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
padding: `${"var(--ds-space-100, 8px)"} ${"var(--ds-space-100, 8px)"} 0`,
|
|
20
|
-
display: 'flex',
|
|
21
|
-
height: 'auto',
|
|
22
|
-
backgroundColor: "var(--ds-surface, #FFFFFF)",
|
|
23
|
-
boxShadow: 'none',
|
|
24
|
-
paddingLeft: "var(--ds-space-250, 20px)",
|
|
25
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
26
|
-
'> div': {
|
|
27
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
28
|
-
'> div:first-of-type:not(style), > style:first-of-type + *': {
|
|
29
|
-
marginLeft: 0
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
33
|
-
'.block-type-btn': {
|
|
34
|
-
paddingLeft: 0
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
/** keep default padding for entire toolbar */
|
|
39
|
-
const mainToolbarWithoutLeftPadding = css({
|
|
40
|
-
padding: `${"var(--ds-space-100, 8px)"} ${"var(--ds-space-100, 8px)"} 0`
|
|
41
|
-
});
|
|
42
|
-
const mainToolbarWithPadding = css({
|
|
43
|
-
padding: `${"var(--ds-space-100, 8px)"}`
|
|
44
|
-
});
|
|
45
|
-
const mainToolbarTwoLineStylesNew = css({
|
|
46
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
47
|
-
'& > div': {
|
|
48
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
49
|
-
[`@media (max-width: ${MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT}px)`]: {
|
|
50
|
-
flexDirection: 'column-reverse',
|
|
51
|
-
alignItems: 'end',
|
|
52
|
-
display: 'flex',
|
|
53
|
-
justifyContent: 'flex-end'
|
|
54
|
-
},
|
|
55
|
-
/* make this more explicit for a toolbar */
|
|
56
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
57
|
-
'> div:first-of-type': {
|
|
58
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
59
|
-
[`@media (max-width: ${MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT}px)`]: {
|
|
60
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
61
|
-
'> div:nth-of-type(2)': {
|
|
62
|
-
justifyContent: 'flex-end',
|
|
63
|
-
display: 'flex'
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
const mainToolbarWrapperStylesVisualRefresh = css({
|
|
70
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
71
|
-
'span svg': {
|
|
72
|
-
maxWidth: '100%'
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
const mainToolbarWithRadiusStyle = css({
|
|
76
|
-
borderRadius: `${"var(--ds-radius-small, 3px)"} ${"var(--ds-radius-small, 3px)"} 0 0`
|
|
77
|
-
});
|
|
78
|
-
const mainToolbarRadius = css({
|
|
79
|
-
borderRadius: `${"var(--ds-radius-medium, 6px)"} ${"var(--ds-radius-medium, 6px)"} 0 0`
|
|
80
|
-
});
|
|
81
|
-
const editorModernisationToolbarStyle = css({
|
|
82
|
-
borderRadius: `${"var(--ds-radius-xlarge, 12px)"} ${"var(--ds-radius-xlarge, 12px)"} 0 0`,
|
|
83
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
84
|
-
'&.show-keyline': {
|
|
85
|
-
boxShadow: 'none'
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
const stickyToolbarWrapperStyleNew = css({
|
|
89
|
-
position: 'sticky',
|
|
90
|
-
paddingBottom: "var(--ds-space-100, 8px)",
|
|
91
|
-
zIndex: akEditorMenuZIndex,
|
|
92
|
-
transition: 'box-shadow ease-in-out 0.2s',
|
|
93
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
94
|
-
'&.show-keyline': {
|
|
95
|
-
boxShadow: `0 ${akEditorToolbarKeylineHeight}px 0 0 ${"var(--ds-background-accent-gray-subtlest, #F0F1F2)"}`
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
const StickyToolbar = props => {
|
|
99
|
-
const [top, setTop] = useState(0);
|
|
100
|
-
|
|
101
|
-
// ED-15802: if externalToolbarRef is passed in, set top to externalToolbarRef?.current?.clientHeight
|
|
102
|
-
// else if offsetTop is a number set top to offsetTop
|
|
103
|
-
// otherwise top is 0 as initial state
|
|
104
|
-
useEffect(() => {
|
|
105
|
-
var _props$externalToolba, _props$externalToolba2;
|
|
106
|
-
if ((_props$externalToolba = props.externalToolbarRef) !== null && _props$externalToolba !== void 0 && (_props$externalToolba2 = _props$externalToolba.current) !== null && _props$externalToolba2 !== void 0 && _props$externalToolba2.clientHeight) {
|
|
107
|
-
setTop(props.externalToolbarRef.current.clientHeight);
|
|
108
|
-
} else {
|
|
109
|
-
setTop(props.offsetTop || 0);
|
|
110
|
-
}
|
|
111
|
-
}, [props.externalToolbarRef, props.offsetTop]);
|
|
112
|
-
return (
|
|
113
|
-
// eslint-disable-next-line @atlaskit/design-system/prefer-primitives
|
|
114
|
-
jsx("div", {
|
|
115
|
-
css: [mainToolbarWrapperStyleNew, props.twoLineEditorToolbar && mainToolbarTwoLineStylesNew, mainToolbarWrapperStylesVisualRefresh, stickyToolbarWrapperStyleNew, props.isNewToolbarEnabled && mainToolbarWithPadding, expValEquals('platform_editor_comment_editor_border_radius', 'isEnabled', true) && mainToolbarRadius, !expValEquals('platform_editor_comment_editor_border_radius', 'isEnabled', true) && fg('platform_editor_comments_border_radius') && mainToolbarWithRadiusStyle, props.isEditorModernisationEnabled && editorModernisationToolbarStyle]
|
|
116
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
117
|
-
,
|
|
118
|
-
style: {
|
|
119
|
-
top: `${top}px`
|
|
120
|
-
},
|
|
121
|
-
"data-testid": "ak-editor-main-toolbar"
|
|
122
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
123
|
-
,
|
|
124
|
-
className: 'show-keyline'
|
|
125
|
-
}, props.children)
|
|
126
|
-
);
|
|
127
|
-
};
|
|
128
|
-
const FixedToolbar = props =>
|
|
129
|
-
// eslint-disable-next-line @atlaskit/design-system/prefer-primitives
|
|
130
|
-
jsx("div", {
|
|
131
|
-
css: [mainToolbarWrapperStyleNew, props.twoLineEditorToolbar && mainToolbarTwoLineStylesNew, mainToolbarWrapperStylesVisualRefresh, props.isNewToolbarEnabled && mainToolbarWithoutLeftPadding, !expValEquals('platform_editor_comment_editor_border_radius', 'isEnabled', true) && fg('platform_editor_comments_border_radius') && mainToolbarWithRadiusStyle, expValEquals('platform_editor_comment_editor_border_radius', 'isEnabled', true) && mainToolbarRadius, props.isEditorModernisationEnabled && editorModernisationToolbarStyle],
|
|
132
|
-
"data-testid": "ak-editor-main-toolbar"
|
|
133
|
-
}, props.children);
|
|
5
|
+
import { FixedToolbarCompiled } from './FixedToolbar-compiled';
|
|
6
|
+
import { FixedToolbarEmotion } from './FixedToolbar-emotion';
|
|
7
|
+
import { StickyToolbarCompiled } from './StickyToolbar-compiled';
|
|
8
|
+
import { StickyToolbarEmotion } from './StickyToolbar-emotion';
|
|
9
|
+
const StickyToolbarMigration = componentWithCondition(() => expValEquals('platform_editor_core_non_ecc_static_css', 'isEnabled', true), StickyToolbarCompiled, StickyToolbarEmotion);
|
|
10
|
+
const FixedToolbarMigration = componentWithCondition(() => expValEquals('platform_editor_core_non_ecc_static_css', 'isEnabled', true), FixedToolbarCompiled, FixedToolbarEmotion);
|
|
134
11
|
|
|
135
12
|
/**
|
|
136
13
|
* ED-15802: Scenarios when a sticky bar is used:
|
|
@@ -167,7 +44,7 @@ export const MainToolbar = ({
|
|
|
167
44
|
isNewToolbarEnabled
|
|
168
45
|
}) => {
|
|
169
46
|
if (useStickyToolbar) {
|
|
170
|
-
return
|
|
47
|
+
return /*#__PURE__*/React.createElement(StickyToolbarMigration
|
|
171
48
|
// Ignored via go/ees005
|
|
172
49
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
173
50
|
, _extends({}, getStickyParameters(useStickyToolbar), {
|
|
@@ -176,7 +53,7 @@ export const MainToolbar = ({
|
|
|
176
53
|
isNewToolbarEnabled: isNewToolbarEnabled
|
|
177
54
|
}), children);
|
|
178
55
|
}
|
|
179
|
-
return
|
|
56
|
+
return /*#__PURE__*/React.createElement(FixedToolbarMigration, {
|
|
180
57
|
isEditorModernisationEnabled: isEditorModernisationEnabled,
|
|
181
58
|
twoLineEditorToolbar: twoLineEditorToolbar,
|
|
182
59
|
isNewToolbarEnabled: isNewToolbarEnabled
|
|
@@ -63,6 +63,15 @@ const hideEditorContentAreaProsemirrorWithAttributeStyle = css({
|
|
|
63
63
|
display: 'none'
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
|
+
const hideEditorContentAreaScrollGutterWithAttributeStyle = css({
|
|
67
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
68
|
+
'&[data-markdown-mode-hide-scroll-gutter="true"] > .ak-editor-content-area > [data-vc="scroll-gutter"]': {
|
|
69
|
+
display: 'none'
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
const hideEditorScrollGutterStyle = css({
|
|
73
|
+
display: 'none'
|
|
74
|
+
});
|
|
66
75
|
const fullWidthNonChromelessBreakoutBlockTableStyle = css({
|
|
67
76
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-1
|
|
68
77
|
'.fabric-editor--full-width-mode:not(:has(#chromeless-editor))': {
|
|
@@ -222,6 +231,38 @@ const contentAreaHeightNoToolbar = css({
|
|
|
222
231
|
const markdownModeContainerBackgroundStyle = css({
|
|
223
232
|
backgroundColor: "var(--ds-surface-sunken, #F8F8F8)"
|
|
224
233
|
});
|
|
234
|
+
const markdownModeContentAreaStyle = css({
|
|
235
|
+
boxSizing: 'border-box',
|
|
236
|
+
height: '100%',
|
|
237
|
+
margin: 0,
|
|
238
|
+
maxWidth: 'none',
|
|
239
|
+
minWidth: 0,
|
|
240
|
+
paddingBottom: 0,
|
|
241
|
+
paddingTop: 0,
|
|
242
|
+
width: '100%',
|
|
243
|
+
// The markdown source view is rendered through PluginSlot. Stretch those
|
|
244
|
+
// intermediate wrappers so its in-flow footer can sit at the bottom without
|
|
245
|
+
// overlaying the CodeMirror scrollbar.
|
|
246
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
247
|
+
'> .ak-editor-content-area': {
|
|
248
|
+
boxSizing: 'border-box',
|
|
249
|
+
display: 'flex',
|
|
250
|
+
flexDirection: 'column',
|
|
251
|
+
height: '100%',
|
|
252
|
+
minHeight: 0,
|
|
253
|
+
minWidth: 0,
|
|
254
|
+
padding: 0,
|
|
255
|
+
width: '100%'
|
|
256
|
+
},
|
|
257
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
258
|
+
'> .ak-editor-content-area > [data-testid="plugins-components-wrapper"]': {
|
|
259
|
+
display: 'flex',
|
|
260
|
+
flex: '1 1 auto',
|
|
261
|
+
minHeight: 0,
|
|
262
|
+
minWidth: 0,
|
|
263
|
+
width: '100%'
|
|
264
|
+
}
|
|
265
|
+
});
|
|
225
266
|
export const CONTENT_AREA_TEST_ID = 'ak-editor-fp-content-area';
|
|
226
267
|
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
227
268
|
export const EDITOR_CONTAINER = 'ak-editor-container';
|
|
@@ -258,7 +299,10 @@ const Content = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
258
299
|
var _states$markdownModeS2;
|
|
259
300
|
return (_states$markdownModeS2 = states.markdownModeState) === null || _states$markdownModeS2 === void 0 ? void 0 : _states$markdownModeS2.isMarkdownMode;
|
|
260
301
|
});
|
|
261
|
-
const
|
|
302
|
+
const isMarkdownModeExperimentEnabled = expValEqualsNoExposure('cc-markdown-mode', 'isEnabled', true);
|
|
303
|
+
const shouldHideProseMirrorForMarkdownMode = isMarkdownModeExperimentEnabled && markdownPluginCurrentView !== 'preview' && markdownPluginCurrentIsMarkdownMode;
|
|
304
|
+
const shouldHideScrollGutterForMarkdownMode = isMarkdownModeExperimentEnabled && markdownPluginCurrentIsMarkdownMode;
|
|
305
|
+
const shouldUseMarkdownModeMvpLayout = shouldHideProseMirrorForMarkdownMode && fg('platform_editor_md_mvp_layout');
|
|
262
306
|
return jsx("div", {
|
|
263
307
|
css: [contentAreaNew, props.isEditorToolbarHidden && contentAreaHeightNoToolbar],
|
|
264
308
|
"data-testid": CONTENT_AREA_TEST_ID,
|
|
@@ -266,7 +310,7 @@ const Content = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
266
310
|
}, jsx("div", {
|
|
267
311
|
css: [
|
|
268
312
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
269
|
-
contentAreaWrapper,
|
|
313
|
+
contentAreaWrapper, shouldUseMarkdownModeMvpLayout && markdownModeContainerBackgroundStyle],
|
|
270
314
|
"data-testid": EDITOR_CONTAINER,
|
|
271
315
|
"data-editor-container": 'true'
|
|
272
316
|
}, jsx(EditorContentContainer
|
|
@@ -285,10 +329,11 @@ const Content = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
285
329
|
editorDisabled: props.disabled
|
|
286
330
|
}, jsx("div", {
|
|
287
331
|
"data-markdown-mode-hide-prosemirror": shouldHideProseMirrorForMarkdownMode ? 'true' : undefined,
|
|
332
|
+
"data-markdown-mode-hide-scroll-gutter": shouldHideScrollGutterForMarkdownMode ? 'true' : undefined,
|
|
288
333
|
css: [editorContentAreaNew, editorContentAreaProsemirrorStyle,
|
|
289
334
|
// EDITOR-6558: hide ProseMirror when the markdown-mode plugin
|
|
290
335
|
// reports a non-WYSIWYG view.
|
|
291
|
-
shouldHideProseMirrorForMarkdownMode && hideEditorContentAreaProsemirrorWithAttributeStyle, tableFullPageEditorStylesNew, fullWidthNonChromelessBreakoutBlockTableStyle,
|
|
336
|
+
shouldHideProseMirrorForMarkdownMode && hideEditorContentAreaProsemirrorWithAttributeStyle, shouldHideScrollGutterForMarkdownMode && hideEditorContentAreaScrollGutterWithAttributeStyle, shouldUseMarkdownModeMvpLayout && markdownModeContentAreaStyle, tableFullPageEditorStylesNew, fullWidthNonChromelessBreakoutBlockTableStyle,
|
|
292
337
|
// for breakout resizing, there's no need to restrict the width of codeblocks as they're always wrapped in a breakout mark
|
|
293
338
|
expValEqualsNoExposure('platform_editor_breakout_resizing', 'isEnabled', true) ? editorContentAreaContainerStyleExcludeCodeBlockNew : editorContentAreaContainerStyleNew, fg('platform_editor_nested_dnd_styles_changes') && editorContentAreaContainerNestedDndStyle, !fg('platform_editor_controls_no_toolbar_space') && editorExperiment('platform_editor_controls', 'variant1') && contentAreaReducedHeaderSpace, !fg('platform_editor_controls_no_toolbar_space') && props.isEditorToolbarHidden && editorExperiment('platform_editor_controls', 'variant1') && contentAreaReservedPrimaryToolbarSpace],
|
|
294
339
|
style: {
|
|
@@ -333,6 +378,7 @@ const Content = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
333
378
|
wrapperElement: props.wrapperElement
|
|
334
379
|
}), props.editorDOMElement, !!props.customContentComponents && 'after' in props.customContentComponents ? contentComponentClickWrapper(props.customContentComponents.after) : null, allowScrollGutter && (editorExperiment('platform_editor_blocks', true) ? jsx("div", {
|
|
335
380
|
id: "editor-scroll-gutter",
|
|
381
|
+
css: shouldHideScrollGutterForMarkdownMode && hideEditorScrollGutterStyle,
|
|
336
382
|
style: {
|
|
337
383
|
paddingBottom: `${(_allowScrollGutter$gu = allowScrollGutter.gutterSize) !== null && _allowScrollGutter$gu !== void 0 ? _allowScrollGutter$gu : '120'}px`
|
|
338
384
|
},
|
|
@@ -340,6 +386,7 @@ const Content = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
340
386
|
"data-editor-scroll-gutter": "true"
|
|
341
387
|
}) : jsx("div", {
|
|
342
388
|
id: "editor-scroll-gutter",
|
|
389
|
+
css: shouldHideScrollGutterForMarkdownMode && hideEditorScrollGutterStyle,
|
|
343
390
|
style: {
|
|
344
391
|
paddingBottom: `${(_allowScrollGutter$gu2 = allowScrollGutter.gutterSize) !== null && _allowScrollGutter$gu2 !== void 0 ? _allowScrollGutter$gu2 : '120'}px`
|
|
345
392
|
},
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/* ToolbarComponentsWrapper-compiled.tsx generated by @compiled/babel-plugin v0.39.1 */
|
|
2
|
+
/**
|
|
3
|
+
* Compiled branch of the `platform_editor_core_non_ecc_static_css` experiment.
|
|
4
|
+
* Used via `componentWithCondition` in `ToolbarInner.tsx`.
|
|
5
|
+
*
|
|
6
|
+
* Cleanup: delete this file once the experiment has shipped.
|
|
7
|
+
*/
|
|
8
|
+
import "./ToolbarComponentsWrapper-compiled.compiled.css";
|
|
9
|
+
import * as React from 'react';
|
|
10
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
11
|
+
const toolbarComponentsWrapperCompiledStyles = {
|
|
12
|
+
root: "_1e0c1txw _1hm21yb4"
|
|
13
|
+
};
|
|
14
|
+
export const ToolbarComponentsWrapperCompiled = ({
|
|
15
|
+
children,
|
|
16
|
+
'data-vc': dataVc
|
|
17
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
18
|
+
"data-vc": dataVc,
|
|
19
|
+
className: ax([toolbarComponentsWrapperCompiledStyles.root])
|
|
20
|
+
}, children);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Emotion fallback branch of the `platform_editor_core_non_ecc_static_css` experiment.
|
|
7
|
+
* Used via `componentWithCondition` in `ToolbarInner.tsx`.
|
|
8
|
+
*
|
|
9
|
+
* Cleanup: delete this file once the experiment has shipped.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- intentional: emotion fallback for compiled migration
|
|
13
|
+
import { css, jsx } from '@emotion/react';
|
|
14
|
+
import { akEditorMobileMaxWidth } from '@atlaskit/editor-shared-styles';
|
|
15
|
+
const toolbarComponentsWrapperEmotionStyles = css({
|
|
16
|
+
display: 'flex',
|
|
17
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
18
|
+
[`@media (max-width: ${akEditorMobileMaxWidth}px)`]: {
|
|
19
|
+
justifyContent: 'space-between'
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
export const ToolbarComponentsWrapperEmotion = ({
|
|
23
|
+
children,
|
|
24
|
+
'data-vc': dataVc
|
|
25
|
+
}) => jsx("div", {
|
|
26
|
+
css: toolbarComponentsWrapperEmotionStyles,
|
|
27
|
+
"data-vc": dataVc
|
|
28
|
+
}, children);
|
|
@@ -1,21 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
1
|
import React from 'react';
|
|
6
|
-
|
|
7
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- Ignored via go/DSP-18766; jsx required at runtime for @jsxRuntime classic
|
|
8
|
-
import { css, jsx } from '@emotion/react';
|
|
9
2
|
import isEqual from 'lodash/isEqual';
|
|
10
3
|
import { isSSR } from '@atlaskit/editor-common/core-utils';
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
justifyContent: 'space-between'
|
|
17
|
-
}
|
|
18
|
-
});
|
|
4
|
+
import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
|
|
5
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
6
|
+
import { ToolbarComponentsWrapperCompiled } from './ToolbarComponentsWrapper-compiled';
|
|
7
|
+
import { ToolbarComponentsWrapperEmotion } from './ToolbarComponentsWrapper-emotion';
|
|
8
|
+
const ToolbarComponentsWrapperMigration = componentWithCondition(() => expValEquals('platform_editor_core_non_ecc_static_css', 'isEnabled', true), ToolbarComponentsWrapperCompiled, ToolbarComponentsWrapperEmotion);
|
|
19
9
|
|
|
20
10
|
// Ignored via go/ees005
|
|
21
11
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
@@ -48,8 +38,7 @@ export class ToolbarInner extends React.Component {
|
|
|
48
38
|
// Hiding toolbar in SSR until the dependency of screen width is resolved in SSR environment.
|
|
49
39
|
return null;
|
|
50
40
|
}
|
|
51
|
-
return
|
|
52
|
-
css: toolbarComponentsWrapper,
|
|
41
|
+
return /*#__PURE__*/React.createElement(ToolbarComponentsWrapperMigration, {
|
|
53
42
|
"data-vc": "toolbar-inner"
|
|
54
43
|
}, items.map((component, key) => {
|
|
55
44
|
const element = component({
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/* ToolbarSizeDetectorWrapper-compiled.tsx generated by @compiled/babel-plugin v0.39.1 */
|
|
2
|
+
/**
|
|
3
|
+
* Compiled branch of the `platform_editor_core_non_ecc_static_css` experiment.
|
|
4
|
+
* Used via `componentWithCondition` in `ToolbarWithSizeDetector.tsx`.
|
|
5
|
+
*
|
|
6
|
+
* Cleanup: delete this file once the experiment has shipped.
|
|
7
|
+
*/
|
|
8
|
+
import "./ToolbarSizeDetectorWrapper-compiled.compiled.css";
|
|
9
|
+
import * as React from 'react';
|
|
10
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
11
|
+
const toolbarSizeDetectorWrapperCompiledStyles = {
|
|
12
|
+
root: "_1bsb1osq _kqswh2mm"
|
|
13
|
+
};
|
|
14
|
+
export const ToolbarSizeDetectorWrapperCompiled = ({
|
|
15
|
+
children,
|
|
16
|
+
style
|
|
17
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
18
|
+
style: style,
|
|
19
|
+
className: ax([toolbarSizeDetectorWrapperCompiledStyles.root])
|
|
20
|
+
}, children);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Emotion fallback branch of the `platform_editor_core_non_ecc_static_css` experiment.
|
|
7
|
+
* Used via `componentWithCondition` in `ToolbarWithSizeDetector.tsx`.
|
|
8
|
+
*
|
|
9
|
+
* Cleanup: delete this file once the experiment has shipped.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- intentional: emotion fallback for compiled migration
|
|
13
|
+
import { css, jsx } from '@emotion/react';
|
|
14
|
+
const toolbarSizeDetectorWrapperEmotionStyles = css({
|
|
15
|
+
width: '100%',
|
|
16
|
+
position: 'relative'
|
|
17
|
+
});
|
|
18
|
+
export const ToolbarSizeDetectorWrapperEmotion = ({
|
|
19
|
+
children,
|
|
20
|
+
style
|
|
21
|
+
}) => jsx("div", {
|
|
22
|
+
css: toolbarSizeDetectorWrapperEmotionStyles,
|
|
23
|
+
style: style
|
|
24
|
+
}, children);
|
|
@@ -1,23 +1,17 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
1
|
import React, { useMemo } from 'react';
|
|
6
|
-
|
|
7
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- Ignored via go/DSP-18766; jsx required at runtime for @jsxRuntime classic
|
|
8
|
-
import { css, jsx } from '@emotion/react';
|
|
9
2
|
import { isSSR } from '@atlaskit/editor-common/core-utils';
|
|
10
3
|
import { ToolbarSize } from '@atlaskit/editor-common/types';
|
|
4
|
+
import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
|
|
5
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
11
6
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
12
7
|
import { WidthObserver } from '@atlaskit/width-detector';
|
|
13
8
|
import { isFullPage } from '../../utils/is-full-page';
|
|
14
9
|
import { useElementWidth } from './hooks';
|
|
15
10
|
import { Toolbar } from './Toolbar';
|
|
16
11
|
import { toolbarSizeToWidth, widthToToolbarSize } from './toolbar-size';
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
});
|
|
12
|
+
import { ToolbarSizeDetectorWrapperCompiled } from './ToolbarSizeDetectorWrapper-compiled';
|
|
13
|
+
import { ToolbarSizeDetectorWrapperEmotion } from './ToolbarSizeDetectorWrapper-emotion';
|
|
14
|
+
const ToolbarSizeDetectorWrapperMigration = componentWithCondition(() => expValEquals('platform_editor_core_non_ecc_static_css', 'isEnabled', true), ToolbarSizeDetectorWrapperCompiled, ToolbarSizeDetectorWrapperEmotion);
|
|
21
15
|
export const ToolbarWithSizeDetector = props => {
|
|
22
16
|
const ref = React.useRef(null);
|
|
23
17
|
const [width, setWidth] = React.useState(undefined);
|
|
@@ -40,14 +34,19 @@ export const ToolbarWithSizeDetector = props => {
|
|
|
40
34
|
return isPreviewPanelResponsivenessEnabled ? 'fit-content' : '254px';
|
|
41
35
|
}
|
|
42
36
|
}, [props.appearance, props.hasMinWidth, props.twoLineEditorToolbar]);
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
37
|
+
const memoizedWrapperStyle = useMemo(() => ({
|
|
38
|
+
minWidth: minWidthValue
|
|
39
|
+
}), [minWidthValue]);
|
|
40
|
+
const wrapperStyle = expValEquals('platform_editor_core_non_ecc_static_css', 'isEnabled', true) ? memoizedWrapperStyle : {
|
|
41
|
+
minWidth: minWidthValue
|
|
42
|
+
};
|
|
43
|
+
return /*#__PURE__*/React.createElement(ToolbarSizeDetectorWrapperMigration
|
|
44
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- minWidth is computed dynamically from props.hasMinWidth, props.appearance, props.twoLineEditorToolbar, and the platform_editor_preview_panel_responsiveness experiment, so it cannot be expressed as a static css value.
|
|
45
|
+
, {
|
|
46
|
+
style: wrapperStyle
|
|
47
|
+
}, /*#__PURE__*/React.createElement(WidthObserver, {
|
|
49
48
|
setWidth: setWidth
|
|
50
|
-
}), props.editorView && toolbarSize ?
|
|
49
|
+
}), props.editorView && toolbarSize ? /*#__PURE__*/React.createElement(Toolbar, {
|
|
51
50
|
toolbarSize: toolbarSize,
|
|
52
51
|
items: props.items,
|
|
53
52
|
editorView: props.editorView,
|
|
@@ -63,7 +62,7 @@ export const ToolbarWithSizeDetector = props => {
|
|
|
63
62
|
containerElement: props.containerElement,
|
|
64
63
|
hasMinWidth: props.hasMinWidth,
|
|
65
64
|
twoLineEditorToolbar: props.twoLineEditorToolbar
|
|
66
|
-
}) :
|
|
65
|
+
}) : /*#__PURE__*/React.createElement("div", {
|
|
67
66
|
ref: ref
|
|
68
67
|
}));
|
|
69
68
|
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
|
|
2
|
+
._2rko12c2{border-radius:var(--ds-radius-medium,6px) var(--ds-radius-medium,6px) 0 0}
|
|
3
|
+
._2rko15b0{border-radius:var(--ds-radius-xlarge,9pt) var(--ds-radius-xlarge,9pt) 0 0}
|
|
4
|
+
._2rko1cku{border-radius:var(--ds-radius-small,3px) var(--ds-radius-small,3px) 0 0}._10ytglyw.show-keyline{box-shadow:none}
|
|
5
|
+
._16qsglyw{box-shadow:none}
|
|
6
|
+
._19bvu2gc{padding-left:var(--ds-space-100,8px)}
|
|
7
|
+
._19bvv47k{padding-left:var(--ds-space-250,20px)}
|
|
8
|
+
._1cuzidpf .block-type-btn{padding-left:0}
|
|
9
|
+
._1e0c1txw{display:flex}
|
|
10
|
+
._1khpidpf >div>div:first-of-type:not(style){margin-left:0}
|
|
11
|
+
._3pwj1osq span svg{max-width:100%}
|
|
12
|
+
._4cvr1h6o{align-items:center}
|
|
13
|
+
._4t3i1wug{height:auto}
|
|
14
|
+
._bfhkvuon{background-color:var(--ds-surface,#fff)}
|
|
15
|
+
._ca0qu2gc{padding-top:var(--ds-space-100,8px)}
|
|
16
|
+
._kqswh2mm{position:relative}
|
|
17
|
+
._lg5oidpf >div>style:first-of-type+*{margin-left:0}
|
|
18
|
+
._n3tdidpf{padding-bottom:0}
|
|
19
|
+
._u5f3u2gc{padding-right:var(--ds-space-100,8px)}
|
|
20
|
+
@media (max-width:490px){._1q27esu3>div>div:first-of-type>div:nth-of-type(2){justify-content:flex-end}._16ec1txw>div>div:first-of-type>div:nth-of-type(2){display:flex}._1uq61sxn>div{flex-direction:column-reverse}._cnpmh9n0>div{align-items:end}._1djy1txw>div{display:flex}._17mgesu3>div{justify-content:flex-end}}
|