@caartzee/theme-sdk 1.0.0 → 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.
Files changed (50) hide show
  1. package/README.md +208 -20
  2. package/dist/bin/caartzee-theme.js +1855 -81
  3. package/dist/lib/index.js +1857 -81
  4. package/dist/types/src/blocks/block-contract.d.ts +10 -10
  5. package/dist/types/src/cli/candy-mcp.d.ts +2 -0
  6. package/dist/types/src/cli/candy-tool-server.d.ts +39 -0
  7. package/dist/types/src/cli/mcp/component-tools.d.ts +2 -0
  8. package/dist/types/src/cli/mcp/docs-tools.d.ts +89 -0
  9. package/dist/types/src/cli/mcp/editor-tools.d.ts +22 -0
  10. package/dist/types/src/cli/mcp/resources-and-prompts.d.ts +2 -0
  11. package/dist/types/src/cli/mcp/testing-tools.d.ts +54 -0
  12. package/dist/types/src/contracts/manifest.d.ts +77 -77
  13. package/dist/types/src/dev-server/dev-server.d.ts +3 -0
  14. package/dist/types/src/dev-server/local-commerce-runtime.d.ts +76 -0
  15. package/dist/types/src/dev-server/local-editor-server.d.ts +22 -0
  16. package/dist/types/src/dev-server/theme-preview.d.ts +6 -2
  17. package/dist/types/src/sections/section-contract.d.ts +12 -12
  18. package/package.json +2 -1
  19. package/templates/theme-candy-boilerplate/.editorconfig +14 -0
  20. package/templates/theme-candy-boilerplate/.gitattributes +1 -0
  21. package/templates/theme-candy-boilerplate/.vscode/extensions.json +7 -0
  22. package/templates/theme-candy-boilerplate/.vscode/settings.json +17 -0
  23. package/templates/theme-candy-boilerplate/assets/theme.css +78 -0
  24. package/templates/theme-candy-boilerplate/assets/theme.js +7 -0
  25. package/templates/theme-candy-boilerplate/candy.config.json +40 -0
  26. package/templates/theme-candy-boilerplate/index.ts +39 -0
  27. package/templates/theme-candy-boilerplate/layout/theme.candy +25 -0
  28. package/templates/theme-candy-boilerplate/locales/en.default.json +37 -0
  29. package/templates/theme-candy-boilerplate/manifest.json +123 -0
  30. package/templates/theme-candy-boilerplate/package.json +16 -0
  31. package/templates/theme-candy-boilerplate/schemas/settings_schema.json +36 -0
  32. package/templates/theme-candy-boilerplate/sections/featured-products.candy +89 -0
  33. package/templates/theme-candy-boilerplate/sections/footer.candy +50 -0
  34. package/templates/theme-candy-boilerplate/sections/header.candy +116 -0
  35. package/templates/theme-candy-boilerplate/sections/hero-banner.candy +135 -0
  36. package/templates/theme-candy-boilerplate/sections/image-with-text.candy +85 -0
  37. package/templates/theme-candy-boilerplate/snippets/price.candy +19 -0
  38. package/templates/theme-candy-boilerplate/snippets/product-card.candy +43 -0
  39. package/templates/theme-candy-boilerplate/templates/404.candy +12 -0
  40. package/templates/theme-candy-boilerplate/templates/cart.candy +51 -0
  41. package/templates/theme-candy-boilerplate/templates/collection.candy +51 -0
  42. package/templates/theme-candy-boilerplate/templates/index.candy +7 -0
  43. package/templates/theme-candy-boilerplate/templates/page.candy +10 -0
  44. package/templates/theme-candy-boilerplate/templates/product.candy +59 -0
  45. package/templates/theme-candy-boilerplate/templates/search.candy +40 -0
  46. package/templates/vscode-candy/LICENSE +21 -0
  47. package/templates/vscode-candy/extension.js +689 -338
  48. package/templates/vscode-candy/icons/candy-logo.png +0 -0
  49. package/templates/vscode-candy/package.json +18 -3
  50. package/templates/vscode-candy/snippets/candy.code-snippets +91 -0
@@ -5,6 +5,8 @@ export interface DevServerOptions {
5
5
  port?: number;
6
6
  themeDir?: string;
7
7
  host?: string;
8
+ editor?: boolean;
9
+ storeLabel?: string;
8
10
  loadTheme?: () => Promise<StorefrontThemeDefinition>;
9
11
  loadCatalog?: (request: PreviewCatalogRequest) => Promise<ThemePreviewCatalog>;
10
12
  }
@@ -12,6 +14,7 @@ export interface DevServerInstance {
12
14
  server: Server;
13
15
  port: number;
14
16
  url: string;
17
+ editorUrl: string;
15
18
  stop: () => Promise<void>;
16
19
  }
17
20
  export declare function createThemeDevServer(options?: DevServerOptions): DevServerInstance;
@@ -0,0 +1,76 @@
1
+ import type { IncomingMessage, ServerResponse } from 'node:http';
2
+ import type { StorefrontPageContext } from '../contracts/page';
3
+ export interface LocalCartItem {
4
+ id: string;
5
+ productId: string | number;
6
+ variantId: string | number | null;
7
+ title: string;
8
+ slug: string;
9
+ price: number;
10
+ imageUrl: string;
11
+ quantity: number;
12
+ }
13
+ export interface LocalCustomer {
14
+ id: string;
15
+ name: string;
16
+ firstName: string;
17
+ lastName: string;
18
+ email: string;
19
+ mobile?: string | undefined;
20
+ addresses: Array<{
21
+ id: string;
22
+ fullName: string;
23
+ address1: string;
24
+ city: string;
25
+ postalCode: string;
26
+ country: string;
27
+ }>;
28
+ }
29
+ export interface LocalOrder {
30
+ orderNumber: string;
31
+ status: 'placed' | 'processing' | 'shipped';
32
+ paymentMode: 'sandbox';
33
+ paymentGateway: 'caartzee_test_sandbox';
34
+ customerEmail: string;
35
+ shippingAddress: Record<string, string>;
36
+ shippingMethod: string;
37
+ subtotal: number;
38
+ discount: number;
39
+ tax: number;
40
+ shipping: number;
41
+ total: number;
42
+ items: LocalCartItem[];
43
+ createdAt: string;
44
+ }
45
+ export interface LocalCommerceSession {
46
+ sessionId: string;
47
+ cart: LocalCartItem[];
48
+ couponCode: string | null;
49
+ shippingMethod: 'standard' | 'express';
50
+ wishlist: Array<string | number>;
51
+ customer: LocalCustomer | null;
52
+ registeredUsers: Map<string, {
53
+ password: string;
54
+ customer: LocalCustomer;
55
+ }>;
56
+ orders: LocalOrder[];
57
+ }
58
+ export declare class LocalCommerceStore {
59
+ private sessions;
60
+ getOrCreateSession(req: IncomingMessage, res: ServerResponse): LocalCommerceSession;
61
+ computeTotals(session: LocalCommerceSession): {
62
+ subtotal: number;
63
+ discount: number;
64
+ shipping: number;
65
+ tax: number;
66
+ total: number;
67
+ itemCount: number;
68
+ };
69
+ applySessionToContext(session: LocalCommerceSession, context: StorefrontPageContext): StorefrontPageContext;
70
+ handleApiRequest(req: IncomingMessage, res: ServerResponse, pathname: string, searchParams: URLSearchParams, resolveCatalogProducts: () => Promise<any[]>): Promise<boolean>;
71
+ }
72
+ export declare function buildStorefrontShellRuntimeScript(options: {
73
+ mode: 'demo' | 'merchant-sandbox';
74
+ storeLabel?: string | undefined;
75
+ editorEnabled?: boolean | undefined;
76
+ }): string;
@@ -0,0 +1,22 @@
1
+ import type { IncomingMessage, ServerResponse } from 'node:http';
2
+ import type { StorefrontThemeDefinition } from '../contracts/theme';
3
+ import type { LayoutDocument, SectionNode, StorefrontPageContext } from '../contracts/page';
4
+ export interface LocalEditorDraftState {
5
+ layout: LayoutDocument;
6
+ bodySections: SectionNode[];
7
+ globalSettings: Record<string, unknown>;
8
+ publishedLayout: LayoutDocument | null;
9
+ publishedBodySections: SectionNode[] | null;
10
+ publishedGlobalSettings: Record<string, unknown> | null;
11
+ version: number;
12
+ }
13
+ export declare class LocalThemeEditorState {
14
+ private state;
15
+ ensureInitialized(theme: StorefrontThemeDefinition): LocalEditorDraftState;
16
+ getEffectiveConfig(theme: StorefrontThemeDefinition, mode?: 'draft' | 'published'): {
17
+ layout: LayoutDocument;
18
+ bodySections: SectionNode[];
19
+ globalSettings: Record<string, unknown>;
20
+ };
21
+ handleRequest(req: IncomingMessage, res: ServerResponse, pathname: string, theme: StorefrontThemeDefinition, buildContext: (pageType: StorefrontPageContext['pageType']) => Promise<StorefrontPageContext>): Promise<boolean>;
22
+ }
@@ -1,4 +1,8 @@
1
1
  import type { StorefrontThemeDefinition } from '../contracts/theme';
2
- import type { StorefrontPageContext } from '../contracts/page';
2
+ import type { LayoutDocument, StorefrontPageContext, SectionNode } from '../contracts/page';
3
3
  /** Local trusted code only. Uploaded third-party packages are never executed by this renderer. */
4
- export declare function renderThemePreview(theme: StorefrontThemeDefinition, context: StorefrontPageContext, preferContextSettings?: boolean): string;
4
+ export declare function renderThemePreview(theme: StorefrontThemeDefinition, context: StorefrontPageContext, preferContextSettings?: boolean, editorOverride?: {
5
+ layout: LayoutDocument;
6
+ bodySections: SectionNode[];
7
+ globalSettings: Record<string, unknown>;
8
+ }): string;
@@ -14,7 +14,7 @@ export declare const SectionContractSchema: z.ZodObject<{
14
14
  allowedTemplates: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
15
15
  settings: z.ZodOptional<z.ZodArray<z.ZodObject<{
16
16
  id: z.ZodString;
17
- type: z.ZodEnum<["text", "textarea", "richtext", "inline_richtext", "header", "paragraph", "number", "boolean", "checkbox", "radio", "color", "image", "select", "range", "url", "json", "code", "javascript", "category_list", "product_picker", "collection_picker", "font", "spacing"]>;
17
+ type: z.ZodEnum<["text", "textarea", "richtext", "inline_richtext", "header", "paragraph", "number", "boolean", "checkbox", "radio", "color", "image", "image_picker", "select", "range", "url", "json", "code", "javascript", "category_list", "product_picker", "collection_picker", "font", "spacing"]>;
18
18
  label: z.ZodString;
19
19
  default: z.ZodOptional<z.ZodUnknown>;
20
20
  options: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -34,7 +34,7 @@ export declare const SectionContractSchema: z.ZodObject<{
34
34
  placeholder: z.ZodOptional<z.ZodString>;
35
35
  }, "strip", z.ZodTypeAny, {
36
36
  id: string;
37
- type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
37
+ type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "image_picker" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
38
38
  label: string;
39
39
  options?: {
40
40
  value: string | number | boolean;
@@ -48,7 +48,7 @@ export declare const SectionContractSchema: z.ZodObject<{
48
48
  placeholder?: string | undefined;
49
49
  }, {
50
50
  id: string;
51
- type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
51
+ type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "image_picker" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
52
52
  label: string;
53
53
  options?: {
54
54
  value: string | number | boolean;
@@ -67,7 +67,7 @@ export declare const SectionContractSchema: z.ZodObject<{
67
67
  max: z.ZodOptional<z.ZodNumber>;
68
68
  settings: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
69
69
  id: z.ZodString;
70
- type: z.ZodEnum<["text", "textarea", "richtext", "inline_richtext", "header", "paragraph", "number", "boolean", "checkbox", "radio", "color", "image", "select", "range", "url", "json", "code", "javascript", "category_list", "product_picker", "collection_picker", "font", "spacing"]>;
70
+ type: z.ZodEnum<["text", "textarea", "richtext", "inline_richtext", "header", "paragraph", "number", "boolean", "checkbox", "radio", "color", "image", "image_picker", "select", "range", "url", "json", "code", "javascript", "category_list", "product_picker", "collection_picker", "font", "spacing"]>;
71
71
  label: z.ZodString;
72
72
  default: z.ZodOptional<z.ZodUnknown>;
73
73
  options: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -87,7 +87,7 @@ export declare const SectionContractSchema: z.ZodObject<{
87
87
  placeholder: z.ZodOptional<z.ZodString>;
88
88
  }, "strip", z.ZodTypeAny, {
89
89
  id: string;
90
- type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
90
+ type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "image_picker" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
91
91
  label: string;
92
92
  options?: {
93
93
  value: string | number | boolean;
@@ -101,7 +101,7 @@ export declare const SectionContractSchema: z.ZodObject<{
101
101
  placeholder?: string | undefined;
102
102
  }, {
103
103
  id: string;
104
- type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
104
+ type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "image_picker" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
105
105
  label: string;
106
106
  options?: {
107
107
  value: string | number | boolean;
@@ -118,7 +118,7 @@ export declare const SectionContractSchema: z.ZodObject<{
118
118
  type: string;
119
119
  settings: {
120
120
  id: string;
121
- type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
121
+ type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "image_picker" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
122
122
  label: string;
123
123
  options?: {
124
124
  value: string | number | boolean;
@@ -138,7 +138,7 @@ export declare const SectionContractSchema: z.ZodObject<{
138
138
  label: string;
139
139
  settings?: {
140
140
  id: string;
141
- type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
141
+ type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "image_picker" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
142
142
  label: string;
143
143
  options?: {
144
144
  value: string | number | boolean;
@@ -192,7 +192,7 @@ export declare const SectionContractSchema: z.ZodObject<{
192
192
  type: string;
193
193
  settings?: {
194
194
  id: string;
195
- type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
195
+ type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "image_picker" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
196
196
  label: string;
197
197
  options?: {
198
198
  value: string | number | boolean;
@@ -209,7 +209,7 @@ export declare const SectionContractSchema: z.ZodObject<{
209
209
  type: string;
210
210
  settings: {
211
211
  id: string;
212
- type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
212
+ type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "image_picker" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
213
213
  label: string;
214
214
  options?: {
215
215
  value: string | number | boolean;
@@ -250,7 +250,7 @@ export declare const SectionContractSchema: z.ZodObject<{
250
250
  type: string;
251
251
  settings?: {
252
252
  id: string;
253
- type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
253
+ type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "image_picker" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
254
254
  label: string;
255
255
  options?: {
256
256
  value: string | number | boolean;
@@ -268,7 +268,7 @@ export declare const SectionContractSchema: z.ZodObject<{
268
268
  label: string;
269
269
  settings?: {
270
270
  id: string;
271
- type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
271
+ type: "number" | "boolean" | "code" | "header" | "text" | "textarea" | "richtext" | "inline_richtext" | "paragraph" | "checkbox" | "radio" | "color" | "image" | "image_picker" | "select" | "range" | "url" | "json" | "javascript" | "category_list" | "product_picker" | "collection_picker" | "font" | "spacing";
272
272
  label: string;
273
273
  options?: {
274
274
  value: string | number | boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caartzee/theme-sdk",
3
- "version": "1.0.0",
3
+ "version": "1.2.0",
4
4
  "description": "Standardized Theme SDK for Caartzee Storefront Themes",
5
5
  "type": "module",
6
6
  "main": "./dist/lib/index.js",
@@ -16,6 +16,7 @@
16
16
  "caartzee": "./dist/bin/caartzee-theme.js"
17
17
  },
18
18
  "dependencies": {
19
+ "@modelcontextprotocol/sdk": "1",
19
20
  "liquidjs": "^10.30.0",
20
21
  "zod": "^3.24.1"
21
22
  },
@@ -0,0 +1,14 @@
1
+ root = true
2
+
3
+ [*]
4
+ charset = utf-8
5
+ end_of_line = lf
6
+ insert_final_newline = true
7
+ trim_trailing_whitespace = true
8
+ indent_style = space
9
+ indent_size = 2
10
+
11
+ [*.candy]
12
+ indent_style = space
13
+ indent_size = 2
14
+ charset = utf-8
@@ -0,0 +1 @@
1
+ *.candy text eol=lf linguist-language=Liquid
@@ -0,0 +1,7 @@
1
+ {
2
+ "recommendations": [
3
+ "caartzee.candy-language-support",
4
+ "shopify.theme-check-vscode",
5
+ "sissel.shopify-liquid"
6
+ ]
7
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "files.associations": {
3
+ "*.candy": "candy",
4
+ "candy.config.json": "json",
5
+ "**/schemas/*.json": "json"
6
+ },
7
+ "emmet.includeLanguages": {
8
+ "candy": "html",
9
+ "liquid": "html"
10
+ },
11
+ "[candy]": {
12
+ "editor.tabSize": 2,
13
+ "editor.insertSpaces": true,
14
+ "editor.bracketPairColorization.enabled": true,
15
+ "editor.guides.bracketPairs": "active"
16
+ }
17
+ }
@@ -0,0 +1,78 @@
1
+ :root {
2
+ --color-primary: #0f172a;
3
+ --color-accent: #4f46e5;
4
+ --color-background: #ffffff;
5
+ --color-surface: #f8fafc;
6
+ --color-text: #0f172a;
7
+ --color-muted: #64748b;
8
+ --color-border: #e2e8f0;
9
+ --font-heading: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
10
+ --font-body: 'Inter', system-ui, -apple-system, sans-serif;
11
+ }
12
+
13
+ * {
14
+ box-sizing: border-box;
15
+ }
16
+
17
+ body.candy-theme-body {
18
+ margin: 0;
19
+ font-family: var(--font-body);
20
+ background-color: var(--color-background);
21
+ color: var(--color-text);
22
+ line-height: 1.6;
23
+ }
24
+
25
+ .candy-container {
26
+ max-width: 1280px;
27
+ margin: 0 auto;
28
+ padding: 0 24px;
29
+ }
30
+
31
+ .candy-btn {
32
+ display: inline-flex;
33
+ align-items: center;
34
+ justify-content: center;
35
+ padding: 12px 28px;
36
+ border-radius: 8px;
37
+ background-color: var(--color-accent);
38
+ color: #ffffff;
39
+ font-weight: 700;
40
+ font-size: 15px;
41
+ text-decoration: none;
42
+ border: none;
43
+ cursor: pointer;
44
+ transition: opacity 0.15s ease;
45
+ }
46
+
47
+ .candy-btn:hover {
48
+ opacity: 0.92;
49
+ }
50
+
51
+ .candy-product-grid {
52
+ display: grid;
53
+ grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
54
+ gap: 24px;
55
+ }
56
+
57
+ .candy-product-card {
58
+ background: #ffffff;
59
+ border: 1px solid var(--color-border);
60
+ border-radius: 12px;
61
+ overflow: hidden;
62
+ padding: 16px;
63
+ display: flex;
64
+ flex-direction: column;
65
+ }
66
+
67
+ .candy-price {
68
+ display: flex;
69
+ align-items: baseline;
70
+ gap: 8px;
71
+ font-weight: 700;
72
+ }
73
+
74
+ .candy-price__compare {
75
+ color: var(--color-muted);
76
+ text-decoration: line-through;
77
+ font-size: 0.9em;
78
+ }
@@ -0,0 +1,7 @@
1
+ (function () {
2
+ if (typeof window === 'undefined') return;
3
+ window.__CAARTZEE_CANDY_THEME__ = {
4
+ version: '1.0.0',
5
+ initializedAt: Date.now(),
6
+ };
7
+ })();
@@ -0,0 +1,40 @@
1
+ {
2
+ "engine": "candy",
3
+ "candyVersion": "1.0.0",
4
+ "slug": "candy-starter",
5
+ "name": "Candy Starter Theme",
6
+ "version": "1.0.0",
7
+ "author": "Caartzee",
8
+ "description": "Official Caartzee starter theme built with the .candy Liquid-compatible template language.",
9
+ "defaultLayout": "theme",
10
+ "directories": {
11
+ "layout": "layout",
12
+ "templates": "templates",
13
+ "sections": "sections",
14
+ "snippets": "snippets",
15
+ "schemas": "schemas",
16
+ "assets": "assets",
17
+ "locales": "locales"
18
+ },
19
+ "tokens": {
20
+ "colors": {
21
+ "primary": "#0f172a",
22
+ "accent": "#4f46e5",
23
+ "background": "#ffffff",
24
+ "surface": "#f8fafc",
25
+ "text": "#0f172a",
26
+ "muted": "#64748b",
27
+ "border": "#e2e8f0"
28
+ },
29
+ "typography": {
30
+ "headingFont": "'Plus Jakarta Sans', system-ui, -apple-system, sans-serif",
31
+ "bodyFont": "'Inter', system-ui, -apple-system, sans-serif"
32
+ },
33
+ "borderRadius": {
34
+ "sm": "6px",
35
+ "md": "10px",
36
+ "lg": "16px",
37
+ "full": "9999px"
38
+ }
39
+ }
40
+ }
@@ -0,0 +1,39 @@
1
+ import { existsSync } from 'node:fs';
2
+ import { dirname, join, resolve } from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+ import {
5
+ createCandyStorefrontTheme,
6
+ loadCandyThemeFromDirectory,
7
+ type CandyThemeBundle,
8
+ type StorefrontThemeDefinition,
9
+ } from '@caartzee/theme-sdk';
10
+
11
+ function resolveBoilerplateDir(): string {
12
+ try {
13
+ const fileDir = dirname(fileURLToPath(import.meta.url));
14
+ if (existsSync(join(fileDir, 'candy.config.json'))) {
15
+ return resolve(fileDir);
16
+ }
17
+ } catch {
18
+ // Fallback below
19
+ }
20
+ const cwdCandidate = resolve(process.cwd(), 'packages/theme-candy-boilerplate');
21
+ if (existsSync(join(cwdCandidate, 'candy.config.json'))) {
22
+ return cwdCandidate;
23
+ }
24
+ const parentCandidate = resolve(process.cwd(), '../theme-candy-boilerplate');
25
+ if (existsSync(join(parentCandidate, 'candy.config.json'))) {
26
+ return parentCandidate;
27
+ }
28
+ return cwdCandidate;
29
+ }
30
+
31
+ export const CANDY_BOILERPLATE_DIR = resolveBoilerplateDir();
32
+
33
+ const loaded = loadCandyThemeFromDirectory(CANDY_BOILERPLATE_DIR);
34
+
35
+ export const candyStarterBundle: CandyThemeBundle = loaded.bundle;
36
+ export const candyStarterManifest = loaded.bundle.manifest;
37
+ export const candyStarterTheme: StorefrontThemeDefinition = createCandyStorefrontTheme(loaded.bundle);
38
+
39
+ export default candyStarterTheme;
@@ -0,0 +1,25 @@
1
+ <!DOCTYPE html>
2
+ <html lang="{{ request.locale.iso_code | default: 'en' }}">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>{{ page_title | escape }}{% if shop.name and page_title != shop.name %} &ndash; {{ shop.name | escape }}{% endif %}</title>
7
+ {{ 'theme.css' | asset_url | stylesheet_tag }}
8
+ {{ content_for_header }}
9
+ </head>
10
+ <body class="candy-theme-body template-{{ template.name | handleize }}" data-theme-engine="candy">
11
+ <a class="skip-to-content-link" href="#MainContent" style="position: absolute; left: -9999px;">
12
+ {{ 'general.accessibility.skip_to_text' | t }}
13
+ </a>
14
+
15
+ {% section 'header' %}
16
+
17
+ <main id="MainContent" class="candy-main-content" role="main" tabindex="-1">
18
+ {{ content_for_layout }}
19
+ </main>
20
+
21
+ {% section 'footer' %}
22
+
23
+ {{ 'theme.js' | asset_url | script_tag }}
24
+ </body>
25
+ </html>
@@ -0,0 +1,37 @@
1
+ {
2
+ "general": {
3
+ "search": {
4
+ "title": "Search our store",
5
+ "placeholder": "Search products, collections...",
6
+ "submit": "Search",
7
+ "no_results": "No results found for \"{{ terms }}\".",
8
+ "results_with_count": {
9
+ "zero": "No results found for \"{{ terms }}\"",
10
+ "one": "1 result found for \"{{ terms }}\"",
11
+ "other": "{{ count }} results found for \"{{ terms }}\""
12
+ }
13
+ },
14
+ "accessibility": {
15
+ "skip_to_text": "Skip to content"
16
+ }
17
+ },
18
+ "products": {
19
+ "product": {
20
+ "add_to_cart": "Add to Cart",
21
+ "sold_out": "Sold Out",
22
+ "on_sale": "Sale",
23
+ "view_details": "View Product",
24
+ "quantity": "Quantity",
25
+ "sku": "SKU"
26
+ }
27
+ },
28
+ "sections": {
29
+ "cart": {
30
+ "title": "Your Shopping Bag",
31
+ "empty": "Your shopping bag is currently empty.",
32
+ "continue_shopping": "Continue Shopping",
33
+ "subtotal": "Subtotal",
34
+ "checkout": "Proceed to Checkout"
35
+ }
36
+ }
37
+ }