@atlaskit/editor-core 221.5.0 → 221.5.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 +16 -0
- package/dist/cjs/create-editor/ReactEditorView.js +6 -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 +97 -0
- package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea-compiled.js +191 -0
- package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea-emotion.js +428 -0
- package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea.js +10 -417
- package/dist/cjs/ui/Appearance/FullPage/StyledComponents.js +19 -18
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/create-editor/ReactEditorView.js +6 -0
- 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 +97 -0
- package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea-compiled.js +180 -0
- package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea-emotion.js +420 -0
- package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea.js +8 -415
- package/dist/es2019/ui/Appearance/FullPage/StyledComponents.js +18 -17
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/create-editor/ReactEditorView.js +6 -0
- 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 +97 -0
- package/dist/esm/ui/Appearance/FullPage/FullPageContentArea-compiled.js +184 -0
- package/dist/esm/ui/Appearance/FullPage/FullPageContentArea-emotion.js +418 -0
- package/dist/esm/ui/Appearance/FullPage/FullPageContentArea.js +10 -413
- package/dist/esm/ui/Appearance/FullPage/StyledComponents.js +18 -17
- 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/Appearance/FullPage/StyledComponents.d.ts +15 -1
- package/package.json +9 -6
|
@@ -1,340 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
/**
|
|
4
|
-
* @jsxRuntime classic
|
|
5
|
-
* @jsx jsx
|
|
6
|
-
*/
|
|
7
|
-
import React, { useCallback, useEffect, useMemo, 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 classnames from 'classnames';
|
|
12
|
-
import { useIntl } from 'react-intl';
|
|
13
|
-
import ButtonGroup from '@atlaskit/button/button-group';
|
|
14
|
-
import Button from '@atlaskit/button/new';
|
|
15
|
-
import { useSharedPluginState, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
16
|
-
import messages from '@atlaskit/editor-common/messages';
|
|
17
|
-
import { WidthConsumer, WidthProvider } from '@atlaskit/editor-common/ui';
|
|
18
|
-
import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
|
|
19
|
-
import { akEditorMobileBreakoutPoint } from '@atlaskit/editor-shared-styles';
|
|
1
|
+
import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
|
|
20
2
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
21
|
-
import {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
import EditorContentContainer from '../../EditorContentContainer/EditorContentContainer';
|
|
27
|
-
import PluginSlot from '../../PluginSlot';
|
|
28
|
-
import { getPrimaryToolbarComponents } from '../../Toolbar/getPrimaryToolbarComponents';
|
|
29
|
-
import { ToolbarWithSizeDetector as Toolbar } from '../../Toolbar/ToolbarWithSizeDetector';
|
|
30
|
-
import WithFlash from '../../WithFlash';
|
|
31
|
-
import { CommentToolbar } from './CommentToolbar';
|
|
32
|
-
import { MainToolbar } from './Toolbar';
|
|
33
|
-
var MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT = 490;
|
|
34
|
-
|
|
35
|
-
// Remove when platform_editor_comment_editor_border_radius is cleaned up
|
|
36
|
-
var commentEditorStylesOld = css({
|
|
37
|
-
display: 'flex',
|
|
38
|
-
flexDirection: 'column',
|
|
39
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
40
|
-
'.less-margin > .ProseMirror': {
|
|
41
|
-
margin: "var(--ds-space-150, 12px)".concat(" ", "var(--ds-space-100, 8px)", " ", "var(--ds-space-100, 8px)")
|
|
42
|
-
},
|
|
43
|
-
minWidth: '272px',
|
|
44
|
-
height: 'auto',
|
|
45
|
-
backgroundColor: "var(--ds-background-input, #FFFFFF)",
|
|
46
|
-
border: "var(--ds-border-width, 1px)".concat(" solid ", "var(--ds-border-input, #8C8F97)"),
|
|
47
|
-
boxSizing: 'border-box',
|
|
48
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
49
|
-
borderRadius: "var(--ds-radius-small, 3px)",
|
|
50
|
-
maxWidth: 'inherit',
|
|
51
|
-
wordWrap: 'break-word'
|
|
52
|
-
});
|
|
53
|
-
var commentEditorStyles = 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
|
-
borderRadius: "var(--ds-radius-medium, 6px)",
|
|
66
|
-
maxWidth: 'inherit',
|
|
67
|
-
wordWrap: 'break-word'
|
|
68
|
-
});
|
|
69
|
-
var modernisedEditorStyles = css({
|
|
70
|
-
borderRadius: "var(--ds-radius-xlarge, 12px)"
|
|
71
|
-
});
|
|
72
|
-
var secondaryToolbarStyles = css({
|
|
73
|
-
boxSizing: 'border-box',
|
|
74
|
-
justifyContent: 'flex-end',
|
|
75
|
-
alignItems: 'center',
|
|
76
|
-
display: 'flex',
|
|
77
|
-
padding: "var(--ds-space-150, 12px)".concat(" ", "var(--ds-space-025, 2px)")
|
|
78
|
-
});
|
|
79
|
-
var mainToolbarCustomComponentsSlotStyleNew = css({
|
|
80
|
-
display: 'flex',
|
|
81
|
-
justifyContent: 'flex-end',
|
|
82
|
-
alignItems: 'center',
|
|
83
|
-
flexGrow: 1,
|
|
84
|
-
paddingRight: "var(--ds-space-250, 20px)",
|
|
85
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
86
|
-
'> div': {
|
|
87
|
-
display: 'flex',
|
|
88
|
-
flexShrink: 0
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
var mainToolbarCustomComponentsSlotStylePaddingOverride = css({
|
|
92
|
-
paddingRight: 0
|
|
93
|
-
});
|
|
94
|
-
var mainToolbarCustomComponentsSlotStyleTwoLineToolbarNew = css(_defineProperty({}, "@media (max-width: ".concat(MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT, "px)"), {
|
|
95
|
-
paddingRight: 0
|
|
96
|
-
}));
|
|
97
|
-
var appearance = 'comment';
|
|
98
|
-
export var CommentEditorWithIntl = function CommentEditorWithIntl(props) {
|
|
99
|
-
var _editorAPI$blockMenu$, _editorAPI$blockMenu;
|
|
100
|
-
var editorAPI = props.editorAPI;
|
|
101
|
-
|
|
102
|
-
// Get useStandardNodeWidth from block menu plugin shared state
|
|
103
|
-
// Only access editorAPI when the experiment is enabled to avoid performance impact
|
|
104
|
-
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);
|
|
105
|
-
var _useSharedPluginState = useSharedPluginStateWithSelector(editorAPI, ['maxContentSize', 'primaryToolbar', 'editorViewMode'], function (states) {
|
|
106
|
-
var _states$maxContentSiz, _states$primaryToolba, _states$editorViewMod;
|
|
107
|
-
return {
|
|
108
|
-
maxContentSizeReached: !!((_states$maxContentSiz = states.maxContentSizeState) !== null && _states$maxContentSiz !== void 0 && _states$maxContentSiz.maxContentSizeReached),
|
|
109
|
-
primaryToolbarComponentsState: (_states$primaryToolba = states.primaryToolbarState) === null || _states$primaryToolba === void 0 ? void 0 : _states$primaryToolba.components,
|
|
110
|
-
editorViewMode: (_states$editorViewMod = states.editorViewModeState) === null || _states$editorViewMod === void 0 ? void 0 : _states$editorViewMod.mode
|
|
111
|
-
};
|
|
112
|
-
}),
|
|
113
|
-
editorViewMode = _useSharedPluginState.editorViewMode,
|
|
114
|
-
primaryToolbarComponentsState = _useSharedPluginState.primaryToolbarComponentsState,
|
|
115
|
-
maxContentSizeReached = _useSharedPluginState.maxContentSizeReached;
|
|
116
|
-
var primaryToolbarState = getPrimaryToolbarComponents(editorAPI, primaryToolbarComponentsState);
|
|
117
|
-
var _useSharedPluginState2 = useSharedPluginState(editorAPI, ['media']),
|
|
118
|
-
mediaState = _useSharedPluginState2.mediaState;
|
|
119
|
-
var intl = useIntl();
|
|
120
|
-
var editorDOMElement = props.editorDOMElement,
|
|
121
|
-
editorView = props.editorView,
|
|
122
|
-
editorActions = props.editorActions,
|
|
123
|
-
eventDispatcher = props.eventDispatcher,
|
|
124
|
-
providerFactory = props.providerFactory,
|
|
125
|
-
contentComponents = props.contentComponents,
|
|
126
|
-
customContentComponents = props.customContentComponents,
|
|
127
|
-
customPrimaryToolbarComponents = props.customPrimaryToolbarComponents,
|
|
128
|
-
primaryToolbarComponentsProp = props.primaryToolbarComponents,
|
|
129
|
-
customSecondaryToolbarComponents = props.customSecondaryToolbarComponents,
|
|
130
|
-
popupsMountPoint = props.popupsMountPoint,
|
|
131
|
-
popupsBoundariesElement = props.popupsBoundariesElement,
|
|
132
|
-
popupsScrollableElement = props.popupsScrollableElement,
|
|
133
|
-
maxHeight = props.maxHeight,
|
|
134
|
-
_props$minHeight = props.minHeight,
|
|
135
|
-
minHeight = _props$minHeight === void 0 ? 150 : _props$minHeight,
|
|
136
|
-
onSave = props.onSave,
|
|
137
|
-
onCancel = props.onCancel,
|
|
138
|
-
disabled = props.disabled,
|
|
139
|
-
dispatchAnalyticsEvent = props.dispatchAnalyticsEvent,
|
|
140
|
-
useStickyToolbar = props.useStickyToolbar,
|
|
141
|
-
pluginHooks = props.pluginHooks,
|
|
142
|
-
featureFlags = props.featureFlags,
|
|
143
|
-
innerRef = props.innerRef,
|
|
144
|
-
isEditorModernisationEnabled = props.isEditorModernisationEnabled;
|
|
145
|
-
var showSecondaryToolbar = !!onSave || !!onCancel || !!customSecondaryToolbarComponents;
|
|
146
|
-
var containerElement = React.useRef(null);
|
|
147
|
-
|
|
148
|
-
// Wrapper container for toolbar and content area
|
|
149
|
-
var wrapperElementRef = useMemo(function () {
|
|
150
|
-
return innerRef || /*#__PURE__*/React.createRef();
|
|
151
|
-
}, [innerRef]);
|
|
152
|
-
var _useState = useState(false),
|
|
153
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
154
|
-
saveButtonDisabled = _useState2[0],
|
|
155
|
-
setSaveButtonDisabled = _useState2[1];
|
|
156
|
-
useEffect(function () {
|
|
157
|
-
if (mediaState) {
|
|
158
|
-
mediaState.subscribeToUploadInProgressState(setSaveButtonDisabled);
|
|
159
|
-
}
|
|
160
|
-
return function () {
|
|
161
|
-
return mediaState === null || mediaState === void 0 ? void 0 : mediaState.unsubscribeFromUploadInProgressState(setSaveButtonDisabled);
|
|
162
|
-
};
|
|
163
|
-
}, [mediaState]);
|
|
164
|
-
var handleSave = useCallback(function () {
|
|
165
|
-
if (editorView && onSave) {
|
|
166
|
-
onSave(editorView);
|
|
167
|
-
}
|
|
168
|
-
}, [editorView, onSave]);
|
|
169
|
-
var handleCancel = useCallback(function () {
|
|
170
|
-
if (editorView && onCancel) {
|
|
171
|
-
onCancel(editorView);
|
|
172
|
-
}
|
|
173
|
-
}, [editorView, onCancel]);
|
|
174
|
-
var isShortcutToFocusToolbar = useCallback(function (event) {
|
|
175
|
-
//Alt + F9 to reach first element in this main toolbar
|
|
176
|
-
return event.altKey && (event.key === 'F9' || event.keyCode === 120);
|
|
177
|
-
}, []);
|
|
178
|
-
|
|
179
|
-
// When primary toolbar components is undefined, do not show two line editor toolbar
|
|
180
|
-
var isTwoLineToolbarEnabled = !!customPrimaryToolbarComponents;
|
|
181
|
-
var handleEscape = useCallback(function (event) {
|
|
182
|
-
if (!(editorView !== null && editorView !== void 0 && editorView.hasFocus())) {
|
|
183
|
-
editorView === null || editorView === void 0 || editorView.focus();
|
|
184
|
-
}
|
|
185
|
-
event.preventDefault();
|
|
186
|
-
event.stopPropagation();
|
|
187
|
-
}, [editorView]);
|
|
188
|
-
var primaryToolbarComponents = primaryToolbarComponentsProp;
|
|
189
|
-
if (Array.isArray(primaryToolbarState === null || primaryToolbarState === void 0 ? void 0 : primaryToolbarState.components) && Array.isArray(primaryToolbarComponents)) {
|
|
190
|
-
primaryToolbarComponents = primaryToolbarState.components.concat(primaryToolbarComponents);
|
|
191
|
-
}
|
|
192
|
-
var isToolbarAIFCEnabled = Boolean(editorAPI === null || editorAPI === void 0 ? void 0 : editorAPI.toolbar);
|
|
193
|
-
var memoizedContentAreaStyles = useMemo(function () {
|
|
194
|
-
return [maxHeight ?
|
|
195
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
196
|
-
css({
|
|
197
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
198
|
-
maxHeight: "".concat(maxHeight, "px"),
|
|
199
|
-
// When maxHeight is set, content area should have overflow-y explicitly set as auto
|
|
200
|
-
// 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.
|
|
201
|
-
// This will cause the content area to have content overflowing the container
|
|
202
|
-
// so need to set overflow-y as auto to make sure the content area is scrollable
|
|
203
|
-
overflowY: 'auto'
|
|
204
|
-
}) : null];
|
|
205
|
-
}, [maxHeight]);
|
|
206
|
-
var contentAreaStyles = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? memoizedContentAreaStyles : [maxHeight ?
|
|
207
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
208
|
-
css({
|
|
209
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
210
|
-
maxHeight: "".concat(maxHeight, "px"),
|
|
211
|
-
// When maxHeight is set, content area should have overflow-y explicitly set as auto
|
|
212
|
-
// 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.
|
|
213
|
-
// This will cause the content area to have content overflowing the container
|
|
214
|
-
// so need to set overflow-y as auto to make sure the content area is scrollable
|
|
215
|
-
overflowY: 'auto'
|
|
216
|
-
}) : null];
|
|
217
|
-
var customToolbarSlot = jsx("div", {
|
|
218
|
-
css: [mainToolbarCustomComponentsSlotStyleNew, isTwoLineToolbarEnabled && mainToolbarCustomComponentsSlotStyleTwoLineToolbarNew, isToolbarAIFCEnabled && mainToolbarCustomComponentsSlotStylePaddingOverride]
|
|
219
|
-
}, customPrimaryToolbarComponents);
|
|
220
|
-
return jsx(WithFlash, {
|
|
221
|
-
animate: maxContentSizeReached
|
|
222
|
-
}, jsx(WidthProvider, null, jsx("div", {
|
|
223
|
-
css: [expValEquals('platform_editor_comment_editor_border_radius', 'isEnabled', true) ? commentEditorStyles : commentEditorStylesOld, isEditorModernisationEnabled && modernisedEditorStyles,
|
|
224
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
225
|
-
css({
|
|
226
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
227
|
-
minHeight: "".concat(minHeight, "px")
|
|
228
|
-
})]
|
|
229
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
230
|
-
,
|
|
231
|
-
className: "akEditor",
|
|
232
|
-
ref: wrapperElementRef
|
|
233
|
-
}, jsx(MainToolbar, {
|
|
234
|
-
isEditorModernisationEnabled: isEditorModernisationEnabled,
|
|
235
|
-
useStickyToolbar: useStickyToolbar,
|
|
236
|
-
twoLineEditorToolbar: isTwoLineToolbarEnabled,
|
|
237
|
-
isNewToolbarEnabled: isToolbarAIFCEnabled
|
|
238
|
-
}, isToolbarAIFCEnabled ? jsx(ToolbarArrowKeyNavigationProvider, {
|
|
239
|
-
editorView: editorView,
|
|
240
|
-
childComponentSelector: "[data-testid='ak-editor-main-toolbar']",
|
|
241
|
-
isShortcutToFocusToolbar: isShortcutToFocusToolbar,
|
|
242
|
-
handleEscape: handleEscape,
|
|
243
|
-
editorAppearance: appearance,
|
|
244
|
-
useStickyToolbar: useStickyToolbar,
|
|
245
|
-
intl: intl
|
|
246
|
-
}, jsx(CommentToolbar, {
|
|
247
|
-
editorAPI: editorAPI,
|
|
248
|
-
editorView: editorView,
|
|
249
|
-
editorAppearance: appearance,
|
|
250
|
-
disabled: !!disabled,
|
|
251
|
-
popupsBoundariesElement: popupsBoundariesElement,
|
|
252
|
-
popupsScrollableElement: popupsScrollableElement,
|
|
253
|
-
popupsMountPoint: popupsMountPoint
|
|
254
|
-
}), customPrimaryToolbarComponents ? customToolbarSlot : null) : jsx(ToolbarArrowKeyNavigationProvider, {
|
|
255
|
-
editorView: editorView,
|
|
256
|
-
childComponentSelector: "[data-testid='ak-editor-main-toolbar']",
|
|
257
|
-
isShortcutToFocusToolbar: isShortcutToFocusToolbar,
|
|
258
|
-
handleEscape: handleEscape,
|
|
259
|
-
editorAppearance: appearance,
|
|
260
|
-
useStickyToolbar: useStickyToolbar,
|
|
261
|
-
intl: intl
|
|
262
|
-
}, jsx(Toolbar
|
|
263
|
-
// Ignored via go/ees005
|
|
264
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
265
|
-
, {
|
|
266
|
-
editorView: editorView,
|
|
267
|
-
editorActions: editorActions
|
|
268
|
-
// Ignored via go/ees005
|
|
269
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
270
|
-
,
|
|
271
|
-
eventDispatcher: eventDispatcher
|
|
272
|
-
// Ignored via go/ees005
|
|
273
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
274
|
-
,
|
|
275
|
-
providerFactory: providerFactory,
|
|
276
|
-
appearance: appearance,
|
|
277
|
-
items: primaryToolbarComponents,
|
|
278
|
-
popupsMountPoint: popupsMountPoint,
|
|
279
|
-
popupsBoundariesElement: popupsBoundariesElement,
|
|
280
|
-
popupsScrollableElement: popupsScrollableElement,
|
|
281
|
-
disabled: !!disabled,
|
|
282
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
283
|
-
containerElement: containerElement.current,
|
|
284
|
-
twoLineEditorToolbar: isTwoLineToolbarEnabled
|
|
285
|
-
}), customToolbarSlot)), jsx(ClickAreaBlock, {
|
|
286
|
-
editorView: editorView,
|
|
287
|
-
editorDisabled: disabled
|
|
288
|
-
}, jsx(WidthConsumer, null, function (_ref) {
|
|
289
|
-
var width = _ref.width;
|
|
290
|
-
return jsx(EditorContentContainer, {
|
|
291
|
-
ref: containerElement,
|
|
292
|
-
css: contentAreaStyles,
|
|
293
|
-
isScrollable: maxHeight ? true : undefined
|
|
294
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
295
|
-
,
|
|
296
|
-
className: classnames('ak-editor-content-area', {
|
|
297
|
-
'less-margin': width < akEditorMobileBreakoutPoint
|
|
298
|
-
}),
|
|
299
|
-
featureFlags: featureFlags,
|
|
300
|
-
viewMode: editorViewMode,
|
|
301
|
-
appearance: appearance,
|
|
302
|
-
useStandardNodeWidth: useStandardNodeWidth
|
|
303
|
-
}, customContentComponents && 'before' in customContentComponents ? contentComponentClickWrapper(customContentComponents.before) : contentComponentClickWrapper(customContentComponents), jsx(PluginSlot, {
|
|
304
|
-
editorView: editorView,
|
|
305
|
-
editorActions: editorActions,
|
|
306
|
-
eventDispatcher: eventDispatcher,
|
|
307
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
308
|
-
providerFactory: providerFactory,
|
|
309
|
-
appearance: appearance,
|
|
310
|
-
items: contentComponents,
|
|
311
|
-
popupsMountPoint: popupsMountPoint,
|
|
312
|
-
popupsBoundariesElement: popupsBoundariesElement,
|
|
313
|
-
popupsScrollableElement: popupsScrollableElement,
|
|
314
|
-
containerElement: containerElement.current,
|
|
315
|
-
disabled: !!disabled,
|
|
316
|
-
wrapperElement: wrapperElementRef.current,
|
|
317
|
-
pluginHooks: pluginHooks
|
|
318
|
-
}), editorDOMElement, customContentComponents && 'after' in customContentComponents ? contentComponentClickWrapper(customContentComponents.after) : null);
|
|
319
|
-
}))), showSecondaryToolbar && jsx("div", {
|
|
320
|
-
css: secondaryToolbarStyles,
|
|
321
|
-
"data-testid": "ak-editor-secondary-toolbar"
|
|
322
|
-
}, jsx(ButtonGroup, null, !!onSave && jsx(Button, {
|
|
323
|
-
appearance: "primary",
|
|
324
|
-
onClick: handleSave,
|
|
325
|
-
testId: "comment-save-button",
|
|
326
|
-
isDisabled: disabled || saveButtonDisabled,
|
|
327
|
-
interactionName: "editor-comment-save-button"
|
|
328
|
-
}, intl.formatMessage(messages.saveButton)), !!onCancel && jsx(Button, {
|
|
329
|
-
appearance: "subtle",
|
|
330
|
-
onClick: handleCancel,
|
|
331
|
-
testId: "comment-cancel-button",
|
|
332
|
-
isDisabled: disabled,
|
|
333
|
-
interactionName: "editor-comment-cancel-button"
|
|
334
|
-
}, intl.formatMessage(messages.cancelButton))), jsx("span", {
|
|
335
|
-
style: {
|
|
336
|
-
flexGrow: 1
|
|
337
|
-
}
|
|
338
|
-
}), customSecondaryToolbarComponents)));
|
|
339
|
-
};
|
|
340
|
-
CommentEditorWithIntl.displayName = 'CommentEditorAppearance';
|
|
3
|
+
import { CommentEditorWithIntlCompiled } from './Comment-compiled';
|
|
4
|
+
import { CommentEditorWithIntlEmotion } from './Comment-emotion';
|
|
5
|
+
export var CommentEditorWithIntl = componentWithCondition(function () {
|
|
6
|
+
return expValEquals('platform_editor_core_non_ecc_static_css', 'isEnabled', true);
|
|
7
|
+
}, CommentEditorWithIntlCompiled, CommentEditorWithIntlEmotion);
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
|
|
2
|
+
._v5641fxv{transition:max-width .5s cubic-bezier(.15,1,.3,1)}
|
|
3
|
+
._v5642kub{transition:padding 0ms cubic-bezier(.15,1,.3,1)}._101j15vq [data-editor-scroll-container=true]{overflow-y:hidden}
|
|
4
|
+
._11bl1txw >.ak-editor-content-area>[data-testid=plugins-components-wrapper]{display:flex}
|
|
5
|
+
._12glglyw[data-markdown-mode-hide-prosemirror=true]>.ak-editor-content-area>.ProseMirror{display:none}
|
|
6
|
+
._13jk1txw >.ak-editor-content-area{display:flex}
|
|
7
|
+
._13svglyw .ProseMirror>ol:not([data-node-type=actionList]):not([data-node-type=decisionList]){clear:none}
|
|
8
|
+
._13t61wug >.ak-editor-content-area>[data-testid=plugins-components-wrapper]{flex-basis:auto}
|
|
9
|
+
._142emslj .fabric-editor--full-width-mode .code-block{max-width:calc(100% - 4px)}
|
|
10
|
+
._1593idpf >.ak-editor-content-area>[data-testid=plugins-components-wrapper]{min-height:0}
|
|
11
|
+
._16jlkb7n{flex-grow:1}
|
|
12
|
+
._17q71osq .fabric-editor--full-width-mode .extension-container.inline{max-width:100%}
|
|
13
|
+
._18q6usvi .ProseMirror{box-sizing:border-box}
|
|
14
|
+
._18u01wug{margin-left:auto}
|
|
15
|
+
._18u0idpf{margin-left:0}
|
|
16
|
+
._19bv1ex1{padding-left:52px}
|
|
17
|
+
._19bvidpf{padding-left:0}
|
|
18
|
+
._19bvt9kd{padding-left:72px}
|
|
19
|
+
._19pk1wug{margin-top:auto}
|
|
20
|
+
._19pkidpf{margin-top:0}
|
|
21
|
+
._19pknm9q{margin-top:calc(var(--ds-space-500, 40px) + 1px)}
|
|
22
|
+
._1a1d1osq >.ak-editor-content-area{height:100%}
|
|
23
|
+
._1b7c1kw7 .fabric-editor--full-width-mode td .extension-container.inline{max-width:inherit}
|
|
24
|
+
._1bsb1osq{width:100%}
|
|
25
|
+
._1e0c1txw{display:flex}
|
|
26
|
+
._1e0cglyw{display:none}
|
|
27
|
+
._1e8kkb7n >.ak-editor-content-area>[data-testid=plugins-components-wrapper]{flex-grow:1}
|
|
28
|
+
._1f38dez1{container-name:editor-area}
|
|
29
|
+
._1gl01ejb .ProseMirror>p:last-child{margin-bottom:var(--ds-space-300,24px)}
|
|
30
|
+
._1k8i1osq .ProseMirror .pm-table-wrapper>table{width:100%}
|
|
31
|
+
._1n5qidpf >.ak-editor-content-area{padding-left:0}
|
|
32
|
+
._1nw4glyw .ProseMirror>h1{clear:none}
|
|
33
|
+
._1qzyglyw .ProseMirror>h3{clear:none}
|
|
34
|
+
._1rnyglyw .ProseMirror>h5{clear:none}
|
|
35
|
+
._1tb2idpf .ProseMirror .pm-table-wrapper>table{margin-left:0}
|
|
36
|
+
._1ul9idpf{min-width:0}
|
|
37
|
+
._1vbxidpf >.ak-editor-content-area{min-height:0}
|
|
38
|
+
._1wpzesu3{align-self:flex-end}
|
|
39
|
+
._1wrrusvi >.ak-editor-content-area{box-sizing:border-box}
|
|
40
|
+
._1wxymslj .fabric-editor--full-width-mode .extension-container{max-width:calc(100% - 4px)}
|
|
41
|
+
._1xouidpf >.ak-editor-content-area{min-width:0}
|
|
42
|
+
._2hwx1wug{margin-right:auto}
|
|
43
|
+
._2hwxidpf{margin-right:0}
|
|
44
|
+
._2lx21bp4{flex-direction:column}
|
|
45
|
+
._2lx2vrvc{flex-direction:row}
|
|
46
|
+
._4t3i1ap5{height:calc(100% - 105px)}
|
|
47
|
+
._4t3i1osq{height:100%}
|
|
48
|
+
._4t3ibhu0{height:calc(100% - var(--ak-editor-fullpage-toolbar-height))}
|
|
49
|
+
._4tbp1osq >.ak-editor-content-area{width:100%}
|
|
50
|
+
._71ybidpf >.ak-editor-content-area{padding-right:0}
|
|
51
|
+
._7cca15wb{container-type:inline-size}
|
|
52
|
+
._7uc0glyw .ProseMirror>ul{clear:none}
|
|
53
|
+
._8j6w1lxk.ak-editor-content-area-no-toolbar{height:calc(100% + 1px)}
|
|
54
|
+
._8vye1n1a .ProseMirror .pm-table-wrapper>table{margin-right:-1px}
|
|
55
|
+
._9dtbmslj .fabric-editor--full-width-mode .multiBodiedExtension--container{max-width:calc(100% - 4px)}
|
|
56
|
+
._amwgglyw[data-markdown-mode-hide-scroll-gutter=true]>.ak-editor-content-area>[data-vc=scroll-gutter]{display:none}
|
|
57
|
+
._bfhkhfxm{background-color:var(--ds-surface-sunken,#f8f8f8)}
|
|
58
|
+
._boivkb7n >.ak-editor-content-area>[data-testid=plugins-components-wrapper]{flex-shrink:1}
|
|
59
|
+
._ca0qidpf{padding-top:0}
|
|
60
|
+
._ca0qoahv{padding-top:var(--ds-space-600,3pc)}
|
|
61
|
+
._ca0qxy5q{padding-top:var(--ds-space-400,2pc)}
|
|
62
|
+
._evz0idpf >.ak-editor-content-area{padding-bottom:0}
|
|
63
|
+
._fh67idpf >.ak-editor-content-area{padding-top:0}
|
|
64
|
+
._i92uagmp .fabric-editor--full-width-mode:not(:has(#chromeless-editor)) .fabric-editor-breakout-mark{transform:none!important}
|
|
65
|
+
._j9k7kb7n .ProseMirror{flex-grow:1}
|
|
66
|
+
._l4a11hrf .ProseMirror>*{clear:both}
|
|
67
|
+
._li931osq >.ak-editor-content-area>[data-testid=plugins-components-wrapper]{width:100%}
|
|
68
|
+
._n3tdidpf{padding-bottom:0}
|
|
69
|
+
._n3tdoahv{padding-bottom:var(--ds-space-600,3pc)}
|
|
70
|
+
._njlp131u{contain:layout style inline-size}
|
|
71
|
+
._ongaglyw .ProseMirror>h4{clear:none}
|
|
72
|
+
._otyr1wug{margin-bottom:auto}
|
|
73
|
+
._otyridpf{margin-bottom:0}
|
|
74
|
+
._p12f5kin{max-width:var(--ak-editor-content-area-max-width)}
|
|
75
|
+
._p12fglyw{max-width:none}
|
|
76
|
+
._pnffaq80 .fabric-editor--full-width-mode:not(:has(#chromeless-editor)) .fabric-editor-breakout-mark{width:100%!important}
|
|
77
|
+
._q0l01bp4 >.ak-editor-content-area{flex-direction:column}
|
|
78
|
+
._qgzyidpf >.ak-editor-content-area>[data-testid=plugins-components-wrapper]{min-width:0}
|
|
79
|
+
._qkfz261p .fabric-editor--full-width-mode:not(:has(#chromeless-editor)) .fabric-editor-breakout-mark{margin-left:unset!important}
|
|
80
|
+
._t2fzglyw .ProseMirror>p{clear:none}
|
|
81
|
+
._tynl4diq .fabric-editor--full-width-mode [data-layout-section]{max-width:calc(100% + 40px)}
|
|
82
|
+
._tynlfknx .fabric-editor--full-width-mode [data-layout-section]{max-width:calc(100% + 24px)}
|
|
83
|
+
._u5f31ex1{padding-right:52px}
|
|
84
|
+
._u5f3idpf{padding-right:0}
|
|
85
|
+
._u5f3t9kd{padding-right:72px}
|
|
86
|
+
._vchhusvi{box-sizing:border-box}
|
|
87
|
+
._vtulglyw .ProseMirror>h6{clear:none}
|
|
88
|
+
._vwz41tcg{line-height:24px}
|
|
89
|
+
._xpemaq80 .fabric-editor--full-width-mode:not(:has(#chromeless-editor)) .extension-container.block{width:100%!important}
|
|
90
|
+
._yq1qglyw .ProseMirror>h2{clear:none}
|
|
91
|
+
._zr7faq80 .fabric-editor--full-width-mode:not(:has(#chromeless-editor)) .pm-table-container{width:100%!important}
|
|
92
|
+
.ak-editor-content-area-no-toolbar ._1uizkqmb{padding-top:calc(var(--ds-space-600, 3pc) + var(--ak-editor-fullpage-toolbar-height) + 1px)}
|
|
93
|
+
.extension-editable-area ._13hh1y6m{align-self:flex-start}
|
|
94
|
+
.extension-editable-area ._1hgw1wug{height:auto}
|
|
95
|
+
.extension-editable-area ._1t1q1if8{position:sticky}
|
|
96
|
+
.extension-editable-area ._uj9widpf{top:0}
|
|
97
|
+
@container editor-area (max-width: 600px){._1d7gidpf{padding-top:0}._n2nw1tcg{padding-right:24px}._d329idpf{padding-bottom:0}._105p1tcg{padding-left:24px}}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/* FullPageContentArea-compiled.tsx generated by @compiled/babel-plugin v0.39.1 */
|
|
2
|
+
import "./FullPageContentArea-compiled.compiled.css";
|
|
3
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
+
import React, { useImperativeHandle, useRef } from 'react';
|
|
5
|
+
import classnames from 'classnames';
|
|
6
|
+
import { injectIntl } from 'react-intl';
|
|
7
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
8
|
+
import { fullPageMessages as messages } from '@atlaskit/editor-common/messages';
|
|
9
|
+
import { akEditorGutterPaddingDynamic, akEditorGutterPaddingReduced, akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
10
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
|
+
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
12
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
13
|
+
|
|
14
|
+
// Ignored via go/ees005
|
|
15
|
+
// eslint-disable-next-line import/no-named-as-default
|
|
16
|
+
|
|
17
|
+
import { ClickAreaBlock } from '../../Addon/ClickAreaBlock';
|
|
18
|
+
import { contentComponentClickWrapper } from '../../Addon/ClickAreaBlock/contentComponentWrapper';
|
|
19
|
+
import { ContextPanel } from '../../ContextPanel';
|
|
20
|
+
import EditorContentContainer from '../../EditorContentContainer/EditorContentContainer';
|
|
21
|
+
import PluginSlot from '../../PluginSlot';
|
|
22
|
+
var akEditorFullWidthLayoutWidth = 1800;
|
|
23
|
+
var akEditorUltraWideLayoutWidth = 4000;
|
|
24
|
+
var akEditorSwoopCubicBezier = "cubic-bezier(0.15, 1, 0.3, 1)";
|
|
25
|
+
var tableMarginFullWidthMode = 2;
|
|
26
|
+
var akLayoutGutterOffset = 12;
|
|
27
|
+
var SWOOP_ANIMATION = "0.5s ".concat(akEditorSwoopCubicBezier);
|
|
28
|
+
var AK_NESTED_DND_GUTTER_OFFSET = 8;
|
|
29
|
+
var getTotalPadding = function getTotalPadding() {
|
|
30
|
+
return akEditorGutterPaddingDynamic() * 2;
|
|
31
|
+
};
|
|
32
|
+
var compiledStyles = {
|
|
33
|
+
contentAreaWrapper: "_1bsb1osq _7cca15wb _1f38dez1 _njlp131u",
|
|
34
|
+
sidebarArea: "_4t3i1osq _vchhusvi _1wpzesu3 _1hgw1wug _1t1q1if8 _uj9widpf _13hh1y6m",
|
|
35
|
+
editorContentAreaProsemirrorStyle: "_j9k7kb7n _18q6usvi _l4a11hrf _1nw4glyw _yq1qglyw _1qzyglyw _ongaglyw _1rnyglyw _vtulglyw _13svglyw _t2fzglyw _7uc0glyw _1gl01ejb",
|
|
36
|
+
hideEditorContentAreaProsemirrorWithAttributeStyle: "_12glglyw",
|
|
37
|
+
hideEditorContentAreaScrollGutterWithAttributeStyle: "_amwgglyw",
|
|
38
|
+
hideEditorScrollGutterStyle: "_1e0cglyw",
|
|
39
|
+
fullWidthNonChromelessBreakoutBlockTableStyle: "_xpemaq80 _pnffaq80 _zr7faq80 _qkfz261p _i92uagmp",
|
|
40
|
+
contentAreaReservedPrimaryToolbarSpace: "_19pknm9q",
|
|
41
|
+
contentAreaReducedHeaderSpace: "_ca0qxy5q",
|
|
42
|
+
editorContentAreaNew: "_19pk1wug _2hwx1wug _otyr1wug _18u01wug _v5641fxv _vwz41tcg _ca0qoahv _n3tdoahv _4t3i1ap5 _1bsb1osq _2lx21bp4 _16jlkb7n _p12f5kin _1uizkqmb",
|
|
43
|
+
tableFullPageEditorStylesNew: "_1tb2idpf _8vye1n1a _1k8i1osq",
|
|
44
|
+
editorContentAreaContainerNestedDndStyle: "_tynl4diq",
|
|
45
|
+
editorContentAreaContainerStyleExcludeCodeBlockNew: "_1wxymslj _9dtbmslj _17q71osq _1b7c1kw7 _tynlfknx",
|
|
46
|
+
editorContentAreaContainerStyleNew: "_142emslj _1wxymslj _9dtbmslj _17q71osq _1b7c1kw7 _tynlfknx",
|
|
47
|
+
editorContentGutterStyleFG: "_ca0qidpf _u5f3t9kd _n3tdidpf _19bvt9kd",
|
|
48
|
+
editorContentGutterStyles: "_ca0qidpf _u5f31ex1 _n3tdidpf _19bv1ex1 _vchhusvi",
|
|
49
|
+
editorContentReducedGutterStyles: "_1d7gidpf _n2nw1tcg _d329idpf _105p1tcg",
|
|
50
|
+
contentAreaNew: "_19pkidpf _2hwxidpf _otyridpf _18u0idpf _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _v5642kub _1e0c1txw _2lx2vrvc _4t3ibhu0 _vchhusvi _8j6w1lxk",
|
|
51
|
+
contentAreaHeightNoToolbar: "_4t3i1osq",
|
|
52
|
+
markdownModeContainerBackgroundStyle: "_bfhkhfxm _101j15vq",
|
|
53
|
+
markdownModeContentAreaStyle: "_19pkidpf _2hwxidpf _otyridpf _18u0idpf _vchhusvi _4t3i1osq _p12fglyw _1ul9idpf _n3tdidpf _ca0qidpf _1bsb1osq _fh67idpf _71ybidpf _evz0idpf _1n5qidpf _1wrrusvi _13jk1txw _q0l01bp4 _1a1d1osq _1vbxidpf _1xouidpf _4tbp1osq _1e8kkb7n _boivkb7n _13t61wug _11bl1txw _1593idpf _qgzyidpf _li931osq"
|
|
54
|
+
};
|
|
55
|
+
export var CONTENT_AREA_TEST_ID = 'ak-editor-fp-content-area';
|
|
56
|
+
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
57
|
+
export var EDITOR_CONTAINER = 'ak-editor-container';
|
|
58
|
+
var Content = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
59
|
+
var _props$editorAPI, _props$editorAPI$bloc, _props$editorAPI2, _contentAreaRef$curre, _allowScrollGutter$gu, _allowScrollGutter$gu2;
|
|
60
|
+
var fullWidthMode = props.appearance === 'full-width';
|
|
61
|
+
var maxWidthMode = props.appearance === 'max';
|
|
62
|
+
var scrollContainerRef = useRef(null);
|
|
63
|
+
var contentAreaRef = useRef(null);
|
|
64
|
+
var containerRef = useRef(null);
|
|
65
|
+
var allowScrollGutter = (_props$editorAPI = props.editorAPI) === null || _props$editorAPI === void 0 || (_props$editorAPI = _props$editorAPI.base) === null || _props$editorAPI === void 0 || (_props$editorAPI = _props$editorAPI.sharedState.currentState()) === null || _props$editorAPI === void 0 ? void 0 : _props$editorAPI.allowScrollGutter;
|
|
66
|
+
var contentAreaMaxWidth = getTotalPadding() + (!fullWidthMode ? maxWidthMode ? akEditorUltraWideLayoutWidth : akEditorDefaultLayoutWidth : akEditorFullWidthLayoutWidth);
|
|
67
|
+
|
|
68
|
+
// Get useStandardNodeWidth from block menu plugin shared state
|
|
69
|
+
// Only access editorAPI when the experiment is enabled to avoid performance impact
|
|
70
|
+
var useStandardNodeWidth = editorExperiment('platform_editor_controls', 'variant1') && ((_props$editorAPI$bloc = (_props$editorAPI2 = props.editorAPI) === null || _props$editorAPI2 === void 0 || (_props$editorAPI2 = _props$editorAPI2.blockMenu) === null || _props$editorAPI2 === void 0 || (_props$editorAPI2 = _props$editorAPI2.sharedState) === null || _props$editorAPI2 === void 0 || (_props$editorAPI2 = _props$editorAPI2.currentState()) === null || _props$editorAPI2 === void 0 ? void 0 : _props$editorAPI2.useStandardNodeWidth) !== null && _props$editorAPI$bloc !== void 0 ? _props$editorAPI$bloc : false);
|
|
71
|
+
useImperativeHandle(ref, function () {
|
|
72
|
+
return {
|
|
73
|
+
get scrollContainer() {
|
|
74
|
+
return scrollContainerRef.current;
|
|
75
|
+
},
|
|
76
|
+
get contentArea() {
|
|
77
|
+
return contentAreaRef.current;
|
|
78
|
+
},
|
|
79
|
+
get containerArea() {
|
|
80
|
+
return containerRef.current;
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
}, []);
|
|
84
|
+
var markdownPluginCurrentView = useSharedPluginStateWithSelector(props.editorAPI, ['markdownMode'], function (states) {
|
|
85
|
+
var _states$markdownModeS;
|
|
86
|
+
return (_states$markdownModeS = states.markdownModeState) === null || _states$markdownModeS === void 0 ? void 0 : _states$markdownModeS.view;
|
|
87
|
+
});
|
|
88
|
+
var markdownPluginCurrentIsMarkdownMode = useSharedPluginStateWithSelector(props.editorAPI, ['markdownMode'], function (states) {
|
|
89
|
+
var _states$markdownModeS2;
|
|
90
|
+
return (_states$markdownModeS2 = states.markdownModeState) === null || _states$markdownModeS2 === void 0 ? void 0 : _states$markdownModeS2.isMarkdownMode;
|
|
91
|
+
});
|
|
92
|
+
var isMarkdownModeExperimentEnabled = expValEqualsNoExposure('cc-markdown-mode', 'isEnabled', true);
|
|
93
|
+
var shouldHideProseMirrorForMarkdownMode = isMarkdownModeExperimentEnabled && markdownPluginCurrentView !== 'preview' && markdownPluginCurrentIsMarkdownMode;
|
|
94
|
+
var shouldHideScrollGutterForMarkdownMode = isMarkdownModeExperimentEnabled && markdownPluginCurrentIsMarkdownMode;
|
|
95
|
+
var shouldUseMarkdownModeMvpLayout = shouldHideProseMirrorForMarkdownMode && fg('platform_editor_md_mvp_layout');
|
|
96
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
97
|
+
"data-testid": CONTENT_AREA_TEST_ID,
|
|
98
|
+
ref: containerRef,
|
|
99
|
+
className: ax([compiledStyles.contentAreaNew, props.isEditorToolbarHidden && compiledStyles.contentAreaHeightNoToolbar])
|
|
100
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
101
|
+
"data-testid": EDITOR_CONTAINER,
|
|
102
|
+
"data-editor-container": 'true',
|
|
103
|
+
className: ax([compiledStyles.contentAreaWrapper, shouldUseMarkdownModeMvpLayout && compiledStyles.markdownModeContainerBackgroundStyle])
|
|
104
|
+
}, /*#__PURE__*/React.createElement(EditorContentContainer
|
|
105
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
106
|
+
, {
|
|
107
|
+
className: "fabric-editor-popup-scroll-parent",
|
|
108
|
+
featureFlags: props.featureFlags,
|
|
109
|
+
ref: scrollContainerRef,
|
|
110
|
+
viewMode: props === null || props === void 0 ? void 0 : props.viewMode,
|
|
111
|
+
isScrollable: true,
|
|
112
|
+
appearance: props.appearance,
|
|
113
|
+
contentMode: props.contentMode,
|
|
114
|
+
useStandardNodeWidth: useStandardNodeWidth
|
|
115
|
+
}, /*#__PURE__*/React.createElement(ClickAreaBlock, {
|
|
116
|
+
editorView: props.editorView,
|
|
117
|
+
editorDisabled: props.disabled
|
|
118
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
119
|
+
"data-markdown-mode-hide-prosemirror": shouldHideProseMirrorForMarkdownMode ? 'true' : undefined,
|
|
120
|
+
"data-markdown-mode-hide-scroll-gutter": shouldHideScrollGutterForMarkdownMode ? 'true' : undefined,
|
|
121
|
+
style: {
|
|
122
|
+
'--ak-editor-content-area-max-width': "".concat(contentAreaMaxWidth, "px")
|
|
123
|
+
}
|
|
124
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
125
|
+
,
|
|
126
|
+
className: ax([compiledStyles.editorContentAreaNew, compiledStyles.editorContentAreaProsemirrorStyle, shouldHideProseMirrorForMarkdownMode && compiledStyles.hideEditorContentAreaProsemirrorWithAttributeStyle, shouldHideScrollGutterForMarkdownMode && compiledStyles.hideEditorContentAreaScrollGutterWithAttributeStyle, shouldUseMarkdownModeMvpLayout && compiledStyles.markdownModeContentAreaStyle, compiledStyles.tableFullPageEditorStylesNew, compiledStyles.fullWidthNonChromelessBreakoutBlockTableStyle, expValEqualsNoExposure('platform_editor_breakout_resizing', 'isEnabled', true) ? compiledStyles.editorContentAreaContainerStyleExcludeCodeBlockNew : compiledStyles.editorContentAreaContainerStyleNew, fg('platform_editor_nested_dnd_styles_changes') && compiledStyles.editorContentAreaContainerNestedDndStyle, !fg('platform_editor_controls_no_toolbar_space') && editorExperiment('platform_editor_controls', 'variant1') && compiledStyles.contentAreaReducedHeaderSpace, !fg('platform_editor_controls_no_toolbar_space') && props.isEditorToolbarHidden && editorExperiment('platform_editor_controls', 'variant1') && compiledStyles.contentAreaReservedPrimaryToolbarSpace, "ak-editor-content-area-region"]),
|
|
127
|
+
"data-editor-editable-content": true,
|
|
128
|
+
role: "region",
|
|
129
|
+
"aria-label": props.intl.formatMessage(messages.editableContentLabel),
|
|
130
|
+
ref: contentAreaRef,
|
|
131
|
+
"data-vc": "editor-content-area-region"
|
|
132
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
133
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
134
|
+
className: ax([compiledStyles.editorContentGutterStyles, fg('platform_editor_controls_increase_full_page_gutter') && editorExperiment('platform_editor_controls', 'variant1') && compiledStyles.editorContentGutterStyleFG, editorExperiment('platform_editor_preview_panel_responsiveness', true, {
|
|
135
|
+
exposure: true
|
|
136
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
137
|
+
}) && compiledStyles.editorContentReducedGutterStyles, classnames('ak-editor-content-area', 'appearance-full-page', {
|
|
138
|
+
'fabric-editor--full-width-mode': fullWidthMode,
|
|
139
|
+
'fabric-editor--max-width-mode': Boolean(maxWidthMode)
|
|
140
|
+
})]),
|
|
141
|
+
ref: contentAreaRef
|
|
142
|
+
}, !!props.customContentComponents && 'before' in props.customContentComponents ? contentComponentClickWrapper(props.customContentComponents.before) : contentComponentClickWrapper(props.customContentComponents), /*#__PURE__*/React.createElement(PluginSlot, {
|
|
143
|
+
editorView: props.editorView,
|
|
144
|
+
editorActions: props.editorActions,
|
|
145
|
+
eventDispatcher: props.eventDispatcher,
|
|
146
|
+
providerFactory: props.providerFactory,
|
|
147
|
+
appearance: props.appearance,
|
|
148
|
+
items: props.contentComponents,
|
|
149
|
+
pluginHooks: props.pluginHooks,
|
|
150
|
+
contentArea: (_contentAreaRef$curre = contentAreaRef.current) !== null && _contentAreaRef$curre !== void 0 ? _contentAreaRef$curre : undefined,
|
|
151
|
+
popupsMountPoint: props.popupsMountPoint,
|
|
152
|
+
popupsBoundariesElement: props.popupsBoundariesElement,
|
|
153
|
+
popupsScrollableElement: props.popupsScrollableElement,
|
|
154
|
+
disabled: !!props.disabled,
|
|
155
|
+
containerElement: scrollContainerRef.current,
|
|
156
|
+
dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
|
|
157
|
+
wrapperElement: props.wrapperElement
|
|
158
|
+
}), props.editorDOMElement, !!props.customContentComponents && 'after' in props.customContentComponents ? contentComponentClickWrapper(props.customContentComponents.after) : null, allowScrollGutter && (editorExperiment('platform_editor_blocks', true) ? /*#__PURE__*/React.createElement("div", {
|
|
159
|
+
id: "editor-scroll-gutter",
|
|
160
|
+
style: {
|
|
161
|
+
paddingBottom: "".concat((_allowScrollGutter$gu = allowScrollGutter.gutterSize) !== null && _allowScrollGutter$gu !== void 0 ? _allowScrollGutter$gu : '120', "px")
|
|
162
|
+
},
|
|
163
|
+
"data-vc": "scroll-gutter",
|
|
164
|
+
"data-editor-scroll-gutter": "true",
|
|
165
|
+
className: ax([shouldHideScrollGutterForMarkdownMode && compiledStyles.hideEditorScrollGutterStyle])
|
|
166
|
+
}) : /*#__PURE__*/React.createElement("div", {
|
|
167
|
+
id: "editor-scroll-gutter",
|
|
168
|
+
style: {
|
|
169
|
+
paddingBottom: "".concat((_allowScrollGutter$gu2 = allowScrollGutter.gutterSize) !== null && _allowScrollGutter$gu2 !== void 0 ? _allowScrollGutter$gu2 : '120', "px")
|
|
170
|
+
},
|
|
171
|
+
"data-vc": "scroll-gutter",
|
|
172
|
+
className: ax([shouldHideScrollGutterForMarkdownMode && compiledStyles.hideEditorScrollGutterStyle])
|
|
173
|
+
}))))))), /*#__PURE__*/React.createElement("div", {
|
|
174
|
+
className: ax([compiledStyles.sidebarArea])
|
|
175
|
+
}, props.contextPanel || /*#__PURE__*/React.createElement(ContextPanel, {
|
|
176
|
+
editorAPI: props.editorAPI,
|
|
177
|
+
visible: false
|
|
178
|
+
})));
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
182
|
+
export var FullPageContentAreaCompiled = injectIntl(Content, {
|
|
183
|
+
forwardRef: true
|
|
184
|
+
});
|