@atlaskit/editor-core 213.5.6 → 213.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/cjs/ui/Appearance/Comment/Comment.js +5 -12
- package/dist/cjs/ui/Appearance/Comment/Toolbar.js +5 -24
- package/dist/cjs/ui/Appearance/FullPage/CustomToolbarWrapper.js +5 -42
- package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea.js +5 -136
- package/dist/cjs/ui/Appearance/FullPage/MainToolbar.js +1 -55
- package/dist/cjs/ui/Appearance/FullPage/MainToolbarWrapper.js +2 -31
- package/dist/cjs/ui/Appearance/FullPage/StyledComponents.js +1 -25
- package/dist/cjs/ui/Toolbar/ToolbarWithSizeDetector.js +4 -70
- package/dist/cjs/utils/validateNodes.js +1 -46
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/ui/Appearance/Comment/Comment.js +1 -23
- package/dist/es2019/ui/Appearance/Comment/Toolbar.js +2 -72
- package/dist/es2019/ui/Appearance/FullPage/CustomToolbarWrapper.js +3 -34
- package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea.js +7 -134
- package/dist/es2019/ui/Appearance/FullPage/MainToolbar.js +1 -58
- package/dist/es2019/ui/Appearance/FullPage/MainToolbarWrapper.js +3 -31
- package/dist/es2019/ui/Appearance/FullPage/StyledComponents.js +0 -24
- package/dist/es2019/ui/Toolbar/ToolbarWithSizeDetector.js +3 -65
- package/dist/es2019/utils/validateNodes.js +1 -43
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/ui/Appearance/Comment/Comment.js +1 -11
- package/dist/esm/ui/Appearance/Comment/Toolbar.js +2 -23
- package/dist/esm/ui/Appearance/FullPage/CustomToolbarWrapper.js +5 -42
- package/dist/esm/ui/Appearance/FullPage/FullPageContentArea.js +7 -138
- package/dist/esm/ui/Appearance/FullPage/MainToolbar.js +1 -55
- package/dist/esm/ui/Appearance/FullPage/MainToolbarWrapper.js +3 -32
- package/dist/esm/ui/Appearance/FullPage/StyledComponents.js +0 -24
- package/dist/esm/ui/Toolbar/ToolbarWithSizeDetector.js +4 -70
- package/dist/esm/utils/validateNodes.js +1 -47
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/ui/Appearance/FullPage/CustomToolbarWrapper.d.ts +3 -2
- package/dist/types/ui/Appearance/FullPage/MainToolbar.d.ts +0 -1
- package/dist/types/ui/Appearance/FullPage/MainToolbarWrapper.d.ts +2 -8
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +0 -1
- package/dist/types/ui/Toolbar/ToolbarWithSizeDetector.d.ts +2 -6
- package/dist/types-ts4.5/ui/Appearance/FullPage/CustomToolbarWrapper.d.ts +3 -2
- package/dist/types-ts4.5/ui/Appearance/FullPage/MainToolbar.d.ts +0 -1
- package/dist/types-ts4.5/ui/Appearance/FullPage/MainToolbarWrapper.d.ts +2 -8
- package/dist/types-ts4.5/ui/Appearance/FullPage/StyledComponents.d.ts +0 -1
- package/dist/types-ts4.5/ui/Toolbar/ToolbarWithSizeDetector.d.ts +2 -6
- package/package.json +11 -27
|
@@ -8,9 +8,7 @@ import React from 'react';
|
|
|
8
8
|
import { css, jsx } from '@emotion/react';
|
|
9
9
|
import { akEditorFloatingDialogZIndex, akEditorSwoopCubicBezier } from '@atlaskit/editor-shared-styles';
|
|
10
10
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
|
-
import {
|
|
12
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
13
|
-
import { mainToolbarStyle as mainToolbarStyleDynamic, MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT } from './MainToolbar';
|
|
11
|
+
import { MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT } from './MainToolbar';
|
|
14
12
|
|
|
15
13
|
// Base styles that don't depend on feature flags
|
|
16
14
|
const baseToolbarStyles = css({
|
|
@@ -52,7 +50,7 @@ const mainToolbarTwoLineStyle = css({
|
|
|
52
50
|
height: `calc(var(--ak-editor-fullpage-toolbar-height) * 2)`
|
|
53
51
|
}
|
|
54
52
|
});
|
|
55
|
-
const
|
|
53
|
+
export const MainToolbarWrapper = ({
|
|
56
54
|
showKeyline,
|
|
57
55
|
twoLineEditorToolbar,
|
|
58
56
|
children,
|
|
@@ -63,30 +61,4 @@ const MainToolbarWrapperNext = ({
|
|
|
63
61
|
css: [baseToolbarStyles, fg('platform-visual-refresh-icons') && flexibleIconSize, showKeyline && mainToolbarWithKeyline, twoLineEditorToolbar && mainToolbarTwoLineStyle],
|
|
64
62
|
"data-testid": testId
|
|
65
63
|
}, children);
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Original version of the toolbar wrapper using dynamic styles
|
|
70
|
-
*/
|
|
71
|
-
const MainToolbarWrapperOld = ({
|
|
72
|
-
showKeyline,
|
|
73
|
-
twoLineEditorToolbar,
|
|
74
|
-
children,
|
|
75
|
-
'data-testid': testId
|
|
76
|
-
}) => {
|
|
77
|
-
return jsx("div", {
|
|
78
|
-
css:
|
|
79
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
80
|
-
mainToolbarStyleDynamic(showKeyline, twoLineEditorToolbar),
|
|
81
|
-
"data-testid": testId
|
|
82
|
-
}, children);
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Wrapper component for the main toolbar that handles feature flag based styling
|
|
87
|
-
* @example
|
|
88
|
-
* <MainToolbarWrapper showKeyline={true} twoLineEditorToolbar={false}>
|
|
89
|
-
* <ToolbarContent />
|
|
90
|
-
* </MainToolbarWrapper>
|
|
91
|
-
*/
|
|
92
|
-
export const MainToolbarWrapper = componentWithCondition(() => expValEquals('platform_editor_core_static_emotion_non_central', 'isEnabled', true), MainToolbarWrapperNext, MainToolbarWrapperOld);
|
|
64
|
+
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
2
2
|
import { css } from '@emotion/react';
|
|
3
|
-
import { FULL_PAGE_EDITOR_TOOLBAR_HEIGHT, akEditorSwoopCubicBezier } from '@atlaskit/editor-shared-styles';
|
|
4
3
|
|
|
5
4
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
6
5
|
export const fullPageEditorWrapper = css({
|
|
@@ -11,29 +10,6 @@ export const fullPageEditorWrapper = css({
|
|
|
11
10
|
boxSizing: 'border-box'
|
|
12
11
|
});
|
|
13
12
|
|
|
14
|
-
// delete when cleaning up experiment `platform_editor_core_static_emotion_non_central`
|
|
15
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
16
|
-
export const contentArea = () => {
|
|
17
|
-
const editorToolbarHeight = FULL_PAGE_EDITOR_TOOLBAR_HEIGHT();
|
|
18
|
-
return css({
|
|
19
|
-
display: 'flex',
|
|
20
|
-
flexDirection: 'row',
|
|
21
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
22
|
-
height: `calc(100% - ${editorToolbarHeight})`,
|
|
23
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
24
|
-
'&.ak-editor-content-area-no-toolbar': {
|
|
25
|
-
// The editor toolbar height is 1px off (from the border) -- so we need to add 1px to the height
|
|
26
|
-
// to match the toolbar height
|
|
27
|
-
height: `calc(100% + 1px)`
|
|
28
|
-
},
|
|
29
|
-
boxSizing: 'border-box',
|
|
30
|
-
margin: 0,
|
|
31
|
-
padding: 0,
|
|
32
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
33
|
-
transition: `padding 0ms ${akEditorSwoopCubicBezier}`
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
|
|
37
13
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
38
14
|
export const contentAreaWrapper = css({
|
|
39
15
|
width: '100%',
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
/**
|
|
3
2
|
* @jsxRuntime classic
|
|
4
3
|
* @jsx jsx
|
|
@@ -9,77 +8,17 @@ import React, { useMemo } from 'react';
|
|
|
9
8
|
import { css, jsx } from '@emotion/react';
|
|
10
9
|
import { isSSR } from '@atlaskit/editor-common/core-utils';
|
|
11
10
|
import { ToolbarSize } from '@atlaskit/editor-common/types';
|
|
12
|
-
import { akEditorMobileMaxWidth } from '@atlaskit/editor-shared-styles';
|
|
13
|
-
import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
|
|
14
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
15
11
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
16
12
|
import { WidthObserver } from '@atlaskit/width-detector';
|
|
17
13
|
import { isFullPage } from '../../utils/is-full-page';
|
|
18
14
|
import { useElementWidth } from './hooks';
|
|
19
15
|
import { Toolbar } from './Toolbar';
|
|
20
16
|
import { toolbarSizeToWidth, widthToToolbarSize } from './toolbar-size';
|
|
21
|
-
// Remove when platform_editor_core_static_emotion_non_central is cleaned up
|
|
22
17
|
const toolbar = css({
|
|
23
|
-
width: '100%',
|
|
24
|
-
position: 'relative',
|
|
25
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
26
|
-
[`@media (max-width: ${akEditorMobileMaxWidth}px)`]: {
|
|
27
|
-
gridColumn: '1 / 2',
|
|
28
|
-
gridRow: 2,
|
|
29
|
-
width: 'calc(100% - 30px)',
|
|
30
|
-
margin: `0 ${"var(--ds-space-200, 16px)"}`
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
// Rename to toolbar when platform_editor_core_static_emotion_non_central is cleaned up
|
|
35
|
-
const staticToolbar = css({
|
|
36
18
|
width: '100%',
|
|
37
19
|
position: 'relative'
|
|
38
|
-
// The media query below has been commented out as akEditorMobileMaxWidth is 0px and thus the styles are never applied.
|
|
39
|
-
// [`@media (max-width: ${akEditorMobileMaxWidth}px)`]: {
|
|
40
|
-
// gridColumn: '1 / 2',
|
|
41
|
-
// gridRow: 2,
|
|
42
|
-
// width: 'calc(100% - 30px)',
|
|
43
|
-
// margin: `0 ${token('space.200', '16px')}`,
|
|
44
|
-
// },
|
|
45
20
|
});
|
|
46
|
-
const
|
|
47
|
-
const ref = React.useRef(null);
|
|
48
|
-
const [width, setWidth] = React.useState(undefined);
|
|
49
|
-
const elementWidth = useElementWidth(ref, {
|
|
50
|
-
skip: typeof width !== 'undefined'
|
|
51
|
-
});
|
|
52
|
-
const defaultToolbarSize = isSSR() && isFullPage(props.appearance) ? ToolbarSize.XXL : undefined;
|
|
53
|
-
const toolbarSize = typeof width === 'undefined' && typeof elementWidth === 'undefined' ? defaultToolbarSize :
|
|
54
|
-
// Ignored via go/ees005
|
|
55
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
56
|
-
widthToToolbarSize(width || elementWidth, props.appearance);
|
|
57
|
-
const toolbarStyle = useMemo(() => {
|
|
58
|
-
const toolbarWidth = isFullPage(props.appearance) && props.twoLineEditorToolbar ? ToolbarSize.S : ToolbarSize.M;
|
|
59
|
-
const toolbarMinWidth = toolbarSizeToWidth(toolbarWidth, props.appearance);
|
|
60
|
-
const isPreviewPanelResponsivenessEnabled = editorExperiment('platform_editor_preview_panel_responsiveness', true, {
|
|
61
|
-
exposure: true
|
|
62
|
-
});
|
|
63
|
-
const minWidth = `min-width: ${props.hasMinWidth ? `${toolbarMinWidth}px` : isPreviewPanelResponsivenessEnabled ? 'fit-content' : '254px'}`;
|
|
64
|
-
return [toolbar, minWidth];
|
|
65
|
-
}, [props.appearance, props.hasMinWidth, props.twoLineEditorToolbar]);
|
|
66
|
-
return (
|
|
67
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
68
|
-
jsx("div", {
|
|
69
|
-
css: toolbarStyle
|
|
70
|
-
}, jsx(WidthObserver, {
|
|
71
|
-
setWidth: setWidth
|
|
72
|
-
}), props.editorView && toolbarSize ?
|
|
73
|
-
// Ignored via go/ees005
|
|
74
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
75
|
-
jsx(Toolbar, _extends({}, props, {
|
|
76
|
-
toolbarSize: toolbarSize
|
|
77
|
-
})) : jsx("div", {
|
|
78
|
-
ref: ref
|
|
79
|
-
}))
|
|
80
|
-
);
|
|
81
|
-
};
|
|
82
|
-
const StaticStyleToolbarWithSizeDetector = props => {
|
|
21
|
+
export const ToolbarWithSizeDetector = props => {
|
|
83
22
|
const ref = React.useRef(null);
|
|
84
23
|
const [width, setWidth] = React.useState(undefined);
|
|
85
24
|
const elementWidth = useElementWidth(ref, {
|
|
@@ -102,7 +41,7 @@ const StaticStyleToolbarWithSizeDetector = props => {
|
|
|
102
41
|
}
|
|
103
42
|
}, [props.appearance, props.hasMinWidth, props.twoLineEditorToolbar]);
|
|
104
43
|
return jsx("div", {
|
|
105
|
-
css:
|
|
44
|
+
css: toolbar,
|
|
106
45
|
style: {
|
|
107
46
|
minWidth: minWidthValue
|
|
108
47
|
}
|
|
@@ -127,5 +66,4 @@ const StaticStyleToolbarWithSizeDetector = props => {
|
|
|
127
66
|
}) : jsx("div", {
|
|
128
67
|
ref: ref
|
|
129
68
|
}));
|
|
130
|
-
};
|
|
131
|
-
export const ToolbarWithSizeDetector = componentWithCondition(() => expValEquals('platform_editor_core_static_emotion_non_central', 'isEnabled', true), StaticStyleToolbarWithSizeDetector, DynamicStyleToolbarWithSizeDetector);
|
|
69
|
+
};
|
|
@@ -1,48 +1,6 @@
|
|
|
1
|
-
import { Mark } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
3
|
-
|
|
4
|
-
// We don't want to use memoize from lodash, because we need to use WeakMap or WeakSet
|
|
5
|
-
// to avoid memory leaks, but lodash allow to change the cache type only globally
|
|
6
|
-
// like `memoize.Cache = WeakMap`, and we don't want to do that.
|
|
7
|
-
// So we use our own cache implementation.
|
|
8
|
-
const cache = new WeakSet();
|
|
9
|
-
|
|
10
|
-
// See https://github.com/ProseMirror/prosemirror-model/blob/20d26c9843d6a69a1d417d937c401537ee0b2342/src/node.ts#L303
|
|
11
|
-
function checkNode(node) {
|
|
12
|
-
if (cache.has(node)) {
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// @ts-expect-error - This is internal ProseMirror API, but we okay with it
|
|
17
|
-
node.type.checkContent(node.content);
|
|
18
|
-
// @ts-expect-error - This is internal ProseMirror API, but we okay with it
|
|
19
|
-
node.type.checkAttrs(node.attrs);
|
|
20
|
-
let copy = Mark.none;
|
|
21
|
-
for (let i = 0; i < node.marks.length; i++) {
|
|
22
|
-
const mark = node.marks[i];
|
|
23
|
-
// @ts-expect-error - This is internal ProseMirror API, but we okay with it
|
|
24
|
-
mark.type.checkAttrs(mark.attrs);
|
|
25
|
-
copy = mark.addToSet(copy);
|
|
26
|
-
}
|
|
27
|
-
if (!Mark.sameSet(copy, node.marks)) {
|
|
28
|
-
throw new RangeError(`Invalid collection of marks for node ${node.type.name}: ${node.marks.map(m => m.type.name)}`);
|
|
29
|
-
}
|
|
30
|
-
node.content.forEach(node => checkNode(node));
|
|
31
|
-
|
|
32
|
-
// The set value should be added in the end of the function,
|
|
33
|
-
// because any previous check can throw an error,
|
|
34
|
-
// and we don't want to add invalid node to the cache.
|
|
35
|
-
cache.add(node);
|
|
36
|
-
}
|
|
37
1
|
export const validNode = node => {
|
|
38
2
|
try {
|
|
39
|
-
|
|
40
|
-
exposure: true
|
|
41
|
-
})) {
|
|
42
|
-
checkNode(node);
|
|
43
|
-
} else {
|
|
44
|
-
node.check();
|
|
45
|
-
}
|
|
3
|
+
node.check();
|
|
46
4
|
} catch (error) {
|
|
47
5
|
return false;
|
|
48
6
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "213.5.
|
|
2
|
+
export const version = "213.5.6";
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
4
|
-
var _templateObject;
|
|
5
3
|
/**
|
|
6
4
|
* @jsxRuntime classic
|
|
7
5
|
* @jsx jsx
|
|
@@ -19,7 +17,6 @@ import messages from '@atlaskit/editor-common/messages';
|
|
|
19
17
|
import { WidthConsumer, WidthProvider } from '@atlaskit/editor-common/ui';
|
|
20
18
|
import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
|
|
21
19
|
import { akEditorMobileBreakoutPoint } from '@atlaskit/editor-shared-styles';
|
|
22
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
23
20
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
24
21
|
// Ignored via go/ees005
|
|
25
22
|
// eslint-disable-next-line import/no-named-as-default
|
|
@@ -57,12 +54,6 @@ var secondaryToolbarStyles = css({
|
|
|
57
54
|
display: 'flex',
|
|
58
55
|
padding: "var(--ds-space-150, 12px)".concat(" ", "var(--ds-space-025, 2px)")
|
|
59
56
|
});
|
|
60
|
-
var mainToolbarCustomComponentsSlotStyle = function mainToolbarCustomComponentsSlotStyle() {
|
|
61
|
-
var isTwoLineEditorToolbar = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
62
|
-
return (// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
|
|
63
|
-
css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t\tdisplay: flex;\n\t\tjustify-content: flex-end;\n\t\talign-items: center;\n\t\tflex-grow: 1;\n\t\tpadding-right: ", ";\n\t\t> div {\n\t\t\tdisplay: flex;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t", "\n\t"])), "var(--ds-space-250, 20px)", isTwoLineEditorToolbar && "\n @media (max-width: ".concat(MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT, "px) {\n {\n padding-right: 0;\n }\n }\n "))
|
|
64
|
-
);
|
|
65
|
-
};
|
|
66
57
|
var mainToolbarCustomComponentsSlotStyleNew = css({
|
|
67
58
|
display: 'flex',
|
|
68
59
|
justifyContent: 'flex-end',
|
|
@@ -168,8 +159,7 @@ export var CommentEditorWithIntl = function CommentEditorWithIntl(props) {
|
|
|
168
159
|
primaryToolbarComponents = primaryToolbarState.components.concat(primaryToolbarComponents);
|
|
169
160
|
}
|
|
170
161
|
var customToolbarSlot = jsx("div", {
|
|
171
|
-
css:
|
|
172
|
-
mainToolbarCustomComponentsSlotStyle(isTwoLineToolbarEnabled)
|
|
162
|
+
css: [mainToolbarCustomComponentsSlotStyleNew, isTwoLineToolbarEnabled && mainToolbarCustomComponentsSlotStyleTwoLineToolbarNew]
|
|
173
163
|
}, customPrimaryToolbarComponents);
|
|
174
164
|
var isToolbarAIFCEnabled = Boolean(editorAPI === null || editorAPI === void 0 ? void 0 : editorAPI.toolbar) && editorExperiment('platform_editor_toolbar_aifc', true);
|
|
175
165
|
return jsx(WithFlash, {
|
|
@@ -2,8 +2,6 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _typeof from "@babel/runtime/helpers/typeof";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
4
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
5
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
6
|
-
var _templateObject, _templateObject2;
|
|
7
5
|
/**
|
|
8
6
|
* @jsxRuntime classic
|
|
9
7
|
* @jsx jsx
|
|
@@ -14,15 +12,9 @@ import React, { useEffect, useState } from 'react';
|
|
|
14
12
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
15
13
|
import { css, jsx } from '@emotion/react';
|
|
16
14
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
18
15
|
var MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT = 490;
|
|
19
16
|
var akEditorMenuZIndex = 500;
|
|
20
17
|
var akEditorToolbarKeylineHeight = 2;
|
|
21
|
-
var mainToolbarWrapperStyle = function mainToolbarWrapperStyle() {
|
|
22
|
-
var isTwoLineEditorToolbar = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
23
|
-
var isToolbarAifcEnabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
24
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\tposition: relative;\n\talign-items: center;\n\tpadding: ", " ", " 0;\n\tdisplay: flex;\n\theight: auto;\n\tbackground-color: ", ";\n\tbox-shadow: none;\n\t", "\n\n\t& > div {\n\t\t> :first-child:not(style),\n\t\t> style:first-child + * {\n\t\t\tmargin-left: 0;\n\t\t}\n\t\t", "\n\t}\n\n\t.block-type-btn {\n\t\tpadding-left: 0;\n\t}\n\n\t", "\n"])), "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", "var(--ds-surface, white)", isToolbarAifcEnabled ? '' : "padding-left: ".concat("var(--ds-space-250, 20px)", ";"), isTwoLineEditorToolbar && "\n @media (max-width: ".concat(MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT, "px) {\n flex-direction: column-reverse;\n align-items: end;\n display: flex;\n justify-content: flex-end;\n }\n\n /* make this more explicit for a toolbar */\n > *:nth-child(1) {\n @media (max-width: ").concat(MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT, "px) {\n > div:nth-child(2) {\n justify-content: flex-end;\n display: flex;\n }\n }\n }\n "), fg('platform-visual-refresh-icons') && 'span svg { max-width: 100%; }');
|
|
25
|
-
};
|
|
26
18
|
var mainToolbarWrapperStyleNew = css({
|
|
27
19
|
position: 'relative',
|
|
28
20
|
alignItems: 'center',
|
|
@@ -70,11 +62,6 @@ var mainToolbarWrapperStylesVisualRefresh = css({
|
|
|
70
62
|
maxWidth: '100%'
|
|
71
63
|
}
|
|
72
64
|
});
|
|
73
|
-
|
|
74
|
-
/* eslint-enable @atlaskit/platform/ensure-feature-flag-registration */
|
|
75
|
-
|
|
76
|
-
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
77
|
-
var stickyToolbarWrapperStyle = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n\t/* stylelint-disable declaration-block-no-duplicate-properties */\n\tposition: relative;\n\tposition: sticky;\n\t/* stylelint-enable declaration-block-no-duplicate-properties */\n\tpadding-bottom: ", ";\n\tz-index: ", ";\n\ttransition: box-shadow ease-in-out 0.2s;\n\t&.show-keyline {\n\t\tbox-shadow: 0 ", "px 0 0\n\t\t\t", ";\n\t}\n"])), "var(--ds-space-100, 8px)", akEditorMenuZIndex, akEditorToolbarKeylineHeight, "var(--ds-background-accent-gray-subtlest, #F1F2F4)");
|
|
78
65
|
var stickyToolbarWrapperStyleNew = css({
|
|
79
66
|
position: 'sticky',
|
|
80
67
|
paddingBottom: "var(--ds-space-100, 8px)",
|
|
@@ -105,11 +92,7 @@ var StickyToolbar = function StickyToolbar(props) {
|
|
|
105
92
|
return (
|
|
106
93
|
// eslint-disable-next-line @atlaskit/design-system/prefer-primitives
|
|
107
94
|
jsx("div", {
|
|
108
|
-
css:
|
|
109
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
110
|
-
mainToolbarWrapperStyle(props.twoLineEditorToolbar,
|
|
111
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
112
|
-
props.isNewToolbarEnabled), stickyToolbarWrapperStyle]
|
|
95
|
+
css: [mainToolbarWrapperStyleNew, props.twoLineEditorToolbar && mainToolbarTwoLineStylesNew, fg('platform-visual-refresh-icons') && mainToolbarWrapperStylesVisualRefresh, stickyToolbarWrapperStyleNew, props.isNewToolbarEnabled && mainToolbarWithoutLeftPadding]
|
|
113
96
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
114
97
|
,
|
|
115
98
|
style: {
|
|
@@ -126,11 +109,7 @@ var FixedToolbar = function FixedToolbar(props) {
|
|
|
126
109
|
return (
|
|
127
110
|
// eslint-disable-next-line @atlaskit/design-system/prefer-primitives
|
|
128
111
|
jsx("div", {
|
|
129
|
-
css:
|
|
130
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
131
|
-
mainToolbarWrapperStyle(props.twoLineEditorToolbar,
|
|
132
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
133
|
-
props.isNewToolbarEnabled),
|
|
112
|
+
css: [mainToolbarWrapperStyleNew, props.twoLineEditorToolbar && mainToolbarTwoLineStylesNew, fg('platform-visual-refresh-icons') && mainToolbarWrapperStylesVisualRefresh, props.isNewToolbarEnabled && mainToolbarWithoutLeftPadding],
|
|
134
113
|
"data-testid": "ak-editor-main-toolbar"
|
|
135
114
|
}, props.children)
|
|
136
115
|
);
|
|
@@ -6,9 +6,6 @@ import React from 'react';
|
|
|
6
6
|
|
|
7
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
8
|
import { css, jsx } from '@emotion/react';
|
|
9
|
-
import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
|
|
10
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
11
|
-
import { mainToolbarFirstChildStyle, mainToolbarSecondChildStyle } from './MainToolbar';
|
|
12
9
|
// Pre-computed static styles for first- and second-child wrappers.
|
|
13
10
|
// These contain no runtime logic and are safe for static-emotion mode.
|
|
14
11
|
|
|
@@ -47,7 +44,7 @@ var secondChildStaticTwoLine = css({
|
|
|
47
44
|
});
|
|
48
45
|
|
|
49
46
|
// ---------------- First child wrapper ----------------
|
|
50
|
-
var
|
|
47
|
+
export var MainToolbarForFirstChildWrapper = function MainToolbarForFirstChildWrapper(_ref) {
|
|
51
48
|
var twoLineEditorToolbar = _ref.twoLineEditorToolbar,
|
|
52
49
|
children = _ref.children,
|
|
53
50
|
role = _ref.role,
|
|
@@ -60,52 +57,18 @@ var FirstChildWrapperStatic = function FirstChildWrapperStatic(_ref) {
|
|
|
60
57
|
"data-testid": testId
|
|
61
58
|
}, children);
|
|
62
59
|
};
|
|
63
|
-
|
|
60
|
+
|
|
61
|
+
// ---------------- Second child wrapper ----------------
|
|
62
|
+
export var MainToolbarForSecondChildWrapper = function MainToolbarForSecondChildWrapper(_ref2) {
|
|
64
63
|
var twoLineEditorToolbar = _ref2.twoLineEditorToolbar,
|
|
65
64
|
children = _ref2.children,
|
|
66
65
|
role = _ref2.role,
|
|
67
66
|
ariaLabel = _ref2['aria-label'],
|
|
68
67
|
testId = _ref2['data-testid'];
|
|
69
|
-
return jsx("div", {
|
|
70
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/design-system/consistent-css-prop-usage
|
|
71
|
-
css: mainToolbarFirstChildStyle(twoLineEditorToolbar),
|
|
72
|
-
role: role,
|
|
73
|
-
"aria-label": ariaLabel,
|
|
74
|
-
"data-testid": testId
|
|
75
|
-
}, children);
|
|
76
|
-
};
|
|
77
|
-
export var MainToolbarForFirstChildWrapper = componentWithCondition(function () {
|
|
78
|
-
return expValEquals('platform_editor_core_static_emotion_non_central', 'isEnabled', true);
|
|
79
|
-
}, FirstChildWrapperStatic, FirstChildWrapperDynamic);
|
|
80
|
-
|
|
81
|
-
// ---------------- Second child wrapper ----------------
|
|
82
|
-
var SecondChildWrapperStatic = function SecondChildWrapperStatic(_ref3) {
|
|
83
|
-
var twoLineEditorToolbar = _ref3.twoLineEditorToolbar,
|
|
84
|
-
children = _ref3.children,
|
|
85
|
-
role = _ref3.role,
|
|
86
|
-
ariaLabel = _ref3['aria-label'],
|
|
87
|
-
testId = _ref3['data-testid'];
|
|
88
68
|
return jsx("div", {
|
|
89
69
|
css: [secondChildStaticBase, twoLineEditorToolbar && secondChildStaticTwoLine],
|
|
90
70
|
role: role,
|
|
91
71
|
"aria-label": ariaLabel,
|
|
92
72
|
"data-testid": testId
|
|
93
73
|
}, children);
|
|
94
|
-
};
|
|
95
|
-
var SecondChildWrapperDynamic = function SecondChildWrapperDynamic(_ref4) {
|
|
96
|
-
var twoLineEditorToolbar = _ref4.twoLineEditorToolbar,
|
|
97
|
-
children = _ref4.children,
|
|
98
|
-
role = _ref4.role,
|
|
99
|
-
ariaLabel = _ref4['aria-label'],
|
|
100
|
-
testId = _ref4['data-testid'];
|
|
101
|
-
return jsx("div", {
|
|
102
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/design-system/consistent-css-prop-usage
|
|
103
|
-
css: mainToolbarSecondChildStyle(twoLineEditorToolbar),
|
|
104
|
-
role: role,
|
|
105
|
-
"aria-label": ariaLabel,
|
|
106
|
-
"data-testid": testId
|
|
107
|
-
}, children);
|
|
108
|
-
};
|
|
109
|
-
export var MainToolbarForSecondChildWrapper = componentWithCondition(function () {
|
|
110
|
-
return expValEquals('platform_editor_core_static_emotion_non_central', 'isEnabled', true);
|
|
111
|
-
}, SecondChildWrapperStatic, SecondChildWrapperDynamic);
|
|
74
|
+
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
2
|
/**
|
|
4
3
|
* @jsxRuntime classic
|
|
5
4
|
* @jsx jsx
|
|
@@ -13,10 +12,8 @@ import classnames from 'classnames';
|
|
|
13
12
|
import { injectIntl } from 'react-intl-next';
|
|
14
13
|
import { decisionListSelector, taskListSelector } from '@atlaskit/adf-schema';
|
|
15
14
|
import { fullPageMessages as messages } from '@atlaskit/editor-common/messages';
|
|
16
|
-
import {
|
|
17
|
-
import { FULL_PAGE_EDITOR_TOOLBAR_HEIGHT, akEditorGutterPaddingDynamic, akEditorGutterPaddingReduced, akEditorFullPageNarrowBreakout } from '@atlaskit/editor-shared-styles';
|
|
15
|
+
import { akEditorGutterPaddingDynamic, akEditorGutterPaddingReduced, akEditorFullPageNarrowBreakout } from '@atlaskit/editor-shared-styles';
|
|
18
16
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
19
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
20
17
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
21
18
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
22
19
|
import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
@@ -27,7 +24,7 @@ import { contentComponentClickWrapper } from '../../Addon/ClickAreaBlock/content
|
|
|
27
24
|
import { ContextPanel } from '../../ContextPanel';
|
|
28
25
|
import EditorContentContainer from '../../EditorContentContainer/EditorContentContainer';
|
|
29
26
|
import PluginSlot from '../../PluginSlot';
|
|
30
|
-
import {
|
|
27
|
+
import { contentAreaWrapper, sidebarArea } from './StyledComponents';
|
|
31
28
|
var akEditorFullWidthLayoutWidth = 1800;
|
|
32
29
|
var akEditorSwoopCubicBezier = "cubic-bezier(0.15, 1, 0.3, 1)";
|
|
33
30
|
var tableMarginFullWidthMode = 2;
|
|
@@ -37,104 +34,6 @@ var AK_NESTED_DND_GUTTER_OFFSET = 8;
|
|
|
37
34
|
var getTotalPadding = function getTotalPadding() {
|
|
38
35
|
return akEditorGutterPaddingDynamic() * 2;
|
|
39
36
|
};
|
|
40
|
-
|
|
41
|
-
// old styles - to be deleted when cleaning up experiment `platform_editor_core_static_emotion_non_central`
|
|
42
|
-
var editorContentAreaStyle = function editorContentAreaStyle(_ref) {
|
|
43
|
-
var layoutMaxWidth = _ref.layoutMaxWidth,
|
|
44
|
-
fullWidthMode = _ref.fullWidthMode,
|
|
45
|
-
isEditorToolbarHidden = _ref.isEditorToolbarHidden;
|
|
46
|
-
return [editorContentArea, editorContentAreaProsemirrorStyle, fullWidthNonChromelessBreakoutBlockTableStyle, !fullWidthMode && editorContentAreaWithLayoutWith(layoutMaxWidth),
|
|
47
|
-
// for breakout resizing, there's no need to restrict the width of codeblocks as they're always wrapped in a breakout mark
|
|
48
|
-
expValEqualsNoExposure('platform_editor_breakout_resizing', 'isEnabled', true) && fg('platform_editor_breakout_resizing_width_changes') ? editorContentAreaContainerStyleExcludeCodeBlock() : editorContentAreaContainerStyle()].concat(_toConsumableArray(fg('platform_editor_controls_no_toolbar_space') ? [] : [editorExperiment('platform_editor_controls', 'variant1') &&
|
|
49
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
50
|
-
contentAreaReducedHeaderSpace, isEditorToolbarHidden && editorExperiment('platform_editor_controls', 'variant1') &&
|
|
51
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
52
|
-
contentAreaReservedPrimaryToolbarSpace]));
|
|
53
|
-
};
|
|
54
|
-
var editorContentAreaWithLayoutWith = function editorContentAreaWithLayoutWith(layoutMaxWidth) {
|
|
55
|
-
return css({
|
|
56
|
-
// this restricts max width
|
|
57
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
58
|
-
maxWidth: "".concat(layoutMaxWidth + getTotalPadding(), "px")
|
|
59
|
-
});
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
/* Prevent horizontal scroll on page in full width mode */
|
|
63
|
-
var editorContentAreaContainerStyleExcludeCodeBlock = function editorContentAreaContainerStyleExcludeCodeBlock() {
|
|
64
|
-
return css({
|
|
65
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
66
|
-
'.fabric-editor--full-width-mode': {
|
|
67
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
68
|
-
'.extension-container, .multiBodiedExtension--container': {
|
|
69
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
70
|
-
maxWidth: "calc(100% - ".concat(tableMarginFullWidthMode * 2, "px)")
|
|
71
|
-
},
|
|
72
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
73
|
-
'.extension-container.inline': {
|
|
74
|
-
maxWidth: '100%'
|
|
75
|
-
},
|
|
76
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
77
|
-
'td .extension-container.inline': {
|
|
78
|
-
maxWidth: 'inherit'
|
|
79
|
-
},
|
|
80
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
81
|
-
'[data-layout-section]': {
|
|
82
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
83
|
-
maxWidth: "calc(100% + ".concat((akLayoutGutterOffset + (fg('platform_editor_nested_dnd_styles_changes') ? AK_NESTED_DND_GUTTER_OFFSET : 0)) * 2, "px)")
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
/* Prevent horizontal scroll on page in full width mode */
|
|
90
|
-
var editorContentAreaContainerStyle = function editorContentAreaContainerStyle() {
|
|
91
|
-
return css({
|
|
92
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
93
|
-
'.fabric-editor--full-width-mode': {
|
|
94
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
95
|
-
'.code-block, .extension-container, .multiBodiedExtension--container': {
|
|
96
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
97
|
-
maxWidth: "calc(100% - ".concat(tableMarginFullWidthMode * 2, "px)")
|
|
98
|
-
},
|
|
99
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
100
|
-
'.extension-container.inline': {
|
|
101
|
-
maxWidth: '100%'
|
|
102
|
-
},
|
|
103
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
104
|
-
'td .extension-container.inline': {
|
|
105
|
-
maxWidth: 'inherit'
|
|
106
|
-
},
|
|
107
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
108
|
-
'[data-layout-section]': {
|
|
109
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
110
|
-
maxWidth: "calc(100% + ".concat((akLayoutGutterOffset + (fg('platform_editor_nested_dnd_styles_changes') ? AK_NESTED_DND_GUTTER_OFFSET : 0)) * 2, "px)")
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
};
|
|
115
|
-
var editorContentArea = css({
|
|
116
|
-
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
117
|
-
lineHeight: '24px',
|
|
118
|
-
paddingTop: "var(--ds-space-600, 48px)",
|
|
119
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
120
|
-
'.ak-editor-content-area-no-toolbar &': {
|
|
121
|
-
// When the toolbar is hidden, we don't want content to jump up
|
|
122
|
-
// the extra 1px is to account for the border on the toolbar
|
|
123
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
124
|
-
paddingTop: "calc(".concat("var(--ds-space-600, 48px)", " + ", FULL_PAGE_EDITOR_TOOLBAR_HEIGHT(), " + 1px)")
|
|
125
|
-
},
|
|
126
|
-
paddingBottom: "var(--ds-space-600, 48px)",
|
|
127
|
-
height: 'calc( 100% - 105px )',
|
|
128
|
-
width: '100%',
|
|
129
|
-
margin: 'auto',
|
|
130
|
-
flexDirection: 'column',
|
|
131
|
-
flexGrow: 1,
|
|
132
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
133
|
-
maxWidth: "".concat(akEditorFullWidthLayoutWidth + getTotalPadding(), "px"),
|
|
134
|
-
transition: "max-width ".concat(SWOOP_ANIMATION)
|
|
135
|
-
},
|
|
136
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
137
|
-
tableFullPageEditorStyles);
|
|
138
37
|
var editorContentAreaProsemirrorStyle = css({
|
|
139
38
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
140
39
|
'& .ProseMirror': _defineProperty(_defineProperty({
|
|
@@ -180,26 +79,6 @@ var contentAreaReservedPrimaryToolbarSpace = css({
|
|
|
180
79
|
var contentAreaReducedHeaderSpace = css({
|
|
181
80
|
paddingTop: "var(--ds-space-400, 32px)"
|
|
182
81
|
});
|
|
183
|
-
var editorContentGutterStyle = function editorContentGutterStyle() {
|
|
184
|
-
if (editorExperiment('platform_editor_preview_panel_responsiveness', true, {
|
|
185
|
-
exposure: true
|
|
186
|
-
})) {
|
|
187
|
-
return css(_defineProperty({
|
|
188
|
-
boxSizing: 'border-box',
|
|
189
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
190
|
-
padding: "0 ".concat(akEditorGutterPaddingDynamic(), "px")
|
|
191
|
-
}, "@container editor-area (max-width: ".concat(akEditorFullPageNarrowBreakout, "px)"), {
|
|
192
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
193
|
-
padding: "0 ".concat(akEditorGutterPaddingReduced, "px")
|
|
194
|
-
}));
|
|
195
|
-
} else {
|
|
196
|
-
return css({
|
|
197
|
-
boxSizing: 'border-box',
|
|
198
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
199
|
-
padding: "0 ".concat(akEditorGutterPaddingDynamic(), "px")
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
};
|
|
203
82
|
|
|
204
83
|
// new styles
|
|
205
84
|
var editorContentAreaNew = css({
|
|
@@ -356,11 +235,7 @@ var Content = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
356
235
|
return editorExperiment('platform_editor_controls', 'variant1');
|
|
357
236
|
};
|
|
358
237
|
return jsx("div", {
|
|
359
|
-
css:
|
|
360
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
361
|
-
contentArea,
|
|
362
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
363
|
-
props.isEditorToolbarHidden && contentAreaHeightNoToolbar],
|
|
238
|
+
css: [contentAreaNew, props.isEditorToolbarHidden && contentAreaHeightNoToolbar],
|
|
364
239
|
"data-testid": CONTENT_AREA_TEST_ID,
|
|
365
240
|
ref: containerRef
|
|
366
241
|
}, jsx("div", {
|
|
@@ -382,13 +257,9 @@ var Content = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
382
257
|
editorView: props.editorView,
|
|
383
258
|
editorDisabled: props.disabled
|
|
384
259
|
}, jsx("div", {
|
|
385
|
-
css:
|
|
260
|
+
css: [editorContentAreaNew, editorContentAreaProsemirrorStyle, tableFullPageEditorStylesNew, fullWidthNonChromelessBreakoutBlockTableStyle,
|
|
386
261
|
// for breakout resizing, there's no need to restrict the width of codeblocks as they're always wrapped in a breakout mark
|
|
387
|
-
expValEqualsNoExposure('platform_editor_breakout_resizing', 'isEnabled', true) && fg('platform_editor_breakout_resizing_width_changes') ? editorContentAreaContainerStyleExcludeCodeBlockNew : editorContentAreaContainerStyleNew, fg('platform_editor_nested_dnd_styles_changes') && editorContentAreaContainerNestedDndStyle, !fg('platform_editor_controls_no_toolbar_space') && editorExperiment('platform_editor_controls', 'variant1') && contentAreaReducedHeaderSpace, !fg('platform_editor_controls_no_toolbar_space') && props.isEditorToolbarHidden && editorExperiment('platform_editor_controls', 'variant1') && contentAreaReservedPrimaryToolbarSpace]
|
|
388
|
-
fullWidthMode: fullWidthMode,
|
|
389
|
-
layoutMaxWidth: theme.layoutMaxWidth,
|
|
390
|
-
isEditorToolbarHidden: props.isEditorToolbarHidden
|
|
391
|
-
})),
|
|
262
|
+
expValEqualsNoExposure('platform_editor_breakout_resizing', 'isEnabled', true) && fg('platform_editor_breakout_resizing_width_changes') ? editorContentAreaContainerStyleExcludeCodeBlockNew : editorContentAreaContainerStyleNew, fg('platform_editor_nested_dnd_styles_changes') && editorContentAreaContainerNestedDndStyle, !fg('platform_editor_controls_no_toolbar_space') && editorExperiment('platform_editor_controls', 'variant1') && contentAreaReducedHeaderSpace, !fg('platform_editor_controls_no_toolbar_space') && props.isEditorToolbarHidden && editorExperiment('platform_editor_controls', 'variant1') && contentAreaReservedPrimaryToolbarSpace],
|
|
392
263
|
style: {
|
|
393
264
|
'--ak-editor-content-area-max-width': !fullWidthMode ? "".concat(theme.layoutMaxWidth + getTotalPadding(), "px") : "".concat(akEditorFullWidthLayoutWidth + getTotalPadding(), "px")
|
|
394
265
|
}
|
|
@@ -401,13 +272,11 @@ var Content = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
401
272
|
"aria-label": props.intl.formatMessage(messages.editableContentLabel),
|
|
402
273
|
ref: contentAreaRef
|
|
403
274
|
}, jsx("div", {
|
|
404
|
-
css:
|
|
275
|
+
css: [editorContentGutterStyles,
|
|
405
276
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
406
277
|
fg('platform_editor_controls_increase_full_page_gutter') && editorExperiment('platform_editor_controls', 'variant1') && editorContentGutterStyleFG, editorExperiment('platform_editor_preview_panel_responsiveness', true, {
|
|
407
278
|
exposure: true
|
|
408
|
-
}) && editorContentReducedGutterStyles]
|
|
409
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
410
|
-
editorContentGutterStyle()]
|
|
279
|
+
}) && editorContentReducedGutterStyles]
|
|
411
280
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
412
281
|
,
|
|
413
282
|
className: classnames('ak-editor-content-area', 'appearance-full-page', {
|