@sanity/sfcc 0.0.1 → 1.0.0
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/LICENSE +21 -0
- package/README.md +165 -43
- package/dist/index.d.ts +152 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +494 -0
- package/dist/index.js.map +1 -0
- package/package.json +57 -7
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sanity.io
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,45 +1,167 @@
|
|
|
1
1
|
# @sanity/sfcc
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
3
|
+
Sanity plugin for Salesforce Commerce Cloud (SFCC) integration. Provides schema building blocks, desk structure, document actions, and UI components for managing SFCC-synced product and category data alongside editorial content in Sanity Studio.
|
|
4
|
+
|
|
5
|
+
## What it does
|
|
6
|
+
|
|
7
|
+
Documents in SFCC (products and categories) are synced into Sanity by our SFCC Cartridge. This plugin provides the Studio-side tooling to work with that synced data:
|
|
8
|
+
|
|
9
|
+
- **Schema fields** (`sfccProductStoreField`, `sfccCategoryStoreField`) -- read-only `store` objects containing all synced SFCC data, including localized fields powered by `sanity-plugin-internationalized-array`.
|
|
10
|
+
- **Preview configs** (`sfccProductPreview`, `sfccCategoryPreview`) -- rich document list previews showing product images, variation attributes, and category hierarchy.
|
|
11
|
+
- **Structure builders** (`productStructure`, `categoryStructure`) -- desk structure items that group Master/Simple products with their variants and list categories.
|
|
12
|
+
- **Document actions** -- replaces the built-in delete action with one that also removes associated product variants in a single transaction, and hides the duplicate action (documents are managed by the sync process).
|
|
13
|
+
- **Offline banner** (`sfccRenderMembers`) -- a caution banner displayed at the top of the document form when a product or category is offline in SFCC.
|
|
14
|
+
|
|
15
|
+
## Prerequisites
|
|
16
|
+
|
|
17
|
+
This plugin requires [`sanity-plugin-internationalized-array`](https://github.com/sanity-io/plugins/tree/main/plugins/sanity-plugin-internationalized-array) to be installed and configured in your Studio. The SFCC store fields use `internationalizedArrayString` and `internationalizedArrayText` types for localized product and category data.
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install @sanity/sfcc sanity-plugin-internationalized-array
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Setup
|
|
26
|
+
|
|
27
|
+
### 1. Configure plugins
|
|
28
|
+
|
|
29
|
+
Add both `sfccPlugin()` and `internationalizedArray()` to your Sanity config. The internationalized array plugin must include at least the `string` and `text` field types and the languages your SFCC instance supports:
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
import {sfccPlugin} from '@sanity/sfcc'
|
|
33
|
+
import {defineConfig} from 'sanity'
|
|
34
|
+
import {internationalizedArray} from 'sanity-plugin-internationalized-array'
|
|
35
|
+
import {structureTool} from 'sanity/structure'
|
|
36
|
+
|
|
37
|
+
export default defineConfig({
|
|
38
|
+
// ...
|
|
39
|
+
plugins: [
|
|
40
|
+
structureTool({structure}), // see step 3
|
|
41
|
+
sfccPlugin(),
|
|
42
|
+
internationalizedArray({
|
|
43
|
+
languages: [
|
|
44
|
+
{id: 'en_US', title: 'English'},
|
|
45
|
+
{id: 'fr', title: 'French'},
|
|
46
|
+
],
|
|
47
|
+
defaultLanguages: ['en_US'],
|
|
48
|
+
fieldTypes: ['string', 'text'],
|
|
49
|
+
}),
|
|
50
|
+
],
|
|
51
|
+
schema: {
|
|
52
|
+
types: [productType, categoryType], // see step 2
|
|
53
|
+
},
|
|
54
|
+
})
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### 2. Define document types
|
|
58
|
+
|
|
59
|
+
Create your `product` and `category` document types using the exported schema building blocks. Add the `sfcc` group, include the store field, attach the preview config, and wire up the offline banner:
|
|
60
|
+
|
|
61
|
+
```ts
|
|
62
|
+
import {PackageIcon, TagIcon} from '@sanity/icons'
|
|
63
|
+
import {
|
|
64
|
+
sfccCategoryPreview,
|
|
65
|
+
sfccCategoryStoreField,
|
|
66
|
+
sfccProductPreview,
|
|
67
|
+
sfccProductStoreField,
|
|
68
|
+
sfccRenderMembers,
|
|
69
|
+
} from '@sanity/sfcc'
|
|
70
|
+
import {defineField, defineType} from 'sanity'
|
|
71
|
+
|
|
72
|
+
const productType = defineType({
|
|
73
|
+
name: 'product',
|
|
74
|
+
title: 'Product',
|
|
75
|
+
type: 'document',
|
|
76
|
+
icon: TagIcon,
|
|
77
|
+
groups: [
|
|
78
|
+
{name: 'editorial', title: 'Editorial', default: true},
|
|
79
|
+
{name: 'sfcc', title: 'Salesforce'},
|
|
80
|
+
],
|
|
81
|
+
renderMembers: sfccRenderMembers,
|
|
82
|
+
fields: [
|
|
83
|
+
// Add your own editorial fields here
|
|
84
|
+
defineField({
|
|
85
|
+
name: 'promotionalContent',
|
|
86
|
+
title: 'Promotional Content',
|
|
87
|
+
type: 'array',
|
|
88
|
+
of: [{type: 'block'}],
|
|
89
|
+
group: 'editorial',
|
|
90
|
+
}),
|
|
91
|
+
// Synced SFCC data (read-only)
|
|
92
|
+
sfccProductStoreField,
|
|
93
|
+
],
|
|
94
|
+
preview: sfccProductPreview,
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
const categoryType = defineType({
|
|
98
|
+
name: 'category',
|
|
99
|
+
title: 'Category',
|
|
100
|
+
type: 'document',
|
|
101
|
+
icon: PackageIcon,
|
|
102
|
+
groups: [
|
|
103
|
+
{name: 'editorial', title: 'Editorial', default: true},
|
|
104
|
+
{name: 'sfcc', title: 'Salesforce'},
|
|
105
|
+
],
|
|
106
|
+
renderMembers: sfccRenderMembers,
|
|
107
|
+
fields: [
|
|
108
|
+
defineField({
|
|
109
|
+
name: 'name',
|
|
110
|
+
title: 'Name',
|
|
111
|
+
type: 'string',
|
|
112
|
+
group: 'editorial',
|
|
113
|
+
}),
|
|
114
|
+
sfccCategoryStoreField,
|
|
115
|
+
],
|
|
116
|
+
preview: sfccCategoryPreview,
|
|
117
|
+
})
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### 3. Set up desk structure
|
|
121
|
+
|
|
122
|
+
Use the exported structure builders to create a custom desk structure with product/category grouping:
|
|
123
|
+
|
|
124
|
+
```ts
|
|
125
|
+
import {categoryStructure, productStructure} from '@sanity/sfcc'
|
|
126
|
+
import {type StructureResolver} from 'sanity/structure'
|
|
127
|
+
|
|
128
|
+
const structure: StructureResolver = (S, context) =>
|
|
129
|
+
S.list()
|
|
130
|
+
.title('Content')
|
|
131
|
+
.items([
|
|
132
|
+
categoryStructure(S, context),
|
|
133
|
+
productStructure(S, context),
|
|
134
|
+
S.divider(),
|
|
135
|
+
...S.documentTypeListItems().filter((item) => {
|
|
136
|
+
const id = item.getId()
|
|
137
|
+
return id ? !['category', 'product'].includes(id) : false
|
|
138
|
+
}),
|
|
139
|
+
])
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## Exports
|
|
143
|
+
|
|
144
|
+
| Export | Type | Description |
|
|
145
|
+
| ------------------------ | ----------------- | ------------------------------------------------------------------------------------ |
|
|
146
|
+
| `sfccPlugin` | Plugin | Registers document action overrides and hides SFCC types from the "Create new" menu. |
|
|
147
|
+
| `sfccProductStoreField` | Field definition | Read-only `store` object field for the `product` document type. |
|
|
148
|
+
| `sfccCategoryStoreField` | Field definition | Read-only `store` object field for the `category` document type. |
|
|
149
|
+
| `sfccProductPreview` | Preview config | `select` + `prepare` for product document list previews. |
|
|
150
|
+
| `sfccCategoryPreview` | Preview config | `select` + `prepare` for category document list previews. |
|
|
151
|
+
| `productStructure` | Structure builder | Desk structure list item for products (Master/Simple with nested variants). |
|
|
152
|
+
| `categoryStructure` | Structure builder | Desk structure list item for categories. |
|
|
153
|
+
| `sfccRenderMembers` | Callback | `renderMembers` callback that injects an offline/deleted caution banner. |
|
|
154
|
+
| `SfccDocumentStatus` | Component | Preview media component showing product/category thumbnail with a deleted overlay. |
|
|
155
|
+
| `SfccOfflineBanner` | Component | Caution banner displayed when `store.onlineFlag` or `store.online` is `false`. |
|
|
156
|
+
|
|
157
|
+
## How the plugin modifies document behaviour
|
|
158
|
+
|
|
159
|
+
For documents with `_type` of `product` or `category`:
|
|
160
|
+
|
|
161
|
+
- The **duplicate** action is removed (documents are created by the SFCC sync process).
|
|
162
|
+
- The **delete** action is replaced with a custom version that, for products, also deletes all associated variants (`store.variants[]._ref`) in a single transaction.
|
|
163
|
+
- The document types are hidden from the **"Create new document"** menu - as the source of truth for these are the documents created by the SFCC sync.
|
|
164
|
+
|
|
165
|
+
## License
|
|
166
|
+
|
|
167
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import * as sanity from "sanity";
|
|
2
|
+
import { DecorationMember, ObjectMember } from "sanity";
|
|
3
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
import * as sanity_structure0 from "sanity/structure";
|
|
5
|
+
import { ListItemBuilder } from "sanity/structure";
|
|
6
|
+
import * as react from "react";
|
|
7
|
+
/**
|
|
8
|
+
* SFCC category store field — contains all read-only data synced from
|
|
9
|
+
* Salesforce Commerce Cloud. Add this to a `category` document type's
|
|
10
|
+
* `fields` array alongside your own custom fields.
|
|
11
|
+
*
|
|
12
|
+
* The field is placed in the `sfcc` group; make sure the document type
|
|
13
|
+
* declares that group.
|
|
14
|
+
*/
|
|
15
|
+
declare const sfccCategoryStoreField: {
|
|
16
|
+
type: "object";
|
|
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;
|
|
21
|
+
/**
|
|
22
|
+
* Default preview configuration for the `category` document type.
|
|
23
|
+
* Shows Category Name with parent category as subtitle.
|
|
24
|
+
*/
|
|
25
|
+
declare const sfccCategoryPreview: {
|
|
26
|
+
select: {
|
|
27
|
+
imageUrl: string;
|
|
28
|
+
isActive: string;
|
|
29
|
+
displayName: string;
|
|
30
|
+
title: string;
|
|
31
|
+
name: string;
|
|
32
|
+
categoryId: string;
|
|
33
|
+
parentDisplayName: string;
|
|
34
|
+
parentName: string;
|
|
35
|
+
parentId: string;
|
|
36
|
+
};
|
|
37
|
+
prepare({
|
|
38
|
+
imageUrl,
|
|
39
|
+
displayName,
|
|
40
|
+
title,
|
|
41
|
+
name,
|
|
42
|
+
categoryId,
|
|
43
|
+
parentDisplayName,
|
|
44
|
+
parentName,
|
|
45
|
+
parentId,
|
|
46
|
+
isActive
|
|
47
|
+
}: {
|
|
48
|
+
imageUrl?: string;
|
|
49
|
+
displayName?: {
|
|
50
|
+
value: string;
|
|
51
|
+
}[];
|
|
52
|
+
title?: string;
|
|
53
|
+
name?: string;
|
|
54
|
+
categoryId?: string;
|
|
55
|
+
parentDisplayName?: {
|
|
56
|
+
value: string;
|
|
57
|
+
}[];
|
|
58
|
+
parentName?: string;
|
|
59
|
+
parentId?: string;
|
|
60
|
+
isActive?: boolean;
|
|
61
|
+
}): {
|
|
62
|
+
title: string;
|
|
63
|
+
subtitle: string;
|
|
64
|
+
media: react_jsx_runtime0.JSX.Element;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* SFCC product store field — contains all read-only data synced from
|
|
69
|
+
* Salesforce Commerce Cloud. Add this to a `product` document type's
|
|
70
|
+
* `fields` array alongside your own custom fields.
|
|
71
|
+
*
|
|
72
|
+
* The field is placed in the `sfcc` group; make sure the document type
|
|
73
|
+
* declares that group.
|
|
74
|
+
*/
|
|
75
|
+
declare const sfccProductStoreField: {
|
|
76
|
+
type: "object";
|
|
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;
|
|
81
|
+
/**
|
|
82
|
+
* Default preview configuration for the `product` document type.
|
|
83
|
+
* Shows product type for Master/Simple, and the relevant variation
|
|
84
|
+
* attributes (driven by `store.variationAttributes`) for all products.
|
|
85
|
+
*/
|
|
86
|
+
declare const sfccProductPreview: {
|
|
87
|
+
select: {
|
|
88
|
+
name: string;
|
|
89
|
+
id: string;
|
|
90
|
+
productType: string;
|
|
91
|
+
variationAttributes: string;
|
|
92
|
+
color: string;
|
|
93
|
+
size: string;
|
|
94
|
+
memorySize: string;
|
|
95
|
+
tvSize: string;
|
|
96
|
+
productImage: string;
|
|
97
|
+
isActive: string;
|
|
98
|
+
};
|
|
99
|
+
prepare(selection: {
|
|
100
|
+
name?: {
|
|
101
|
+
value: string;
|
|
102
|
+
}[];
|
|
103
|
+
id?: string;
|
|
104
|
+
productType?: string;
|
|
105
|
+
variationAttributes?: string[];
|
|
106
|
+
color?: string;
|
|
107
|
+
size?: string;
|
|
108
|
+
memorySize?: string;
|
|
109
|
+
tvSize?: string;
|
|
110
|
+
productImage?: string;
|
|
111
|
+
isActive?: boolean;
|
|
112
|
+
}): {
|
|
113
|
+
title: string;
|
|
114
|
+
subtitle: string;
|
|
115
|
+
media: react_jsx_runtime0.JSX.Element;
|
|
116
|
+
};
|
|
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;
|
|
120
|
+
type Props = {
|
|
121
|
+
isDeleted: boolean;
|
|
122
|
+
imageUrl: string;
|
|
123
|
+
title: string;
|
|
124
|
+
};
|
|
125
|
+
declare const SfccDocumentStatus: react.ForwardRefExoticComponent<Props & react.RefAttributes<HTMLDivElement>>;
|
|
126
|
+
/**
|
|
127
|
+
* Decorative banner injected via `renderMembers` that warns editors when a
|
|
128
|
+
* product or category is offline in SFCC.
|
|
129
|
+
*
|
|
130
|
+
* Reads `store.onlineFlag` (products) and `store.online` (categories) via
|
|
131
|
+
* `useFormValue` so it works without props.
|
|
132
|
+
*/
|
|
133
|
+
declare function SfccOfflineBanner(): react_jsx_runtime0.JSX.Element | null;
|
|
134
|
+
/**
|
|
135
|
+
* `renderMembers` callback that injects a caution banner at the top of the
|
|
136
|
+
* document form when the SFCC document is offline or deleted.
|
|
137
|
+
*
|
|
138
|
+
* Usage: add `renderMembers: sfccRenderMembers` to your `defineType` call.
|
|
139
|
+
*/
|
|
140
|
+
declare const sfccRenderMembers: (members: ObjectMember[]) => (ObjectMember | DecorationMember)[];
|
|
141
|
+
/**
|
|
142
|
+
* SFCC plugin — enforces document-level guardrails for synced commerce data:
|
|
143
|
+
*
|
|
144
|
+
* - Replaces the built-in `delete` action with a custom one that also cleans
|
|
145
|
+
* up associated product variants when deleting a product.
|
|
146
|
+
* - Removes the `duplicate` action (documents are managed by SFCC sync).
|
|
147
|
+
* - Hides product / category from the "Create new document" menu
|
|
148
|
+
* (new documents are only created by the sync process).
|
|
149
|
+
*/
|
|
150
|
+
declare const sfccPlugin: sanity.Plugin<void>;
|
|
151
|
+
export { SfccDocumentStatus, SfccOfflineBanner, categoryStructure, productStructure, sfccCategoryPreview, sfccCategoryStoreField, sfccPlugin, sfccProductPreview, sfccProductStoreField, sfccRenderMembers };
|
|
152
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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,MAAA,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,MAAA,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,kBAAA,CAAA,GAAA,CAAA,OAAA;EAAA;AAAA;AAAA,cC5MY,iBAAA,GAAiB,CAAA,EAE7B,iBAAA,CAF6B,gBAAA,EAAA,OAAA,EAAA,MAAA,CAAA,aAAA,KAAA,eAAA;AAAA,cCCjB,gBAAA,GAAgB,CAAA,EA+B3B,iBAAA,CA/B2B,gBAAA,EAAA,OAAA,EAAA,MAAA,CAAA,aAAA,KAAA,eAAA;AAAA,KCFxB,KAAA;EACH,SAAA;EACA,QAAA;EACA,KAAA;AAAA;AAAA,cAGI,kBAAA,EAAkB,KAAA,CAAA,yBAAA,CAAA,KAAA,GAAA,KAAA,CAAA,aAAA,CAAA,cAAA;;;;;;;;iBCER,iBAAA,CAAA,GAAiB,kBAAA,CAAA,GAAA,CAAA,OAAA;;ALCjC;;;;;cMUa,iBAAA,GAAqB,OAAA,EAAS,YAAA,QAAkB,YAAA,GAAe,gBAAA;;;;;;;;;;cAoB/D,UAAA,EAeV,MAAA,CAfoB,MAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,494 @@
|
|
|
1
|
+
import { useFormValue, useClient, defineField, definePlugin } from "sanity";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
4
|
+
import { WarningOutlineIcon, TrashIcon, ImageIcon, CloseIcon } from "@sanity/icons";
|
|
5
|
+
import { Card, Flex, Text, useToast, Stack } from "@sanity/ui";
|
|
6
|
+
import { useState, forwardRef } from "react";
|
|
7
|
+
import { useRouter } from "sanity/router";
|
|
8
|
+
function SfccOfflineBanner() {
|
|
9
|
+
const $ = c(3);
|
|
10
|
+
let t0;
|
|
11
|
+
$[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t0 = ["store", "onlineFlag"], $[0] = t0) : t0 = $[0];
|
|
12
|
+
const onlineFlagRaw = useFormValue(t0);
|
|
13
|
+
let t1;
|
|
14
|
+
$[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t1 = ["store", "online"], $[1] = t1) : t1 = $[1];
|
|
15
|
+
const onlineRaw = useFormValue(t1);
|
|
16
|
+
if (((typeof onlineFlagRaw == "boolean" ? onlineFlagRaw : void 0) ?? (typeof onlineRaw == "boolean" ? onlineRaw : void 0)) !== !1)
|
|
17
|
+
return null;
|
|
18
|
+
let t2;
|
|
19
|
+
return $[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t2 = /* @__PURE__ */ jsx(Card, { padding: 4, radius: 2, shadow: 1, tone: "caution", children: /* @__PURE__ */ jsxs(Flex, { align: "center", gap: 3, children: [
|
|
20
|
+
/* @__PURE__ */ jsx(Text, { size: 2, children: /* @__PURE__ */ jsx(WarningOutlineIcon, {}) }),
|
|
21
|
+
/* @__PURE__ */ jsx(Text, { size: 1, weight: "medium", children: "This document is currently offline in SFCC." })
|
|
22
|
+
] }) }), $[2] = t2) : t2 = $[2], t2;
|
|
23
|
+
}
|
|
24
|
+
const API_VERSION = "2026-02-24", CONFIG = {
|
|
25
|
+
product: {
|
|
26
|
+
message: "Delete the current product and all associated variants in your dataset?",
|
|
27
|
+
backPath: "/structure/products"
|
|
28
|
+
},
|
|
29
|
+
category: {
|
|
30
|
+
message: "Delete the current category from your dataset?",
|
|
31
|
+
backPath: "/structure/categories"
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
function createSfccDeleteAction(originalDeleteAction) {
|
|
35
|
+
return function(props) {
|
|
36
|
+
const originalResult = originalDeleteAction(props), [dialogOpen, setDialogOpen] = useState(!1), router = useRouter(), toast = useToast(), client = useClient({
|
|
37
|
+
apiVersion: API_VERSION
|
|
38
|
+
}), {
|
|
39
|
+
type,
|
|
40
|
+
draft,
|
|
41
|
+
published
|
|
42
|
+
} = props, config = CONFIG[type];
|
|
43
|
+
return config ? {
|
|
44
|
+
...originalResult,
|
|
45
|
+
tone: "critical",
|
|
46
|
+
icon: TrashIcon,
|
|
47
|
+
label: "Delete",
|
|
48
|
+
onHandle: () => setDialogOpen(!0),
|
|
49
|
+
dialog: dialogOpen && {
|
|
50
|
+
type: "confirm",
|
|
51
|
+
message: /* @__PURE__ */ jsxs(Stack, { space: 4, children: [
|
|
52
|
+
/* @__PURE__ */ jsx(Text, { size: 1, children: config.message }),
|
|
53
|
+
/* @__PURE__ */ jsx(Text, { size: 1, weight: "medium", children: "No data on SFCC will be deleted." })
|
|
54
|
+
] }),
|
|
55
|
+
onCancel: () => setDialogOpen(!1),
|
|
56
|
+
onConfirm: async () => {
|
|
57
|
+
const transaction = client.transaction();
|
|
58
|
+
if (published?._id && transaction.delete(published._id), draft?._id && transaction.delete(draft._id), type === "product" && published) {
|
|
59
|
+
const store = published.store, variants = store != null && typeof store == "object" && "variants" in store && Array.isArray(store.variants) ? store.variants : [];
|
|
60
|
+
for (const v of variants)
|
|
61
|
+
v != null && typeof v == "object" && "_ref" in v && typeof v._ref == "string" && (transaction.delete(v._ref), transaction.delete(`drafts.${v._ref}`));
|
|
62
|
+
}
|
|
63
|
+
try {
|
|
64
|
+
await transaction.commit(), router.navigateUrl({
|
|
65
|
+
path: config.backPath
|
|
66
|
+
});
|
|
67
|
+
} catch (err) {
|
|
68
|
+
const message = err instanceof Error ? err.message : "Unknown Error";
|
|
69
|
+
toast.push({
|
|
70
|
+
status: "error",
|
|
71
|
+
title: message
|
|
72
|
+
});
|
|
73
|
+
} finally {
|
|
74
|
+
setDialogOpen(!1);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
} : originalResult;
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
const SfccDocumentStatus = forwardRef((props, ref) => {
|
|
82
|
+
const $ = c(12), {
|
|
83
|
+
isDeleted,
|
|
84
|
+
imageUrl,
|
|
85
|
+
title
|
|
86
|
+
} = props, [imageVisible, setImageVisible] = useState(!0);
|
|
87
|
+
let t0;
|
|
88
|
+
$[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t0 = () => setImageVisible(!1), $[0] = t0) : t0 = $[0];
|
|
89
|
+
const handleImageError = t0;
|
|
90
|
+
let t1;
|
|
91
|
+
$[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t1 = {
|
|
92
|
+
alignItems: "center",
|
|
93
|
+
borderRadius: "inherit",
|
|
94
|
+
display: "flex",
|
|
95
|
+
height: "100%",
|
|
96
|
+
justifyContent: "center",
|
|
97
|
+
overflow: "hidden",
|
|
98
|
+
width: "100%"
|
|
99
|
+
}, $[1] = t1) : t1 = $[1];
|
|
100
|
+
let t2;
|
|
101
|
+
$[2] !== imageUrl || $[3] !== imageVisible || $[4] !== title ? (t2 = imageVisible && imageUrl ? /* @__PURE__ */ jsx("img", { onError: handleImageError, src: imageUrl.replace("/large/", "/small/"), style: {
|
|
102
|
+
height: "100%",
|
|
103
|
+
left: 0,
|
|
104
|
+
objectFit: "contain",
|
|
105
|
+
position: "absolute",
|
|
106
|
+
top: 0,
|
|
107
|
+
width: "100%"
|
|
108
|
+
}, alt: `${title} preview` }) : /* @__PURE__ */ jsx(ImageIcon, { style: {
|
|
109
|
+
position: "absolute"
|
|
110
|
+
} }), $[2] = imageUrl, $[3] = imageVisible, $[4] = title, $[5] = t2) : t2 = $[5];
|
|
111
|
+
let t3;
|
|
112
|
+
$[6] !== isDeleted ? (t3 = isDeleted && /* @__PURE__ */ jsx(CloseIcon, { style: {
|
|
113
|
+
background: "rgba(255, 0, 0, 0.7)",
|
|
114
|
+
color: "rgba(255, 255, 255, 0.85)",
|
|
115
|
+
height: "100%",
|
|
116
|
+
position: "relative",
|
|
117
|
+
width: "100%"
|
|
118
|
+
} }), $[6] = isDeleted, $[7] = t3) : t3 = $[7];
|
|
119
|
+
let t4;
|
|
120
|
+
return $[8] !== ref || $[9] !== t2 || $[10] !== t3 ? (t4 = /* @__PURE__ */ jsxs("div", { ref, style: t1, children: [
|
|
121
|
+
t2,
|
|
122
|
+
t3
|
|
123
|
+
] }), $[8] = ref, $[9] = t2, $[10] = t3, $[11] = t4) : t4 = $[11], t4;
|
|
124
|
+
}), sfccCategoryStoreField = defineField({
|
|
125
|
+
readOnly: !0,
|
|
126
|
+
name: "store",
|
|
127
|
+
title: "SFCC Data",
|
|
128
|
+
type: "object",
|
|
129
|
+
group: "sfcc",
|
|
130
|
+
fields: [defineField({
|
|
131
|
+
name: "categoryId",
|
|
132
|
+
title: "Category ID",
|
|
133
|
+
type: "string",
|
|
134
|
+
readOnly: !0
|
|
135
|
+
}), defineField({
|
|
136
|
+
name: "thumbnailImage",
|
|
137
|
+
title: "Thumbnail Image",
|
|
138
|
+
type: "string",
|
|
139
|
+
readOnly: !0
|
|
140
|
+
}), defineField({
|
|
141
|
+
name: "online",
|
|
142
|
+
title: "Online",
|
|
143
|
+
type: "boolean",
|
|
144
|
+
readOnly: !0
|
|
145
|
+
}), defineField({
|
|
146
|
+
name: "onlineFrom",
|
|
147
|
+
title: "Online From",
|
|
148
|
+
type: "date",
|
|
149
|
+
readOnly: !0
|
|
150
|
+
}), defineField({
|
|
151
|
+
name: "onlineTo",
|
|
152
|
+
title: "Online To",
|
|
153
|
+
type: "date",
|
|
154
|
+
readOnly: !0
|
|
155
|
+
}), defineField({
|
|
156
|
+
name: "creationDate",
|
|
157
|
+
title: "Creation Date",
|
|
158
|
+
type: "date",
|
|
159
|
+
readOnly: !0
|
|
160
|
+
}), defineField({
|
|
161
|
+
name: "isDeleted",
|
|
162
|
+
title: "Is Deleted",
|
|
163
|
+
type: "boolean",
|
|
164
|
+
readOnly: !0
|
|
165
|
+
}), defineField({
|
|
166
|
+
name: "parentCategory",
|
|
167
|
+
type: "reference",
|
|
168
|
+
to: [{
|
|
169
|
+
type: "category"
|
|
170
|
+
}],
|
|
171
|
+
readOnly: !0
|
|
172
|
+
}), defineField({
|
|
173
|
+
name: "displayName",
|
|
174
|
+
title: "Display Name",
|
|
175
|
+
type: "internationalizedArrayString",
|
|
176
|
+
readOnly: !0
|
|
177
|
+
}), defineField({
|
|
178
|
+
name: "description",
|
|
179
|
+
title: "Description",
|
|
180
|
+
type: "internationalizedArrayText",
|
|
181
|
+
readOnly: !0
|
|
182
|
+
})]
|
|
183
|
+
}), sfccCategoryPreview = {
|
|
184
|
+
select: {
|
|
185
|
+
imageUrl: "store.thumbnailImage",
|
|
186
|
+
isActive: "store.online",
|
|
187
|
+
displayName: "store.displayName",
|
|
188
|
+
title: "title",
|
|
189
|
+
name: "name",
|
|
190
|
+
categoryId: "store.categoryId",
|
|
191
|
+
parentDisplayName: "store.parentCategory.store.displayName",
|
|
192
|
+
parentName: "store.parentCategory.name",
|
|
193
|
+
parentId: "store.parentCategory.store.categoryId"
|
|
194
|
+
},
|
|
195
|
+
prepare({
|
|
196
|
+
imageUrl,
|
|
197
|
+
displayName,
|
|
198
|
+
title,
|
|
199
|
+
name,
|
|
200
|
+
categoryId,
|
|
201
|
+
parentDisplayName,
|
|
202
|
+
parentName,
|
|
203
|
+
parentId,
|
|
204
|
+
isActive
|
|
205
|
+
}) {
|
|
206
|
+
const displayTitle = title || name || displayName?.[0]?.value || categoryId || "Untitled Category", parentLabel = parentId !== "root" && (parentName || parentDisplayName?.[0]?.value || parentId);
|
|
207
|
+
return {
|
|
208
|
+
title: displayTitle,
|
|
209
|
+
subtitle: parentLabel ? `Parent: ${parentLabel}` : "",
|
|
210
|
+
media: /* @__PURE__ */ jsx(SfccDocumentStatus, { isDeleted: !isActive, imageUrl: imageUrl ?? "", title: displayTitle })
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
}, sfccProductStoreField = defineField({
|
|
214
|
+
readOnly: !0,
|
|
215
|
+
name: "store",
|
|
216
|
+
title: "SFCC Data",
|
|
217
|
+
type: "object",
|
|
218
|
+
group: "sfcc",
|
|
219
|
+
fields: [defineField({
|
|
220
|
+
name: "productId",
|
|
221
|
+
title: "Product ID",
|
|
222
|
+
type: "string",
|
|
223
|
+
readOnly: !0
|
|
224
|
+
}), defineField({
|
|
225
|
+
name: "brand",
|
|
226
|
+
title: "Brand",
|
|
227
|
+
type: "string",
|
|
228
|
+
readOnly: !0
|
|
229
|
+
}), defineField({
|
|
230
|
+
name: "color",
|
|
231
|
+
title: "Color",
|
|
232
|
+
type: "string",
|
|
233
|
+
readOnly: !0
|
|
234
|
+
}), defineField({
|
|
235
|
+
name: "size",
|
|
236
|
+
title: "Size",
|
|
237
|
+
type: "string",
|
|
238
|
+
readOnly: !0
|
|
239
|
+
}), defineField({
|
|
240
|
+
name: "width",
|
|
241
|
+
title: "Width",
|
|
242
|
+
type: "string",
|
|
243
|
+
readOnly: !0
|
|
244
|
+
}), defineField({
|
|
245
|
+
name: "productType",
|
|
246
|
+
title: "Product Type",
|
|
247
|
+
type: "string",
|
|
248
|
+
readOnly: !0
|
|
249
|
+
}), defineField({
|
|
250
|
+
name: "styleNumber",
|
|
251
|
+
title: "Style Number",
|
|
252
|
+
type: "string",
|
|
253
|
+
readOnly: !0
|
|
254
|
+
}), defineField({
|
|
255
|
+
name: "searchable",
|
|
256
|
+
title: "Searchable",
|
|
257
|
+
type: "boolean",
|
|
258
|
+
readOnly: !0
|
|
259
|
+
}), defineField({
|
|
260
|
+
name: "isSale",
|
|
261
|
+
title: "On Sale?",
|
|
262
|
+
type: "boolean",
|
|
263
|
+
readOnly: !0
|
|
264
|
+
}), defineField({
|
|
265
|
+
name: "isNew",
|
|
266
|
+
title: "New Arrival?",
|
|
267
|
+
type: "boolean",
|
|
268
|
+
readOnly: !0
|
|
269
|
+
}), defineField({
|
|
270
|
+
name: "manufacturerName",
|
|
271
|
+
title: "Manufacturer",
|
|
272
|
+
type: "string",
|
|
273
|
+
readOnly: !0
|
|
274
|
+
}), defineField({
|
|
275
|
+
name: "manufacturerSKU",
|
|
276
|
+
title: "Manufacturer Product ID",
|
|
277
|
+
type: "string",
|
|
278
|
+
readOnly: !0
|
|
279
|
+
}), defineField({
|
|
280
|
+
name: "creationDate",
|
|
281
|
+
title: "Creation Date",
|
|
282
|
+
type: "datetime",
|
|
283
|
+
readOnly: !0
|
|
284
|
+
}), defineField({
|
|
285
|
+
name: "lastModified",
|
|
286
|
+
title: "Last Modified",
|
|
287
|
+
type: "datetime",
|
|
288
|
+
readOnly: !0
|
|
289
|
+
}), defineField({
|
|
290
|
+
name: "onlineFlag",
|
|
291
|
+
title: "Online",
|
|
292
|
+
type: "boolean",
|
|
293
|
+
readOnly: !0
|
|
294
|
+
}), defineField({
|
|
295
|
+
name: "onlineFrom",
|
|
296
|
+
title: "Online From",
|
|
297
|
+
type: "datetime",
|
|
298
|
+
readOnly: !0
|
|
299
|
+
}), defineField({
|
|
300
|
+
name: "onlineTo",
|
|
301
|
+
title: "Online To",
|
|
302
|
+
type: "datetime",
|
|
303
|
+
readOnly: !0
|
|
304
|
+
}), defineField({
|
|
305
|
+
name: "length",
|
|
306
|
+
title: "Length",
|
|
307
|
+
type: "string",
|
|
308
|
+
readOnly: !0
|
|
309
|
+
}), defineField({
|
|
310
|
+
name: "memorySize",
|
|
311
|
+
title: "Memory Size",
|
|
312
|
+
type: "string",
|
|
313
|
+
readOnly: !0
|
|
314
|
+
}), defineField({
|
|
315
|
+
name: "tvSize",
|
|
316
|
+
title: "TV Size",
|
|
317
|
+
type: "string",
|
|
318
|
+
readOnly: !0
|
|
319
|
+
}), defineField({
|
|
320
|
+
name: "tvType",
|
|
321
|
+
title: "TV Type",
|
|
322
|
+
type: "array",
|
|
323
|
+
of: [{
|
|
324
|
+
type: "string"
|
|
325
|
+
}],
|
|
326
|
+
readOnly: !0
|
|
327
|
+
}), defineField({
|
|
328
|
+
name: "productImage",
|
|
329
|
+
title: "Product Image",
|
|
330
|
+
type: "string",
|
|
331
|
+
readOnly: !0
|
|
332
|
+
}), defineField({
|
|
333
|
+
name: "refinementColor",
|
|
334
|
+
title: "Refinement Color",
|
|
335
|
+
type: "string",
|
|
336
|
+
readOnly: !0
|
|
337
|
+
}), defineField({
|
|
338
|
+
name: "variants",
|
|
339
|
+
title: "Variants",
|
|
340
|
+
type: "array",
|
|
341
|
+
of: [{
|
|
342
|
+
type: "reference",
|
|
343
|
+
to: [{
|
|
344
|
+
type: "product"
|
|
345
|
+
}],
|
|
346
|
+
weak: !0
|
|
347
|
+
}],
|
|
348
|
+
readOnly: !0
|
|
349
|
+
}), defineField({
|
|
350
|
+
name: "variationAttributes",
|
|
351
|
+
title: "Variation Attributes",
|
|
352
|
+
type: "array",
|
|
353
|
+
of: [{
|
|
354
|
+
type: "string"
|
|
355
|
+
}],
|
|
356
|
+
readOnly: !0
|
|
357
|
+
}), defineField({
|
|
358
|
+
name: "isDeleted",
|
|
359
|
+
title: "Is Deleted",
|
|
360
|
+
type: "boolean"
|
|
361
|
+
}), defineField({
|
|
362
|
+
name: "name",
|
|
363
|
+
title: "Name",
|
|
364
|
+
type: "internationalizedArrayString",
|
|
365
|
+
readOnly: !0
|
|
366
|
+
}), defineField({
|
|
367
|
+
name: "longDescription",
|
|
368
|
+
title: "Long Description",
|
|
369
|
+
type: "internationalizedArrayText",
|
|
370
|
+
readOnly: !0
|
|
371
|
+
}), defineField({
|
|
372
|
+
name: "shortDescription",
|
|
373
|
+
title: "Short Description",
|
|
374
|
+
type: "internationalizedArrayText",
|
|
375
|
+
readOnly: !0
|
|
376
|
+
}), defineField({
|
|
377
|
+
name: "pageTitle",
|
|
378
|
+
title: "Page Title",
|
|
379
|
+
type: "internationalizedArrayString",
|
|
380
|
+
readOnly: !0
|
|
381
|
+
}), defineField({
|
|
382
|
+
name: "pageDescription",
|
|
383
|
+
title: "Page Description",
|
|
384
|
+
type: "internationalizedArrayString",
|
|
385
|
+
readOnly: !0
|
|
386
|
+
}), defineField({
|
|
387
|
+
name: "pageKeywords",
|
|
388
|
+
title: "Page Keywords",
|
|
389
|
+
type: "internationalizedArrayString",
|
|
390
|
+
readOnly: !0
|
|
391
|
+
}), defineField({
|
|
392
|
+
name: "pageURL",
|
|
393
|
+
title: "Page URL",
|
|
394
|
+
type: "internationalizedArrayString",
|
|
395
|
+
readOnly: !0
|
|
396
|
+
})]
|
|
397
|
+
}), VARIATION_ATTRIBUTE_MAP = {
|
|
398
|
+
color: {
|
|
399
|
+
label: "Color",
|
|
400
|
+
storeKey: "color"
|
|
401
|
+
},
|
|
402
|
+
size: {
|
|
403
|
+
label: "Size",
|
|
404
|
+
storeKey: "size"
|
|
405
|
+
},
|
|
406
|
+
memorySize: {
|
|
407
|
+
label: "Memory Size",
|
|
408
|
+
storeKey: "memorySize"
|
|
409
|
+
},
|
|
410
|
+
tvSize: {
|
|
411
|
+
label: "TV Size",
|
|
412
|
+
storeKey: "tvSize"
|
|
413
|
+
}
|
|
414
|
+
}, sfccProductPreview = {
|
|
415
|
+
select: {
|
|
416
|
+
name: "store.name",
|
|
417
|
+
id: "store.productId",
|
|
418
|
+
productType: "store.productType",
|
|
419
|
+
variationAttributes: "store.variationAttributes",
|
|
420
|
+
color: "store.color",
|
|
421
|
+
size: "store.size",
|
|
422
|
+
memorySize: "store.memorySize",
|
|
423
|
+
tvSize: "store.tvSize",
|
|
424
|
+
productImage: "store.productImage",
|
|
425
|
+
isActive: "store.onlineFlag"
|
|
426
|
+
},
|
|
427
|
+
prepare(selection) {
|
|
428
|
+
const {
|
|
429
|
+
name,
|
|
430
|
+
id,
|
|
431
|
+
productType,
|
|
432
|
+
variationAttributes,
|
|
433
|
+
productImage,
|
|
434
|
+
isActive,
|
|
435
|
+
...attrValues
|
|
436
|
+
} = selection, title = name?.[0]?.value || id || "Untitled Product", meta = [];
|
|
437
|
+
if (productType && productType !== "Variant" && meta.push(productType), variationAttributes?.length)
|
|
438
|
+
for (const attr of variationAttributes) {
|
|
439
|
+
const mapped = VARIATION_ATTRIBUTE_MAP[attr], value = mapped && attrValues[mapped.storeKey];
|
|
440
|
+
mapped && value && meta.push(`${mapped.label}: ${value}`);
|
|
441
|
+
}
|
|
442
|
+
else
|
|
443
|
+
for (const [, {
|
|
444
|
+
label,
|
|
445
|
+
storeKey
|
|
446
|
+
}] of Object.entries(VARIATION_ATTRIBUTE_MAP)) {
|
|
447
|
+
const value = attrValues[storeKey];
|
|
448
|
+
value && meta.push(`${label}: ${value}`);
|
|
449
|
+
}
|
|
450
|
+
return {
|
|
451
|
+
title,
|
|
452
|
+
subtitle: meta.join(" | "),
|
|
453
|
+
media: /* @__PURE__ */ jsx(SfccDocumentStatus, { isDeleted: !isActive, imageUrl: productImage ?? "", title })
|
|
454
|
+
};
|
|
455
|
+
}
|
|
456
|
+
}, categoryStructure = (S) => S.listItem().title("Categories").schemaType("category").child(S.documentTypeList("category")), productStructure = (S, context) => {
|
|
457
|
+
const client = context.getClient({
|
|
458
|
+
apiVersion: API_VERSION
|
|
459
|
+
});
|
|
460
|
+
return S.listItem().title("Products").schemaType("product").child(S.documentList().title("Products").schemaType("product").filter('_type == "product" && store.productType in ["Master", "Simple"]').apiVersion(API_VERSION).child(async (productId) => {
|
|
461
|
+
const product = await client.fetch("*[_id == $id][0]{store}", {
|
|
462
|
+
id: productId
|
|
463
|
+
});
|
|
464
|
+
if (product?.store?.productType === "Master") {
|
|
465
|
+
const variantRefs = product.store.variants?.map((v) => v._ref) ?? [];
|
|
466
|
+
return S.list().title("Product").items([S.documentListItem().id(productId).schemaType("product"), S.divider().title("Variants"), ...variantRefs.map((ref) => S.documentListItem().id(ref).schemaType("product"))]);
|
|
467
|
+
}
|
|
468
|
+
return S.document().documentId(productId).schemaType("product");
|
|
469
|
+
}));
|
|
470
|
+
};
|
|
471
|
+
const sfccRenderMembers = (members) => [{
|
|
472
|
+
key: "sfcc-offline-banner",
|
|
473
|
+
kind: "decoration",
|
|
474
|
+
component: SfccOfflineBanner
|
|
475
|
+
}, ...members], SFCC_TYPES = /* @__PURE__ */ new Set(["product", "category"]), sfccPlugin = definePlugin(() => ({
|
|
476
|
+
name: "sfcc",
|
|
477
|
+
document: {
|
|
478
|
+
actions: (prev, context) => SFCC_TYPES.has(context.schemaType) ? prev.filter((action) => action.action !== "duplicate").map((action) => action.action === "delete" ? createSfccDeleteAction(action) : action) : prev,
|
|
479
|
+
newDocumentOptions: (prev) => prev.filter((template) => !SFCC_TYPES.has(template.templateId))
|
|
480
|
+
}
|
|
481
|
+
}));
|
|
482
|
+
export {
|
|
483
|
+
SfccDocumentStatus,
|
|
484
|
+
SfccOfflineBanner,
|
|
485
|
+
categoryStructure,
|
|
486
|
+
productStructure,
|
|
487
|
+
sfccCategoryPreview,
|
|
488
|
+
sfccCategoryStoreField,
|
|
489
|
+
sfccPlugin,
|
|
490
|
+
sfccProductPreview,
|
|
491
|
+
sfccProductStoreField,
|
|
492
|
+
sfccRenderMembers
|
|
493
|
+
};
|
|
494
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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","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,KAGjCM,KAAA,oBAAC,MAAA,EAAc,SAAA,GAAW,QAAA,GAAW,QAAA,GAAQ,MAAA,WAC3C,+BAAC,MAAA,EAAW,OAAA,UAAc,QACxB,UAAA;AAAA,IAAA,oBAAC,MAAA,EAAW,MAAA,GACV,UAAA,oBAAC,sBAAkB,GACrB;AAAA,wBACC,MAAA,EAAW,MAAA,GAAU,QAAA,UAAS,UAAA,8CAAA,CAE/B;AAAA,EAAA,GACF,EAAA,CACF,GAAOT,OAAAS,MAAAA,KAAAT,EAAA,CAAA,GATPS;AASO;AC/BJ,MAAME,cAAc,cCQrBC,SAA8D;AAAA,EAClEC,SAAS;AAAA,IACPC,SAAS;AAAA,IACTC,UAAU;AAAA,EAAA;AAAA,EAEZC,UAAU;AAAA,IACRF,SAAS;AAAA,IACTC,UAAU;AAAA,EAAA;AAEd;AAWO,SAASE,uBACdC,sBACyB;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AAAA,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,10 +1,60 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/sfcc",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Sanity plugin for Salesforce Commerce Cloud (SFCC) integration — synced product and category data with editorial enrichment.",
|
|
5
5
|
"keywords": [
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
"salesforce-commerce-cloud",
|
|
7
|
+
"sanity",
|
|
8
|
+
"sanity-plugin",
|
|
9
|
+
"sfcc"
|
|
10
|
+
],
|
|
11
|
+
"homepage": "https://github.com/sanity-io/plugins/tree/main/plugins/@sanity/sfcc#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/sanity-io/plugins/issues"
|
|
14
|
+
},
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"author": "Sanity.io <hello@sanity.io>",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+ssh://git@github.com/sanity-io/plugins.git",
|
|
20
|
+
"directory": "plugins/@sanity/sfcc"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist"
|
|
24
|
+
],
|
|
25
|
+
"type": "module",
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"exports": {
|
|
28
|
+
".": "./dist/index.js",
|
|
29
|
+
"./package.json": "./package.json"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@sanity/icons": "^3.7.4",
|
|
33
|
+
"@sanity/ui": "^3.1.14"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@sanity/pkg-utils": "^10.4.11",
|
|
37
|
+
"@types/react": "^19.2.14",
|
|
38
|
+
"@types/react-dom": "^19.2.3",
|
|
39
|
+
"babel-plugin-react-compiler": "^1.0.0",
|
|
40
|
+
"babel-plugin-styled-components": "^2.1.4",
|
|
41
|
+
"react": "^19.2.4",
|
|
42
|
+
"react-dom": "^19.2.4",
|
|
43
|
+
"sanity": "^5.17.1",
|
|
44
|
+
"styled-components": "^6.3.11",
|
|
45
|
+
"@repo/package.config": "0.0.0",
|
|
46
|
+
"@repo/tsconfig": "0.0.0"
|
|
47
|
+
},
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"react": "^19.2",
|
|
50
|
+
"react-dom": "^19.2",
|
|
51
|
+
"sanity": "^5",
|
|
52
|
+
"sanity-plugin-internationalized-array": "^4.0.0 || ^5.0.0"
|
|
53
|
+
},
|
|
54
|
+
"engines": {
|
|
55
|
+
"node": ">=20.19 <22 || >=22.12"
|
|
56
|
+
},
|
|
57
|
+
"scripts": {
|
|
58
|
+
"build": "pkg build --strict --check --clean"
|
|
59
|
+
}
|
|
60
|
+
}
|