@sanity/sfcc

1.0.251.0.26
~

Modified (5 files)

Index: package/dist/index.js
===================================================================
--- package/dist/index.js
+++ package/dist/index.js
@@ -1,10 +1,12 @@
+import "@sanity/ui/styles.css";
 import { defineField, definePlugin, useClient, useFormValue } from "sanity";
 import { c } from "react/compiler-runtime";
 import { WarningOutlineIcon } from "@sanity/icons/WarningOutline";
-import { Card, Flex, Stack, Text, useToast } from "@sanity/ui";
+import { Card, Flex, Stack, Text } from "@sanity/ui";
 import { jsx, jsxs } from "react/jsx-runtime";
 import { TrashIcon } from "@sanity/icons/Trash";
+import { useToast } from "@sanity/ui/toast";
 import { useState } from "react";
 import { useRouter } from "sanity/router";
 import { CloseIcon } from "@sanity/icons/Close";
 import { ImageIcon } from "@sanity/icons/Image";
Index: package/package.json
===================================================================
--- package/package.json
+++ package/package.json
@@ -1,7 +1,7 @@
 {
   "name": "@sanity/sfcc",
-  "version": "1.0.25",
+  "version": "1.0.26",
   "description": "Sanity plugin for Salesforce Commerce Cloud (SFCC) integration — synced product and category data with editorial enrichment.",
   "keywords": [
     "salesforce-commerce-cloud",
     "sanity",
@@ -29,9 +29,9 @@
     "./package.json": "./package.json"
   },
   "dependencies": {
     "@sanity/icons": "^5.2.1",
-    "@sanity/ui": "^3.5.1"
+    "@sanity/ui": "^4.0.0"
   },
   "devDependencies": {
     "@sanity/tsconfig": "^2.2.1",
     "@sanity/tsdown-config": "^0.21.2",
@@ -40,9 +40,9 @@
     "@types/react-dom": "^19.2.4",
     "babel-plugin-react-compiler": "^1.0.0",
     "react": "^19.2.8",
     "react-dom": "^19.2.8",
-    "sanity": "^6.7.0",
+    "sanity": "^6.9.0",
     "styled-components": "^6.4.4",
     "tsdown": "^0.22.14"
   },
   "peerDependencies": {
Index: package/dist/index.d.ts.map
===================================================================
--- package/dist/index.d.ts.map
+++ package/dist/index.d.ts.map
@@ -1,1 +1,1 @@
-{"version":3,"file":"index.d.ts","names":[],"sources":["../src/schemas/category.tsx","../src/schemas/product.tsx","../src/structure/categoryStructure.ts","../src/structure/productStructure.ts","../src/components/SfccDocumentStatus.tsx","../src/components/SfccOfflineBanner.tsx","../src/index.ts"],"mappings":";;;;;;;;;;;cAYa;;;;;qBAsCX,uCAAA,mCAAA;;;;;cAMW;EACX;IACE;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;EAEF,UAAO,UAAA,aAAA,OAAA,MAAA,YAAA,mBAAA,YAAA,UAAA;IAWL;IACA;MAAe;;IACf;IACA;IACA;IACA;MAAqB;;IACrB;IACA;IACA;;IASE;IACA;IACA,uBAAK,IAAA;;;;;;;;;;;cCtFE;;;;;qBA4HX,uCAAA,mCAAA;;;;;;cAmBW;;IAET;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;EAEiB,QAAA;IACjB;MAAQ;;IACR;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;;;;;;cChLS,oBAAiB,8BAAA,kBAAA,0BAAA,6CAAA;cCCjB,mBAAgB,8BAAA,kBAAA,0BAAA,6CAAA;KCCxB;EACH;EACA;EACA;EACA,MAAM,IAAI;;cAGN,qBAAkB,OAAW,0BAAK,IAAA;;;;;;;;iBCAxB,qCAAiB,IAAA;;;;;;;cCWpB,oBAAiB,SAAa,oBAAkB,eAAe;;;;;;;;;;cAoB/D,6BAAU"}
\ No newline at end of file
+{"version":3,"file":"index.d.ts","names":[],"sources":["../src/schemas/category.tsx","../src/schemas/product.tsx","../src/structure/categoryStructure.ts","../src/structure/productStructure.ts","../src/components/SfccDocumentStatus.tsx","../src/components/SfccOfflineBanner.tsx","../src/index.ts"],"mappings":";;;;;;;;;;;;cAYa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA4CA;EACX;IACE;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;EAEF,UAAO,UAAA,aAAA,OAAA,MAAA,YAAA,mBAAA,YAAA,UAAA;IAWL;IACA;MAAe;;IACf;IACA;IACA;IACA;MAAqB;;IACrB;IACA;IACA;;IASE;IACA;IACA,uBAAK,IAAA;;;;;;;;;;;cCtFE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA+IA;;IAET;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;EAEiB,QAAA;IACjB;MAAQ;;IACR;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;;;;;;cChLS,oBAAiB,8BAAA,kBAAA,0BAAA,6CAAA;cCCjB,mBAAgB,8BAAA,kBAAA,0BAAA,6CAAA;KCCxB;EACH;EACA;EACA;EACA,MAAM,IAAI;;cAGN,qBAAkB,OAAW,0BAAK,IAAA;;;;;;;;iBCAxB,qCAAiB,IAAA;;;;;;;cCYpB,oBAAiB,SAAa,oBAAkB,eAAe;;;;;;;;;;cAoB/D,6BAAU"}
\ No newline at end of file
Index: package/dist/index.js.map
===================================================================
--- package/dist/index.js.map
+++ package/dist/index.js.map
@@ -1,1 +1,1 @@
-{"version":3,"file":"index.js","names":["WarningOutlineIcon","Card","Flex","Text","useFormValue","SfccOfflineBanner","$","_c","t0","Symbol","for","onlineFlagRaw","t1","onlineRaw","onlineFlag","undefined","online","isOnline","t2","API_VERSION","TrashIcon","Stack","Text","useToast","useState","DocumentActionComponent","useClient","useRouter","API_VERSION","CONFIG","Record","message","backPath","product","category","createSfccDeleteAction","originalDeleteAction","SfccDeleteAction","props","originalResult","dialogOpen","setDialogOpen","router","toast","client","apiVersion","type","draft","published","config","tone","icon","label","onHandle","dialog","onCancel","onConfirm","transaction","_id","delete","store","variants","Array","isArray","v","_ref","commit","navigateUrl","path","err","Error","push","status","title","CloseIcon","ImageIcon","Ref","useState","Props","isDeleted","imageUrl","title","ref","HTMLDivElement","SfccDocumentStatus","props","$","_c","imageVisible","setImageVisible","t0","Symbol","for","handleImageError","t1","alignItems","borderRadius","display","height","justifyContent","overflow","width","t2","replace","left","objectFit","position","top","t3","background","color","t4","defineField","SfccDocumentStatus","sfccCategoryStoreField","readOnly","name","title","type","group","fields","to","sfccCategoryPreview","select","imageUrl","isActive","displayName","categoryId","parentDisplayName","parentName","parentId","prepare","value","displayTitle","isRoot","parentLabel","subtitle","media","defineField","SfccDocumentStatus","sfccProductStoreField","readOnly","name","title","type","group","fields","of","to","weak","VariationAttrKey","VARIATION_ATTRIBUTE_MAP","Record","label","storeKey","color","size","memorySize","tvSize","sfccProductPreview","select","id","productType","variationAttributes","productImage","isActive","prepare","selection","value","attrValues","meta","push","length","attr","mapped","Object","entries","subtitle","join","media","defineStructure","categoryStructure","S","listItem","title","schemaType","child","documentTypeList","API_VERSION","defineStructure","productStructure","S","context","client","getClient","apiVersion","listItem","title","schemaType","child","documentList","filter","productId","product","fetch","id","store","productType","variantRefs","variants","map","v","_ref","list","items","documentListItem","divider","ref","document","documentId","ConfigContext","StructureBuilder","defineStructure","factory","S","context","StructureType","DecorationMember","definePlugin","ObjectMember","SfccOfflineBanner","createSfccDeleteAction","sfccCategoryPreview","sfccCategoryStoreField","sfccProductPreview","sfccProductStoreField","categoryStructure","productStructure","SfccDocumentStatus","sfccRenderMembers","members","key","kind","component","SFCC_TYPES","Set","sfccPlugin","name","document","actions","prev","context","has","schemaType","filter","action","map","newDocumentOptions","template","templateId"],"sources":["../src/components/SfccOfflineBanner.tsx","../src/constants.ts","../src/documentActions/sfccDelete.tsx","../src/components/SfccDocumentStatus.tsx","../src/schemas/category.tsx","../src/schemas/product.tsx","../src/structure/categoryStructure.ts","../src/structure/productStructure.ts","../src/structure/index.ts","../src/index.ts"],"sourcesContent":["import {WarningOutlineIcon} from '@sanity/icons/WarningOutline'\nimport {Card, Flex, Text} from '@sanity/ui'\nimport {useFormValue} from 'sanity'\n\n/**\n * Decorative banner injected via `renderMembers` that warns editors when a\n * product or category is offline in SFCC.\n *\n * Reads `store.onlineFlag` (products) and `store.online` (categories) via\n * `useFormValue` so it works without props.\n */\nexport function SfccOfflineBanner() {\n  const onlineFlagRaw = useFormValue(['store', 'onlineFlag'])\n  const onlineRaw = useFormValue(['store', 'online'])\n\n  const onlineFlag = typeof onlineFlagRaw === 'boolean' ? onlineFlagRaw : undefined\n  const online = typeof onlineRaw === 'boolean' ? onlineRaw : undefined\n  const isOnline = onlineFlag ?? online\n\n  if (isOnline !== false) return null\n\n  return (\n    <Card padding={4} radius={2} shadow={1} tone=\"caution\">\n      <Flex align=\"center\" gap={3}>\n        <Text size={2}>\n          <WarningOutlineIcon />\n        </Text>\n        <Text size={1} weight=\"medium\">\n          This document is currently offline in SFCC.\n        </Text>\n      </Flex>\n    </Card>\n  )\n}\n","export const API_VERSION = '2026-02-24'\n","import {TrashIcon} from '@sanity/icons/Trash'\nimport {Stack, Text, useToast} from '@sanity/ui'\nimport {useState} from 'react'\nimport {type DocumentActionComponent, useClient} from 'sanity'\nimport {useRouter} from 'sanity/router'\n\nimport {API_VERSION} from '../constants'\n\nconst CONFIG: Record<string, {message: string; backPath: string}> = {\n  product: {\n    message: 'Delete the current product and all associated variants in your dataset?',\n    backPath: '/structure/products',\n  },\n  category: {\n    message: 'Delete the current category from your dataset?',\n    backPath: '/structure/categories',\n  },\n}\n\n/**\n * Wraps the built-in delete action for SFCC-synced documents.\n *\n * - **Products**: deletes the product *and* all associated variants\n *   (resolved from `store.variants[]._ref`) in a single transaction,\n *   then navigates back to the products list.\n * - **Categories**: deletes the category with a confirmation warning,\n *   then navigates back to the categories list.\n */\nexport function createSfccDeleteAction(\n  originalDeleteAction: DocumentActionComponent,\n): DocumentActionComponent {\n  return function SfccDeleteAction(props) {\n    const originalResult = originalDeleteAction(props)\n\n    const [dialogOpen, setDialogOpen] = useState(false)\n    const router = useRouter()\n    const toast = useToast()\n    const client = useClient({apiVersion: API_VERSION})\n\n    const {type, draft, published} = props\n    const config = CONFIG[type]\n\n    if (!config) return originalResult\n\n    return {\n      ...originalResult,\n      tone: 'critical',\n      icon: TrashIcon,\n      label: 'Delete',\n      onHandle: () => setDialogOpen(true),\n      dialog: dialogOpen && {\n        type: 'confirm',\n        message: (\n          <Stack gap={4}>\n            <Text size={1}>{config.message}</Text>\n            <Text size={1} weight=\"medium\">\n              No data on SFCC will be deleted.\n            </Text>\n          </Stack>\n        ),\n        onCancel: () => setDialogOpen(false),\n        onConfirm: async () => {\n          const transaction = client.transaction()\n          if (published?._id) transaction.delete(published._id)\n          if (draft?._id) transaction.delete(draft._id)\n\n          if (type === 'product' && published) {\n            const store = published['store']\n            const variants =\n              store != null &&\n              typeof store === 'object' &&\n              'variants' in store &&\n              Array.isArray(store.variants)\n                ? store.variants\n                : []\n            for (const v of variants) {\n              if (v != null && typeof v === 'object' && '_ref' in v && typeof v._ref === 'string') {\n                transaction.delete(v._ref)\n                transaction.delete(`drafts.${v._ref}`)\n              }\n            }\n          }\n\n          try {\n            await transaction.commit()\n            router.navigateUrl({path: config.backPath})\n          } catch (err) {\n            const message = err instanceof Error ? err.message : 'Unknown Error'\n            toast.push({status: 'error', title: message})\n          } finally {\n            setDialogOpen(false)\n          }\n        },\n      },\n    }\n  }\n}\n","import {CloseIcon} from '@sanity/icons/Close'\nimport {ImageIcon} from '@sanity/icons/Image'\nimport {type Ref, useState} from 'react'\n\ntype Props = {\n  isDeleted: boolean\n  imageUrl: string\n  title: string\n  ref?: Ref<HTMLDivElement>\n}\n\nconst SfccDocumentStatus = (props: Props) => {\n  const {isDeleted, imageUrl, title, ref} = props\n\n  const [imageVisible, setImageVisible] = useState(true)\n\n  const handleImageError = () => setImageVisible(false)\n\n  return (\n    <div\n      ref={ref}\n      style={{\n        alignItems: 'center',\n        borderRadius: 'inherit',\n        display: 'flex',\n        height: '100%',\n        justifyContent: 'center',\n        overflow: 'hidden',\n        width: '100%',\n      }}\n    >\n      {imageVisible && imageUrl ? (\n        <img\n          onError={handleImageError}\n          src={imageUrl.replace('/large/', '/small/')}\n          style={{\n            height: '100%',\n            left: 0,\n            objectFit: 'contain',\n            position: 'absolute',\n            top: 0,\n            width: '100%',\n          }}\n          alt={`${title} preview`}\n        />\n      ) : (\n        <ImageIcon style={{position: 'absolute'}} />\n      )}\n\n      {isDeleted && (\n        <CloseIcon\n          style={{\n            background: 'rgba(255, 0, 0, 0.7)',\n            color: 'rgba(255, 255, 255, 0.85)',\n            height: '100%',\n            position: 'relative',\n            width: '100%',\n          }}\n        />\n      )}\n    </div>\n  )\n}\n\nexport {SfccDocumentStatus}\n","import {defineField} from 'sanity'\n\nimport {SfccDocumentStatus} from '../components/SfccDocumentStatus'\n\n/**\n * SFCC category store field — contains all read-only data synced from\n * Salesforce Commerce Cloud.  Add this to a `category` document type's\n * `fields` array alongside your own custom fields.\n *\n * The field is placed in the `sfcc` group; make sure the document type\n * declares that group.\n */\nexport const sfccCategoryStoreField = defineField({\n  readOnly: true,\n  name: 'store',\n  title: 'SFCC Data',\n  type: 'object',\n  group: 'sfcc',\n  fields: [\n    defineField({name: 'categoryId', title: 'Category ID', type: 'string', readOnly: true}),\n    defineField({\n      name: 'thumbnailImage',\n      title: 'Thumbnail Image',\n      type: 'string',\n      readOnly: true,\n    }),\n    defineField({name: 'online', title: 'Online', type: 'boolean', readOnly: true}),\n    defineField({name: 'onlineFrom', title: 'Online From', type: 'date', readOnly: true}),\n    defineField({name: 'onlineTo', title: 'Online To', type: 'date', readOnly: true}),\n    defineField({name: 'creationDate', title: 'Creation Date', type: 'date', readOnly: true}),\n    defineField({name: 'isDeleted', title: 'Is Deleted', type: 'boolean', readOnly: true}),\n    defineField({\n      name: 'parentCategory',\n      type: 'reference',\n      to: [{type: 'category'}],\n      readOnly: true,\n    }),\n    defineField({\n      name: 'displayName',\n      title: 'Display Name',\n      type: 'internationalizedArrayString',\n      readOnly: true,\n    }),\n    defineField({\n      name: 'description',\n      title: 'Description',\n      type: 'internationalizedArrayText',\n      readOnly: true,\n    }),\n  ],\n})\n\n/**\n * Default preview configuration for the `category` document type.\n * Shows Category Name with parent category as subtitle.\n */\nexport const sfccCategoryPreview = {\n  select: {\n    imageUrl: 'store.thumbnailImage',\n    isActive: 'store.online',\n    displayName: 'store.displayName',\n    title: 'title',\n    name: 'name',\n    categoryId: 'store.categoryId',\n    parentDisplayName: 'store.parentCategory.store.displayName',\n    parentName: 'store.parentCategory.name',\n    parentId: 'store.parentCategory.store.categoryId',\n  },\n  prepare({\n    imageUrl,\n    displayName,\n    title,\n    name,\n    categoryId,\n    parentDisplayName,\n    parentName,\n    parentId,\n    isActive,\n  }: {\n    imageUrl?: string\n    displayName?: {value: string}[]\n    title?: string\n    name?: string\n    categoryId?: string\n    parentDisplayName?: {value: string}[]\n    parentName?: string\n    parentId?: string\n    isActive?: boolean\n  }) {\n    const displayTitle =\n      title || name || displayName?.[0]?.value || categoryId || 'Untitled Category'\n\n    const isRoot = parentId === 'root'\n    const parentLabel = !isRoot && (parentName || parentDisplayName?.[0]?.value || parentId)\n\n    return {\n      title: displayTitle,\n      subtitle: parentLabel ? `Parent: ${parentLabel}` : '',\n      media: (\n        <SfccDocumentStatus isDeleted={!isActive} imageUrl={imageUrl ?? ''} title={displayTitle} />\n      ),\n    }\n  },\n}\n","import {defineField} from 'sanity'\n\nimport {SfccDocumentStatus} from '../components/SfccDocumentStatus'\n\n/**\n * SFCC product store field — contains all read-only data synced from\n * Salesforce Commerce Cloud.  Add this to a `product` document type's\n * `fields` array alongside your own custom fields.\n *\n * The field is placed in the `sfcc` group; make sure the document type\n * declares that group.\n */\nexport const sfccProductStoreField = defineField({\n  readOnly: true,\n  name: 'store',\n  title: 'SFCC Data',\n  type: 'object',\n  group: 'sfcc',\n  fields: [\n    defineField({name: 'productId', title: 'Product ID', type: 'string', readOnly: true}),\n    defineField({name: 'brand', title: 'Brand', type: 'string', readOnly: true}),\n    defineField({name: 'color', title: 'Color', type: 'string', readOnly: true}),\n    defineField({name: 'size', title: 'Size', type: 'string', readOnly: true}),\n    defineField({name: 'width', title: 'Width', type: 'string', readOnly: true}),\n    defineField({name: 'productType', title: 'Product Type', type: 'string', readOnly: true}),\n    defineField({name: 'styleNumber', title: 'Style Number', type: 'string', readOnly: true}),\n    defineField({name: 'searchable', title: 'Searchable', type: 'boolean', readOnly: true}),\n    defineField({name: 'isSale', title: 'On Sale?', type: 'boolean', readOnly: true}),\n    defineField({name: 'isNew', title: 'New Arrival?', type: 'boolean', readOnly: true}),\n    defineField({\n      name: 'manufacturerName',\n      title: 'Manufacturer',\n      type: 'string',\n      readOnly: true,\n    }),\n    defineField({\n      name: 'manufacturerSKU',\n      title: 'Manufacturer Product ID',\n      type: 'string',\n      readOnly: true,\n    }),\n    defineField({\n      name: 'creationDate',\n      title: 'Creation Date',\n      type: 'datetime',\n      readOnly: true,\n    }),\n    defineField({\n      name: 'lastModified',\n      title: 'Last Modified',\n      type: 'datetime',\n      readOnly: true,\n    }),\n    defineField({name: 'onlineFlag', title: 'Online', type: 'boolean', readOnly: true}),\n    defineField({name: 'onlineFrom', title: 'Online From', type: 'datetime', readOnly: true}),\n    defineField({name: 'onlineTo', title: 'Online To', type: 'datetime', readOnly: true}),\n    defineField({name: 'length', title: 'Length', type: 'string', readOnly: true}),\n    defineField({name: 'memorySize', title: 'Memory Size', type: 'string', readOnly: true}),\n    defineField({name: 'tvSize', title: 'TV Size', type: 'string', readOnly: true}),\n    defineField({\n      name: 'tvType',\n      title: 'TV Type',\n      type: 'array',\n      of: [{type: 'string'}],\n      readOnly: true,\n    }),\n    defineField({\n      name: 'productImage',\n      title: 'Product Image',\n      type: 'string',\n      readOnly: true,\n    }),\n    defineField({\n      name: 'refinementColor',\n      title: 'Refinement Color',\n      type: 'string',\n      readOnly: true,\n    }),\n    defineField({\n      name: 'variants',\n      title: 'Variants',\n      type: 'array',\n      of: [{type: 'reference', to: [{type: 'product'}], weak: true}],\n      readOnly: true,\n    }),\n    defineField({\n      name: 'variationAttributes',\n      title: 'Variation Attributes',\n      type: 'array',\n      of: [{type: 'string'}],\n      readOnly: true,\n    }),\n    defineField({name: 'isDeleted', title: 'Is Deleted', type: 'boolean'}),\n    defineField({\n      name: 'name',\n      title: 'Name',\n      type: 'internationalizedArrayString',\n      readOnly: true,\n    }),\n    defineField({\n      name: 'longDescription',\n      title: 'Long Description',\n      type: 'internationalizedArrayText',\n      readOnly: true,\n    }),\n    defineField({\n      name: 'shortDescription',\n      title: 'Short Description',\n      type: 'internationalizedArrayText',\n      readOnly: true,\n    }),\n    defineField({\n      name: 'pageTitle',\n      title: 'Page Title',\n      type: 'internationalizedArrayString',\n      readOnly: true,\n    }),\n    defineField({\n      name: 'pageDescription',\n      title: 'Page Description',\n      type: 'internationalizedArrayString',\n      readOnly: true,\n    }),\n    defineField({\n      name: 'pageKeywords',\n      title: 'Page Keywords',\n      type: 'internationalizedArrayString',\n      readOnly: true,\n    }),\n    defineField({\n      name: 'pageURL',\n      title: 'Page URL',\n      type: 'internationalizedArrayString',\n      readOnly: true,\n    }),\n  ],\n})\n\ntype VariationAttrKey = 'color' | 'size' | 'memorySize' | 'tvSize'\n\n/**\n * Maps SFCC variation attribute IDs to their store field keys and display labels.\n */\nconst VARIATION_ATTRIBUTE_MAP: Record<string, {label: string; storeKey: VariationAttrKey}> = {\n  color: {label: 'Color', storeKey: 'color'},\n  size: {label: 'Size', storeKey: 'size'},\n  memorySize: {label: 'Memory Size', storeKey: 'memorySize'},\n  tvSize: {label: 'TV Size', storeKey: 'tvSize'},\n}\n\n/**\n * Default preview configuration for the `product` document type.\n * Shows product type for Master/Simple, and the relevant variation\n * attributes (driven by `store.variationAttributes`) for all products.\n */\nexport const sfccProductPreview = {\n  select: {\n    name: 'store.name',\n    id: 'store.productId',\n    productType: 'store.productType',\n    variationAttributes: 'store.variationAttributes',\n    color: 'store.color',\n    size: 'store.size',\n    memorySize: 'store.memorySize',\n    tvSize: 'store.tvSize',\n    productImage: 'store.productImage',\n    isActive: 'store.onlineFlag',\n  },\n  prepare(selection: {\n    name?: {value: string}[]\n    id?: string\n    productType?: string\n    variationAttributes?: string[]\n    color?: string\n    size?: string\n    memorySize?: string\n    tvSize?: string\n    productImage?: string\n    isActive?: boolean\n  }) {\n    const {name, id, productType, variationAttributes, productImage, isActive, ...attrValues} =\n      selection\n\n    const title = name?.[0]?.value || id || 'Untitled Product'\n    const meta: string[] = []\n    if (productType && productType !== 'Variant') meta.push(productType)\n\n    if (variationAttributes?.length) {\n      for (const attr of variationAttributes) {\n        const mapped = VARIATION_ATTRIBUTE_MAP[attr]\n        const value = mapped && attrValues[mapped.storeKey]\n        if (mapped && value) meta.push(`${mapped.label}: ${value}`)\n      }\n    } else {\n      for (const [, {label, storeKey}] of Object.entries(VARIATION_ATTRIBUTE_MAP)) {\n        const value = attrValues[storeKey]\n        if (value) meta.push(`${label}: ${value}`)\n      }\n    }\n\n    return {\n      title,\n      subtitle: meta.join(' | '),\n      media: (\n        <SfccDocumentStatus isDeleted={!isActive} imageUrl={productImage ?? ''} title={title} />\n      ),\n    }\n  },\n}\n","import {defineStructure} from './index'\n\nexport const categoryStructure = defineStructure((S) =>\n  S.listItem().title('Categories').schemaType('category').child(S.documentTypeList('category')),\n)\n","import {API_VERSION} from '../constants'\nimport {defineStructure} from './index'\n\nexport const productStructure = defineStructure((S, context) => {\n  const client = context.getClient({apiVersion: API_VERSION})\n\n  return S.listItem()\n    .title('Products')\n    .schemaType('product')\n    .child(\n      S.documentList()\n        .title('Products')\n        .schemaType('product')\n        .filter('_type == \"product\" && store.productType in [\"Master\", \"Simple\"]')\n        .apiVersion(API_VERSION)\n        .child(async (productId) => {\n          const product = await client.fetch('*[_id == $id][0]{store}', {id: productId})\n\n          if (product?.store?.productType === 'Master') {\n            const variantRefs: string[] =\n              product.store.variants?.map((v: {_ref: string}) => v._ref) ?? []\n\n            return S.list()\n              .title('Product')\n              .items([\n                S.documentListItem().id(productId).schemaType('product'),\n                S.divider().title('Variants'),\n                ...variantRefs.map((ref) => S.documentListItem().id(ref).schemaType('product')),\n              ])\n          }\n\n          return S.document().documentId(productId).schemaType('product')\n        }),\n    )\n})\n","import type {ConfigContext} from 'sanity'\nimport type {StructureBuilder} from 'sanity/structure'\n\n/**\n * Helper for creating and typing composable structure parts.\n */\nexport function defineStructure<StructureType>(\n  factory: (S: StructureBuilder, context: ConfigContext) => StructureType,\n) {\n  return factory\n}\n\nexport * from './categoryStructure'\nexport * from './productStructure'\n","import {type DecorationMember, definePlugin, type ObjectMember} from 'sanity'\n\nimport {SfccOfflineBanner} from './components/SfccOfflineBanner'\nimport {createSfccDeleteAction} from './documentActions/sfccDelete'\n\n// Schema building blocks\nexport {sfccCategoryPreview, sfccCategoryStoreField} from './schemas/category'\nexport {sfccProductPreview, sfccProductStoreField} from './schemas/product'\n\n// Structure builders\nexport {categoryStructure, productStructure} from './structure'\n\n// Components\nexport {SfccDocumentStatus} from './components/SfccDocumentStatus'\nexport {SfccOfflineBanner} from './components/SfccOfflineBanner'\n\n/**\n * `renderMembers` callback that injects a caution banner at the top of the\n * document form when the SFCC document is offline or deleted.\n *\n * Usage: add `renderMembers: sfccRenderMembers` to your `defineType` call.\n */\nexport const sfccRenderMembers = (members: ObjectMember[]): (ObjectMember | DecorationMember)[] => [\n  {\n    key: 'sfcc-offline-banner',\n    kind: 'decoration',\n    component: SfccOfflineBanner,\n  },\n  ...members,\n]\n\nconst SFCC_TYPES = new Set(['product', 'category'])\n\n/**\n * SFCC plugin — enforces document-level guardrails for synced commerce data:\n *\n * - Replaces the built-in `delete` action with a custom one that also cleans\n *   up associated product variants when deleting a product.\n * - Removes the `duplicate` action (documents are managed by SFCC sync).\n * - Hides product / category from the \"Create new document\" menu\n *   (new documents are only created by the sync process).\n */\nexport const sfccPlugin = definePlugin(() => ({\n  name: 'sfcc',\n  document: {\n    actions: (prev, context) => {\n      if (SFCC_TYPES.has(context.schemaType)) {\n        return prev\n          .filter((action) => action.action !== 'duplicate')\n          .map((action) => (action.action === 'delete' ? createSfccDeleteAction(action) : action))\n      }\n      return prev\n    },\n    newDocumentOptions: (prev) => {\n      return prev.filter((template) => !SFCC_TYPES.has(template.templateId))\n    },\n  },\n}))\n"],"mappings":";;;;;;;;;;;;;;;;;AAWA,SAAOK,oBAAA;CAAA,IAAAC,IAAAC,EAAA,CAAA,GAAAC;CAAA,AAAAF,EAAA,OAAAG,OAAAC,IAAA,2BAAA,KAC8BF,KAAA,CAAC,SAAS,YAAY,GAACF,EAAA,KAAAE,MAAAA,KAAAF,EAAA;CAA1D,IAAAK,gBAAsBP,aAAaI,EAAuB,GAACI;CAAA,AAAAN,EAAA,OAAAG,OAAAC,IAAA,2BAAA,KAC5BE,KAAA,CAAC,SAAS,QAAQ,GAACN,EAAA,KAAAM,MAAAA,KAAAN,EAAA;CAAlD,IAAAO,YAAkBT,aAAaQ,EAAmB;CAMlD,MAJmB,OAAOD,iBAAkB,YAAzBA,gBAAAI,KAAAA,OACJ,OAAOF,aAAc,YAArBA,YAAAE,KAAAA,QAGE,IAAK,OAAS;CAAI,IAAAG;CAY1B,OAZ0BZ,EAAA,OAAAG,OAAAC,IAAA,2BAAA,KAGjCQ,KAAA,oBAAC,MAAD;EAAe,SAAA;EAAW,QAAA;EAAW,QAAA;EAAQ,MAAA;EAC3C,UAAA,qBAAC,MAAD;GAAY,OAAA;GAAc,KAAA;GAA1B,UAAA,CACE,oBAAC,MAAD;IAAY,MAAA;IACV,UAAA,oBAAC,oBAAD,CAAmB,CAAA;GADhB,CAAA,GAGL,oBAAC,MAAD;IAAY,MAAA;IAAU,QAAA;IAAS,UAAA;GAA1B,CAAA,CAJF;;CADF,CAAA,GASEZ,EAAA,KAAAY,MAAAA,KAAAZ,EAAA,IATPY;AASO;AC/BX,MAAaC,cAAc,cCQrBU,SAA8D;CAClEI,SAAS;EACPF,SAAS;EACTC,UAAU;CACZ;CACAE,UAAU;EACRH,SAAS;EACTC,UAAU;CACZ;AACF;;;;;;;;;;AAWA,SAAgBG,uBACdC,sBACyB;CACzB,OAAO,SAASC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QAAQI,aAAa,CAACd,WAAWQ,IAAIM,SAASC,UAAU,CAAC;CAEzE;AACF,EAAE"}
\ No newline at end of file
+{"version":3,"file":"index.js","names":["WarningOutlineIcon","Card","Flex","Text","useFormValue","SfccOfflineBanner","$","_c","t0","Symbol","for","onlineFlagRaw","t1","onlineRaw","onlineFlag","undefined","online","isOnline","t2","API_VERSION","TrashIcon","Stack","Text","useToast","useState","DocumentActionComponent","useClient","useRouter","API_VERSION","CONFIG","Record","message","backPath","product","category","createSfccDeleteAction","originalDeleteAction","SfccDeleteAction","props","originalResult","dialogOpen","setDialogOpen","router","toast","client","apiVersion","type","draft","published","config","tone","icon","label","onHandle","dialog","onCancel","onConfirm","transaction","_id","delete","store","variants","Array","isArray","v","_ref","commit","navigateUrl","path","err","Error","push","status","title","CloseIcon","ImageIcon","Ref","useState","Props","isDeleted","imageUrl","title","ref","HTMLDivElement","SfccDocumentStatus","props","$","_c","imageVisible","setImageVisible","t0","Symbol","for","handleImageError","t1","alignItems","borderRadius","display","height","justifyContent","overflow","width","t2","replace","left","objectFit","position","top","t3","background","color","t4","defineField","SfccDocumentStatus","sfccCategoryStoreField","readOnly","name","title","type","group","fields","to","sfccCategoryPreview","select","imageUrl","isActive","displayName","categoryId","parentDisplayName","parentName","parentId","prepare","value","displayTitle","isRoot","parentLabel","subtitle","media","defineField","SfccDocumentStatus","sfccProductStoreField","readOnly","name","title","type","group","fields","of","to","weak","VariationAttrKey","VARIATION_ATTRIBUTE_MAP","Record","label","storeKey","color","size","memorySize","tvSize","sfccProductPreview","select","id","productType","variationAttributes","productImage","isActive","prepare","selection","value","attrValues","meta","push","length","attr","mapped","Object","entries","subtitle","join","media","defineStructure","categoryStructure","S","listItem","title","schemaType","child","documentTypeList","API_VERSION","defineStructure","productStructure","S","context","client","getClient","apiVersion","listItem","title","schemaType","child","documentList","filter","productId","product","fetch","id","store","productType","variantRefs","variants","map","v","_ref","list","items","documentListItem","divider","ref","document","documentId","ConfigContext","StructureBuilder","defineStructure","factory","S","context","StructureType","DecorationMember","definePlugin","ObjectMember","SfccOfflineBanner","createSfccDeleteAction","sfccCategoryPreview","sfccCategoryStoreField","sfccProductPreview","sfccProductStoreField","categoryStructure","productStructure","SfccDocumentStatus","sfccRenderMembers","members","key","kind","component","SFCC_TYPES","Set","sfccPlugin","name","document","actions","prev","context","has","schemaType","filter","action","map","newDocumentOptions","template","templateId"],"sources":["../src/components/SfccOfflineBanner.tsx","../src/constants.ts","../src/documentActions/sfccDelete.tsx","../src/components/SfccDocumentStatus.tsx","../src/schemas/category.tsx","../src/schemas/product.tsx","../src/structure/categoryStructure.ts","../src/structure/productStructure.ts","../src/structure/index.ts","../src/index.ts"],"sourcesContent":["import {WarningOutlineIcon} from '@sanity/icons/WarningOutline'\nimport {Card, Flex, Text} from '@sanity/ui'\nimport {useFormValue} from 'sanity'\n\n/**\n * Decorative banner injected via `renderMembers` that warns editors when a\n * product or category is offline in SFCC.\n *\n * Reads `store.onlineFlag` (products) and `store.online` (categories) via\n * `useFormValue` so it works without props.\n */\nexport function SfccOfflineBanner() {\n  const onlineFlagRaw = useFormValue(['store', 'onlineFlag'])\n  const onlineRaw = useFormValue(['store', 'online'])\n\n  const onlineFlag = typeof onlineFlagRaw === 'boolean' ? onlineFlagRaw : undefined\n  const online = typeof onlineRaw === 'boolean' ? onlineRaw : undefined\n  const isOnline = onlineFlag ?? online\n\n  if (isOnline !== false) return null\n\n  return (\n    <Card padding={4} radius={2} shadow={1} tone=\"caution\">\n      <Flex align=\"center\" gap={3}>\n        <Text size={2}>\n          <WarningOutlineIcon />\n        </Text>\n        <Text size={1} weight=\"medium\">\n          This document is currently offline in SFCC.\n        </Text>\n      </Flex>\n    </Card>\n  )\n}\n","export const API_VERSION = '2026-02-24'\n","import {TrashIcon} from '@sanity/icons/Trash'\nimport {Stack, Text} from '@sanity/ui'\nimport {useToast} from '@sanity/ui/toast'\nimport {useState} from 'react'\nimport {type DocumentActionComponent, useClient} from 'sanity'\nimport {useRouter} from 'sanity/router'\n\nimport {API_VERSION} from '../constants'\n\nconst CONFIG: Record<string, {message: string; backPath: string}> = {\n  product: {\n    message: 'Delete the current product and all associated variants in your dataset?',\n    backPath: '/structure/products',\n  },\n  category: {\n    message: 'Delete the current category from your dataset?',\n    backPath: '/structure/categories',\n  },\n}\n\n/**\n * Wraps the built-in delete action for SFCC-synced documents.\n *\n * - **Products**: deletes the product *and* all associated variants\n *   (resolved from `store.variants[]._ref`) in a single transaction,\n *   then navigates back to the products list.\n * - **Categories**: deletes the category with a confirmation warning,\n *   then navigates back to the categories list.\n */\nexport function createSfccDeleteAction(\n  originalDeleteAction: DocumentActionComponent,\n): DocumentActionComponent {\n  return function SfccDeleteAction(props) {\n    const originalResult = originalDeleteAction(props)\n\n    const [dialogOpen, setDialogOpen] = useState(false)\n    const router = useRouter()\n    const toast = useToast()\n    const client = useClient({apiVersion: API_VERSION})\n\n    const {type, draft, published} = props\n    const config = CONFIG[type]\n\n    if (!config) return originalResult\n\n    return {\n      ...originalResult,\n      tone: 'critical',\n      icon: TrashIcon,\n      label: 'Delete',\n      onHandle: () => setDialogOpen(true),\n      dialog: dialogOpen && {\n        type: 'confirm',\n        message: (\n          <Stack gap={4}>\n            <Text size={1}>{config.message}</Text>\n            <Text size={1} weight=\"medium\">\n              No data on SFCC will be deleted.\n            </Text>\n          </Stack>\n        ),\n        onCancel: () => setDialogOpen(false),\n        onConfirm: async () => {\n          const transaction = client.transaction()\n          if (published?._id) transaction.delete(published._id)\n          if (draft?._id) transaction.delete(draft._id)\n\n          if (type === 'product' && published) {\n            const store = published['store']\n            const variants =\n              store != null &&\n              typeof store === 'object' &&\n              'variants' in store &&\n              Array.isArray(store.variants)\n                ? store.variants\n                : []\n            for (const v of variants) {\n              if (v != null && typeof v === 'object' && '_ref' in v && typeof v._ref === 'string') {\n                transaction.delete(v._ref)\n                transaction.delete(`drafts.${v._ref}`)\n              }\n            }\n          }\n\n          try {\n            await transaction.commit()\n            router.navigateUrl({path: config.backPath})\n          } catch (err) {\n            const message = err instanceof Error ? err.message : 'Unknown Error'\n            toast.push({status: 'error', title: message})\n          } finally {\n            setDialogOpen(false)\n          }\n        },\n      },\n    }\n  }\n}\n","import {CloseIcon} from '@sanity/icons/Close'\nimport {ImageIcon} from '@sanity/icons/Image'\nimport {type Ref, useState} from 'react'\n\ntype Props = {\n  isDeleted: boolean\n  imageUrl: string\n  title: string\n  ref?: Ref<HTMLDivElement>\n}\n\nconst SfccDocumentStatus = (props: Props) => {\n  const {isDeleted, imageUrl, title, ref} = props\n\n  const [imageVisible, setImageVisible] = useState(true)\n\n  const handleImageError = () => setImageVisible(false)\n\n  return (\n    <div\n      ref={ref}\n      style={{\n        alignItems: 'center',\n        borderRadius: 'inherit',\n        display: 'flex',\n        height: '100%',\n        justifyContent: 'center',\n        overflow: 'hidden',\n        width: '100%',\n      }}\n    >\n      {imageVisible && imageUrl ? (\n        <img\n          onError={handleImageError}\n          src={imageUrl.replace('/large/', '/small/')}\n          style={{\n            height: '100%',\n            left: 0,\n            objectFit: 'contain',\n            position: 'absolute',\n            top: 0,\n            width: '100%',\n          }}\n          alt={`${title} preview`}\n        />\n      ) : (\n        <ImageIcon style={{position: 'absolute'}} />\n      )}\n\n      {isDeleted && (\n        <CloseIcon\n          style={{\n            background: 'rgba(255, 0, 0, 0.7)',\n            color: 'rgba(255, 255, 255, 0.85)',\n            height: '100%',\n            position: 'relative',\n            width: '100%',\n          }}\n        />\n      )}\n    </div>\n  )\n}\n\nexport {SfccDocumentStatus}\n","import {defineField} from 'sanity'\n\nimport {SfccDocumentStatus} from '../components/SfccDocumentStatus'\n\n/**\n * SFCC category store field — contains all read-only data synced from\n * Salesforce Commerce Cloud.  Add this to a `category` document type's\n * `fields` array alongside your own custom fields.\n *\n * The field is placed in the `sfcc` group; make sure the document type\n * declares that group.\n */\nexport const sfccCategoryStoreField = defineField({\n  readOnly: true,\n  name: 'store',\n  title: 'SFCC Data',\n  type: 'object',\n  group: 'sfcc',\n  fields: [\n    defineField({name: 'categoryId', title: 'Category ID', type: 'string', readOnly: true}),\n    defineField({\n      name: 'thumbnailImage',\n      title: 'Thumbnail Image',\n      type: 'string',\n      readOnly: true,\n    }),\n    defineField({name: 'online', title: 'Online', type: 'boolean', readOnly: true}),\n    defineField({name: 'onlineFrom', title: 'Online From', type: 'date', readOnly: true}),\n    defineField({name: 'onlineTo', title: 'Online To', type: 'date', readOnly: true}),\n    defineField({name: 'creationDate', title: 'Creation Date', type: 'date', readOnly: true}),\n    defineField({name: 'isDeleted', title: 'Is Deleted', type: 'boolean', readOnly: true}),\n    defineField({\n      name: 'parentCategory',\n      type: 'reference',\n      to: [{type: 'category'}],\n      readOnly: true,\n    }),\n    defineField({\n      name: 'displayName',\n      title: 'Display Name',\n      type: 'internationalizedArrayString',\n      readOnly: true,\n    }),\n    defineField({\n      name: 'description',\n      title: 'Description',\n      type: 'internationalizedArrayText',\n      readOnly: true,\n    }),\n  ],\n})\n\n/**\n * Default preview configuration for the `category` document type.\n * Shows Category Name with parent category as subtitle.\n */\nexport const sfccCategoryPreview = {\n  select: {\n    imageUrl: 'store.thumbnailImage',\n    isActive: 'store.online',\n    displayName: 'store.displayName',\n    title: 'title',\n    name: 'name',\n    categoryId: 'store.categoryId',\n    parentDisplayName: 'store.parentCategory.store.displayName',\n    parentName: 'store.parentCategory.name',\n    parentId: 'store.parentCategory.store.categoryId',\n  },\n  prepare({\n    imageUrl,\n    displayName,\n    title,\n    name,\n    categoryId,\n    parentDisplayName,\n    parentName,\n    parentId,\n    isActive,\n  }: {\n    imageUrl?: string\n    displayName?: {value: string}[]\n    title?: string\n    name?: string\n    categoryId?: string\n    parentDisplayName?: {value: string}[]\n    parentName?: string\n    parentId?: string\n    isActive?: boolean\n  }) {\n    const displayTitle =\n      title || name || displayName?.[0]?.value || categoryId || 'Untitled Category'\n\n    const isRoot = parentId === 'root'\n    const parentLabel = !isRoot && (parentName || parentDisplayName?.[0]?.value || parentId)\n\n    return {\n      title: displayTitle,\n      subtitle: parentLabel ? `Parent: ${parentLabel}` : '',\n      media: (\n        <SfccDocumentStatus isDeleted={!isActive} imageUrl={imageUrl ?? ''} title={displayTitle} />\n      ),\n    }\n  },\n}\n","import {defineField} from 'sanity'\n\nimport {SfccDocumentStatus} from '../components/SfccDocumentStatus'\n\n/**\n * SFCC product store field — contains all read-only data synced from\n * Salesforce Commerce Cloud.  Add this to a `product` document type's\n * `fields` array alongside your own custom fields.\n *\n * The field is placed in the `sfcc` group; make sure the document type\n * declares that group.\n */\nexport const sfccProductStoreField = defineField({\n  readOnly: true,\n  name: 'store',\n  title: 'SFCC Data',\n  type: 'object',\n  group: 'sfcc',\n  fields: [\n    defineField({name: 'productId', title: 'Product ID', type: 'string', readOnly: true}),\n    defineField({name: 'brand', title: 'Brand', type: 'string', readOnly: true}),\n    defineField({name: 'color', title: 'Color', type: 'string', readOnly: true}),\n    defineField({name: 'size', title: 'Size', type: 'string', readOnly: true}),\n    defineField({name: 'width', title: 'Width', type: 'string', readOnly: true}),\n    defineField({name: 'productType', title: 'Product Type', type: 'string', readOnly: true}),\n    defineField({name: 'styleNumber', title: 'Style Number', type: 'string', readOnly: true}),\n    defineField({name: 'searchable', title: 'Searchable', type: 'boolean', readOnly: true}),\n    defineField({name: 'isSale', title: 'On Sale?', type: 'boolean', readOnly: true}),\n    defineField({name: 'isNew', title: 'New Arrival?', type: 'boolean', readOnly: true}),\n    defineField({\n      name: 'manufacturerName',\n      title: 'Manufacturer',\n      type: 'string',\n      readOnly: true,\n    }),\n    defineField({\n      name: 'manufacturerSKU',\n      title: 'Manufacturer Product ID',\n      type: 'string',\n      readOnly: true,\n    }),\n    defineField({\n      name: 'creationDate',\n      title: 'Creation Date',\n      type: 'datetime',\n      readOnly: true,\n    }),\n    defineField({\n      name: 'lastModified',\n      title: 'Last Modified',\n      type: 'datetime',\n      readOnly: true,\n    }),\n    defineField({name: 'onlineFlag', title: 'Online', type: 'boolean', readOnly: true}),\n    defineField({name: 'onlineFrom', title: 'Online From', type: 'datetime', readOnly: true}),\n    defineField({name: 'onlineTo', title: 'Online To', type: 'datetime', readOnly: true}),\n    defineField({name: 'length', title: 'Length', type: 'string', readOnly: true}),\n    defineField({name: 'memorySize', title: 'Memory Size', type: 'string', readOnly: true}),\n    defineField({name: 'tvSize', title: 'TV Size', type: 'string', readOnly: true}),\n    defineField({\n      name: 'tvType',\n      title: 'TV Type',\n      type: 'array',\n      of: [{type: 'string'}],\n      readOnly: true,\n    }),\n    defineField({\n      name: 'productImage',\n      title: 'Product Image',\n      type: 'string',\n      readOnly: true,\n    }),\n    defineField({\n      name: 'refinementColor',\n      title: 'Refinement Color',\n      type: 'string',\n      readOnly: true,\n    }),\n    defineField({\n      name: 'variants',\n      title: 'Variants',\n      type: 'array',\n      of: [{type: 'reference', to: [{type: 'product'}], weak: true}],\n      readOnly: true,\n    }),\n    defineField({\n      name: 'variationAttributes',\n      title: 'Variation Attributes',\n      type: 'array',\n      of: [{type: 'string'}],\n      readOnly: true,\n    }),\n    defineField({name: 'isDeleted', title: 'Is Deleted', type: 'boolean'}),\n    defineField({\n      name: 'name',\n      title: 'Name',\n      type: 'internationalizedArrayString',\n      readOnly: true,\n    }),\n    defineField({\n      name: 'longDescription',\n      title: 'Long Description',\n      type: 'internationalizedArrayText',\n      readOnly: true,\n    }),\n    defineField({\n      name: 'shortDescription',\n      title: 'Short Description',\n      type: 'internationalizedArrayText',\n      readOnly: true,\n    }),\n    defineField({\n      name: 'pageTitle',\n      title: 'Page Title',\n      type: 'internationalizedArrayString',\n      readOnly: true,\n    }),\n    defineField({\n      name: 'pageDescription',\n      title: 'Page Description',\n      type: 'internationalizedArrayString',\n      readOnly: true,\n    }),\n    defineField({\n      name: 'pageKeywords',\n      title: 'Page Keywords',\n      type: 'internationalizedArrayString',\n      readOnly: true,\n    }),\n    defineField({\n      name: 'pageURL',\n      title: 'Page URL',\n      type: 'internationalizedArrayString',\n      readOnly: true,\n    }),\n  ],\n})\n\ntype VariationAttrKey = 'color' | 'size' | 'memorySize' | 'tvSize'\n\n/**\n * Maps SFCC variation attribute IDs to their store field keys and display labels.\n */\nconst VARIATION_ATTRIBUTE_MAP: Record<string, {label: string; storeKey: VariationAttrKey}> = {\n  color: {label: 'Color', storeKey: 'color'},\n  size: {label: 'Size', storeKey: 'size'},\n  memorySize: {label: 'Memory Size', storeKey: 'memorySize'},\n  tvSize: {label: 'TV Size', storeKey: 'tvSize'},\n}\n\n/**\n * Default preview configuration for the `product` document type.\n * Shows product type for Master/Simple, and the relevant variation\n * attributes (driven by `store.variationAttributes`) for all products.\n */\nexport const sfccProductPreview = {\n  select: {\n    name: 'store.name',\n    id: 'store.productId',\n    productType: 'store.productType',\n    variationAttributes: 'store.variationAttributes',\n    color: 'store.color',\n    size: 'store.size',\n    memorySize: 'store.memorySize',\n    tvSize: 'store.tvSize',\n    productImage: 'store.productImage',\n    isActive: 'store.onlineFlag',\n  },\n  prepare(selection: {\n    name?: {value: string}[]\n    id?: string\n    productType?: string\n    variationAttributes?: string[]\n    color?: string\n    size?: string\n    memorySize?: string\n    tvSize?: string\n    productImage?: string\n    isActive?: boolean\n  }) {\n    const {name, id, productType, variationAttributes, productImage, isActive, ...attrValues} =\n      selection\n\n    const title = name?.[0]?.value || id || 'Untitled Product'\n    const meta: string[] = []\n    if (productType && productType !== 'Variant') meta.push(productType)\n\n    if (variationAttributes?.length) {\n      for (const attr of variationAttributes) {\n        const mapped = VARIATION_ATTRIBUTE_MAP[attr]\n        const value = mapped && attrValues[mapped.storeKey]\n        if (mapped && value) meta.push(`${mapped.label}: ${value}`)\n      }\n    } else {\n      for (const [, {label, storeKey}] of Object.entries(VARIATION_ATTRIBUTE_MAP)) {\n        const value = attrValues[storeKey]\n        if (value) meta.push(`${label}: ${value}`)\n      }\n    }\n\n    return {\n      title,\n      subtitle: meta.join(' | '),\n      media: (\n        <SfccDocumentStatus isDeleted={!isActive} imageUrl={productImage ?? ''} title={title} />\n      ),\n    }\n  },\n}\n","import {defineStructure} from './index'\n\nexport const categoryStructure = defineStructure((S) =>\n  S.listItem().title('Categories').schemaType('category').child(S.documentTypeList('category')),\n)\n","import {API_VERSION} from '../constants'\nimport {defineStructure} from './index'\n\nexport const productStructure = defineStructure((S, context) => {\n  const client = context.getClient({apiVersion: API_VERSION})\n\n  return S.listItem()\n    .title('Products')\n    .schemaType('product')\n    .child(\n      S.documentList()\n        .title('Products')\n        .schemaType('product')\n        .filter('_type == \"product\" && store.productType in [\"Master\", \"Simple\"]')\n        .apiVersion(API_VERSION)\n        .child(async (productId) => {\n          const product = await client.fetch('*[_id == $id][0]{store}', {id: productId})\n\n          if (product?.store?.productType === 'Master') {\n            const variantRefs: string[] =\n              product.store.variants?.map((v: {_ref: string}) => v._ref) ?? []\n\n            return S.list()\n              .title('Product')\n              .items([\n                S.documentListItem().id(productId).schemaType('product'),\n                S.divider().title('Variants'),\n                ...variantRefs.map((ref) => S.documentListItem().id(ref).schemaType('product')),\n              ])\n          }\n\n          return S.document().documentId(productId).schemaType('product')\n        }),\n    )\n})\n","import type {ConfigContext} from 'sanity'\nimport type {StructureBuilder} from 'sanity/structure'\n\n/**\n * Helper for creating and typing composable structure parts.\n */\nexport function defineStructure<StructureType>(\n  factory: (S: StructureBuilder, context: ConfigContext) => StructureType,\n) {\n  return factory\n}\n\nexport * from './categoryStructure'\nexport * from './productStructure'\n","import '@sanity/ui/styles.css'\nimport {type DecorationMember, definePlugin, type ObjectMember} from 'sanity'\n\nimport {SfccOfflineBanner} from './components/SfccOfflineBanner'\nimport {createSfccDeleteAction} from './documentActions/sfccDelete'\n\n// Schema building blocks\nexport {sfccCategoryPreview, sfccCategoryStoreField} from './schemas/category'\nexport {sfccProductPreview, sfccProductStoreField} from './schemas/product'\n\n// Structure builders\nexport {categoryStructure, productStructure} from './structure'\n\n// Components\nexport {SfccDocumentStatus} from './components/SfccDocumentStatus'\nexport {SfccOfflineBanner} from './components/SfccOfflineBanner'\n\n/**\n * `renderMembers` callback that injects a caution banner at the top of the\n * document form when the SFCC document is offline or deleted.\n *\n * Usage: add `renderMembers: sfccRenderMembers` to your `defineType` call.\n */\nexport const sfccRenderMembers = (members: ObjectMember[]): (ObjectMember | DecorationMember)[] => [\n  {\n    key: 'sfcc-offline-banner',\n    kind: 'decoration',\n    component: SfccOfflineBanner,\n  },\n  ...members,\n]\n\nconst SFCC_TYPES = new Set(['product', 'category'])\n\n/**\n * SFCC plugin — enforces document-level guardrails for synced commerce data:\n *\n * - Replaces the built-in `delete` action with a custom one that also cleans\n *   up associated product variants when deleting a product.\n * - Removes the `duplicate` action (documents are managed by SFCC sync).\n * - Hides product / category from the \"Create new document\" menu\n *   (new documents are only created by the sync process).\n */\nexport const sfccPlugin = definePlugin(() => ({\n  name: 'sfcc',\n  document: {\n    actions: (prev, context) => {\n      if (SFCC_TYPES.has(context.schemaType)) {\n        return prev\n          .filter((action) => action.action !== 'duplicate')\n          .map((action) => (action.action === 'delete' ? createSfccDeleteAction(action) : action))\n      }\n      return prev\n    },\n    newDocumentOptions: (prev) => {\n      return prev.filter((template) => !SFCC_TYPES.has(template.templateId))\n    },\n  },\n}))\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAWA,SAAOK,oBAAA;CAAA,IAAAC,IAAAC,EAAA,CAAA,GAAAC;CAAA,AAAAF,EAAA,OAAAG,OAAAC,IAAA,2BAAA,KAC8BF,KAAA,CAAC,SAAS,YAAY,GAACF,EAAA,KAAAE,MAAAA,KAAAF,EAAA;CAA1D,IAAAK,gBAAsBP,aAAaI,EAAuB,GAACI;CAAA,AAAAN,EAAA,OAAAG,OAAAC,IAAA,2BAAA,KAC5BE,KAAA,CAAC,SAAS,QAAQ,GAACN,EAAA,KAAAM,MAAAA,KAAAN,EAAA;CAAlD,IAAAO,YAAkBT,aAAaQ,EAAmB;CAMlD,MAJmB,OAAOD,iBAAkB,YAAzBA,gBAAAI,KAAAA,OACJ,OAAOF,aAAc,YAArBA,YAAAE,KAAAA,QAGE,IAAK,OAAS;CAAI,IAAAG;CAY1B,OAZ0BZ,EAAA,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P,EAAE2B,SAAS,CAAC,CAACC,WAAWjB,SAAS,CAAC,CAACJ,WAAW,SAAS;CAChE,CAAC,CACL;AACJ,CAAC;;;;AC5BD,SAAgBwB,gBACdC,SACA;CACA,OAAOA;AACT;;;;;;;ACaA,MAAagB,qBAAqBC,YAAiE,CACjG;CACEC,KAAK;CACLC,MAAM;CACNC,WAAWb;AACb,GACA,GAAGU,OAAO,GAGNI,6BAAa,IAAIC,IAAI,CAAC,WAAW,UAAU,CAAC,GAWrCC,aAAalB,oBAAoB;CAC5CmB,MAAM;CACNC,UAAU;EACRC,UAAUC,MAAMC,YACVP,WAAWQ,IAAID,QAAQE,UAAU,IAC5BH,KACJI,QAAQC,WAAWA,OAAOA,WAAW,WAAW,CAAC,CACjDC,KAAKD,WAAYA,OAAOA,WAAW,WAAWxB,uBAAuBwB,MAAM,IAAIA,MAAO,IAEpFL;EAETO,qBAAqBP,SACZA,KAAKI,QAAQI,aAAa,CAACd,WAAWQ,IAAIM,SAASC,UAAU,CAAC;CAEzE;AACF,EAAE"}
\ No newline at end of file
Index: package/dist/index.d.ts
===================================================================
--- package/dist/index.d.ts
+++ package/dist/index.d.ts
@@ -1,4 +1,5 @@
+import "@sanity/ui/styles.css";
 import { DecorationMember, ObjectMember } from "sanity";
 import { Ref } from "react";
 import "sanity/structure";
 /**
@@ -9,13 +10,67 @@
  * The field is placed in the `sfcc` group; make sure the document type
  * declares that group.
  */
 declare const sfccCategoryStoreField: {
-  type: "object";
+  readOnly: true;
   name: "store";
-} & Omit<import("sanity").ObjectDefinition, "preview"> & {
-  preview?: import("sanity").PreviewConfig<Record<string, string>, Record<never, any>> | undefined;
-} & import("sanity").FieldDefinitionBase & import("sanity").WidenValidation & import("sanity").WidenInitialValue;
+  title: string;
+  type: "object";
+  group: string;
+  fields: ({
+    name: "categoryId";
+    title: string;
+    type: "string";
+    readOnly: true;
+  } | {
+    name: "thumbnailImage";
+    title: string;
+    type: "string";
+    readOnly: true;
+  } | {
+    name: "online";
+    title: string;
+    type: "boolean";
+    readOnly: true;
+  } | {
+    name: "onlineFrom";
+    title: string;
+    type: "date";
+    readOnly: true;
+  } | {
+    name: "onlineTo";
+    title: string;
+    type: "date";
+    readOnly: true;
+  } | {
+    name: "creationDate";
+    title: string;
+    type: "date";
+    readOnly: true;
+  } | {
+    name: "isDeleted";
+    title: string;
+    type: "boolean";
+    readOnly: true;
+  } | {
+    name: "parentCategory";
+    type: "reference";
+    to: {
+      type: string;
+    }[];
+    readOnly: true;
+  } | {
+    name: "displayName";
+    title: string;
+    type: "internationalizedArrayString";
+    readOnly: true;
+  } | {
+    name: "description";
+    title: string;
+    type: "internationalizedArrayText";
+    readOnly: true;
+  })[];
+};
 /**
  * Default preview configuration for the `category` document type.
  * Shows Category Name with parent category as subtitle.
  */
@@ -59,13 +114,192 @@
  * The field is placed in the `sfcc` group; make sure the document type
  * declares that group.
  */
 declare const sfccProductStoreField: {
-  type: "object";
+  readOnly: true;
   name: "store";
-} & Omit<import("sanity").ObjectDefinition, "preview"> & {
-  preview?: import("sanity").PreviewConfig<Record<string, string>, Record<never, any>> | undefined;
-} & import("sanity").FieldDefinitionBase & import("sanity").WidenValidation & import("sanity").WidenInitialValue;
+  title: string;
+  type: "object";
+  group: string;
+  fields: ({
+    name: "productId";
+    title: string;
+    type: "string";
+    readOnly: true;
+  } | {
+    name: "brand";
+    title: string;
+    type: "string";
+    readOnly: true;
+  } | {
+    name: "color";
+    title: string;
+    type: "string";
+    readOnly: true;
+  } | {
+    name: "size";
+    title: string;
+    type: "string";
+    readOnly: true;
+  } | {
+    name: "width";
+    title: string;
+    type: "string";
+    readOnly: true;
+  } | {
+    name: "productType";
+    title: string;
+    type: "string";
+    readOnly: true;
+  } | {
+    name: "styleNumber";
+    title: string;
+    type: "string";
+    readOnly: true;
+  } | {
+    name: "searchable";
+    title: string;
+    type: "boolean";
+    readOnly: true;
+  } | {
+    name: "isSale";
+    title: string;
+    type: "boolean";
+    readOnly: true;
+  } | {
+    name: "isNew";
+    title: string;
+    type: "boolean";
+    readOnly: true;
+  } | {
+    name: "manufacturerName";
+    title: string;
+    type: "string";
+    readOnly: true;
+  } | {
+    name: "manufacturerSKU";
+    title: string;
+    type: "string";
+    readOnly: true;
+  } | {
+    name: "creationDate";
+    title: string;
+    type: "datetime";
+    readOnly: true;
+  } | {
+    name: "lastModified";
+    title: string;
+    type: "datetime";
+    readOnly: true;
+  } | {
+    name: "onlineFlag";
+    title: string;
+    type: "boolean";
+    readOnly: true;
+  } | {
+    name: "onlineFrom";
+    title: string;
+    type: "datetime";
+    readOnly: true;
+  } | {
+    name: "onlineTo";
+    title: string;
+    type: "datetime";
+    readOnly: true;
+  } | {
+    name: "length";
+    title: string;
+    type: "string";
+    readOnly: true;
+  } | {
+    name: "memorySize";
+    title: string;
+    type: "string";
+    readOnly: true;
+  } | {
+    name: "tvSize";
+    title: string;
+    type: "string";
+    readOnly: true;
+  } | {
+    name: "tvType";
+    title: string;
+    type: "array";
+    of: {
+      type: "string";
+    }[];
+    readOnly: true;
+  } | {
+    name: "productImage";
+    title: string;
+    type: "string";
+    readOnly: true;
+  } | {
+    name: "refinementColor";
+    title: string;
+    type: "string";
+    readOnly: true;
+  } | {
+    name: "variants";
+    title: string;
+    type: "array";
+    of: {
+      type: "reference";
+      to: {
+        type: string;
+      }[];
+      weak: true;
+    }[];
+    readOnly: true;
+  } | {
+    name: "variationAttributes";
+    title: string;
+    type: "array";
+    of: {
+      type: "string";
+    }[];
+    readOnly: true;
+  } | {
+    name: "isDeleted";
+    title: string;
+    type: "boolean";
+  } | {
+    name: "name";
+    title: string;
+    type: "internationalizedArrayString";
+    readOnly: true;
+  } | {
+    name: "longDescription";
+    title: string;
+    type: "internationalizedArrayText";
+    readOnly: true;
+  } | {
+    name: "shortDescription";
+    title: string;
+    type: "internationalizedArrayText";
+    readOnly: true;
+  } | {
+    name: "pageTitle";
+    title: string;
+    type: "internationalizedArrayString";
+    readOnly: true;
+  } | {
+    name: "pageDescription";
+    title: string;
+    type: "internationalizedArrayString";
+    readOnly: true;
+  } | {
+    name: "pageKeywords";
+    title: string;
+    type: "internationalizedArrayString";
+    readOnly: true;
+  } | {
+    name: "pageURL";
+    title: string;
+    type: "internationalizedArrayString";
+    readOnly: true;
+  })[];
+};
 /**
  * Default preview configuration for the `product` document type.
  * Shows product type for Master/Simple, and the relevant variation
  * attributes (driven by `store.variationAttributes`) for all products.