velxio/frontend/src/utils
David Montero 737ec5c6eb feat(import): unify project import — accept .vlx and .zip in both entry points
Velxio had two parallel import paths that confused users (reported on
Discord by AgUn / dmontero):

  * Toolbar "Import a project from a .zip file" → Wokwi .zip only
  * File-explorer "Open .vlx file"               → Velxio .vlx only

If you exported a Velxio project as .vlx and tried to bring it back via
the toolbar Import button, you bounced off "wrong format" with no hint
that the .vlx loader was hiding behind the file-explorer save-bar.

Fix: introduce `utils/importProject.ts` as the single dispatcher.  It
sniffs the extension and routes:

  *.vlx  → importVlxFile      (writes directly to stores)
  *.zip  → importFromWokwiZip (returns a payload the caller applies,
                               so the toolbar can still trigger the
                               install-libraries modal afterwards)

Both UI entry points now go through the dispatcher with the same
`accept=".vlx,.zip,application/json,application/zip"` filter:

  * Toolbar "Import project (.vlx Velxio or .zip Wokwi)"
  * File-explorer "Open project (.vlx Velxio or .zip Wokwi)"

The toolbar tooltip is i18n-driven — updated EN + 8 other locales
(es, fr, de, it, pt-br, ja, ru, zh-cn) so every user sees the same
clarification.

Wokwi compatibility kept intact — the .zip path still resolves to
`importFromWokwiZip` and the same library-install modal pops if the
imported project lists libraries we don't have locally.
2026-05-22 20:55:06 +02:00
..
analytics.ts refactor: rename components and update prefixes to 'velxio-' for consistency 2026-04-21 16:45:45 -03:00
boardPinMapping.ts Merge branch 'master' into feature/electrical-simulation-ngspice 2026-04-21 17:11:26 -03:00
boardProtocols.ts feat(pi): Phase 3.3 — Pi Zero / Pi 1 / Pi 2 armhf simulators 2026-05-18 23:23:48 +02:00
captureCanvasPreview.ts refactor: rename components and update prefixes to 'velxio-' for consistency 2026-04-21 16:45:45 -03:00
compilationLogger.ts refactor: rename components and update prefixes to 'velxio-' for consistency 2026-04-21 16:45:45 -03:00
countryFlag.ts feat(metrics): add usage analytics dashboard with country tracking 2026-04-25 19:47:40 -03:00
esp32ImageParser.ts refactor: rename components and update prefixes to 'velxio-' for consistency 2026-04-21 16:45:45 -03:00
exampleToBuildNetlistInput.ts feat(sim): Phase 1d #2 + #9 — convergence helpers in Worker + enable LM358 subckt 2026-05-15 22:17:06 +02:00
firmwareLoader.ts refactor: rename components and update prefixes to 'velxio-' for consistency 2026-04-21 16:45:45 -03:00
generateExamplePreview.tsx
…
hexParser.ts refactor: rename components and update prefixes to 'velxio-' for consistency 2026-04-21 16:45:45 -03:00
importProject.ts feat(import): unify project import — accept .vlx and .zip in both entry points 2026-05-22 20:55:06 +02:00
loadExample.ts feat(pi): Phase 3.3 — Pi Zero / Pi 1 / Pi 2 armhf simulators 2026-05-18 23:23:48 +02:00
pinPositionCalculator.ts chore(tests): silence three noisy warnings in deploy-gate output 2026-05-16 22:39:43 +02:00
projectPayload.ts feat(board-options): per-board options modal + persistence 2026-05-18 21:50:45 -03:00
reservedUsernames.ts refactor: rename components and update prefixes to 'velxio-' for consistency 2026-04-21 16:45:45 -03:00
useSEO.ts refactor: rename components and update prefixes to 'velxio-' for consistency 2026-04-21 16:45:45 -03:00
useTouchDevice.ts feat: add touch-friendly components for improved mobile usability 2026-05-08 11:12:26 -03:00
uuid.ts fix(frontend): polyfill crypto.randomUUID for non-secure contexts 2026-05-05 13:41:30 -03:00
vlxFile.ts feat(oss): portable .vlx project export/import for self-hosters 2026-05-14 16:33:00 -03:00
wireColors.ts refactor: rename components and update prefixes to 'velxio-' for consistency 2026-04-21 16:45:45 -03:00
wireHitDetection.ts Add shared validators and test configurations for Velxio projects 2026-04-28 00:36:05 -03:00
wireUtils.ts refactor: rename components and update prefixes to 'velxio-' for consistency 2026-04-21 16:45:45 -03:00
wokwiZip.ts refactor: rename components and update prefixes to 'velxio-' for consistency 2026-04-21 16:45:45 -03:00