Module: utils/componentLoader

Loads the component catalog for the palette. - Local version: served by the FastAPI backend from the JSON files on disk (`GET /api/components`). - Web/standalone version (no backend): the JSON files are bundled into the build at build time, so the app ships with them and makes no network call.
Source:

Methods

(static) loadBundledComponents() → {Object.<string, Array.<Object>>}

Group the JSON files bundled at build time by category, matching the shape returned by the backend's `/api/components`.
Source:
Returns:
Components grouped by category.
Type
Object.<string, Array.<Object>>

(static) loadComponents() → {Promise.<Object.<string, Array.<Object>>>}

Load all components, keyed by category. Tries the local backend first and falls back to the JSON bundled into the build when no backend is present.
Source:
Returns:
Components grouped by category.
Type
Promise.<Object.<string, Array.<Object>>>