diff --git a/packages/shared/src/components/MainLayout.tsx b/packages/shared/src/components/MainLayout.tsx index 86b6eee64c1..0c872eb1e20 100644 --- a/packages/shared/src/components/MainLayout.tsx +++ b/packages/shared/src/components/MainLayout.tsx @@ -26,6 +26,8 @@ import { } from '../contexts'; import { useFeedLayout, useViewSize, ViewSize } from '../hooks'; import { BootPopups } from './modals/BootPopups'; +import { SmartComposerHotkey } from './post/SmartComposerHotkey'; +import { SmartComposerDevToggle } from './post/SmartComposerDevToggle'; import { StreakMilestonePopup } from './modals/streaks/StreakMilestonePopup'; import { useFeedName } from '../hooks/feed/useFeedName'; import { AuthTriggers } from '../lib/auth'; @@ -185,6 +187,8 @@ function MainLayoutComponent({ + + {plusEntryAnnouncementBar && ( void; inlineActions?: ReactNode; + /** + * Slot rendered before any inline actions and formatting buttons. Useful for + * a leading control (e.g. a post-type picker) that should sit at the start + * of the toolbar with a visual divider after it. + */ + inlineActionsLeading?: ReactNode; rightActions?: ReactNode; allowBlockFormatting?: boolean; + /** + * Drop the visual border separator. Useful when the toolbar sits at the + * bottom of a flat editor container (no surrounding card). + */ + borderless?: boolean; } export interface RichTextToolbarRef { openLinkModal: () => void; } +interface ToolbarItem { + id: string; + tooltip: string; + label: string; + icon: ReactElement; + isActive: boolean; + onClick: () => void; + disabled?: boolean; + priority: number; + /** + * Visual group identifier — items in the same group render adjacent to each + * other; a divider is drawn whenever the rendered group changes. + */ + group: string; +} + +const ToolbarDivider = (): ReactElement => ( + +); + interface ToolbarButtonProps { tooltip: string; icon: ReactElement; @@ -47,37 +92,84 @@ const ToolbarButton = ({ isActive, onClick, disabled = false, -}: ToolbarButtonProps): ReactElement | null => { - if (disabled) { +}: ToolbarButtonProps): ReactElement => ( + +