diff --git a/apps/app/package.json b/apps/app/package.json index 08a4913..0cce0d8 100644 --- a/apps/app/package.json +++ b/apps/app/package.json @@ -15,6 +15,6 @@ "react-dom": "19.3.1", "svgo": "4.1.0", "tesseract.js-core": "7.0.0", - "tipjar": "1.2.0" + "tipjar": "2.2.0" } } diff --git a/apps/app/src/App.tsx b/apps/app/src/App.tsx index 51b5f6e..f3e6e39 100644 --- a/apps/app/src/App.tsx +++ b/apps/app/src/App.tsx @@ -68,7 +68,7 @@ import { bounds, effective, fromSlider, snap, step, toSlider, type Zoom } from ' import { sampleImage } from './lib/sample' import { track } from './lib/track' import { Canvas, type Overlays, type SelectMode, type Tool, type ViewMode } from './components/Canvas' -import { ShortcutsDialog } from './components/Shortcuts' +import { REDO_KEYS, ShortcutsDialog, UNDO_KEYS } from './components/Shortcuts' import { ExportOptions } from './components/ExportOptions' import { CLEAN_TOOLS, EDIT_TOOLS, ModeSwitch, ToolRail, useWide, type WorkMode } from './components/Workspace' import { Dock, DOCK_ICON, MoreMenu, type DockSlot } from './components/Dock' @@ -1229,10 +1229,6 @@ export default function App() { tools={EDIT_TOOLS(strokes, lineTrace)} tool={tool} onTool={chooseTool} - canUndo={history.past.length > 0} - canRedo={history.future.length > 0} - onUndo={() => historyStep('undo')} - onRedo={() => historyStep('redo')} /> ) const cleanRail = ( @@ -1240,10 +1236,6 @@ export default function App() { tools={CLEAN_TOOLS(settings.removeBackground)} tool={cleanTool} onTool={chooseCleanTool} - canUndo={history.past.length > 0} - canRedo={history.future.length > 0} - onUndo={() => historyStep('undo')} - onRedo={() => historyStep('redo')} /> ) const modeRail = workMode === 'edit' ? rail : workMode === 'clean' ? cleanRail : null @@ -1659,6 +1651,42 @@ export default function App() { ] : [view('image', 'Image'), view('type', 'Type'), view('tune', 'Tune'), view('export', 'Export')] + /** Split, Difference and Vector: beside the mode tabs on a wide screen, in the canvas's foot on a phone. Active in the primary buttons' mustard. */ + const compare = ( +
+ {( + [ + ['split', 'Split'], + ['difference', 'Difference'], + ['vector', 'Vector'], + ] as const + ).map(([v, label]) => ( + + ))} +
+ ) + return (
{/* On a phone the page scrolls under it until a trace opens; then the layout fits the screen. */} -
+

{/* The landing page and docs live beside the app, at the site root. */} @@ -1696,7 +1724,7 @@ export default function App() {

Image to SVG, in your browser.

- {/* A phone's undo and redo: on a wide screen they are at the foot of the tool rail. */} + {/* A phone's undo and redo: on a wide screen they are in the mode bar above the canvas. */} {docked && workMode !== 'trace' && (
historyStep('undo')}> @@ -1747,6 +1775,25 @@ export default function App() { {/* The mode switcher, above the canvas; a phone switches modes and tools in the dock instead. */}
+ {workMode !== 'clean' && ( + <> +
{modeRail && wide && modeRail} @@ -1834,44 +1881,11 @@ export default function App() { )}
- {/* One row, the same height as the sidebar's footer beside it (lg). The hint shows where there's room for it - (each view's button carries it as a tooltip too) and shortens rather than wrapping. */} -
-
- {( - [ - ['split', 'Split'], - ['difference', 'Difference'], - ['vector', 'Vector'], - ] as const - ).map(([v, label]) => ( - - ))} -
-

- {COMPARE_HINT[mode]} -

+ {/* One row, the same height as the sidebar's footer beside it (lg): the overlays and zoom on the left (a wide screen has + Split, Difference and Vector above, beside the modes). The hint shows where there's room for it, at the right + (each view's button carries it as a tooltip too), and shortens rather than wrapping. */} +
+ {!wide && compare}
+

+ {COMPARE_HINT[mode]} +

) : ( @@ -2185,20 +2202,18 @@ export default function App() {
)} - {/* No room for a page footer, so one quiet line ends the sidebar. A phone has these in the header's menu. */} -