/** * WooCommerce workspace — shared constants: the four store views, each * view's second-level tabs, and the small icon/option lookups they use. * Shared between the top hub (`index.tsx`, listing the 4 views), each * view's own hub (`shop/index.tsx` etc., listing that view's tabs), and * each tab's own mounted leaf (`shop/tab-section.tsx` etc.). */ import { __ } from '@wordpress/i18n'; import { ShoppingBag, Package, ShoppingCart, CreditCard, Monitor, Tablet, Smartphone, AlignJustify, Square, PanelLeft, PanelRight, PanelsLeftRight, LayoutGrid, ClipboardList, ShoppingBasket, Link2, FormInput, SlidersHorizontal, UserRound, LogIn, } from '../../icons'; import type { LucideIcon } from '../../icons'; // An unset per-context layout key is stored as '' and falls through to the // global Layout default; the picker shows that as "Inherit". export const INHERIT = 'inherit'; // Products-per-row is a tiny discrete range (1–6): a segmented picker is more // direct than a slider and matches the Sidebar layout control. export const COLUMN_CHOICES = [ 1, 2, 3, 4, 5, 6 ]; // The grid card edits one device's column count at a time behind a device // switcher (the same idiom as the header builder's canvas), rather than // showing all three pickers — desktop/tablet/mobile — stacked at once. export type GridDevice = 'desktop' | 'tablet' | 'mobile'; export const GRID_DEVICES: Array< { key: GridDevice; label: string; Icon: LucideIcon; settingKey: string; fallback: number; } > = [ { key: 'desktop', label: __( 'Desktop', 'aureon' ), Icon: Monitor, settingKey: 'shop_columns', fallback: 3, }, { key: 'tablet', label: __( 'Tablet', 'aureon' ), Icon: Tablet, settingKey: 'shop_columns_tablet', fallback: 2, }, { key: 'mobile', label: __( 'Mobile', 'aureon' ), Icon: Smartphone, settingKey: 'shop_columns_mobile', fallback: 1, }, ]; // One per sidebar position the Layout module offers (see the `sidebars` list // in Layout_Engine), plus `inherit` for the "follow the site-wide default" // choice this picker adds on top of them. A position with no entry here still // renders — as a label-only card — so a new one is never hidden, just plainer. export const SIDEBAR_ICONS: Record< string, LucideIcon > = { inherit: AlignJustify, none: Square, left: PanelLeft, right: PanelRight, both: PanelsLeftRight, }; // The views this workspace covers. `context` maps to a preview URL exposed by // Admin_Panel::preview_urls() (shop / product / cart / checkout). export const VIEWS: Array< { context: string; label: string; icon: LucideIcon; blurb: string; } > = [ { context: 'shop', label: __( 'Product Catalog', 'aureon' ), icon: ShoppingBag, blurb: __( 'The shop and product category/tag grids.', 'aureon' ), }, { context: 'product', label: __( 'Single Product', 'aureon' ), icon: Package, blurb: __( 'An individual product page.', 'aureon' ), }, { context: 'cart', label: __( 'Cart', 'aureon' ), icon: ShoppingCart, blurb: __( 'The cart page and mini-cart drawer.', 'aureon' ), }, { context: 'checkout', label: __( 'Checkout', 'aureon' ), icon: CreditCard, blurb: __( 'The checkout form.', 'aureon' ), }, { context: 'account', label: __( 'My Account', 'aureon' ), icon: UserRound, blurb: __( 'The customer account area and sign-in screen.', 'aureon' ), }, ]; // Second-level tabs within the Product Catalog view. Everything except the // product card — Layout, Grid, Toolbar, Sale Badge, Sale Price, Catalog // Mode — is one small group of controls apiece, none big enough to earn a // tab of its own, so they're stacked together under "General"; Product // Card's element-reordering UI is the one group substantial enough to keep // as its own tab. Icons are this section's own pairing, distinct per view (a // repeated concept, like "Layout", intentionally reuses an icon across views // since the two tab bars are never shown together). export const SHOP_TABS = [ { key: 'general', label: __( 'General', 'aureon' ), icon: LayoutGrid }, { key: 'card', label: __( 'Product Card', 'aureon' ), icon: Package, }, ]; export const PRODUCT_TABS = [ { key: 'summary', label: __( 'Summary', 'aureon' ), icon: ClipboardList, }, { key: 'layout', label: __( 'Layout', 'aureon' ), icon: LayoutGrid }, { key: 'cart_button', label: __( 'Add-to-Cart Button', 'aureon' ), icon: ShoppingBasket, }, { key: 'related', label: __( 'Related & Cross-sells', 'aureon' ), icon: Link2, }, ]; // Cart's own two tabs. Not separate topics so much as two questions asked of // the same page — what it looks like, and what it does when a customer acts — // which is the same split Shop makes, so they render inline behind a segmented // toggle rather than each drilling into a section of its own. The groups // within each tab (Cart Layout, Free Shipping, … ) are still one small cluster // of controls apiece and stay stacked under `FieldGroup` headings; what earned // the split is the number of them, not their size. export const CART_TABS = [ { key: 'design', label: __( 'Cart', 'aureon' ), icon: ShoppingCart }, { key: 'behavior', label: __( 'Behavior', 'aureon' ), icon: SlidersHorizontal, }, ]; // My Account's two tabs split the page by who is looking at it — the signed-in // endpoint panel, and the signed-out login screen. The two are never on screen // together, which is a cleaner line than any topic would draw through them, and // it lets the Login tab carry the one note this view needs (the preview is // always signed in). Inline behind a segmented toggle, like Cart and Checkout. export const ACCOUNT_TABS = [ { key: 'layout', label: __( 'Account', 'aureon' ), icon: UserRound }, { key: 'login', label: __( 'Login', 'aureon' ), icon: LogIn }, ]; export const CHECKOUT_TABS = [ { key: 'layout', label: __( 'Layout', 'aureon' ), icon: LayoutGrid, }, { key: 'form', label: __( 'Form', 'aureon' ), icon: FormInput, }, ];