diff --git a/.docs/wiki/3D.md b/.docs/wiki/3D.md index a92bbf85..e223403e 100644 --- a/.docs/wiki/3D.md +++ b/.docs/wiki/3D.md @@ -4,11 +4,13 @@ From 0.10.0 a structure you drew can be turned in 3D: build it from the drawing, ## The 3D View -Select a structure and choose 3D > 3D View (`Ctrl+3`, `Cmd+3` on a Mac). A panel floats over the drawing and follows your selection; drag it by its title and resize it from its corner. The first time it opens it loads the 3D viewer (3Dmol.js), so FormChem starts no slower for people who never use 3D. +Select a structure and choose 3D > 3D View (`Ctrl+3`, `Cmd+3` on a Mac). The view fills the window and follows your selection. To see the drawing beside it, click the button next to the close button (or double-click the title, or press Escape): it becomes a floating panel you can drag by its title and resize from its corner, and FormChem remembers which you chose. The button beside it hides the tools on the right for a model the full width of the window. The first time it opens it loads the 3D viewer (3Dmol.js), so FormChem starts no slower for people who never use 3D. | Do | How | | --- | --- | -| Turn and zoom | drag to turn, wheel to zoom | +| Turn | drag with the left button | +| Zoom | scroll, drag with the right button or Shift+drag, or the Zoom In and Zoom Out buttons | +| Pan | drag with the middle button or Ctrl+drag | | Change the style | Wire, Stick, Ball and Stick, Space Filling, Cartoon (proteins), or 3D > Display | | Add a surface | the Surface list (van der Waals, solvent accessible, solvent excluded) or 3D > Surface; ESP colours it by charge | | Show the ligand | Focus the ligand; Reset view brings the whole model back | diff --git a/CHANGELOG.md b/CHANGELOG.md index f9e131e3..e299be55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,21 @@ Versions follow `v*.*.*` with dots. Dates are US Eastern. +## 0.14.1 · 2026-12-06 + +The 3D View fills the window. It opened as a small floating panel, which left little room to turn, zoom and pan a molecule; it now opens across the whole window between the title bar and the status bar, and says how to move the model. + +### Changed + +- 3D > 3D View opens filling the window. The new button in its header, a double-click on its title or Escape turn it back into a floating panel you can drag and resize, and FormChem remembers your choice. +- The tools on the right of the 3D View (conformers, measure, energy, surface, model) hide and show with the button beside it, for a model the full width of the window. +- Zoom In and Zoom Out buttons sit beside Reset View, and a line on the model gives the mouse: drag to rotate; scroll, right-drag or Shift+drag to zoom; middle-drag or Ctrl+drag to pan. + +### Fixed + +- Panning the 3D model with the middle mouse button on Linux showed "The clipboard holds nothing FormChem can paste." +- With the 3D View open, a structure added to a new, empty drawing left Build 3D greyed out until the structure was selected. + ## 0.14.0 · 2026-12-06 The parity pass, the last phase of the plan: FormChem now does what a chemist reaches for daily when drawing for a paper, a lab or a class. Reaction schemes hold together (Space Reaction, conditions that follow their arrow, arrows that stretch to their conditions, step letters with footnotes, wrapping), journal styles apply to a drawing you already have, rings and templates fuse onto the bond or atom you click, labels such as CH2CH2OH and C(O)NHMe become chemistry, and a drawing can have many pages with headers and footers. Pictures leave in the formats journals ask for, the Analysis panel shows predicted 1H, 13C, IR and MS tables, the 3D View gains energy terms, surfaces, bond rotation, crystal packing and proteins by id, and a periodic table and a constants window join the reference tools. The template library was rebuilt as the owner asked: "the templates are only starter molecule structures and whole real molecules, not single parts". Every requirement of the specifications FormChem is measured against is now either met or carries a written decision in `docs/PARITY.md`. diff --git a/README.md b/README.md index 692cb10f..f9822fdb 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ with an MCP server so an agent works in the same window you see. Local-first, no account.

- version 0.14.0 + version 0.14.1 TypeScript and Vite Python and FastAPI macOS, Windows, Linux @@ -176,7 +176,7 @@ cd formchem `./formchem desktop dev` opens the desktop window instead. On Windows use `formchem.bat install` and `formchem.bat`. The engine listens on `127.0.0.1:8220` (MCP at `/mcp`); `FORMCHEM_DATA_DIR` moves the data folder from `~/formchem`. > [!IMPORTANT] -> **Status:** in development, in a public repository since 5 December 2026. This version draws, checks and analyses structures and reactions, with stereochemistry, query structures and calculated properties, from 0.7.0 reads and writes the common chemistry files, exports pictures, prints, copies and pastes, and converts files on the command line, from 0.8.0 lets agents draw, edit, check and convert directly, from 0.9.0 reads and writes chemical names, predicts NMR spectra and opens JCAMP-DX spectra, from 0.10.0 builds structures in 3D, searches conformers, opens PDB and mmCIF files and extracts their ligands, from 0.11.0 keeps structure databases and a lab notebook, from 0.12.0 shares live structures and a structure library with the other Form apps, works from the keyboard with spoken atoms, reads and writes HELM, and runs xtb and CREST you install, and from 0.13.0 opens the files the system hands the desktop app (databases, PDB, CIF, mmCIF and JCAMP-DX included) with document icons for `.fchem` and `.fcdb`, carries its whole data folder in the desktop app so names and HELM work there, and comes with demos, the manual and a parity score, and from 0.14.0, the parity pass, lays out reaction schemes, applies journal styles to drawings you have, fuses rings and templates by clicking, reads condensed labels, keeps several pages, exports journal-ready pictures, predicts IR, MS and NMR tables, and adds 3D energy terms, surfaces, proteins by id and crystal packing, a periodic table and 27 agent tools. 0.14.0 is the current release, and with it all fourteen phases of the plan are built. The 0.7.0 to 0.14.0 desktop apps have not been run on a Mac or on Windows yet (the 0.13.0 and 0.14.0 Linux packages were built through formcompiler and run), 0.8.0's agent tools were checked over stdio and HTTP, 0.9.0's and 0.10.0's in process and 0.11.0's and 0.12.0's over HTTP, not yet with a real Claude Code or Codex client, the NMR accuracy figures rest on approximate reference shifts, the 3D View ran on software WebGL only, no sibling app has opened a live structure yet, no real screen reader has been run, and xtb and CREST were checked with stand-in programs only. Nothing is built or released for download yet. +> **Status:** in development, in a public repository since 5 December 2026. This version draws, checks and analyses structures and reactions, with stereochemistry, query structures and calculated properties, from 0.7.0 reads and writes the common chemistry files, exports pictures, prints, copies and pastes, and converts files on the command line, from 0.8.0 lets agents draw, edit, check and convert directly, from 0.9.0 reads and writes chemical names, predicts NMR spectra and opens JCAMP-DX spectra, from 0.10.0 builds structures in 3D, searches conformers, opens PDB and mmCIF files and extracts their ligands, from 0.11.0 keeps structure databases and a lab notebook, from 0.12.0 shares live structures and a structure library with the other Form apps, works from the keyboard with spoken atoms, reads and writes HELM, and runs xtb and CREST you install, and from 0.13.0 opens the files the system hands the desktop app (databases, PDB, CIF, mmCIF and JCAMP-DX included) with document icons for `.fchem` and `.fcdb`, carries its whole data folder in the desktop app so names and HELM work there, and comes with demos, the manual and a parity score, and from 0.14.0, the parity pass, lays out reaction schemes, applies journal styles to drawings you have, fuses rings and templates by clicking, reads condensed labels, keeps several pages, exports journal-ready pictures, predicts IR, MS and NMR tables, and adds 3D energy terms, surfaces, proteins by id and crystal packing, a periodic table and 27 agent tools. 0.14.1 is the current release (0.14.0 with a 3D View that fills the window), and with it all fourteen phases of the plan are built. The 0.7.0 to 0.14.0 desktop apps have not been run on a Mac or on Windows yet (the 0.13.0 and 0.14.0 Linux packages were built through formcompiler and run), 0.8.0's agent tools were checked over stdio and HTTP, 0.9.0's and 0.10.0's in process and 0.11.0's and 0.12.0's over HTTP, not yet with a real Claude Code or Codex client, the NMR accuracy figures rest on approximate reference shifts, the 3D View ran on software WebGL only, no sibling app has opened a live structure yet, no real screen reader has been run, and xtb and CREST were checked with stand-in programs only. Nothing is built or released for download yet. **Contributing:** branch from `main`, keep changes to source here, and leave packaging and releases to FormCompiler. See [`CONTRIBUTING.md`](CONTRIBUTING.md), [`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md), [`.docs/BRANCHING.md`](.docs/BRANCHING.md) and [`AGENTS.md`](AGENTS.md). Report security issues privately as [`SECURITY.md`](SECURITY.md) describes. @@ -207,7 +207,7 @@ You need Python 3.12+, Node 20.19+ and Rust everywhere, plus Xcode's Command Lin | `src-tauri/` | Desktop shell; it starts the engine folder on macOS and the engine sidecar elsewhere, registers the `formai://` link, FormChem's file types and document icons | | `demos/` | Three offline browser demos (drawing, reactions, 3D) built from the window's code; each opens from its folder with no engine | -Its size, in non-blank lines: about 55,400 of TypeScript, 2,600 of CSS, 42,900 of Python, 804 of Rust (product code, tests excluded, counted by `./formchem counts`; `./formchem counts --check` fails when this line drifts from the code). +Its size, in non-blank lines: about 55,500 of TypeScript, 2,600 of CSS, 42,900 of Python, 804 of Rust (product code, tests excluded, counted by `./formchem counts`; `./formchem counts --check` fails when this line drifts from the code). Manual: [`docs/MANUAL.md`](docs/MANUAL.md) · Parity with the specifications: [`docs/PARITY.md`](docs/PARITY.md) · Docs: [`.docs/wiki`](.docs/wiki) · Extensions: [`docs/EXTENSIONS.md`](docs/EXTENSIONS.md) · Formats: [`docs/FORMATS.md`](docs/FORMATS.md) · Names: [`docs/NAMES.md`](docs/NAMES.md) · Spectra and NMR: [`docs/SPECTRA.md`](docs/SPECTRA.md) · 3D: [`docs/3D.md`](docs/3D.md) · Databases: [`docs/DATABASES.md`](docs/DATABASES.md) and the contract [`docs/DATABASE.md`](docs/DATABASE.md) · Live structures: [`docs/LIVE-STRUCTURES.md`](docs/LIVE-STRUCTURES.md) and the contract [`docs/LIVE_STRUCTURES.md`](docs/LIVE_STRUCTURES.md) · Accessibility: [`docs/ACCESSIBILITY.md`](docs/ACCESSIBILITY.md) · HELM: [`docs/HELM.md`](docs/HELM.md) · Command line: [`docs/CLI.md`](docs/CLI.md) · Agent tools: [`docs/AGENTS.md`](docs/AGENTS.md) · Agents: [`CLAUDE.md`](CLAUDE.md), [`AGENTS.md`](AGENTS.md) · Contributing: [`.docs/BRANCHING.md`](.docs/BRANCHING.md) diff --git a/backend/app/__init__.py b/backend/app/__init__.py index 9e78220f..f075dd36 100644 --- a/backend/app/__init__.py +++ b/backend/app/__init__.py @@ -1 +1 @@ -__version__ = "0.14.0" +__version__ = "0.14.1" diff --git a/docs/3D.md b/docs/3D.md index 47eace88..1399da9d 100644 --- a/docs/3D.md +++ b/docs/3D.md @@ -43,7 +43,7 @@ The reasons behind each choice are in `backend/HASHOUT_LOG.md` entries 199 to 22 ## The 3D View -3D > 3D View (`Mod+3`) opens a floating panel on the selected structure, or on the selected 3D object on the page, and follows the selection. The viewer is 3Dmol.js 3.0.0 (BSD-3-Clause), loaded the first time a 3D view opens; starting FormChem loads none of it. Without WebGL the panel says so. +3D > 3D View (`Mod+3`) opens on the selected structure, or on the selected 3D object on the page, and follows the selection. From 0.14.1 it fills the window between the title bar and the status bar; the header's Fill the window button, a double-click on the title or Escape switch it to a floating panel that drags and resizes, and the choice is kept in the browser's local storage (`formchem-3d-layout`, with the side tools shown or hidden). Mouse: drag rotates; scroll, right-drag or Shift+drag zooms; middle-drag or Ctrl+drag pans (3Dmol.js's own mapping); a middle press in the panel never pastes. The viewer is 3Dmol.js 3.0.0 (BSD-3-Clause), loaded the first time a 3D view opens; starting FormChem loads none of it. Without WebGL the panel says so. | Control | What it does | | --- | --- | @@ -52,7 +52,8 @@ The reasons behind each choice are in `backend/HASHOUT_LOG.md` entries 199 to 22 | Build 3D | builds a conformer from the drawing | | Minimise, force field | minimises the shown conformer with MMFF94, MMFF94s or UFF | | Conformers..., Scan... | the conformer search and the dihedral scan dialogs | -| Focus the ligand, Reset view, Spin | Spin is off, with the reason, when the system asks for reduced motion | +| Focus the ligand, Zoom out, Zoom in, Reset view, Spin | Spin is off, with the reason, when the system asks for reduced motion | +| Hide or show the 3D tools, Fill the window | in the header; both are remembered | | Export | PNG, PNG with a transparent background, glTF binary | | Conformers list | energy relative to the lowest, population, method; click a row to show that conformer | | Measure | Distance, Angle, Dihedral; click atoms in the view | diff --git a/frontend/HASHOUT_LOG.md b/frontend/HASHOUT_LOG.md index c4bc1d9f..d66e3f64 100644 --- a/frontend/HASHOUT_LOG.md +++ b/frontend/HASHOUT_LOG.md @@ -1,6 +1,6 @@ # frontend HASHOUT_LOG -Living log for the FormChem frontend and its desktop shell (src-tauri), _v0.1.0 to _v0.14.0. For 0.1.0 and 0.2.0 it follows the family template (formdeck's window and formvis's title bar), so most reasons there are about what was kept, what was dropped, and why. From 0.3.0 it records the document client, the window's own chemistry, from 0.4.0 the canvas: renderer, tools, view and tool rail, and from 0.5.0 the drawn objects (arrows, symbols, brackets, shapes, tables, TLC, orbitals, images, captions, groups), their tools and handles, the stoichiometry panel, the template library and the Reaction commands, and from 0.6.0 the analysis client, the chemistry marks layer, the stereo, query, R-group and abbreviation commands and dialogs, the structure check panel, the properties section with the isotope plot, Set Reaction Roles, and the Tauri CLI pin, and from 0.7.0 the one-folder engine start, the dark page, scaling on the sheet, the wrapping panel rows, the folding menu row, grids and snapping, picture export, print and the shared save path, the embedded source, the clipboard, the import report, Standardise and the quick command state mirror, and from 0.8.0 the window tools that render, report the selection and show drawings for agents, Agent activity, the editing chip with Stop, the agent marks and the token in the Agents dialog, and from 0.9.0 Structure from Name, the Name section, Copy Name and pasting a name, the spectrum object kind with its data cache and page plot, atom links, the Spectrum editor, the spectrum and NMR prediction commands, and from 0.10.0 the 3D View panel over a lazily loaded 3Dmol.js, the model3d page object with its snapshots, measurements, surfaces with ESP, the Conformers and Dihedral Scan dialogs, the glTF writer, structure files in Open and Import, Extract Ligand and Export 3D Structure, and the stale-conformer rule mirrored in the client, and from 0.11.0 the full-window database workspace (virtualised table, gallery, form, the shared selection and record paging, fields, settings, duplicates and record details), search with the query builder, hit lists, saved queries, import, export and the plot, the lab notebook view with its entry editor, Edit Scheme and signing, `.fcdb` in Open and drops, the view key, and the new mark, and from 0.12.0 live structures (the library client, Copy as Live Structure, the live drawing and its Save, drops, the deep link), the Structure Library dialog, the file changed bar, accessibility (the key route ahead of the canvas, spoken atoms and bonds, the shared announcer, the focus ring, element palettes, the Structure Summary), the HELM dialog and commands, and the xtb and CREST dialogs and Preferences section, and from 0.13.0 files handed over by the system (the receiver, the shell's path handling, the file associations, the Linux MIME package and desktop entry, the macOS document types, the Windows installer hook), Home's Demos and Help > Demos, and the browser demos built from the window's code, and from 0.14.0 the parity pass (the Template tool and Insert Glassware, the new bond and ring gestures, selection drill-down, smart guides and nudges, the hover panels, atom numbers and the periodic table picker, the abbreviation library, journal styles and per-character text formatting, butt caps and mitres, pages with the page strip, Page Setup and headers, table and TLC editing, the undo selection, the picture encoders and the Print dialog, clipboard flavours, reaction marks, followers and the arrow badge, the spectra tables and stoichiometry extras, found elemental analysis, the 3D View's tabs, viewer and offscreen renders, the periodic table and constants windows, and the integration fixes). The code carries almost no comments; the reasons live here, anchored by file and symbol. Read the map and the TOC first. +Living log for the FormChem frontend and its desktop shell (src-tauri), _v0.1.0 to _v0.14.1. For 0.1.0 and 0.2.0 it follows the family template (formdeck's window and formvis's title bar), so most reasons there are about what was kept, what was dropped, and why. From 0.3.0 it records the document client, the window's own chemistry, from 0.4.0 the canvas: renderer, tools, view and tool rail, and from 0.5.0 the drawn objects (arrows, symbols, brackets, shapes, tables, TLC, orbitals, images, captions, groups), their tools and handles, the stoichiometry panel, the template library and the Reaction commands, and from 0.6.0 the analysis client, the chemistry marks layer, the stereo, query, R-group and abbreviation commands and dialogs, the structure check panel, the properties section with the isotope plot, Set Reaction Roles, and the Tauri CLI pin, and from 0.7.0 the one-folder engine start, the dark page, scaling on the sheet, the wrapping panel rows, the folding menu row, grids and snapping, picture export, print and the shared save path, the embedded source, the clipboard, the import report, Standardise and the quick command state mirror, and from 0.8.0 the window tools that render, report the selection and show drawings for agents, Agent activity, the editing chip with Stop, the agent marks and the token in the Agents dialog, and from 0.9.0 Structure from Name, the Name section, Copy Name and pasting a name, the spectrum object kind with its data cache and page plot, atom links, the Spectrum editor, the spectrum and NMR prediction commands, and from 0.10.0 the 3D View panel over a lazily loaded 3Dmol.js, the model3d page object with its snapshots, measurements, surfaces with ESP, the Conformers and Dihedral Scan dialogs, the glTF writer, structure files in Open and Import, Extract Ligand and Export 3D Structure, and the stale-conformer rule mirrored in the client, and from 0.11.0 the full-window database workspace (virtualised table, gallery, form, the shared selection and record paging, fields, settings, duplicates and record details), search with the query builder, hit lists, saved queries, import, export and the plot, the lab notebook view with its entry editor, Edit Scheme and signing, `.fcdb` in Open and drops, the view key, and the new mark, and from 0.12.0 live structures (the library client, Copy as Live Structure, the live drawing and its Save, drops, the deep link), the Structure Library dialog, the file changed bar, accessibility (the key route ahead of the canvas, spoken atoms and bonds, the shared announcer, the focus ring, element palettes, the Structure Summary), the HELM dialog and commands, and the xtb and CREST dialogs and Preferences section, and from 0.13.0 files handed over by the system (the receiver, the shell's path handling, the file associations, the Linux MIME package and desktop entry, the macOS document types, the Windows installer hook), Home's Demos and Help > Demos, and the browser demos built from the window's code, and from 0.14.0 the parity pass (the Template tool and Insert Glassware, the new bond and ring gestures, selection drill-down, smart guides and nudges, the hover panels, atom numbers and the periodic table picker, the abbreviation library, journal styles and per-character text formatting, butt caps and mitres, pages with the page strip, Page Setup and headers, table and TLC editing, the undo selection, the picture encoders and the Print dialog, clipboard flavours, reaction marks, followers and the arrow badge, the spectra tables and stoichiometry extras, found elemental analysis, the 3D View's tabs, viewer and offscreen renders, the periodic table and constants windows, and the integration fixes). The code carries almost no comments; the reasons live here, anchored by file and symbol. Read the map and the TOC first. ## Org navi map @@ -464,6 +464,9 @@ assets/ formchem_mark.svg, icon_src/build.py, icon set 350. Moving many atoms is one op; crossings are swept once · canvas/tools/draft.ts moveAtoms; canvas/render/renderer.ts SWEEP_AT 351. Integration: registrations, menus and keys · app.ts, app/canvas.ts, app/menus.ts, app/commands-shell.ts 352. A dialog that lost focus still hears Escape · ui/dialogs.ts watchStrayKeys +353. The 3D View fills the window · ui/view3d-panel.ts setMax, setSide +354. A panel with nothing bound picks up the first structure · ui/view3d-panel.ts bind +355. A middle press in the 3D View never pastes · app/clipboard.ts middleIn3d ## 1. Dependencies are the template's, nothing more · _v0.1.0 (package.json) @@ -1873,6 +1876,18 @@ app.ts registers the glassware, page, annotation and style commands; app/canvas. The xtb and CREST dialogs disable Run while they look for the programs, and Chromium drops focus to the body without a blur, so Escape never reached the dialog. A capture-phase window listener closes the top dialog on Escape and gives Tab back to it when focus is outside. +## 353. The 3D View fills the window · _v0.14.1 (ui/view3d-panel.ts setMax, setSide, loadLayout, saveLayout, RESTORE_ICON; ui/view3d-viewer.ts zoomBy; styles/view3d.css .is-max, .is-noside, .fc-v3d-mouse) + +The owner asked why the 3D View was a small popout. The floating geometry stays as it was; `.is-max` pins the same element between the title bar and the status bar with `!important` so the left and top a drag wrote inline survive for the way back. Layout is applied in the constructor while the panel is still hidden, so the first open paints in its final size with no jump. The choice lives in localStorage under `formchem-3d-layout` (wrapped in try and catch; a lost value falls back to full window). Hiding the side tools sets the second grid column to 0 and hides the aside with visibility, so the stage keeps its node and the ResizeObserver resizes the viewer. The mouse line names 3Dmol.js 3.0.0's own mapping (`_handleMouseMove`: left rotates, right or Shift zooms, middle or Ctrl pans, Ctrl+right slabs). The restore glyph is local to the panel because icons.ts has no inward arrows. Escape first leaves full window, then closes. + +## 354. A panel with nothing bound picks up the first structure · _v0.14.1 (ui/view3d-panel.ts bind client.on) + +A new drawing emits `selection` once from setClient while it is still empty, so the panel bound no fragment and Build 3D stayed disabled when a structure arrived by paste, an agent or a route. On each tx or reset, a panel bound to nothing asks the host for the page's sole or selected fragment again. + +## 355. A middle press in the 3D View never pastes · _v0.14.1 (app/clipboard.ts middleIn3d) + +Linux pastes the primary selection on a middle click, and the paste event does not land inside the WebGL host, so a preventDefault there is not enough. The clipboard module notes a middle press inside `.fc-v3d` and ignores a paste within 3 s of it; the auxclick default is also prevented in the stage, as the canvas does. + ## Not verified at 0.4.0 The lasso tool in the real window (its band path is the marquee's), touch pinch and Safari gesture events, the Tauri webview (dialogs, native accelerators, `contenteditable="plaintext-only"` in older WebKit), light themes, the rotate handle on dark pages, extensions against a real package, and socket drop with resync during an edit. The title field collapses to a sliver at 1280 px wide because the menu bar takes the room; it predates this work. diff --git a/frontend/package-lock.json b/frontend/package-lock.json index ad83f802..3f29a8ca 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1,12 +1,12 @@ { "name": "formchem", - "version": "0.14.0", + "version": "0.14.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "formchem", - "version": "0.14.0", + "version": "0.14.1", "license": "Apache-2.0", "dependencies": { "@tauri-apps/api": "2.12.1", diff --git a/frontend/package.json b/frontend/package.json index d6c0f9dd..c2107f82 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,7 +1,7 @@ { "name": "formchem", "private": true, - "version": "0.14.0", + "version": "0.14.1", "description": "FormChem · chemical structure drawing in the FormAI family", "license": "Apache-2.0", "type": "module", diff --git a/frontend/src/app/clipboard.ts b/frontend/src/app/clipboard.ts index aaa50af2..8d60eb6e 100644 --- a/frontend/src/app/clipboard.ts +++ b/frontend/src/app/clipboard.ts @@ -413,7 +413,11 @@ export function mountClipboard(deps: ClipboardDeps): ClipboardApi { document.addEventListener('beforepaste', (e) => { if (ours(e)) e.preventDefault(); }); document.addEventListener('copy', (e) => { if (ours(e)) void copy(e); }); document.addEventListener('cut', (e) => { if (ours(e)) void cut(e); }); - document.addEventListener('paste', (e) => { if (ours(e)) void paste(e); }); + let middleIn3d = -Infinity; + document.addEventListener('pointerdown', (e) => { + if (e.button === 1) middleIn3d = (e.target as Element | null)?.closest?.('.fc-v3d') ? performance.now() : -Infinity; + }, { capture: true }); + document.addEventListener('paste', (e) => { if (ours(e) && performance.now() - middleIn3d > 3000) void paste(e); }); window.addEventListener('keydown', (e) => { if (e.defaultPrevented || e.altKey || e.shiftKey || !(IS_MAC ? e.metaKey : e.ctrlKey) || typing(document.activeElement)) return; const k = e.key.toLowerCase(); diff --git a/frontend/src/i18n/keys/part22.json b/frontend/src/i18n/keys/part22.json new file mode 100644 index 00000000..89625edc --- /dev/null +++ b/frontend/src/i18n/keys/part22.json @@ -0,0 +1,9 @@ +[ +"Hide the 3D tools", +"Fill the window", +"Zoom out", +"Zoom in", +"Drag to rotate · Scroll, right-drag or Shift+drag to zoom · Middle-drag or Ctrl+drag to pan", +"Back to a floating window", +"Show the 3D tools" +] diff --git a/frontend/src/i18n/locales/cs/part22.json b/frontend/src/i18n/locales/cs/part22.json new file mode 100644 index 00000000..f493204d --- /dev/null +++ b/frontend/src/i18n/locales/cs/part22.json @@ -0,0 +1,9 @@ +{ + "0": "Skrýt 3D nástroje", + "1": "Vyplnit okno", + "2": "Oddálit", + "3": "Přiblížit", + "4": "Tažením otáčet · Kolečko, tažení pravým tlačítkem nebo Shift+tažení přibližuje · Tažení prostředním tlačítkem nebo Ctrl+tažení posouvá", + "5": "Zpět do plovoucího okna", + "6": "Zobrazit 3D nástroje" +} diff --git a/frontend/src/i18n/locales/da/part22.json b/frontend/src/i18n/locales/da/part22.json new file mode 100644 index 00000000..aa1e8f69 --- /dev/null +++ b/frontend/src/i18n/locales/da/part22.json @@ -0,0 +1,9 @@ +{ + "0": "Skjul 3D-værktøjerne", + "1": "Udfyld vinduet", + "2": "Zoom ud", + "3": "Zoom ind", + "4": "Træk for at rotere · Rul, højretræk eller Shift+træk for at zoome · Midtertræk eller Ctrl+træk for at panorere", + "5": "Tilbage til et flydende vindue", + "6": "Vis 3D-værktøjerne" +} diff --git a/frontend/src/i18n/locales/de/part22.json b/frontend/src/i18n/locales/de/part22.json new file mode 100644 index 00000000..e975b8f6 --- /dev/null +++ b/frontend/src/i18n/locales/de/part22.json @@ -0,0 +1,9 @@ +{ + "0": "3D-Werkzeuge ausblenden", + "1": "Fenster ausfüllen", + "2": "Verkleinern", + "3": "Vergrößern", + "4": "Ziehen zum Drehen · Mausrad, Ziehen mit rechter Taste oder Umschalt+Ziehen zum Zoomen · Ziehen mit mittlerer Taste oder Strg+Ziehen zum Verschieben", + "5": "Zurück zum schwebenden Fenster", + "6": "3D-Werkzeuge einblenden" +} diff --git a/frontend/src/i18n/locales/es-MX/part22.json b/frontend/src/i18n/locales/es-MX/part22.json new file mode 100644 index 00000000..4158867e --- /dev/null +++ b/frontend/src/i18n/locales/es-MX/part22.json @@ -0,0 +1,9 @@ +{ + "0": "Ocultar las herramientas 3D", + "1": "Llenar la ventana", + "2": "Alejar", + "3": "Acercar", + "4": "Arrastra para girar · Rueda, arrastre con el botón derecho o Mayús+arrastre para hacer zoom · Arrastre con el botón central o Ctrl+arrastre para desplazar", + "5": "Volver a una ventana flotante", + "6": "Mostrar las herramientas 3D" +} diff --git a/frontend/src/i18n/locales/es/part22.json b/frontend/src/i18n/locales/es/part22.json new file mode 100644 index 00000000..0a85ccba --- /dev/null +++ b/frontend/src/i18n/locales/es/part22.json @@ -0,0 +1,9 @@ +{ + "0": "Ocultar las herramientas 3D", + "1": "Llenar la ventana", + "2": "Alejar", + "3": "Acercar", + "4": "Arrastre para girar · Rueda, arrastre con el botón derecho o Mayús+arrastre para hacer zoom · Arrastre con el botón central o Ctrl+arrastre para desplazar", + "5": "Volver a una ventana flotante", + "6": "Mostrar las herramientas 3D" +} diff --git a/frontend/src/i18n/locales/fi/part22.json b/frontend/src/i18n/locales/fi/part22.json new file mode 100644 index 00000000..fe960f36 --- /dev/null +++ b/frontend/src/i18n/locales/fi/part22.json @@ -0,0 +1,9 @@ +{ + "0": "Piilota 3D-työkalut", + "1": "Täytä ikkuna", + "2": "Loitonna", + "3": "Lähennä", + "4": "Kierrä vetämällä · Zoomaa rullalla, oikealla vedolla tai Vaihto+vedolla · Panoroi keskivedolla tai Ctrl+vedolla", + "5": "Takaisin kelluvaan ikkunaan", + "6": "Näytä 3D-työkalut" +} diff --git a/frontend/src/i18n/locales/fr-CA/part22.json b/frontend/src/i18n/locales/fr-CA/part22.json new file mode 100644 index 00000000..c79cb331 --- /dev/null +++ b/frontend/src/i18n/locales/fr-CA/part22.json @@ -0,0 +1,9 @@ +{ + "0": "Masquer les outils 3D", + "1": "Remplir la fenêtre", + "2": "Zoom arrière", + "3": "Zoom avant", + "4": "Faites glisser pour tourner · Molette, glisser avec le bouton droit ou Maj+glisser pour zoomer · Glisser avec le bouton du milieu ou Ctrl+glisser pour déplacer", + "5": "Revenir à une fenêtre flottante", + "6": "Afficher les outils 3D" +} diff --git a/frontend/src/i18n/locales/fr/part22.json b/frontend/src/i18n/locales/fr/part22.json new file mode 100644 index 00000000..c79cb331 --- /dev/null +++ b/frontend/src/i18n/locales/fr/part22.json @@ -0,0 +1,9 @@ +{ + "0": "Masquer les outils 3D", + "1": "Remplir la fenêtre", + "2": "Zoom arrière", + "3": "Zoom avant", + "4": "Faites glisser pour tourner · Molette, glisser avec le bouton droit ou Maj+glisser pour zoomer · Glisser avec le bouton du milieu ou Ctrl+glisser pour déplacer", + "5": "Revenir à une fenêtre flottante", + "6": "Afficher les outils 3D" +} diff --git a/frontend/src/i18n/locales/hu/part22.json b/frontend/src/i18n/locales/hu/part22.json new file mode 100644 index 00000000..479de777 --- /dev/null +++ b/frontend/src/i18n/locales/hu/part22.json @@ -0,0 +1,9 @@ +{ + "0": "A 3D-eszközök elrejtése", + "1": "Az ablak kitöltése", + "2": "Kicsinyítés", + "3": "Nagyítás", + "4": "Húzással forgatás · Görgetés, jobb gombos húzás vagy Shift+húzás a nagyításhoz · Középső gombos húzás vagy Ctrl+húzás a mozgatáshoz", + "5": "Vissza lebegő ablakba", + "6": "A 3D-eszközök megjelenítése" +} diff --git a/frontend/src/i18n/locales/id/part22.json b/frontend/src/i18n/locales/id/part22.json new file mode 100644 index 00000000..1ec71129 --- /dev/null +++ b/frontend/src/i18n/locales/id/part22.json @@ -0,0 +1,9 @@ +{ + "0": "Sembunyikan alat 3D", + "1": "Penuhi jendela", + "2": "Perkecil", + "3": "Perbesar", + "4": "Seret untuk memutar · Gulir, seret kanan, atau Shift+seret untuk zoom · Seret tengah atau Ctrl+seret untuk menggeser", + "5": "Kembali ke jendela mengambang", + "6": "Tampilkan alat 3D" +} diff --git a/frontend/src/i18n/locales/it/part22.json b/frontend/src/i18n/locales/it/part22.json new file mode 100644 index 00000000..68bfe17b --- /dev/null +++ b/frontend/src/i18n/locales/it/part22.json @@ -0,0 +1,9 @@ +{ + "0": "Nascondi gli strumenti 3D", + "1": "Riempi la finestra", + "2": "Riduci", + "3": "Ingrandisci", + "4": "Trascina per ruotare · Rotellina, trascinamento con il tasto destro o Maiusc+trascina per lo zoom · Trascinamento con il tasto centrale o Ctrl+trascina per spostare", + "5": "Torna a una finestra mobile", + "6": "Mostra gli strumenti 3D" +} diff --git a/frontend/src/i18n/locales/ja/part22.json b/frontend/src/i18n/locales/ja/part22.json new file mode 100644 index 00000000..7d099920 --- /dev/null +++ b/frontend/src/i18n/locales/ja/part22.json @@ -0,0 +1,9 @@ +{ + "0": "3D ツールを隠す", + "1": "ウィンドウ全体に表示", + "2": "縮小", + "3": "拡大", + "4": "ドラッグで回転 · ホイール、右ドラッグまたは Shift+ドラッグでズーム · 中ボタンドラッグまたは Ctrl+ドラッグで移動", + "5": "フローティングウィンドウに戻す", + "6": "3D ツールを表示" +} diff --git a/frontend/src/i18n/locales/ko/part22.json b/frontend/src/i18n/locales/ko/part22.json new file mode 100644 index 00000000..bd5a1985 --- /dev/null +++ b/frontend/src/i18n/locales/ko/part22.json @@ -0,0 +1,9 @@ +{ + "0": "3D 도구 숨기기", + "1": "창 전체에 표시", + "2": "축소", + "3": "확대", + "4": "드래그하여 회전 · 휠, 오른쪽 드래그 또는 Shift+드래그로 확대/축소 · 가운데 드래그 또는 Ctrl+드래그로 이동", + "5": "떠 있는 창으로 돌아가기", + "6": "3D 도구 표시" +} diff --git a/frontend/src/i18n/locales/nb/part22.json b/frontend/src/i18n/locales/nb/part22.json new file mode 100644 index 00000000..6a30e9f4 --- /dev/null +++ b/frontend/src/i18n/locales/nb/part22.json @@ -0,0 +1,9 @@ +{ + "0": "Skjul 3D-verktøyene", + "1": "Fyll vinduet", + "2": "Zoom ut", + "3": "Zoom inn", + "4": "Dra for å rotere · Rull, høyredra eller Shift+dra for å zoome · Midtdra eller Ctrl+dra for å panorere", + "5": "Tilbake til et flytende vindu", + "6": "Vis 3D-verktøyene" +} diff --git a/frontend/src/i18n/locales/nl/part22.json b/frontend/src/i18n/locales/nl/part22.json new file mode 100644 index 00000000..e85ee5e7 --- /dev/null +++ b/frontend/src/i18n/locales/nl/part22.json @@ -0,0 +1,9 @@ +{ + "0": "3D-gereedschap verbergen", + "1": "Venster vullen", + "2": "Uitzoomen", + "3": "Inzoomen", + "4": "Sleep om te draaien · Scrollen, rechts slepen of Shift+slepen om te zoomen · Middel slepen of Ctrl+slepen om te verschuiven", + "5": "Terug naar een zwevend venster", + "6": "3D-gereedschap tonen" +} diff --git a/frontend/src/i18n/locales/pl/part22.json b/frontend/src/i18n/locales/pl/part22.json new file mode 100644 index 00000000..374fb2da --- /dev/null +++ b/frontend/src/i18n/locales/pl/part22.json @@ -0,0 +1,9 @@ +{ + "0": "Ukryj narzędzia 3D", + "1": "Wypełnij okno", + "2": "Pomniejsz", + "3": "Powiększ", + "4": "Przeciągnij, aby obrócić · Kółko, przeciąganie prawym przyciskiem lub Shift+przeciąganie, aby powiększyć · Przeciąganie środkowym przyciskiem lub Ctrl+przeciąganie, aby przesunąć", + "5": "Wróć do pływającego okna", + "6": "Pokaż narzędzia 3D" +} diff --git a/frontend/src/i18n/locales/pt-BR/part22.json b/frontend/src/i18n/locales/pt-BR/part22.json new file mode 100644 index 00000000..e76c67bf --- /dev/null +++ b/frontend/src/i18n/locales/pt-BR/part22.json @@ -0,0 +1,9 @@ +{ + "0": "Ocultar as ferramentas 3D", + "1": "Preencher a janela", + "2": "Diminuir zoom", + "3": "Aumentar zoom", + "4": "Arraste para girar · Roda, arrastar com o botão direito ou Shift+arrastar para zoom · Arrastar com o botão do meio ou Ctrl+arrastar para mover", + "5": "Voltar para uma janela flutuante", + "6": "Mostrar as ferramentas 3D" +} diff --git a/frontend/src/i18n/locales/ru/part22.json b/frontend/src/i18n/locales/ru/part22.json new file mode 100644 index 00000000..6898e1c4 --- /dev/null +++ b/frontend/src/i18n/locales/ru/part22.json @@ -0,0 +1,9 @@ +{ + "0": "Скрыть 3D-инструменты", + "1": "Заполнить окно", + "2": "Уменьшить", + "3": "Увеличить", + "4": "Перетаскивание вращает · Колесо, перетаскивание правой кнопкой или Shift+перетаскивание масштабирует · Перетаскивание средней кнопкой или Ctrl+перетаскивание сдвигает", + "5": "Вернуть плавающее окно", + "6": "Показать 3D-инструменты" +} diff --git a/frontend/src/i18n/locales/sv/part22.json b/frontend/src/i18n/locales/sv/part22.json new file mode 100644 index 00000000..a9e76cba --- /dev/null +++ b/frontend/src/i18n/locales/sv/part22.json @@ -0,0 +1,9 @@ +{ + "0": "Dölj 3D-verktygen", + "1": "Fyll fönstret", + "2": "Zooma ut", + "3": "Zooma in", + "4": "Dra för att rotera · Rulla, högerdra eller Skift+dra för att zooma · Mittendra eller Ctrl+dra för att panorera", + "5": "Tillbaka till ett flytande fönster", + "6": "Visa 3D-verktygen" +} diff --git a/frontend/src/i18n/locales/th/part22.json b/frontend/src/i18n/locales/th/part22.json new file mode 100644 index 00000000..1e3859ed --- /dev/null +++ b/frontend/src/i18n/locales/th/part22.json @@ -0,0 +1,9 @@ +{ + "0": "ซ่อนเครื่องมือ 3D", + "1": "เต็มหน้าต่าง", + "2": "ซูมออก", + "3": "ซูมเข้า", + "4": "ลากเพื่อหมุน · เลื่อนล้อ ลากด้วยปุ่มขวา หรือ Shift+ลาก เพื่อซูม · ลากด้วยปุ่มกลาง หรือ Ctrl+ลาก เพื่อเลื่อน", + "5": "กลับไปเป็นหน้าต่างลอย", + "6": "แสดงเครื่องมือ 3D" +} diff --git a/frontend/src/i18n/locales/tr/part22.json b/frontend/src/i18n/locales/tr/part22.json new file mode 100644 index 00000000..6cf2e34e --- /dev/null +++ b/frontend/src/i18n/locales/tr/part22.json @@ -0,0 +1,9 @@ +{ + "0": "3B araçlarını gizle", + "1": "Pencereyi doldur", + "2": "Uzaklaştır", + "3": "Yakınlaştır", + "4": "Döndürmek için sürükleyin · Yakınlaştırmak için tekerlek, sağ tuşla sürükleme veya Shift+sürükleme · Kaydırmak için orta tuşla sürükleme veya Ctrl+sürükleme", + "5": "Kayan pencereye dön", + "6": "3B araçlarını göster" +} diff --git a/frontend/src/i18n/locales/uk/part22.json b/frontend/src/i18n/locales/uk/part22.json new file mode 100644 index 00000000..706e9a69 --- /dev/null +++ b/frontend/src/i18n/locales/uk/part22.json @@ -0,0 +1,9 @@ +{ + "0": "Сховати 3D-інструменти", + "1": "Заповнити вікно", + "2": "Зменшити", + "3": "Збільшити", + "4": "Перетягування обертає · Коліщатко, перетягування правою кнопкою або Shift+перетягування масштабує · Перетягування середньою кнопкою або Ctrl+перетягування зсуває", + "5": "Повернути плаваюче вікно", + "6": "Показати 3D-інструменти" +} diff --git a/frontend/src/i18n/locales/vi/part22.json b/frontend/src/i18n/locales/vi/part22.json new file mode 100644 index 00000000..5d64dd87 --- /dev/null +++ b/frontend/src/i18n/locales/vi/part22.json @@ -0,0 +1,9 @@ +{ + "0": "Ẩn công cụ 3D", + "1": "Lấp đầy cửa sổ", + "2": "Thu nhỏ", + "3": "Phóng to", + "4": "Kéo để xoay · Cuộn, kéo chuột phải hoặc Shift+kéo để thu phóng · Kéo chuột giữa hoặc Ctrl+kéo để di chuyển", + "5": "Trở lại cửa sổ nổi", + "6": "Hiện công cụ 3D" +} diff --git a/frontend/src/i18n/locales/zh-Hans/part22.json b/frontend/src/i18n/locales/zh-Hans/part22.json new file mode 100644 index 00000000..6822df66 --- /dev/null +++ b/frontend/src/i18n/locales/zh-Hans/part22.json @@ -0,0 +1,9 @@ +{ + "0": "隐藏 3D 工具", + "1": "填满窗口", + "2": "缩小", + "3": "放大", + "4": "拖动以旋转 · 滚轮、右键拖动或 Shift+拖动以缩放 · 中键拖动或 Ctrl+拖动以平移", + "5": "回到浮动窗口", + "6": "显示 3D 工具" +} diff --git a/frontend/src/i18n/locales/zh-Hant/part22.json b/frontend/src/i18n/locales/zh-Hant/part22.json new file mode 100644 index 00000000..0b3e08db --- /dev/null +++ b/frontend/src/i18n/locales/zh-Hant/part22.json @@ -0,0 +1,9 @@ +{ + "0": "隱藏 3D 工具", + "1": "填滿視窗", + "2": "縮小", + "3": "放大", + "4": "拖曳以旋轉 · 滾輪、右鍵拖曳或 Shift+拖曳以縮放 · 中鍵拖曳或 Ctrl+拖曳以平移", + "5": "回到浮動視窗", + "6": "顯示 3D 工具" +} diff --git a/frontend/src/styles/view3d.css b/frontend/src/styles/view3d.css index cb721e94..efd04e9f 100644 --- a/frontend/src/styles/view3d.css +++ b/frontend/src/styles/view3d.css @@ -1,5 +1,10 @@ .fc-v3d { position: fixed; top: calc(var(--fc-titlebar-h, 40px) + 16px); right: 16px; z-index: var(--z-companion); display: grid; grid-template-rows: auto auto auto minmax(0, 1fr) auto; width: min(760px, calc(100vw - 32px)); height: min(540px, calc(100vh - 96px)); min-width: 420px; min-height: 340px; overflow: hidden; resize: both; border: 1px solid var(--line-3, var(--line-2)); border-radius: var(--radius-lg); background: var(--surface-2); box-shadow: var(--shadow-lg); color: var(--text-primary); font-size: var(--fc-13); } .fc-v3d[hidden] { display: none; } +.fc-v3d.is-max { top: var(--fc-titlebar-h, 40px) !important; right: 0 !important; bottom: var(--fc-status-h, 28px) !important; left: 0 !important; width: auto !important; height: auto !important; min-width: 0; resize: none; border-width: 1px 0; border-radius: 0; box-shadow: none; } +.fc-v3d.is-max .fc-v3d-head { cursor: default; } +.fc-v3d.is-noside .fc-v3d-main { grid-template-columns: minmax(0, 1fr) 0; } +.fc-v3d.is-noside .fc-v3d-side { visibility: hidden; border-left: 0; } +.fc-v3d-mouse { position: absolute; top: 8px; left: 10px; z-index: var(--z-local-2); max-width: calc(100% - 20px); margin: 0; padding: 4px 8px; border-radius: var(--radius); background: var(--glass-bg); color: var(--text-muted); font-size: var(--fc-12); line-height: 1.3; pointer-events: none; } .fc-v3d-head { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 6px 0 12px; border-bottom: 1px solid var(--line-1); cursor: grab; user-select: none; touch-action: none; } .fc-v3d-head:active { cursor: grabbing; } .fc-v3d-title { font-weight: 600; } diff --git a/frontend/src/ui/view3d-panel.ts b/frontend/src/ui/view3d-panel.ts index a975a420..176e4e3c 100644 --- a/frontend/src/ui/view3d-panel.ts +++ b/frontend/src/ui/view3d-panel.ts @@ -97,6 +97,8 @@ function markup(): string { return `