feat(desktop): add the outline header and share menu icons

Add a Table of Contents header with a button that opens the sidebar.
Use the BlockSuite icons in the document menu and the outline header.
Keep the last outline tick when the rail has room for it.
Clear the active outline entry when its block stops being a heading.
This commit is contained in:
DarkSky committed 2026-12-03 17:43:38 +09:00
1 parent 864848c3cb
commit 3a75ecff4c
6 files changed
+297 -21

No files matched your search

@@ -63,7 +63,13 @@ impl PlaygroundView {
{
match pin.heading.as_deref() {
None => return None,
Some(id) if layout.block(id).is_some() => return Some(id),
Some(id)
if layout
.block(id)
.is_some_and(|block| is_heading(&block.body.kind)) =>
{
return Some(id);
}
Some(_) => {}
}
}
@@ -100,6 +106,7 @@ impl PlaygroundView {
#[cfg(test)]
mod tests {
use blocksuite_playground_doc::schema::BlockSpec;
use y_octo::{Any, SessionValue};
use super::ParagraphType;
use crate::{
@@ -245,4 +252,31 @@ mod tests {
session.frame();
assert_eq!(active().as_deref(), Some("h0"));
}
#[test]
fn outline_reveal_releases_a_heading_turned_into_text_in_place() {
let session = outline_session();
let active = || session.view(|view, _| view.active_outline_heading().map(str::to_owned));
session.view(|view, cx| view.reveal_outline_heading(Some("h1".into()), cx));
session.frame();
assert_eq!(active().as_deref(), Some("h1"));
let scroll_y = session.view(|view, _| view.scroll_y);
session.view(|view, cx| {
view.edit_document(cx, |doc| {
let page = doc.workspace.ensure_page(HOME_PAGE_ID).unwrap();
page.set_block_prop(
"h1",
"prop:type",
SessionValue::Any(Any::String("text".into())),
900,
)
.unwrap();
});
});
session.frame();
assert_eq!(session.view(|view, _| view.scroll_y), scroll_y);
assert!(session.view(|view, _| view.flow_layout().unwrap().block("h1").is_some()));
assert_eq!(active().as_deref(), Some("h0"));
}
}
@@ -4,9 +4,10 @@ use std::rc::Rc;
use blocksuite_editor::scroll::{ScrollAxis, wheel_delta};
use ui::{
App, BoxShadow, Context, ElementId, Entity, FontWeight, Hsla, InteractiveElement, IntoElement,
ParentElement, RenderOnce, SharedString, StatefulInteractiveElement, Styled, ViewElement,
Window, div, hsla, prelude::FluentBuilder as _, px,
App, AppContext as _, BoxShadow, Context, ElementId, Entity, FontWeight, Hsla,
InteractiveElement, IntoElement, ParentElement, RenderOnce, SharedString,
StatefulInteractiveElement, Styled, ViewElement, Window, div, hsla,
prelude::FluentBuilder as _, px, svg,
};
use ui_kit::VirtualList;
use ui_tokens::ThemeMode;
@@ -24,6 +25,10 @@ const TICK_HEIGHT: f32 = 16.0;
/// Smallest tick space: ticks shrink to their own height before the rail clips them.
const TICK_MIN_HEIGHT: f32 = 2.0;
const PANEL_PADDING: f32 = 8.0;
/// Height of the panel header: 6 px padding around a 20 px line (`.outline-viewer-header`).
const HEADER_HEIGHT: f32 = 32.0;
/// Side of the `Open in sidebar` button: a 16 px icon in 2 px padding.
const OPEN_BUTTON_SIZE: f32 = 20.0;
const PANEL_WIDTH: f32 = 200.0;
/// Rows mounted above and below the visible part of the heading list.
const OVERSCAN_ROWS: f32 = 2.0;
@@ -52,7 +57,7 @@ pub(crate) fn render_outline_rail(
cx: &Context<DesktopShellView>,
) -> Option<impl IntoElement + use<>> {
if width <= HIDDEN_MAX_PANE_WIDTH
|| height - RAIL_TOP - RAIL_BOTTOM < ROW_HEIGHT + 2.0 * PANEL_PADDING + 2.0
|| height - RAIL_TOP - RAIL_BOTTOM < HEADER_HEIGHT + ROW_HEIGHT + 2.0 * PANEL_PADDING + 2.0
|| store.get_doc(doc).is_none()
{
return None;
@@ -155,7 +160,7 @@ impl RenderOnce for OutlineRail {
let list = VirtualList::fixed(count, ROW_HEIGHT);
let list_height = list
.total_height()
.min(self.height - 2.0 * PANEL_PADDING - 2.0);
.min(self.height - HEADER_HEIGHT - 2.0 * PANEL_PADDING - 2.0);
let max_scroll = list.total_height() - list_height;
let scroll = window.use_keyed_state(
ElementId::NamedInteger(
@@ -182,6 +187,7 @@ impl RenderOnce for OutlineRail {
// Web. While the panel stays open, only the wheel moves the list.
let reveal = active.map(|index| (index as f32 + 0.5) * ROW_HEIGHT - list_height / 2.0);
let reveal_scroll = scroll.clone();
let collapse = hovered.clone();
rail.interactivity().on_hover(move |inside, _, app| {
if *inside
&& !*hovered.read(app)
@@ -299,7 +305,7 @@ impl RenderOnce for OutlineRail {
row.style().justify_content = Some(ui::JustifyContent::FlexStart);
rows = rows.child(row);
}
let panel = panel.child(
let panel = panel.child(self.header(collapse, colors)).child(
div()
.id("desktop.outline.rail.list")
.h(px(list_height))
@@ -355,16 +361,106 @@ impl RenderOnce for OutlineRail {
}
}
impl OutlineRail {
/// `Table of Contents` and the `Open in sidebar` button above the heading list. The
/// button collapses the panel and opens the Outline tab of the right sidebar for this
/// pane, which hides the rail.
fn header(&self, hovered: Entity<bool>, colors: RailColors) -> impl IntoElement + use<> {
let palette = self.palette;
let shell = self.shell.clone();
let workspace = self.workspace.clone();
let pane = self.pane;
let mut open = div()
.id(ElementId::NamedInteger(
SharedString::new_static("outline-rail-open"),
ui::hash(&pane),
))
.snapshot(ui::snap_id!("desktop.outline.rail.open.{pane}"), None)
.size(px(OPEN_BUTTON_SIZE))
.flex_shrink(0.0)
.flex()
.items_center()
.justify_center()
.rounded(px(4.0))
.cursor_pointer()
.hover(move |style| style.bg(palette.hover_color))
.on_click(move |_, _, app| {
hovered.update(app, |hovered, _| *hovered = false);
shell.update(app, |shell, cx| {
if shell.state.store.active_workspace().id != workspace {
return;
}
let Some(index) = shell.state.split.panes.iter().position(|p| p.id == pane)
else {
return;
};
shell.state.split.focus_pane(index);
shell.state.inspector_tab = Some(crate::DocInspectorTab::Outline);
cx.notify();
});
})
.child(
svg()
.data(ui_tokens::icons::TOC.svg.as_bytes())
.size(px(OPEN_BUTTON_SIZE - 4.0))
.text_color(colors.icon),
);
open.interactivity()
.tooltip(move |_, app| app.new(|_| OpenTooltip(palette)).into());
div()
.h(px(HEADER_HEIGHT))
.w_full()
.flex_shrink(0.0)
.p(px(6.0))
.flex()
.items_center()
.gap(px(4.0))
.child(
div()
.flex_1()
.min_w_0()
.truncate()
.text_size(px(12.0))
.line_height(px(20.0))
.font_weight(FontWeight::MEDIUM)
.text_color(palette.text_secondary)
.child("Table of Contents"),
)
.child(open)
}
}
struct OpenTooltip(DesktopPalette);
impl ui::Render for OpenTooltip {
fn render(&mut self, _: &mut Window, _: &mut Context<Self>) -> impl IntoElement {
div()
.px(px(8.0))
.py(px(4.0))
.rounded(px(4.0))
.bg(self.0.bg_elevated)
.text_color(self.0.text_primary)
.text_size(px(12.0))
.child("Open in sidebar")
}
}
/// Space of each tick and the number of ticks that fit in `height`. Ticks keep 16 px each
/// while they fit, then shrink alike down to their own 2 px height, and the rail clips the
/// rest, as the `flex: 1 1 16px` ticks do in Web.
/// rest, as the `flex: 1 1 16px` ticks do in Web. The count compares against the 2 px floor,
/// so the rounding of `height / count` never drops a tick that fits.
fn tick_layout(count: usize, height: f32) -> (f32, usize) {
if count == 0 {
return (TICK_HEIGHT, 0);
}
let pitch = (height / count as f32).clamp(TICK_MIN_HEIGHT, TICK_HEIGHT);
(pitch, ((height / pitch).floor() as usize).min(count))
let shown = ((height / TICK_MIN_HEIGHT).floor() as usize).min(count);
(pitch, shown)
}
const TICK_TOKEN: &str = "--affine-black-10";
const ACTIVE_TEXT_TOKEN: &str = "--affine-v2-text-emphasis";
const ICON_TOKEN: &str = "--affine-icon-color";
/// Theme colors of the rail that the desktop palette does not carry.
#[derive(Clone, Copy)]
@@ -375,6 +471,8 @@ struct RailColors {
active_tick: Hsla,
/// `text/emphasis`, the color of the active entry in the panel.
active_text: Hsla,
/// `--affine-icon-color`, the `Open in sidebar` icon.
icon: Hsla,
}
impl RailColors {
@@ -385,6 +483,7 @@ impl RailColors {
tick: color(TICK_TOKEN, tokens.border),
active_tick: crate::rgba_to_hsla(tokens.text_primary),
active_text: color(ACTIVE_TEXT_TOKEN, tokens.text_emphasis),
icon: color(ICON_TOKEN, tokens.text_secondary),
}
}
}
@@ -401,8 +500,11 @@ mod tests {
};
use ui_tokens::ThemeMode;
use super::{ACTIVE_TEXT_TOKEN, TICK_HEIGHT, TICK_TOKEN, tick_layout};
use crate::{DesktopAppState, DesktopShellView, register_desktop_fonts, split_view::PaneId};
use super::{ACTIVE_TEXT_TOKEN, ICON_TOKEN, RAIL_BOTTOM, TICK_HEIGHT, TICK_TOKEN, tick_layout};
use crate::{
DesktopAppState, DesktopShellView, DocInspectorTab, register_desktop_fonts,
split_view::PaneId,
};
const HEIGHT: f32 = 800.0;
@@ -592,7 +694,7 @@ mod tests {
fn rail_color_tokens_exist_in_both_themes() {
for mode in [ThemeMode::Light, ThemeMode::Dark] {
let tokens = crate::theme_tokens_for(mode);
for name in [TICK_TOKEN, ACTIVE_TEXT_TOKEN] {
for name in [TICK_TOKEN, ACTIVE_TEXT_TOKEN, ICON_TOKEN] {
assert!(tokens.color(name).is_some(), "{name} in {mode:?}");
}
}
@@ -605,11 +707,116 @@ mod tests {
(25, 400.0, (16.0, 25)),
(50, 400.0, (8.0, 50)),
(512, 400.0, (2.0, 200)),
(45, 400.0, (400.0_f32 / 45.0_f32, 45)),
(50, 428.0, (428.0_f32 / 50.0_f32, 50)),
(0, 400.0, (TICK_HEIGHT, 0)),
] {
assert_eq!(tick_layout(count, height), expected, "{count} ticks");
}
}
#[test]
fn the_last_of_50_entries_keeps_its_tick_after_its_row_reveals_it() {
let mut state = DesktopAppState::seed_showcase(ThemeMode::Light, "2026-12-03");
let (doc, ids) = add_sections(&mut state, "Outline", 49, 2);
state.open_doc_in_active_pane(&doc);
let pane = state.split.active().id;
let app = Shell::new(1280, state);
let rail = format!("desktop.outline.rail.{pane}");
// The rail reaches down to 76 px above the pane bottom: 428 px, where `428 / 50`
// rounds up.
let top = app.element(&rail).unwrap().bounds.y;
let body = app.element("desktop.pane.0").unwrap().bounds;
assert_eq!(body.y + body.height - RAIL_BOTTOM - top, 428.0);
let (x, y) = app.center(&rail);
app.hover(x, y);
let panel = app
.element(&format!("desktop.outline.rail.panel.{pane}"))
.unwrap()
.bounds;
app.scroll(
panel.x + panel.width / 2.0,
panel.y + panel.height / 2.0,
-1.0e6,
);
app.click(&format!("desktop.outline.rail.heading.{pane}.{}", ids[48]));
assert_eq!(
app.active_heading(pane, &doc).as_deref(),
Some(ids[48].as_str())
);
app.hover(1.0, 1.0);
assert!(
app.element(&format!("desktop.outline.rail.panel.{pane}"))
.is_none()
);
assert_eq!(app.active_tick(pane, 50), Some(49));
}
#[test]
fn open_in_sidebar_focuses_its_pane_and_hands_the_outline_to_the_sidebar() {
let mut state = DesktopAppState::seed_showcase(ThemeMode::Light, "2026-12-03");
let (doc, _) = add_sections(&mut state, "Outline", 60, 2);
state.open_doc_in_active_pane(&doc);
state.open_doc_in_split(&doc);
let panes: Vec<PaneId> = state.split.panes.iter().map(|pane| pane.id).collect();
assert_eq!(panes.len(), 2);
let active = state.split.active_pane;
let target = 1 - active;
let pane = panes[target];
let app = Shell::new(2200, state);
let (x, y) = app.center(&format!("desktop.outline.rail.{pane}"));
app.hover(x, y);
let panel = app
.element(&format!("desktop.outline.rail.panel.{pane}"))
.unwrap()
.bounds;
let body = app
.element(&format!("desktop.pane.{target}"))
.unwrap()
.bounds;
assert!(
panel.y + panel.height <= body.y + body.height - RAIL_BOTTOM + 0.01,
"panel {panel:?} in pane {body:?}"
);
let open = app
.element(&format!("desktop.outline.rail.open.{pane}"))
.unwrap()
.bounds;
assert_eq!((open.width, open.height), (20.0, 20.0));
// 1 px border, 8 px panel padding, 6 px header padding.
assert_eq!(open.y - panel.y, 15.0);
app.click(&format!("desktop.outline.rail.open.{pane}"));
app.update(|shell, _, _| {
assert_eq!(shell.state.split.active_pane, target);
assert_eq!(shell.state.inspector_tab, Some(DocInspectorTab::Outline));
});
for pane in &panes {
assert!(
app.element(&format!("desktop.outline.rail.{pane}"))
.is_none()
);
}
app.update(|shell, _, cx| {
shell.state.inspector_tab = None;
cx.notify();
});
app.window.request_frame();
assert!(
app.element(&format!("desktop.outline.rail.{pane}"))
.is_some()
);
assert!(
app.element(&format!("desktop.outline.rail.panel.{pane}"))
.is_none()
);
assert!(
app.element(&format!("desktop.outline.rail.tick.{pane}"))
.is_some()
);
}
#[test]
fn split_panes_of_one_page_track_their_own_active_heading() {
let mut state = DesktopAppState::seed_showcase(ThemeMode::Light, "2026-12-03");
@@ -100,13 +100,13 @@ fn outline_rail_mounts_a_bounded_window_of_512_headings_while_it_scrolls_and_rev
app.hover(&rail);
let open = app.bounds(&panel);
// 1 px border and 8 px padding above and below the list.
let list_top = open.y + 9.0;
// 1 px border and 8 px padding around the panel, and the 32 px header above the list.
let list_top = open.y + 9.0 + 32.0;
let list_bottom = open.y + open.height - 9.0;
// The pane body starts below the 52 px header; the panel keeps 204 px above it and
// 76 px below it, less its border and padding.
// 76 px below it, less its border, padding, and header.
let body = app.bounds("desktop.pane.0");
let list_height = body.height - 52.0 - 204.0 - 76.0 - 18.0;
let list_height = body.height - 52.0 - 204.0 - 76.0 - 18.0 - 32.0;
assert_eq!(list_bottom - list_top, list_height);
// The showcase document has headings of its own above the added ones.
let base = ((app.bounds(&heading(0)).y - list_top) / ROW) as usize;
@@ -17,11 +17,11 @@ use super::{
};
// Menu glyphs from @blocksuite/icons 2.2.17.
const EDIT_ICON_SVG: &[u8] = br#"<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.303 4.498a.85.85 0 0 1 1.2 0c.33.33.33.863 0 1.192l-.43.428-1.196-1.195zm-1.488 1.485 1.197 1.195-7.086 7.072H9.75v-1.216zm3.747-2.547a2.35 2.35 0 0 0-3.318 0L8.47 12.192a.75.75 0 0 0-.22.531V15c0 .414.336.75.75.75h2.236a.75.75 0 0 0 .53-.22l8.796-8.778c.917-.915.917-2.4 0-3.316M4.75 6c0-.69.56-1.25 1.25-1.25h6a.75.75 0 0 0 0-1.5H6A2.75 2.75 0 0 0 3.25 6v12A2.75 2.75 0 0 0 6 20.75h12A2.75 2.75 0 0 0 20.75 18v-6a.75.75 0 0 0-1.5 0v6c0 .69-.56 1.25-1.25 1.25H6c-.69 0-1.25-.56-1.25-1.25z" fill-rule="evenodd"/></svg>"#;
const SHARE_ICON_SVG: &[u8] = br#"<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18 3.75a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5M14.25 6a3.75 3.75 0 1 1 .799 2.314l-5.427 2.713a3.75 3.75 0 0 1 0 1.946l5.427 2.713a3.75 3.75 0 1 1-.671 1.341L8.95 14.314a3.75 3.75 0 1 1 0-4.628l5.427-2.713A3.8 3.8 0 0 1 14.25 6M6 9.75a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5m12 6a2.25 2.25 0 1 0-.002 4.5 2.25 2.25 0 0 0 .002-4.5" fill-rule="evenodd"/></svg>"#;
const OPEN_IN_NEW_ICON_SVG: &[u8] = br#"<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13.25 4a.75.75 0 0 1 .75-.75h6a.75.75 0 0 1 .75.75v6a.75.75 0 0 1-1.5 0V5.81l-8.72 8.72a.75.75 0 1 1-1.06-1.06l8.72-8.72H14a.75.75 0 0 1-.75-.75M6 6.75c-.69 0-1.25.56-1.25 1.25v10c0 .69.56 1.25 1.25 1.25h10c.69 0 1.25-.56 1.25-1.25v-4a.75.75 0 0 1 1.5 0v4A2.75 2.75 0 0 1 16 20.75H6A2.75 2.75 0 0 1 3.25 18V8A2.75 2.75 0 0 1 6 5.25h4a.75.75 0 0 1 0 1.5z" fill-rule="evenodd"/></svg>"#;
const PAGE_WIDTH_ICON_SVG: &[u8] = br#"<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5 5.75a.75.75 0 0 0 0 1.5h14a.75.75 0 0 0 0-1.5zm0 3.5a.75.75 0 0 0 0 1.5h14a.75.75 0 0 0 0-1.5zm-.75 4.25a.75.75 0 0 1 .75-.75h14a.75.75 0 0 1 0 1.5H5a.75.75 0 0 1-.75-.75M5 16.25a.75.75 0 0 0 0 1.5h7a.75.75 0 0 0 0-1.5z" fill-rule="evenodd"/></svg>"#;
const TOC_ICON_SVG: &[u8] = br#"<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 5.25a.75.75 0 0 0 0 1.5h15.023a.75.75 0 0 0 0-1.5zM9 9.25a.75.75 0 0 0 0 1.5h10a.75.75 0 0 0 0-1.5zM4.25 14a.75.75 0 0 1 .75-.75h14a.75.75 0 0 1 0 1.5H5a.75.75 0 0 1-.75-.75M9 17.25a.75.75 0 0 0 0 1.5h10a.75.75 0 0 0 0-1.5z"/></svg>"#;
const EDIT_ICON_SVG: &[u8] = icons::EDIT.svg.as_bytes();
const SHARE_ICON_SVG: &[u8] = icons::SHARE.svg.as_bytes();
const OPEN_IN_NEW_ICON_SVG: &[u8] = icons::OPEN_IN_NEW.svg.as_bytes();
const PAGE_WIDTH_ICON_SVG: &[u8] = icons::PAGE_WIDTH.svg.as_bytes();
const TOC_ICON_SVG: &[u8] = icons::TOC.svg.as_bytes();
pub(in crate::workbench) struct HeaderOverlay {
target: DocTarget,
+5
View File
@@ -111,6 +111,11 @@ const CORE_ICONS = [
['EXPAND_FULL', 'ExpandFullIcon'],
['HOME', 'HomeIcon'],
['ALL_DOCS', 'AllDocsIcon'],
['TOC', 'TocIcon'],
['EDIT', 'EditIcon'],
['SHARE', 'ShareIcon'],
['OPEN_IN_NEW', 'OpenInNewIcon'],
['PAGE_WIDTH', 'LongerIcon'],
];
/**
+30
View File
@@ -483,6 +483,31 @@ pub const ALL_DOCS: IconDef = IconDef {
svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M10.167 3.25c-.783 0-1.417.634-1.417 1.417V15.5c0 .782.634 1.417 1.417 1.417h8.666c.783 0 1.417-.635 1.417-1.417V8.125h-2.5a1.833 1.833 0 0 1-1.833-1.833V3.25zm7.25 1.223 1.913 2.152h-1.58a.333.333 0 0 1-.333-.333zM7.25 4.667a2.917 2.917 0 0 1 2.917-2.917h6.5a.75.75 0 0 1 .56.252l4.334 4.875a.75.75 0 0 1 .189.498V15.5a2.917 2.917 0 0 1-2.917 2.917H16.75v.916a2.917 2.917 0 0 1-2.917 2.917H5.708a3.46 3.46 0 0 1-3.458-3.458V8.5a2.917 2.917 0 0 1 2.917-2.917H7.25zm0 2.416H5.167c-.783 0-1.417.635-1.417 1.417v10.292c0 1.081.877 1.958 1.958 1.958h8.125c.783 0 1.417-.634 1.417-1.417v-.916h-5.083A2.917 2.917 0 0 1 7.25 15.5zm4.333-.25a.75.75 0 0 1 .75-.75h1.409a.75.75 0 0 1 0 1.5h-1.409a.75.75 0 0 1-.75-.75m0 3.25a.75.75 0 0 1 .75-.75h4.334a.75.75 0 0 1 0 1.5h-4.334a.75.75 0 0 1-.75-.75m0 3.25a.75.75 0 0 1 .75-.75h3.25a.75.75 0 0 1 0 1.5h-3.25a.75.75 0 0 1-.75-.75\" fill=\"#000\" fill-rule=\"evenodd\" clip-rule=\"evenodd\"/></svg>",
};
pub const TOC: IconDef = IconDef {
name: "TocIcon",
svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M4 5.25a.75.75 0 0 0 0 1.5h15.023a.75.75 0 0 0 0-1.5zM9 9.25a.75.75 0 0 0 0 1.5h10a.75.75 0 0 0 0-1.5zM4.25 14a.75.75 0 0 1 .75-.75h14a.75.75 0 0 1 0 1.5H5a.75.75 0 0 1-.75-.75M9 17.25a.75.75 0 0 0 0 1.5h10a.75.75 0 0 0 0-1.5z\" fill=\"#000\" fill-rule=\"nonzero\" clip-rule=\"nonzero\"/></svg>",
};
pub const EDIT: IconDef = IconDef {
name: "EditIcon",
svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M18.303 4.498a.85.85 0 0 1 1.2 0c.33.33.33.863 0 1.192l-.43.428-1.196-1.195zm-1.488 1.485 1.197 1.195-7.086 7.072H9.75v-1.216zm3.747-2.547a2.35 2.35 0 0 0-3.318 0L8.47 12.192a.75.75 0 0 0-.22.531V15c0 .414.336.75.75.75h2.236a.75.75 0 0 0 .53-.22l8.796-8.778c.917-.915.917-2.4 0-3.316M4.75 6c0-.69.56-1.25 1.25-1.25h6a.75.75 0 0 0 0-1.5H6A2.75 2.75 0 0 0 3.25 6v12A2.75 2.75 0 0 0 6 20.75h12A2.75 2.75 0 0 0 20.75 18v-6a.75.75 0 0 0-1.5 0v6c0 .69-.56 1.25-1.25 1.25H6c-.69 0-1.25-.56-1.25-1.25z\" fill=\"#000\" fill-rule=\"evenodd\" clip-rule=\"evenodd\"/></svg>",
};
pub const SHARE: IconDef = IconDef {
name: "ShareIcon",
svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M18 3.75a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5M14.25 6a3.75 3.75 0 1 1 .799 2.314l-5.427 2.713a3.75 3.75 0 0 1 0 1.946l5.427 2.713a3.75 3.75 0 1 1-.671 1.341L8.95 14.314a3.75 3.75 0 1 1 0-4.628l5.427-2.713A3.8 3.8 0 0 1 14.25 6M6 9.75a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5m12 6a2.25 2.25 0 1 0-.002 4.5 2.25 2.25 0 0 0 .002-4.5\" fill=\"#000\" fill-rule=\"evenodd\" clip-rule=\"evenodd\"/></svg>",
};
pub const OPEN_IN_NEW: IconDef = IconDef {
name: "OpenInNewIcon",
svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M13.25 4a.75.75 0 0 1 .75-.75h6a.75.75 0 0 1 .75.75v6a.75.75 0 0 1-1.5 0V5.81l-8.72 8.72a.75.75 0 1 1-1.06-1.06l8.72-8.72H14a.75.75 0 0 1-.75-.75M6 6.75c-.69 0-1.25.56-1.25 1.25v10c0 .69.56 1.25 1.25 1.25h10c.69 0 1.25-.56 1.25-1.25v-4a.75.75 0 0 1 1.5 0v4A2.75 2.75 0 0 1 16 20.75H6A2.75 2.75 0 0 1 3.25 18V8A2.75 2.75 0 0 1 6 5.25h4a.75.75 0 0 1 0 1.5z\" fill=\"#000\" fill-rule=\"evenodd\" clip-rule=\"evenodd\"/></svg>",
};
pub const PAGE_WIDTH: IconDef = IconDef {
name: "LongerIcon",
svg: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M5 5.75a.75.75 0 0 0 0 1.5h14a.75.75 0 0 0 0-1.5zm0 3.5a.75.75 0 0 0 0 1.5h14a.75.75 0 0 0 0-1.5zm-.75 4.25a.75.75 0 0 1 .75-.75h14a.75.75 0 0 1 0 1.5H5a.75.75 0 0 1-.75-.75M5 16.25a.75.75 0 0 0 0 1.5h7a.75.75 0 0 0 0-1.5z\" fill=\"#000\" fill-rule=\"evenodd\" clip-rule=\"evenodd\"/></svg>",
};
pub const ALL_ICONS: &[IconDef] = &[
ADD_TEXT,
ALL_DOCS,
@@ -520,6 +545,7 @@ pub const ALL_ICONS: &[IconDef] = &[
DRAG_HANDLE,
DUPLICATE,
EDGELESS,
EDIT,
EXPAND_FULL,
EXPAND,
FAVORITE,
@@ -542,6 +568,7 @@ pub const ALL_ICONS: &[IconDef] = &[
LINK,
LINKED_PAGE,
LOCK,
PAGE_WIDTH,
MINUS,
MORE_HORIZONTAL,
MORE_VERTICAL,
@@ -549,6 +576,7 @@ pub const ALL_ICONS: &[IconDef] = &[
MOVE_RIGHT,
NOTE,
NUMBERED_LIST,
OPEN_IN_NEW,
PAGE,
PEN,
PLUS,
@@ -560,6 +588,7 @@ pub const ALL_ICONS: &[IconDef] = &[
SELECT,
SETTINGS,
SHAPE,
SHARE,
SIDEBAR,
SPLIT_VIEW,
SQUARE,
@@ -567,6 +596,7 @@ pub const ALL_ICONS: &[IconDef] = &[
TAG,
TEX,
TEXT,
TOC,
TODAY,
TOGGLE_DOWN,
TOGGLE_RIGHT,