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