/** * Legacy single-product stub. * * v0.6 — the host no longer owns a runtime product catalog. The * canonical catalog lives in template-manager (productsStore) and is * seeded once from src/constants/seedProducts.js. * * What's left in this file * ──────────────────────── * The legacy single-product editor flow at `/` (apparel-designer's * App.jsx) calls `getActiveProduct()` and reads a small set of * shape-only fields off the result: `canvasSize`, `printZone`, * `productSvg`, `background`. We keep a minimal stub here so that * flow continues booting without re-architecting it for the v0.6 * data shape. * * Migration intent * ──────────────── * The legacy `/` flow is slated for retirement; the customer-facing * surface is `/customize?template=…` which reads the template's * embedded variant. When the legacy flow is removed, this file goes * with it. */ // Bare shirt shape with just enough fields for the legacy // getActiveProduct() consumers in App.jsx + the editor's // legacy single-product code paths. const LEGACY_SHIRT_STUB = { id: 'shirt', label: 'T-Shirt', canvasSize: 300, printZone: { x: 90, y: 130, width: 220, height: 220 }, productSvg: { component: 'shirt', width: 400, height: 470 }, background: { mode: 'color', defaultColorId: 'white' }, // No variants — v0.6 catalog lives in template-manager. variants: [], }; /** * Return the active product for the legacy single-product editor. * Always returns the shirt stub in v0.6. */ export function getActiveProduct() { return LEGACY_SHIRT_STUB; } // ── Deprecated exports ──────────────────────────────────────── // // These names are referenced in places that haven't been swept yet. // They resolve to the legacy stub or to undefined so any straggling // importer doesn't crash on module load. Will be removed in a // follow-up cleanup pass. /** @deprecated Use seedProducts.DEFAULT_PRODUCT_ID. */ export const DEFAULT_PRODUCT_TYPE_ID = 'shirt'; /** @deprecated Use seedProducts.DEFAULT_SIZE_ID. */ export const DEFAULT_VARIANT_ID = 'shirt-default'; /** @deprecated Use seedProducts. */ export const ACTIVE_PRODUCT_ID = 'shirt'; /** @deprecated Use seedProducts; map productId/sizeId via the products API. */ export const PRODUCT_TYPES = { shirt: LEGACY_SHIRT_STUB }; /** @deprecated Use the resolved variant from a template GET response. */ export function getVariant(_productTypeId, _variantId) { return null; }