@atlaskit/editor-core 207.6.0 → 207.7.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 +22 -0
- package/dist/cjs/ui/Appearance/FullPage/FullPage.js +13 -1
- package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea.js +7 -1
- package/dist/cjs/ui/ContentStyles/media.js +1 -1
- package/dist/cjs/ui/EditorContentContainer/EditorContentContainer.js +17 -18
- package/dist/cjs/ui/EditorContentContainer/styles/codeBlockStyles.js +216 -0
- package/dist/cjs/ui/EditorContentContainer/styles/firstBlockNodeStyles.js +39 -0
- package/dist/cjs/ui/EditorContentContainer/styles/overflowShadowStyles.js +13 -0
- package/dist/cjs/ui/EditorContentContainer/styles/selectionStyles.js +78 -0
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/ui/Appearance/FullPage/FullPage.js +13 -1
- package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea.js +7 -1
- package/dist/es2019/ui/ContentStyles/media.js +1 -0
- package/dist/es2019/ui/EditorContentContainer/EditorContentContainer.js +13 -57
- package/dist/es2019/ui/EditorContentContainer/styles/codeBlockStyles.js +266 -0
- package/dist/es2019/ui/EditorContentContainer/styles/firstBlockNodeStyles.js +41 -0
- package/dist/es2019/ui/EditorContentContainer/styles/overflowShadowStyles.js +47 -0
- package/dist/es2019/ui/EditorContentContainer/styles/selectionStyles.js +71 -0
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/ui/Appearance/FullPage/FullPage.js +13 -1
- package/dist/esm/ui/Appearance/FullPage/FullPageContentArea.js +7 -1
- package/dist/esm/ui/ContentStyles/media.js +1 -1
- package/dist/esm/ui/EditorContentContainer/EditorContentContainer.js +16 -17
- package/dist/esm/ui/EditorContentContainer/styles/codeBlockStyles.js +208 -0
- package/dist/esm/ui/EditorContentContainer/styles/firstBlockNodeStyles.js +32 -0
- package/dist/esm/ui/EditorContentContainer/styles/overflowShadowStyles.js +6 -0
- package/dist/esm/ui/EditorContentContainer/styles/selectionStyles.js +71 -0
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/create-editor/create-universal-preset.d.ts +3 -12
- package/dist/types/presets/universal.d.ts +3 -12
- package/dist/types/presets/useUniversalPreset.d.ts +3 -12
- package/dist/types/ui/Appearance/FullPage/FullPageContentArea.d.ts +1 -1
- package/dist/types/ui/EditorContentContainer/EditorContentContainer.d.ts +0 -1
- package/dist/types/ui/EditorContentContainer/styles/codeBlockStyles.d.ts +14 -0
- package/dist/types/ui/EditorContentContainer/styles/firstBlockNodeStyles.d.ts +2 -0
- package/dist/types/ui/EditorContentContainer/styles/overflowShadowStyles.d.ts +1 -0
- package/dist/types/ui/EditorContentContainer/styles/selectionStyles.d.ts +5 -0
- package/dist/types-ts4.5/create-editor/create-universal-preset.d.ts +3 -12
- package/dist/types-ts4.5/presets/universal.d.ts +3 -12
- package/dist/types-ts4.5/presets/useUniversalPreset.d.ts +3 -12
- package/dist/types-ts4.5/ui/Appearance/FullPage/FullPageContentArea.d.ts +1 -1
- package/dist/types-ts4.5/ui/EditorContentContainer/EditorContentContainer.d.ts +0 -1
- package/dist/types-ts4.5/ui/EditorContentContainer/styles/codeBlockStyles.d.ts +14 -0
- package/dist/types-ts4.5/ui/EditorContentContainer/styles/firstBlockNodeStyles.d.ts +2 -0
- package/dist/types-ts4.5/ui/EditorContentContainer/styles/overflowShadowStyles.d.ts +1 -0
- package/dist/types-ts4.5/ui/EditorContentContainer/styles/selectionStyles.d.ts +5 -0
- package/package.json +5 -5
|
@@ -83,7 +83,19 @@ export const FullPageEditor = props => {
|
|
|
83
83
|
interactionState
|
|
84
84
|
} = useFullPageEditorPluginsStates(editorAPI);
|
|
85
85
|
const viewMode = getEditorViewMode(editorViewModeState, props.preset);
|
|
86
|
-
|
|
86
|
+
|
|
87
|
+
// Remove all this logic when platform_editor_interaction_api_refactor is cleaned up
|
|
88
|
+
let hasHadInteraction;
|
|
89
|
+
if (fg('platform_editor_interaction_api_refactor')) {
|
|
90
|
+
// Warning: this logic is a cluster-f but `hasHadInteraction` depends on undefined being allowed
|
|
91
|
+
// in which case no class will be rendered at all. In this way we only set `hasHadInteraction to
|
|
92
|
+
// boolean when interactionState is not undefined.
|
|
93
|
+
if (interactionState) {
|
|
94
|
+
hasHadInteraction = interactionState.interactionState !== 'hasNotHadInteraction';
|
|
95
|
+
}
|
|
96
|
+
} else {
|
|
97
|
+
hasHadInteraction = interactionState === null || interactionState === void 0 ? void 0 : interactionState.hasHadInteraction;
|
|
98
|
+
}
|
|
87
99
|
let toolbarDocking = useSharedPluginStateSelector(editorAPI, 'selectionToolbar.toolbarDocking');
|
|
88
100
|
if (!toolbarDocking && fg('platform_editor_controls_toolbar_ssr_fix')) {
|
|
89
101
|
var _editorAPI$selectionT, _editorAPI$selectionT2, _editorAPI$selectionT3;
|
|
@@ -61,8 +61,14 @@ const Content = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
61
61
|
return containerRef.current;
|
|
62
62
|
}
|
|
63
63
|
}), []);
|
|
64
|
+
|
|
65
|
+
// Remove entire `hasHadInteraction` logic and prop when 'platform_editor_interaction_api_refactor' is cleaned up
|
|
64
66
|
let interactionClassName;
|
|
65
|
-
if (
|
|
67
|
+
if (fg('platform_editor_interaction_api_refactor')) {
|
|
68
|
+
// no-op and do not add any classes
|
|
69
|
+
} else if (
|
|
70
|
+
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
71
|
+
props.hasHadInteraction !== undefined && fg('platform_editor_no_cursor_on_live_doc_init')) {
|
|
66
72
|
interactionClassName = props.hasHadInteraction ? 'ak-editor-has-interaction' : 'ak-editor-no-interaction';
|
|
67
73
|
}
|
|
68
74
|
const shouldSetHiddenDataAttribute = () => {
|
|
@@ -9,13 +9,11 @@ import React from 'react';
|
|
|
9
9
|
|
|
10
10
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
11
11
|
import { css, jsx, useTheme } from '@emotion/react';
|
|
12
|
-
import { browser } from '@atlaskit/editor-common/browser';
|
|
13
12
|
import { telepointerStyle, telepointerStyleWithInitialOnly } from '@atlaskit/editor-common/collab';
|
|
14
13
|
import { EmojiSharedCssClassName, defaultEmojiHeight } from '@atlaskit/editor-common/emoji';
|
|
15
14
|
import { MentionSharedCssClassName } from '@atlaskit/editor-common/mention';
|
|
16
|
-
import { PanelSharedCssClassName } from '@atlaskit/editor-common/panel';
|
|
17
15
|
import { gapCursorStyles } from '@atlaskit/editor-common/selection';
|
|
18
|
-
import {
|
|
16
|
+
import { GRID_GUTTER, blockMarksSharedStyles, dateSharedStyle, getSmartCardSharedStyles, gridStyles, indentationSharedStyles, listsSharedStyles, paragraphSharedStyles, shadowSharedStyle, smartCardSharedStyles, smartCardStyles, tasksAndDecisionsStyles, textColorStyles, unsupportedStyles, whitespaceSharedStyles } from '@atlaskit/editor-common/styles';
|
|
19
17
|
import { blocktypeStyles } from '@atlaskit/editor-plugins/block-type/styles';
|
|
20
18
|
import { findReplaceStyles } from '@atlaskit/editor-plugins/find-replace/styles';
|
|
21
19
|
import { textHighlightStyle } from '@atlaskit/editor-plugins/paste-options-toolbar/styles';
|
|
@@ -27,7 +25,6 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
27
25
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
28
26
|
import { useThemeObserver } from '@atlaskit/tokens';
|
|
29
27
|
import { InlineNodeViewSharedStyles } from '../../nodeviews/getInlineNodeViewProducer.styles';
|
|
30
|
-
import { codeBlockStyles } from '../ContentStyles/code-block';
|
|
31
28
|
import { dateStyles, dateVanillaStyles } from '../ContentStyles/date';
|
|
32
29
|
import { expandStyles } from '../ContentStyles/expand';
|
|
33
30
|
import { extensionStyles } from '../ContentStyles/extension';
|
|
@@ -37,8 +34,10 @@ import { taskDecisionStyles, vanillaTaskDecisionIconWithoutVisualRefresh as vani
|
|
|
37
34
|
import { aiPanelBaseStyles, aiPanelDarkStyles } from './styles/ai-panel';
|
|
38
35
|
import { annotationStyles } from './styles/annotationStyles';
|
|
39
36
|
import { backgroundColorStyles } from './styles/backgroundColorStyles';
|
|
37
|
+
import { codeBlockStyles, firstCodeBlockWithNoMargin, firstCodeBlockWithNoMarginOld } from './styles/codeBlockStyles';
|
|
40
38
|
import { codeMarkStyles } from './styles/codeMarkStyles';
|
|
41
39
|
import { embedCardStyles } from './styles/embedCardStyles';
|
|
40
|
+
import { firstBlockNodeStyles, firstBlockNodeStylesOld } from './styles/firstBlockNodeStyles';
|
|
42
41
|
import { layoutBaseStyles, layoutViewStyles } from './styles/layout';
|
|
43
42
|
import { linkStyles, linkStylesOld } from './styles/link';
|
|
44
43
|
import { mediaStyles } from './styles/mediaStyles';
|
|
@@ -146,12 +145,6 @@ const listsStyles = css`
|
|
|
146
145
|
margin-top: ${blockNodesVerticalMargin};
|
|
147
146
|
}
|
|
148
147
|
}
|
|
149
|
-
|
|
150
|
-
&:not([data-node-type='decisionList']) > li,
|
|
151
|
-
// This prevents https://product-fabric.atlassian.net/browse/ED-20924
|
|
152
|
-
&:not(.${SmartCardSharedCssClassName.BLOCK_CARD_CONTAINER}) > li {
|
|
153
|
-
${browser.safari ? codeBlockInListSafariFix : ''}
|
|
154
|
-
}
|
|
155
148
|
}
|
|
156
149
|
`;
|
|
157
150
|
const reactEmojiStyles = css`
|
|
@@ -233,49 +226,6 @@ const placeholderWrapStyles = css({
|
|
|
233
226
|
whiteSpace: 'nowrap'
|
|
234
227
|
}
|
|
235
228
|
});
|
|
236
|
-
const firstBlockNodeStyles = css`
|
|
237
|
-
.ProseMirror {
|
|
238
|
-
> .${PanelSharedCssClassName.prefix},
|
|
239
|
-
> .${CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER},
|
|
240
|
-
> .${SmartCardSharedCssClassName.BLOCK_CARD_CONTAINER},
|
|
241
|
-
> div[data-task-list-local-id],
|
|
242
|
-
> div[data-layout-section],
|
|
243
|
-
> .${expandClassNames.prefix} {
|
|
244
|
-
&:first-child {
|
|
245
|
-
margin-top: 0;
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
> hr:first-of-type {
|
|
250
|
-
margin-top: 0;
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
`;
|
|
254
|
-
const firstBlockNodeStylesNew = css`
|
|
255
|
-
.ProseMirror {
|
|
256
|
-
> .${PanelSharedCssClassName.prefix},
|
|
257
|
-
> .${CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER},
|
|
258
|
-
> .${SmartCardSharedCssClassName.BLOCK_CARD_CONTAINER},
|
|
259
|
-
> div[data-task-list-local-id],
|
|
260
|
-
> div[data-layout-section],
|
|
261
|
-
> .${expandClassNames.prefix} {
|
|
262
|
-
&:first-child {
|
|
263
|
-
margin-top: 0;
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
> hr:first-child,
|
|
268
|
-
> .ProseMirror-widget:first-child + hr {
|
|
269
|
-
margin-top: 0;
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
`;
|
|
273
|
-
export const fixBlockControlStylesSSR = () => {
|
|
274
|
-
if (fg('platform_editor_element_dnd_nested_fix_patch_6')) {
|
|
275
|
-
return firstBlockNodeStylesNew;
|
|
276
|
-
}
|
|
277
|
-
return firstBlockNodeStyles;
|
|
278
|
-
};
|
|
279
229
|
|
|
280
230
|
// The breakpoint for small devices is 1266px, copied from getBreakpoint in platform/packages/editor/editor-common/src/ui/WidthProvider/index.tsx
|
|
281
231
|
const akEditorBreakpointForSmallDevice = `1266px`;
|
|
@@ -395,7 +345,7 @@ const contentStyles = () => css`
|
|
|
395
345
|
|
|
396
346
|
${editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_quick_insert_placeholder') ? placeholderWrapStyles : null}
|
|
397
347
|
|
|
398
|
-
${codeBlockStyles
|
|
348
|
+
${codeBlockStyles}
|
|
399
349
|
|
|
400
350
|
${blocktypeStyles()}
|
|
401
351
|
|
|
@@ -487,8 +437,6 @@ const contentStyles = () => css`
|
|
|
487
437
|
|
|
488
438
|
${resizerStyles}
|
|
489
439
|
|
|
490
|
-
${fixBlockControlStylesSSR()}
|
|
491
|
-
|
|
492
440
|
.panelView-content-wrap {
|
|
493
441
|
box-sizing: border-box;
|
|
494
442
|
}
|
|
@@ -636,7 +584,15 @@ const EditorContentContainer = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
636
584
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
637
585
|
colorMode === 'dark' && aiPanelDarkStyles,
|
|
638
586
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
639
|
-
viewMode === 'view' && layoutViewStyles, isComment && commentEditorStyles, isFullPage && fullPageEditorStyles, fg('platform_editor_ssr_fix_lists') && listLayoutShiftFix
|
|
587
|
+
viewMode === 'view' && layoutViewStyles, isComment && commentEditorStyles, isFullPage && fullPageEditorStyles, fg('platform_editor_ssr_fix_lists') && listLayoutShiftFix, fg('platform_editor_nested_dnd_styles_changes') ?
|
|
588
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
589
|
+
firstCodeBlockWithNoMargin :
|
|
590
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
591
|
+
firstCodeBlockWithNoMarginOld, fg('platform_editor_element_dnd_nested_fix_patch_6') ?
|
|
592
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
593
|
+
firstBlockNodeStyles :
|
|
594
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
595
|
+
firstBlockNodeStylesOld],
|
|
640
596
|
"data-editor-scroll-container": isScrollable ? 'true' : undefined,
|
|
641
597
|
"data-testid": "editor-content-container",
|
|
642
598
|
style: {
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
import { css } from '@emotion/react'; // eslint-disable-line @atlaskit/ui-styling-standard/use-compiled
|
|
2
|
+
|
|
3
|
+
import { overflowShadowStyles } from './overflowShadowStyles';
|
|
4
|
+
import { blanketSelectionStyles, boxShadowSelectionStyles, hideNativeBrowserTextSelectionStyles } from './selectionStyles';
|
|
5
|
+
export const CodeBlockSharedCssClassName = {
|
|
6
|
+
CODEBLOCK_CONTAINER: 'code-block',
|
|
7
|
+
CODEBLOCK_START: 'code-block--start',
|
|
8
|
+
CODEBLOCK_END: 'code-block--end',
|
|
9
|
+
CODEBLOCK_CONTENT_WRAPPER: 'code-block-content-wrapper',
|
|
10
|
+
CODEBLOCK_LINE_NUMBER_GUTTER: 'line-number-gutter',
|
|
11
|
+
CODEBLOCK_CONTENT: 'code-content',
|
|
12
|
+
DS_CODEBLOCK: '[data-ds--code--code-block]',
|
|
13
|
+
CODEBLOCK_CONTENT_WRAPPED: 'code-content--wrapped',
|
|
14
|
+
CODEBLOCK_CONTAINER_LINE_NUMBER_WIDGET: 'code-content__line-number--wrapped'
|
|
15
|
+
};
|
|
16
|
+
const fontSize14px = `${14 / 16}rem`;
|
|
17
|
+
const blockNodesVerticalMargin = '0.75rem';
|
|
18
|
+
const gutterDangerOverlay = css({
|
|
19
|
+
'&::after': {
|
|
20
|
+
height: '100%',
|
|
21
|
+
content: "''",
|
|
22
|
+
position: 'absolute',
|
|
23
|
+
left: 0,
|
|
24
|
+
top: 0,
|
|
25
|
+
width: '24px',
|
|
26
|
+
backgroundColor: "var(--ds-blanket-danger, #EF5C4814)"
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
31
|
+
export const codeBlockStyles = css({
|
|
32
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
33
|
+
'.ProseMirror': {
|
|
34
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
35
|
+
[`.${CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPED} > .${CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER} > .${CodeBlockSharedCssClassName.CODEBLOCK_CONTENT}`]: {
|
|
36
|
+
marginRight: "var(--ds-space-100, 8px)",
|
|
37
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
38
|
+
code: {
|
|
39
|
+
display: 'block',
|
|
40
|
+
wordBreak: 'break-word',
|
|
41
|
+
whiteSpace: 'pre-wrap'
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
45
|
+
[`.${CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER} > .${CodeBlockSharedCssClassName.CODEBLOCK_CONTENT}`]: {
|
|
46
|
+
display: 'flex',
|
|
47
|
+
flex: 1,
|
|
48
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
49
|
+
code: {
|
|
50
|
+
flexGrow: 1,
|
|
51
|
+
whiteSpace: 'pre'
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
55
|
+
[`.${CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER}`]: {
|
|
56
|
+
'--ds--code--bg-color': 'transparent',
|
|
57
|
+
position: 'relative',
|
|
58
|
+
backgroundColor: "var(--ds-surface-raised, #FFFFFF)",
|
|
59
|
+
borderRadius: "var(--ds-border-radius, 3px)",
|
|
60
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
61
|
+
margin: `${blockNodesVerticalMargin} 0 0 0`,
|
|
62
|
+
fontFamily: "var(--ds-font-family-code, ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)",
|
|
63
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
64
|
+
minWidth: 48,
|
|
65
|
+
cursor: 'pointer',
|
|
66
|
+
clear: 'both',
|
|
67
|
+
// This is necessary to allow for arrow key navigation in/out of code blocks in Firefox.
|
|
68
|
+
whiteSpace: 'normal',
|
|
69
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
70
|
+
'.code-block-gutter-pseudo-element::before': {
|
|
71
|
+
content: 'attr(data-label)'
|
|
72
|
+
},
|
|
73
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
74
|
+
[`.${CodeBlockSharedCssClassName.CODEBLOCK_START}`]: {
|
|
75
|
+
position: 'absolute',
|
|
76
|
+
visibility: 'hidden',
|
|
77
|
+
height: '1.5rem',
|
|
78
|
+
top: 0,
|
|
79
|
+
left: 0
|
|
80
|
+
},
|
|
81
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
82
|
+
[`.${CodeBlockSharedCssClassName.CODEBLOCK_END}`]: {
|
|
83
|
+
position: 'absolute',
|
|
84
|
+
visibility: 'hidden',
|
|
85
|
+
height: '1.5rem',
|
|
86
|
+
bottom: 0,
|
|
87
|
+
right: 0
|
|
88
|
+
},
|
|
89
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
90
|
+
[`.${CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER}`]: [
|
|
91
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
92
|
+
overflowShadowStyles, {
|
|
93
|
+
position: 'relative',
|
|
94
|
+
backgroundColor: "var(--ds-background-neutral, #091E420F)",
|
|
95
|
+
display: 'flex',
|
|
96
|
+
borderRadius: "var(--ds-border-radius, 3px)",
|
|
97
|
+
width: '100%',
|
|
98
|
+
counterReset: 'line',
|
|
99
|
+
overflowX: 'auto',
|
|
100
|
+
backgroundRepeat: 'no-repeat',
|
|
101
|
+
backgroundAttachment: 'local, local, local, local, scroll, scroll, scroll, scroll',
|
|
102
|
+
backgroundSize: `${"var(--ds-space-300, 24px)"} 100%,
|
|
103
|
+
${"var(--ds-space-300, 24px)"} 100%,
|
|
104
|
+
${"var(--ds-space-100, 8px)"} 100%,
|
|
105
|
+
${"var(--ds-space-100, 8px)"} 100%,
|
|
106
|
+
${"var(--ds-space-100, 8px)"} 100%,
|
|
107
|
+
1px 100%,
|
|
108
|
+
${"var(--ds-space-100, 8px)"} 100%,
|
|
109
|
+
1px 100%`,
|
|
110
|
+
backgroundPosition: `0 0,
|
|
111
|
+
0 0,
|
|
112
|
+
100% 0,
|
|
113
|
+
100% 0,
|
|
114
|
+
100% 0,
|
|
115
|
+
100% 0,
|
|
116
|
+
0 0,
|
|
117
|
+
0 0`,
|
|
118
|
+
// Be careful if refactoring this; it is needed to keep arrow key navigation in Firefox consistent with other browsers.
|
|
119
|
+
overflowY: 'hidden'
|
|
120
|
+
}],
|
|
121
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
122
|
+
[`.${CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER}`]: {
|
|
123
|
+
backgroundColor: "var(--ds-background-neutral, #091E420F)",
|
|
124
|
+
position: 'relative',
|
|
125
|
+
width: 'var(--lineNumberGutterWidth, 2rem)',
|
|
126
|
+
padding: "var(--ds-space-100, 8px)",
|
|
127
|
+
flexShrink: 0,
|
|
128
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
129
|
+
fontSize: fontSize14px,
|
|
130
|
+
boxSizing: 'content-box'
|
|
131
|
+
},
|
|
132
|
+
// This is a fix of marker of list item with code block.
|
|
133
|
+
// The list item marker in Chrome is aligned by the baseline of the text,
|
|
134
|
+
// that's why we need to add a text (content: "1") to the line number gutter to align
|
|
135
|
+
// the list item marker with the text.
|
|
136
|
+
// Without it, the list item marker will be aligned by the bottom of the code block. */
|
|
137
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
138
|
+
[`.${CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER}::before`]: {
|
|
139
|
+
content: "'1'",
|
|
140
|
+
visibility: 'hidden',
|
|
141
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
142
|
+
fontSize: fontSize14px,
|
|
143
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
144
|
+
lineHeight: '1.5rem'
|
|
145
|
+
},
|
|
146
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
147
|
+
[`.${CodeBlockSharedCssClassName.CODEBLOCK_CONTENT}`]: {
|
|
148
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
149
|
+
code: {
|
|
150
|
+
tabSize: 4,
|
|
151
|
+
cursor: 'text',
|
|
152
|
+
color: "var(--ds-text, #172B4D)",
|
|
153
|
+
borderRadius: "var(--ds-border-radius, 3px)",
|
|
154
|
+
margin: "var(--ds-space-100, 8px)",
|
|
155
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
156
|
+
fontSize: fontSize14px,
|
|
157
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
158
|
+
lineHeight: '1.5rem'
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
162
|
+
[`.${CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER_LINE_NUMBER_WIDGET}`]: {
|
|
163
|
+
pointerEvents: 'none',
|
|
164
|
+
userSelect: 'none',
|
|
165
|
+
width: 'var(--lineNumberGutterWidth, 2rem)',
|
|
166
|
+
left: 0,
|
|
167
|
+
position: 'absolute',
|
|
168
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
169
|
+
fontSize: fontSize14px,
|
|
170
|
+
padding: `0px ${"var(--ds-space-100, 8px)"}`,
|
|
171
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
172
|
+
lineHeight: '1.5rem',
|
|
173
|
+
textAlign: 'right',
|
|
174
|
+
color: "var(--ds-text-subtlest, #505F79)",
|
|
175
|
+
boxSizing: 'content-box'
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
179
|
+
li: {
|
|
180
|
+
// if same list item has multiple code blocks we need top margin for all but first
|
|
181
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
182
|
+
'> .code-block': {
|
|
183
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
184
|
+
margin: `${blockNodesVerticalMargin} 0 0 0`
|
|
185
|
+
},
|
|
186
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
187
|
+
'> .code-block:first-child, > .ProseMirror-gapcursor:first-child + .code-block': {
|
|
188
|
+
marginTop: 0
|
|
189
|
+
},
|
|
190
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
191
|
+
'> div:last-of-type.code-block, > pre:last-of-type.code-block': {
|
|
192
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
193
|
+
marginBottom: blockNodesVerticalMargin
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values,@atlaskit/ui-styling-standard/no-imported-style-values
|
|
197
|
+
[`.code-block.ak-editor-selected-node:not(.danger)`]: [
|
|
198
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
199
|
+
boxShadowSelectionStyles,
|
|
200
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
201
|
+
blanketSelectionStyles,
|
|
202
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
203
|
+
hideNativeBrowserTextSelectionStyles],
|
|
204
|
+
// Danger when top level node
|
|
205
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
206
|
+
'.danger.code-block': {
|
|
207
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
208
|
+
boxShadow: `0 0 0 1px ${"var(--ds-border-danger, #E2483D)"}`,
|
|
209
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
210
|
+
[`.${CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER}`]: [{
|
|
211
|
+
backgroundColor: "var(--ds-background-danger, #FFECEB)",
|
|
212
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
213
|
+
color: "var(--ds-text-danger, #AE2E24)"
|
|
214
|
+
}, gutterDangerOverlay],
|
|
215
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
216
|
+
[`.${CodeBlockSharedCssClassName.CODEBLOCK_CONTENT}`]: {
|
|
217
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
218
|
+
backgroundColor: "var(--ds-blanket-danger, #EF5C4814)"
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
// Danger when nested node
|
|
222
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
223
|
+
'.danger .code-block': {
|
|
224
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
225
|
+
[`.${CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER}`]: [{
|
|
226
|
+
backgroundColor: "var(--ds-background-danger, #FFECEB)",
|
|
227
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
228
|
+
color: "var(--ds-text-danger, #AE2E24)"
|
|
229
|
+
}, gutterDangerOverlay],
|
|
230
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
231
|
+
[`.${CodeBlockSharedCssClassName.CODEBLOCK_CONTENT}`]: {
|
|
232
|
+
backgroundColor: "var(--ds-blanket-danger, #EF5C4814)"
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
239
|
+
export const firstCodeBlockWithNoMargin = css({
|
|
240
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
241
|
+
'.ProseMirror': {
|
|
242
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
243
|
+
'.ak-editor-panel__content': {
|
|
244
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
245
|
+
'> .code-block:first-child, > .ProseMirror-widget:first-child + .code-block, > .ProseMirror-widget:first-child + .ProseMirror-widget + .code-block': {
|
|
246
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space,@atlaskit/ui-styling-standard/no-important-styles
|
|
247
|
+
margin: '0!important'
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
254
|
+
export const firstCodeBlockWithNoMarginOld = css({
|
|
255
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
256
|
+
'.ProseMirror': {
|
|
257
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
258
|
+
'.ak-editor-panel__content': {
|
|
259
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
260
|
+
'> .code-block:first-child': {
|
|
261
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space,@atlaskit/ui-styling-standard/no-important-styles
|
|
262
|
+
margin: '0!important'
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { css } from '@emotion/react'; // eslint-disable-line @atlaskit/ui-styling-standard/use-compiled
|
|
2
|
+
|
|
3
|
+
import { PanelSharedCssClassName } from '@atlaskit/editor-common/panel';
|
|
4
|
+
import { expandClassNames, SmartCardSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
5
|
+
import { CodeBlockSharedCssClassName } from './codeBlockStyles';
|
|
6
|
+
|
|
7
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
8
|
+
export const firstBlockNodeStylesOld = css({
|
|
9
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
10
|
+
'.ProseMirror': {
|
|
11
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values,@atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
12
|
+
[`> .${PanelSharedCssClassName.prefix}, > .${CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER}, > .${SmartCardSharedCssClassName.BLOCK_CARD_CONTAINER}, > div[data-task-list-local-id], > div[data-layout-section], > .${expandClassNames.prefix}`]: {
|
|
13
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
14
|
+
'&:first-child': {
|
|
15
|
+
marginTop: 0
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
19
|
+
'> hr:first-of-type': {
|
|
20
|
+
marginTop: 0
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
26
|
+
export const firstBlockNodeStyles = css({
|
|
27
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
28
|
+
'.ProseMirror': {
|
|
29
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values,@atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
30
|
+
[`> .${PanelSharedCssClassName.prefix}, > .${CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER}, > .${SmartCardSharedCssClassName.BLOCK_CARD_CONTAINER}, > div[data-task-list-local-id], > div[data-layout-section], > .${expandClassNames.prefix}`]: {
|
|
31
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
32
|
+
'&:first-child': {
|
|
33
|
+
marginTop: 0
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
37
|
+
'> hr:first-child, > .ProseMirror-widget:first-child + hr': {
|
|
38
|
+
marginTop: 0
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
});
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { css } from '@emotion/react'; // eslint-disable-line @atlaskit/ui-styling-standard/use-compiled
|
|
2
|
+
|
|
3
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
4
|
+
export const overflowShadowStyles = css({
|
|
5
|
+
backgroundImage: `
|
|
6
|
+
linear-gradient(
|
|
7
|
+
to right,
|
|
8
|
+
${"var(--ds-background-neutral, #091E420F)"} ${"var(--ds-space-300, 24px)"},
|
|
9
|
+
transparent ${"var(--ds-space-300, 24px)"}
|
|
10
|
+
),
|
|
11
|
+
linear-gradient(
|
|
12
|
+
to right,
|
|
13
|
+
${"var(--ds-surface-raised, #FFFFFF)"} ${"var(--ds-space-300, 24px)"},
|
|
14
|
+
transparent ${"var(--ds-space-300, 24px)"}
|
|
15
|
+
),
|
|
16
|
+
linear-gradient(
|
|
17
|
+
to left,
|
|
18
|
+
${"var(--ds-background-neutral, #091E420F)"} ${"var(--ds-space-100, 8px)"},
|
|
19
|
+
transparent ${"var(--ds-space-100, 8px)"}
|
|
20
|
+
),
|
|
21
|
+
linear-gradient(
|
|
22
|
+
to left,
|
|
23
|
+
${"var(--ds-surface-raised, #FFFFFF)"} ${"var(--ds-space-100, 8px)"},
|
|
24
|
+
transparent ${"var(--ds-space-100, 8px)"}
|
|
25
|
+
),
|
|
26
|
+
linear-gradient(
|
|
27
|
+
to left,
|
|
28
|
+
${"var(--ds-shadow-overflow-spread, #091e4229)"} 0,
|
|
29
|
+
${"var(--ds-UNSAFE-transparent, transparent)"} ${"var(--ds-space-100, 8px)"}
|
|
30
|
+
),
|
|
31
|
+
linear-gradient(
|
|
32
|
+
to left,
|
|
33
|
+
${"var(--ds-shadow-overflow-perimeter, #091e421f)"} 0,
|
|
34
|
+
${"var(--ds-UNSAFE-transparent, transparent)"} ${"var(--ds-space-100, 8px)"}
|
|
35
|
+
),
|
|
36
|
+
linear-gradient(
|
|
37
|
+
to right,
|
|
38
|
+
${"var(--ds-shadow-overflow-spread, #091e4229)"} 0,
|
|
39
|
+
${"var(--ds-UNSAFE-transparent, transparent)"} ${"var(--ds-space-100, 8px)"}
|
|
40
|
+
),
|
|
41
|
+
linear-gradient(
|
|
42
|
+
to right,
|
|
43
|
+
${"var(--ds-shadow-overflow-perimeter, #091e421f)"} 0,
|
|
44
|
+
${"var(--ds-UNSAFE-transparent, transparent)"} ${"var(--ds-space-100, 8px)"}
|
|
45
|
+
)
|
|
46
|
+
`
|
|
47
|
+
});
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { css } from '@emotion/react'; // eslint-disable-line @atlaskit/ui-styling-standard/use-compiled
|
|
2
|
+
|
|
3
|
+
// TODO: ED-28075 - refactor selection styles to unblock Compiled CSS migration
|
|
4
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
5
|
+
export const hideNativeBrowserTextSelectionStyles = css({
|
|
6
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
7
|
+
'&::selection,*::selection': {
|
|
8
|
+
backgroundColor: 'transparent'
|
|
9
|
+
},
|
|
10
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
11
|
+
'&::-moz-selection,*::-moz-selection': {
|
|
12
|
+
backgroundColor: 'transparent'
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
// TODO: ED-28075 - refactor selection styles to unblock Compiled CSS migration
|
|
17
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
18
|
+
export const borderSelectionStyles = css({
|
|
19
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
20
|
+
border: `1px solid ${"var(--ds-border-selected, #0C66E4)"}`,
|
|
21
|
+
// Fixes ED-15246: Trello card is visible through a border of a table border
|
|
22
|
+
'&::after': {
|
|
23
|
+
height: '100%',
|
|
24
|
+
content: '"\\00a0"',
|
|
25
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
26
|
+
background: "var(--ds-border-selected, #0C66E4)",
|
|
27
|
+
position: 'absolute',
|
|
28
|
+
right: -1,
|
|
29
|
+
top: 0,
|
|
30
|
+
bottom: 0,
|
|
31
|
+
width: 1,
|
|
32
|
+
border: 'none',
|
|
33
|
+
display: 'inline-block'
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
// TODO: ED-28075 - refactor selection styles to unblock Compiled CSS migration
|
|
38
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
39
|
+
export const boxShadowSelectionStyles = css({
|
|
40
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
41
|
+
boxShadow: `0 0 0 1px ${"var(--ds-border-selected, #0C66E4)"}`,
|
|
42
|
+
borderColor: 'transparent'
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
// TODO: ED-28075 - refactor selection styles to unblock Compiled CSS migration
|
|
46
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
47
|
+
export const backgroundSelectionStyles = css({
|
|
48
|
+
backgroundColor: "var(--ds-background-selected, #E9F2FF)"
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
// TODO: ED-28075 - refactor selection styles to unblock Compiled CSS migration
|
|
52
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
53
|
+
export const blanketSelectionStyles = css({
|
|
54
|
+
position: 'relative',
|
|
55
|
+
// Fixes ED-9263, where emoji or inline card in panel makes selection go outside the panel
|
|
56
|
+
// in Safari. Looks like it's caused by user-select: all in the emoji element
|
|
57
|
+
'-webkit-user-select': 'text',
|
|
58
|
+
'&::before': {
|
|
59
|
+
position: 'absolute',
|
|
60
|
+
content: "''",
|
|
61
|
+
left: 0,
|
|
62
|
+
right: 0,
|
|
63
|
+
top: 0,
|
|
64
|
+
bottom: 0,
|
|
65
|
+
width: '100%',
|
|
66
|
+
pointerEvents: 'none',
|
|
67
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values,@atlaskit/ui-styling-standard/no-unsafe-values
|
|
68
|
+
zIndex: 12,
|
|
69
|
+
backgroundColor: "var(--ds-blanket-selected, #388BFF14)"
|
|
70
|
+
}
|
|
71
|
+
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "207.
|
|
2
|
+
export const version = "207.7.0";
|
|
@@ -90,7 +90,19 @@ export var FullPageEditor = function FullPageEditor(props) {
|
|
|
90
90
|
primaryToolbarState = _useFullPageEditorPlu.primaryToolbarState,
|
|
91
91
|
interactionState = _useFullPageEditorPlu.interactionState;
|
|
92
92
|
var viewMode = getEditorViewMode(editorViewModeState, props.preset);
|
|
93
|
-
|
|
93
|
+
|
|
94
|
+
// Remove all this logic when platform_editor_interaction_api_refactor is cleaned up
|
|
95
|
+
var hasHadInteraction;
|
|
96
|
+
if (fg('platform_editor_interaction_api_refactor')) {
|
|
97
|
+
// Warning: this logic is a cluster-f but `hasHadInteraction` depends on undefined being allowed
|
|
98
|
+
// in which case no class will be rendered at all. In this way we only set `hasHadInteraction to
|
|
99
|
+
// boolean when interactionState is not undefined.
|
|
100
|
+
if (interactionState) {
|
|
101
|
+
hasHadInteraction = interactionState.interactionState !== 'hasNotHadInteraction';
|
|
102
|
+
}
|
|
103
|
+
} else {
|
|
104
|
+
hasHadInteraction = interactionState === null || interactionState === void 0 ? void 0 : interactionState.hasHadInteraction;
|
|
105
|
+
}
|
|
94
106
|
var toolbarDocking = useSharedPluginStateSelector(editorAPI, 'selectionToolbar.toolbarDocking');
|
|
95
107
|
if (!toolbarDocking && fg('platform_editor_controls_toolbar_ssr_fix')) {
|
|
96
108
|
var _editorAPI$selectionT, _editorAPI$selectionT2;
|
|
@@ -66,8 +66,14 @@ var Content = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
68
|
}, []);
|
|
69
|
+
|
|
70
|
+
// Remove entire `hasHadInteraction` logic and prop when 'platform_editor_interaction_api_refactor' is cleaned up
|
|
69
71
|
var interactionClassName;
|
|
70
|
-
if (
|
|
72
|
+
if (fg('platform_editor_interaction_api_refactor')) {
|
|
73
|
+
// no-op and do not add any classes
|
|
74
|
+
} else if (
|
|
75
|
+
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
76
|
+
props.hasHadInteraction !== undefined && fg('platform_editor_no_cursor_on_live_doc_init')) {
|
|
71
77
|
interactionClassName = props.hasHadInteraction ? 'ak-editor-has-interaction' : 'ak-editor-no-interaction';
|
|
72
78
|
}
|
|
73
79
|
var shouldSetHiddenDataAttribute = function shouldSetHiddenDataAttribute() {
|