@atlaskit/editor-core 215.8.2 → 215.8.3
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 +7 -0
- package/dist/cjs/ui/EditorContentContainer/EditorContentContainer.js +3 -1
- package/dist/cjs/ui/EditorContentContainer/styles/list.js +24 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/ui/EditorContentContainer/EditorContentContainer.js +4 -2
- package/dist/es2019/ui/EditorContentContainer/styles/list.js +23 -0
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/ui/EditorContentContainer/EditorContentContainer.js +4 -2
- package/dist/esm/ui/EditorContentContainer/styles/list.js +23 -0
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/ui/EditorContentContainer/styles/list.d.ts +1 -0
- package/dist/types-ts4.5/ui/EditorContentContainer/styles/list.d.ts +1 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 215.8.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`76effece25ab5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/76effece25ab5) -
|
|
8
|
+
ED-29540: Fix layout shift caused by the top margin of lists changing post-hydration.
|
|
9
|
+
|
|
3
10
|
## 215.8.2
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -220,7 +220,9 @@ var EditorContentContainer = /*#__PURE__*/_react.default.forwardRef(function (pr
|
|
|
220
220
|
// Condense vertical spacing between list items when content mode dense is active
|
|
221
221
|
(0, _expValEquals.expValEquals)('cc_editor_ai_content_mode', 'variant', 'test') && (0, _platformFeatureFlags.fg)('platform_editor_content_mode_button_mvp') &&
|
|
222
222
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
223
|
-
(0, _list.getDenseListStyles)(baseFontSize),
|
|
223
|
+
(0, _list.getDenseListStyles)(baseFontSize), (0, _expValEquals.expValEquals)('cc_editor_ttvc_release_bundle_one', 'listLayoutShiftFix', true) && isFullPage &&
|
|
224
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
225
|
+
_list.listsStylesMarginLayoutShiftFix,
|
|
224
226
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
225
227
|
_rule.ruleStyles,
|
|
226
228
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.listsStylesSafariFix = exports.listsStyles = exports.getDenseListStyles = exports.diffListStyles = exports.EDITOR_LIST_DENSE_GAP = void 0;
|
|
7
|
+
exports.listsStylesSafariFix = exports.listsStylesMarginLayoutShiftFix = exports.listsStyles = exports.getDenseListStyles = exports.diffListStyles = exports.EDITOR_LIST_DENSE_GAP = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _react = require("@emotion/react");
|
|
10
10
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
@@ -148,6 +148,29 @@ var diffListStyles = exports.diffListStyles = (0, _react.css)({
|
|
|
148
148
|
}
|
|
149
149
|
});
|
|
150
150
|
|
|
151
|
+
// These styles are to fix a layout shift issue that occurs when aui-reset.less CSS is applied post-hydration.
|
|
152
|
+
// It overrides the design system bundle.css list margins, which in turn causes the lists to shift vertically.
|
|
153
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
154
|
+
var listsStylesMarginLayoutShiftFix = exports.listsStylesMarginLayoutShiftFix = (0, _react.css)({
|
|
155
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
156
|
+
'.ProseMirror': {
|
|
157
|
+
// Root lists: 12px top margin (design system value), except first content child. Uses :not(:nth-child(1 of ...)) to exclude first content lists.
|
|
158
|
+
// A more complex selector is used here to ensure this style is not applied to block quotes and panels, as they do not have a margin-top property already, and this will incorrectly add a margin-top to them.
|
|
159
|
+
// This is unlike tables and expands, which do have a margin-top property already, and this style would not change their top margin, even without the :not(:nth-child(1 of ...)) selector.
|
|
160
|
+
// This targeted approach reduces the blast radius of the fix. Instead of modifying numerous existing styles, we add this single selector until the issue with bundle.css & aui-reset.less is fixed.
|
|
161
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
162
|
+
'ul:not(li > ul):not(:nth-child(1 of :not(style, .ProseMirror-gapcursor, .ProseMirror-widget, span))), ol:not(li > ol):not(:nth-child(1 of :not(style, .ProseMirror-gapcursor, .ProseMirror-widget, span)))': {
|
|
163
|
+
marginTop: "var(--ds-space-150, 12px)"
|
|
164
|
+
},
|
|
165
|
+
// Nested lists: 4px top margin (design system value)
|
|
166
|
+
// Applies to both OL and UL nested inside list items
|
|
167
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
168
|
+
'li > ol, li > ul': {
|
|
169
|
+
marginTop: "var(--ds-space-050, 4px)"
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
|
|
151
174
|
/* This prevents https://product-fabric.atlassian.net/browse/ED-20924 */
|
|
152
175
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
153
176
|
var listsStylesSafariFix = exports.listsStylesSafariFix = (0, _react.css)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, ".ProseMirror:not(.".concat(BLOCK_CARD_CONTAINER, ") > li::before"), {
|
|
@@ -44,7 +44,7 @@ import { indentationStyles } from './styles/indentationStyles';
|
|
|
44
44
|
import { InlineNodeViewSharedStyles } from './styles/inlineNodeViewSharedStyles';
|
|
45
45
|
import { layoutBaseStyles, layoutBaseStylesAdvanced, layoutBaseStylesFixesUnderNestedDnDFG, layoutColumnMartinTopFixesNew, layoutColumnMartinTopFixesOld, layoutColumnResponsiveStyles, layoutColumnStylesAdvanced, layoutColumnStylesNotAdvanced, layoutResponsiveBaseStyles, layoutResponsiveStylesForView, layoutSectionStylesAdvanced, layoutSectionStylesNotAdvanced, layoutSelectedStylesAdvanced, layoutSelectedStylesForViewAdvanced, layoutSelectedStylesForViewNotAdvanced, layoutSelectedStylesNotAdvanced, layoutStylesForView } from './styles/layout';
|
|
46
46
|
import { hyperLinkFloatingToolbarStyles, linkLegacyIconStylesFix, linkStyles } from './styles/link';
|
|
47
|
-
import { getDenseListStyles, listsStyles, diffListStyles, listsStylesSafariFix } from './styles/list';
|
|
47
|
+
import { getDenseListStyles, listsStyles, diffListStyles, listsStylesSafariFix, listsStylesMarginLayoutShiftFix } from './styles/list';
|
|
48
48
|
import { mediaAlignmentStyles, mediaCaptionStyles, mediaDangerStyles, mediaGroupStyles, mediaStyles } from './styles/mediaStyles';
|
|
49
49
|
import { mentionsStyles, mentionsSelectionStyles, mentionNodeStyles, mentionsStylesMixin_platform_editor_centre_mention_padding, mentionsSelectionStylesWithSearchMatch, mentionDangerStyles } from './styles/mentions';
|
|
50
50
|
import { panelStyles, panelStylesMixin, nestedPanelBorderStylesMixin, panelStylesMixin_fg_platform_editor_nested_dnd_styles_changes, panelViewStyles, nestedPanelDangerStyles } from './styles/panelStyles';
|
|
@@ -216,7 +216,9 @@ const EditorContentContainer = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
216
216
|
// Condense vertical spacing between list items when content mode dense is active
|
|
217
217
|
expValEquals('cc_editor_ai_content_mode', 'variant', 'test') && fg('platform_editor_content_mode_button_mvp') &&
|
|
218
218
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
219
|
-
getDenseListStyles(baseFontSize),
|
|
219
|
+
getDenseListStyles(baseFontSize), expValEquals('cc_editor_ttvc_release_bundle_one', 'listLayoutShiftFix', true) && isFullPage &&
|
|
220
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
221
|
+
listsStylesMarginLayoutShiftFix,
|
|
220
222
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
221
223
|
ruleStyles,
|
|
222
224
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
@@ -139,6 +139,29 @@ export const diffListStyles = css({
|
|
|
139
139
|
}
|
|
140
140
|
});
|
|
141
141
|
|
|
142
|
+
// These styles are to fix a layout shift issue that occurs when aui-reset.less CSS is applied post-hydration.
|
|
143
|
+
// It overrides the design system bundle.css list margins, which in turn causes the lists to shift vertically.
|
|
144
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
145
|
+
export const listsStylesMarginLayoutShiftFix = css({
|
|
146
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
147
|
+
'.ProseMirror': {
|
|
148
|
+
// Root lists: 12px top margin (design system value), except first content child. Uses :not(:nth-child(1 of ...)) to exclude first content lists.
|
|
149
|
+
// A more complex selector is used here to ensure this style is not applied to block quotes and panels, as they do not have a margin-top property already, and this will incorrectly add a margin-top to them.
|
|
150
|
+
// This is unlike tables and expands, which do have a margin-top property already, and this style would not change their top margin, even without the :not(:nth-child(1 of ...)) selector.
|
|
151
|
+
// This targeted approach reduces the blast radius of the fix. Instead of modifying numerous existing styles, we add this single selector until the issue with bundle.css & aui-reset.less is fixed.
|
|
152
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
153
|
+
'ul:not(li > ul):not(:nth-child(1 of :not(style, .ProseMirror-gapcursor, .ProseMirror-widget, span))), ol:not(li > ol):not(:nth-child(1 of :not(style, .ProseMirror-gapcursor, .ProseMirror-widget, span)))': {
|
|
154
|
+
marginTop: `var(--ds-space-150, 12px)`
|
|
155
|
+
},
|
|
156
|
+
// Nested lists: 4px top margin (design system value)
|
|
157
|
+
// Applies to both OL and UL nested inside list items
|
|
158
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
159
|
+
'li > ol, li > ul': {
|
|
160
|
+
marginTop: `var(--ds-space-050, 4px)`
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
|
|
142
165
|
/* This prevents https://product-fabric.atlassian.net/browse/ED-20924 */
|
|
143
166
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
144
167
|
export const listsStylesSafariFix = css({
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "215.8.
|
|
2
|
+
export const version = "215.8.2";
|
|
@@ -45,7 +45,7 @@ import { indentationStyles } from './styles/indentationStyles';
|
|
|
45
45
|
import { InlineNodeViewSharedStyles } from './styles/inlineNodeViewSharedStyles';
|
|
46
46
|
import { layoutBaseStyles, layoutBaseStylesAdvanced, layoutBaseStylesFixesUnderNestedDnDFG, layoutColumnMartinTopFixesNew, layoutColumnMartinTopFixesOld, layoutColumnResponsiveStyles, layoutColumnStylesAdvanced, layoutColumnStylesNotAdvanced, layoutResponsiveBaseStyles, layoutResponsiveStylesForView, layoutSectionStylesAdvanced, layoutSectionStylesNotAdvanced, layoutSelectedStylesAdvanced, layoutSelectedStylesForViewAdvanced, layoutSelectedStylesForViewNotAdvanced, layoutSelectedStylesNotAdvanced, layoutStylesForView } from './styles/layout';
|
|
47
47
|
import { hyperLinkFloatingToolbarStyles, linkLegacyIconStylesFix, linkStyles } from './styles/link';
|
|
48
|
-
import { getDenseListStyles, listsStyles, diffListStyles, listsStylesSafariFix } from './styles/list';
|
|
48
|
+
import { getDenseListStyles, listsStyles, diffListStyles, listsStylesSafariFix, listsStylesMarginLayoutShiftFix } from './styles/list';
|
|
49
49
|
import { mediaAlignmentStyles, mediaCaptionStyles, mediaDangerStyles, mediaGroupStyles, mediaStyles } from './styles/mediaStyles';
|
|
50
50
|
import { mentionsStyles, mentionsSelectionStyles, mentionNodeStyles, mentionsStylesMixin_platform_editor_centre_mention_padding, mentionsSelectionStylesWithSearchMatch, mentionDangerStyles } from './styles/mentions';
|
|
51
51
|
import { panelStyles, panelStylesMixin, nestedPanelBorderStylesMixin, panelStylesMixin_fg_platform_editor_nested_dnd_styles_changes, panelViewStyles, nestedPanelDangerStyles } from './styles/panelStyles';
|
|
@@ -212,7 +212,9 @@ var EditorContentContainer = /*#__PURE__*/React.forwardRef(function (props, ref)
|
|
|
212
212
|
// Condense vertical spacing between list items when content mode dense is active
|
|
213
213
|
expValEquals('cc_editor_ai_content_mode', 'variant', 'test') && fg('platform_editor_content_mode_button_mvp') &&
|
|
214
214
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
215
|
-
getDenseListStyles(baseFontSize),
|
|
215
|
+
getDenseListStyles(baseFontSize), expValEquals('cc_editor_ttvc_release_bundle_one', 'listLayoutShiftFix', true) && isFullPage &&
|
|
216
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
217
|
+
listsStylesMarginLayoutShiftFix,
|
|
216
218
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
217
219
|
ruleStyles,
|
|
218
220
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
@@ -140,6 +140,29 @@ export var diffListStyles = css({
|
|
|
140
140
|
}
|
|
141
141
|
});
|
|
142
142
|
|
|
143
|
+
// These styles are to fix a layout shift issue that occurs when aui-reset.less CSS is applied post-hydration.
|
|
144
|
+
// It overrides the design system bundle.css list margins, which in turn causes the lists to shift vertically.
|
|
145
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
146
|
+
export var listsStylesMarginLayoutShiftFix = css({
|
|
147
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
148
|
+
'.ProseMirror': {
|
|
149
|
+
// Root lists: 12px top margin (design system value), except first content child. Uses :not(:nth-child(1 of ...)) to exclude first content lists.
|
|
150
|
+
// A more complex selector is used here to ensure this style is not applied to block quotes and panels, as they do not have a margin-top property already, and this will incorrectly add a margin-top to them.
|
|
151
|
+
// This is unlike tables and expands, which do have a margin-top property already, and this style would not change their top margin, even without the :not(:nth-child(1 of ...)) selector.
|
|
152
|
+
// This targeted approach reduces the blast radius of the fix. Instead of modifying numerous existing styles, we add this single selector until the issue with bundle.css & aui-reset.less is fixed.
|
|
153
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
154
|
+
'ul:not(li > ul):not(:nth-child(1 of :not(style, .ProseMirror-gapcursor, .ProseMirror-widget, span))), ol:not(li > ol):not(:nth-child(1 of :not(style, .ProseMirror-gapcursor, .ProseMirror-widget, span)))': {
|
|
155
|
+
marginTop: "var(--ds-space-150, 12px)"
|
|
156
|
+
},
|
|
157
|
+
// Nested lists: 4px top margin (design system value)
|
|
158
|
+
// Applies to both OL and UL nested inside list items
|
|
159
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
160
|
+
'li > ol, li > ul': {
|
|
161
|
+
marginTop: "var(--ds-space-050, 4px)"
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
|
|
143
166
|
/* This prevents https://product-fabric.atlassian.net/browse/ED-20924 */
|
|
144
167
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
|
|
145
168
|
export var listsStylesSafariFix = css(_defineProperty(_defineProperty({}, ".ProseMirror:not(.".concat(BLOCK_CARD_CONTAINER, ") > li::before"), {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export var name = "@atlaskit/editor-core";
|
|
2
|
-
export var version = "215.8.
|
|
2
|
+
export var version = "215.8.2";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type SerializedStyles } from '@emotion/react';
|
|
2
2
|
export declare const listsStyles: SerializedStyles;
|
|
3
3
|
export declare const diffListStyles: SerializedStyles;
|
|
4
|
+
export declare const listsStylesMarginLayoutShiftFix: SerializedStyles;
|
|
4
5
|
export declare const listsStylesSafariFix: SerializedStyles;
|
|
5
6
|
export declare const EDITOR_LIST_DENSE_GAP = "max(0px, calc((var(--ak-editor-base-font-size, 16px) - 13px) * (4 / 3)))";
|
|
6
7
|
export declare const getDenseListStyles: (baseFontSize?: number) => SerializedStyles;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type SerializedStyles } from '@emotion/react';
|
|
2
2
|
export declare const listsStyles: SerializedStyles;
|
|
3
3
|
export declare const diffListStyles: SerializedStyles;
|
|
4
|
+
export declare const listsStylesMarginLayoutShiftFix: SerializedStyles;
|
|
4
5
|
export declare const listsStylesSafariFix: SerializedStyles;
|
|
5
6
|
export declare const EDITOR_LIST_DENSE_GAP = "max(0px, calc((var(--ak-editor-base-font-size, 16px) - 13px) * (4 / 3)))";
|
|
6
7
|
export declare const getDenseListStyles: (baseFontSize?: number) => SerializedStyles;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "215.8.
|
|
3
|
+
"version": "215.8.3",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
"@atlaskit/media-core": "^37.0.0",
|
|
104
104
|
"@atlaskit/media-integration-test-helpers": "workspace:^",
|
|
105
105
|
"@atlaskit/media-test-helpers": "^39.0.0",
|
|
106
|
-
"@atlaskit/modal-dialog": "^14.
|
|
106
|
+
"@atlaskit/modal-dialog": "^14.6.0",
|
|
107
107
|
"@atlaskit/primitives": "^16.0.0",
|
|
108
108
|
"@atlaskit/renderer": "^124.8.0",
|
|
109
109
|
"@atlaskit/section-message": "^8.7.0",
|