@atlaskit/editor-core 221.3.2 → 221.3.4

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