@atlaskit/editor-core 207.0.3 → 207.0.4
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 +9 -0
- package/dist/cjs/ui/ContentStyles/index.js +8 -1
- package/dist/cjs/ui/EditorContentContainer.js +9 -2
- package/dist/cjs/utils/extensions.js +16 -26
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/ui/ContentStyles/index.js +8 -1
- package/dist/es2019/ui/EditorContentContainer.js +9 -3
- package/dist/es2019/utils/extensions.js +16 -26
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/ui/ContentStyles/index.js +8 -1
- package/dist/esm/ui/EditorContentContainer.js +9 -2
- package/dist/esm/utils/extensions.js +16 -26
- package/dist/esm/version-wrapper.js +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 207.0.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#156947](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/156947)
|
|
8
|
+
[`177aaf68cb7af`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/177aaf68cb7af) -
|
|
9
|
+
Cleanup feature flag - adding extension api to quick insert
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 207.0.3
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -174,6 +174,13 @@ var legacyContentStyles = function legacyContentStyles(props) {
|
|
|
174
174
|
exposure: false
|
|
175
175
|
}) && !(0, _platformFeatureFlags.fg)('platform-visual-refresh-icons') && _tasksAndDecisions.vanillaTaskDecisionIconWithoutVisualRefresh, _status.statusStyles, (0, _experiments.editorExperiment)('platform_editor_vanilla_dom', true) ? (0, _status.vanillaStatusStyles)() : null, (0, _styles.annotationSharedStyles)(), (0, _styles.smartCardStyles)(), (0, _platformFeatureFlags.fg)('platform-linking-visual-refresh-v1') ? (0, _styles.getSmartCardSharedStyles)() : _styles.smartCardSharedStyles, (0, _experiments.editorExperiment)('platform_editor_vanilla_dom', true) ? _date.dateVanillaStyles : null, _date.dateStyles, (0, _styles.embedCardStyles)(), _styles.unsupportedStyles, _styles.resizerStyles, (0, _aiPanels.aiPanelStyles)(props.colorMode), fixBlockControlStylesSSR(), _styles.MediaSharedClassNames.FLOATING_TOOLBAR_COMPONENT, !(0, _platformFeatureFlags.fg)('platform-visual-refresh-icons') ? (0, _react2.css)(_templateObject14 || (_templateObject14 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t.hyperlink-open-link {\n\t\t\t\t\tmin-width: 24px;\n\t\t\t\t\tsvg {\n\t\t\t\t\t\tmax-width: 18px;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t"]))) : null);
|
|
176
176
|
};
|
|
177
|
+
var listLayoutShiftFix = (0, _react2.css)({
|
|
178
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
179
|
+
'.ProseMirror ul, .ProseMirror ol': {
|
|
180
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
181
|
+
marginTop: '10px'
|
|
182
|
+
}
|
|
183
|
+
});
|
|
177
184
|
var createEditorContentStyle = exports.createEditorContentStyle = function createEditorContentStyle(styles) {
|
|
178
185
|
return /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
179
186
|
var className = props.className,
|
|
@@ -206,7 +213,7 @@ var createEditorContentStyle = exports.createEditorContentStyle = function creat
|
|
|
206
213
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
207
214
|
className: className,
|
|
208
215
|
ref: ref,
|
|
209
|
-
css: [memoizedStyle, styles],
|
|
216
|
+
css: [memoizedStyle, styles, (0, _platformFeatureFlags.fg)('platform_editor_ssr_fix_lists') && listLayoutShiftFix],
|
|
210
217
|
"data-testid": "editor-content-container"
|
|
211
218
|
}, children);
|
|
212
219
|
});
|
|
@@ -255,7 +255,7 @@ var layoutResponsiveViewStyles = (0, _react2.css)(_templateObject27 || (_templat
|
|
|
255
255
|
|
|
256
256
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
|
|
257
257
|
var layoutBaseStyles = function layoutBaseStyles() {
|
|
258
|
-
return (0, _react2.css)(_templateObject28 || (_templateObject28 = (0, _taggedTemplateLiteral2.default)(["\n\t.ProseMirror {\n\t\t", "\n\t\t[data-layout-section] {\n\t\t\t/* Ignored via go/ees007\n\t\t\tTODO: Migrate away from gridSize\n\t\t\tRecommendation: Replace directly with 7px */\n\t\t\tmargin: ", " -", "px
|
|
258
|
+
return (0, _react2.css)(_templateObject28 || (_templateObject28 = (0, _taggedTemplateLiteral2.default)(["\n\t.ProseMirror {\n\t\t", "\n\t\t[data-layout-section] {\n\t\t\t/* Ignored via go/ees007\n\t\t\tTODO: Migrate away from gridSize\n\t\t\tRecommendation: Replace directly with 7px */\n\t\t\tmargin: ", " -", "px 0;\n\t\t\ttransition: border-color 0.3s ", ";\n\t\t\tcursor: pointer;\n\n\t\t\t/* Inner cursor located 26px from left */\n\t\t\t[data-layout-column] {\n\t\t\t\tflex: 1;\n\t\t\t\tposition: relative;\n\n\t\t\t\tmin-width: 0;\n\t\t\t\t/* disable 4 borders when in view mode and advanced layouts is on */\n\t\t\t\tborder: ", "px\n\t\t\t\t\tsolid ", ";\n\t\t\t\tborder-radius: 4px;\n\t\t\t\tpadding: ", "px\n\t\t\t\t\t", "px;\n\t\t\t\tbox-sizing: border-box;\n\n\t\t\t\t> div {\n\t\t\t\t\t", "\n\n\t\t\t\t\t> .embedCardView-content-wrap:first-of-type .rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .mediaSingleView-content-wrap:first-of-type .rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .ProseMirror-gapcursor.-right:first-child\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> style:first-child\n\t\t\t\t\t\t+ .ProseMirror-gapcursor.-right\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> .ProseMirror-gapcursor.-right:first-of-type\n\t\t\t\t\t\t+ .embedCardView-content-wrap\n\t\t\t\t\t\t.rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .ProseMirror-gapcursor:first-child\n\t\t\t\t\t\t+ span\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> style:first-child\n\t\t\t\t\t\t+ .ProseMirror-gapcursor\n\t\t\t\t\t\t+ span\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t/* Prevent first DecisionWrapper's margin-top: 8px from shifting decisions down\n\t\t\t and shrinking layout's node selectable area (leniency margin) */\n\t\t\t\t\t> [data-node-type='decisionList'] {\n\t\t\t\t\t\tli:first-of-type [data-decision-wrapper] {\n\t\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/* Make the 'content' fill the entire height of the layout column to allow click\n\t\t handler of layout section nodeview to target only data-layout-column */\n\t\t\t\t[data-layout-content] {\n\t\t\t\t\theight: 100%;\n\t\t\t\t\tcursor: text;\n\t\t\t\t\t.mediaGroupView-content-wrap {\n\t\t\t\t\t\tclear: both;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t", "\n\t\t}\n\n\t\t/* styles to support borders for layout */\n\t\t[data-layout-section],\n\t\t.layoutSectionView-content-wrap {\n\t\t\t", "\n\t\t}\n\t}\n\n\t", "\n\n\t/* hide separator when element is dragging on top of a layout column */\n\t[data-blocks-drop-target-container] ~ [data-layout-column] > [data-layout-content]::before {\n\t\tdisplay: none;\n\t}\n\n\t.fabric-editor--full-width-mode .ProseMirror {\n\t\t[data-layout-section] {\n\t\t\t.", " {\n\t\t\t\tmargin: 0 ", "px;\n\t\t\t}\n\t\t}\n\t}\n\n\t", "\n"])), layoutSectionStyles(), "var(--ds-space-100, 8px)", _editorSharedStyles.akLayoutGutterOffset + ((0, _platformFeatureFlags.fg)('platform_editor_nested_dnd_styles_changes') ? 8 : 0), _editorSharedStyles.akEditorSwoopCubicBezier, (0, _experiments.editorExperiment)('advanced_layouts', true) ? 0 : _editorSharedStyles.akEditorSelectedBorderSize, "var(--ds-border, #091E4224)", _styles.LAYOUT_COLUMN_PADDING, _styles.LAYOUT_COLUMN_PADDING + ((0, _platformFeatureFlags.fg)('platform_editor_nested_dnd_styles_changes') ? 8 : 0), firstNodeWithNotMarginTop(), layoutColumnStyles(), (0, _experiments.editorExperiment)('advanced_layouts', true) ? layoutWithSeparatorBorderBaseStyles : layoutBorderBaseStyles, (0, _experiments.editorExperiment)('advanced_layouts', true) && layoutResponsiveBaseStyles, _types.TableCssClassName.TABLE_CONTAINER, _consts.tableMarginFullWidthMode, (0, _experiments.editorExperiment)('advanced_layouts', false) && (0, _platformFeatureFlags.fg)('platform_editor_nested_dnd_styles_changes') && ".ak-editor-content-area.appearance-full-page .ProseMirror [data-layout-section] {\n\t\t\t\tmargin: ".concat("var(--ds-space-100, 8px)", " -", _editorSharedStyles.akLayoutGutterOffset + 8, "px 0;\n\t\t\t\t}"));
|
|
259
259
|
};
|
|
260
260
|
|
|
261
261
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
|
|
@@ -403,6 +403,13 @@ var fullPageEditorStyles = (0, _react2.css)({
|
|
|
403
403
|
},
|
|
404
404
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
405
405
|
_scrollbar.scrollbarStyles);
|
|
406
|
+
var listLayoutShiftFix = (0, _react2.css)({
|
|
407
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
408
|
+
'.ProseMirror ul, .ProseMirror ol': {
|
|
409
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
410
|
+
marginTop: '10px'
|
|
411
|
+
}
|
|
412
|
+
});
|
|
406
413
|
|
|
407
414
|
/**
|
|
408
415
|
* EditorContentStyles is a wrapper component that applies styles to its children
|
|
@@ -436,7 +443,7 @@ var EditorContentContainer = /*#__PURE__*/_react.default.forwardRef(function (pr
|
|
|
436
443
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
437
444
|
className: className,
|
|
438
445
|
ref: ref,
|
|
439
|
-
css: [contentStyles(), layoutBaseStyles(), aiPanelBaseStyles, colorMode === 'dark' && aiPanelDarkStyles, viewMode === 'view' && layoutViewStyles, isComment && commentEditorStyles, isFullPage && fullPageEditorStyles],
|
|
446
|
+
css: [contentStyles(), layoutBaseStyles(), aiPanelBaseStyles, colorMode === 'dark' && aiPanelDarkStyles, viewMode === 'view' && layoutViewStyles, isComment && commentEditorStyles, isFullPage && fullPageEditorStyles, (0, _platformFeatureFlags.fg)('platform_editor_ssr_fix_lists') && listLayoutShiftFix],
|
|
440
447
|
"data-editor-scroll-container": isScrollable ? 'true' : undefined,
|
|
441
448
|
"data-testid": "editor-content-container",
|
|
442
449
|
style: {
|
|
@@ -110,33 +110,23 @@ function _extensionProviderToQuickInsertProvider() {
|
|
|
110
110
|
isDisabledOffline: true,
|
|
111
111
|
action: function action(insert, state, source) {
|
|
112
112
|
if (typeof item.node === 'function') {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
(
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
});
|
|
125
|
-
} else {
|
|
126
|
-
// Originally it was understood we could only use this if we were using the extension plugin
|
|
127
|
-
// However there are some edge cases where this is not true (ie. in jira)
|
|
128
|
-
// Since making it optional now would be a breaking change - instead we can just pass a dummy
|
|
129
|
-
// extension API to consumers that warns them of using the methods.
|
|
130
|
-
(0, _extensions.resolveImport)(item.node(dummyExtensionAPI)).then(function (node) {
|
|
131
|
-
sendExtensionQuickInsertAnalytics(item, state.selection, createAnalyticsEvent, source);
|
|
132
|
-
if (node) {
|
|
133
|
-
editorActions.replaceSelection(node);
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
}
|
|
113
|
+
var _apiRef$current;
|
|
114
|
+
var extensionAPI = apiRef === null || apiRef === void 0 || (_apiRef$current = apiRef.current) === null || _apiRef$current === void 0 || (_apiRef$current = _apiRef$current.extension) === null || _apiRef$current === void 0 || (_apiRef$current = _apiRef$current.actions) === null || _apiRef$current === void 0 ? void 0 : _apiRef$current.api();
|
|
115
|
+
// While this should only run when the extension some setups of editor
|
|
116
|
+
// may not have the extension API
|
|
117
|
+
if (extensionAPI) {
|
|
118
|
+
(0, _extensions.resolveImport)(item.node(extensionAPI)).then(function (node) {
|
|
119
|
+
sendExtensionQuickInsertAnalytics(item, state.selection, createAnalyticsEvent, source);
|
|
120
|
+
if (node) {
|
|
121
|
+
editorActions.replaceSelection(node);
|
|
122
|
+
}
|
|
123
|
+
});
|
|
137
124
|
} else {
|
|
138
|
-
//
|
|
139
|
-
|
|
125
|
+
// Originally it was understood we could only use this if we were using the extension plugin
|
|
126
|
+
// However there are some edge cases where this is not true (ie. in jira)
|
|
127
|
+
// Since making it optional now would be a breaking change - instead we can just pass a dummy
|
|
128
|
+
// extension API to consumers that warns them of using the methods.
|
|
129
|
+
(0, _extensions.resolveImport)(item.node(dummyExtensionAPI)).then(function (node) {
|
|
140
130
|
sendExtensionQuickInsertAnalytics(item, state.selection, createAnalyticsEvent, source);
|
|
141
131
|
if (node) {
|
|
142
132
|
editorActions.replaceSelection(node);
|
|
@@ -538,6 +538,13 @@ const legacyContentStyles = props => css`
|
|
|
538
538
|
}
|
|
539
539
|
` : null}
|
|
540
540
|
`;
|
|
541
|
+
const listLayoutShiftFix = css({
|
|
542
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
543
|
+
'.ProseMirror ul, .ProseMirror ol': {
|
|
544
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
545
|
+
marginTop: '10px'
|
|
546
|
+
}
|
|
547
|
+
});
|
|
541
548
|
export const createEditorContentStyle = styles => {
|
|
542
549
|
return /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
543
550
|
const {
|
|
@@ -571,7 +578,7 @@ export const createEditorContentStyle = styles => {
|
|
|
571
578
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
572
579
|
className: className,
|
|
573
580
|
ref: ref,
|
|
574
|
-
css: [memoizedStyle, styles],
|
|
581
|
+
css: [memoizedStyle, styles, fg('platform_editor_ssr_fix_lists') && listLayoutShiftFix],
|
|
575
582
|
"data-testid": "editor-content-container"
|
|
576
583
|
}, children);
|
|
577
584
|
});
|
|
@@ -688,8 +688,7 @@ const layoutBaseStyles = () => css`
|
|
|
688
688
|
/* Ignored via go/ees007
|
|
689
689
|
TODO: Migrate away from gridSize
|
|
690
690
|
Recommendation: Replace directly with 7px */
|
|
691
|
-
margin: ${"var(--ds-space-100, 8px)"} -${akLayoutGutterOffset + (fg('platform_editor_nested_dnd_styles_changes') ? 8 : 0)}px
|
|
692
|
-
0;
|
|
691
|
+
margin: ${"var(--ds-space-100, 8px)"} -${akLayoutGutterOffset + (fg('platform_editor_nested_dnd_styles_changes') ? 8 : 0)}px 0;
|
|
693
692
|
transition: border-color 0.3s ${akEditorSwoopCubicBezier};
|
|
694
693
|
cursor: pointer;
|
|
695
694
|
|
|
@@ -1293,6 +1292,13 @@ const fullPageEditorStyles = css({
|
|
|
1293
1292
|
},
|
|
1294
1293
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
1295
1294
|
scrollbarStyles);
|
|
1295
|
+
const listLayoutShiftFix = css({
|
|
1296
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
1297
|
+
'.ProseMirror ul, .ProseMirror ol': {
|
|
1298
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
1299
|
+
marginTop: '10px'
|
|
1300
|
+
}
|
|
1301
|
+
});
|
|
1296
1302
|
|
|
1297
1303
|
/**
|
|
1298
1304
|
* EditorContentStyles is a wrapper component that applies styles to its children
|
|
@@ -1329,7 +1335,7 @@ const EditorContentContainer = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
1329
1335
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
1330
1336
|
className: className,
|
|
1331
1337
|
ref: ref,
|
|
1332
|
-
css: [contentStyles(), layoutBaseStyles(), aiPanelBaseStyles, colorMode === 'dark' && aiPanelDarkStyles, viewMode === 'view' && layoutViewStyles, isComment && commentEditorStyles, isFullPage && fullPageEditorStyles],
|
|
1338
|
+
css: [contentStyles(), layoutBaseStyles(), aiPanelBaseStyles, colorMode === 'dark' && aiPanelDarkStyles, viewMode === 'view' && layoutViewStyles, isComment && commentEditorStyles, isFullPage && fullPageEditorStyles, fg('platform_editor_ssr_fix_lists') && listLayoutShiftFix],
|
|
1333
1339
|
"data-editor-scroll-container": isScrollable ? 'true' : undefined,
|
|
1334
1340
|
"data-testid": "editor-content-container",
|
|
1335
1341
|
style: {
|
|
@@ -70,33 +70,23 @@ export async function extensionProviderToQuickInsertProvider(extensionProvider,
|
|
|
70
70
|
isDisabledOffline: true,
|
|
71
71
|
action: (insert, state, source) => {
|
|
72
72
|
if (typeof item.node === 'function') {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
});
|
|
85
|
-
} else {
|
|
86
|
-
// Originally it was understood we could only use this if we were using the extension plugin
|
|
87
|
-
// However there are some edge cases where this is not true (ie. in jira)
|
|
88
|
-
// Since making it optional now would be a breaking change - instead we can just pass a dummy
|
|
89
|
-
// extension API to consumers that warns them of using the methods.
|
|
90
|
-
resolveImport(item.node(dummyExtensionAPI)).then(node => {
|
|
91
|
-
sendExtensionQuickInsertAnalytics(item, state.selection, createAnalyticsEvent, source);
|
|
92
|
-
if (node) {
|
|
93
|
-
editorActions.replaceSelection(node);
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
}
|
|
73
|
+
var _apiRef$current, _apiRef$current$exten, _apiRef$current$exten2;
|
|
74
|
+
const extensionAPI = apiRef === null || apiRef === void 0 ? void 0 : (_apiRef$current = apiRef.current) === null || _apiRef$current === void 0 ? void 0 : (_apiRef$current$exten = _apiRef$current.extension) === null || _apiRef$current$exten === void 0 ? void 0 : (_apiRef$current$exten2 = _apiRef$current$exten.actions) === null || _apiRef$current$exten2 === void 0 ? void 0 : _apiRef$current$exten2.api();
|
|
75
|
+
// While this should only run when the extension some setups of editor
|
|
76
|
+
// may not have the extension API
|
|
77
|
+
if (extensionAPI) {
|
|
78
|
+
resolveImport(item.node(extensionAPI)).then(node => {
|
|
79
|
+
sendExtensionQuickInsertAnalytics(item, state.selection, createAnalyticsEvent, source);
|
|
80
|
+
if (node) {
|
|
81
|
+
editorActions.replaceSelection(node);
|
|
82
|
+
}
|
|
83
|
+
});
|
|
97
84
|
} else {
|
|
98
|
-
//
|
|
99
|
-
|
|
85
|
+
// Originally it was understood we could only use this if we were using the extension plugin
|
|
86
|
+
// However there are some edge cases where this is not true (ie. in jira)
|
|
87
|
+
// Since making it optional now would be a breaking change - instead we can just pass a dummy
|
|
88
|
+
// extension API to consumers that warns them of using the methods.
|
|
89
|
+
resolveImport(item.node(dummyExtensionAPI)).then(node => {
|
|
100
90
|
sendExtensionQuickInsertAnalytics(item, state.selection, createAnalyticsEvent, source);
|
|
101
91
|
if (node) {
|
|
102
92
|
editorActions.replaceSelection(node);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "207.0.
|
|
2
|
+
export const version = "207.0.4";
|
|
@@ -166,6 +166,13 @@ var legacyContentStyles = function legacyContentStyles(props) {
|
|
|
166
166
|
exposure: false
|
|
167
167
|
}) && !fg('platform-visual-refresh-icons') && vanillaDecisionIconWithoutVisualRefresh, statusStyles, editorExperiment('platform_editor_vanilla_dom', true) ? vanillaStatusStyles() : null, annotationSharedStyles(), smartCardStyles(), fg('platform-linking-visual-refresh-v1') ? getSmartCardSharedStyles() : smartCardSharedStyles, editorExperiment('platform_editor_vanilla_dom', true) ? dateVanillaStyles : null, dateStyles, embedCardStyles(), unsupportedStyles, resizerStyles, aiPanelStyles(props.colorMode), fixBlockControlStylesSSR(), MediaSharedClassNames.FLOATING_TOOLBAR_COMPONENT, !fg('platform-visual-refresh-icons') ? css(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n\t\t\t\t.hyperlink-open-link {\n\t\t\t\t\tmin-width: 24px;\n\t\t\t\t\tsvg {\n\t\t\t\t\t\tmax-width: 18px;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t"]))) : null);
|
|
168
168
|
};
|
|
169
|
+
var listLayoutShiftFix = css({
|
|
170
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
171
|
+
'.ProseMirror ul, .ProseMirror ol': {
|
|
172
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
173
|
+
marginTop: '10px'
|
|
174
|
+
}
|
|
175
|
+
});
|
|
169
176
|
export var createEditorContentStyle = function createEditorContentStyle(styles) {
|
|
170
177
|
return /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
171
178
|
var className = props.className,
|
|
@@ -198,7 +205,7 @@ export var createEditorContentStyle = function createEditorContentStyle(styles)
|
|
|
198
205
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
199
206
|
className: className,
|
|
200
207
|
ref: ref,
|
|
201
|
-
css: [memoizedStyle, styles],
|
|
208
|
+
css: [memoizedStyle, styles, fg('platform_editor_ssr_fix_lists') && listLayoutShiftFix],
|
|
202
209
|
"data-testid": "editor-content-container"
|
|
203
210
|
}, children);
|
|
204
211
|
});
|
|
@@ -250,7 +250,7 @@ var layoutResponsiveViewStyles = css(_templateObject27 || (_templateObject27 = _
|
|
|
250
250
|
|
|
251
251
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
|
|
252
252
|
var layoutBaseStyles = function layoutBaseStyles() {
|
|
253
|
-
return css(_templateObject28 || (_templateObject28 = _taggedTemplateLiteral(["\n\t.ProseMirror {\n\t\t", "\n\t\t[data-layout-section] {\n\t\t\t/* Ignored via go/ees007\n\t\t\tTODO: Migrate away from gridSize\n\t\t\tRecommendation: Replace directly with 7px */\n\t\t\tmargin: ", " -", "px
|
|
253
|
+
return css(_templateObject28 || (_templateObject28 = _taggedTemplateLiteral(["\n\t.ProseMirror {\n\t\t", "\n\t\t[data-layout-section] {\n\t\t\t/* Ignored via go/ees007\n\t\t\tTODO: Migrate away from gridSize\n\t\t\tRecommendation: Replace directly with 7px */\n\t\t\tmargin: ", " -", "px 0;\n\t\t\ttransition: border-color 0.3s ", ";\n\t\t\tcursor: pointer;\n\n\t\t\t/* Inner cursor located 26px from left */\n\t\t\t[data-layout-column] {\n\t\t\t\tflex: 1;\n\t\t\t\tposition: relative;\n\n\t\t\t\tmin-width: 0;\n\t\t\t\t/* disable 4 borders when in view mode and advanced layouts is on */\n\t\t\t\tborder: ", "px\n\t\t\t\t\tsolid ", ";\n\t\t\t\tborder-radius: 4px;\n\t\t\t\tpadding: ", "px\n\t\t\t\t\t", "px;\n\t\t\t\tbox-sizing: border-box;\n\n\t\t\t\t> div {\n\t\t\t\t\t", "\n\n\t\t\t\t\t> .embedCardView-content-wrap:first-of-type .rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .mediaSingleView-content-wrap:first-of-type .rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .ProseMirror-gapcursor.-right:first-child\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> style:first-child\n\t\t\t\t\t\t+ .ProseMirror-gapcursor.-right\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> .ProseMirror-gapcursor.-right:first-of-type\n\t\t\t\t\t\t+ .embedCardView-content-wrap\n\t\t\t\t\t\t.rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .ProseMirror-gapcursor:first-child\n\t\t\t\t\t\t+ span\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> style:first-child\n\t\t\t\t\t\t+ .ProseMirror-gapcursor\n\t\t\t\t\t\t+ span\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t/* Prevent first DecisionWrapper's margin-top: 8px from shifting decisions down\n\t\t\t and shrinking layout's node selectable area (leniency margin) */\n\t\t\t\t\t> [data-node-type='decisionList'] {\n\t\t\t\t\t\tli:first-of-type [data-decision-wrapper] {\n\t\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/* Make the 'content' fill the entire height of the layout column to allow click\n\t\t handler of layout section nodeview to target only data-layout-column */\n\t\t\t\t[data-layout-content] {\n\t\t\t\t\theight: 100%;\n\t\t\t\t\tcursor: text;\n\t\t\t\t\t.mediaGroupView-content-wrap {\n\t\t\t\t\t\tclear: both;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t", "\n\t\t}\n\n\t\t/* styles to support borders for layout */\n\t\t[data-layout-section],\n\t\t.layoutSectionView-content-wrap {\n\t\t\t", "\n\t\t}\n\t}\n\n\t", "\n\n\t/* hide separator when element is dragging on top of a layout column */\n\t[data-blocks-drop-target-container] ~ [data-layout-column] > [data-layout-content]::before {\n\t\tdisplay: none;\n\t}\n\n\t.fabric-editor--full-width-mode .ProseMirror {\n\t\t[data-layout-section] {\n\t\t\t.", " {\n\t\t\t\tmargin: 0 ", "px;\n\t\t\t}\n\t\t}\n\t}\n\n\t", "\n"])), layoutSectionStyles(), "var(--ds-space-100, 8px)", akLayoutGutterOffset + (fg('platform_editor_nested_dnd_styles_changes') ? 8 : 0), akEditorSwoopCubicBezier, editorExperiment('advanced_layouts', true) ? 0 : akEditorSelectedBorderSize, "var(--ds-border, #091E4224)", LAYOUT_COLUMN_PADDING, LAYOUT_COLUMN_PADDING + (fg('platform_editor_nested_dnd_styles_changes') ? 8 : 0), firstNodeWithNotMarginTop(), layoutColumnStyles(), editorExperiment('advanced_layouts', true) ? layoutWithSeparatorBorderBaseStyles : layoutBorderBaseStyles, editorExperiment('advanced_layouts', true) && layoutResponsiveBaseStyles, TableCssClassName.TABLE_CONTAINER, tableMarginFullWidthMode, editorExperiment('advanced_layouts', false) && fg('platform_editor_nested_dnd_styles_changes') && ".ak-editor-content-area.appearance-full-page .ProseMirror [data-layout-section] {\n\t\t\t\tmargin: ".concat("var(--ds-space-100, 8px)", " -", akLayoutGutterOffset + 8, "px 0;\n\t\t\t\t}"));
|
|
254
254
|
};
|
|
255
255
|
|
|
256
256
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
|
|
@@ -398,6 +398,13 @@ var fullPageEditorStyles = css({
|
|
|
398
398
|
},
|
|
399
399
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
400
400
|
scrollbarStyles);
|
|
401
|
+
var listLayoutShiftFix = css({
|
|
402
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
403
|
+
'.ProseMirror ul, .ProseMirror ol': {
|
|
404
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
405
|
+
marginTop: '10px'
|
|
406
|
+
}
|
|
407
|
+
});
|
|
401
408
|
|
|
402
409
|
/**
|
|
403
410
|
* EditorContentStyles is a wrapper component that applies styles to its children
|
|
@@ -431,7 +438,7 @@ var EditorContentContainer = /*#__PURE__*/React.forwardRef(function (props, ref)
|
|
|
431
438
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
432
439
|
className: className,
|
|
433
440
|
ref: ref,
|
|
434
|
-
css: [contentStyles(), layoutBaseStyles(), aiPanelBaseStyles, colorMode === 'dark' && aiPanelDarkStyles, viewMode === 'view' && layoutViewStyles, isComment && commentEditorStyles, isFullPage && fullPageEditorStyles],
|
|
441
|
+
css: [contentStyles(), layoutBaseStyles(), aiPanelBaseStyles, colorMode === 'dark' && aiPanelDarkStyles, viewMode === 'view' && layoutViewStyles, isComment && commentEditorStyles, isFullPage && fullPageEditorStyles, fg('platform_editor_ssr_fix_lists') && listLayoutShiftFix],
|
|
435
442
|
"data-editor-scroll-container": isScrollable ? 'true' : undefined,
|
|
436
443
|
"data-testid": "editor-content-container",
|
|
437
444
|
style: {
|
|
@@ -104,33 +104,23 @@ function _extensionProviderToQuickInsertProvider() {
|
|
|
104
104
|
isDisabledOffline: true,
|
|
105
105
|
action: function action(insert, state, source) {
|
|
106
106
|
if (typeof item.node === 'function') {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
});
|
|
119
|
-
} else {
|
|
120
|
-
// Originally it was understood we could only use this if we were using the extension plugin
|
|
121
|
-
// However there are some edge cases where this is not true (ie. in jira)
|
|
122
|
-
// Since making it optional now would be a breaking change - instead we can just pass a dummy
|
|
123
|
-
// extension API to consumers that warns them of using the methods.
|
|
124
|
-
resolveImport(item.node(dummyExtensionAPI)).then(function (node) {
|
|
125
|
-
sendExtensionQuickInsertAnalytics(item, state.selection, createAnalyticsEvent, source);
|
|
126
|
-
if (node) {
|
|
127
|
-
editorActions.replaceSelection(node);
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
}
|
|
107
|
+
var _apiRef$current;
|
|
108
|
+
var extensionAPI = apiRef === null || apiRef === void 0 || (_apiRef$current = apiRef.current) === null || _apiRef$current === void 0 || (_apiRef$current = _apiRef$current.extension) === null || _apiRef$current === void 0 || (_apiRef$current = _apiRef$current.actions) === null || _apiRef$current === void 0 ? void 0 : _apiRef$current.api();
|
|
109
|
+
// While this should only run when the extension some setups of editor
|
|
110
|
+
// may not have the extension API
|
|
111
|
+
if (extensionAPI) {
|
|
112
|
+
resolveImport(item.node(extensionAPI)).then(function (node) {
|
|
113
|
+
sendExtensionQuickInsertAnalytics(item, state.selection, createAnalyticsEvent, source);
|
|
114
|
+
if (node) {
|
|
115
|
+
editorActions.replaceSelection(node);
|
|
116
|
+
}
|
|
117
|
+
});
|
|
131
118
|
} else {
|
|
132
|
-
//
|
|
133
|
-
|
|
119
|
+
// Originally it was understood we could only use this if we were using the extension plugin
|
|
120
|
+
// However there are some edge cases where this is not true (ie. in jira)
|
|
121
|
+
// Since making it optional now would be a breaking change - instead we can just pass a dummy
|
|
122
|
+
// extension API to consumers that warns them of using the methods.
|
|
123
|
+
resolveImport(item.node(dummyExtensionAPI)).then(function (node) {
|
|
134
124
|
sendExtensionQuickInsertAnalytics(item, state.selection, createAnalyticsEvent, source);
|
|
135
125
|
if (node) {
|
|
136
126
|
editorActions.replaceSelection(node);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export var name = "@atlaskit/editor-core";
|
|
2
|
-
export var version = "207.0.
|
|
2
|
+
export var version = "207.0.4";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "207.0.
|
|
3
|
+
"version": "207.0.4",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@atlaskit/analytics-next-stable-react-context": "1.0.1",
|
|
47
47
|
"@atlaskit/button": "^23.0.0",
|
|
48
48
|
"@atlaskit/css": "^0.10.0",
|
|
49
|
-
"@atlaskit/editor-common": "^105.
|
|
49
|
+
"@atlaskit/editor-common": "^105.5.0",
|
|
50
50
|
"@atlaskit/editor-json-transformer": "^8.24.0",
|
|
51
51
|
"@atlaskit/editor-performance-metrics": "^2.1.0",
|
|
52
52
|
"@atlaskit/editor-plugin-quick-insert": "^2.5.0",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"@atlaskit/analytics-listeners": "^9.0.0",
|
|
92
92
|
"@atlaskit/collab-provider": "^10.14.0",
|
|
93
93
|
"@atlaskit/editor-plugin-annotation": "^2.8.0",
|
|
94
|
-
"@atlaskit/editor-plugin-card": "^6.
|
|
94
|
+
"@atlaskit/editor-plugin-card": "^6.1.0",
|
|
95
95
|
"@atlaskit/editor-plugin-list": "^4.2.0",
|
|
96
96
|
"@atlaskit/editor-plugin-paste": "^3.3.0",
|
|
97
97
|
"@atlaskit/link-provider": "^3.0.0",
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
"@atlaskit/media-test-helpers": "^36.0.0",
|
|
102
102
|
"@atlaskit/modal-dialog": "^14.2.0",
|
|
103
103
|
"@atlaskit/primitives": "^14.7.0",
|
|
104
|
-
"@atlaskit/renderer": "^118.
|
|
104
|
+
"@atlaskit/renderer": "^118.1.0",
|
|
105
105
|
"@atlaskit/smart-card": "^38.1.0",
|
|
106
106
|
"@atlaskit/synchrony-test-helpers": "workspace:^",
|
|
107
107
|
"@atlaskit/toggle": "^15.0.0",
|
|
@@ -278,9 +278,6 @@
|
|
|
278
278
|
"platform_editor_disable_rerender_tracking_jira": {
|
|
279
279
|
"type": "boolean"
|
|
280
280
|
},
|
|
281
|
-
"platform_editor_add_extension_api_to_quick_insert": {
|
|
282
|
-
"type": "boolean"
|
|
283
|
-
},
|
|
284
281
|
"platform-component-visual-refresh": {
|
|
285
282
|
"type": "boolean",
|
|
286
283
|
"referenceOnly": true
|
|
@@ -666,6 +663,9 @@
|
|
|
666
663
|
},
|
|
667
664
|
"confluence_team_presence_scroll_to_pointer": {
|
|
668
665
|
"type": "boolean"
|
|
666
|
+
},
|
|
667
|
+
"platform_editor_ssr_fix_lists": {
|
|
668
|
+
"type": "boolean"
|
|
669
669
|
}
|
|
670
670
|
},
|
|
671
671
|
"stricter": {
|