Skip to content

Build your personal knowledge base with Trilium Notes

link previews: tweak the toolbar button

Adorian Doraneb4e6d074d13
diff --git a/apps/client/src/widgets/type_widgets/text/toolbar.ts b/apps/client/src/widgets/type_widgets/text/toolbar.ts
index 915b6a9887..b212652278 100644
--- a/apps/client/src/widgets/type_widgets/text/toolbar.ts
+++ b/apps/client/src/widgets/type_widgets/text/toolbar.ts
@@ -77,7 +77,7 @@ export function buildClassicToolbar(multilineToolbar: boolean) {
{
label: "Insert",
icon: "plus",
- items: ["link", "bookmark", "internallink", "includeNote", "linkEmbed", "|", "collapsible", "math", "mermaid", "horizontalLine", "pageBreak", "|", "dateTime", "specialCharacters", "emoji"]
+ items: ["link", "linkEmbed", "bookmark", "internallink", "includeNote", "|", "collapsible", "math", "mermaid", "horizontalLine", "pageBreak", "|", "dateTime", "specialCharacters", "emoji"]
},
"|",
buildAlignmentToolbar(),
@@ -137,7 +137,7 @@ export function buildFloatingToolbar() {
{
label: "Insert",
icon: "plus",
- items: ["link", "bookmark", "internallink", "includeNote", "linkEmbed", "|", "collapsible", "math", "mermaid", "horizontalLine", "pageBreak", "dateTime"]
+ items: ["link", "linkEmbed", "bookmark", "internallink", "includeNote", "|", "collapsible", "math", "mermaid", "horizontalLine", "pageBreak", "dateTime"]
},
"|",
buildAlignmentToolbar(),
diff --git a/packages/ckeditor5/src/icons/link-embed.svg b/packages/ckeditor5/src/icons/link-embed.svg
deleted file mode 100644
index fccfa49ea9..0000000000
--- a/packages/ckeditor5/src/icons/link-embed.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M3 3h14a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm0 1v12h14V4H3zm2 2h4v4H5V6zm5 1h5v1h-5V7zm0 2h4v1h-4V9zm-5 3h10v1H5v-1z"/></svg>
diff --git a/packages/ckeditor5/src/icons/link-preview.svg b/packages/ckeditor5/src/icons/link-preview.svg
new file mode 100644
index 0000000000..f8ba8ac2f4
--- /dev/null
+++ b/packages/ckeditor5/src/icons/link-preview.svg
@@ -0,0 +1 @@
+<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><rect x="1.1" y="1.1" width="17.8" height="17.8" rx="3.5" fill="none" stroke="currentColor" stroke-width="1.2"/><g transform="translate(3 3) scale(0.7)"><path d="m11.077 15 .991-1.416a.75.75 0 1 1 1.229.86l-1.148 1.64a.8.8 0 0 1-.217.206 5.251 5.251 0 0 1-8.503-5.955.7.7 0 0 1 .12-.274l1.147-1.639a.75.75 0 1 1 1.228.86L4.933 10.7l.006.003a3.75 3.75 0 0 0 6.132 4.294zm5.494-5.335a.8.8 0 0 1-.12.274l-1.147 1.639a.75.75 0 1 1-1.228-.86l.86-1.23a3.75 3.75 0 0 0-6.144-4.301l-.86 1.229a.75.75 0 0 1-1.229-.86l1.148-1.64a.8.8 0 0 1 .217-.206 5.251 5.251 0 0 1 8.503 5.955m-4.563-2.532a.75.75 0 0 1 .184 1.045l-3.155 4.505a.75.75 0 1 1-1.229-.86l3.155-4.506a.75.75 0 0 1 1.045-.184"/></g></svg>
diff --git a/packages/ckeditor5/src/plugins/linkembed.ts b/packages/ckeditor5/src/plugins/linkembed.ts
index 132615a0ad..b312988b71 100644
--- a/packages/ckeditor5/src/plugins/linkembed.ts
+++ b/packages/ckeditor5/src/plugins/linkembed.ts
@@ -1,6 +1,6 @@
import { type BlockChildLike, chooseLinkPreviewKind, isHttpUrl, isUrlAloneInBlock } from '@triliumnext/commons';
import { ButtonView, clickOutsideHandler, Command, ContextualBalloon, Plugin, toWidget, viewToModelPositionOutsideModelElement, Widget, type Editor, type Observable } from 'ckeditor5';
-import linkEmbedIcon from '../icons/link-embed.svg?raw';
+import linkPreviewIcon from '../icons/link-preview.svg?raw';
import LinkEmbedFormView from './link_embed_form.js';
import { translate } from './translate.js';
import { preventCKEditorHandling } from './widget_utils.js';
@@ -49,7 +49,7 @@ class LinkEmbedUI extends Plugin {
buttonView.set({
label: editor.t('Link preview'),
- icon: linkEmbedIcon,
+ icon: linkPreviewIcon,
tooltip: true
});