@sanity/sfcc 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +17 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +8 -7
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as sanity from "sanity";
|
|
1
|
+
import * as _$sanity from "sanity";
|
|
2
2
|
import { DecorationMember, ObjectMember } from "sanity";
|
|
3
|
-
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
-
import * as sanity_structure0 from "sanity/structure";
|
|
3
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
import * as _$sanity_structure0 from "sanity/structure";
|
|
5
5
|
import { ListItemBuilder } from "sanity/structure";
|
|
6
|
-
import * as react from "react";
|
|
6
|
+
import * as _$react from "react";
|
|
7
7
|
/**
|
|
8
8
|
* SFCC category store field — contains all read-only data synced from
|
|
9
9
|
* Salesforce Commerce Cloud. Add this to a `category` document type's
|
|
@@ -15,9 +15,9 @@ import * as react from "react";
|
|
|
15
15
|
declare const sfccCategoryStoreField: {
|
|
16
16
|
type: "object";
|
|
17
17
|
name: "store";
|
|
18
|
-
} & Omit<sanity.ObjectDefinition, "preview"> & {
|
|
19
|
-
preview?: sanity.PreviewConfig<Record<string, string>, Record<never, any>> | undefined;
|
|
20
|
-
} & sanity.FieldDefinitionBase & sanity.WidenValidation & sanity.WidenInitialValue;
|
|
18
|
+
} & Omit<_$sanity.ObjectDefinition, "preview"> & {
|
|
19
|
+
preview?: _$sanity.PreviewConfig<Record<string, string>, Record<never, any>> | undefined;
|
|
20
|
+
} & _$sanity.FieldDefinitionBase & _$sanity.WidenValidation & _$sanity.WidenInitialValue;
|
|
21
21
|
/**
|
|
22
22
|
* Default preview configuration for the `category` document type.
|
|
23
23
|
* Shows Category Name with parent category as subtitle.
|
|
@@ -61,7 +61,7 @@ declare const sfccCategoryPreview: {
|
|
|
61
61
|
}): {
|
|
62
62
|
title: string;
|
|
63
63
|
subtitle: string;
|
|
64
|
-
media: react_jsx_runtime0.JSX.Element;
|
|
64
|
+
media: _$react_jsx_runtime0.JSX.Element;
|
|
65
65
|
};
|
|
66
66
|
};
|
|
67
67
|
/**
|
|
@@ -75,9 +75,9 @@ declare const sfccCategoryPreview: {
|
|
|
75
75
|
declare const sfccProductStoreField: {
|
|
76
76
|
type: "object";
|
|
77
77
|
name: "store";
|
|
78
|
-
} & Omit<sanity.ObjectDefinition, "preview"> & {
|
|
79
|
-
preview?: sanity.PreviewConfig<Record<string, string>, Record<never, any>> | undefined;
|
|
80
|
-
} & sanity.FieldDefinitionBase & sanity.WidenValidation & sanity.WidenInitialValue;
|
|
78
|
+
} & Omit<_$sanity.ObjectDefinition, "preview"> & {
|
|
79
|
+
preview?: _$sanity.PreviewConfig<Record<string, string>, Record<never, any>> | undefined;
|
|
80
|
+
} & _$sanity.FieldDefinitionBase & _$sanity.WidenValidation & _$sanity.WidenInitialValue;
|
|
81
81
|
/**
|
|
82
82
|
* Default preview configuration for the `product` document type.
|
|
83
83
|
* Shows product type for Master/Simple, and the relevant variation
|
|
@@ -112,17 +112,17 @@ declare const sfccProductPreview: {
|
|
|
112
112
|
}): {
|
|
113
113
|
title: string;
|
|
114
114
|
subtitle: string;
|
|
115
|
-
media: react_jsx_runtime0.JSX.Element;
|
|
115
|
+
media: _$react_jsx_runtime0.JSX.Element;
|
|
116
116
|
};
|
|
117
117
|
};
|
|
118
|
-
declare const categoryStructure: (S: sanity_structure0.StructureBuilder, context: sanity.ConfigContext) => ListItemBuilder;
|
|
119
|
-
declare const productStructure: (S: sanity_structure0.StructureBuilder, context: sanity.ConfigContext) => ListItemBuilder;
|
|
118
|
+
declare const categoryStructure: (S: _$sanity_structure0.StructureBuilder, context: _$sanity.ConfigContext) => ListItemBuilder;
|
|
119
|
+
declare const productStructure: (S: _$sanity_structure0.StructureBuilder, context: _$sanity.ConfigContext) => ListItemBuilder;
|
|
120
120
|
type Props = {
|
|
121
121
|
isDeleted: boolean;
|
|
122
122
|
imageUrl: string;
|
|
123
123
|
title: string;
|
|
124
124
|
};
|
|
125
|
-
declare const SfccDocumentStatus: react.ForwardRefExoticComponent<Props & react.RefAttributes<HTMLDivElement>>;
|
|
125
|
+
declare const SfccDocumentStatus: _$react.ForwardRefExoticComponent<Props & _$react.RefAttributes<HTMLDivElement>>;
|
|
126
126
|
/**
|
|
127
127
|
* Decorative banner injected via `renderMembers` that warns editors when a
|
|
128
128
|
* product or category is offline in SFCC.
|
|
@@ -130,7 +130,7 @@ declare const SfccDocumentStatus: react.ForwardRefExoticComponent<Props & react.
|
|
|
130
130
|
* Reads `store.onlineFlag` (products) and `store.online` (categories) via
|
|
131
131
|
* `useFormValue` so it works without props.
|
|
132
132
|
*/
|
|
133
|
-
declare function SfccOfflineBanner(): react_jsx_runtime0.JSX.Element | null;
|
|
133
|
+
declare function SfccOfflineBanner(): _$react_jsx_runtime0.JSX.Element | null;
|
|
134
134
|
/**
|
|
135
135
|
* `renderMembers` callback that injects a caution banner at the top of the
|
|
136
136
|
* document form when the SFCC document is offline or deleted.
|
|
@@ -147,6 +147,6 @@ declare const sfccRenderMembers: (members: ObjectMember[]) => (ObjectMember | De
|
|
|
147
147
|
* - Hides product / category from the "Create new document" menu
|
|
148
148
|
* (new documents are only created by the sync process).
|
|
149
149
|
*/
|
|
150
|
-
declare const sfccPlugin: sanity.Plugin<void>;
|
|
150
|
+
declare const sfccPlugin: _$sanity.Plugin<void>;
|
|
151
151
|
export { SfccDocumentStatus, SfccOfflineBanner, categoryStructure, productStructure, sfccCategoryPreview, sfccCategoryStoreField, sfccPlugin, sfccProductPreview, sfccProductStoreField, sfccRenderMembers };
|
|
152
152
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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":";;;;;;;;;;;;;AAYA;cAAa,sBAAA;;;SAsCX,
|
|
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":";;;;;;;;;;;;;AAYA;cAAa,sBAAA;;;SAsCX,QAAA,CAAA,gBAAA;;;;;;;cAMW,mBAAA;;;;;;;;;;;;;;;;;;;;;;;IAuBT,QAAA;IACA,WAAA;MAAe,KAAA;IAAA;IACf,KAAA;IACA,IAAA;IACA,UAAA;IACA,iBAAA;MAAqB,KAAA;IAAA;IACrB,UAAA;IACA,QAAA;IACA,QAAA;EAAA;;;;;;;;;;;;;AA3EJ;cCAa,qBAAA;;;SA4HX,QAAA,CAAA,gBAAA;;;;;;;;cAmBW,kBAAA;;;;;;;;;;;;;;IAcT,IAAA;MAAQ,KAAA;IAAA;IACR,EAAA;IACA,WAAA;IACA,mBAAA;IACA,KAAA;IACA,IAAA;IACA,UAAA;IACA,MAAA;IACA,YAAA;IACA,QAAA;EAAA;;;WA8BH,oBAAA,CAAA,GAAA,CAAA,OAAA;EAAA;AAAA;AAAA,cC5MY,iBAAA,GAAiB,CAAA,EAE7B,mBAAA,CAF6B,gBAAA,EAAA,OAAA,EAAA,QAAA,CAAA,aAAA,KAAA,eAAA;AAAA,cCCjB,gBAAA,GAAgB,CAAA,EA+B3B,mBAAA,CA/B2B,gBAAA,EAAA,OAAA,EAAA,QAAA,CAAA,aAAA,KAAA,eAAA;AAAA,KCFxB,KAAA;EACH,SAAA;EACA,QAAA;EACA,KAAA;AAAA;AAAA,cAGI,kBAAA,EAAkB,OAAA,CAAA,yBAAA,CAAA,KAAA,GAAA,OAAA,CAAA,aAAA,CAAA,cAAA;;;;;;;;iBCER,iBAAA,CAAA,GAAiB,oBAAA,CAAA,GAAA,CAAA,OAAA;;ALCjC;;;;;cMUa,iBAAA,GAAqB,OAAA,EAAS,YAAA,QAAkB,YAAA,GAAe,gBAAA;;;;;;;;;;cAoB/D,UAAA,EAeV,QAAA,CAfoB,MAAA"}
|
package/dist/index.js
CHANGED
|
@@ -48,7 +48,7 @@ function createSfccDeleteAction(originalDeleteAction) {
|
|
|
48
48
|
onHandle: () => setDialogOpen(!0),
|
|
49
49
|
dialog: dialogOpen && {
|
|
50
50
|
type: "confirm",
|
|
51
|
-
message: /* @__PURE__ */ jsxs(Stack, {
|
|
51
|
+
message: /* @__PURE__ */ jsxs(Stack, { gap: 4, children: [
|
|
52
52
|
/* @__PURE__ */ jsx(Text, { size: 1, children: config.message }),
|
|
53
53
|
/* @__PURE__ */ jsx(Text, { size: 1, weight: "medium", children: "No data on SFCC will be deleted." })
|
|
54
54
|
] }),
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","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/index.ts"],"sourcesContent":["import {WarningOutlineIcon} from '@sanity/icons'\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'\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 space={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, ImageIcon} from '@sanity/icons'\nimport {forwardRef, useState} from 'react'\n\ntype Props = {\n isDeleted: boolean\n imageUrl: string\n title: string\n}\n\nconst SfccDocumentStatus = forwardRef<HTMLDivElement, Props>((props, ref) => {\n const {isDeleted, imageUrl, title} = 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 type {ListItemBuilder} from 'sanity/structure'\n\nimport {defineStructure} from './index'\n\nexport const categoryStructure = defineStructure<ListItemBuilder>((S) =>\n S.listItem().title('Categories').schemaType('category').child(S.documentTypeList('category')),\n)\n","import type {ListItemBuilder} from 'sanity/structure'\n\nimport {API_VERSION} from '../constants'\nimport {defineStructure} from './index'\n\nexport const productStructure = defineStructure<ListItemBuilder>((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 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"],"names":["SfccOfflineBanner","$","_c","t0","for","onlineFlagRaw","useFormValue","t1","onlineRaw","undefined","t2","Symbol","API_VERSION","CONFIG","product","message","backPath","category","createSfccDeleteAction","originalDeleteAction","props","originalResult","dialogOpen","setDialogOpen","useState","router","useRouter","toast","useToast","client","useClient","apiVersion","type","draft","published","config","tone","icon","TrashIcon","label","onHandle","dialog","onCancel","onConfirm","transaction","_id","delete","store","variants","Array","isArray","v","_ref","commit","navigateUrl","path","err","Error","push","status","title","SfccDocumentStatus","forwardRef","ref","isDeleted","imageUrl","imageVisible","setImageVisible","handleImageError","alignItems","borderRadius","display","height","justifyContent","overflow","width","replace","left","objectFit","position","top","t3","background","color","t4","sfccCategoryStoreField","defineField","readOnly","name","group","fields","to","sfccCategoryPreview","select","isActive","displayName","categoryId","parentDisplayName","parentName","parentId","prepare","displayTitle","value","parentLabel","subtitle","media","sfccProductStoreField","of","weak","VARIATION_ATTRIBUTE_MAP","storeKey","size","memorySize","tvSize","sfccProductPreview","id","productType","variationAttributes","productImage","selection","attrValues","meta","length","attr","mapped","Object","entries","join","categoryStructure","S","listItem","schemaType","child","documentTypeList","productStructure","context","getClient","documentList","filter","productId","fetch","variantRefs","map","list","items","documentListItem","divider","document","documentId","sfccRenderMembers","members","key","kind","component","SFCC_TYPES","Set","sfccPlugin","definePlugin","actions","prev","has","action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AA,SACZA,KAAKrB,OAAQyB,CAAAA,aAAa,CAACT,WAAWM,IAAIG,SAASC,UAAU,CAAC;AAAA,EAAA;AAG3E,EAAE;"}
|
|
1
|
+
{"version":3,"file":"index.js","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/index.ts"],"sourcesContent":["import {WarningOutlineIcon} from '@sanity/icons'\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'\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, ImageIcon} from '@sanity/icons'\nimport {forwardRef, useState} from 'react'\n\ntype Props = {\n isDeleted: boolean\n imageUrl: string\n title: string\n}\n\nconst SfccDocumentStatus = forwardRef<HTMLDivElement, Props>((props, ref) => {\n const {isDeleted, imageUrl, title} = 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 type {ListItemBuilder} from 'sanity/structure'\n\nimport {defineStructure} from './index'\n\nexport const categoryStructure = defineStructure<ListItemBuilder>((S) =>\n S.listItem().title('Categories').schemaType('category').child(S.documentTypeList('category')),\n)\n","import type {ListItemBuilder} from 'sanity/structure'\n\nimport {API_VERSION} from '../constants'\nimport {defineStructure} from './index'\n\nexport const productStructure = defineStructure<ListItemBuilder>((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 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"],"names":["SfccOfflineBanner","$","_c","t0","for","onlineFlagRaw","useFormValue","t1","onlineRaw","undefined","t2","Symbol","API_VERSION","CONFIG","product","message","backPath","category","createSfccDeleteAction","originalDeleteAction","props","originalResult","dialogOpen","setDialogOpen","useState","router","useRouter","toast","useToast","client","useClient","apiVersion","type","draft","published","config","tone","icon","TrashIcon","label","onHandle","dialog","onCancel","onConfirm","transaction","_id","delete","store","variants","Array","isArray","v","_ref","commit","navigateUrl","path","err","Error","push","status","title","SfccDocumentStatus","forwardRef","ref","isDeleted","imageUrl","imageVisible","setImageVisible","handleImageError","alignItems","borderRadius","display","height","justifyContent","overflow","width","replace","left","objectFit","position","top","t3","background","color","t4","sfccCategoryStoreField","defineField","readOnly","name","group","fields","to","sfccCategoryPreview","select","isActive","displayName","categoryId","parentDisplayName","parentName","parentId","prepare","displayTitle","value","parentLabel","subtitle","media","sfccProductStoreField","of","weak","VARIATION_ATTRIBUTE_MAP","storeKey","size","memorySize","tvSize","sfccProductPreview","id","productType","variationAttributes","productImage","selection","attrValues","meta","length","attr","mapped","Object","entries","join","categoryStructure","S","listItem","schemaType","child","documentTypeList","productStructure","context","getClient","documentList","filter","productId","fetch","variantRefs","map","list","items","documentListItem","divider","document","documentId","sfccRenderMembers","members","key","kind","component","SFCC_TYPES","Set","sfccPlugin","definePlugin","actions","prev","has","action","newDocumentOptions","template","templateId"],"mappings":";;;;;;;AAWO,SAAAA,oBAAA;AAAA,QAAAC,IAAAC,EAAA,CAAA;AAAA,MAAAC;AAAAF,IAAA,CAAA,6BAAAG,IAAA,2BAAA,KAC8BD,KAAA,CAAC,SAAS,YAAY,GAACF,OAAAE,MAAAA,KAAAF,EAAA,CAAA;AAA1D,QAAAI,gBAAsBC,aAAaH,EAAuB;AAAC,MAAAI;AAAAN,IAAA,CAAA,6BAAAG,IAAA,2BAAA,KAC5BG,KAAA,CAAC,SAAS,QAAQ,GAACN,OAAAM,MAAAA,KAAAN,EAAA,CAAA;AAAlD,QAAAO,YAAkBF,aAAaC,EAAmB;AAMlD,QAJmB,OAAOF,iBAAkB,YAAzBA,gBAAAI,YACJ,OAAOD,aAAc,YAArBA,YAAAC,aAGE;AAAK,WAAS;AAAI,MAAAC;AAAA,SAAAT,EAAA,CAAA,MAAAU,uBAAAP,IAAA,2BAAA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AAmB9B,GAAGpD,GAAG,EAAEoE,WAAW,SAAS,CAAC,CAAC,CAChF;AAAA,IACL;AAEA,WAAOF,EAAEkB,WAAWC,WAAWT,SAAS,EAAER,WAAW,SAAS;AAAA,EAChE,CAAC,CACL;AACJ;ACdO,MAAMkB,oBAAqBC,aAAiE,CACjG;AAAA,EACEC,KAAK;AAAA,EACLC,MAAM;AAAA,EACNC,WAAWzJ;AACb,GACA,GAAGsJ,OAAO,GAGNI,aAAa,oBAAIC,IAAI,CAAC,WAAW,UAAU,CAAC,GAWrCC,aAAaC,aAAa,OAAO;AAAA,EAC5CrE,MAAM;AAAA,EACN2D,UAAU;AAAA,IACRW,SAASA,CAACC,MAAMxB,YACVmB,WAAWM,IAAIzB,QAAQJ,UAAU,IAC5B4B,KACJrB,OAAQuB,CAAAA,WAAWA,OAAOA,WAAW,WAAW,EAChDnB,IAAKmB,CAAAA,WAAYA,OAAOA,WAAW,WAAW/I,uBAAuB+I,MAAM,IAAIA,MAAO,IAEpFF;AAAAA,IAETG,oBAAqBH,CAAAA,SACZA,KAAKrB,OAAQyB,CAAAA,aAAa,CAACT,WAAWM,IAAIG,SAASC,UAAU,CAAC;AAAA,EAAA;AAG3E,EAAE;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/sfcc",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Sanity plugin for Salesforce Commerce Cloud (SFCC) integration — synced product and category data with editorial enrichment.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"salesforce-commerce-cloud",
|
|
@@ -30,18 +30,19 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@sanity/icons": "^3.7.4",
|
|
33
|
-
"@sanity/ui": "^3.
|
|
33
|
+
"@sanity/ui": "^3.2.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@sanity/pkg-utils": "^10.4.
|
|
36
|
+
"@sanity/pkg-utils": "^10.4.18",
|
|
37
|
+
"@types/node": "^24.12.4",
|
|
37
38
|
"@types/react": "^19.2.14",
|
|
38
39
|
"@types/react-dom": "^19.2.3",
|
|
39
40
|
"babel-plugin-react-compiler": "^1.0.0",
|
|
40
41
|
"babel-plugin-styled-components": "^2.1.4",
|
|
41
|
-
"react": "^19.2.
|
|
42
|
-
"react-dom": "^19.2.
|
|
43
|
-
"sanity": "^5.
|
|
44
|
-
"styled-components": "^6.
|
|
42
|
+
"react": "^19.2.5",
|
|
43
|
+
"react-dom": "^19.2.5",
|
|
44
|
+
"sanity": "^5.21.0",
|
|
45
|
+
"styled-components": "^6.4.1",
|
|
45
46
|
"@repo/package.config": "0.0.0",
|
|
46
47
|
"@repo/tsconfig": "0.0.0"
|
|
47
48
|
},
|