import React from 'react'; import { type MetafieldMeta, type ShapedMetafieldEntry } from './resolveMetafield.js'; export interface MetafieldProps { /** Owner entity type — 'product' | 'category' | 'collection' | 'customer' * | 'order' | 'shop' | 'blog_post' | 'blog_category' (open set). */ owner: string; namespace: string; fieldKey: string; /** * The entity carrying `metafields` — ALWAYS provided by the developer * (owner decision 2026-07-18: the component never fetches or reads entity * contexts itself). On productView: `const product = useProduct()` and pass * it; in grids/shelves: the card's item; for shop: the `setting` object * from the enclosing master's query. Nullish is tolerated at runtime (the * default renders) so loading/optional data doesn't crash. */ entity: { uuid?: string; metafields?: ShapedMetafieldEntry[]; } | null | undefined; /** Per-call-site override; the manifest's appearance.placeholder is the * primary default source (design Decision 5). Render-side only. */ defaultValue?: unknown; render?: (value: unknown, meta: MetafieldMeta) => React.ReactNode; /** Fast path for plain scalar text when no render prop is given. */ as?: keyof React.JSX.IntrinsicElements; className?: string; } /** * Storefront metafield renderer (theme-metafields design § V1b + § V1.1). * * Purely presentational: the developer supplies the entity (with its * `metafields` selection from the page's merged GraphQL query) — the * component performs no fetching and reads no entity contexts. Its only * ambient input is the manifest-descriptor projection in app context (the * theme's DECLARATION, not entity data — per-call-site descriptors would * reintroduce the dual-declaration drift the manifest killed). Declared * `visibleToCustomer: false` fields render NOTHING — never the default. * * Page-builder mode (V1.1): after hydration inside the PB iframe the * rendered value gains hover chrome; clicking posts a `metafield-select` * message to the admin shell, which opens the guideline drawer (info + * definition status + deep link — values are LIVE data and are never edited * from the builder). Declared fields that render nothing on the storefront * (hidden, or unset without a default) show a ghost chip instead so they * stay discoverable in the canvas. The first render is always the bare * production element (Editable's two-phase pattern — SSR-stable). */ export declare function Metafield({ owner, namespace, fieldKey, entity, defaultValue, render, as: Tag, className }: MetafieldProps): React.JSX.Element | null;