@atlaskit/editor-core 209.0.1 → 209.0.2
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/create-editor/ReactEditorView.js +12 -1
- package/dist/cjs/ui/EditorContentContainer/styles/extensionStyles.js +10 -0
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/create-editor/ReactEditorView.js +12 -1
- package/dist/es2019/ui/EditorContentContainer/styles/extensionStyles.js +10 -0
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/create-editor/ReactEditorView.js +12 -1
- package/dist/esm/ui/EditorContentContainer/styles/extensionStyles.js +10 -0
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/composable-editor/editor-internal.d.ts +1 -0
- package/dist/types/create-editor/ReactEditorView/useDispatchTransaction.d.ts +1 -1
- package/dist/types/create-editor/create-universal-preset.d.ts +919 -75
- package/dist/types/create-editor/editorStateNotificationPlugin.d.ts +2 -2
- package/dist/types/create-editor/get-ui-component.d.ts +1 -0
- package/dist/types/presets/universal.d.ts +924 -75
- package/dist/types/presets/useUniversalPreset.d.ts +919 -75
- package/dist/types/test-utils.d.ts +1 -1
- package/dist/types/types/with-appearance-component.d.ts +1 -0
- package/dist/types/ui/Addon/types.d.ts +1 -0
- package/dist/types/ui/Appearance/Chromeless.d.ts +7 -7
- package/dist/types/ui/Appearance/FullPage/FullPageContentArea.d.ts +7 -7
- package/dist/types/ui/Appearance/FullPage/getEditorViewModeSync.d.ts +1 -1
- package/dist/types/ui/CollapsedEditor/index.d.ts +1 -1
- package/dist/types/ui/ContentStyles/ai-panels.d.ts +1 -1
- package/dist/types/ui/ContentStyles/layout.d.ts +1 -1
- package/dist/types/ui/IntlProviderIfMissingWrapper/IntlProviderIfMissingWrapper.d.ts +1 -0
- package/dist/types/ui/Toolbar/Toolbar.d.ts +1 -0
- package/dist/types/utils/is-full-page.d.ts +1 -1
- package/dist/types/utils/prepare-extension-provider.d.ts +1 -1
- package/dist/types/utils/prepare-quick-insert-provider.d.ts +1 -0
- package/dist/types-ts4.5/composable-editor/editor-internal.d.ts +1 -0
- package/dist/types-ts4.5/create-editor/ReactEditorView/useDispatchTransaction.d.ts +1 -1
- package/dist/types-ts4.5/create-editor/create-universal-preset.d.ts +1072 -100
- package/dist/types-ts4.5/create-editor/editorStateNotificationPlugin.d.ts +2 -2
- package/dist/types-ts4.5/create-editor/get-ui-component.d.ts +1 -0
- package/dist/types-ts4.5/presets/universal.d.ts +1077 -100
- package/dist/types-ts4.5/presets/useUniversalPreset.d.ts +1072 -100
- package/dist/types-ts4.5/test-utils.d.ts +1 -1
- package/dist/types-ts4.5/types/with-appearance-component.d.ts +1 -0
- package/dist/types-ts4.5/ui/Addon/types.d.ts +1 -0
- package/dist/types-ts4.5/ui/Appearance/Chromeless.d.ts +7 -7
- package/dist/types-ts4.5/ui/Appearance/FullPage/FullPageContentArea.d.ts +7 -7
- package/dist/types-ts4.5/ui/Appearance/FullPage/getEditorViewModeSync.d.ts +1 -1
- package/dist/types-ts4.5/ui/CollapsedEditor/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/ContentStyles/ai-panels.d.ts +1 -1
- package/dist/types-ts4.5/ui/ContentStyles/layout.d.ts +1 -1
- package/dist/types-ts4.5/ui/IntlProviderIfMissingWrapper/IntlProviderIfMissingWrapper.d.ts +1 -0
- package/dist/types-ts4.5/ui/Toolbar/Toolbar.d.ts +1 -0
- package/dist/types-ts4.5/utils/is-full-page.d.ts +1 -1
- package/dist/types-ts4.5/utils/prepare-extension-provider.d.ts +1 -1
- package/dist/types-ts4.5/utils/prepare-quick-insert-provider.d.ts +1 -0
- package/package.json +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 209.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#181802](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/181802)
|
|
8
|
+
[`4f35336716da7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4f35336716da7) -
|
|
9
|
+
EDITOR-921 Prevent calls to scrollTop calculation for editors nested in LCE
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 209.0.1
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -479,7 +479,18 @@ function ReactEditorView(props) {
|
|
|
479
479
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
480
480
|
editorView = _useState4[0],
|
|
481
481
|
setEditorView = _useState4[1];
|
|
482
|
-
|
|
482
|
+
|
|
483
|
+
// Detects if the editor is nested inside an extension - ie. it is a Legacy Content Extension (LCE)
|
|
484
|
+
var isNestedEditor = (0, _react.useRef)(null);
|
|
485
|
+
var isNestedEditorCalculated = (0, _react.useRef)(false);
|
|
486
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_lce_scrolltop_mitigation')) {
|
|
487
|
+
if (editorRef.current !== null && !isNestedEditorCalculated.current) {
|
|
488
|
+
var _editorRef$current;
|
|
489
|
+
isNestedEditor.current = !!((_editorRef$current = editorRef.current) !== null && _editorRef$current !== void 0 && _editorRef$current.closest('.extension-editable-area'));
|
|
490
|
+
isNestedEditorCalculated.current = true;
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
var originalScrollToRestore = _react.default.useRef(!isNestedEditor.current && (0, _isFullPage.isFullPage)(props.editorProps.appearance) && (0, _platformFeatureFlags.fg)('platform_editor_reduce_scroll_jump_on_editor_start') ? (_document$querySelect = document.querySelector('[data-editor-scroll-container]')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.scrollTop : undefined);
|
|
483
494
|
var mitigateScrollJump =
|
|
484
495
|
// The feature gate here is being used to avoid potential bugs with the scroll restoration code
|
|
485
496
|
// moving it to the end of the expression negates the point of the feature gate
|
|
@@ -240,6 +240,16 @@ var extensionStyles = exports.extensionStyles = (0, _react.css)({
|
|
|
240
240
|
'&.danger > span > div > .extension-label > span': {
|
|
241
241
|
display: 'inline'
|
|
242
242
|
},
|
|
243
|
+
/** Targets legacy content header in LCM extension */
|
|
244
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
245
|
+
'&.danger > span > .legacy-content-header': {
|
|
246
|
+
boxShadow: "0 0 0 1px ".concat("var(--ds-border-danger, #E2483D)"),
|
|
247
|
+
backgroundColor: "var(--ds-background-danger, #FFECEB)",
|
|
248
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
249
|
+
'& .status-lozenge-span > span': {
|
|
250
|
+
backgroundColor: "var(--ds-background-accent-red-subtle-hovered, #FD9891)"
|
|
251
|
+
}
|
|
252
|
+
},
|
|
243
253
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
244
254
|
'&:not(.danger).ak-editor-selected-node > span > div .extension-label > span': {
|
|
245
255
|
display: 'inline'
|
|
@@ -446,7 +446,18 @@ export function ReactEditorView(props) {
|
|
|
446
446
|
return view;
|
|
447
447
|
}, [getDirectEditorProps, dispatchAnalyticsEvent]);
|
|
448
448
|
const [editorView, setEditorView] = useState(undefined);
|
|
449
|
-
|
|
449
|
+
|
|
450
|
+
// Detects if the editor is nested inside an extension - ie. it is a Legacy Content Extension (LCE)
|
|
451
|
+
const isNestedEditor = useRef(null);
|
|
452
|
+
const isNestedEditorCalculated = useRef(false);
|
|
453
|
+
if (fg('platform_editor_lce_scrolltop_mitigation')) {
|
|
454
|
+
if (editorRef.current !== null && !isNestedEditorCalculated.current) {
|
|
455
|
+
var _editorRef$current;
|
|
456
|
+
isNestedEditor.current = !!((_editorRef$current = editorRef.current) !== null && _editorRef$current !== void 0 && _editorRef$current.closest('.extension-editable-area'));
|
|
457
|
+
isNestedEditorCalculated.current = true;
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
const originalScrollToRestore = React.useRef(!isNestedEditor.current && isFullPage(props.editorProps.appearance) && fg('platform_editor_reduce_scroll_jump_on_editor_start') ? (_document$querySelect = document.querySelector('[data-editor-scroll-container]')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.scrollTop : undefined);
|
|
450
461
|
const mitigateScrollJump =
|
|
451
462
|
// The feature gate here is being used to avoid potential bugs with the scroll restoration code
|
|
452
463
|
// moving it to the end of the expression negates the point of the feature gate
|
|
@@ -234,6 +234,16 @@ export const extensionStyles = css({
|
|
|
234
234
|
'&.danger > span > div > .extension-label > span': {
|
|
235
235
|
display: 'inline'
|
|
236
236
|
},
|
|
237
|
+
/** Targets legacy content header in LCM extension */
|
|
238
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
239
|
+
'&.danger > span > .legacy-content-header': {
|
|
240
|
+
boxShadow: `0 0 0 1px ${"var(--ds-border-danger, #E2483D)"}`,
|
|
241
|
+
backgroundColor: `${"var(--ds-background-danger, #FFECEB)"}`,
|
|
242
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
243
|
+
'& .status-lozenge-span > span': {
|
|
244
|
+
backgroundColor: `${"var(--ds-background-accent-red-subtle-hovered, #FD9891)"}`
|
|
245
|
+
}
|
|
246
|
+
},
|
|
237
247
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
238
248
|
'&:not(.danger).ak-editor-selected-node > span > div .extension-label > span': {
|
|
239
249
|
display: 'inline'
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "209.0.
|
|
2
|
+
export const version = "209.0.1";
|
|
@@ -469,7 +469,18 @@ export function ReactEditorView(props) {
|
|
|
469
469
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
470
470
|
editorView = _useState4[0],
|
|
471
471
|
setEditorView = _useState4[1];
|
|
472
|
-
|
|
472
|
+
|
|
473
|
+
// Detects if the editor is nested inside an extension - ie. it is a Legacy Content Extension (LCE)
|
|
474
|
+
var isNestedEditor = useRef(null);
|
|
475
|
+
var isNestedEditorCalculated = useRef(false);
|
|
476
|
+
if (fg('platform_editor_lce_scrolltop_mitigation')) {
|
|
477
|
+
if (editorRef.current !== null && !isNestedEditorCalculated.current) {
|
|
478
|
+
var _editorRef$current;
|
|
479
|
+
isNestedEditor.current = !!((_editorRef$current = editorRef.current) !== null && _editorRef$current !== void 0 && _editorRef$current.closest('.extension-editable-area'));
|
|
480
|
+
isNestedEditorCalculated.current = true;
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
var originalScrollToRestore = React.useRef(!isNestedEditor.current && isFullPage(props.editorProps.appearance) && fg('platform_editor_reduce_scroll_jump_on_editor_start') ? (_document$querySelect = document.querySelector('[data-editor-scroll-container]')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.scrollTop : undefined);
|
|
473
484
|
var mitigateScrollJump =
|
|
474
485
|
// The feature gate here is being used to avoid potential bugs with the scroll restoration code
|
|
475
486
|
// moving it to the end of the expression negates the point of the feature gate
|
|
@@ -234,6 +234,16 @@ export var extensionStyles = css({
|
|
|
234
234
|
'&.danger > span > div > .extension-label > span': {
|
|
235
235
|
display: 'inline'
|
|
236
236
|
},
|
|
237
|
+
/** Targets legacy content header in LCM extension */
|
|
238
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
239
|
+
'&.danger > span > .legacy-content-header': {
|
|
240
|
+
boxShadow: "0 0 0 1px ".concat("var(--ds-border-danger, #E2483D)"),
|
|
241
|
+
backgroundColor: "var(--ds-background-danger, #FFECEB)",
|
|
242
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
243
|
+
'& .status-lozenge-span > span': {
|
|
244
|
+
backgroundColor: "var(--ds-background-accent-red-subtle-hovered, #FD9891)"
|
|
245
|
+
}
|
|
246
|
+
},
|
|
237
247
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
238
248
|
'&:not(.danger).ak-editor-selected-node > span > div .extension-label > span': {
|
|
239
249
|
display: 'inline'
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export var name = "@atlaskit/editor-core";
|
|
2
|
-
export var version = "209.0.
|
|
2
|
+
export var version = "209.0.1";
|
|
@@ -8,6 +8,6 @@ export declare const useDispatchTransaction: ({ onChange, dispatchAnalyticsEvent
|
|
|
8
8
|
onChange: EditorOnChangeHandler | undefined;
|
|
9
9
|
dispatchAnalyticsEvent: (payload: AnalyticsEventPayload) => void;
|
|
10
10
|
onEditorViewUpdated: (params: EditorViewStateUpdatedCallbackProps) => void;
|
|
11
|
-
isRemoteReplaceDocumentTransaction?: (tr: Transaction) => boolean;
|
|
11
|
+
isRemoteReplaceDocumentTransaction?: ((tr: Transaction) => boolean) | undefined;
|
|
12
12
|
}) => DispatchTransaction;
|
|
13
13
|
export {};
|