@o2vend/theme-cli 1.0.32

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 (116) hide show
  1. package/README.md +425 -0
  2. package/assets/Logo_o2vend.png +0 -0
  3. package/assets/favicon.png +0 -0
  4. package/assets/logo-white.png +0 -0
  5. package/bin/o2vend +42 -0
  6. package/config/widget-map.json +50 -0
  7. package/lib/commands/check.js +201 -0
  8. package/lib/commands/generate.js +33 -0
  9. package/lib/commands/init.js +214 -0
  10. package/lib/commands/optimize.js +216 -0
  11. package/lib/commands/package.js +208 -0
  12. package/lib/commands/serve.js +105 -0
  13. package/lib/commands/validate.js +191 -0
  14. package/lib/lib/api-client.js +357 -0
  15. package/lib/lib/dev-server.js +2618 -0
  16. package/lib/lib/file-watcher.js +80 -0
  17. package/lib/lib/hot-reload.js +106 -0
  18. package/lib/lib/liquid-engine.js +822 -0
  19. package/lib/lib/liquid-filters.js +671 -0
  20. package/lib/lib/mock-api-server.js +989 -0
  21. package/lib/lib/mock-data.js +1468 -0
  22. package/lib/lib/widget-service.js +321 -0
  23. package/package.json +70 -0
  24. package/test-theme/README.md +27 -0
  25. package/test-theme/assets/async-sections.js +446 -0
  26. package/test-theme/assets/cart-drawer.js +463 -0
  27. package/test-theme/assets/cart-manager.js +223 -0
  28. package/test-theme/assets/checkout-price-handler.js +368 -0
  29. package/test-theme/assets/components.css +4629 -0
  30. package/test-theme/assets/delivery-zone.css +299 -0
  31. package/test-theme/assets/delivery-zone.js +396 -0
  32. package/test-theme/assets/logo.png +0 -0
  33. package/test-theme/assets/sections.css +48 -0
  34. package/test-theme/assets/theme.css +3500 -0
  35. package/test-theme/assets/theme.js +3745 -0
  36. package/test-theme/config/settings_data.json +292 -0
  37. package/test-theme/config/settings_schema.json +1050 -0
  38. package/test-theme/layout/theme.liquid +195 -0
  39. package/test-theme/locales/en.default.json +260 -0
  40. package/test-theme/sections/content-fallback.liquid +53 -0
  41. package/test-theme/sections/content.liquid +57 -0
  42. package/test-theme/sections/footer-fallback.liquid +328 -0
  43. package/test-theme/sections/footer.liquid +278 -0
  44. package/test-theme/sections/header-fallback.liquid +1805 -0
  45. package/test-theme/sections/header.liquid +1145 -0
  46. package/test-theme/sections/hero-fallback.liquid +212 -0
  47. package/test-theme/sections/hero.liquid +136 -0
  48. package/test-theme/snippets/account-sidebar.liquid +200 -0
  49. package/test-theme/snippets/add-to-cart-modal.liquid +484 -0
  50. package/test-theme/snippets/breadcrumbs.liquid +134 -0
  51. package/test-theme/snippets/cart-drawer.liquid +467 -0
  52. package/test-theme/snippets/delivery-zone-city-selector.liquid +79 -0
  53. package/test-theme/snippets/delivery-zone-modal.liquid +337 -0
  54. package/test-theme/snippets/delivery-zone-search.liquid +78 -0
  55. package/test-theme/snippets/icon.liquid +105 -0
  56. package/test-theme/snippets/login-modal.liquid +346 -0
  57. package/test-theme/snippets/mega-menu.liquid +812 -0
  58. package/test-theme/snippets/news-thumbnail.liquid +187 -0
  59. package/test-theme/snippets/pagination.liquid +120 -0
  60. package/test-theme/snippets/price.liquid +92 -0
  61. package/test-theme/snippets/product-card-related.liquid +78 -0
  62. package/test-theme/snippets/product-card-simple.liquid +41 -0
  63. package/test-theme/snippets/product-card.liquid +697 -0
  64. package/test-theme/snippets/rating.liquid +85 -0
  65. package/test-theme/snippets/skeleton-collection-grid.liquid +114 -0
  66. package/test-theme/snippets/skeleton-product-card.liquid +124 -0
  67. package/test-theme/snippets/skeleton-product-grid.liquid +34 -0
  68. package/test-theme/snippets/social-sharing.liquid +185 -0
  69. package/test-theme/templates/account/dashboard.liquid +401 -0
  70. package/test-theme/templates/account/loyalty-redemption.liquid +405 -0
  71. package/test-theme/templates/account/loyalty.liquid +588 -0
  72. package/test-theme/templates/account/order-detail.liquid +230 -0
  73. package/test-theme/templates/account/orders.liquid +349 -0
  74. package/test-theme/templates/account/profile.liquid +758 -0
  75. package/test-theme/templates/account/register.liquid +232 -0
  76. package/test-theme/templates/account/return-orders.liquid +348 -0
  77. package/test-theme/templates/account/store-credit.liquid +464 -0
  78. package/test-theme/templates/account/subscriptions.liquid +601 -0
  79. package/test-theme/templates/account/wishlist.liquid +419 -0
  80. package/test-theme/templates/address-book.liquid +1092 -0
  81. package/test-theme/templates/categories.liquid +452 -0
  82. package/test-theme/templates/checkout.liquid +4511 -0
  83. package/test-theme/templates/error.liquid +384 -0
  84. package/test-theme/templates/index.liquid +11 -0
  85. package/test-theme/templates/login.liquid +185 -0
  86. package/test-theme/templates/order-confirmation.liquid +720 -0
  87. package/test-theme/templates/page.liquid +297 -0
  88. package/test-theme/templates/product-detail.liquid +4363 -0
  89. package/test-theme/templates/products.liquid +518 -0
  90. package/test-theme/templates/search.liquid +922 -0
  91. package/test-theme/theme.json.example +19 -0
  92. package/test-theme/widgets/brand-carousel.liquid +676 -0
  93. package/test-theme/widgets/brand.liquid +245 -0
  94. package/test-theme/widgets/carousel.liquid +843 -0
  95. package/test-theme/widgets/category-list-carousel.liquid +656 -0
  96. package/test-theme/widgets/category-list.liquid +340 -0
  97. package/test-theme/widgets/category.liquid +475 -0
  98. package/test-theme/widgets/discount-time.liquid +176 -0
  99. package/test-theme/widgets/footer-menu.liquid +695 -0
  100. package/test-theme/widgets/footer.liquid +179 -0
  101. package/test-theme/widgets/gallery.liquid +271 -0
  102. package/test-theme/widgets/header-menu.liquid +932 -0
  103. package/test-theme/widgets/header.liquid +159 -0
  104. package/test-theme/widgets/html.liquid +214 -0
  105. package/test-theme/widgets/news.liquid +217 -0
  106. package/test-theme/widgets/product-canvas.liquid +235 -0
  107. package/test-theme/widgets/product-carousel.liquid +502 -0
  108. package/test-theme/widgets/product.liquid +45 -0
  109. package/test-theme/widgets/recently-viewed.liquid +26 -0
  110. package/test-theme/widgets/shared/product-grid.liquid +339 -0
  111. package/test-theme/widgets/simple-product.liquid +42 -0
  112. package/test-theme/widgets/single-product.liquid +610 -0
  113. package/test-theme/widgets/spacebar-carousel.liquid +663 -0
  114. package/test-theme/widgets/spacebar.liquid +279 -0
  115. package/test-theme/widgets/splash.liquid +378 -0
  116. package/test-theme/widgets/testimonial-carousel.liquid +709 -0
@@ -0,0 +1,401 @@
1
+ {% layout 'layout/theme' %}
2
+
3
+ {% comment %}
4
+ Account Dashboard Page
5
+ {% endcomment %}
6
+
7
+ {% hook 'account_before' %}
8
+ <section class="account-page">
9
+ <div class="container">
10
+ <div class="account-header">
11
+ <h1 class="account-title display-2">My Account</h1>
12
+ <p class="account-subtitle">Manage your account and orders</p>
13
+ </div>
14
+
15
+ <div class="account-layout">
16
+ <!-- Account Sidebar -->
17
+ <aside class="account-sidebar">
18
+ {% render 'snippets/account-sidebar' %}
19
+ </aside>
20
+
21
+ <!-- Dashboard Content -->
22
+ <div class="account-content">
23
+ {% hook 'account_dashboard_before' %}
24
+ <div class="account-section-header">
25
+ <h2 class="account-section-title">Dashboard</h2>
26
+ </div>
27
+
28
+ <div class="account-dashboard">
29
+ <div class="dashboard-stats">
30
+ <div class="dashboard-stat">
31
+ <div class="stat-icon">
32
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
33
+ <circle cx="9" cy="21" r="1"></circle>
34
+ <circle cx="20" cy="21" r="1"></circle>
35
+ <path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"></path>
36
+ </svg>
37
+ </div>
38
+ <div class="stat-content">
39
+ <h3 class="stat-value">{{ customer.ordersCount | default: 0 }}</h3>
40
+ <p class="stat-label">Total Orders</p>
41
+ </div>
42
+ </div>
43
+
44
+ <div class="dashboard-stat">
45
+ <div class="stat-icon">
46
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
47
+ <path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"></path>
48
+ </svg>
49
+ </div>
50
+ <div class="stat-content">
51
+ <h3 class="stat-value">{{ customer.wishlistCount | default: 0 }}</h3>
52
+ <p class="stat-label">Wishlist Items</p>
53
+ </div>
54
+ </div>
55
+
56
+ <div class="dashboard-stat">
57
+ <div class="stat-icon">
58
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
59
+ <circle cx="12" cy="8" r="7"></circle>
60
+ <polyline points="8.21 13.89 7 23 12 20 17 23 15.79 13.88"></polyline>
61
+ </svg>
62
+ </div>
63
+ <div class="stat-content">
64
+ <h3 class="stat-value">{{ customer.loyaltyPoints | default: 0 }}</h3>
65
+ <p class="stat-label">Loyalty Points</p>
66
+ </div>
67
+ </div>
68
+ </div>
69
+
70
+ <div class="dashboard-recent-orders">
71
+ <h3 class="dashboard-subtitle">Recent Orders</h3>
72
+ {% if customer.recentOrders and customer.recentOrders.size > 0 %}
73
+ <div class="orders-list">
74
+ {% for order in customer.recentOrders limit: 5 %}
75
+ <div class="order-item">
76
+ <div class="order-item-info">
77
+ <h4 class="order-item-number">Order #{{ order.orderNumber }}</h4>
78
+ <p class="order-item-date">{{ order.createdAt | date: '%B %d, %Y' }}</p>
79
+ </div>
80
+ <div class="order-item-status">
81
+ <span class="status-badge status-{{ order.status | downcase }}">{{ order.status }}</span>
82
+ </div>
83
+ <div class="order-item-total">
84
+ {{ order.total | money_with_settings: shop.settings }}
85
+ </div>
86
+ <div class="order-item-actions">
87
+ <a href="/orders/{{ order.id }}" class="btn btn-sm btn-outline">View Details</a>
88
+ </div>
89
+ </div>
90
+ {% endfor %}
91
+ </div>
92
+ <div class="view-all-orders">
93
+ <a href="/orders" class="btn btn-primary">View All Orders</a>
94
+ </div>
95
+ {% else %}
96
+ <div class="empty-state">
97
+ <p>No recent orders</p>
98
+ <a href="/products" class="btn btn-primary">Start Shopping</a>
99
+ </div>
100
+ {% endif %}
101
+ </div>
102
+ </div>
103
+ {% hook 'account_dashboard_after' %}
104
+ </div>
105
+ </div>
106
+ </div>
107
+ </section>
108
+ {% hook 'account_after' %}
109
+
110
+ <style>
111
+ /* Account page uses theme.css variables - no local :root needed */
112
+
113
+ .account-page {
114
+ padding: var(--spacing-section) var(--spacing-small);
115
+ background: var(--color-background);
116
+ min-height: 100vh;
117
+ }
118
+
119
+ .container {
120
+ max-width: var(--container-width);
121
+ margin: 0 auto;
122
+ padding: 0 var(--spacing-small);
123
+ }
124
+
125
+ .account-header {
126
+ text-align: center;
127
+ margin-bottom: var(--spacing-section);
128
+
129
+ }
130
+
131
+ .account-title {
132
+ font-size: 2.5rem;
133
+ font-weight: 700;
134
+ color: var(--color-text);
135
+ margin: 0 0 0.5rem 0;
136
+ letter-spacing: -0.025em;
137
+ }
138
+
139
+ .account-subtitle {
140
+ font-size: 1.125rem;
141
+ color: var(--color-text-light);
142
+ margin: 0;
143
+ }
144
+
145
+ .account-layout {
146
+ display: grid;
147
+ grid-template-columns: 280px 1fr;
148
+ gap: var(--spacing-component);
149
+ align-items: start;
150
+ }
151
+
152
+ .account-sidebar {
153
+ position: sticky;
154
+ top: var(--spacing-component);
155
+ background: var(--color-background);
156
+ border-radius: var(--border-radius-large);
157
+ padding: var(--spacing-component);
158
+ box-shadow: var(--shadow-md);
159
+ border: 1px solid var(--color-border);
160
+ }
161
+
162
+ .account-content {
163
+ background: var(--color-background);
164
+ border-radius: var(--border-radius-large);
165
+ padding: var(--spacing-component);
166
+ box-shadow: var(--shadow-md);
167
+ border: 1px solid var(--color-border);
168
+ }
169
+
170
+ .account-section-header {
171
+ margin-bottom: var(--spacing-component);
172
+ padding-bottom: var(--spacing-component);
173
+ border-bottom: 1px solid var(--color-border);
174
+ }
175
+
176
+ .account-section-title {
177
+ font-size: 1.75rem;
178
+ font-weight: 600;
179
+ color: var(--color-text);
180
+ margin: 0;
181
+ }
182
+
183
+ .dashboard-stats {
184
+ display: grid;
185
+ grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
186
+ gap: var(--spacing-component);
187
+ margin-bottom: var(--spacing-section);
188
+ }
189
+
190
+ .dashboard-stat {
191
+ display: flex;
192
+ align-items: center;
193
+ gap: var(--spacing-component);
194
+ padding: var(--spacing-component);
195
+ background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-background) 100%);
196
+ border-radius: var(--border-radius-medium);
197
+ border: 1px solid var(--color-border);
198
+ transition: all 0.3s ease;
199
+ }
200
+
201
+ .dashboard-stat:hover {
202
+ transform: translateY(-2px);
203
+ box-shadow: var(--shadow-lg);
204
+ }
205
+
206
+ .stat-icon {
207
+ width: 50px;
208
+ height: 50px;
209
+ display: flex;
210
+ align-items: center;
211
+ justify-content: center;
212
+ background: var(--color-primary);
213
+ color: var(--color-background);
214
+ border-radius: var(--border-radius-medium);
215
+ flex-shrink: 0;
216
+ }
217
+
218
+ .stat-value {
219
+ font-size: 2rem;
220
+ font-weight: 700;
221
+ color: var(--color-text);
222
+ margin: 0 0 0.25rem 0;
223
+ line-height: 1;
224
+ }
225
+
226
+ .stat-label {
227
+ font-size: 0.875rem;
228
+ color: var(--color-text-light);
229
+ margin: 0;
230
+ text-transform: uppercase;
231
+ letter-spacing: 0.05em;
232
+ }
233
+
234
+ .dashboard-subtitle {
235
+ font-size: 1.25rem;
236
+ font-weight: 600;
237
+ color: var(--color-text);
238
+ margin: 0 0 var(--spacing-component) 0;
239
+ }
240
+
241
+ .orders-list {
242
+ display: grid;
243
+ gap: var(--spacing-small);
244
+ }
245
+
246
+ .order-item {
247
+ display: grid;
248
+ grid-template-columns: 2fr 1fr 1fr auto;
249
+ gap: var(--spacing-component);
250
+ align-items: center;
251
+ padding: var(--spacing-component);
252
+ background: var(--color-background);
253
+ border-radius: var(--border-radius-medium);
254
+ border: 1px solid var(--color-border);
255
+ transition: all 0.3s ease;
256
+ }
257
+
258
+ .order-item:hover {
259
+ border-color: var(--color-primary);
260
+ box-shadow: var(--shadow-sm);
261
+ }
262
+
263
+ .order-item-number {
264
+ font-size: 1.4rem;
265
+ font-weight: 600;
266
+ color: var(--color-text);
267
+ margin: 0 0 0.25rem 0;
268
+ }
269
+
270
+ .order-item-date {
271
+ font-size: 1.2rem;
272
+ color: var(--color-text-light);
273
+ margin: 0;
274
+ }
275
+
276
+ .order-item-status {
277
+ justify-self: center;
278
+ }
279
+
280
+ .status-badge {
281
+ display: inline-block;
282
+ padding: 0.375rem 0.75rem;
283
+ border-radius: 0.375rem;
284
+ font-size: 1.2rem;
285
+ font-weight: 600;
286
+ text-transform: capitalize;
287
+ }
288
+
289
+ .status-pending {
290
+ background: var(--color-warning-light);
291
+ color: var(--color-warning-dark);
292
+ }
293
+
294
+ .status-processing {
295
+ background: var(--color-info-light);
296
+ color: var(--color-info-dark);
297
+ }
298
+
299
+ .status-shipped, .status-delivered {
300
+ background: var(--color-success-light);
301
+ color: var(--color-success-dark);
302
+ }
303
+
304
+ .status-cancelled {
305
+ background: var(--color-danger-light);
306
+ color: var(--color-danger-dark);
307
+ }
308
+
309
+ .order-item-total {
310
+ font-size: 1.4rem;
311
+ font-weight: 600;
312
+ color: var(--color-text);
313
+ text-align: right;
314
+ }
315
+
316
+ .view-all-orders {
317
+ margin-top: var(--spacing-component);
318
+ text-align: center;
319
+ }
320
+
321
+ .btn {
322
+ display: inline-flex;
323
+ align-items: center;
324
+ justify-content: center;
325
+ padding: 0.625rem 1.5rem;
326
+ font-size: 1.4rem;
327
+ font-weight: 500;
328
+ text-decoration: none;
329
+ border-radius: var(--border-radius-medium);
330
+ border: none;
331
+ cursor: pointer;
332
+ transition: all 0.3s ease;
333
+ }
334
+
335
+ .btn-primary {
336
+ background: var(--color-primary);
337
+ color: var(--color-background);
338
+ border: 2px solid var(--color-primary);
339
+ }
340
+
341
+ .btn-primary:hover {
342
+ background: var(--color-primary-hover);
343
+ transform: translateY(-1px);
344
+ box-shadow: var(--shadow-md);
345
+ }
346
+
347
+ .btn-outline {
348
+ background: transparent;
349
+ color: var(--color-text);
350
+ border: 2px solid var(--color-border);
351
+ }
352
+
353
+ .btn-outline:hover {
354
+ border-color: var(--color-primary);
355
+ color: var(--color-primary);
356
+ }
357
+
358
+ .btn-sm {
359
+ padding: 0.5rem 1rem;
360
+ font-size: 1.4rem;
361
+ }
362
+
363
+ .empty-state {
364
+ text-align: center;
365
+ padding: var(--spacing-section);
366
+ background: var(--color-background);
367
+ border-radius: var(--border-radius-medium);
368
+ border: 2px dashed var(--color-border);
369
+ }
370
+
371
+ .empty-state p {
372
+ margin: 0 0 var(--spacing-component) 0;
373
+ color: var(--color-text-light);
374
+ }
375
+
376
+ @media (max-width: 768px) {
377
+ .account-layout {
378
+ grid-template-columns: 1fr;
379
+ }
380
+
381
+ .account-content {
382
+ order: 1;
383
+ }
384
+
385
+ .dashboard-stats {
386
+ grid-template-columns: 1fr;
387
+ }
388
+ .order-item-status, .order-item-total {
389
+ justify-self: start;
390
+ }
391
+
392
+ .order-item-actions {
393
+ width: 100%;
394
+ }
395
+
396
+ .order-item-actions .btn {
397
+ width: 100%;
398
+ }
399
+ }
400
+ </style>
401
+