velxio/frontend/src
David Montero Crespo b4ab742456 feat(oss): portable .vlx project export/import for self-hosters
Phase 4 of the OSS / pro split. The OSS image has no auth and no
server-side persistence — without this commit, the user's workspace
was ephemeral (lost on tab refresh). `.vlx` is a single-file JSON
snapshot of the entire workspace (boards, file groups, components,
wires, active board id) that the user can save to disk and reload
later.

New: utils/vlxFile.ts
  - buildVlxPayload() / buildVlxBlob() — pure snapshot of the current
    editor + simulator stores.
  - triggerDownloadVlx({ name? }) — anchor-click download with a safe
    filename. Returns the filename actually used.
  - parseVlxFile(File) — async reader + validator. Checks
    format === "velxio-project", version <= 1, and the required
    arrays/objects are present. Throws VlxParseError with a human-
    readable message on any issue.
  - importVlxFile(File) — convenience wrapper that parses AND calls
    useSimulatorStore.loadProjectState() with the result.

Format intentionally mirrors the server's POST /api/projects body so
a Pro user can export-from-pro and import-into-OSS losslessly (and
vice-versa once Pro adds an Export button — out of scope here).

lib/proSaveAction.ts: the default (no-overlay) implementation now
calls triggerDownloadVlx() instead of console.info'ing about the
missing handler. The Pro overlay still wins via installSaveActionImpl()
— Save in Pro keeps opening SaveProjectModal. The Save button in OSS
now actually saves.

components/editor/FileExplorer.tsx: new "Open .vlx" button next to
New + Save. Opens a hidden file input; confirms with the user before
replacing the workspace (loadProjectState is destructive); surfaces
VlxParseError messages via window.alert.

Verified with both builds:
  - OSS-only: triggerSaveAction → download .vlx; FileExplorer shows
    3 buttons (New, Open, Save).
  - OSS + overlay: Pro's installSaveActionImpl overrides — Save opens
    SaveProjectModal as before. Open .vlx still works (independent
    button, not part of the save flow).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 16:33:00 -03:00
..
__pro_stub__ feat: add optional extension hooks for private overlays 2026-05-04 14:03:20 -03:00
__tests__ feat(examples): Pico Doom — Wolf3D-style raycaster on RP2040 + ILI9341 2026-05-13 22:54:35 +02:00
assets
components feat(oss): portable .vlx project export/import for self-hosters 2026-05-14 16:33:00 -03:00
data feat(examples): Pico Doom — Wolf3D-style raycaster on RP2040 + ILI9341 2026-05-13 22:54:35 +02:00
hooks refactor(oss-split): remove auth/admin/profile frontend from OSS 2026-05-14 15:31:12 -03:00
i18n feat(landing): bump pricing display to 100/500/2000 daily credits 2026-05-14 08:10:25 +02:00
lib feat(oss): portable .vlx project export/import for self-hosters 2026-05-14 16:33:00 -03:00
pages refactor(oss-split): remove auth/admin/profile frontend from OSS 2026-05-14 15:31:12 -03:00
services refactor(oss-split): remove auth/admin/profile frontend from OSS 2026-05-14 15:31:12 -03:00
simulation feat(i2c): cross-board bridging across all velxio boards (AVR/RP2040/ESP32 xtensa+riscv) 2026-05-12 17:51:39 -03:00
store refactor(oss-split): remove auth/admin/profile frontend from OSS 2026-05-14 15:31:12 -03:00
tokens feat(landing+theme): multiplier pricing copy + softer canvas 2026-05-13 21:02:48 +02:00
types feat(components): pro_only flag + registry merge API + picker gate hook 2026-05-05 10:33:53 -03:00
utils feat(oss): portable .vlx project export/import for self-hosters 2026-05-14 16:33:00 -03:00
velxio-elements
App.css feat(editor): view-mode toggle, agent-chat slot, toolbar polish 2026-05-08 00:56:51 -03:00
App.tsx refactor(oss-split): remove auth/admin/profile frontend from OSS 2026-05-14 15:31:12 -03:00
entry-server.tsx refactor: rename wokwi-libs/ → third-party/ 2026-05-03 00:58:57 -03:00
index.css feat(auth): welcome email on register + password reset via Odoo mail relay 2026-05-12 17:34:30 -03:00
main.tsx refactor(oss-split): remove auth/admin/profile frontend from OSS 2026-05-14 15:31:12 -03:00
seoRoutes.ts fix(docs): RISC-V emulation goes through QEMU, not a TypeScript browser core 2026-05-07 21:56:29 +02:00
vite-env.d.ts