Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
client/text editor/tabs: add support for displaying tabs at the bottom
Adorian Doran5a19cf578807
diff --git a/apps/client/src/fonts/text-editor-icons.woff2 b/apps/client/src/fonts/text-editor-icons.woff2index efc3384f26..81b23b1766 100644Binary files a/apps/client/src/fonts/text-editor-icons.woff2 and b/apps/client/src/fonts/text-editor-icons.woff2 differdiff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.jsonindex cdec9fd4bb..3553e52691 100644--- a/apps/client/src/translations/en/translation.json+++ b/apps/client/src/translations/en/translation.json@@ -4433,6 +4433,9 @@"move-tab-right": "Move tab right","copy-link-to-tab": "Copy link to tab","tabs-toolbar": "Tabs toolbar",+ "tab-alignment": "Tab alignment",+ "align-tabs-at-top": "Align tabs at top",+ "align-tabs-at-bottom": "Align tabs at bottom","insert-titled-tabs-that-show-one-panel-at-a-time": "Insert titled tabs that show one panel at a time.","multicolumn-layout": "Multicolumn layout","multicolumn-layout-toolbar": "Multicolumn layout toolbar",diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text/Content tabs.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text/Content tabs.htmlindex 3045fbebd2..3bd0b4f0b7 100644--- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text/Content tabs.html+++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text/Content tabs.html@@ -4,10 +4,11 @@in several programming languages).</p><p>A tabs block consists of:</p><ul>- <li><strong>A row of tab titles.</strong> The title of the panel that is showing+ <li><strong>A row of tab titles</strong>, above the panel or, when the tabs+ are aligned at the bottom, below it. The title of the panel that is showingis highlighted.</li>- <li><strong>The panel of the active tab</strong>, below the titles. A panel- can hold any kind of content (including nested tabs blocks).</li>+ <li><strong>The panel of the active tab.</strong> A panel can hold any kind+ of content (including nested tabs blocks).</li></ul><h2>Inserting a tabs block</h2><ul>@@ -27,15 +28,18 @@<p>While the cursor is inside a tabs block, a toolbar appears above it withthe following buttons:</p><ul>- <li><span class="tn-icon cke cke-plus"></span><em> (Add tab)</em> inserts+ <li><span class="tn-icon cke cke-plus"></span> <em>(Add tab)</em> insertsa tab after the current one and selects its title.</li>- <li><span class="tn-icon cke cke-remove"></span><em> (Remove tab)</em> removes+ <li><span class="tn-icon cke cke-remove"></span> <em>(Remove tab)</em> removesthe current tab. Removing the last tab removes the whole block.</li>- <li><span class="tn-icon cke cke-chevron-right bx-flip-horizontal"></span><em> (Move tab left)</em> and <span+ <li><span class="tn-icon cke cke-chevron-right bx-flip-horizontal"></span> <em>(Move tab left)</em> and <spanclass="tn-icon cke cke-chevron-right"></span> (<em>Move tab right)</em> changethe order of the tabs.</li>- <li><span class="tn-icon cke cke-link"></span><em> (Copy link to tab)</em> copies+ <li><span class="tn-icon cke cke-link"></span> <em>(Copy link to tab)</em> copiesa link to the current tab, as described below.</li>+ <li><span class="tn-icon cke cke-trilium-tabs"></span> <em>(Tab alignment)</em> places+ the tab titles above the panel (<em>Align tabs at top</em>, the default)+ or below it (<em>Align tabs at bottom</em>).</li></ul><p>The tab that is showing is not saved with the note: every tabs block openson its first tab.</p>@@ -86,12 +90,13 @@<ul><li>When printing or <a href="#root/_help_NRnIZmSMc5sj">exporting to PDF</a>,every tab is printed, one after another, each with its title above its- panel.</li>+ panel, whatever the tab alignment.</li><li>Markdown export and import write tabs blocks in the content tabs syntaxof Material for MkDocs, described in <a class="reference-link" href="#root/_help_rJ9grSgoExl9">Supported syntax</a>. <aclass="reference-link" href="#root/_help_6RM1Q7ppFVoj">Markdown</a> notesuse the same syntax, show the blocks as tabs in their preview and insert- them with <code>/tabs</code>.</li>+ them with <code>/tabs</code>. That syntax has no tab alignment, so tabs+ aligned at the bottom are exported as regular tabs.</li><li>Anywhere the tabs cannot work as tabs (such as an HTML export opened elsewhere),a tabs block reads as a sequence of titled sections.</li></ul>\ No newline at end of filediff --git a/docs/User Guide/User Guide/Note Types/Text/Content tabs.md b/docs/User Guide/User Guide/Note Types/Text/Content tabs.mdindex b401eb133e..e36a45d77e 100644--- a/docs/User Guide/User Guide/Note Types/Text/Content tabs.md+++ b/docs/User Guide/User Guide/Note Types/Text/Content tabs.md@@ -3,8 +3,8 @@ Content tabs group several titled panels of content into one block that shows aA tabs block consists of:-* **A row of tab titles.** The title of the panel that is showing is highlighted.-* **The panel of the active tab**, below the titles. A panel can hold any kind of content (including nested tabs blocks).+* **A row of tab titles**, above the panel or, when the tabs are aligned at the bottom, below it. The title of the panel that is showing is highlighted.+* **The panel of the active tab.** A panel can hold any kind of content (including nested tabs blocks).## Inserting a tabs block@@ -25,6 +25,7 @@ While the cursor is inside a tabs block, a toolbar appears above it with the fol* <span class="tn-icon cke cke-remove"></span> _(Remove tab)_ removes the current tab. Removing the last tab removes the whole block.* <span class="tn-icon cke cke-chevron-right bx-flip-horizontal"></span> _(Move tab left)_ and <span class="tn-icon cke cke-chevron-right"></span> (_Move tab right)_ change the order of the tabs.* <span class="tn-icon cke cke-link"></span> _(Copy link to tab)_ copies a link to the current tab, as described below.+* <span class="tn-icon cke cke-trilium-tabs"></span> _(Tab alignment)_ places the tab titles above the panel (_Align tabs at top_, the default) or below it (_Align tabs at bottom_).The tab that is showing is not saved with the note: every tabs block opens on its first tab.@@ -62,6 +63,6 @@ Tab titles are not headings, so they do not appear in the table of contents; hea## Printing and exporting-* When printing or [exporting to PDF](../../Basic%20Concepts%20and%20Features/Notes/Printing%20%26%20Exporting%20as%20PDF.md), every tab is printed, one after another, each with its title above its panel.-* Markdown export and import write tabs blocks in the content tabs syntax of Material for MkDocs, described in <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/Import%20%26%20Export/Markdown/Supported%20syntax.md">Supported syntax</a>. <a class="reference-link" href="../Markdown.md">Markdown</a> notes use the same syntax, show the blocks as tabs in their preview and insert them with `/tabs`.+* When printing or [exporting to PDF](../../Basic%20Concepts%20and%20Features/Notes/Printing%20%26%20Exporting%20as%20PDF.md), every tab is printed, one after another, each with its title above its panel, whatever the tab alignment.+* Markdown export and import write tabs blocks in the content tabs syntax of Material for MkDocs, described in <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/Import%20%26%20Export/Markdown/Supported%20syntax.md">Supported syntax</a>. <a class="reference-link" href="../Markdown.md">Markdown</a> notes use the same syntax, show the blocks as tabs in their preview and insert them with `/tabs`. That syntax has no tab alignment, so tabs aligned at the bottom are exported as regular tabs.* Anywhere the tabs cannot work as tabs (such as an HTML export opened elsewhere), a tabs block reads as a sequence of titled sections.\ No newline at end of filediff --git a/packages/ckeditor5/src/icons/tabs-bottom.svg b/packages/ckeditor5/src/icons/tabs-bottom.svgnew file mode 100644index 0000000000..589f87bac4--- /dev/null+++ b/packages/ckeditor5/src/icons/tabs-bottom.svg@@ -0,0 +1,5 @@+<?xml version="1.0" encoding="UTF-8"?>+<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">+ <path d="M2.6 5.2v11.2c0 .55.45 1 1 1h4.2c.55 0 1-.45 1-1v-2.2h7.6c.55 0 1-.45 1-1v-8c0-.55-.45-1-1-1H3.6c-.55 0-1 .45-1 1Z" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linejoin="round"/>+ <path d="M8.8 14.2v2.2c0 .55.45 1 1 1h3.6c.55 0 1-.45 1-1v-2.2" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linejoin="round"/>+</svg>diff --git a/packages/ckeditor5/src/plugins/tabs/constants.ts b/packages/ckeditor5/src/plugins/tabs/constants.tsindex edef6a74f0..9da117b74c 100644--- a/packages/ckeditor5/src/plugins/tabs/constants.ts+++ b/packages/ckeditor5/src/plugins/tabs/constants.ts@@ -17,3 +17,17 @@ export const CLASSES = {/** Custom property that marks the editing-view widget element of a tabs block. */export const TABS_WIDGET_PROPERTY = "tabsWidget";++/** Model attribute with the side of the panels that the titles of a tabs block sit on. */+export const ALIGNMENT_ATTRIBUTE = "tabAlignment";+export const ALIGNMENT_DATA_ATTRIBUTE = "data-trilium-tab-alignment";++/** The sides the titles can sit on. A block without the attribute uses the first one. */+export const TAB_ALIGNMENTS = ["top", "bottom"] as const;+export type TabAlignment = typeof TAB_ALIGNMENTS[number];+export const DEFAULT_TAB_ALIGNMENT: TabAlignment = TAB_ALIGNMENTS[0];++/** Returns `value` when it names a tab alignment, or `null` otherwise. */+export function parseTabAlignment(value: unknown): TabAlignment | null {+ return TAB_ALIGNMENTS.find(alignment => alignment === value) ?? null;+}diff --git a/packages/ckeditor5/src/plugins/tabs/tabs.spec.ts b/packages/ckeditor5/src/plugins/tabs/tabs.spec.tsindex a7bba6c8dd..321adac2af 100644--- a/packages/ckeditor5/src/plugins/tabs/tabs.spec.ts+++ b/packages/ckeditor5/src/plugins/tabs/tabs.spec.ts@@ -68,6 +68,25 @@ describe("Tabs", () => {expect(editor.getData()).toBe(TWO_TABS);});+ it("round-trips the bottom alignment and drops the default or an unknown one", () => {+ const aligned = (value: string) => TWO_TABS.replace(+ "<div class=\"trilium-tabs\">",+ `<div class="trilium-tabs" data-trilium-tab-alignment="${value}">`+ );+ editor.setData(aligned("bottom"));++ expect(model()).toMatch(/^<tabs tabAlignment="bottom"><tab>/);+ expect(editor.getData()).toBe(aligned("bottom"));+ const widget = editor.editing.view.getDomRoot()?.querySelector(".trilium-tabs");+ expect(widget?.getAttribute("data-trilium-tab-alignment")).toBe("bottom");++ for (const value of ["top", "left", ""]) {+ editor.setData(aligned(value));+ expect(model(), value).toMatch(/^<tabs><tab>/);+ expect(editor.getData(), value).toBe(TWO_TABS);+ }+ });+it("inserts two numbered tabs and selects the first title", () => {setModelData(editor.model, "<paragraph>[]</paragraph>");diff --git a/packages/ckeditor5/src/plugins/tabs/tabs.ts b/packages/ckeditor5/src/plugins/tabs/tabs.tsindex 027fba5822..e985052383 100644--- a/packages/ckeditor5/src/plugins/tabs/tabs.ts+++ b/packages/ckeditor5/src/plugins/tabs/tabs.ts@@ -2,7 +2,8 @@ import { Plugin } from "ckeditor5";import "../../theme/tabs.css";import type {- AssignTabReferenceCommand, InsertTabCommand, InsertTabsCommand, MoveTabCommand, RemoveTabCommand+ AssignTabReferenceCommand, InsertTabCommand, InsertTabsCommand, MoveTabCommand,+ RemoveTabCommand, TabAlignmentCommand} from "./tabs_commands.js";import TabsEditing from "./tabs_editing.js";import TabsUI from "./tabs_ui.js";@@ -38,5 +39,6 @@ declare module "ckeditor5" {moveTabLeft: MoveTabCommand;moveTabRight: MoveTabCommand;assignTabReference: AssignTabReferenceCommand;+ tabAlignment: TabAlignmentCommand;}}diff --git a/packages/ckeditor5/src/plugins/tabs/tabs_commands.spec.ts b/packages/ckeditor5/src/plugins/tabs/tabs_commands.spec.tsindex cfcc46ef54..ffb984022e 100644--- a/packages/ckeditor5/src/plugins/tabs/tabs_commands.spec.ts+++ b/packages/ckeditor5/src/plugins/tabs/tabs_commands.spec.ts@@ -7,6 +7,7 @@ import {} from "ckeditor5";import { afterEach, beforeEach, describe, expect, it } from "vitest";+import type { TabAlignment } from "./constants.js";import Tabs from "./tabs.js";function tab(title: string, body = "") {@@ -83,6 +84,36 @@ describe("tabs commands", () => {expect(titles(inner)).toEqual(["B1", "B2"]);});+ it("aligns the block holding the selection and saves no attribute for the top", () => {+ const html = `<div class="trilium-tabs">${tab("A", "a")}${tab("B", "b")}</div>` ++ "<p>Outside</p>";+ editor.setData(html);+ const root = editor.model.document.getRoot();+ const tabs = root?.getChild(0) as ModelElement;+ const command = editor.commands.get("tabAlignment");+ expect(command).toBeDefined();++ editor.model.change(writer => writer.setSelection(root?.getChild(1) as ModelElement, 0));+ expect([command?.isEnabled, command?.value]).toEqual([false, undefined]);++ const panel = (tabs.getChild(1) as ModelElement).getChild(1) as ModelElement;+ editor.model.change(writer => writer.setSelection(panel, 0));+ expect([command?.isEnabled, command?.value]).toEqual([true, "top"]);++ editor.execute("tabAlignment", { value: "bottom" });+ expect([tabs.getAttribute("tabAlignment"), command?.value]).toEqual(["bottom", "bottom"]);+ expect(editor.getData())+ .toContain("<div class=\"trilium-tabs\" data-trilium-tab-alignment=\"bottom\">");++ const unknownAlignment: string = "left";+ editor.execute("tabAlignment", { value: unknownAlignment as TabAlignment });+ expect(command?.value).toBe("bottom");++ editor.execute("tabAlignment", { value: "top" });+ expect(tabs.hasAttribute("tabAlignment")).toBe(false);+ expect(editor.getData()).toBe(html);+ });+it("moves a tab left and disables the move at either end", () => {editor.setData(`<div class="trilium-tabs">${tab("A")}${tab("B")}</div>`);const tabs = editor.model.document.getRoot()?.getChild(0) as ModelElement;diff --git a/packages/ckeditor5/src/plugins/tabs/tabs_commands.ts b/packages/ckeditor5/src/plugins/tabs/tabs_commands.tsindex 47653459a2..2f4da5bbb3 100644--- a/packages/ckeditor5/src/plugins/tabs/tabs_commands.ts+++ b/packages/ckeditor5/src/plugins/tabs/tabs_commands.ts@@ -1,7 +1,9 @@import { Command, type Editor, type ModelElement, type ModelWriter } from "ckeditor5";import { BLOCK_ID, type BlockReferenceTarget, generateBlockId } from "../block_reference/block_reference_editing.js";-import { ELEMENTS } from "./constants.js";+import {+ ALIGNMENT_ATTRIBUTE, DEFAULT_TAB_ALIGNMENT, ELEMENTS, parseTabAlignment, type TabAlignment+} from "./constants.js";/*** Inserts a tabs block with two numbered tabs at the selection and selects the first tab's title,@@ -161,6 +163,41 @@ export class AssignTabReferenceCommand extends Command {}}+/**+ * Sets the side of the panels that the titles of the selected tabs block sit on. The default side+ * removes the attribute, so the saved HTML of a block on the default side does not change.+ */+export class TabAlignmentCommand extends Command {++ declare public value: TabAlignment | undefined;++ public override refresh(): void {+ const tabs = getSelectedTabs(this.editor);+ this.isEnabled = !!tabs;+ this.value = tabs ? getTabAlignment(tabs) : undefined;+ }++ public override execute({ value }: { value: TabAlignment }): void {+ const tabs = getSelectedTabs(this.editor);+ if (!tabs || !parseTabAlignment(value)) {+ return;+ }++ this.editor.model.change(writer => {+ if (value === DEFAULT_TAB_ALIGNMENT) {+ writer.removeAttribute(ALIGNMENT_ATTRIBUTE, tabs);+ } else {+ writer.setAttribute(ALIGNMENT_ATTRIBUTE, value, tabs);+ }+ });+ }+}++/** Returns the side of the panels that the titles of `tabs` sit on. */+export function getTabAlignment(tabs: ModelElement): TabAlignment {+ return parseTabAlignment(tabs.getAttribute(ALIGNMENT_ATTRIBUTE)) ?? DEFAULT_TAB_ALIGNMENT;+}+/** Creates a tab with the given title and a panel holding one empty paragraph. */export function createTab(writer: ModelWriter, titleText: string): ModelElement {const tab = writer.createElement(ELEMENTS.tab);diff --git a/packages/ckeditor5/src/plugins/tabs/tabs_editing.ts b/packages/ckeditor5/src/plugins/tabs/tabs_editing.tsindex b25da2d5ad..895b65e0b8 100644--- a/packages/ckeditor5/src/plugins/tabs/tabs_editing.ts+++ b/packages/ckeditor5/src/plugins/tabs/tabs_editing.ts@@ -10,14 +10,19 @@ import {toWidgetEditable,type ViewDocumentEnterEvent,type ViewEditableElement,+ type ViewElement,uid,Widget} from "ckeditor5";import { BLOCK_ID } from "../block_reference/block_reference_editing.js";-import { CLASSES, ELEMENTS, TABS_WIDGET_PROPERTY } from "./constants.js";import {- AssignTabReferenceCommand, InsertTabCommand, InsertTabsCommand, MoveTabCommand, RemoveTabCommand+ ALIGNMENT_ATTRIBUTE, ALIGNMENT_DATA_ATTRIBUTE, CLASSES, DEFAULT_TAB_ALIGNMENT, ELEMENTS,+ parseTabAlignment, TABS_WIDGET_PROPERTY+} from "./constants.js";+import {+ AssignTabReferenceCommand, InsertTabCommand, InsertTabsCommand, MoveTabCommand,+ RemoveTabCommand, TabAlignmentCommand} from "./tabs_commands.js";/**@@ -48,6 +53,7 @@ export default class TabsEditing extends Plugin {editor.commands.add("moveTabLeft", new MoveTabCommand(editor, "left"));editor.commands.add("moveTabRight", new MoveTabCommand(editor, "right"));editor.commands.add("assignTabReference", new AssignTabReferenceCommand(editor));+ editor.commands.add("tabAlignment", new TabAlignmentCommand(editor));this.registerSchema();this.registerConversion();@@ -105,7 +111,8 @@ export default class TabsEditing extends Plugin {private registerSchema() {const schema = this.editor.model.schema;schema.register(ELEMENTS.tabs, {- inheritAllFrom: "$blockObject"+ inheritAllFrom: "$blockObject",+ allowAttributes: ALIGNMENT_ATTRIBUTE});schema.register(ELEMENTS.tab, {allowIn: ELEMENTS.tabs,@@ -152,6 +159,23 @@ export default class TabsEditing extends Plugin {converterPriority: "high"});+ // The model holds the alignment only when it differs from the default.+ conversion.for("upcast").attributeToAttribute({+ view: { name: "div", key: ALIGNMENT_DATA_ATTRIBUTE },+ model: {+ key: ALIGNMENT_ATTRIBUTE,+ value: (view: ViewElement) => {+ const value = view.getAttribute(ALIGNMENT_DATA_ATTRIBUTE);+ const alignment = parseTabAlignment(value);+ return alignment === DEFAULT_TAB_ALIGNMENT ? null : alignment;+ }+ }+ });+ conversion.for("downcast").attributeToAttribute({+ model: { name: ELEMENTS.tabs, key: ALIGNMENT_ATTRIBUTE },+ view: ALIGNMENT_DATA_ATTRIBUTE+ });+conversion.for("dataDowncast").elementToElement({model: ELEMENTS.tabs,view: (_model, { writer }) => writer.createContainerElement("div", { class: CLASSES.tabs })diff --git a/packages/ckeditor5/src/plugins/tabs/tabs_layout.spec.ts b/packages/ckeditor5/src/plugins/tabs/tabs_layout.spec.tsnew file mode 100644index 0000000000..4033cf7ac4--- /dev/null+++ b/packages/ckeditor5/src/plugins/tabs/tabs_layout.spec.ts@@ -0,0 +1,126 @@+import { Essentials, Paragraph } from "ckeditor5";+import editorStylesheetUrl from "ckeditor5/ckeditor5.css?url";+import { beforeAll, describe, expect, it, onTestFinished } from "vitest";++import { createTestEditor } from "../../../test/editor-kit.js";+import type { TabAlignment } from "./constants.js";+import Tabs from "./tabs.js";+import { applyTabs } from "./tabs_read_only.js";++function tab(title: string, body: string) {+ return `<section class="trilium-tab"><p class="trilium-tab-title">${title}</p>` ++ `<div class="trilium-tab-panel">${body}</div></section>`;+}++/** Three tabs, the last with a title of two lines, so the titles differ in height. */+function tabsHtml(alignment: TabAlignment | null) {+ const attribute = alignment ? ` data-trilium-tab-alignment="${alignment}"` : "";+ return `<div class="trilium-tabs"${attribute}>` ++ tab("Windows", "<p>Run the installer.</p>") ++ tab("Linux", "<p>Use the package.</p>") ++ tab("Two<br>lines", "<p>Wrap it.</p>") ++ "</div>";+}++/** The radii of the top-left, top-right, bottom-right and bottom-left corners. */+function cornersOf(element: Element | null | undefined) {+ if (!element) {+ return null;+ }+ const style = getComputedStyle(element);+ return [+ style.borderTopLeftRadius,+ style.borderTopRightRadius,+ style.borderBottomRightRadius,+ style.borderBottomLeftRadius+ ].join(" ");+}++/** The top of the text of `element`, which its padding offsets from its box. */+function textTopOf(element: Element) {+ const range = document.createRange();+ range.selectNodeContents(element);+ return range.getBoundingClientRect().top;+}++/**+ * Measures a tabs block whose first tab shows: the distance of each title from the side of the+ * panel it sits on, how far the first title starts from the start of the panel, how far the text+ * of the second title sits below that of the first, and the corners of the panel and of the first+ * two titles.+ */+function measure(block: Element | null, alignment: TabAlignment) {+ expect(block).not.toBeNull();+ const titles = [...block?.querySelectorAll(":scope > .trilium-tab > .trilium-tab-title") ?? []];+ const panel = block?.querySelector(".trilium-tab--active > .trilium-tab-panel");+ const panelRect = panel?.getBoundingClientRect();+ expect(titles).toHaveLength(3);+ expect(panelRect).toBeDefined();++ const gaps = titles.map(title => {+ const rect = title.getBoundingClientRect();+ const gap = alignment === "top"+ ? (panelRect?.top ?? NaN) - rect.bottom+ : rect.top - (panelRect?.bottom ?? NaN);+ return Math.round(gap);+ });+ return {+ gaps,+ inset: Math.round(titles[0].getBoundingClientRect().left - (panelRect?.left ?? NaN)),+ textOffset: Math.round(textTopOf(titles[1]) - textTopOf(titles[0])),+ corners: [panel, ...titles.slice(0, 2)].map(cornersOf)+ };+}++const EXPECTED = {+ top: {+ gaps: [0, 2, 2],+ inset: 0,+ textOffset: 0,+ corners: ["0px 8px 8px 8px", "8px 8px 0px 0px", "8px 8px 0px 0px"]+ },+ bottom: {+ gaps: [0, 2, 2],+ inset: 0,+ textOffset: 0,+ corners: ["8px 8px 8px 0px", "0px 0px 8px 8px", "0px 0px 8px 8px"]+ }+};++describe("tabs layout styles", () => {+ beforeAll(() => new Promise<void>((resolve, reject) => {+ const link = document.createElement("link");+ link.rel = "stylesheet";+ link.href = editorStylesheetUrl;+ link.onload = () => resolve();+ link.onerror = () => reject(new Error("the editor stylesheet did not load"));+ document.head.appendChild(link);+ }));++ it("puts the titles above or below the panel in saved content", () => {+ for (const [attribute, alignment] of [[null, "top"], ["bottom", "bottom"]] as const) {+ const container = document.createElement("div");+ container.className = "ck-content";+ container.style.width = "600px";+ container.innerHTML = tabsHtml(attribute);+ document.body.appendChild(container);+ onTestFinished(() => container.remove());+ applyTabs(container, { placeholder: "Tab title" });++ const block = container.querySelector(".trilium-tabs");+ expect(measure(block, alignment), alignment).toEqual(EXPECTED[alignment]);+ }+ });++ it("puts the titles above or below the panel in the editor", async () => {+ const editor = await createTestEditor([Essentials, Paragraph, Tabs]);+ const editable = editor.ui.view.editable.element as HTMLElement;+ editable.style.width = "600px";++ for (const alignment of ["top", "bottom"] as const) {+ editor.setData(tabsHtml(alignment));+ const block = editable.querySelector(".trilium-tabs.ck-widget");+ expect(measure(block, alignment), alignment).toEqual(EXPECTED[alignment]);+ }+ });+});diff --git a/packages/ckeditor5/src/plugins/tabs/tabs_ui.spec.ts b/packages/ckeditor5/src/plugins/tabs/tabs_ui.spec.tsindex 51b50dbd0e..21a70175d3 100644--- a/packages/ckeditor5/src/plugins/tabs/tabs_ui.spec.ts+++ b/packages/ckeditor5/src/plugins/tabs/tabs_ui.spec.ts@@ -1,7 +1,22 @@-import { ButtonView, ClassicEditor, Essentials, Paragraph } from "ckeditor5";-import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";+import {+ _getModelData as getModelData,+ ButtonView,+ ClassicEditor,+ DropdownView,+ Essentials,+ type ListItemButtonView,+ type ListItemView,+ type ListView,+ Paragraph,+ ToolbarSeparatorView,+ type ToolbarView,+ WidgetToolbarRepository+} from "ckeditor5";+import { afterEach, beforeEach, describe, expect, it, onTestFinished, vi } from "vitest";import { installGlobMock } from "../../../test/globals-test-kit.js";+import tabsBottomIcon from "../../icons/tabs-bottom.svg?raw";+import tabsIcon from "../../icons/tabs.svg?raw";import Tabs from "./tabs.js";describe("TabsUI", () => {@@ -49,4 +64,42 @@ describe("TabsUI", () => {expect(copyTabReference).toHaveBeenCalledTimes(1);});++ it("aligns the tabs from a dropdown at the end of the toolbar", () => {+ editor.setData("<p>x</p>");+ const dropdown = editor.ui.componentFactory.create("tabAlignment") as DropdownView;+ dropdown.render();+ document.body.appendChild(dropdown.element as HTMLElement);+ onTestFinished(() => dropdown.element?.remove());+ expect([dropdown.isEnabled, dropdown.buttonView.icon]).toEqual([false, tabsIcon]);++ editor.execute("tabs");+ dropdown.isOpen = true;+ const items = [...(dropdown.panelView.children.first as ListView).items]+ .map(item => (item as ListItemView).children.first as ListItemButtonView);+ expect(items.map(item => [item.label, item.icon, item.role, item.isOn])).toEqual([+ ["Align tabs at top", tabsIcon, "menuitemradio", true],+ ["Align tabs at bottom", tabsBottomIcon, "menuitemradio", false]+ ]);+ expect([dropdown.isEnabled, dropdown.buttonView.label, dropdown.buttonView.tooltip])+ .toEqual([true, "Tab alignment", true]);++ const focus = vi.spyOn(editor.editing.view, "focus");+ items[1].fire("execute");++ expect(getModelData(editor.model, { withoutSelection: true }))+ .toMatch(/^<tabs tabAlignment="bottom">/);+ expect(items.map(item => item.isOn)).toEqual([false, true]);+ expect([dropdown.buttonView.icon, dropdown.isOpen]).toEqual([tabsBottomIcon, false]);+ expect(focus).toHaveBeenCalled();++ const repository = editor.plugins.get(WidgetToolbarRepository) as unknown as {+ _toolbarDefinitions: Map<string, { view: ToolbarView }>;+ };+ const toolbarItems = [...repository._toolbarDefinitions.get("tabs")?.view.items ?? []];+ const [separator, last] = toolbarItems.slice(-2);+ expect(separator).toBeInstanceOf(ToolbarSeparatorView);+ expect(last).toBeInstanceOf(DropdownView);+ expect((last as DropdownView).buttonView.label).toBe("Tab alignment");+ });});diff --git a/packages/ckeditor5/src/plugins/tabs/tabs_ui.ts b/packages/ckeditor5/src/plugins/tabs/tabs_ui.tsindex 5b44ca7000..ba03033ef3 100644--- a/packages/ckeditor5/src/plugins/tabs/tabs_ui.ts+++ b/packages/ckeditor5/src/plugins/tabs/tabs_ui.ts@@ -1,23 +1,34 @@import {+ addListToDropdown,ButtonView,+ Collection,type Command,+ createDropdown,type Editor,IconLink,IconNextArrow,IconPlus,IconPreviousArrow,IconRemove,+ type ListDropdownButtonDefinition,+ type Locale,+ type LocaleTranslate,Plugin,+ ViewModel,WidgetToolbarRepository} from "ckeditor5";+import tabsBottomIcon from "../../icons/tabs-bottom.svg?raw";import tabsIcon from "../../icons/tabs.svg?raw";import { findSelectedWidget } from "../widget_utils.js";-import { TABS_WIDGET_PROPERTY } from "./constants.js";+import {+ DEFAULT_TAB_ALIGNMENT, TAB_ALIGNMENTS, type TabAlignment, TABS_WIDGET_PROPERTY+} from "./constants.js";+import type { TabAlignmentCommand } from "./tabs_commands.js";/**- * The insert button for tabs blocks and the contextual toolbar that adds, removes and reorders- * tabs while the selection is inside a block.+ * The insert button for tabs blocks and the contextual toolbar that adds, removes, reorders and+ * aligns tabs while the selection is inside a block.*/export default class TabsUI extends Plugin {@@ -37,13 +48,18 @@ export default class TabsUI extends Plugin {this.addButton("moveTabLeft", t("Move tab left"), IconPreviousArrow);this.addButton("moveTabRight", t("Move tab right"), IconNextArrow);this.addCopyLinkButton();+ this.editor.ui.componentFactory.add("tabAlignment",+ locale => this.createAlignmentDropdown(locale));}public afterInit(): void {const t = this.editor.t;this.editor.plugins.get(WidgetToolbarRepository).register("tabs", {ariaLabel: t("Tabs toolbar"),- items: ["insertTab", "removeTab", "|", "moveTabLeft", "moveTabRight", "|", "copyTabLink"],+ items: [+ "insertTab", "removeTab", "|", "moveTabLeft", "moveTabRight", "|", "copyTabLink",+ "|", "tabAlignment"+ ],getRelatedElement: selection =>findSelectedWidget(selection, TABS_WIDGET_PROPERTY)});@@ -63,6 +79,41 @@ export default class TabsUI extends Plugin {});}+ /**+ * A dropdown that puts the titles above or below the panels. Its button shows the icon of the+ * current alignment.+ */+ private createAlignmentDropdown(locale: Locale) {+ const editor = this.editor;+ const command = editor.commands.get("tabAlignment") as TabAlignmentCommand;+ const dropdown = createDropdown(locale);+ dropdown.buttonView.set({ label: editor.t("Tab alignment"), tooltip: true });+ dropdown.buttonView.bind("icon").to(command, "value",+ value => getAlignmentIcon(value ?? DEFAULT_TAB_ALIGNMENT));+ dropdown.bind("isEnabled").to(command, "isEnabled");++ const items = new Collection<ListDropdownButtonDefinition>();+ for (const alignment of TAB_ALIGNMENTS) {+ const model = new ViewModel({+ commandParam: alignment,+ label: getAlignmentLabel(editor.t, alignment),+ icon: getAlignmentIcon(alignment),+ role: "menuitemradio",+ withText: true+ });+ model.bind("isOn").to(command, "value", value => value === alignment);+ items.add({ type: "button", model });+ }+ addListToDropdown(dropdown, items);++ this.listenTo(dropdown, "execute", evt => {+ const value = (evt.source as { commandParam: TabAlignment }).commandParam;+ editor.execute("tabAlignment", { value });+ editor.editing.view.focus();+ });+ return dropdown;+ }+private addButton(name: string, label: string, icon: string) {const editor = this.editor;editor.ui.componentFactory.add(name, locale => {@@ -82,6 +133,14 @@ export default class TabsUI extends Plugin {}}+function getAlignmentLabel(t: LocaleTranslate, alignment: TabAlignment): string {+ return alignment === "bottom" ? t("Align tabs at bottom") : t("Align tabs at top");+}++function getAlignmentIcon(alignment: TabAlignment): string {+ return alignment === "bottom" ? tabsBottomIcon : tabsIcon;+}+/** Returns the host component of `editor`, which copies links. */function getHost(editor: Editor) {return glob.getComponentByEl<EditorComponent>(editor.editing.view.getDomRoot());diff --git a/packages/ckeditor5/src/theme/tabs.css b/packages/ckeditor5/src/theme/tabs.cssindex ac0a36f0ea..ac6a0c2100 100644--- a/packages/ckeditor5/src/theme/tabs.css+++ b/packages/ckeditor5/src/theme/tabs.css@@ -70,6 +70,33 @@display: block;}}++ &[data-trilium-tab-alignment="bottom"] {+ align-items: flex-start;++ & > .trilium-tab > .trilium-tab-title {+ order: 1;+ margin: var(--_tabs-delimiter-width) 0 0;+ border-radius: 0 0 var(--_tabs-border-radius) var(--_tabs-border-radius);+ }++ & > .trilium-tab > .trilium-tab-panel {+ order: 0;+ border-radius: var(--_tabs-border-radius);+ border-bottom-left-radius: 0;+ }++ & > .trilium-tab.trilium-tab--active > .trilium-tab-title {+ margin-top: 0;+ padding-top: calc(6px + var(--_tabs-delimiter-width));+ padding-bottom: 6px;+ }++ /* The editor's widget UI elements stay at the end of the title row. */+ & > :not(.trilium-tab) {+ order: 1;+ }+ }}}diff --git a/packages/trilium-core/src/services/export/markdown.spec.ts b/packages/trilium-core/src/services/export/markdown.spec.tsindex 5a8410632d..edbcfa4af0 100644--- a/packages/trilium-core/src/services/export/markdown.spec.ts+++ b/packages/trilium-core/src/services/export/markdown.spec.ts@@ -1001,6 +1001,15 @@ describe("Markdown export", () => {y`);});+ it("drops the tab alignment, which MkDocs content tabs cannot express", () => {+ const html = "<div class=\"trilium-tabs\" data-trilium-tab-alignment=\"bottom\">" ++ `${tab("Windows", "<p>a</p>")}</div>`;+ expect(markdownExportService.toMarkdown(html)).toBe(trimIndentation`\+ === "Windows"++ a`);+ });+it("exports the icons and formatting of a tab title as inline Markdown", () => {const html = tabs(tab(`<span class="tn-icon bx bxl-chrome"></span> Chrome`, "<p>a</p>"),diff --git a/packages/trilium-core/src/services/icon_pack_text_editor.json b/packages/trilium-core/src/services/icon_pack_text_editor.jsonindex 50ecc259df..99f31d8cfe 100644--- a/packages/trilium-core/src/services/icon_pack_text_editor.json+++ b/packages/trilium-core/src/services/icon_pack_text_editor.json@@ -252,1172 +252,1202 @@"chevron-down"]},- "cke-chevron-right": {+ "cke-chevron-left": {"glyph": "",+ "terms": [+ "chevron-left"+ ]+ },+ "cke-chevron-right": {+ "glyph": "","terms": ["chevron-right"]},"cke-chevron-up": {- "glyph": "",+ "glyph": "","terms": ["chevron-up"]},"cke-ckbox-image-edit": {- "glyph": "",+ "glyph": "","terms": ["ckbox-image-edit"]},"cke-close": {- "glyph": "",+ "glyph": "","terms": ["close"]},"cke-code": {- "glyph": "",+ "glyph": "","terms": ["code"]},"cke-code-block": {- "glyph": "",+ "glyph": "","terms": ["code-block"]},"cke-cog": {- "glyph": "",+ "glyph": "","terms": ["cog"]},"cke-color-palette": {- "glyph": "",+ "glyph": "","terms": ["color-palette"]},"cke-color-tile-check": {- "glyph": "",+ "glyph": "","terms": ["color-tile-check"]},+ "cke-comments": {+ "glyph": "",+ "terms": [+ "comments"+ ]+ },"cke-comments-archive": {- "glyph": "",+ "glyph": "","terms": ["comments-archive"]},"cke-content-lock": {- "glyph": "",+ "glyph": "","terms": ["content-lock"]},"cke-content-unlock": {- "glyph": "",+ "glyph": "","terms": ["content-unlock"]},"cke-copy": {- "glyph": "",+ "glyph": "","terms": ["copy"]},"cke-document": {- "glyph": "",+ "glyph": "","terms": ["document"]},"cke-document-outline": {- "glyph": "",+ "glyph": "","terms": ["document-outline"]},"cke-document-outline-toggle": {- "glyph": "",+ "glyph": "","terms": ["document-outline-toggle"]},"cke-document-with-checkmark": {- "glyph": "",+ "glyph": "","terms": ["document-with-checkmark"]},"cke-document-with-cross": {- "glyph": "",+ "glyph": "","terms": ["document-with-cross"]},"cke-document-with-loupe": {- "glyph": "",+ "glyph": "","terms": ["document-with-loupe"]},"cke-drag-handle": {- "glyph": "",+ "glyph": "","terms": ["drag-handle"]},"cke-drag-indicator": {- "glyph": "",+ "glyph": "","terms": ["drag-indicator"]},"cke-dropbox": {- "glyph": "",+ "glyph": "","terms": ["dropbox"]},"cke-dropdown-arrow": {- "glyph": "",+ "glyph": "","terms": ["dropdown-arrow"]},"cke-edit-comment": {- "glyph": "",+ "glyph": "","terms": ["edit-comment"]},"cke-emoji": {- "glyph": "",+ "glyph": "","terms": ["emoji"]},"cke-eraser": {- "glyph": "",+ "glyph": "","terms": ["eraser"]},"cke-error": {- "glyph": "",+ "glyph": "","terms": ["error"]},"cke-export-pdf": {- "glyph": "",+ "glyph": "","terms": ["export-pdf"]},"cke-export-word": {- "glyph": "",+ "glyph": "","terms": ["export-word"]},"cke-eye": {- "glyph": "",+ "glyph": "","terms": ["eye"]},"cke-eye-crossed-out": {- "glyph": "",+ "glyph": "","terms": ["eye-crossed-out"]},"cke-facebook": {- "glyph": "",+ "glyph": "","terms": ["facebook"]},"cke-file-upload": {- "glyph": "",+ "glyph": "","terms": ["file-upload"]},"cke-find-replace": {- "glyph": "",+ "glyph": "","terms": ["find-replace"]},"cke-font-background": {- "glyph": "",+ "glyph": "","terms": ["font-background"]},"cke-font-color": {- "glyph": "",+ "glyph": "","terms": ["font-color"]},"cke-font-family": {- "glyph": "",+ "glyph": "","terms": ["font-family"]},"cke-font-size": {- "glyph": "",+ "glyph": "","terms": ["font-size"]},"cke-footnote": {- "glyph": "",+ "glyph": "","terms": ["footnote"]},"cke-fullscreen-enter": {- "glyph": "",+ "glyph": "","terms": ["fullscreen-enter"]},"cke-fullscreen-leave": {- "glyph": "",+ "glyph": "","terms": ["fullscreen-leave"]},"cke-google-drive": {- "glyph": "",+ "glyph": "","terms": ["google-drive"]},"cke-google-photos": {- "glyph": "",+ "glyph": "","terms": ["google-photos"]},"cke-heading-1": {- "glyph": "",+ "glyph": "","terms": ["heading-1"]},"cke-heading-2": {- "glyph": "",+ "glyph": "","terms": ["heading-2"]},"cke-heading-3": {- "glyph": "",+ "glyph": "","terms": ["heading-3"]},"cke-heading-4": {- "glyph": "",+ "glyph": "","terms": ["heading-4"]},"cke-heading-5": {- "glyph": "",+ "glyph": "","terms": ["heading-5"]},"cke-heading-6": {- "glyph": "",+ "glyph": "","terms": ["heading-6"]},"cke-history": {- "glyph": "",+ "glyph": "","terms": ["history"]},"cke-horizontal-line": {- "glyph": "",+ "glyph": "","terms": ["horizontal-line"]},"cke-html": {- "glyph": "",+ "glyph": "","terms": ["html"]},"cke-image": {- "glyph": "",+ "glyph": "","terms": ["image"]},"cke-image-asset-manager": {- "glyph": "",+ "glyph": "","terms": ["image-asset-manager"]},"cke-image-upload": {- "glyph": "",+ "glyph": "","terms": ["image-upload"]},"cke-image-url": {- "glyph": "",+ "glyph": "","terms": ["image-url"]},"cke-import-export": {- "glyph": "",+ "glyph": "","terms": ["import-export"]},"cke-import-word": {- "glyph": "",+ "glyph": "","terms": ["import-word"]},"cke-indent": {- "glyph": "",+ "glyph": "","terms": ["indent"]},"cke-info": {- "glyph": "",+ "glyph": "","terms": ["info"]},"cke-insert-merge-field": {- "glyph": "",+ "glyph": "","terms": ["insert-merge-field"]},"cke-italic": {- "glyph": "",+ "glyph": "","terms": ["italic"]},"cke-legal-style-list": {- "glyph": "",+ "glyph": "","terms": ["legal-style-list"]},"cke-line-height": {- "glyph": "",+ "glyph": "","terms": ["line-height"]},"cke-link": {- "glyph": "",+ "glyph": "","terms": ["link"]},"cke-list-style-circle": {- "glyph": "",+ "glyph": "","terms": ["list-style-circle"]},"cke-list-style-decimal": {- "glyph": "",+ "glyph": "","terms": ["list-style-decimal"]},"cke-list-style-decimal-leading-zero": {- "glyph": "",+ "glyph": "","terms": ["list-style-decimal-leading-zero"]},"cke-list-style-disc": {- "glyph": "",+ "glyph": "","terms": ["list-style-disc"]},"cke-list-style-lower-latin": {- "glyph": "",+ "glyph": "","terms": ["list-style-lower-latin"]},"cke-list-style-lower-roman": {- "glyph": "",+ "glyph": "","terms": ["list-style-lower-roman"]},"cke-list-style-square": {- "glyph": "",+ "glyph": "","terms": ["list-style-square"]},"cke-list-style-upper-latin": {- "glyph": "",+ "glyph": "","terms": ["list-style-upper-latin"]},"cke-list-style-upper-roman": {- "glyph": "",+ "glyph": "","terms": ["list-style-upper-roman"]},"cke-local": {- "glyph": "",+ "glyph": "","terms": ["local"]},+ "cke-lock": {+ "glyph": "",+ "terms": [+ "lock"+ ]+ },"cke-loupe": {- "glyph": "",+ "glyph": "","terms": ["loupe"]},"cke-low-vision": {- "glyph": "",+ "glyph": "","terms": ["low-vision"]},"cke-magic-wand": {- "glyph": "",+ "glyph": "","terms": ["magic-wand"]},"cke-marker": {- "glyph": "",+ "glyph": "","terms": ["marker"]},"cke-maximize": {- "glyph": "",+ "glyph": "","terms": ["maximize"]},"cke-media": {- "glyph": "",+ "glyph": "","terms": ["media"]},"cke-media-placeholder": {- "glyph": "",+ "glyph": "","terms": ["media-placeholder"]},"cke-minimize": {- "glyph": "",+ "glyph": "","terms": ["minimize"]},"cke-multi-level-list": {- "glyph": "",+ "glyph": "","terms": ["multi-level-list"]},"cke-next-arrow": {- "glyph": "",+ "glyph": "","terms": ["next-arrow"]},"cke-notification": {- "glyph": "",+ "glyph": "","terms": ["notification"]},"cke-numbered-list": {- "glyph": "",+ "glyph": "","terms": ["numbered-list"]},"cke-object-center": {- "glyph": "",+ "glyph": "","terms": ["object-center"]},"cke-object-full-width": {- "glyph": "",+ "glyph": "","terms": ["object-full-width"]},"cke-object-inline": {- "glyph": "",+ "glyph": "","terms": ["object-inline"]},"cke-object-inline-left": {- "glyph": "",+ "glyph": "","terms": ["object-inline-left"]},"cke-object-inline-right": {- "glyph": "",+ "glyph": "","terms": ["object-inline-right"]},"cke-object-left": {- "glyph": "",+ "glyph": "","terms": ["object-left"]},"cke-object-right": {- "glyph": "",+ "glyph": "","terms": ["object-right"]},"cke-object-size-custom": {- "glyph": "",+ "glyph": "","terms": ["object-size-custom"]},"cke-object-size-full": {- "glyph": "",+ "glyph": "","terms": ["object-size-full"]},"cke-object-size-large": {- "glyph": "",+ "glyph": "","terms": ["object-size-large"]},"cke-object-size-medium": {- "glyph": "",+ "glyph": "","terms": ["object-size-medium"]},"cke-object-size-small": {- "glyph": "",+ "glyph": "","terms": ["object-size-small"]},"cke-one-drive": {- "glyph": "",+ "glyph": "","terms": ["one-drive"]},"cke-outdated": {- "glyph": "",+ "glyph": "","terms": ["outdated"]},"cke-outdent": {- "glyph": "",+ "glyph": "","terms": ["outdent"]},"cke-page-break": {- "glyph": "",+ "glyph": "","terms": ["page-break"]},"cke-pagination-example": {- "glyph": "",+ "glyph": "","terms": ["pagination-example"]},"cke-paint-roller": {- "glyph": "",+ "glyph": "","terms": ["paint-roller"]},"cke-paint-roller-cursor-default": {- "glyph": "",+ "glyph": "","terms": ["paint-roller-cursor-default"]},"cke-paint-roller-cursor-text": {- "glyph": "",+ "glyph": "","terms": ["paint-roller-cursor-text"]},"cke-paper-clip": {- "glyph": "",+ "glyph": "","terms": ["paper-clip"]},"cke-paragraph": {- "glyph": "",+ "glyph": "","terms": ["paragraph"]},"cke-pen": {- "glyph": "",+ "glyph": "","terms": ["pen"]},"cke-pencil": {- "glyph": "",+ "glyph": "","terms": ["pencil"]},"cke-pilcrow": {- "glyph": "",+ "glyph": "","terms": ["pilcrow"]},"cke-pin": {- "glyph": "",+ "glyph": "","terms": ["pin"]},"cke-play": {- "glyph": "",+ "glyph": "","terms": ["play"]},"cke-plus": {- "glyph": "",+ "glyph": "","terms": ["plus"]},"cke-preview-merge-fields": {- "glyph": "",+ "glyph": "","terms": ["preview-merge-fields"]},"cke-previous-arrow": {- "glyph": "",+ "glyph": "","terms": ["previous-arrow"]},"cke-print": {- "glyph": "",+ "glyph": "","terms": ["print"]},"cke-project-logo": {- "glyph": "",+ "glyph": "","terms": ["project-logo"]},"cke-quote": {- "glyph": "",+ "glyph": "","terms": ["quote"]},"cke-redo": {- "glyph": "",+ "glyph": "","terms": ["redo"]},"cke-refresh": {- "glyph": "",+ "glyph": "","terms": ["refresh"]},"cke-remove": {- "glyph": "",+ "glyph": "","terms": ["remove"]},"cke-remove-comment": {- "glyph": "",+ "glyph": "","terms": ["remove-comment"]},"cke-remove-format": {- "glyph": "",+ "glyph": "","terms": ["remove-format"]},"cke-return-arrow": {- "glyph": "",+ "glyph": "","terms": ["return-arrow"]},"cke-revision-history": {- "glyph": "",+ "glyph": "","terms": ["revision-history"]},"cke-robot-pencil": {- "glyph": "",+ "glyph": "","terms": ["robot-pencil"]},"cke-select-all": {- "glyph": "",+ "glyph": "","terms": ["select-all"]},"cke-selection": {- "glyph": "",+ "glyph": "","terms": ["selection"]},"cke-settings": {- "glyph": "",+ "glyph": "","terms": ["settings"]},"cke-show-blocks": {- "glyph": "",+ "glyph": "","terms": ["show-blocks"]},"cke-show-changes-off": {- "glyph": "",+ "glyph": "","terms": ["show-changes-off"]},"cke-show-changes-on": {- "glyph": "",+ "glyph": "","terms": ["show-changes-on"]},"cke-source": {- "glyph": "",+ "glyph": "","terms": ["source"]},"cke-sparkle": {- "glyph": "",+ "glyph": "","terms": ["sparkle"]},"cke-special-characters": {- "glyph": "",+ "glyph": "","terms": ["special-characters"]},"cke-stop": {- "glyph": "",+ "glyph": "","terms": ["stop"]},+ "cke-stop-circle": {+ "glyph": "",+ "terms": [+ "stop-circle"+ ]+ },"cke-strikethrough": {- "glyph": "",+ "glyph": "","terms": ["strikethrough"]},"cke-submit": {- "glyph": "",+ "glyph": "","terms": ["submit"]},"cke-subscript": {- "glyph": "",+ "glyph": "","terms": ["subscript"]},"cke-superscript": {- "glyph": "",+ "glyph": "","terms": ["superscript"]},"cke-table": {- "glyph": "",+ "glyph": "","terms": ["table"]},"cke-table-cell-properties": {- "glyph": "",+ "glyph": "","terms": ["table-cell-properties"]},"cke-table-column": {- "glyph": "",+ "glyph": "","terms": ["table-column"]},"cke-table-layout": {- "glyph": "",+ "glyph": "","terms": ["table-layout"]},"cke-table-merge-cell": {- "glyph": "",+ "glyph": "","terms": ["table-merge-cell"]},"cke-table-of-contents": {- "glyph": "",+ "glyph": "","terms": ["table-of-contents"]},"cke-table-properties": {- "glyph": "",+ "glyph": "","terms": ["table-properties"]},"cke-table-row": {- "glyph": "",+ "glyph": "","terms": ["table-row"]},"cke-template": {- "glyph": "",+ "glyph": "","terms": ["template"]},"cke-template-generic": {- "glyph": "",+ "glyph": "","terms": ["template-generic"]},"cke-text": {- "glyph": "",+ "glyph": "","terms": ["text"]},"cke-text-alternative": {- "glyph": "",+ "glyph": "","terms": ["text-alternative"]},"cke-three-horizontal-dots": {- "glyph": "",+ "glyph": "","terms": ["three-horizontal-dots"]},"cke-three-stars": {- "glyph": "",+ "glyph": "","terms": ["three-stars"]},"cke-three-vertical-dots": {- "glyph": "",+ "glyph": "","terms": ["three-vertical-dots"]},"cke-thumb-down": {- "glyph": "",+ "glyph": "","terms": ["thumb-down"]},"cke-thumb-up": {- "glyph": "",+ "glyph": "","terms": ["thumb-up"]},"cke-todo-list": {- "glyph": "",+ "glyph": "","terms": ["todo-list"]},"cke-track-changes": {- "glyph": "",+ "glyph": "","terms": ["track-changes"]},"cke-track-changes-accept": {- "glyph": "",+ "glyph": "","terms": ["track-changes-accept"]},"cke-track-changes-discard": {- "glyph": "",+ "glyph": "","terms": ["track-changes-discard"]},"cke-underline": {- "glyph": "",+ "glyph": "","terms": ["underline"]},"cke-undo": {- "glyph": "",+ "glyph": "","terms": ["undo"]},"cke-unlink": {- "glyph": "",+ "glyph": "","terms": ["unlink"]},"cke-uploadcare-image-edit": {- "glyph": "",+ "glyph": "","terms": ["uploadcare-image-edit"]},"cke-uploadcare-image-upload": {- "glyph": "",+ "glyph": "","terms": ["uploadcare-image-upload"]},"cke-uploadcare-link": {- "glyph": "",+ "glyph": "","terms": ["uploadcare-link"]},"cke-user": {- "glyph": "",+ "glyph": "","terms": ["user"]},"cke-warning": {- "glyph": "",+ "glyph": "","terms": ["warning"]},"cke-web": {- "glyph": "",+ "glyph": "","terms": ["web"]},"cke-trilium-admonition": {- "glyph": "",+ "glyph": "","terms": ["trilium-admonition"]},"cke-trilium-collapsible": {- "glyph": "",+ "glyph": "","terms": ["trilium-collapsible"]},"cke-trilium-copy": {- "glyph": "",+ "glyph": "","terms": ["trilium-copy"]},"cke-trilium-date-time": {- "glyph": "",+ "glyph": "","terms": ["trilium-date-time"]},"cke-trilium-download": {- "glyph": "",+ "glyph": "","terms": ["trilium-download"]},"cke-trilium-fileupload": {- "glyph": "",+ "glyph": "","terms": ["trilium-fileupload"]},"cke-trilium-insert-footnote": {- "glyph": "",+ "glyph": "","terms": ["trilium-insert-footnote"]},"cke-trilium-kbd": {- "glyph": "",+ "glyph": "","terms": ["trilium-kbd"]},"cke-trilium-link-preview": {- "glyph": "",+ "glyph": "","terms": ["trilium-link-preview"]},"cke-trilium-markdown-mark": {- "glyph": "",+ "glyph": "","terms": ["trilium-markdown-mark"]},"cke-trilium-math": {- "glyph": "",+ "glyph": "","terms": ["trilium-math"]},"cke-trilium-mermaid-info": {- "glyph": "",+ "glyph": "","terms": ["trilium-mermaid-info"]},"cke-trilium-mermaid-insert": {- "glyph": "",+ "glyph": "","terms": ["trilium-mermaid-insert"]},"cke-trilium-mermaid-preview-mode": {- "glyph": "",+ "glyph": "","terms": ["trilium-mermaid-preview-mode"]},"cke-trilium-mermaid-source-mode": {- "glyph": "",+ "glyph": "","terms": ["trilium-mermaid-source-mode"]},"cke-trilium-mermaid-split-mode": {- "glyph": "",+ "glyph": "","terms": ["trilium-mermaid-split-mode"]},"cke-trilium-multicolumn": {- "glyph": "",+ "glyph": "","terms": ["trilium-multicolumn"]},"cke-trilium-note": {- "glyph": "",+ "glyph": "","terms": ["trilium-note"]},"cke-trilium-scissors": {- "glyph": "",+ "glyph": "","terms": ["trilium-scissors"]},+ "cke-trilium-tabs-bottom": {+ "glyph": "",+ "terms": [+ "trilium-tabs-bottom"+ ]+ },"cke-trilium-tabs": {- "glyph": "",+ "glyph": "","terms": ["trilium-tabs"]},"cke-trilium": {- "glyph": "",+ "glyph": "","terms": ["trilium"]},"cke-trilium-ai": {- "glyph": "",+ "glyph": "","terms": ["trilium-ai"]},"cke-trilium-template": {- "glyph": "",+ "glyph": "","terms": ["trilium-template"]