@sanity/sfcc
1.0.341.0.35
dist/index.js.map~
dist/index.js.mapModified+1−1
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":["['store', 'onlineFlag']","['store', 'online']","<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>","() => setImageVisible(false)","{\n alignItems: 'center',\n borderRadius: 'inherit',\n display: 'flex',\n height: '100%',\n justifyContent: 'center',\n overflow: 'hidden',\n width: '100%',\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 )","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 )","<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>"],"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,SAAgB,oBAAoB;eACCA;qDAAC,KAAA,CAAA,SAAS,YAAY;CAAzD,IAAM,gBAAgB,aAAaA,EAAuB,G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S,CAAC,CAChB,MAAM;IACL,EAAE,iBAAiB,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,WAAW,SAAS;IACvD,EAAE,QAAQ,CAAC,CAAC,MAAM,UAAU;IAC5B,GAAG,YAAY,KAAK,QAAQ,EAAE,iBAAiB,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,WAAW,SAAS,CAAC;GAChF,CAAC;EACL;EAEA,OAAO,EAAE,SAAS,CAAC,CAAC,WAAW,SAAS,CAAC,CAAC,WAAW,SAAS;CAChE,CAAC,CACL;AACJ,CAAC;;;;AC5BD,SAAgB,gBACd,SACA;CACA,OAAO;AACT;;;;;;;ACaA,MAAa,qBAAqB,YAAiE,CACjG;CACE,KAAK;CACL,MAAM;CACN,WAAW;AACb,GACA,GAAG,OACL,GAEM,6BAAa,IAAI,IAAI,CAAC,WAAW,UAAU,CAAC,GAWrC,aAAa,oBAAoB;CAC5C,MAAM;CACN,UAAU;EACR,UAAU,MAAM,YACV,WAAW,IAAI,QAAQ,UAAU,IAC5B,KACJ,QAAQ,WAAW,OAAO,WAAW,WAAW,CAAC,CACjD,KAAK,WAAY,OAAO,WAAW,WAAW,uBAAuB,MAAM,IAAI,MAAO,IAEpF;EAET,qBAAqB,SACZ,KAAK,QAAQ,aAAa,CAAC,WAAW,IAAI,SAAS,UAAU,CAAC;CAEzE;AACF,EAAE"}
\ No newline at end of file
+{"version":3,"file":"index.js","names":["['store', 'onlineFlag']","['store', 'online']","<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>","_c","() => setImageVisible(false)","{\n alignItems: 'center',\n borderRadius: 'inherit',\n display: 'flex',\n height: '100%',\n justifyContent: 'center',\n overflow: 'hidden',\n width: '100%',\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 )","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 )","<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>","_c","\"store\""],"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,SAAgB,oBAAoB;eACCA;qDAAC,KAAA,CAAA,SAAS,YAAY;CAAzD,IAAM,gBAAgB,aAAaA,EAAuB,GAC3BC;qDAAC,KAAA,CAAA,SAAS,QAAQ;CAAjD,IAAM,YAAY,aAAaA,EAAmB;CAMlD,MAJmB,OAAO,iBAAkB,YAAY,gBAAgB,KAAA,OACzD,OAAO,aAAc,YAAY,YAAY,KAAA,QAG3C,IAAO,OAAO;CAG7BC,IAAAA;CADF,2DACG,KAAA,oBAAA,MAAD;EAAM,SAAS;EAAG,QAAQ;EAAG,QAAQ;EAAG,MAAK;EAC3C,UAAA,qBAAC,MAAD;GAAM,OAAM;GAAS,KAAK;GAA1B,UAAA,CACE,oBAAC,MAAD;IAAM,MAAM;IACV,UAAA,oBAAC,oBAAD,CAAqB,CAAA;GACjB,CAAA,GACN,oBAAC,MAAD;IAAM,MAAM;IAAG,QAAO;IACpB,UAAA;GACI,CAAA,CACF;;CAC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