@caartzee/theme-sdk 1.0.0 → 1.2.1
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 +208 -20
- package/dist/bin/caartzee-theme.js +2272 -87
- package/dist/lib/index.js +2274 -87
- package/dist/types/src/blocks/block-contract.d.ts +10 -10
- 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/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/mcp/ui-patterns-tools.d.ts +26 -0
- package/dist/types/src/cli/mcp/v2-commerce-tools.d.ts +16 -0
- package/dist/types/src/contracts/manifest.d.ts +77 -77
- package/dist/types/src/dev-server/dev-server.d.ts +3 -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 +6 -2
- package/dist/types/src/scaffold/design-presets.d.ts +41 -0
- package/dist/types/src/scaffold/template-generator.d.ts +2 -0
- package/dist/types/src/sections/section-contract.d.ts +12 -12
- package/package.json +2 -1
- 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/extension.js +689 -338
- package/templates/vscode-candy/icons/candy-logo.png +0 -0
- package/templates/vscode-candy/package.json +18 -3
- package/templates/vscode-candy/snippets/candy.code-snippets +91 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{% doc %}
|
|
2
|
+
Renders a product card inside product grids and search results.
|
|
3
|
+
Accepts:
|
|
4
|
+
- product: {Object} Product drop
|
|
5
|
+
- show_vendor: {Boolean} Optional flag to show vendor name
|
|
6
|
+
{% enddoc %}
|
|
7
|
+
<article class="candy-product-card" data-product-id="{{ product.id }}" data-product-handle="{{ product.handle }}">
|
|
8
|
+
<a href="{{ product.url }}" class="candy-product-card__media" style="display: block; text-decoration: none; margin-bottom: 12px;">
|
|
9
|
+
<img
|
|
10
|
+
src="{{ product.featured_image | image_url: width: 600 }}"
|
|
11
|
+
alt="{{ product.title | escape }}"
|
|
12
|
+
loading="lazy"
|
|
13
|
+
style="width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 8px; background: #f1f5f9;"
|
|
14
|
+
/>
|
|
15
|
+
</a>
|
|
16
|
+
|
|
17
|
+
{% if show_vendor and product.vendor %}
|
|
18
|
+
<div class="candy-product-card__vendor" style="font-size: 12px; color: #64748b; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px;">
|
|
19
|
+
{{ product.vendor | escape }}
|
|
20
|
+
</div>
|
|
21
|
+
{% endif %}
|
|
22
|
+
|
|
23
|
+
<h3 class="candy-product-card__title" style="font-size: 16px; font-weight: 700; margin: 0 0 8px;">
|
|
24
|
+
<a href="{{ product.url }}" style="color: #0f172a; text-decoration: none;">
|
|
25
|
+
{{ product.title | escape }}
|
|
26
|
+
</a>
|
|
27
|
+
</h3>
|
|
28
|
+
|
|
29
|
+
<div style="margin-top: auto; padding-top: 8px;">
|
|
30
|
+
{% render 'price', product: product %}
|
|
31
|
+
<a
|
|
32
|
+
href="{{ product.url }}"
|
|
33
|
+
class="candy-btn"
|
|
34
|
+
style="display: block; width: 100%; text-align: center; margin-top: 12px; padding: 10px 16px; background: #0f172a; color: #ffffff; border-radius: 6px; font-size: 13px; font-weight: 600; text-decoration: none;"
|
|
35
|
+
>
|
|
36
|
+
{% if product.available %}
|
|
37
|
+
{{ 'products.product.view_details' | t }}
|
|
38
|
+
{% else %}
|
|
39
|
+
{{ 'products.product.sold_out' | t }}
|
|
40
|
+
{% endif %}
|
|
41
|
+
</a>
|
|
42
|
+
</div>
|
|
43
|
+
</article>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{% layout 'theme' %}
|
|
2
|
+
|
|
3
|
+
<section class="candy-section candy-not-found" style="text-align: center; padding: 80px 0;">
|
|
4
|
+
<div class="candy-container" style="max-width: 560px; margin: 0 auto;">
|
|
5
|
+
<p class="candy-eyebrow">404</p>
|
|
6
|
+
<h1 class="candy-section__title">{{ page_title | default: 'Page Not Found' | escape }}</h1>
|
|
7
|
+
<p class="candy-section__subtitle" style="margin-bottom: 24px;">
|
|
8
|
+
{{ page.content | default: 'The page you are looking for does not exist or has been moved.' | escape }}
|
|
9
|
+
</p>
|
|
10
|
+
<a href="{{ routes.root_url }}" class="candy-btn candy-btn--primary">Back to Home</a>
|
|
11
|
+
</div>
|
|
12
|
+
</section>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{% layout 'theme' %}
|
|
2
|
+
|
|
3
|
+
<section class="cz-candy-cart candy-container" style="padding-top: 48px; padding-bottom: 64px;">
|
|
4
|
+
<h1 style="font-size: 32px; font-weight: 800; color: #0f172a; margin: 0 0 32px;">
|
|
5
|
+
{{ 'sections.cart.title' | t }}
|
|
6
|
+
</h1>
|
|
7
|
+
|
|
8
|
+
{% if cart.item_count > 0 %}
|
|
9
|
+
<div class="cz-candy-cart__items" style="border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; margin-bottom: 24px;">
|
|
10
|
+
{% for item in cart.items %}
|
|
11
|
+
<div
|
|
12
|
+
class="cz-candy-cart__item"
|
|
13
|
+
style="display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 24px; border-bottom: 1px solid #e2e8f0;"
|
|
14
|
+
>
|
|
15
|
+
<div>
|
|
16
|
+
<a href="{{ item.url }}" style="font-size: 16px; font-weight: 700; color: #0f172a; text-decoration: none;">
|
|
17
|
+
{{ item.title | escape }}
|
|
18
|
+
</a>
|
|
19
|
+
<div style="font-size: 13px; color: #64748b;">
|
|
20
|
+
Qty: {{ item.quantity }} × {{ item.price | money }}
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
<div style="font-size: 16px; font-weight: 800; color: #0f172a;">
|
|
24
|
+
{{ item.line_price | money }}
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
{% endfor %}
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<div style="display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; background: #f8fafc; border-radius: 12px;">
|
|
31
|
+
<div>
|
|
32
|
+
<span style="font-size: 14px; color: #64748b;">{{ 'sections.cart.subtotal' | t }}:</span>
|
|
33
|
+
<strong style="font-size: 20px; font-weight: 800; color: #0f172a; margin-left: 8px;">
|
|
34
|
+
{{ cart.total_price | money }}
|
|
35
|
+
</strong>
|
|
36
|
+
</div>
|
|
37
|
+
<a href="/checkout" class="candy-btn">
|
|
38
|
+
{{ 'sections.cart.checkout' | t }}
|
|
39
|
+
</a>
|
|
40
|
+
</div>
|
|
41
|
+
{% else %}
|
|
42
|
+
<div style="text-align: center; padding: 48px 24px; background: #f8fafc; border-radius: 12px; border: 1px solid #e2e8f0;">
|
|
43
|
+
<p style="font-size: 16px; color: #64748b; margin: 0 0 20px;">
|
|
44
|
+
{{ 'sections.cart.empty' | t }}
|
|
45
|
+
</p>
|
|
46
|
+
<a href="{{ routes.all_products_collection_url }}" class="candy-btn">
|
|
47
|
+
{{ 'sections.cart.continue_shopping' | t }}
|
|
48
|
+
</a>
|
|
49
|
+
</div>
|
|
50
|
+
{% endif %}
|
|
51
|
+
</section>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{% layout 'theme' %}
|
|
2
|
+
|
|
3
|
+
<section class="cz-candy-collection candy-container" style="padding-top: 48px; padding-bottom: 64px;">
|
|
4
|
+
<header style="margin-bottom: 36px; text-align: center;">
|
|
5
|
+
<h1 style="font-size: 36px; font-weight: 800; color: #0f172a; margin: 0 0 8px;">
|
|
6
|
+
{{ collection.title | default: 'All Products' | escape }}
|
|
7
|
+
</h1>
|
|
8
|
+
{% if collection.description != blank %}
|
|
9
|
+
<p style="font-size: 16px; color: #64748b; max-width: 640px; margin: 0 auto;">
|
|
10
|
+
{{ collection.description | escape }}
|
|
11
|
+
</p>
|
|
12
|
+
{% endif %}
|
|
13
|
+
|
|
14
|
+
{% if categories.size > 0 %}
|
|
15
|
+
<div style="display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 20px;">
|
|
16
|
+
<a
|
|
17
|
+
href="/collections/all"
|
|
18
|
+
style="padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; text-decoration: none; {% if collection.handle == 'all' %}background: #4f46e5; color: #ffffff;{% else %}background: #f1f5f9; color: #334155;{% endif %}"
|
|
19
|
+
>
|
|
20
|
+
All Products
|
|
21
|
+
</a>
|
|
22
|
+
{% for cat in categories limit: 10 %}
|
|
23
|
+
<a
|
|
24
|
+
href="/collections/{{ cat.handle }}"
|
|
25
|
+
style="padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; text-decoration: none; {% if collection.handle == cat.handle %}background: #4f46e5; color: #ffffff;{% else %}background: #f1f5f9; color: #334155;{% endif %}"
|
|
26
|
+
>
|
|
27
|
+
{{ cat.title | escape }} ({{ cat.products_count }})
|
|
28
|
+
</a>
|
|
29
|
+
{% endfor %}
|
|
30
|
+
</div>
|
|
31
|
+
{% endif %}
|
|
32
|
+
</header>
|
|
33
|
+
|
|
34
|
+
{% paginate collection.products by 12 %}
|
|
35
|
+
<div class="candy-product-grid">
|
|
36
|
+
{% for product in collection.products %}
|
|
37
|
+
{% render 'product-card', product: product %}
|
|
38
|
+
{% else %}
|
|
39
|
+
<p style="grid-column: 1 / -1; text-align: center; color: #64748b; padding: 40px 0;">
|
|
40
|
+
No products found.
|
|
41
|
+
</p>
|
|
42
|
+
{% endfor %}
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
{% if paginate.pages > 1 %}
|
|
46
|
+
<div style="margin-top: 40px; text-align: center;">
|
|
47
|
+
{{ paginate | default_pagination }}
|
|
48
|
+
</div>
|
|
49
|
+
{% endif %}
|
|
50
|
+
{% endpaginate %}
|
|
51
|
+
</section>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{% layout 'theme' %}
|
|
2
|
+
|
|
3
|
+
<section class="candy-section candy-custom-page">
|
|
4
|
+
<div class="candy-container" style="max-width: 820px; margin: 0 auto;">
|
|
5
|
+
<h1 class="candy-section__title">{{ page.title | default: page_title | escape }}</h1>
|
|
6
|
+
<div class="candy-page__content">
|
|
7
|
+
{{ page.content }}
|
|
8
|
+
</div>
|
|
9
|
+
</div>
|
|
10
|
+
</section>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{% layout 'theme' %}
|
|
2
|
+
|
|
3
|
+
<section class="cz-candy-product-detail candy-container" style="padding-top: 48px; padding-bottom: 64px;" data-product-id="{{ product.id }}">
|
|
4
|
+
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 48px; align-items: start;">
|
|
5
|
+
<div class="cz-candy-product-detail__gallery">
|
|
6
|
+
<img
|
|
7
|
+
src="{{ product.featured_image | image_url: width: 900 }}"
|
|
8
|
+
alt="{{ product.title | escape }}"
|
|
9
|
+
style="width: 100%; border-radius: 12px; object-fit: cover; aspect-ratio: 1 / 1; background: #f8fafc; border: 1px solid #e2e8f0;"
|
|
10
|
+
/>
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
<div class="cz-candy-product-detail__info">
|
|
14
|
+
{% if product.vendor %}
|
|
15
|
+
<div style="font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #64748b; margin-bottom: 8px;">
|
|
16
|
+
{{ product.vendor | escape }}
|
|
17
|
+
</div>
|
|
18
|
+
{% endif %}
|
|
19
|
+
|
|
20
|
+
<h1 style="font-size: 32px; font-weight: 800; color: #0f172a; margin: 0 0 16px;">
|
|
21
|
+
{{ product.title | escape }}
|
|
22
|
+
</h1>
|
|
23
|
+
|
|
24
|
+
<div style="margin-bottom: 24px;">
|
|
25
|
+
{% render 'price', product: product %}
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<div class="cz-candy-product-detail__availability" style="margin-bottom: 20px; font-size: 14px; font-weight: 600;">
|
|
29
|
+
{% if product.available %}
|
|
30
|
+
<span style="color: #16a34a;">Available</span>
|
|
31
|
+
{% elsif product.inventory_quantity > 0 %}
|
|
32
|
+
<span style="color: #d97706;">Limited stock</span>
|
|
33
|
+
{% else %}
|
|
34
|
+
<span style="color: #dc2626;">Unavailable</span>
|
|
35
|
+
{% endif %}
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<div class="cz-candy-product-detail__description" style="font-size: 15px; color: #475569; line-height: 1.7; margin-bottom: 28px;">
|
|
39
|
+
{{ product.description | strip_html | escape }}
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
{% form 'product', product, class: 'cz-candy-product-form' %}
|
|
43
|
+
<input type="hidden" name="id" value="{{ product.selected_or_first_available_variant.id }}" />
|
|
44
|
+
<button
|
|
45
|
+
type="submit"
|
|
46
|
+
class="candy-btn"
|
|
47
|
+
{% unless product.available %}disabled{% endunless %}
|
|
48
|
+
style="width: 100%; padding: 14px 24px; background: #4f46e5; color: #ffffff; border-radius: 8px; font-size: 15px; font-weight: 700; border: none; cursor: pointer;"
|
|
49
|
+
>
|
|
50
|
+
{% if product.available %}
|
|
51
|
+
{{ 'products.product.add_to_cart' | t }}
|
|
52
|
+
{% else %}
|
|
53
|
+
{{ 'products.product.sold_out' | t }}
|
|
54
|
+
{% endif %}
|
|
55
|
+
</button>
|
|
56
|
+
{% endform %}
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
</section>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{% layout 'theme' %}
|
|
2
|
+
|
|
3
|
+
<section class="cz-candy-search candy-container" style="padding-top: 48px; padding-bottom: 64px;">
|
|
4
|
+
<header style="max-width: 640px; margin: 0 auto 40px; text-align: center;">
|
|
5
|
+
<h1 style="font-size: 32px; font-weight: 800; color: #0f172a; margin: 0 0 16px;">
|
|
6
|
+
{{ 'general.search.title' | t }}
|
|
7
|
+
</h1>
|
|
8
|
+
|
|
9
|
+
{% form 'search', class: 'cz-candy-search__form' %}
|
|
10
|
+
<div style="display: flex; gap: 12px;">
|
|
11
|
+
<input
|
|
12
|
+
type="search"
|
|
13
|
+
name="q"
|
|
14
|
+
value="{{ search.terms | escape }}"
|
|
15
|
+
placeholder="{{ 'general.search.placeholder' | t }}"
|
|
16
|
+
style="flex: 1; padding: 12px 16px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 15px;"
|
|
17
|
+
/>
|
|
18
|
+
<button type="submit" class="candy-btn">
|
|
19
|
+
{{ 'general.search.submit' | t }}
|
|
20
|
+
</button>
|
|
21
|
+
</div>
|
|
22
|
+
{% endform %}
|
|
23
|
+
</header>
|
|
24
|
+
|
|
25
|
+
{% if search.performed %}
|
|
26
|
+
<p style="font-size: 14px; color: #64748b; margin-bottom: 24px;">
|
|
27
|
+
{{ 'general.search.results_with_count' | t: count: search.results_count, terms: search.terms }}
|
|
28
|
+
</p>
|
|
29
|
+
|
|
30
|
+
<div class="candy-product-grid">
|
|
31
|
+
{% for item in search.results %}
|
|
32
|
+
{% render 'product-card', product: item %}
|
|
33
|
+
{% else %}
|
|
34
|
+
<p style="grid-column: 1 / -1; text-align: center; color: #64748b; padding: 32px 0;">
|
|
35
|
+
{{ 'general.search.no_results' | t: terms: search.terms }}
|
|
36
|
+
</p>
|
|
37
|
+
{% endfor %}
|
|
38
|
+
</div>
|
|
39
|
+
{% endif %}
|
|
40
|
+
</section>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Caartzee / Akhil Jinu
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|