@jay-framework/wix-stores-v1 0.24.0 → 0.24.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.
@@ -0,0 +1,179 @@
1
+ name: product-card
2
+ tags:
3
+ # Product basic info (from Wix Stores Product API)
4
+ - tag: _id
5
+ type: data
6
+ dataType: string
7
+ description: Product GUID
8
+
9
+ - tag: name
10
+ type: data
11
+ dataType: string
12
+ required: true
13
+ description: Product name
14
+
15
+ - tag: slug
16
+ type: data
17
+ dataType: string
18
+ description: Product slug for URL
19
+
20
+ - tag: productUrl
21
+ type: data
22
+ dataType: string
23
+ description: Full URL path to product page (e.g., /products/my-product)
24
+
25
+ - tag: productLink
26
+ type: interactive
27
+ elementType: HTMLAnchorElement
28
+ description: Link to product page
29
+
30
+ # Media (from Wix Stores Product API)
31
+ - tag: mainMedia
32
+ type: sub-contract
33
+ description: Main product media
34
+ tags:
35
+ - tag: url
36
+ type: data
37
+ dataType: string
38
+ description: Media URL
39
+ meta: {mediaType: wix-image}
40
+
41
+ - tag: altText
42
+ type: data
43
+ dataType: string
44
+ description: Media alt text
45
+
46
+ - tag: mediaType
47
+ type: data
48
+ dataType: enum (IMAGE | VIDEO)
49
+ description: Media type
50
+
51
+ - tag: thumbnail
52
+ type: sub-contract
53
+ description: Thumbnail image optimized for listings
54
+ tags:
55
+ - tag: url
56
+ type: data
57
+ dataType: string
58
+ description: Thumbnail URL
59
+ meta: {mediaType: wix-image}
60
+
61
+ - tag: altText
62
+ type: data
63
+ dataType: string
64
+ description: Thumbnail alt text
65
+
66
+ - tag: width
67
+ type: data
68
+ dataType: number
69
+ description: Thumbnail width in pixels
70
+
71
+ - tag: height
72
+ type: data
73
+ dataType: number
74
+ description: Thumbnail height in pixels
75
+
76
+ # Price information
77
+ - tag: price
78
+ type: data
79
+ dataType: string
80
+ phase: fast+interactive
81
+ description: The product or variant price
82
+
83
+ - tag: strikethroughPrice
84
+ type: data
85
+ dataType: string
86
+ phase: fast+interactive
87
+ description: A Strikethrough product price for sales
88
+
89
+ - tag: hasDiscount
90
+ type: variant
91
+ dataType: boolean
92
+ description: Whether product has a discount (compareAtPrice > actualPrice)
93
+
94
+ # Inventory (from Wix Stores Product API)
95
+ - tag: inventory
96
+ type: sub-contract
97
+ description: Product inventory information
98
+ tags:
99
+ - tag: availabilityStatus
100
+ type: variant
101
+ dataType: enum (IN_STOCK | OUT_OF_STOCK | PARTIALLY_OUT_OF_STOCK)
102
+ description: Current availability status
103
+
104
+ - tag: preorderStatus
105
+ type: data
106
+ dataType: enum (ENABLED | DISABLED | PARTIALLY_ENABLED)
107
+ description: Current preorder status
108
+
109
+ # Product ribbon (from Wix Stores Product API)
110
+ - tag: ribbon
111
+ type: sub-contract
112
+ description: Product ribbon/badge
113
+ tags:
114
+ - tag: _id
115
+ type: data
116
+ dataType: string
117
+ description: Ribbon GUID
118
+
119
+ - tag: name
120
+ type: data
121
+ dataType: string
122
+ description: Ribbon text (e.g., "New", "Sale", "Best Seller")
123
+
124
+ - tag: hasRibbon
125
+ type: variant
126
+ dataType: boolean
127
+ description: Whether product has a ribbon/badge
128
+
129
+ # Brand (from Wix Stores Product API)
130
+ - tag: brand
131
+ type: sub-contract
132
+ description: Product brand
133
+ tags:
134
+ - tag: _id
135
+ type: data
136
+ dataType: string
137
+ description: Brand GUID
138
+
139
+ - tag: name
140
+ type: data
141
+ dataType: string
142
+ description: Brand name
143
+
144
+ # Additional product metadata
145
+ - tag: productType
146
+ type: data
147
+ dataType: enum (PHYSICAL | DIGITAL)
148
+ description: Product type
149
+
150
+ # Quick actions
151
+ - tag: addToCartButton
152
+ type: interactive
153
+ elementType: HTMLButtonElement
154
+ description: Quick add to cart button (for SIMPLE products with no options)
155
+
156
+ - tag: isAddingToCart
157
+ type: variant
158
+ dataType: boolean
159
+ phase: fast+interactive
160
+ description: Whether add to cart is in progress
161
+
162
+ # Quick-add behavior
163
+ - tag: quickAddType
164
+ type: variant
165
+ dataType: enum (SIMPLE | SINGLE_OPTION | NEEDS_CONFIGURATION)
166
+ description: |
167
+ SIMPLE = no options, show Add to Cart button
168
+ SINGLE_OPTION = one option, show choices on hover (click = add to cart)
169
+ NEEDS_CONFIGURATION = multiple options or modifiers, link to product page
170
+
171
+ - tag: quickOption
172
+ type: sub-contract
173
+ description: Primary option for quick selection (only when quickAddType = SINGLE_OPTION)
174
+ link: ./product-options
175
+
176
+ - tag: viewOptionsButton
177
+ type: interactive
178
+ elementType: HTMLButtonElement
179
+ description: Button to navigate to product page (when quickAddType = NEEDS_CONFIGURATION)
@@ -0,0 +1,119 @@
1
+ import {HTMLElementCollectionProxy, HTMLElementProxy, JayContract} from "@jay-framework/runtime";
2
+ import {ProductOptionsViewState, ProductOptionsRefs, ProductOptionsRepeatedRefs} from "./product-options.jay-contract";
3
+
4
+ export enum MediaType {
5
+ IMAGE,
6
+ VIDEO
7
+ }
8
+
9
+ export interface MainMediaOfProductCardViewState {
10
+ url: string,
11
+ altText: string,
12
+ mediaType: MediaType
13
+ }
14
+
15
+ export interface ThumbnailOfProductCardViewState {
16
+ url: string,
17
+ altText: string,
18
+ width: number,
19
+ height: number
20
+ }
21
+
22
+ export enum AvailabilityStatus {
23
+ IN_STOCK,
24
+ OUT_OF_STOCK,
25
+ PARTIALLY_OUT_OF_STOCK
26
+ }
27
+
28
+ export enum PreorderStatus {
29
+ ENABLED,
30
+ DISABLED,
31
+ PARTIALLY_ENABLED
32
+ }
33
+
34
+ export interface InventoryOfProductCardViewState {
35
+ availabilityStatus: AvailabilityStatus,
36
+ preorderStatus: PreorderStatus
37
+ }
38
+
39
+ export interface RibbonOfProductCardViewState {
40
+ _id: string,
41
+ name: string
42
+ }
43
+
44
+ export interface BrandOfProductCardViewState {
45
+ _id: string,
46
+ name: string
47
+ }
48
+
49
+ export enum ProductType {
50
+ PHYSICAL,
51
+ DIGITAL
52
+ }
53
+
54
+ export enum QuickAddType {
55
+ SIMPLE,
56
+ SINGLE_OPTION,
57
+ NEEDS_CONFIGURATION
58
+ }
59
+
60
+ export interface ProductCardViewState {
61
+ _id: string,
62
+ name: string,
63
+ slug: string,
64
+ productUrl: string,
65
+ mainMedia: MainMediaOfProductCardViewState,
66
+ thumbnail: ThumbnailOfProductCardViewState,
67
+ price: string,
68
+ strikethroughPrice: string,
69
+ hasDiscount: boolean,
70
+ inventory: InventoryOfProductCardViewState,
71
+ ribbon: RibbonOfProductCardViewState,
72
+ hasRibbon: boolean,
73
+ brand: BrandOfProductCardViewState,
74
+ productType: ProductType,
75
+ isAddingToCart: boolean,
76
+ quickAddType: QuickAddType,
77
+ quickOption: ProductOptionsViewState
78
+ }
79
+
80
+ export type ProductCardSlowViewState = Pick<ProductCardViewState, '_id' | 'name' | 'slug' | 'productUrl' | 'hasDiscount' | 'hasRibbon' | 'productType' | 'quickAddType'> & {
81
+ mainMedia: ProductCardViewState['mainMedia'];
82
+ thumbnail: ProductCardViewState['thumbnail'];
83
+ inventory: ProductCardViewState['inventory'];
84
+ ribbon: ProductCardViewState['ribbon'];
85
+ brand: ProductCardViewState['brand'];
86
+ quickOption: Pick<ProductCardViewState['quickOption'], '_id' | 'name' | 'optionRenderType'> & {
87
+ choices: Array<Pick<ProductCardViewState['quickOption']['choices'][number], 'choiceId' | 'name' | 'choiceType' | 'colorCode' | 'variantId'>>;
88
+ };
89
+ };
90
+
91
+ export type ProductCardFastViewState = Pick<ProductCardViewState, 'price' | 'strikethroughPrice' | 'isAddingToCart'> & {
92
+ quickOption: {
93
+ choices: Array<Pick<ProductCardViewState['quickOption']['choices'][number], 'choiceId' | 'inStock' | 'isSelected'>>;
94
+ };
95
+ };
96
+
97
+ export type ProductCardInteractiveViewState = Pick<ProductCardViewState, 'price' | 'strikethroughPrice' | 'isAddingToCart'> & {
98
+ quickOption: {
99
+ choices: Array<Pick<ProductCardViewState['quickOption']['choices'][number], 'choiceId' | 'inStock' | 'isSelected'>>;
100
+ };
101
+ };
102
+
103
+
104
+ export interface ProductCardRefs {
105
+ productLink: HTMLElementProxy<ProductCardViewState, HTMLAnchorElement>,
106
+ addToCartButton: HTMLElementProxy<ProductCardViewState, HTMLButtonElement>,
107
+ viewOptionsButton: HTMLElementProxy<ProductCardViewState, HTMLButtonElement>,
108
+ quickOption: ProductOptionsRefs
109
+ }
110
+
111
+
112
+ export interface ProductCardRepeatedRefs {
113
+ productLink: HTMLElementCollectionProxy<ProductCardViewState, HTMLAnchorElement>,
114
+ addToCartButton: HTMLElementCollectionProxy<ProductCardViewState, HTMLButtonElement>,
115
+ viewOptionsButton: HTMLElementCollectionProxy<ProductCardViewState, HTMLButtonElement>,
116
+ quickOption: ProductOptionsRepeatedRefs
117
+ }
118
+
119
+ export type ProductCardContract = JayContract<ProductCardViewState, ProductCardRefs, ProductCardSlowViewState, ProductCardFastViewState, ProductCardInteractiveViewState>
@@ -0,0 +1,66 @@
1
+ name: product-options
2
+ description: Shared product option structure for quick selection and full product page
3
+
4
+ tags:
5
+ - tag: _id
6
+ type: data
7
+ dataType: string
8
+ description: Option GUID
9
+
10
+ - tag: name
11
+ type: data
12
+ dataType: string
13
+ description: "Option name (e.g., \"Size\", \"Color\")"
14
+
15
+ - tag: optionRenderType
16
+ type: variant
17
+ dataType: enum (TEXT_CHOICES | COLOR_SWATCH_CHOICES)
18
+ description: How the option should be rendered
19
+
20
+ - tag: choices
21
+ type: sub-contract
22
+ repeated: true
23
+ trackBy: choiceId
24
+ description: Available choices for this option
25
+ tags:
26
+ - tag: choiceId
27
+ type: data
28
+ dataType: string
29
+ description: Choice GUID
30
+
31
+ - tag: name
32
+ type: data
33
+ dataType: string
34
+ description: "Choice display name (e.g., \"XL\", \"Red\")"
35
+
36
+ - tag: choiceType
37
+ type: variant
38
+ dataType: enum (CHOICE_TEXT | ONE_COLOR)
39
+ description: Type of choice (text or color swatch)
40
+
41
+ - tag: colorCode
42
+ type: data
43
+ dataType: string
44
+ description: Color code in HEX format (for color swatches)
45
+
46
+ - tag: inStock
47
+ type: variant
48
+ dataType: boolean
49
+ phase: fast+interactive
50
+ description: Whether this choice has available stock
51
+
52
+ - tag: variantId
53
+ type: data
54
+ dataType: string
55
+ description: The variant ID to use when adding to cart (for single-option products)
56
+
57
+ - tag: isSelected
58
+ type: variant
59
+ dataType: boolean
60
+ phase: fast+interactive
61
+ description: Whether this choice is currently selected
62
+
63
+ - tag: choiceButton
64
+ type: interactive
65
+ elementType: HTMLButtonElement
66
+ description: Button to select this choice (click adds to cart for quick-add)
@@ -0,0 +1,57 @@
1
+ import {HTMLElementCollectionProxy, JayContract} from "@jay-framework/runtime";
2
+
3
+
4
+ export enum OptionRenderType {
5
+ TEXT_CHOICES,
6
+ COLOR_SWATCH_CHOICES
7
+ }
8
+
9
+ export enum ChoiceType {
10
+ CHOICE_TEXT,
11
+ ONE_COLOR
12
+ }
13
+
14
+ export interface ChoiceOfProductOptionsViewState {
15
+ choiceId: string,
16
+ name: string,
17
+ choiceType: ChoiceType,
18
+ colorCode: string,
19
+ inStock: boolean,
20
+ variantId: string,
21
+ isSelected: boolean
22
+ }
23
+
24
+ export interface ProductOptionsViewState {
25
+ _id: string,
26
+ name: string,
27
+ optionRenderType: OptionRenderType,
28
+ choices: Array<ChoiceOfProductOptionsViewState>
29
+ }
30
+
31
+ export type ProductOptionsSlowViewState = Pick<ProductOptionsViewState, '_id' | 'name' | 'optionRenderType'> & {
32
+ choices: Array<Pick<ProductOptionsViewState['choices'][number], 'choiceId' | 'name' | 'choiceType' | 'colorCode' | 'variantId'>>;
33
+ };
34
+
35
+ export type ProductOptionsFastViewState = {
36
+ choices: Array<Pick<ProductOptionsViewState['choices'][number], 'choiceId' | 'inStock' | 'isSelected'>>;
37
+ };
38
+
39
+ export type ProductOptionsInteractiveViewState = {
40
+ choices: Array<Pick<ProductOptionsViewState['choices'][number], 'choiceId' | 'inStock' | 'isSelected'>>;
41
+ };
42
+
43
+
44
+ export interface ProductOptionsRefs {
45
+ choices: {
46
+ choiceButton: HTMLElementCollectionProxy<ChoiceOfProductOptionsViewState, HTMLButtonElement>
47
+ }
48
+ }
49
+
50
+
51
+ export interface ProductOptionsRepeatedRefs {
52
+ choices: {
53
+ choiceButton: HTMLElementCollectionProxy<ChoiceOfProductOptionsViewState, HTMLButtonElement>
54
+ }
55
+ }
56
+
57
+ export type ProductOptionsContract = JayContract<ProductOptionsViewState, ProductOptionsRefs, ProductOptionsSlowViewState, ProductOptionsFastViewState, ProductOptionsInteractiveViewState>
@@ -0,0 +1,153 @@
1
+ name: product-page
2
+ params:
3
+ slug: string
4
+ tags:
5
+ - {tag: _id, type: data, dataType: string, description: Product GUID}
6
+ - {tag: productName, type: data, dataType: string, required: true, description: Product name}
7
+
8
+ - tag: mediaGallery
9
+ type: sub-contract
10
+ phase: fast+interactive
11
+ link: ./media-gallery
12
+
13
+ - {tag: description, type: data, dataType: html-string, description: Product description}
14
+ - {tag: brand, type: data, dataType: string, description: Brand name}
15
+ - {tag: ribbon, type: data, dataType: string, description: "Ribbon text (e.g., \"New\", \"Sale\")"}
16
+ - {tag: productType, type: variant, dataType: "enum (PHYSICAL | DIGITAL)", description: Product type }
17
+
18
+ - {tag: sku, type: data, dataType: string, phase: fast+interactive, description: Product SKU, or chosen variant SKU}
19
+ - {tag: price, type: data, dataType: string, phase: fast+interactive, description: The product or variant price}
20
+ - {tag: strikethroughPrice, type: data, dataType: string, phase: fast+interactive, description: A Strikethrough product price for sales}
21
+ - {tag: pricePerUnit, type: data, dataType: string, phase: fast+interactive, description: formatted price per unit, if used}
22
+ - {tag: stockStatus, type: variant, dataType: "enum (OUT_OF_STOCK | IN_STOCK)", phase: fast+interactive, description: indicator if the product or current variant are in stock }
23
+
24
+ - tag: quantity
25
+ type: sub-contract
26
+ description: Quantity selection controls
27
+ tags:
28
+ - {tag: decrementButton, type: interactive, elementType: HTMLButtonElement, description: Button to decrease quantity}
29
+ - {tag: incrementButton, type: interactive, elementType: HTMLButtonElement, description: Button to increase quantity}
30
+ - {tag: quantity, type: [data, interactive], dataType: number, elementType: HTMLInputElement, description: Selected Quantity and Direct quantity input field}
31
+
32
+ # Call to action
33
+ - {tag: addToCartButton, type: interactive, elementType: HTMLButtonElement, required: true, description: Add product to cart button}
34
+ - {tag: buyNowButton, type: interactive, elementType: HTMLButtonElement, required: true, description: Buy now button}
35
+ - {tag: actionsEnabled, type: variant, dataType: boolean, phase: fast+interactive, description: should the add to cart and buy now buttons be enabled}
36
+
37
+ - tag: options
38
+ type: sub-contract
39
+ repeated: true
40
+ trackBy: _id
41
+ description: Product customization options that generate variants
42
+ tags:
43
+ - {tag: _id, type: data, dataType: string, description: "Option GUID (customization ID)"}
44
+ - {tag: name, type: data, dataType: string, description: "Option name (e.g., \"Color\", \"Size\")"}
45
+ - {tag: optionRenderType, type: variant, dataType: "enum (TEXT_CHOICES | COLOR_SWATCH_CHOICES)", description: How the option should be rendered}
46
+ - {tag: textChoice, type: interactive, elementType: HTMLSelectElement, description: dropdown for text choice}
47
+ - {tag: textChoiceSelection, type: data, dataType: string, phase: fast+interactive, description: the selected text option}
48
+
49
+ - tag: choices
50
+ type: sub-contract
51
+ repeated: true
52
+ trackBy: choiceId
53
+ description: Available choices for this option
54
+ tags:
55
+ - {tag: choiceId, type: data, dataType: string, description: Choice GUID}
56
+ - {tag: choiceType, type: variant, dataType: "enum (CHOICE_TEXT | ONE_COLOR)", description: Type of choice}
57
+ - {tag: name, type: data, dataType: string, description: "Choice name (e.g., \"Red\", \"Large\")"}
58
+ - {tag: colorCode, type: data, dataType: string, description: Color code in HEX format (for color choices)}
59
+ - {tag: inStock, type: data, dataType: boolean, description: Whether at least one variant with this choice is in stock}
60
+ - {tag: isSelected, type: variant, dataType: boolean, phase: fast+interactive, description: Whether this choice is currently selected (UI state)}
61
+ - {tag: choiceButton, type: interactive, elementType: HTMLButtonElement, description: Button to select this choice}
62
+
63
+ # Additional info sections (from Wix Stores API)
64
+ - tag: infoSections
65
+ type: sub-contract
66
+ repeated: true
67
+ trackBy: _id
68
+ description: Additional product information sections
69
+ tags:
70
+ - {tag: _id, type: data, dataType: string, description: Info section GUID}
71
+ - {tag: title, type: data, dataType: string, description: Info section title}
72
+ - {tag: plainDescription, type: data, dataType: html-string, description: Info section description in HTML}
73
+
74
+ - tag: modifiers
75
+ type: sub-contract
76
+ repeated: true
77
+ trackBy: _id
78
+ description: Product customization options that do not generate variants
79
+ tags:
80
+ - {tag: _id, type: data, dataType: string, description: "modifier id"}
81
+ - {tag: name, type: data, dataType: string, description: "modifier name (e.g., \"Color\", \"Size\")"}
82
+ - {tag: modifierType, type: variant, dataType: "enum (TEXT_CHOICES | COLOR_SWATCH_CHOICES | FREE_TEXT)", description: What type of modifier to use?}
83
+ - {tag: textModifier, type: interactive, elementType: HTMLSelectElement, description: dropdown for text modifier}
84
+ - {tag: textModifierSelection, type: data, dataType: string, phase: fast+interactive, description: the selected text modifier}
85
+ - {tag: textInput, type: interactive, elementType: HTMLInputElement | HTMLAreaElement, description: text input for free text}
86
+ - {tag: textInputLength, type: data, dataType: number, description: the limit on the length of free text}
87
+ - {tag: textInputRequired, type: data, dataType: boolean, description: Is the free text input required?}
88
+
89
+ - tag: choices
90
+ type: sub-contract
91
+ repeated: true
92
+ trackBy: choiceId
93
+ description: Available choices for this Modifier
94
+ tags:
95
+ - {tag: choiceId, type: data, dataType: string, description: Choice GUID}
96
+ - {tag: choiceType, type: variant, dataType: "enum (CHOICE_TEXT | ONE_COLOR)", description: Type of choice}
97
+ - {tag: name, type: data, dataType: string, description: "Choice name (e.g., \"Red\", \"Large\")"}
98
+ - {tag: colorCode, type: data, dataType: string, description: Color code in HEX format (for color choices)}
99
+ - {tag: isSelected, type: variant, dataType: boolean, phase: fast+interactive, description: Whether this choice is currently selected (UI state)}
100
+ - {tag: choiceButton, type: interactive, elementType: HTMLButtonElement, description: Button to select this choice}
101
+
102
+ - tag: seoData
103
+ type: sub-contract
104
+ description: Product SEO data.
105
+ tags:
106
+ - tag: tags
107
+ type: sub-contract
108
+ repeated: true
109
+ trackBy: position
110
+ description: SEO tag information.
111
+ tags:
112
+ - {tag: position, type: data, dataType: string, description: the number of the tag, as two digit string.}
113
+ - {tag: type, type: data, dataType: string, description: SEO tag type.}
114
+ - tag: props
115
+ type: sub-contract
116
+ repeated: true
117
+ trackBy: key
118
+ description: A Key Value pair of SEO properties.
119
+ tags:
120
+ - tag: key
121
+ type: data
122
+ dataType: string
123
+ - tag: value
124
+ type: data
125
+ dataType: string
126
+ - tag: meta
127
+ type: sub-contract
128
+ repeated: true
129
+ trackBy: key
130
+ description: SEO tag metadata
131
+ tags:
132
+ - tag: key
133
+ type: data
134
+ dataType: string
135
+ - tag: value
136
+ type: data
137
+ dataType: string
138
+ - {tag: children, type: data, dataType: string, description: SEO tag inner content.}
139
+
140
+ - tag: settings
141
+ type: sub-contract
142
+ description: SEO general settings.
143
+ tags:
144
+ - {tag: preventAutoRedirect, type: data, dataType: boolean, description: Whether the automatical redirect visits from the old URL to the new one is enabled.}
145
+ - tag: keywords
146
+ type: sub-contract
147
+ repeated: true
148
+ trackBy: term
149
+ description: User-selected keyword terms for a specific page.
150
+ tags:
151
+ - {tag: term, type: data, dataType: string, description: Keyword value.}
152
+ - {tag: isMain, type: data, dataType: boolean, description: Whether the keyword is the main focus keyword.}
153
+ - {tag: origin, type: data, dataType: string, description: The source that added the keyword terms to the SEO settings. }