@caartzee/theme-sdk 0.0.0-stage → 1.2.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/README.md +222 -2
- package/dist/bin/caartzee-theme.js +9223 -0
- package/dist/lib/index.js +11614 -0
- package/dist/types/src/auth/credentials-store.d.ts +18 -0
- package/dist/types/src/auth/index.d.ts +2 -0
- package/dist/types/src/auth/oauth-client.d.ts +39 -0
- package/dist/types/src/blocks/block-contract.d.ts +242 -0
- package/dist/types/src/candy/compatibility-matrix.d.ts +10 -0
- package/dist/types/src/candy/context-builder.d.ts +31 -0
- package/dist/types/src/candy/engine.d.ts +69 -0
- package/dist/types/src/candy/filters.d.ts +32 -0
- package/dist/types/src/candy/ide-support.d.ts +20 -0
- package/dist/types/src/candy/index.d.ts +9 -0
- package/dist/types/src/candy/schema-parser.d.ts +13 -0
- package/dist/types/src/candy/security.d.ts +54 -0
- package/dist/types/src/candy/tags.d.ts +11 -0
- package/dist/types/src/candy/types.d.ts +185 -0
- package/dist/types/src/cli/caartzee-cli.d.ts +9 -0
- package/dist/types/src/cli/candy-mcp.d.ts +2 -0
- package/dist/types/src/cli/candy-tool-server.d.ts +39 -0
- package/dist/types/src/cli/index.d.ts +1 -0
- package/dist/types/src/cli/mcp/component-tools.d.ts +2 -0
- package/dist/types/src/cli/mcp/docs-tools.d.ts +89 -0
- package/dist/types/src/cli/mcp/editor-tools.d.ts +22 -0
- package/dist/types/src/cli/mcp/resources-and-prompts.d.ts +2 -0
- package/dist/types/src/cli/mcp/testing-tools.d.ts +54 -0
- package/dist/types/src/cli/sdk-client.d.ts +12 -0
- package/dist/types/src/contracts/category-selection.d.ts +15 -0
- package/dist/types/src/contracts/commerce.d.ts +282 -0
- package/dist/types/src/contracts/footer-builder.d.ts +125 -0
- package/dist/types/src/contracts/hooks.d.ts +37 -0
- package/dist/types/src/contracts/manifest.d.ts +3127 -0
- package/dist/types/src/contracts/navigation.d.ts +39 -0
- package/dist/types/src/contracts/order-tracking.d.ts +40 -0
- package/dist/types/src/contracts/page.d.ts +262 -0
- package/dist/types/src/contracts/storefront-content.d.ts +60 -0
- package/dist/types/src/contracts/style-document.d.ts +2 -0
- package/dist/types/src/contracts/styles.d.ts +2002 -0
- package/dist/types/src/contracts/theme.d.ts +35 -0
- package/dist/types/src/dev-server/catalog-preview.d.ts +25 -0
- package/dist/types/src/dev-server/dev-server.d.ts +25 -0
- package/dist/types/src/dev-server/index.d.ts +1 -0
- package/dist/types/src/dev-server/local-commerce-runtime.d.ts +76 -0
- package/dist/types/src/dev-server/local-editor-server.d.ts +22 -0
- package/dist/types/src/dev-server/theme-preview.d.ts +8 -0
- package/dist/types/src/index.d.ts +27 -0
- package/dist/types/src/mock/index.d.ts +10 -0
- package/dist/types/src/mock/mock-categories.d.ts +2 -0
- package/dist/types/src/mock/mock-commerce.d.ts +55 -0
- package/dist/types/src/mock/mock-customer.d.ts +47 -0
- package/dist/types/src/mock/mock-hooks.d.ts +2 -0
- package/dist/types/src/mock/mock-products.d.ts +3 -0
- package/dist/types/src/rendering/commerce-pages.d.ts +16 -0
- package/dist/types/src/rendering/raw-html.d.ts +12 -0
- package/dist/types/src/rendering/section-wrapper.d.ts +30 -0
- package/dist/types/src/scaffold/candy-starter-assets.d.ts +2 -0
- package/dist/types/src/scaffold/commerce-generator.d.ts +3 -0
- package/dist/types/src/scaffold/index.d.ts +2 -0
- package/dist/types/src/scaffold/template-generator.d.ts +21 -0
- package/dist/types/src/sections/section-contract.d.ts +350 -0
- package/dist/types/src/settings/global-settings.d.ts +25 -0
- package/dist/types/src/templates/json-template.d.ts +991 -0
- package/dist/types/src/validation/package-validator.d.ts +53 -0
- package/dist/types/src/validation/rich-text.d.ts +24 -0
- package/package.json +29 -3
- package/templates/commerce/README.md +165 -0
- package/templates/commerce/assets/theme.css +1 -0
- package/templates/commerce/manifest.json +1 -0
- package/templates/commerce/src/blocks/index.ts +184 -0
- package/templates/commerce/src/config/settings-defaults.ts +25 -0
- package/templates/commerce/src/config/settings-schema.ts +102 -0
- package/templates/commerce/src/index.ts +90 -0
- package/templates/commerce/src/layouts/default.ts +275 -0
- package/templates/commerce/src/manifest.ts +976 -0
- package/templates/commerce/src/pages/account/components.ts +369 -0
- package/templates/commerce/src/pages/account/tabs.ts +792 -0
- package/templates/commerce/src/pages/account.ts +55 -0
- package/templates/commerce/src/pages/campaign.ts +423 -0
- package/templates/commerce/src/pages/cart.ts +261 -0
- package/templates/commerce/src/pages/category-detail.ts +124 -0
- package/templates/commerce/src/pages/category-list.ts +87 -0
- package/templates/commerce/src/pages/checkout.ts +712 -0
- package/templates/commerce/src/pages/commerce.ts +45 -0
- package/templates/commerce/src/pages/home.ts +160 -0
- package/templates/commerce/src/pages/index.ts +99 -0
- package/templates/commerce/src/pages/login.ts +204 -0
- package/templates/commerce/src/pages/order-success.ts +80 -0
- package/templates/commerce/src/pages/product-detail.ts +489 -0
- package/templates/commerce/src/pages/product-list.ts +125 -0
- package/templates/commerce/src/pages/search.ts +88 -0
- package/templates/commerce/src/pages/signup.ts +253 -0
- package/templates/commerce/src/pages/status.ts +7 -0
- package/templates/commerce/src/pages/theme-layout.ts +491 -0
- package/templates/commerce/src/pages/track-order.ts +196 -0
- package/templates/commerce/src/pages/wishlist.ts +83 -0
- package/templates/commerce/src/sections/about-story.ts +117 -0
- package/templates/commerce/src/sections/announcement-bar.ts +101 -0
- package/templates/commerce/src/sections/banner-grid.ts +319 -0
- package/templates/commerce/src/sections/campaign-banners.ts +158 -0
- package/templates/commerce/src/sections/category-slider.ts +144 -0
- package/templates/commerce/src/sections/content-builder.ts +123 -0
- package/templates/commerce/src/sections/content-controls.ts +45 -0
- package/templates/commerce/src/sections/custom-form.ts +59 -0
- package/templates/commerce/src/sections/faq-accordion.ts +123 -0
- package/templates/commerce/src/sections/footer.ts +728 -0
- package/templates/commerce/src/sections/header.ts +439 -0
- package/templates/commerce/src/sections/hero-slider.ts +492 -0
- package/templates/commerce/src/sections/hero.ts +137 -0
- package/templates/commerce/src/sections/index.ts +102 -0
- package/templates/commerce/src/sections/mobile-slider.ts +102 -0
- package/templates/commerce/src/sections/newsletter.ts +43 -0
- package/templates/commerce/src/sections/product-grid.ts +191 -0
- package/templates/commerce/src/sections/raw-html.ts +1 -0
- package/templates/commerce/src/sections/rich-text.ts +26 -0
- package/templates/commerce/src/sections/services-features.ts +211 -0
- package/templates/commerce/src/sections/testimonials.ts +194 -0
- package/templates/commerce/src/snippets/product-card.ts +178 -0
- package/templates/commerce/src/snippets/product-price.ts +46 -0
- package/templates/commerce/src/snippets/responsive-image.ts +29 -0
- package/templates/commerce/src/styles.ts +477 -0
- package/templates/commerce/src/templates/404.json +26 -0
- package/templates/commerce/src/templates/account.json +17 -0
- package/templates/commerce/src/templates/cart.json +17 -0
- package/templates/commerce/src/templates/category.json +16 -0
- package/templates/commerce/src/templates/checkout.json +15 -0
- package/templates/commerce/src/templates/collection.json +16 -0
- package/templates/commerce/src/templates/index.json +180 -0
- package/templates/commerce/src/templates/login.json +17 -0
- package/templates/commerce/src/templates/order-success.json +17 -0
- package/templates/commerce/src/templates/page.json +17 -0
- package/templates/commerce/src/templates/product.json +17 -0
- package/templates/commerce/src/templates/search.json +18 -0
- package/templates/commerce/src/templates/signup.json +17 -0
- package/templates/commerce/src/templates/track-order.json +17 -0
- package/templates/commerce/src/templates/wishlist.json +17 -0
- package/templates/commerce/src/templates.ts +510 -0
- package/templates/commerce/src/tokens.ts +22 -0
- package/templates/theme-candy-boilerplate/.editorconfig +14 -0
- package/templates/theme-candy-boilerplate/.gitattributes +1 -0
- package/templates/theme-candy-boilerplate/.vscode/extensions.json +7 -0
- package/templates/theme-candy-boilerplate/.vscode/settings.json +17 -0
- package/templates/theme-candy-boilerplate/assets/theme.css +78 -0
- package/templates/theme-candy-boilerplate/assets/theme.js +7 -0
- package/templates/theme-candy-boilerplate/candy.config.json +40 -0
- package/templates/theme-candy-boilerplate/index.ts +39 -0
- package/templates/theme-candy-boilerplate/layout/theme.candy +25 -0
- package/templates/theme-candy-boilerplate/locales/en.default.json +37 -0
- package/templates/theme-candy-boilerplate/manifest.json +123 -0
- package/templates/theme-candy-boilerplate/package.json +16 -0
- package/templates/theme-candy-boilerplate/schemas/settings_schema.json +36 -0
- package/templates/theme-candy-boilerplate/sections/featured-products.candy +89 -0
- package/templates/theme-candy-boilerplate/sections/footer.candy +50 -0
- package/templates/theme-candy-boilerplate/sections/header.candy +116 -0
- package/templates/theme-candy-boilerplate/sections/hero-banner.candy +135 -0
- package/templates/theme-candy-boilerplate/sections/image-with-text.candy +85 -0
- package/templates/theme-candy-boilerplate/snippets/price.candy +19 -0
- package/templates/theme-candy-boilerplate/snippets/product-card.candy +43 -0
- package/templates/theme-candy-boilerplate/templates/404.candy +12 -0
- package/templates/theme-candy-boilerplate/templates/cart.candy +51 -0
- package/templates/theme-candy-boilerplate/templates/collection.candy +51 -0
- package/templates/theme-candy-boilerplate/templates/index.candy +7 -0
- package/templates/theme-candy-boilerplate/templates/page.candy +10 -0
- package/templates/theme-candy-boilerplate/templates/product.candy +59 -0
- package/templates/theme-candy-boilerplate/templates/search.candy +40 -0
- package/templates/vscode-candy/LICENSE +21 -0
- package/templates/vscode-candy/README.md +22 -0
- package/templates/vscode-candy/extension.js +689 -0
- package/templates/vscode-candy/icons/candy-dark.svg +23 -0
- package/templates/vscode-candy/icons/candy-light.svg +23 -0
- package/templates/vscode-candy/icons/candy-logo.png +0 -0
- package/templates/vscode-candy/icons/candy-sweet-dark.svg +23 -0
- package/templates/vscode-candy/icons/candy-sweet-light.svg +23 -0
- package/templates/vscode-candy/language-configuration.json +47 -0
- package/templates/vscode-candy/package.json +118 -0
- package/templates/vscode-candy/schemas/candy-config.schema.json +56 -0
- package/templates/vscode-candy/schemas/candy-settings.schema.json +70 -0
- package/templates/vscode-candy/snippets/candy.code-snippets +270 -0
- package/templates/vscode-candy/syntaxes/candy.tmLanguage.json +296 -0
- package/templates/vscode-candy/vim/ftdetect/candy.vim +5 -0
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalized Commerce Data Contracts for Storefront Themes.
|
|
3
|
+
* Themes consume these stable contracts instead of depending on raw V2 REST responses.
|
|
4
|
+
*/
|
|
5
|
+
export interface StorefrontPrice {
|
|
6
|
+
amount: number;
|
|
7
|
+
formatted: string;
|
|
8
|
+
currency: string;
|
|
9
|
+
}
|
|
10
|
+
export interface StorefrontBadge {
|
|
11
|
+
name: string;
|
|
12
|
+
imageUrl?: string | null | undefined;
|
|
13
|
+
color?: string | null | undefined;
|
|
14
|
+
}
|
|
15
|
+
export interface StorefrontProduct {
|
|
16
|
+
id: number | string;
|
|
17
|
+
title: string;
|
|
18
|
+
name: string;
|
|
19
|
+
slug: string;
|
|
20
|
+
sku?: string | null | undefined;
|
|
21
|
+
summary?: string | null | undefined;
|
|
22
|
+
shortDescription?: string | null | undefined;
|
|
23
|
+
description?: string | null | undefined;
|
|
24
|
+
price: number;
|
|
25
|
+
salePrice: number | null;
|
|
26
|
+
compareAtPrice?: number | null | undefined;
|
|
27
|
+
formattedPrice: string;
|
|
28
|
+
priceFormatted: string;
|
|
29
|
+
formattedSalePrice?: string | null | undefined;
|
|
30
|
+
compareAtPriceFormatted?: string | null | undefined;
|
|
31
|
+
hasDiscount: boolean;
|
|
32
|
+
onSale: boolean;
|
|
33
|
+
discountPercentage?: number | null | undefined;
|
|
34
|
+
inStock: boolean;
|
|
35
|
+
stockCount: number;
|
|
36
|
+
isCartable: boolean;
|
|
37
|
+
imageUrl: string;
|
|
38
|
+
galleryImages: string[];
|
|
39
|
+
images?: string[] | undefined;
|
|
40
|
+
categoryId?: number | string | null | undefined;
|
|
41
|
+
categoryName?: string | null | undefined;
|
|
42
|
+
categorySlug?: string | null | undefined;
|
|
43
|
+
category?: {
|
|
44
|
+
id?: number | string | undefined;
|
|
45
|
+
name?: string | undefined;
|
|
46
|
+
slug?: string | undefined;
|
|
47
|
+
} | null | undefined;
|
|
48
|
+
badge?: StorefrontBadge | null | undefined;
|
|
49
|
+
avgRating?: number | null | undefined;
|
|
50
|
+
rating?: number | null | undefined;
|
|
51
|
+
reviewCount?: number | undefined;
|
|
52
|
+
}
|
|
53
|
+
export interface StorefrontSubcategory {
|
|
54
|
+
id: number | string;
|
|
55
|
+
categoryId: number | string;
|
|
56
|
+
name: string;
|
|
57
|
+
slug: string;
|
|
58
|
+
description?: string | null | undefined;
|
|
59
|
+
imageUrl?: string | null | undefined;
|
|
60
|
+
productCount?: number | undefined;
|
|
61
|
+
}
|
|
62
|
+
export interface StorefrontCategory {
|
|
63
|
+
id: number | string;
|
|
64
|
+
name: string;
|
|
65
|
+
slug: string;
|
|
66
|
+
description?: string | null | undefined;
|
|
67
|
+
imageUrl?: string | null | undefined;
|
|
68
|
+
productCount: number;
|
|
69
|
+
subcategories?: StorefrontSubcategory[] | undefined;
|
|
70
|
+
}
|
|
71
|
+
export interface StorefrontInventoryDetail {
|
|
72
|
+
id: number | string;
|
|
73
|
+
label?: string | undefined;
|
|
74
|
+
color?: string | null | undefined;
|
|
75
|
+
colorCode?: string | null | undefined;
|
|
76
|
+
size?: string | null | undefined;
|
|
77
|
+
imageUrl?: string | null | undefined;
|
|
78
|
+
price?: number | undefined;
|
|
79
|
+
formattedPrice?: string | undefined;
|
|
80
|
+
attributes?: Array<{
|
|
81
|
+
name: string;
|
|
82
|
+
value: string;
|
|
83
|
+
}> | undefined;
|
|
84
|
+
attributeName?: string | undefined;
|
|
85
|
+
attributeValue?: string | undefined;
|
|
86
|
+
stockCount: number;
|
|
87
|
+
priceDelta?: number | undefined;
|
|
88
|
+
}
|
|
89
|
+
export interface StorefrontReview {
|
|
90
|
+
id: number | string;
|
|
91
|
+
author: string;
|
|
92
|
+
rating: number;
|
|
93
|
+
comment: string;
|
|
94
|
+
createdAt: string;
|
|
95
|
+
}
|
|
96
|
+
export interface StorefrontProductDetails extends StorefrontProduct {
|
|
97
|
+
coupons?: import('./storefront-content').StorefrontCoupon[] | undefined;
|
|
98
|
+
brandName?: string | null | undefined;
|
|
99
|
+
tags?: string[] | undefined;
|
|
100
|
+
labels?: string[] | undefined;
|
|
101
|
+
unitLabel?: string | null | undefined;
|
|
102
|
+
minPurchase?: number | undefined;
|
|
103
|
+
maxPurchase?: number | null | undefined;
|
|
104
|
+
returnPolicy?: string | null | undefined;
|
|
105
|
+
deliveryOptions?: string[] | undefined;
|
|
106
|
+
attributes?: Record<string, string[]> | undefined;
|
|
107
|
+
inventoryDetails?: StorefrontInventoryDetail[] | undefined;
|
|
108
|
+
reviews?: StorefrontReview[] | undefined;
|
|
109
|
+
relatedProducts?: StorefrontProduct[] | undefined;
|
|
110
|
+
productUrl?: string | undefined;
|
|
111
|
+
}
|
|
112
|
+
export interface StorefrontPagination {
|
|
113
|
+
currentPage: number;
|
|
114
|
+
totalPages: number;
|
|
115
|
+
totalItems: number;
|
|
116
|
+
total?: number | undefined;
|
|
117
|
+
perPage: number;
|
|
118
|
+
hasNextPage?: boolean | undefined;
|
|
119
|
+
hasPreviousPage?: boolean | undefined;
|
|
120
|
+
}
|
|
121
|
+
export type StorefrontProductListResult = StorefrontProduct[] & {
|
|
122
|
+
products: StorefrontProduct[];
|
|
123
|
+
pagination: StorefrontPagination;
|
|
124
|
+
};
|
|
125
|
+
export interface StorefrontSearchResult {
|
|
126
|
+
query: string;
|
|
127
|
+
products: StorefrontProduct[];
|
|
128
|
+
categories: StorefrontCategory[];
|
|
129
|
+
totalResults: number;
|
|
130
|
+
total?: number | undefined;
|
|
131
|
+
}
|
|
132
|
+
export interface StorefrontBreadcrumb {
|
|
133
|
+
label: string;
|
|
134
|
+
url: string;
|
|
135
|
+
}
|
|
136
|
+
export interface StorefrontBlog {
|
|
137
|
+
id: number | string;
|
|
138
|
+
title: string;
|
|
139
|
+
slug: string;
|
|
140
|
+
excerpt?: string | null | undefined;
|
|
141
|
+
content: string;
|
|
142
|
+
imageUrl?: string | null | undefined;
|
|
143
|
+
author?: string | null | undefined;
|
|
144
|
+
publishedAt?: string | null | undefined;
|
|
145
|
+
createdAt?: string | null | undefined;
|
|
146
|
+
categoryName?: string | null | undefined;
|
|
147
|
+
tags?: string[] | undefined;
|
|
148
|
+
}
|
|
149
|
+
export interface StorefrontBlogListResult {
|
|
150
|
+
blogs: StorefrontBlog[];
|
|
151
|
+
pagination?: StorefrontPagination | undefined;
|
|
152
|
+
}
|
|
153
|
+
export interface StorefrontSiteSettings {
|
|
154
|
+
siteTitle?: string | undefined;
|
|
155
|
+
siteTagline?: string | undefined;
|
|
156
|
+
logoUrl?: string | null | undefined;
|
|
157
|
+
faviconUrl?: string | null | undefined;
|
|
158
|
+
contactEmail?: string | null | undefined;
|
|
159
|
+
contactPhone?: string | null | undefined;
|
|
160
|
+
address?: string | null | undefined;
|
|
161
|
+
copyrightText?: string | null | undefined;
|
|
162
|
+
socialLinks?: Record<string, string> | undefined;
|
|
163
|
+
customCss?: string | null | undefined;
|
|
164
|
+
rawSettings?: Record<string, any> | undefined;
|
|
165
|
+
}
|
|
166
|
+
export interface StorefrontCurrencyInfo {
|
|
167
|
+
symbol: string;
|
|
168
|
+
currency?: string | undefined;
|
|
169
|
+
code?: string | undefined;
|
|
170
|
+
currencyPosition: 'left' | 'right';
|
|
171
|
+
position?: 'left' | 'right' | undefined;
|
|
172
|
+
rtl: boolean;
|
|
173
|
+
decimalDigits?: number | undefined;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Formats a monetary amount according to the tenant's currency configuration.
|
|
177
|
+
*/
|
|
178
|
+
export declare function formatPrice(amount: number | string | null | undefined, currency?: Partial<StorefrontCurrencyInfo> | null | undefined): string;
|
|
179
|
+
export interface StorefrontLanguage {
|
|
180
|
+
id?: number | string | undefined;
|
|
181
|
+
name: string;
|
|
182
|
+
code: string;
|
|
183
|
+
direction: 'ltr' | 'rtl';
|
|
184
|
+
isDefault: boolean;
|
|
185
|
+
}
|
|
186
|
+
export interface StorefrontCampaign {
|
|
187
|
+
id: number | string;
|
|
188
|
+
title: string;
|
|
189
|
+
name?: string | null | undefined;
|
|
190
|
+
subtitle?: string | null | undefined;
|
|
191
|
+
slug?: string | null | undefined;
|
|
192
|
+
image?: string | null | undefined;
|
|
193
|
+
imageUrl?: string | null | undefined;
|
|
194
|
+
startDate?: string | null | undefined;
|
|
195
|
+
endDate?: string | null | undefined;
|
|
196
|
+
status?: string | null | undefined;
|
|
197
|
+
badge?: string | null | undefined;
|
|
198
|
+
freeShipping?: boolean | undefined;
|
|
199
|
+
promotionRules?: any[] | undefined;
|
|
200
|
+
qualifyingProducts?: StorefrontProduct[] | undefined;
|
|
201
|
+
rewardProducts?: StorefrontProduct[] | undefined;
|
|
202
|
+
rewardProduct?: StorefrontProduct | null | undefined;
|
|
203
|
+
utmLinks?: any[] | undefined;
|
|
204
|
+
products: StorefrontProduct[];
|
|
205
|
+
}
|
|
206
|
+
export interface StorefrontCustomer {
|
|
207
|
+
id: number | string;
|
|
208
|
+
firstName?: string | undefined;
|
|
209
|
+
lastName?: string | undefined;
|
|
210
|
+
name?: string | undefined;
|
|
211
|
+
email: string;
|
|
212
|
+
phone?: string | undefined;
|
|
213
|
+
avatarUrl?: string | null | undefined;
|
|
214
|
+
createdAt?: string | undefined;
|
|
215
|
+
}
|
|
216
|
+
export interface StorefrontAddress {
|
|
217
|
+
id?: number | string | undefined;
|
|
218
|
+
name?: string | undefined;
|
|
219
|
+
street: string;
|
|
220
|
+
city: string;
|
|
221
|
+
state?: string | undefined;
|
|
222
|
+
postalCode: string;
|
|
223
|
+
country: string;
|
|
224
|
+
phone?: string | undefined;
|
|
225
|
+
isDefault?: boolean | undefined;
|
|
226
|
+
}
|
|
227
|
+
export interface StorefrontOrderItem {
|
|
228
|
+
id?: number | string | undefined;
|
|
229
|
+
productId: number | string;
|
|
230
|
+
productName: string;
|
|
231
|
+
productSlug?: string | undefined;
|
|
232
|
+
imageUrl?: string | undefined;
|
|
233
|
+
price: number;
|
|
234
|
+
formattedPrice: string;
|
|
235
|
+
quantity: number;
|
|
236
|
+
variantName?: string | null | undefined;
|
|
237
|
+
}
|
|
238
|
+
export interface StorefrontOrder {
|
|
239
|
+
id: number | string;
|
|
240
|
+
orderNumber: string;
|
|
241
|
+
status: 'pending' | 'processing' | 'shipped' | 'delivered' | 'cancelled' | string;
|
|
242
|
+
statusLabel?: string | undefined;
|
|
243
|
+
createdAt: string;
|
|
244
|
+
total: number;
|
|
245
|
+
formattedTotal: string;
|
|
246
|
+
subtotal?: number | undefined;
|
|
247
|
+
shippingFee?: number | undefined;
|
|
248
|
+
tax?: number | undefined;
|
|
249
|
+
currency?: string | undefined;
|
|
250
|
+
items: StorefrontOrderItem[];
|
|
251
|
+
shippingAddress?: StorefrontAddress | undefined;
|
|
252
|
+
trackingNumber?: string | null | undefined;
|
|
253
|
+
trackingUrl?: string | null | undefined;
|
|
254
|
+
}
|
|
255
|
+
export interface StorefrontWishlistItem {
|
|
256
|
+
id: number | string;
|
|
257
|
+
productId: number | string;
|
|
258
|
+
product: StorefrontProduct;
|
|
259
|
+
addedAt?: string | undefined;
|
|
260
|
+
}
|
|
261
|
+
export interface StorefrontShippingMethod {
|
|
262
|
+
id: string;
|
|
263
|
+
name: string;
|
|
264
|
+
description?: string | undefined;
|
|
265
|
+
price: number;
|
|
266
|
+
formattedPrice: string;
|
|
267
|
+
estimatedDays?: string | undefined;
|
|
268
|
+
}
|
|
269
|
+
export interface StorefrontMobileSlider {
|
|
270
|
+
id?: number | string | undefined;
|
|
271
|
+
title: string | null;
|
|
272
|
+
description: string | null;
|
|
273
|
+
image: string | null;
|
|
274
|
+
imageUrl?: string | null | undefined;
|
|
275
|
+
buttonUrl?: string | null | undefined;
|
|
276
|
+
buttonText?: string | null | undefined;
|
|
277
|
+
button_url?: string | null | undefined;
|
|
278
|
+
button_text?: string | null | undefined;
|
|
279
|
+
campaign?: string | number | null | undefined;
|
|
280
|
+
category?: string | number | null | undefined;
|
|
281
|
+
}
|
|
282
|
+
export declare const DEFAULT_PRODUCT_PLACEHOLDER = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 24 24' fill='%23f8fafc' stroke='%2394a3b8' stroke-width='1.5'%3E%3Crect x='3' y='3' width='18' height='18' rx='2' ry='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5' fill='%2394a3b8'/%3E%3Cpath d='M21 15l-5-5L5 21'/%3E%3C/svg%3E";
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
export type FooterComponentType = 'logo' | 'menu' | 'contact' | 'social' | 'newsletter' | 'payment-methods' | 'custom-text';
|
|
2
|
+
export interface LogoComponentSettings {
|
|
3
|
+
logoImage?: string;
|
|
4
|
+
logoWidth?: number;
|
|
5
|
+
logoText?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface MenuComponentSettings {
|
|
9
|
+
heading?: string;
|
|
10
|
+
menuId?: string | number;
|
|
11
|
+
menuTitle?: string;
|
|
12
|
+
displayStyle?: 'vertical' | 'horizontal';
|
|
13
|
+
items?: Array<{
|
|
14
|
+
label: string;
|
|
15
|
+
url: string;
|
|
16
|
+
}>;
|
|
17
|
+
}
|
|
18
|
+
export interface ContactComponentSettings {
|
|
19
|
+
heading?: string;
|
|
20
|
+
address?: string;
|
|
21
|
+
email?: string;
|
|
22
|
+
phone?: string;
|
|
23
|
+
businessHours?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface SocialComponentSettings {
|
|
26
|
+
heading?: string;
|
|
27
|
+
facebookUrl?: string;
|
|
28
|
+
instagramUrl?: string;
|
|
29
|
+
twitterUrl?: string;
|
|
30
|
+
linkedinUrl?: string;
|
|
31
|
+
youtubeUrl?: string;
|
|
32
|
+
tiktokUrl?: string;
|
|
33
|
+
iconStyle?: 'simple' | 'filled' | 'circle';
|
|
34
|
+
}
|
|
35
|
+
export interface NewsletterComponentSettings {
|
|
36
|
+
heading?: string;
|
|
37
|
+
description?: string;
|
|
38
|
+
buttonText?: string;
|
|
39
|
+
placeholder?: string;
|
|
40
|
+
successMessage?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface PaymentMethodsComponentSettings {
|
|
43
|
+
heading?: string;
|
|
44
|
+
showVisa?: boolean;
|
|
45
|
+
showMastercard?: boolean;
|
|
46
|
+
showAmex?: boolean;
|
|
47
|
+
showPaypal?: boolean;
|
|
48
|
+
showApplePay?: boolean;
|
|
49
|
+
showGooglePay?: boolean;
|
|
50
|
+
grayscale?: boolean;
|
|
51
|
+
}
|
|
52
|
+
export interface CustomTextComponentSettings {
|
|
53
|
+
heading?: string;
|
|
54
|
+
content?: string;
|
|
55
|
+
}
|
|
56
|
+
export interface FooterComponentInstance {
|
|
57
|
+
id: string;
|
|
58
|
+
type: FooterComponentType;
|
|
59
|
+
settings: Record<string, any>;
|
|
60
|
+
}
|
|
61
|
+
export interface FooterColumn {
|
|
62
|
+
id: string;
|
|
63
|
+
width: string;
|
|
64
|
+
components: FooterComponentInstance[];
|
|
65
|
+
settings?: {
|
|
66
|
+
textAlign?: 'left' | 'center' | 'right';
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
export interface FooterRow {
|
|
70
|
+
id: string;
|
|
71
|
+
columns: FooterColumn[];
|
|
72
|
+
settings?: {
|
|
73
|
+
paddingTop?: number;
|
|
74
|
+
paddingBottom?: number;
|
|
75
|
+
dividerTop?: boolean;
|
|
76
|
+
dividerBottom?: boolean;
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
export interface GlobalFooterStyling {
|
|
80
|
+
backgroundColor?: string | undefined;
|
|
81
|
+
backgroundImage?: string | undefined;
|
|
82
|
+
headingColor?: string | undefined;
|
|
83
|
+
textColor?: string | undefined;
|
|
84
|
+
linkColor?: string | undefined;
|
|
85
|
+
linkHoverColor?: string | undefined;
|
|
86
|
+
fontFamily?: string | undefined;
|
|
87
|
+
paddingTop?: number | undefined;
|
|
88
|
+
paddingBottom?: number | undefined;
|
|
89
|
+
borderTopWidth?: number | undefined;
|
|
90
|
+
borderTopColor?: string | undefined;
|
|
91
|
+
dividerColor?: string | undefined;
|
|
92
|
+
}
|
|
93
|
+
export interface GlobalFooterResponsive {
|
|
94
|
+
stackOnMobile: boolean;
|
|
95
|
+
hideOnMobile?: boolean | undefined;
|
|
96
|
+
hideOnTablet?: boolean | undefined;
|
|
97
|
+
hideOnDesktop?: boolean | undefined;
|
|
98
|
+
}
|
|
99
|
+
export interface GlobalFooterBottomBar {
|
|
100
|
+
enabled: boolean;
|
|
101
|
+
copyrightText?: string | undefined;
|
|
102
|
+
showSocialLinks?: boolean | undefined;
|
|
103
|
+
showPaymentIcons?: boolean | undefined;
|
|
104
|
+
backgroundColor?: string | undefined;
|
|
105
|
+
textColor?: string | undefined;
|
|
106
|
+
}
|
|
107
|
+
export interface GlobalFooterConfig {
|
|
108
|
+
schemaVersion: number;
|
|
109
|
+
enabled: boolean;
|
|
110
|
+
styling: GlobalFooterStyling;
|
|
111
|
+
responsive: GlobalFooterResponsive;
|
|
112
|
+
rows: FooterRow[];
|
|
113
|
+
bottomBar: GlobalFooterBottomBar;
|
|
114
|
+
}
|
|
115
|
+
export interface GlobalFooterPayload {
|
|
116
|
+
themeSlug: string;
|
|
117
|
+
config: GlobalFooterConfig;
|
|
118
|
+
version: number;
|
|
119
|
+
publishedVersion: number;
|
|
120
|
+
updatedAt?: string | null;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Generates an initial default global footer configuration.
|
|
124
|
+
*/
|
|
125
|
+
export declare function createDefaultGlobalFooterConfig(storeName?: string): GlobalFooterConfig;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Caartzee Theme SDK: Universal Dynamic Theme Hooks Contract
|
|
3
|
+
*
|
|
4
|
+
* Standardized extension slots across e-commerce storefronts.
|
|
5
|
+
* Theme developers insert `${ctx.hooks?.render('hook_name')}` into themes.
|
|
6
|
+
* Plugin developers declare `targetHook: 'hook_name'`.
|
|
7
|
+
* The Caartzee rendering engine resolves and injects them automatically at runtime.
|
|
8
|
+
*/
|
|
9
|
+
export type ThemeHookName = 'head_scripts' | 'body_start' | 'body_end' | 'header_actions' | 'header_announcement_before' | 'header_announcement_after' | 'footer_widgets_before' | 'footer_widgets_after' | 'footer_bottom' | 'login_form_top' | 'login_form_bottom' | 'signup_form_top' | 'signup_form_bottom' | 'product_price_after' | 'product_add_to_cart_before' | 'product_add_to_cart_after' | 'product_description_after' | 'product_reviews' | 'cart_items_after' | 'cart_drawer_bottom' | 'cart_summary_after' | 'checkout_payment_methods' | 'checkout_summary_after' | 'account_dashboard_top' | 'account_dashboard_bottom';
|
|
10
|
+
export interface ThemeHookSlot {
|
|
11
|
+
pluginSlug?: string | undefined;
|
|
12
|
+
content: string;
|
|
13
|
+
priority?: number | undefined;
|
|
14
|
+
}
|
|
15
|
+
export interface ThemeHooks {
|
|
16
|
+
/**
|
|
17
|
+
* Renders all plugin content registered for the specified hook name.
|
|
18
|
+
* If no plugins are registered for this hook, returns an empty string.
|
|
19
|
+
*/
|
|
20
|
+
render: (hookName: ThemeHookName) => string;
|
|
21
|
+
/**
|
|
22
|
+
* Checks whether any content exists for a given hook.
|
|
23
|
+
*/
|
|
24
|
+
has: (hookName: ThemeHookName) => boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Returns all raw slot entries registered for a given hook.
|
|
27
|
+
*/
|
|
28
|
+
get: (hookName: ThemeHookName) => ThemeHookSlot[];
|
|
29
|
+
/**
|
|
30
|
+
* Raw slots dictionary keyed by hook name.
|
|
31
|
+
*/
|
|
32
|
+
slots: Partial<Record<ThemeHookName, ThemeHookSlot[]>>;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Factory helper to construct a ThemeHooks instance with priority ordering and safe string joining.
|
|
36
|
+
*/
|
|
37
|
+
export declare function createThemeHooks(initialSlots?: Partial<Record<ThemeHookName, Array<ThemeHookSlot | string> | string>>): ThemeHooks;
|