@atlaskit/editor-core 221.3.0 → 221.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/dist/cjs/create-editor/ReactEditorView.js +66 -9
- package/dist/cjs/ui/Appearance/Comment/Comment-compiled.compiled.css +30 -0
- package/dist/cjs/ui/Appearance/Comment/Comment-compiled.js +275 -0
- package/dist/cjs/ui/Appearance/Comment/Comment-emotion.js +357 -0
- package/dist/cjs/ui/Appearance/Comment/Comment.js +6 -344
- package/dist/cjs/ui/Appearance/FullPage/FullPage.js +1 -1
- package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea-compiled.compiled.css +96 -0
- package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea-compiled.js +190 -0
- package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea-emotion.js +413 -0
- package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea.js +10 -402
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbarNext.js +21 -2
- package/dist/cjs/ui/EditorContentContainer/EditorContentContainer-compiled.js +6 -5
- package/dist/cjs/ui/EditorContentContainer/EditorContentContainer-emotion.js +6 -4
- package/dist/cjs/ui/EditorContentContainer/styles/backgroundColorStyles.js +17 -6
- package/dist/cjs/ui/EditorContentContainer/styles/expandStyles.js +2 -2
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/create-editor/ReactEditorView.js +60 -9
- package/dist/es2019/ui/Appearance/Comment/Comment-compiled.compiled.css +30 -0
- package/dist/es2019/ui/Appearance/Comment/Comment-compiled.js +262 -0
- package/dist/es2019/ui/Appearance/Comment/Comment-emotion.js +344 -0
- package/dist/es2019/ui/Appearance/Comment/Comment.js +4 -337
- package/dist/es2019/ui/Appearance/FullPage/FullPage.js +1 -1
- package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea-compiled.compiled.css +96 -0
- package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea-compiled.js +179 -0
- package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea-emotion.js +405 -0
- package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea.js +8 -400
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbarNext.js +21 -2
- package/dist/es2019/ui/EditorContentContainer/EditorContentContainer-compiled.js +6 -5
- package/dist/es2019/ui/EditorContentContainer/EditorContentContainer-emotion.js +8 -6
- package/dist/es2019/ui/EditorContentContainer/styles/backgroundColorStyles.js +16 -5
- package/dist/es2019/ui/EditorContentContainer/styles/expandStyles.js +1 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/create-editor/ReactEditorView.js +66 -9
- package/dist/esm/ui/Appearance/Comment/Comment-compiled.compiled.css +30 -0
- package/dist/esm/ui/Appearance/Comment/Comment-compiled.js +268 -0
- package/dist/esm/ui/Appearance/Comment/Comment-emotion.js +346 -0
- package/dist/esm/ui/Appearance/Comment/Comment.js +6 -339
- package/dist/esm/ui/Appearance/FullPage/FullPage.js +1 -1
- package/dist/esm/ui/Appearance/FullPage/FullPageContentArea-compiled.compiled.css +96 -0
- package/dist/esm/ui/Appearance/FullPage/FullPageContentArea-compiled.js +183 -0
- package/dist/esm/ui/Appearance/FullPage/FullPageContentArea-emotion.js +403 -0
- package/dist/esm/ui/Appearance/FullPage/FullPageContentArea.js +10 -398
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbarNext.js +21 -2
- package/dist/esm/ui/EditorContentContainer/EditorContentContainer-compiled.js +6 -5
- package/dist/esm/ui/EditorContentContainer/EditorContentContainer-emotion.js +8 -6
- package/dist/esm/ui/EditorContentContainer/styles/backgroundColorStyles.js +16 -5
- package/dist/esm/ui/EditorContentContainer/styles/expandStyles.js +1 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/ui/Appearance/Comment/Comment-compiled.d.ts +30 -0
- package/dist/types/ui/Appearance/Comment/Comment-emotion.d.ts +20 -0
- package/dist/types/ui/Appearance/Comment/Comment.d.ts +2 -20
- package/dist/types/ui/Appearance/FullPage/FullPageContentArea-compiled.d.ts +56 -0
- package/dist/types/ui/Appearance/FullPage/FullPageContentArea-emotion.d.ts +56 -0
- package/dist/types/ui/Appearance/FullPage/FullPageContentArea.d.ts +6 -54
- package/dist/types/ui/EditorContentContainer/styles/backgroundColorStyles.d.ts +7 -0
- package/dist/types/ui/EditorContentContainer/styles/expandStyles.d.ts +1 -1
- package/package.json +8 -8
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
+
/**
|
|
4
|
+
* @jsxRuntime classic
|
|
5
|
+
* @jsx jsx
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Emotion fallback branch of the `platform_editor_core_non_ecc_static_css` experiment.
|
|
9
|
+
* Used via `componentWithCondition` in `Comment.tsx`.
|
|
10
|
+
*
|
|
11
|
+
* Cleanup: delete this file once the experiment has shipped.
|
|
12
|
+
*/
|
|
13
|
+
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
14
|
+
|
|
15
|
+
// 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
|
|
16
|
+
import { css, jsx } from '@emotion/react';
|
|
17
|
+
import classnames from 'classnames';
|
|
18
|
+
import { useIntl } from 'react-intl';
|
|
19
|
+
import ButtonGroup from '@atlaskit/button/button-group';
|
|
20
|
+
import Button from '@atlaskit/button/new';
|
|
21
|
+
import { useSharedPluginState, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
22
|
+
import messages from '@atlaskit/editor-common/messages';
|
|
23
|
+
import { WidthConsumer, WidthProvider } from '@atlaskit/editor-common/ui';
|
|
24
|
+
import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
|
|
25
|
+
import { akEditorMobileBreakoutPoint } from '@atlaskit/editor-shared-styles';
|
|
26
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
27
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
28
|
+
// Ignored via go/ees005
|
|
29
|
+
// eslint-disable-next-line import/no-named-as-default
|
|
30
|
+
import ClickAreaBlock from '../../Addon/ClickAreaBlock';
|
|
31
|
+
import { contentComponentClickWrapper } from '../../Addon/ClickAreaBlock/contentComponentWrapper';
|
|
32
|
+
import EditorContentContainer from '../../EditorContentContainer/EditorContentContainer';
|
|
33
|
+
import PluginSlot from '../../PluginSlot';
|
|
34
|
+
import { getPrimaryToolbarComponents } from '../../Toolbar/getPrimaryToolbarComponents';
|
|
35
|
+
import { ToolbarWithSizeDetector as Toolbar } from '../../Toolbar/ToolbarWithSizeDetector';
|
|
36
|
+
import WithFlash from '../../WithFlash';
|
|
37
|
+
import { CommentToolbar } from './CommentToolbar';
|
|
38
|
+
import { MainToolbar } from './Toolbar';
|
|
39
|
+
var MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT = 490;
|
|
40
|
+
|
|
41
|
+
// Remove when platform_editor_comment_editor_border_radius is cleaned up
|
|
42
|
+
var commentEditorStylesOld = css({
|
|
43
|
+
display: 'flex',
|
|
44
|
+
flexDirection: 'column',
|
|
45
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
46
|
+
'.less-margin > .ProseMirror': {
|
|
47
|
+
margin: "var(--ds-space-150, 12px)".concat(" ", "var(--ds-space-100, 8px)", " ", "var(--ds-space-100, 8px)")
|
|
48
|
+
},
|
|
49
|
+
minWidth: '272px',
|
|
50
|
+
height: 'auto',
|
|
51
|
+
backgroundColor: "var(--ds-background-input, #FFFFFF)",
|
|
52
|
+
border: "var(--ds-border-width, 1px)".concat(" solid ", "var(--ds-border-input, #8C8F97)"),
|
|
53
|
+
boxSizing: 'border-box',
|
|
54
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
55
|
+
borderRadius: "var(--ds-radius-small, 3px)",
|
|
56
|
+
maxWidth: 'inherit',
|
|
57
|
+
wordWrap: 'break-word'
|
|
58
|
+
});
|
|
59
|
+
var commentEditorStyles = css({
|
|
60
|
+
display: 'flex',
|
|
61
|
+
flexDirection: 'column',
|
|
62
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
63
|
+
'.less-margin > .ProseMirror': {
|
|
64
|
+
margin: "var(--ds-space-150, 12px)".concat(" ", "var(--ds-space-100, 8px)", " ", "var(--ds-space-100, 8px)")
|
|
65
|
+
},
|
|
66
|
+
minWidth: '272px',
|
|
67
|
+
height: 'auto',
|
|
68
|
+
backgroundColor: "var(--ds-background-input, #FFFFFF)",
|
|
69
|
+
border: "var(--ds-border-width, 1px)".concat(" solid ", "var(--ds-border-input, #8C8F97)"),
|
|
70
|
+
boxSizing: 'border-box',
|
|
71
|
+
borderRadius: "var(--ds-radius-medium, 6px)",
|
|
72
|
+
maxWidth: 'inherit',
|
|
73
|
+
wordWrap: 'break-word'
|
|
74
|
+
});
|
|
75
|
+
var modernisedEditorStyles = css({
|
|
76
|
+
borderRadius: "var(--ds-radius-xlarge, 12px)"
|
|
77
|
+
});
|
|
78
|
+
var secondaryToolbarStyles = css({
|
|
79
|
+
boxSizing: 'border-box',
|
|
80
|
+
justifyContent: 'flex-end',
|
|
81
|
+
alignItems: 'center',
|
|
82
|
+
display: 'flex',
|
|
83
|
+
padding: "var(--ds-space-150, 12px)".concat(" ", "var(--ds-space-025, 2px)")
|
|
84
|
+
});
|
|
85
|
+
var mainToolbarCustomComponentsSlotStyleNew = css({
|
|
86
|
+
display: 'flex',
|
|
87
|
+
justifyContent: 'flex-end',
|
|
88
|
+
alignItems: 'center',
|
|
89
|
+
flexGrow: 1,
|
|
90
|
+
paddingRight: "var(--ds-space-250, 20px)",
|
|
91
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
92
|
+
'> div': {
|
|
93
|
+
display: 'flex',
|
|
94
|
+
flexShrink: 0
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
var mainToolbarCustomComponentsSlotStylePaddingOverride = css({
|
|
98
|
+
paddingRight: 0
|
|
99
|
+
});
|
|
100
|
+
var mainToolbarCustomComponentsSlotStyleTwoLineToolbarNew = css(_defineProperty({}, "@media (max-width: ".concat(MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT, "px)"), {
|
|
101
|
+
paddingRight: 0
|
|
102
|
+
}));
|
|
103
|
+
var appearance = 'comment';
|
|
104
|
+
export var CommentEditorWithIntlEmotion = function CommentEditorWithIntlEmotion(props) {
|
|
105
|
+
var _editorAPI$blockMenu$, _editorAPI$blockMenu;
|
|
106
|
+
var editorAPI = props.editorAPI;
|
|
107
|
+
|
|
108
|
+
// Get useStandardNodeWidth from block menu plugin shared state
|
|
109
|
+
// Only access editorAPI when the experiment is enabled to avoid performance impact
|
|
110
|
+
var useStandardNodeWidth = editorExperiment('platform_editor_controls', 'variant1') && ((_editorAPI$blockMenu$ = editorAPI === null || editorAPI === void 0 || (_editorAPI$blockMenu = editorAPI.blockMenu) === null || _editorAPI$blockMenu === void 0 || (_editorAPI$blockMenu = _editorAPI$blockMenu.sharedState) === null || _editorAPI$blockMenu === void 0 || (_editorAPI$blockMenu = _editorAPI$blockMenu.currentState()) === null || _editorAPI$blockMenu === void 0 ? void 0 : _editorAPI$blockMenu.useStandardNodeWidth) !== null && _editorAPI$blockMenu$ !== void 0 ? _editorAPI$blockMenu$ : false);
|
|
111
|
+
var _useSharedPluginState = useSharedPluginStateWithSelector(editorAPI, ['maxContentSize', 'primaryToolbar', 'editorViewMode'], function (states) {
|
|
112
|
+
var _states$maxContentSiz, _states$primaryToolba, _states$editorViewMod;
|
|
113
|
+
return {
|
|
114
|
+
maxContentSizeReached: !!((_states$maxContentSiz = states.maxContentSizeState) !== null && _states$maxContentSiz !== void 0 && _states$maxContentSiz.maxContentSizeReached),
|
|
115
|
+
primaryToolbarComponentsState: (_states$primaryToolba = states.primaryToolbarState) === null || _states$primaryToolba === void 0 ? void 0 : _states$primaryToolba.components,
|
|
116
|
+
editorViewMode: (_states$editorViewMod = states.editorViewModeState) === null || _states$editorViewMod === void 0 ? void 0 : _states$editorViewMod.mode
|
|
117
|
+
};
|
|
118
|
+
}),
|
|
119
|
+
editorViewMode = _useSharedPluginState.editorViewMode,
|
|
120
|
+
primaryToolbarComponentsState = _useSharedPluginState.primaryToolbarComponentsState,
|
|
121
|
+
maxContentSizeReached = _useSharedPluginState.maxContentSizeReached;
|
|
122
|
+
var primaryToolbarState = getPrimaryToolbarComponents(editorAPI, primaryToolbarComponentsState);
|
|
123
|
+
var _useSharedPluginState2 = useSharedPluginState(editorAPI, ['media']),
|
|
124
|
+
mediaState = _useSharedPluginState2.mediaState;
|
|
125
|
+
var intl = useIntl();
|
|
126
|
+
var editorDOMElement = props.editorDOMElement,
|
|
127
|
+
editorView = props.editorView,
|
|
128
|
+
editorActions = props.editorActions,
|
|
129
|
+
eventDispatcher = props.eventDispatcher,
|
|
130
|
+
providerFactory = props.providerFactory,
|
|
131
|
+
contentComponents = props.contentComponents,
|
|
132
|
+
customContentComponents = props.customContentComponents,
|
|
133
|
+
customPrimaryToolbarComponents = props.customPrimaryToolbarComponents,
|
|
134
|
+
primaryToolbarComponentsProp = props.primaryToolbarComponents,
|
|
135
|
+
customSecondaryToolbarComponents = props.customSecondaryToolbarComponents,
|
|
136
|
+
popupsMountPoint = props.popupsMountPoint,
|
|
137
|
+
popupsBoundariesElement = props.popupsBoundariesElement,
|
|
138
|
+
popupsScrollableElement = props.popupsScrollableElement,
|
|
139
|
+
maxHeight = props.maxHeight,
|
|
140
|
+
_props$minHeight = props.minHeight,
|
|
141
|
+
minHeight = _props$minHeight === void 0 ? 150 : _props$minHeight,
|
|
142
|
+
onSave = props.onSave,
|
|
143
|
+
onCancel = props.onCancel,
|
|
144
|
+
disabled = props.disabled,
|
|
145
|
+
dispatchAnalyticsEvent = props.dispatchAnalyticsEvent,
|
|
146
|
+
useStickyToolbar = props.useStickyToolbar,
|
|
147
|
+
pluginHooks = props.pluginHooks,
|
|
148
|
+
featureFlags = props.featureFlags,
|
|
149
|
+
innerRef = props.innerRef,
|
|
150
|
+
isEditorModernisationEnabled = props.isEditorModernisationEnabled;
|
|
151
|
+
var showSecondaryToolbar = !!onSave || !!onCancel || !!customSecondaryToolbarComponents;
|
|
152
|
+
var containerElement = React.useRef(null);
|
|
153
|
+
|
|
154
|
+
// Wrapper container for toolbar and content area
|
|
155
|
+
var wrapperElementRef = useMemo(function () {
|
|
156
|
+
return innerRef || /*#__PURE__*/React.createRef();
|
|
157
|
+
}, [innerRef]);
|
|
158
|
+
var _useState = useState(false),
|
|
159
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
160
|
+
saveButtonDisabled = _useState2[0],
|
|
161
|
+
setSaveButtonDisabled = _useState2[1];
|
|
162
|
+
useEffect(function () {
|
|
163
|
+
if (mediaState) {
|
|
164
|
+
mediaState.subscribeToUploadInProgressState(setSaveButtonDisabled);
|
|
165
|
+
}
|
|
166
|
+
return function () {
|
|
167
|
+
return mediaState === null || mediaState === void 0 ? void 0 : mediaState.unsubscribeFromUploadInProgressState(setSaveButtonDisabled);
|
|
168
|
+
};
|
|
169
|
+
}, [mediaState]);
|
|
170
|
+
var handleSave = useCallback(function () {
|
|
171
|
+
if (editorView && onSave) {
|
|
172
|
+
onSave(editorView);
|
|
173
|
+
}
|
|
174
|
+
}, [editorView, onSave]);
|
|
175
|
+
var handleCancel = useCallback(function () {
|
|
176
|
+
if (editorView && onCancel) {
|
|
177
|
+
onCancel(editorView);
|
|
178
|
+
}
|
|
179
|
+
}, [editorView, onCancel]);
|
|
180
|
+
var isShortcutToFocusToolbar = useCallback(function (event) {
|
|
181
|
+
//Alt + F9 to reach first element in this main toolbar
|
|
182
|
+
return event.altKey && (event.key === 'F9' || event.keyCode === 120);
|
|
183
|
+
}, []);
|
|
184
|
+
|
|
185
|
+
// When primary toolbar components is undefined, do not show two line editor toolbar
|
|
186
|
+
var isTwoLineToolbarEnabled = !!customPrimaryToolbarComponents;
|
|
187
|
+
var handleEscape = useCallback(function (event) {
|
|
188
|
+
if (!(editorView !== null && editorView !== void 0 && editorView.hasFocus())) {
|
|
189
|
+
editorView === null || editorView === void 0 || editorView.focus();
|
|
190
|
+
}
|
|
191
|
+
event.preventDefault();
|
|
192
|
+
event.stopPropagation();
|
|
193
|
+
}, [editorView]);
|
|
194
|
+
var primaryToolbarComponents = primaryToolbarComponentsProp;
|
|
195
|
+
if (Array.isArray(primaryToolbarState === null || primaryToolbarState === void 0 ? void 0 : primaryToolbarState.components) && Array.isArray(primaryToolbarComponents)) {
|
|
196
|
+
primaryToolbarComponents = primaryToolbarState.components.concat(primaryToolbarComponents);
|
|
197
|
+
}
|
|
198
|
+
var isToolbarAIFCEnabled = Boolean(editorAPI === null || editorAPI === void 0 ? void 0 : editorAPI.toolbar);
|
|
199
|
+
var memoizedContentAreaStyles = useMemo(function () {
|
|
200
|
+
return [maxHeight ?
|
|
201
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
202
|
+
css({
|
|
203
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
204
|
+
maxHeight: "".concat(maxHeight, "px"),
|
|
205
|
+
// When maxHeight is set, content area should have overflow-y explicitly set as auto
|
|
206
|
+
// As we have overflow-x: clip for the content area, and when maxHeight prop is set, overflow-y will be computed as visible by default.
|
|
207
|
+
// This will cause the content area to have content overflowing the container
|
|
208
|
+
// so need to set overflow-y as auto to make sure the content area is scrollable
|
|
209
|
+
overflowY: 'auto'
|
|
210
|
+
}) : null];
|
|
211
|
+
}, [maxHeight]);
|
|
212
|
+
var contentAreaStyles = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? memoizedContentAreaStyles : [maxHeight ?
|
|
213
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
214
|
+
css({
|
|
215
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
216
|
+
maxHeight: "".concat(maxHeight, "px"),
|
|
217
|
+
// When maxHeight is set, content area should have overflow-y explicitly set as auto
|
|
218
|
+
// As we have overflow-x: clip for the content area, and when maxHeight prop is set, overflow-y will be computed as visible by default.
|
|
219
|
+
// This will cause the content area to have content overflowing the container
|
|
220
|
+
// so need to set overflow-y as auto to make sure the content area is scrollable
|
|
221
|
+
overflowY: 'auto'
|
|
222
|
+
}) : null];
|
|
223
|
+
var customToolbarSlot = jsx("div", {
|
|
224
|
+
css: [mainToolbarCustomComponentsSlotStyleNew, isTwoLineToolbarEnabled && mainToolbarCustomComponentsSlotStyleTwoLineToolbarNew, isToolbarAIFCEnabled && mainToolbarCustomComponentsSlotStylePaddingOverride]
|
|
225
|
+
}, customPrimaryToolbarComponents);
|
|
226
|
+
return jsx(WithFlash, {
|
|
227
|
+
animate: maxContentSizeReached
|
|
228
|
+
}, jsx(WidthProvider, null, jsx("div", {
|
|
229
|
+
css: [expValEquals('platform_editor_comment_editor_border_radius', 'isEnabled', true) ? commentEditorStyles : commentEditorStylesOld, isEditorModernisationEnabled && modernisedEditorStyles,
|
|
230
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
231
|
+
css({
|
|
232
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
233
|
+
minHeight: "".concat(minHeight, "px")
|
|
234
|
+
})]
|
|
235
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
236
|
+
,
|
|
237
|
+
className: "akEditor",
|
|
238
|
+
ref: wrapperElementRef
|
|
239
|
+
}, jsx(MainToolbar, {
|
|
240
|
+
isEditorModernisationEnabled: isEditorModernisationEnabled,
|
|
241
|
+
useStickyToolbar: useStickyToolbar,
|
|
242
|
+
twoLineEditorToolbar: isTwoLineToolbarEnabled,
|
|
243
|
+
isNewToolbarEnabled: isToolbarAIFCEnabled
|
|
244
|
+
}, isToolbarAIFCEnabled ? jsx(ToolbarArrowKeyNavigationProvider, {
|
|
245
|
+
editorView: editorView,
|
|
246
|
+
childComponentSelector: "[data-testid='ak-editor-main-toolbar']",
|
|
247
|
+
isShortcutToFocusToolbar: isShortcutToFocusToolbar,
|
|
248
|
+
handleEscape: handleEscape,
|
|
249
|
+
editorAppearance: appearance,
|
|
250
|
+
useStickyToolbar: useStickyToolbar,
|
|
251
|
+
intl: intl
|
|
252
|
+
}, jsx(CommentToolbar, {
|
|
253
|
+
editorAPI: editorAPI,
|
|
254
|
+
editorView: editorView,
|
|
255
|
+
editorAppearance: appearance,
|
|
256
|
+
disabled: !!disabled,
|
|
257
|
+
popupsBoundariesElement: popupsBoundariesElement,
|
|
258
|
+
popupsScrollableElement: popupsScrollableElement,
|
|
259
|
+
popupsMountPoint: popupsMountPoint
|
|
260
|
+
}), customPrimaryToolbarComponents ? customToolbarSlot : null) : jsx(ToolbarArrowKeyNavigationProvider, {
|
|
261
|
+
editorView: editorView,
|
|
262
|
+
childComponentSelector: "[data-testid='ak-editor-main-toolbar']",
|
|
263
|
+
isShortcutToFocusToolbar: isShortcutToFocusToolbar,
|
|
264
|
+
handleEscape: handleEscape,
|
|
265
|
+
editorAppearance: appearance,
|
|
266
|
+
useStickyToolbar: useStickyToolbar,
|
|
267
|
+
intl: intl
|
|
268
|
+
}, jsx(Toolbar
|
|
269
|
+
// Ignored via go/ees005
|
|
270
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
271
|
+
, {
|
|
272
|
+
editorView: editorView,
|
|
273
|
+
editorActions: editorActions
|
|
274
|
+
// Ignored via go/ees005
|
|
275
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
276
|
+
,
|
|
277
|
+
eventDispatcher: eventDispatcher
|
|
278
|
+
// Ignored via go/ees005
|
|
279
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
280
|
+
,
|
|
281
|
+
providerFactory: providerFactory,
|
|
282
|
+
appearance: appearance,
|
|
283
|
+
items: primaryToolbarComponents,
|
|
284
|
+
popupsMountPoint: popupsMountPoint,
|
|
285
|
+
popupsBoundariesElement: popupsBoundariesElement,
|
|
286
|
+
popupsScrollableElement: popupsScrollableElement,
|
|
287
|
+
disabled: !!disabled,
|
|
288
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
289
|
+
containerElement: containerElement.current,
|
|
290
|
+
twoLineEditorToolbar: isTwoLineToolbarEnabled
|
|
291
|
+
}), customToolbarSlot)), jsx(ClickAreaBlock, {
|
|
292
|
+
editorView: editorView,
|
|
293
|
+
editorDisabled: disabled
|
|
294
|
+
}, jsx(WidthConsumer, null, function (_ref) {
|
|
295
|
+
var width = _ref.width;
|
|
296
|
+
return jsx(EditorContentContainer, {
|
|
297
|
+
ref: containerElement,
|
|
298
|
+
css: contentAreaStyles,
|
|
299
|
+
isScrollable: maxHeight ? true : undefined
|
|
300
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
301
|
+
,
|
|
302
|
+
className: classnames('ak-editor-content-area', {
|
|
303
|
+
'less-margin': width < akEditorMobileBreakoutPoint
|
|
304
|
+
}),
|
|
305
|
+
featureFlags: featureFlags,
|
|
306
|
+
viewMode: editorViewMode,
|
|
307
|
+
appearance: appearance,
|
|
308
|
+
useStandardNodeWidth: useStandardNodeWidth
|
|
309
|
+
}, customContentComponents && 'before' in customContentComponents ? contentComponentClickWrapper(customContentComponents.before) : contentComponentClickWrapper(customContentComponents), jsx(PluginSlot, {
|
|
310
|
+
editorView: editorView,
|
|
311
|
+
editorActions: editorActions,
|
|
312
|
+
eventDispatcher: eventDispatcher,
|
|
313
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
314
|
+
providerFactory: providerFactory,
|
|
315
|
+
appearance: appearance,
|
|
316
|
+
items: contentComponents,
|
|
317
|
+
popupsMountPoint: popupsMountPoint,
|
|
318
|
+
popupsBoundariesElement: popupsBoundariesElement,
|
|
319
|
+
popupsScrollableElement: popupsScrollableElement,
|
|
320
|
+
containerElement: containerElement.current,
|
|
321
|
+
disabled: !!disabled,
|
|
322
|
+
wrapperElement: wrapperElementRef.current,
|
|
323
|
+
pluginHooks: pluginHooks
|
|
324
|
+
}), editorDOMElement, customContentComponents && 'after' in customContentComponents ? contentComponentClickWrapper(customContentComponents.after) : null);
|
|
325
|
+
}))), showSecondaryToolbar && jsx("div", {
|
|
326
|
+
css: secondaryToolbarStyles,
|
|
327
|
+
"data-testid": "ak-editor-secondary-toolbar"
|
|
328
|
+
}, jsx(ButtonGroup, null, !!onSave && jsx(Button, {
|
|
329
|
+
appearance: "primary",
|
|
330
|
+
onClick: handleSave,
|
|
331
|
+
testId: "comment-save-button",
|
|
332
|
+
isDisabled: disabled || saveButtonDisabled,
|
|
333
|
+
interactionName: "editor-comment-save-button"
|
|
334
|
+
}, intl.formatMessage(messages.saveButton)), !!onCancel && jsx(Button, {
|
|
335
|
+
appearance: "subtle",
|
|
336
|
+
onClick: handleCancel,
|
|
337
|
+
testId: "comment-cancel-button",
|
|
338
|
+
isDisabled: disabled,
|
|
339
|
+
interactionName: "editor-comment-cancel-button"
|
|
340
|
+
}, intl.formatMessage(messages.cancelButton))), jsx("span", {
|
|
341
|
+
style: {
|
|
342
|
+
flexGrow: 1
|
|
343
|
+
}
|
|
344
|
+
}), customSecondaryToolbarComponents)));
|
|
345
|
+
};
|
|
346
|
+
CommentEditorWithIntlEmotion.displayName = 'CommentEditorAppearance';
|