// Shared frame + mount catalog. Imported by: // - Builder.tsx (live preview + picker UI) // - FramedPreview.tsx (reusable framed-image component) // - admin/orders/[id]/page.tsx (resolves order config for the editor preview) // - orders/[id]/approve/page.tsx (renders preview inside customer's chosen frame) // - orders/[id]/page.tsx (label lookup) // // `frame` is the rich 3-stop gradient used by the live frame around the // preview; `swatch` is the chip in the picker. export const FRAMES = { black: { label: 'Matte black', swatch: 'linear-gradient(135deg, #2a2520, #0a0806)', frame: 'linear-gradient(135deg, #2a2520 0%, #16120e 50%, #2a2520 100%)' }, white: { label: 'Soft white', swatch: 'linear-gradient(135deg, #f6f3ec, #d8d1be)', frame: 'linear-gradient(135deg, #f6f3ec 0%, #e8e2d0 50%, #f6f3ec 100%)' }, walnut: { label: 'Walnut', swatch: 'linear-gradient(135deg, #6e4a2f, #3b2614)', frame: 'linear-gradient(135deg, #6e4a2f 0%, #4a3220 50%, #6e4a2f 100%)' }, oak: { label: 'Honey oak', swatch: 'linear-gradient(135deg, #c8a274, #8a6b46)', frame: 'linear-gradient(135deg, #c8a274 0%, #a3825a 50%, #c8a274 100%)' }, gold: { label: 'Warm gold', swatch: 'linear-gradient(135deg, #d8b46a, #8a6a2a)', frame: 'linear-gradient(135deg, #d8b46a 0%, #b08c44 50%, #d8b46a 100%)' }, silver: { label: 'Brushed silver',swatch: 'linear-gradient(135deg, #d8d6d2, #8c8a85)', frame: 'linear-gradient(135deg, #d8d6d2 0%, #b3b1ac 50%, #d8d6d2 100%)' }, // Classic-frame-only finishes (Prodigi GLOBAL-CFP 'dark grey' / 'light grey'). darkgrey: { label: 'Dark grey', swatch: 'linear-gradient(135deg, #595b5e, #313336)', frame: 'linear-gradient(135deg, #595b5e 0%, #3c3e41 50%, #595b5e 100%)' }, lightgrey: { label: 'Light grey', swatch: 'linear-gradient(135deg, #d3d3d0, #a9a9a4)', frame: 'linear-gradient(135deg, #d3d3d0 0%, #bcbcb6 50%, #d3d3d0 100%)' }, } as const; export type FrameId = keyof typeof FRAMES; // Mat board treatments for the box-frame matted product. The three // mount colours Prodigi fulfils on the FRA-BOX-EMA-MOUNT1-ACRY line — // the `label` strings MUST match Prodigi's `mountColor` attribute // values EXACTLY ('Snow white' / 'Off-white' / 'Black'), because the // label is what gets sent on the order item (see lib/prodigi-skus.ts). // `hex` is what the preview's `--matte-bg` reads from. Canvas float // frames ignore matteId and render a fixed dark recess gap instead. // The three mount colours fulfil on FRA-BOX-EMA-MOUNT1-ACRY, plus a // `nomat` option. "No matte" is the same box frame with no mat board — // it fulfils on the No-Mount sibling SKU (FRA-BOX-EMA-NM-ACRY, same // moulding) at its own (slightly lower) price. See lib/prodigi-skus.ts // (SKU swap) and lib/pricing.ts (nomat pricing). `nomat` carries no real // mat colour; its `hex` is an unused fallback (the preview drops the mat // board to zero width). export const MATTES = { snowwhite: { label: 'Snow white', swatch: 'linear-gradient(135deg, #fbfaf6, #ece8de)', hex: '#f7f5ee' }, offwhite: { label: 'Off-white', swatch: 'linear-gradient(135deg, #f3ecdb, #e6dcc4)', hex: '#ede4cd' }, black: { label: 'Black', swatch: 'linear-gradient(135deg, #2a2520, #0a0806)', hex: '#141210' }, nomat: { label: 'No matte', swatch: 'linear-gradient(135deg, #efe9dd 0 46%, #b9b3a6 46% 54%, #efe9dd 54%)', hex: '#f7f5ee' }, } as const; export type MatteId = keyof typeof MATTES; // Edge-wrap options for the frameless Stretched Canvas (Prodigi // GLOBAL-CAN). These describe how the printed image continues around the // 38mm canvas edges — they're not visible front-on, so the live preview // renders the same for every wrap; the choice only changes the Prodigi // `wrap` attribute (see prodigi-skus.ts). `label` is shown in the // Builder; `prodigi` is the exact catalogue value. export const WRAPS = { imagewrap: { label: 'Image wrap', sub: 'Image continues around the edges', prodigi: 'ImageWrap', swatch: 'linear-gradient(135deg, #b9a98c, #6f5f44)' }, mirror: { label: 'Mirror wrap', sub: 'Edges mirror the image', prodigi: 'MirrorWrap', swatch: 'linear-gradient(135deg, #c9bda6, #8a7d63)' }, white: { label: 'White edges', sub: 'Clean white border edges', prodigi: 'White', swatch: 'linear-gradient(135deg, #ffffff, #e6e2d8)' }, black: { label: 'Black edges', sub: 'Solid black border edges', prodigi: 'Black', swatch: 'linear-gradient(135deg, #2a2520, #0a0806)' }, } as const; export type WrapId = keyof typeof WRAPS; export function normalizeWrapId(id: string | null | undefined): WrapId { return id && id in WRAPS ? (id as WrapId) : 'imagewrap'; } /** True when this mat selection means "no mat board at all" (routes to * the Classic Frame SKU + price). */ export const NO_MAT_ID = 'nomat' as const; export function isNoMat(id: string | null | undefined): boolean { return id === NO_MAT_ID; } // Normalise legacy / unknown mat ids to a current key. Old drafts / // orders may carry `warmwhite` (since renamed to `offwhite`), `cream`, // `hayseed`, or `none` from previous UI revisions. Legacy `none` was a // default-mount placeholder (NOT today's `nomat` no-mat product), so it // still resolves to snow white. export function normalizeMatteId(id: string | null | undefined): MatteId { if (!id) return 'snowwhite'; if (id === 'warmwhite' || id === 'cream' || id === 'hayseed') return 'offwhite'; if (id === 'none') return 'snowwhite'; return id in MATTES ? (id as MatteId) : 'snowwhite'; }