@numueg/theme-cli 0.4.1 → 0.6.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/CHANGELOG.md +22 -0
- package/dist/index.js +817 -405
- package/package.json +2 -1
- package/templates/scaffold/index.html +13 -0
- package/templates/scaffold/package.json +27 -0
- package/templates/scaffold/schemas/sections/about_section.json +23 -0
- package/templates/scaffold/schemas/sections/account.json +8 -0
- package/templates/scaffold/schemas/sections/cart_summary.json +12 -0
- package/templates/scaffold/schemas/sections/categories.json +9 -0
- package/templates/scaffold/schemas/sections/featured_collection.json +14 -0
- package/templates/scaffold/schemas/sections/footer.json +14 -0
- package/templates/scaffold/schemas/sections/frequently_bought.json +10 -0
- package/templates/scaffold/schemas/sections/header.json +14 -0
- package/templates/scaffold/schemas/sections/hero.json +15 -0
- package/templates/scaffold/schemas/sections/image_with_text.json +19 -0
- package/templates/scaffold/schemas/sections/marquee.json +9 -0
- package/templates/scaffold/schemas/sections/newsletter.json +11 -0
- package/templates/scaffold/schemas/sections/not_found.json +12 -0
- package/templates/scaffold/schemas/sections/order_confirmation.json +9 -0
- package/templates/scaffold/schemas/sections/product_details.json +12 -0
- package/templates/scaffold/schemas/sections/product_grid.json +12 -0
- package/templates/scaffold/schemas/sections/promo_banner.json +13 -0
- package/templates/scaffold/schemas/sections/rich_text.json +17 -0
- package/templates/scaffold/schemas/sections/search_results.json +11 -0
- package/templates/scaffold/schemas/sections/size_chart.json +9 -0
- package/templates/scaffold/schemas/sections/testimonials.json +22 -0
- package/templates/scaffold/settings_schema.json +35 -0
- package/templates/scaffold/src/dev-entry.tsx +244 -0
- package/templates/scaffold/src/lib/CouponForm.tsx +90 -0
- package/templates/scaffold/src/lib/EditableText.tsx +178 -0
- package/templates/scaffold/src/lib/ProductCard.tsx +99 -0
- package/templates/scaffold/src/lib/cartUI.ts +43 -0
- package/templates/scaffold/src/lib/i18n.ts +17 -0
- package/templates/scaffold/src/lib/section.ts +12 -0
- package/templates/scaffold/src/main.tsx +230 -0
- package/templates/scaffold/src/sections/Footer.tsx +161 -0
- package/templates/scaffold/src/sections/Header.tsx +453 -0
- package/templates/scaffold/src/sections/about_section.tsx +104 -0
- package/templates/scaffold/src/sections/account.tsx +422 -0
- package/templates/scaffold/src/sections/cart_summary.tsx +169 -0
- package/templates/scaffold/src/sections/categories.tsx +57 -0
- package/templates/scaffold/src/sections/featured_collection.tsx +109 -0
- package/templates/scaffold/src/sections/frequently_bought.tsx +187 -0
- package/templates/scaffold/src/sections/hero.tsx +133 -0
- package/templates/scaffold/src/sections/image_with_text.tsx +105 -0
- package/templates/scaffold/src/sections/marquee.tsx +45 -0
- package/templates/scaffold/src/sections/newsletter.tsx +79 -0
- package/templates/scaffold/src/sections/not_found.tsx +56 -0
- package/templates/scaffold/src/sections/order_confirmation.tsx +127 -0
- package/templates/scaffold/src/sections/product_details.tsx +517 -0
- package/templates/scaffold/src/sections/product_grid.tsx +147 -0
- package/templates/scaffold/src/sections/promo_banner.tsx +80 -0
- package/templates/scaffold/src/sections/rich_text.tsx +51 -0
- package/templates/scaffold/src/sections/search_results.tsx +93 -0
- package/templates/scaffold/src/sections/size_chart.tsx +109 -0
- package/templates/scaffold/src/sections/testimonials.tsx +112 -0
- package/templates/scaffold/styles.css +2404 -0
- package/templates/scaffold/templates/error.html +13 -0
- package/templates/scaffold/templates/loading.html +11 -0
- package/templates/scaffold/theme.json +224 -0
- package/templates/scaffold/tsconfig.json +22 -0
- package/templates/scaffold/vite.config.ts +16 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Static BYOT error template — rendered by the storefront when a
|
|
3
|
+
page throws. No JS available (the bundle might be the thing that
|
|
4
|
+
failed). Use <button data-numu-reset> to expose a retry button —
|
|
5
|
+
the storefront wires the click for you.
|
|
6
|
+
-->
|
|
7
|
+
<main role="alert" style="min-height:100vh;display:flex;align-items:center;justify-content:center;padding:1rem;font-family:system-ui">
|
|
8
|
+
<div style="text-align:center;max-width:28rem">
|
|
9
|
+
<h1 style="font-size:1.5rem;font-weight:700;color:#b91c1c">Something went wrong</h1>
|
|
10
|
+
<p style="color:#374151;margin-top:.5rem">Please try again in a moment.</p>
|
|
11
|
+
<button data-numu-reset type="button" style="margin-top:1.5rem;padding:.5rem 1rem;background:#1d4ed8;color:white;border-radius:.375rem;border:0;cursor:pointer">Try again</button>
|
|
12
|
+
</div>
|
|
13
|
+
</main>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<!-- Static BYOT loading skeleton. -->
|
|
2
|
+
<div role="status" aria-live="polite" aria-label="Loading" style="min-height:100vh;display:flex;align-items:center;justify-content:center;padding:1rem;font-family:system-ui">
|
|
3
|
+
<div style="display:flex;align-items:center;gap:.75rem;color:#4b5563">
|
|
4
|
+
<svg style="width:1.25rem;height:1.25rem;animation:spin 1s linear infinite" viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
|
5
|
+
<circle cx="12" cy="12" r="10" stroke="currentColor" stroke-opacity=".25" stroke-width="3"></circle>
|
|
6
|
+
<path d="M22 12a10 10 0 0 1-10 10" stroke="currentColor" stroke-width="3" stroke-linecap="round"></path>
|
|
7
|
+
</svg>
|
|
8
|
+
<span style="font-size:.875rem;font-weight:500">Loading…</span>
|
|
9
|
+
</div>
|
|
10
|
+
<style>@keyframes spin { to { transform: rotate(360deg) } }</style>
|
|
11
|
+
</div>
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "__THEME_ID__",
|
|
3
|
+
"name": "__THEME_NAME__",
|
|
4
|
+
"author": "__AUTHOR__",
|
|
5
|
+
"version": "__VERSION__",
|
|
6
|
+
"layout": "single-column",
|
|
7
|
+
"description": "__THEME_NAME__ — a premium NUMU V3 starter: bilingual (AR/EN), inline-editable, multi-currency, with a size-aware product page.",
|
|
8
|
+
"error_template": "templates/error.html",
|
|
9
|
+
"loading_template": "templates/loading.html",
|
|
10
|
+
"presets": {
|
|
11
|
+
"section_groups": {
|
|
12
|
+
"header": {
|
|
13
|
+
"name": "Header",
|
|
14
|
+
"sections": [
|
|
15
|
+
{
|
|
16
|
+
"type": "header",
|
|
17
|
+
"settings": {
|
|
18
|
+
"announcement_text": "شحن مجاني للطلبات فوق ٥٠٠ ج.م",
|
|
19
|
+
"menu_handle": "main-menu",
|
|
20
|
+
"show_search": true,
|
|
21
|
+
"show_account": true,
|
|
22
|
+
"show_cart": true
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
"footer": {
|
|
28
|
+
"name": "Footer",
|
|
29
|
+
"sections": [
|
|
30
|
+
{
|
|
31
|
+
"type": "footer",
|
|
32
|
+
"settings": {
|
|
33
|
+
"description": "متجر مستقل يقدّم تشكيلة مختارة بعناية. تصميم نظيف، جودة تدوم.",
|
|
34
|
+
"ticker_text": "100% مستقل"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"templates": {
|
|
41
|
+
"home": {
|
|
42
|
+
"name": "Home",
|
|
43
|
+
"sections": [
|
|
44
|
+
{
|
|
45
|
+
"type": "hero",
|
|
46
|
+
"settings": {
|
|
47
|
+
"headline": "اكتشف التشكيلة الجديدة",
|
|
48
|
+
"subtitle": "تسوق الآن",
|
|
49
|
+
"cta_text": "تسوق",
|
|
50
|
+
"cta_link": "/products",
|
|
51
|
+
"image_1": "https://images.unsplash.com/photo-1441986300917-64674bd600d8?w=1600",
|
|
52
|
+
"image_2": "https://images.unsplash.com/photo-1523275335684-37898b6baf30?w=1600",
|
|
53
|
+
"image_3": "https://images.unsplash.com/photo-1556906781-9a412961c28c?w=1600",
|
|
54
|
+
"autoplay": true
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"type": "marquee",
|
|
59
|
+
"settings": { "text": "100% مستقل", "repeat": 10 }
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"type": "featured_collection",
|
|
63
|
+
"settings": {
|
|
64
|
+
"title": "المتجر",
|
|
65
|
+
"view_all_link": "/products",
|
|
66
|
+
"max_items": 8
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"type": "categories",
|
|
71
|
+
"settings": { "title": "تسوق حسب الفئة", "columns_desktop": 5 }
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"type": "promo_banner",
|
|
75
|
+
"settings": {
|
|
76
|
+
"badge_text": "عرض محدود",
|
|
77
|
+
"headline": "خصم ٢٥٪ على كل الإكسسوارات",
|
|
78
|
+
"subtitle": "العرض ساري لنهاية الشهر. متفوتش الفرصة!",
|
|
79
|
+
"cta_text": "تسوق الآن",
|
|
80
|
+
"cta_link": "/products"
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"type": "testimonials",
|
|
85
|
+
"settings": { "title": "رأي عملائنا" },
|
|
86
|
+
"blocks": [
|
|
87
|
+
{ "type": "review", "settings": { "text": "جودة المنتجات فوق الممتازة والتوصيل سريع جداً.", "author": "ليلى م.", "city": "القاهرة", "rating": 5 } },
|
|
88
|
+
{ "type": "review", "settings": { "text": "تصميم أنيق وخامات تدوم. تجربة شراء مريحة.", "author": "عمر أ.", "city": "الرياض", "rating": 5 } },
|
|
89
|
+
{ "type": "review", "settings": { "text": "أفضل متجر تعاملت معه. أنصح به بشدة.", "author": "نادية ح.", "city": "دبي", "rating": 4 } }
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"type": "newsletter",
|
|
94
|
+
"settings": {
|
|
95
|
+
"title": "اشترك في نشرتنا",
|
|
96
|
+
"subtitle": "اعرف أول واحد عن العروض والمنتجات الجديدة",
|
|
97
|
+
"button_text": "اشترك",
|
|
98
|
+
"placeholder": "البريد الإلكتروني"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
]
|
|
102
|
+
},
|
|
103
|
+
"product": {
|
|
104
|
+
"name": "Product",
|
|
105
|
+
"sections": [
|
|
106
|
+
{
|
|
107
|
+
"type": "product_details",
|
|
108
|
+
"settings": {
|
|
109
|
+
"add_to_cart_label": "أضف إلى السلة",
|
|
110
|
+
"show_compare_price": true,
|
|
111
|
+
"show_related": false,
|
|
112
|
+
"show_whatsapp": true,
|
|
113
|
+
"show_fbt": true
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
]
|
|
117
|
+
},
|
|
118
|
+
"products": {
|
|
119
|
+
"name": "All Products",
|
|
120
|
+
"sections": [
|
|
121
|
+
{
|
|
122
|
+
"type": "product_grid",
|
|
123
|
+
"settings": {
|
|
124
|
+
"title": "كل المنتجات",
|
|
125
|
+
"columns_desktop": 4,
|
|
126
|
+
"show_search": true,
|
|
127
|
+
"show_sort": true,
|
|
128
|
+
"show_categories": true
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
]
|
|
132
|
+
},
|
|
133
|
+
"collection": {
|
|
134
|
+
"name": "Collection",
|
|
135
|
+
"sections": [
|
|
136
|
+
{
|
|
137
|
+
"type": "product_grid",
|
|
138
|
+
"settings": {
|
|
139
|
+
"title": "المجموعة",
|
|
140
|
+
"columns_desktop": 4,
|
|
141
|
+
"show_search": false,
|
|
142
|
+
"show_sort": true,
|
|
143
|
+
"show_categories": false
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
]
|
|
147
|
+
},
|
|
148
|
+
"cart": {
|
|
149
|
+
"name": "Cart",
|
|
150
|
+
"sections": [
|
|
151
|
+
{
|
|
152
|
+
"type": "cart_summary",
|
|
153
|
+
"settings": {
|
|
154
|
+
"title": "سلة التسوق",
|
|
155
|
+
"checkout_label": "إتمام الطلب",
|
|
156
|
+
"empty_title": "السلة فاضية",
|
|
157
|
+
"empty_cta_label": "متابعة التسوق",
|
|
158
|
+
"empty_cta_link": "/products"
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
]
|
|
162
|
+
},
|
|
163
|
+
"order-confirmation": {
|
|
164
|
+
"name": "Order Confirmation",
|
|
165
|
+
"sections": [
|
|
166
|
+
{
|
|
167
|
+
"type": "order_confirmation",
|
|
168
|
+
"settings": {
|
|
169
|
+
"title": "شكراً لطلبك!",
|
|
170
|
+
"subtitle": "تم استلام طلبك بنجاح. هنبعتلك تأكيد على بريدك."
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
]
|
|
174
|
+
},
|
|
175
|
+
"search": {
|
|
176
|
+
"name": "Search",
|
|
177
|
+
"sections": [
|
|
178
|
+
{
|
|
179
|
+
"type": "search_results",
|
|
180
|
+
"settings": {
|
|
181
|
+
"title": "البحث",
|
|
182
|
+
"search_placeholder": "ابحث عن المنتجات…",
|
|
183
|
+
"columns_desktop": 4
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
]
|
|
187
|
+
},
|
|
188
|
+
"page": {
|
|
189
|
+
"name": "Page",
|
|
190
|
+
"sections": [
|
|
191
|
+
{
|
|
192
|
+
"type": "rich_text",
|
|
193
|
+
"settings": {
|
|
194
|
+
"content": "<p>أضف محتوى صفحتك من إعدادات القسم.</p>",
|
|
195
|
+
"align": "start",
|
|
196
|
+
"width": "narrow"
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
]
|
|
200
|
+
},
|
|
201
|
+
"404": {
|
|
202
|
+
"name": "404 — Not Found",
|
|
203
|
+
"sections": [
|
|
204
|
+
{
|
|
205
|
+
"type": "not_found",
|
|
206
|
+
"settings": {
|
|
207
|
+
"code": "404",
|
|
208
|
+
"title": "الصفحة غير موجودة",
|
|
209
|
+
"message": "يبدو أن الصفحة التي تبحث عنها غير متاحة أو تم نقلها.",
|
|
210
|
+
"cta_text": "العودة للتسوق",
|
|
211
|
+
"cta_link": "/products"
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
]
|
|
215
|
+
},
|
|
216
|
+
"profile": {
|
|
217
|
+
"name": "Account",
|
|
218
|
+
"sections": [
|
|
219
|
+
{ "type": "account", "settings": { "heading": "حسابي" } }
|
|
220
|
+
]
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"lib": [
|
|
5
|
+
"ES2022",
|
|
6
|
+
"DOM",
|
|
7
|
+
"DOM.Iterable"
|
|
8
|
+
],
|
|
9
|
+
"module": "ESNext",
|
|
10
|
+
"moduleResolution": "bundler",
|
|
11
|
+
"jsx": "react-jsx",
|
|
12
|
+
"strict": true,
|
|
13
|
+
"noEmit": true,
|
|
14
|
+
"skipLibCheck": true,
|
|
15
|
+
"isolatedModules": true,
|
|
16
|
+
"esModuleInterop": true,
|
|
17
|
+
"resolveJsonModule": true
|
|
18
|
+
},
|
|
19
|
+
"include": [
|
|
20
|
+
"src"
|
|
21
|
+
]
|
|
22
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { defineConfig } from "vite";
|
|
2
|
+
import react from "@vitejs/plugin-react";
|
|
3
|
+
import { numuTheme } from "@numueg/theme-plugin";
|
|
4
|
+
|
|
5
|
+
// The @numueg/theme-plugin handles all the NUMU-specific glue:
|
|
6
|
+
// - validates theme.json + settings_schema.json + entry point
|
|
7
|
+
// - externalizes React + @numueg/theme-sdk (host-provided)
|
|
8
|
+
// - emits dist/manifest.json + dist/import-map.json after build
|
|
9
|
+
//
|
|
10
|
+
// You don't need to repeat `build.lib` / `build.rollupOptions.external`
|
|
11
|
+
// — the plugin sets sensible defaults when they're omitted.
|
|
12
|
+
|
|
13
|
+
export default defineConfig({
|
|
14
|
+
plugins: [react(), numuTheme()],
|
|
15
|
+
server: { port: 5173 },
|
|
16
|
+
});
|