@atlaskit/editor-core 207.18.1 → 207.19.1
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 +20 -0
- package/dist/cjs/create-editor/ReactEditorView.js +2 -1
- package/dist/cjs/ui/ContextPanel/index.js +1 -0
- package/dist/cjs/ui/EditorContentContainer/EditorContentContainer.js +38 -4
- package/dist/cjs/ui/EditorContentContainer/styles/gapCursorStyles.js +99 -0
- package/dist/cjs/ui/EditorContentContainer/styles/layout.js +409 -366
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/create-editor/ReactEditorView.js +2 -1
- package/dist/es2019/ui/ContextPanel/index.js +1 -0
- package/dist/es2019/ui/EditorContentContainer/EditorContentContainer.js +38 -4
- package/dist/es2019/ui/EditorContentContainer/styles/gapCursorStyles.js +167 -0
- package/dist/es2019/ui/EditorContentContainer/styles/layout.js +423 -315
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/create-editor/ReactEditorView.js +2 -1
- package/dist/esm/ui/ContextPanel/index.js +1 -0
- package/dist/esm/ui/EditorContentContainer/EditorContentContainer.js +38 -4
- package/dist/esm/ui/EditorContentContainer/styles/gapCursorStyles.js +91 -0
- package/dist/esm/ui/EditorContentContainer/styles/layout.js +408 -365
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/ui/EditorContentContainer/styles/gapCursorStyles.d.ts +2 -0
- package/dist/types/ui/EditorContentContainer/styles/layout.d.ts +59 -2
- package/dist/types-ts4.5/ui/EditorContentContainer/styles/gapCursorStyles.d.ts +2 -0
- package/dist/types-ts4.5/ui/EditorContentContainer/styles/layout.d.ts +59 -2
- package/package.json +3 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "207.
|
|
2
|
+
export const version = "207.19.1";
|
|
@@ -20,6 +20,7 @@ import { isEmptyDocument } from '@atlaskit/editor-common/utils/document';
|
|
|
20
20
|
import { EditorState, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
21
21
|
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
22
22
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
23
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
23
24
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
24
25
|
import { useProviders } from '../composable-editor/hooks/useProviders';
|
|
25
26
|
import { createFeatureFlagsFromProps } from '../utils/feature-flags-from-props';
|
|
@@ -568,7 +569,7 @@ export function ReactEditorView(props) {
|
|
|
568
569
|
var createEditor = useCallback(function (assistiveLabel, assistiveDescribedBy) {
|
|
569
570
|
return /*#__PURE__*/React.createElement("div", {
|
|
570
571
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
571
|
-
className: getUAPrefix(),
|
|
572
|
+
className: (expValEquals('platform_editor_stable_editorview_classname', 'isEnabled', true) ? 'ProseMirror ' : '') + getUAPrefix(),
|
|
572
573
|
key: "ProseMirror",
|
|
573
574
|
ref: handleEditorViewRef,
|
|
574
575
|
"aria-label": assistiveLabel || props.intl.formatMessage(editorMessages.editorAssistiveLabel)
|
|
@@ -149,6 +149,7 @@ export var SwappableContentArea = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
149
149
|
_this2.props.customWidth && customPanelWidthStyles, !visible && panelHidden, fg('platform_editor_disable_context_panel_animation') && disablePanelAnimation],
|
|
150
150
|
"data-testid": "context-panel-panel",
|
|
151
151
|
"aria-labelledby": "context-panel-title",
|
|
152
|
+
"aria-label": "context-panel-panel",
|
|
152
153
|
role: "dialog"
|
|
153
154
|
}, jsx("div", {
|
|
154
155
|
"data-testid": "context-panel-content",
|
|
@@ -12,7 +12,6 @@ import React from 'react';
|
|
|
12
12
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
13
13
|
import { css, jsx, useTheme } from '@emotion/react';
|
|
14
14
|
import { browser } from '@atlaskit/editor-common/browser';
|
|
15
|
-
import { gapCursorStyles } from '@atlaskit/editor-common/selection';
|
|
16
15
|
import { GRID_GUTTER } from '@atlaskit/editor-common/styles';
|
|
17
16
|
import { tableCommentEditorStyles } from '@atlaskit/editor-plugins/table/ui/common-styles';
|
|
18
17
|
import { akEditorCalculatedWideLayoutWidth, akEditorCalculatedWideLayoutWidthSmallViewport, akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPadding, akEditorGutterPaddingDynamic, editorFontSize } from '@atlaskit/editor-shared-styles';
|
|
@@ -34,10 +33,11 @@ import { reactEmojiStyles, vanillaEmojiStyles } from './styles/emoji';
|
|
|
34
33
|
import { expandStyles, expandStylesMixin_fg_platform_editor_nested_dnd_styles_changes, expandStylesMixin_fg_platform_visual_refresh_icons, expandStylesMixin_without_fg_platform_editor_nested_dnd_styles_changes } from './styles/expandStyles';
|
|
35
34
|
import { findReplaceStyles } from './styles/findReplaceStyles';
|
|
36
35
|
import { firstBlockNodeStyles } from './styles/firstBlockNodeStyles';
|
|
36
|
+
import { gapCursorStyles } from './styles/gapCursorStyles';
|
|
37
37
|
import { gridStyles } from './styles/gridStyles';
|
|
38
38
|
import { indentationStyles } from './styles/indentationStyles';
|
|
39
39
|
import { InlineNodeViewSharedStyles } from './styles/inlineNodeViewSharedStyles';
|
|
40
|
-
import { layoutBaseStyles,
|
|
40
|
+
import { layoutColumnResponsiveStyles, layoutBaseStyles, layoutBaseStylesAdvanced, layoutBaseStylesFixesUnderNestedDnDFG, layoutSelectedStylesNotAdvanced, layoutSelectedStylesForViewNotAdvanced, layoutColumnMartinTopFixesNew, layoutColumnMartinTopFixesOld, layoutColumnStylesAdvanced, layoutColumnStylesNotAdvanced, layoutResponsiveBaseStyles, layoutResponsiveStylesForView, layoutSectionStylesAdvanced, layoutSectionStylesNotAdvanced, layoutStylesForView, layoutSelectedStylesAdvanced, layoutSelectedStylesForViewAdvanced } from './styles/layout';
|
|
41
41
|
import { linkStyles, linkStylesOld } from './styles/link';
|
|
42
42
|
import { listsStyles, listsStylesSafariFix } from './styles/list';
|
|
43
43
|
import { mediaStyles } from './styles/mediaStyles';
|
|
@@ -213,7 +213,33 @@ var EditorContentContainer = /*#__PURE__*/React.forwardRef(function (props, ref)
|
|
|
213
213
|
ref: ref,
|
|
214
214
|
css: [contentStyles(),
|
|
215
215
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
216
|
-
layoutBaseStyles
|
|
216
|
+
layoutBaseStyles,
|
|
217
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
218
|
+
editorExperiment('advanced_layouts', true) && layoutBaseStylesAdvanced, editorExperiment('advanced_layouts', true) ?
|
|
219
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
220
|
+
layoutSectionStylesAdvanced :
|
|
221
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
222
|
+
layoutSectionStylesNotAdvanced, editorExperiment('advanced_layouts', true) ?
|
|
223
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
224
|
+
layoutColumnStylesAdvanced :
|
|
225
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
226
|
+
layoutColumnStylesNotAdvanced,
|
|
227
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
228
|
+
editorExperiment('advanced_layouts', true) ?
|
|
229
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
230
|
+
layoutSelectedStylesAdvanced :
|
|
231
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
232
|
+
layoutSelectedStylesNotAdvanced,
|
|
233
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
234
|
+
editorExperiment('advanced_layouts', true) && layoutColumnResponsiveStyles,
|
|
235
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
236
|
+
editorExperiment('advanced_layouts', true) && layoutResponsiveBaseStyles, fg('platform_editor_nested_dnd_styles_changes') &&
|
|
237
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
238
|
+
layoutBaseStylesFixesUnderNestedDnDFG, fg('platform_editor_nested_dnd_styles_changes') ?
|
|
239
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
240
|
+
layoutColumnMartinTopFixesNew :
|
|
241
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
242
|
+
layoutColumnMartinTopFixesOld, fg('linking_platform_smart_links_in_live_pages') ?
|
|
217
243
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
218
244
|
smartLinksInLivePagesStyles :
|
|
219
245
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
@@ -245,7 +271,15 @@ var EditorContentContainer = /*#__PURE__*/React.forwardRef(function (props, ref)
|
|
|
245
271
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
246
272
|
colorMode === 'dark' && isFirefox && aiPanelDarkFirefoxStyles,
|
|
247
273
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
248
|
-
viewMode === 'view' &&
|
|
274
|
+
viewMode === 'view' && layoutStylesForView,
|
|
275
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
276
|
+
viewMode === 'view' && editorExperiment('advanced_layouts', true) &&
|
|
277
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
278
|
+
layoutSelectedStylesForViewAdvanced, viewMode === 'view' && editorExperiment('advanced_layouts', false) &&
|
|
279
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
280
|
+
layoutSelectedStylesForViewNotAdvanced, viewMode === 'view' && editorExperiment('advanced_layouts', true) &&
|
|
281
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
282
|
+
layoutResponsiveStylesForView, isComment && commentEditorStyles, isFullPage && fullPageEditorStyles, isFullPage && scrollbarStyles, fg('platform_editor_ssr_fix_lists') && listLayoutShiftFix, fg('platform_editor_nested_dnd_styles_changes') ?
|
|
249
283
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
250
284
|
firstCodeBlockWithNoMargin :
|
|
251
285
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
3
|
+
import { css, keyframes } from '@emotion/react';
|
|
4
|
+
var gapCursorBlink = keyframes({
|
|
5
|
+
'from, to': {
|
|
6
|
+
opacity: 0
|
|
7
|
+
},
|
|
8
|
+
'50%': {
|
|
9
|
+
opacity: 1
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
export var hideCaretModifier = 'ProseMirror-hide-gapcursor';
|
|
13
|
+
var gapCursorSelector = '.ProseMirror-gapcursor';
|
|
14
|
+
var prosemirrorwidgetNotBlock = '.ProseMirror-widget:not([data-blocks-decoration-container="true"]):not([data-blocks-drag-handle-container="true"]):not([data-blocks-quick-insert-container="true"])';
|
|
15
|
+
var wrapLeft = '[layout="wrap-left"]';
|
|
16
|
+
var wrapRight = '[layout="wrap-right"]';
|
|
17
|
+
var fixVerticalAlignmentSelector = "\n\t&:first-of-type + ul,\n\t&:first-of-type + span + ul,\n\t&:first-of-type + ol,\n\t&:first-of-type + span + ol,\n\t&:first-of-type + pre,\n\t&:first-of-type + span + pre,\n\t&:first-of-type + blockquote,\n\t&:first-of-type + span + blockquote\n";
|
|
18
|
+
var twoImagesSideBySideFixSelector = "\n ".concat(gapCursorSelector).concat(wrapLeft, " + span + ").concat(wrapLeft, ",\n ").concat(gapCursorSelector).concat(wrapRight, " + span + ").concat(wrapRight, ",\n ").concat(gapCursorSelector, " + ").concat(wrapLeft, " + ").concat(wrapRight, ",\n ").concat(gapCursorSelector, " + ").concat(wrapLeft, " + span + ").concat(wrapRight, ",\n ").concat(gapCursorSelector, " + ").concat(wrapRight, " + ").concat(wrapLeft, ",\n ").concat(gapCursorSelector, " + ").concat(wrapRight, " + span + ").concat(wrapLeft, ",\n ").concat(wrapLeft, " + ").concat(gapCursorSelector, " + ").concat(wrapRight, ",\n ").concat(wrapLeft, " + ").concat(gapCursorSelector, " + span ").concat(wrapRight, ",\n ").concat(wrapRight, " + ").concat(gapCursorSelector, " + ").concat(wrapLeft, ",\n ").concat(wrapRight, " + ").concat(gapCursorSelector, " + span + ").concat(wrapLeft, ",\n ").concat(wrapLeft, " + ").concat(gapCursorSelector);
|
|
19
|
+
var marginFixSelector = "\n ".concat(wrapLeft, " + ").concat(gapCursorSelector, " + ").concat(wrapRight, " > div,\n ").concat(wrapLeft, " + ").concat(gapCursorSelector, " + span + ").concat(wrapRight, " > div,\n ").concat(wrapRight, " + ").concat(gapCursorSelector, " + ").concat(wrapLeft, " > div,\n ").concat(wrapRight, " + ").concat(gapCursorSelector, " + span + ").concat(wrapLeft, " > div,\n ").concat(gapCursorSelector, " + ").concat(wrapRight, " + ").concat(wrapLeft, " > div,\n ").concat(gapCursorSelector, " + ").concat(wrapRight, " + span + ").concat(wrapLeft, " > div,\n ").concat(gapCursorSelector, " + ").concat(wrapLeft, " + ").concat(wrapRight, " > div,\n ").concat(gapCursorSelector, " + ").concat(wrapLeft, " + span + ").concat(wrapRight, " > div");
|
|
20
|
+
var floatLeftFixSelector = "\n ".concat(wrapLeft, " + ").concat(gapCursorSelector, ",\n ").concat(wrapRight, " + ").concat(gapCursorSelector);
|
|
21
|
+
var afterPresudoSelector = "\n ".concat(gapCursorSelector, " + ").concat(wrapLeft, " + span + ").concat(wrapRight, "::after,\n ").concat(gapCursorSelector, " + ").concat(wrapRight, " + span + ").concat(wrapLeft, "::after,\n ").concat(wrapLeft, " + ").concat(gapCursorSelector, " + ").concat(wrapRight, "::after,\n ").concat(wrapLeft, " + ").concat(gapCursorSelector, " + span + ").concat(wrapRight, "::after,\n ").concat(wrapRight, " + ").concat(gapCursorSelector, " + ").concat(wrapLeft, "::after,\n ").concat(wrapRight, " + ").concat(gapCursorSelector, " + span + ").concat(wrapLeft, "::after");
|
|
22
|
+
var marginDeepChildrenFixSelector = "\n".concat(wrapLeft, " + ").concat(gapCursorSelector, " + ").concat(wrapRight, " + *,\n ").concat(wrapLeft, " + ").concat(gapCursorSelector, " + ").concat(wrapRight, " + span + *,\n ").concat(wrapRight, " + ").concat(gapCursorSelector, " + ").concat(wrapLeft, " + *,\n ").concat(wrapRight, " + ").concat(gapCursorSelector, " + ").concat(wrapLeft, " + span + *,\n ").concat(wrapLeft, " + ").concat(gapCursorSelector, " + span + ").concat(wrapRight, " + *,\n ").concat(wrapRight, " + ").concat(gapCursorSelector, " + span + ").concat(wrapLeft, " + *,\n ").concat(gapCursorSelector, " + ").concat(wrapLeft, " + span + ").concat(wrapRight, " + *,\n ").concat(gapCursorSelector, " + ").concat(wrapRight, " + span + ").concat(wrapLeft, " + *,\n ").concat(wrapLeft, " + ").concat(gapCursorSelector, " + ").concat(wrapRight, " + * > *,\n ").concat(wrapLeft, " + ").concat(gapCursorSelector, " + ").concat(wrapRight, " + span + * > *,\n ").concat(wrapRight, " + ").concat(gapCursorSelector, " + ").concat(wrapLeft, " + * > *,\n ").concat(wrapRight, " + ").concat(gapCursorSelector, " + ").concat(wrapLeft, " + span + * > *,\n ").concat(wrapLeft, " + ").concat(gapCursorSelector, " + span + ").concat(wrapRight, " + * > *,\n ").concat(wrapRight, " + ").concat(gapCursorSelector, " + span + ").concat(wrapLeft, " + * > *,\n ").concat(gapCursorSelector, " + ").concat(wrapLeft, " + span + ").concat(wrapRight, " + * > *,\n ").concat(gapCursorSelector, " + ").concat(wrapRight, " + span + ").concat(wrapLeft, " + * > *,\n ").concat(prosemirrorwidgetNotBlock, " + ").concat(gapCursorSelector, " + *,\n ").concat(prosemirrorwidgetNotBlock, " + ").concat(gapCursorSelector, " + span + *");
|
|
23
|
+
|
|
24
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
25
|
+
export var gapCursorStyles = css(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
26
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
27
|
+
'.ProseMirror': _defineProperty(_defineProperty(_defineProperty({}, "&.".concat(hideCaretModifier), {
|
|
28
|
+
caretColor: 'transparent'
|
|
29
|
+
}), gapCursorSelector, _defineProperty(_defineProperty({
|
|
30
|
+
display: 'none',
|
|
31
|
+
pointerEvents: 'none',
|
|
32
|
+
position: 'relative',
|
|
33
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
34
|
+
'& span': {
|
|
35
|
+
caretColor: 'transparent',
|
|
36
|
+
position: 'absolute',
|
|
37
|
+
height: '100%',
|
|
38
|
+
width: '100%',
|
|
39
|
+
display: 'block'
|
|
40
|
+
},
|
|
41
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
42
|
+
'& span::after': {
|
|
43
|
+
animation: "1s ".concat(gapCursorBlink, " step-start infinite"),
|
|
44
|
+
borderLeft: '1px solid',
|
|
45
|
+
content: "''",
|
|
46
|
+
display: 'block',
|
|
47
|
+
position: 'absolute',
|
|
48
|
+
top: 0,
|
|
49
|
+
height: '100%'
|
|
50
|
+
},
|
|
51
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
52
|
+
'&.-left span::after': {
|
|
53
|
+
left: "var(--ds-space-negative-050, -4px)"
|
|
54
|
+
},
|
|
55
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
56
|
+
'&.-right span::after': {
|
|
57
|
+
right: "var(--ds-space-negative-050, -4px)"
|
|
58
|
+
},
|
|
59
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
60
|
+
'& span[layout="full-width"], & span[layout="wide"], & span[layout="fixed-width"]': {
|
|
61
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
62
|
+
marginLeft: '50%',
|
|
63
|
+
transform: 'translateX(-50%)'
|
|
64
|
+
}
|
|
65
|
+
}, "&".concat(wrapRight), {
|
|
66
|
+
float: 'right'
|
|
67
|
+
}), fixVerticalAlignmentSelector, {
|
|
68
|
+
marginTop: 0
|
|
69
|
+
})), "&.ProseMirror-focused ".concat(gapCursorSelector), {
|
|
70
|
+
display: 'block',
|
|
71
|
+
borderColor: 'transparent'
|
|
72
|
+
})
|
|
73
|
+
}, twoImagesSideBySideFixSelector, {
|
|
74
|
+
clear: 'none'
|
|
75
|
+
}), marginFixSelector, {
|
|
76
|
+
marginRight: 0,
|
|
77
|
+
marginLeft: 0,
|
|
78
|
+
marginBottom: 0
|
|
79
|
+
}), floatLeftFixSelector, {
|
|
80
|
+
float: 'left'
|
|
81
|
+
}), afterPresudoSelector, {
|
|
82
|
+
visibility: 'hidden',
|
|
83
|
+
display: 'block',
|
|
84
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
85
|
+
fontSize: 0,
|
|
86
|
+
content: "' '",
|
|
87
|
+
clear: 'both',
|
|
88
|
+
height: 0
|
|
89
|
+
}), marginDeepChildrenFixSelector, {
|
|
90
|
+
marginTop: 0
|
|
91
|
+
}));
|