From ac93ba86514f941f97fcb912746a5bfa594280da Mon Sep 17 00:00:00 2001 From: Steffen Becker Date: Wed, 12 Aug 2026 01:34:03 +0200 Subject: [PATCH] feat: the ribbon's Home tab carries every formatting control MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Clipboard, Font, Paragraph, a style gallery of live tiles, and Find/Replace — which had no button in either chrome before. So did change case, underline and strikethrough line styles: the engine has carried them all along. Two things the fixed-height band forced. Its own overflow clips a dropdown, so a menu leaves the flow and pins itself under its trigger. And with one shared open-menu id, each wrapper must name the menu it owns, or every sibling closes it on mousedown and the click on a row never lands. --- src/App.svelte | 3 + src/lib/components/ribbon/Ribbon.svelte | 27 +- src/lib/components/ribbon/RibbonMenu.svelte | 42 +- .../ribbon/controls/FontFamilyBox.svelte | 117 +++++ .../ribbon/controls/FontSizeBox.svelte | 98 +++++ .../ribbon/controls/StyleGallery.svelte | 198 +++++++++ src/lib/components/ribbon/fontList.svelte.ts | 58 +++ src/lib/components/ribbon/icons.ts | 28 ++ src/lib/components/ribbon/menu.svelte.ts | 38 +- src/lib/components/ribbon/tabs/HomeTab.svelte | 408 ++++++++++++++++++ src/lib/editor/contextMenuItems.ts | 4 +- src/lib/i18n/locales/de.ts | 23 + src/lib/i18n/locales/en.ts | 23 + src/styles/global.css | 109 ++++- 14 files changed, 1118 insertions(+), 58 deletions(-) create mode 100644 src/lib/components/ribbon/controls/FontFamilyBox.svelte create mode 100644 src/lib/components/ribbon/controls/FontSizeBox.svelte create mode 100644 src/lib/components/ribbon/controls/StyleGallery.svelte create mode 100644 src/lib/components/ribbon/fontList.svelte.ts create mode 100644 src/lib/components/ribbon/tabs/HomeTab.svelte diff --git a/src/App.svelte b/src/App.svelte index 8c37d48..f0e0d27 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -831,6 +831,9 @@ tick={activeTick} bind:chromeMode bind:documentName + bind:showFormattingMarks + onManageStyles={openStyleManager} + onFind={openFind} {namePlaceholder} {themeMode} onSelectTheme={selectTheme} diff --git a/src/lib/components/ribbon/Ribbon.svelte b/src/lib/components/ribbon/Ribbon.svelte index 3ba3cb0..883577d 100644 --- a/src/lib/components/ribbon/Ribbon.svelte +++ b/src/lib/components/ribbon/Ribbon.svelte @@ -3,18 +3,23 @@ import Icon from './Icon.svelte'; import RibbonMenu from './RibbonMenu.svelte'; import HistoryButton from '../HistoryButton.svelte'; + import HomeTab from './tabs/HomeTab.svelte'; import UiLanguagePicker from '../UiLanguagePicker.svelte'; import { clickOutside, isMenuOpen, toggleMenu, closeMenu } from './menu.svelte'; import { t } from '../../i18n/i18n.svelte'; import { withShortcut } from '../../i18n/shortcut'; import { shortcutHint } from '../../editor/shortcuts'; import type { ChromeMode, ThemeMode } from '../../storage/theme'; + import type { StyleFamily } from '../../styles/styleSheet'; let { editor, tick, chromeMode = $bindable('ribbon'), documentName = $bindable(''), + showFormattingMarks = $bindable(false), + onManageStyles, + onFind, namePlaceholder = '', themeMode = 'auto', onSelectTheme, @@ -26,6 +31,9 @@ tick: number; chromeMode?: ChromeMode; documentName?: string; + showFormattingMarks?: boolean; + onManageStyles?: (family: StyleFamily) => void; + onFind?: (mode: 'find' | 'replace') => void; namePlaceholder?: string; themeMode?: ThemeMode; onSelectTheme?: (mode: ThemeMode) => void; @@ -58,7 +66,7 @@
-
+
-
+

- +
{t().appearance.title}
{#each (['light', 'dark', 'allBlack', 'auto'] as const) as m}
@@ -289,17 +297,6 @@ .appearance-wrap { position: relative; } - /* The heading style RibbonMenu applies to its own `heading` prop, for the second - section of a menu that has two. */ - .menu-heading { - padding: 4px 12px 6px; - font-size: 11px; - font-weight: 600; - text-transform: uppercase; - letter-spacing: 0.05em; - color: var(--w-text-tertiary); - } - /* The name field grows with its text: the sizer mirrors the value and lends the input its width. */ .doc-name { diff --git a/src/lib/components/ribbon/RibbonMenu.svelte b/src/lib/components/ribbon/RibbonMenu.svelte index 1d3d369..6d13542 100644 --- a/src/lib/components/ribbon/RibbonMenu.svelte +++ b/src/lib/components/ribbon/RibbonMenu.svelte @@ -1,8 +1,11 @@ -