From dba688253218505a11928e8b4e352b1aee22cb7b Mon Sep 17 00:00:00 2001 From: Mateusz Baginski Date: Thu, 5 Dec 2024 09:20:53 +0100 Subject: [PATCH] Fix deps --- packages/ckeditor5-bookmark/package.json | 4 ++-- packages/ckeditor5-bookmark/src/bookmarkui.ts | 2 +- packages/ckeditor5-link/package.json | 1 - packages/ckeditor5-link/src/linkui.ts | 3 ++- packages/ckeditor5-link/src/utils.ts | 12 +----------- 5 files changed, 6 insertions(+), 16 deletions(-) diff --git a/packages/ckeditor5-bookmark/package.json b/packages/ckeditor5-bookmark/package.json index 2db171b791b..71aaf009772 100644 --- a/packages/ckeditor5-bookmark/package.json +++ b/packages/ckeditor5-bookmark/package.json @@ -17,8 +17,7 @@ "@ckeditor/ckeditor5-core": "43.3.1", "@ckeditor/ckeditor5-widget": "43.3.1", "@ckeditor/ckeditor5-utils": "43.3.1", - "@ckeditor/ckeditor5-ui": "43.3.1", - "@ckeditor/ckeditor5-link": "43.3.1" + "@ckeditor/ckeditor5-ui": "43.3.1" }, "devDependencies": { "@ckeditor/ckeditor5-basic-styles": "43.3.1", @@ -27,6 +26,7 @@ "@ckeditor/ckeditor5-code-block": "43.3.1", "@ckeditor/ckeditor5-dev-utils": "^45.0.0", "@ckeditor/ckeditor5-easy-image": "43.3.1", + "@ckeditor/ckeditor5-link": "43.3.1", "@ckeditor/ckeditor5-editor-classic": "43.3.1", "@ckeditor/ckeditor5-editor-multi-root": "43.3.1", "@ckeditor/ckeditor5-engine": "43.3.1", diff --git a/packages/ckeditor5-bookmark/src/bookmarkui.ts b/packages/ckeditor5-bookmark/src/bookmarkui.ts index f063f327855..cc83db02edc 100644 --- a/packages/ckeditor5-bookmark/src/bookmarkui.ts +++ b/packages/ckeditor5-bookmark/src/bookmarkui.ts @@ -241,7 +241,7 @@ export default class BookmarkUI extends Plugin { const { plugins } = this.editor; const t = this.editor.locale.t; - const linksUI = plugins.get( LinkUI ); + const linksUI = plugins.get( LinkUI )!; const bookmarkEditing = plugins.get( BookmarkEditing ); const getItems = () => diff --git a/packages/ckeditor5-link/package.json b/packages/ckeditor5-link/package.json index bdfcd4bdae7..7a6156be915 100644 --- a/packages/ckeditor5-link/package.json +++ b/packages/ckeditor5-link/package.json @@ -26,7 +26,6 @@ "devDependencies": { "@ckeditor/ckeditor5-basic-styles": "43.3.1", "@ckeditor/ckeditor5-block-quote": "43.3.1", - "@ckeditor/ckeditor5-bookmark": "0.0.1", "@ckeditor/ckeditor5-cloud-services": "43.3.1", "@ckeditor/ckeditor5-code-block": "43.3.1", "@ckeditor/ckeditor5-dev-utils": "^45.0.0", diff --git a/packages/ckeditor5-link/src/linkui.ts b/packages/ckeditor5-link/src/linkui.ts index 1310d9a8caf..cf54bc866f4 100644 --- a/packages/ckeditor5-link/src/linkui.ts +++ b/packages/ckeditor5-link/src/linkui.ts @@ -35,6 +35,8 @@ import LinkFormView, { type LinkFormValidatorCallback } from './ui/linkformview. import LinkProviderItemsView from './ui/linkprovideritemsview.js'; import LinkPropertiesView from './ui/linkpropertiesview.js'; import LinkButtonView from './ui/linkbuttonview.js'; +import LinkEditing from './linkediting.js'; + import type LinkCommand from './linkcommand.js'; import type UnlinkCommand from './unlinkcommand.js'; @@ -52,7 +54,6 @@ import linkIcon from '../theme/icons/link.svg'; import unlinkIcon from '../theme/icons/unlink.svg'; import '../theme/linktoolbar.css'; -import LinkEditing from './linkediting.js'; const VISUAL_SELECTION_MARKER_NAME = 'link-ui'; diff --git a/packages/ckeditor5-link/src/utils.ts b/packages/ckeditor5-link/src/utils.ts index 7da136106bd..036b84853e1 100644 --- a/packages/ckeditor5-link/src/utils.ts +++ b/packages/ckeditor5-link/src/utils.ts @@ -21,7 +21,6 @@ import type { import type { Editor } from 'ckeditor5/src/core.js'; import type { LocaleTranslate } from 'ckeditor5/src/utils.js'; -import type { BookmarkEditing } from '@ckeditor/ckeditor5-bookmark'; import type { LinkDecoratorAutomaticDefinition, @@ -210,9 +209,7 @@ export function isScrollableToTarget( editor: Editor, link: string | undefined ) return false; } - const bookmarkEditing: BookmarkEditing = editor.plugins.get( 'BookmarkEditing' ); - - return !!bookmarkEditing.getElementForBookmarkId( link.slice( 1 ) ); + return true; } /** @@ -223,13 +220,6 @@ export function scrollToTarget( editor: Editor, link: string ): boolean { return false; } - const bookmarkEditing: BookmarkEditing = editor.plugins.get( 'BookmarkEditing' )!; - const modelBookmark = bookmarkEditing.getElementForBookmarkId( link.slice( 1 ) ); - - editor.model.change( writer => { - writer.setSelection( modelBookmark!, 'on' ); - } ); - editor.editing.view.scrollToTheSelection( { alignToTop: true, forceScroll: true