@caartzee/theme-sdk 0.0.0-stage → 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.
Files changed (142) hide show
  1. package/README.md +34 -2
  2. package/dist/bin/caartzee-theme.js +7449 -0
  3. package/dist/lib/index.js +9838 -0
  4. package/dist/types/src/auth/credentials-store.d.ts +18 -0
  5. package/dist/types/src/auth/index.d.ts +2 -0
  6. package/dist/types/src/auth/oauth-client.d.ts +39 -0
  7. package/dist/types/src/blocks/block-contract.d.ts +242 -0
  8. package/dist/types/src/candy/compatibility-matrix.d.ts +10 -0
  9. package/dist/types/src/candy/context-builder.d.ts +31 -0
  10. package/dist/types/src/candy/engine.d.ts +69 -0
  11. package/dist/types/src/candy/filters.d.ts +32 -0
  12. package/dist/types/src/candy/ide-support.d.ts +20 -0
  13. package/dist/types/src/candy/index.d.ts +9 -0
  14. package/dist/types/src/candy/schema-parser.d.ts +13 -0
  15. package/dist/types/src/candy/security.d.ts +54 -0
  16. package/dist/types/src/candy/tags.d.ts +11 -0
  17. package/dist/types/src/candy/types.d.ts +185 -0
  18. package/dist/types/src/cli/caartzee-cli.d.ts +9 -0
  19. package/dist/types/src/cli/index.d.ts +1 -0
  20. package/dist/types/src/cli/sdk-client.d.ts +12 -0
  21. package/dist/types/src/contracts/category-selection.d.ts +15 -0
  22. package/dist/types/src/contracts/commerce.d.ts +282 -0
  23. package/dist/types/src/contracts/footer-builder.d.ts +125 -0
  24. package/dist/types/src/contracts/hooks.d.ts +37 -0
  25. package/dist/types/src/contracts/manifest.d.ts +3127 -0
  26. package/dist/types/src/contracts/navigation.d.ts +39 -0
  27. package/dist/types/src/contracts/order-tracking.d.ts +40 -0
  28. package/dist/types/src/contracts/page.d.ts +262 -0
  29. package/dist/types/src/contracts/storefront-content.d.ts +60 -0
  30. package/dist/types/src/contracts/style-document.d.ts +2 -0
  31. package/dist/types/src/contracts/styles.d.ts +2002 -0
  32. package/dist/types/src/contracts/theme.d.ts +35 -0
  33. package/dist/types/src/dev-server/catalog-preview.d.ts +25 -0
  34. package/dist/types/src/dev-server/dev-server.d.ts +22 -0
  35. package/dist/types/src/dev-server/index.d.ts +1 -0
  36. package/dist/types/src/dev-server/theme-preview.d.ts +4 -0
  37. package/dist/types/src/index.d.ts +27 -0
  38. package/dist/types/src/mock/index.d.ts +10 -0
  39. package/dist/types/src/mock/mock-categories.d.ts +2 -0
  40. package/dist/types/src/mock/mock-commerce.d.ts +55 -0
  41. package/dist/types/src/mock/mock-customer.d.ts +47 -0
  42. package/dist/types/src/mock/mock-hooks.d.ts +2 -0
  43. package/dist/types/src/mock/mock-products.d.ts +3 -0
  44. package/dist/types/src/rendering/commerce-pages.d.ts +16 -0
  45. package/dist/types/src/rendering/raw-html.d.ts +12 -0
  46. package/dist/types/src/rendering/section-wrapper.d.ts +30 -0
  47. package/dist/types/src/scaffold/candy-starter-assets.d.ts +2 -0
  48. package/dist/types/src/scaffold/commerce-generator.d.ts +3 -0
  49. package/dist/types/src/scaffold/index.d.ts +2 -0
  50. package/dist/types/src/scaffold/template-generator.d.ts +21 -0
  51. package/dist/types/src/sections/section-contract.d.ts +350 -0
  52. package/dist/types/src/settings/global-settings.d.ts +25 -0
  53. package/dist/types/src/templates/json-template.d.ts +991 -0
  54. package/dist/types/src/validation/package-validator.d.ts +53 -0
  55. package/dist/types/src/validation/rich-text.d.ts +24 -0
  56. package/package.json +28 -3
  57. package/templates/commerce/README.md +165 -0
  58. package/templates/commerce/assets/theme.css +1 -0
  59. package/templates/commerce/manifest.json +1 -0
  60. package/templates/commerce/src/blocks/index.ts +184 -0
  61. package/templates/commerce/src/config/settings-defaults.ts +25 -0
  62. package/templates/commerce/src/config/settings-schema.ts +102 -0
  63. package/templates/commerce/src/index.ts +90 -0
  64. package/templates/commerce/src/layouts/default.ts +275 -0
  65. package/templates/commerce/src/manifest.ts +976 -0
  66. package/templates/commerce/src/pages/account/components.ts +369 -0
  67. package/templates/commerce/src/pages/account/tabs.ts +792 -0
  68. package/templates/commerce/src/pages/account.ts +55 -0
  69. package/templates/commerce/src/pages/campaign.ts +423 -0
  70. package/templates/commerce/src/pages/cart.ts +261 -0
  71. package/templates/commerce/src/pages/category-detail.ts +124 -0
  72. package/templates/commerce/src/pages/category-list.ts +87 -0
  73. package/templates/commerce/src/pages/checkout.ts +712 -0
  74. package/templates/commerce/src/pages/commerce.ts +45 -0
  75. package/templates/commerce/src/pages/home.ts +160 -0
  76. package/templates/commerce/src/pages/index.ts +99 -0
  77. package/templates/commerce/src/pages/login.ts +204 -0
  78. package/templates/commerce/src/pages/order-success.ts +80 -0
  79. package/templates/commerce/src/pages/product-detail.ts +489 -0
  80. package/templates/commerce/src/pages/product-list.ts +125 -0
  81. package/templates/commerce/src/pages/search.ts +88 -0
  82. package/templates/commerce/src/pages/signup.ts +253 -0
  83. package/templates/commerce/src/pages/status.ts +7 -0
  84. package/templates/commerce/src/pages/theme-layout.ts +491 -0
  85. package/templates/commerce/src/pages/track-order.ts +196 -0
  86. package/templates/commerce/src/pages/wishlist.ts +83 -0
  87. package/templates/commerce/src/sections/about-story.ts +117 -0
  88. package/templates/commerce/src/sections/announcement-bar.ts +101 -0
  89. package/templates/commerce/src/sections/banner-grid.ts +319 -0
  90. package/templates/commerce/src/sections/campaign-banners.ts +158 -0
  91. package/templates/commerce/src/sections/category-slider.ts +144 -0
  92. package/templates/commerce/src/sections/content-builder.ts +123 -0
  93. package/templates/commerce/src/sections/content-controls.ts +45 -0
  94. package/templates/commerce/src/sections/custom-form.ts +59 -0
  95. package/templates/commerce/src/sections/faq-accordion.ts +123 -0
  96. package/templates/commerce/src/sections/footer.ts +728 -0
  97. package/templates/commerce/src/sections/header.ts +439 -0
  98. package/templates/commerce/src/sections/hero-slider.ts +492 -0
  99. package/templates/commerce/src/sections/hero.ts +137 -0
  100. package/templates/commerce/src/sections/index.ts +102 -0
  101. package/templates/commerce/src/sections/mobile-slider.ts +102 -0
  102. package/templates/commerce/src/sections/newsletter.ts +43 -0
  103. package/templates/commerce/src/sections/product-grid.ts +191 -0
  104. package/templates/commerce/src/sections/raw-html.ts +1 -0
  105. package/templates/commerce/src/sections/rich-text.ts +26 -0
  106. package/templates/commerce/src/sections/services-features.ts +211 -0
  107. package/templates/commerce/src/sections/testimonials.ts +194 -0
  108. package/templates/commerce/src/snippets/product-card.ts +178 -0
  109. package/templates/commerce/src/snippets/product-price.ts +46 -0
  110. package/templates/commerce/src/snippets/responsive-image.ts +29 -0
  111. package/templates/commerce/src/styles.ts +477 -0
  112. package/templates/commerce/src/templates/404.json +26 -0
  113. package/templates/commerce/src/templates/account.json +17 -0
  114. package/templates/commerce/src/templates/cart.json +17 -0
  115. package/templates/commerce/src/templates/category.json +16 -0
  116. package/templates/commerce/src/templates/checkout.json +15 -0
  117. package/templates/commerce/src/templates/collection.json +16 -0
  118. package/templates/commerce/src/templates/index.json +180 -0
  119. package/templates/commerce/src/templates/login.json +17 -0
  120. package/templates/commerce/src/templates/order-success.json +17 -0
  121. package/templates/commerce/src/templates/page.json +17 -0
  122. package/templates/commerce/src/templates/product.json +17 -0
  123. package/templates/commerce/src/templates/search.json +18 -0
  124. package/templates/commerce/src/templates/signup.json +17 -0
  125. package/templates/commerce/src/templates/track-order.json +17 -0
  126. package/templates/commerce/src/templates/wishlist.json +17 -0
  127. package/templates/commerce/src/templates.ts +510 -0
  128. package/templates/commerce/src/tokens.ts +22 -0
  129. package/templates/vscode-candy/README.md +22 -0
  130. package/templates/vscode-candy/extension.js +338 -0
  131. package/templates/vscode-candy/icons/candy-dark.svg +23 -0
  132. package/templates/vscode-candy/icons/candy-light.svg +23 -0
  133. package/templates/vscode-candy/icons/candy-logo.png +0 -0
  134. package/templates/vscode-candy/icons/candy-sweet-dark.svg +23 -0
  135. package/templates/vscode-candy/icons/candy-sweet-light.svg +23 -0
  136. package/templates/vscode-candy/language-configuration.json +47 -0
  137. package/templates/vscode-candy/package.json +103 -0
  138. package/templates/vscode-candy/schemas/candy-config.schema.json +56 -0
  139. package/templates/vscode-candy/schemas/candy-settings.schema.json +70 -0
  140. package/templates/vscode-candy/snippets/candy.code-snippets +179 -0
  141. package/templates/vscode-candy/syntaxes/candy.tmLanguage.json +296 -0
  142. package/templates/vscode-candy/vim/ftdetect/candy.vim +5 -0
@@ -0,0 +1,185 @@
1
+ import type { SectionManifest, SettingField, ThemeDesignTokens, ThemeManifest } from '../contracts/manifest';
2
+ import type { LayoutDocument, PageDocument } from '../contracts/page';
3
+ export declare const CANDY_LANGUAGE_VERSION = "1.0.0";
4
+ export type CompatibilityClassification = 'core' | 'shopify_compat' | 'candy_extension' | 'shopify_platform_unsupported';
5
+ export type ConformanceStatus = 'implemented_and_tested' | 'implemented_with_caartzee_semantics' | 'implemented_with_differences' | 'unsupported_platform_specific' | 'deferred';
6
+ export interface CompatibilityMatrixEntry {
7
+ name: string;
8
+ category: 'core_language' | 'tag' | 'filter' | 'object' | 'architecture' | 'caartzee_extension';
9
+ classification: CompatibilityClassification;
10
+ status: ConformanceStatus;
11
+ description: string;
12
+ notes?: string | undefined;
13
+ }
14
+ export interface CandyDiagnostic {
15
+ severity: 'error' | 'warning' | 'info';
16
+ code: string;
17
+ message: string;
18
+ file?: string | undefined;
19
+ line?: number | undefined;
20
+ column?: number | undefined;
21
+ }
22
+ export interface CandyEngineOptions {
23
+ rootDir?: string | undefined;
24
+ /**
25
+ * Virtual file system map where keys are relative paths like
26
+ * `layout/theme.candy`, `templates/index.candy`, `sections/hero-banner.candy`, `snippets/product-card.candy`
27
+ */
28
+ files?: Record<string, string> | undefined;
29
+ locales?: Record<string, Record<string, unknown>> | undefined;
30
+ defaultLocale?: string | undefined;
31
+ assetsBaseUrl?: string | undefined;
32
+ themeSlug?: string | undefined;
33
+ currencySymbol?: string | undefined;
34
+ currencyCode?: string | undefined;
35
+ currencyPosition?: 'left' | 'right' | undefined;
36
+ maxRenderDepth?: number | undefined;
37
+ maxLoopIterations?: number | undefined;
38
+ maxTemplateSizeBytes?: number | undefined;
39
+ maxOutputSizeBytes?: number | undefined;
40
+ parseTimeoutMs?: number | undefined;
41
+ renderTimeoutMs?: number | undefined;
42
+ memoryLimitBytes?: number | undefined;
43
+ strictVariables?: boolean | undefined;
44
+ strictFilters?: boolean | undefined;
45
+ sectionManifests?: Record<string, SectionManifest> | undefined;
46
+ }
47
+ export interface CandyRawSettingField {
48
+ id?: string | undefined;
49
+ type: string;
50
+ label?: string | undefined;
51
+ name?: string | undefined;
52
+ content?: string | undefined;
53
+ info?: string | undefined;
54
+ default?: unknown;
55
+ options?: Array<{
56
+ label: string;
57
+ value: string | number | boolean;
58
+ group?: string;
59
+ }> | undefined;
60
+ min?: number | undefined;
61
+ max?: number | undefined;
62
+ step?: number | undefined;
63
+ unit?: string | undefined;
64
+ required?: boolean | undefined;
65
+ placeholder?: string | undefined;
66
+ }
67
+ export interface CandyRawBlockSchema {
68
+ type: string;
69
+ name?: string | undefined;
70
+ label?: string | undefined;
71
+ limit?: number | undefined;
72
+ max?: number | undefined;
73
+ settings?: CandyRawSettingField[] | undefined;
74
+ }
75
+ export interface CandyRawPresetSchema {
76
+ name: string;
77
+ label?: string | undefined;
78
+ category?: string | undefined;
79
+ isDefault?: boolean | undefined;
80
+ settings?: Record<string, unknown> | undefined;
81
+ blocks?: Array<{
82
+ type: string;
83
+ settings?: Record<string, unknown> | undefined;
84
+ }> | undefined;
85
+ }
86
+ export interface CandyRawSectionSchema {
87
+ type?: string | undefined;
88
+ name?: string | undefined;
89
+ label?: string | undefined;
90
+ tag?: string | undefined;
91
+ class?: string | undefined;
92
+ category?: string | undefined;
93
+ limit?: number | undefined;
94
+ max_blocks?: number | undefined;
95
+ maxBlocks?: number | undefined;
96
+ allowedBlocks?: string[] | undefined;
97
+ allowedRegions?: Array<'header' | 'body' | 'footer'> | undefined;
98
+ enabled_on?: {
99
+ templates?: string[] | undefined;
100
+ groups?: string[] | undefined;
101
+ } | undefined;
102
+ disabled_on?: {
103
+ templates?: string[] | undefined;
104
+ groups?: string[] | undefined;
105
+ } | undefined;
106
+ settings?: CandyRawSettingField[] | undefined;
107
+ blocks?: CandyRawBlockSchema[] | undefined;
108
+ presets?: CandyRawPresetSchema[] | undefined;
109
+ default?: {
110
+ settings?: Record<string, unknown> | undefined;
111
+ blocks?: Array<{
112
+ type: string;
113
+ settings?: Record<string, unknown> | undefined;
114
+ }> | undefined;
115
+ } | undefined;
116
+ [key: string]: unknown;
117
+ }
118
+ export interface ExtractedCandySectionSchema {
119
+ sectionType: string;
120
+ rawSchema: CandyRawSectionSchema | null;
121
+ manifest: SectionManifest;
122
+ templateWithoutSchema: string;
123
+ diagnostics: CandyDiagnostic[];
124
+ schemaStartLine?: number | undefined;
125
+ schemaEndLine?: number | undefined;
126
+ }
127
+ export interface CandyConfig {
128
+ engine: 'candy';
129
+ candyVersion: string;
130
+ slug: string;
131
+ name: string;
132
+ version: string;
133
+ description?: string | undefined;
134
+ author?: string | undefined;
135
+ defaultLayout?: string | undefined;
136
+ directories?: {
137
+ layout?: string | undefined;
138
+ templates?: string | undefined;
139
+ sections?: string | undefined;
140
+ snippets?: string | undefined;
141
+ schemas?: string | undefined;
142
+ assets?: string | undefined;
143
+ locales?: string | undefined;
144
+ } | undefined;
145
+ tokens?: ThemeDesignTokens | undefined;
146
+ settingsSchema?: SettingField[] | undefined;
147
+ }
148
+ export interface CandyThemeBundle {
149
+ formatVersion: '1.0.0';
150
+ engine: 'candy';
151
+ candyVersion: string;
152
+ slug: string;
153
+ name: string;
154
+ version: string;
155
+ manifest: ThemeManifest;
156
+ tokens: ThemeDesignTokens;
157
+ config: CandyConfig;
158
+ /**
159
+ * Relative template path -> `.candy` source content
160
+ */
161
+ files: Record<string, string>;
162
+ /**
163
+ * Section type -> compiled Caartzee SectionManifest
164
+ */
165
+ sectionSchemas: Record<string, SectionManifest>;
166
+ /**
167
+ * Asset relative path (e.g., `theme.css`) -> asset content
168
+ */
169
+ assets: Record<string, string>;
170
+ /**
171
+ * Locale code (e.g., `en.default`) -> locale dictionary
172
+ */
173
+ locales: Record<string, Record<string, unknown>>;
174
+ defaultTemplates: {
175
+ layout: LayoutDocument;
176
+ pages: Record<string, PageDocument>;
177
+ };
178
+ builtAt: string;
179
+ }
180
+ export interface CandyValidationResult {
181
+ valid: boolean;
182
+ diagnostics: CandyDiagnostic[];
183
+ manifest?: ThemeManifest | undefined;
184
+ sectionSchemas?: Record<string, SectionManifest> | undefined;
185
+ }
@@ -0,0 +1,9 @@
1
+ export interface CliOptions {
2
+ args: string[];
3
+ stdout?: (msg: string) => void;
4
+ stderr?: (msg: string) => void;
5
+ }
6
+ export declare function runCli(rawArgs: string[], io?: {
7
+ stdout?: (msg: string) => void;
8
+ stderr?: (msg: string) => void;
9
+ }): Promise<number>;
@@ -0,0 +1 @@
1
+ export * from './caartzee-cli';
@@ -0,0 +1,12 @@
1
+ import { type DeveloperCredentials } from '../auth/credentials-store';
2
+ export declare function sdkEndpoint(value: string): string;
3
+ export declare function parseSdkConnection(input: string): {
4
+ api: string;
5
+ token: string;
6
+ };
7
+ export declare function sdkRequest<T>(endpoint: string, token: string, query: string, variables?: {}): Promise<T>;
8
+ export declare function connectSdk(endpoint: string, token: string): Promise<DeveloperCredentials>;
9
+ export declare function collectThemeSources(root: string): {
10
+ path: string;
11
+ content: string;
12
+ }[];
@@ -0,0 +1,15 @@
1
+ import type { StorefrontCategory } from './commerce';
2
+ /**
3
+ * Resolves a selected list of category identifiers against a tenant's authorized categories.
4
+ *
5
+ * Guarantees:
6
+ * 1. Tenant Isolation: Categories are matched ONLY against the provided `tenantCategories`
7
+ * belonging to the verified tenant. Cross-tenant IDs or foreign identifiers are discarded.
8
+ * 2. Order Preservation: Results follow the exact selection order specified by the merchant.
9
+ * 3. Empty Selection: An empty selection (`[]`, `undefined`, `null`) safely returns all
10
+ * tenant categories to preserve default theme section behavior.
11
+ * 4. Resilient & Non-Crashing: Unknown, deleted, or duplicate category IDs are safely handled.
12
+ * 5. Backward Compatibility: Transparently accepts arrays of strings/numbers, legacy single
13
+ * IDs, or comma-separated string formats.
14
+ */
15
+ export declare function resolveSelectedCategories(tenantCategories: StorefrontCategory[], selectedCategoryIds?: unknown): StorefrontCategory[];
@@ -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;