easyorders 0.1.8 → 0.1.10

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.
@@ -0,0 +1,304 @@
1
+ <section
2
+ class="shop-the-look shop-the-look--{{ section_data.surface | default: 'cream' }}"
3
+ style="--stl-accent: {{ section_data.accent_color | default: '#C9A962' }};"
4
+ >
5
+ <header class="shop-the-look__head">
6
+ {% if section_data.eyebrow != blank %}
7
+ <p class="shop-the-look__eyebrow">{{ section_data.eyebrow }}</p>
8
+ {% endif %}
9
+ {% if section_data.title != blank %}
10
+ <h2 class="shop-the-look__title">{{ section_data.title }}</h2>
11
+ {% endif %}
12
+ {% if section_data.subtitle != blank %}
13
+ <p class="shop-the-look__subtitle">{{ section_data.subtitle }}</p>
14
+ {% endif %}
15
+ </header>
16
+
17
+ <div class="shop-the-look__layout">
18
+ <a class="shop-the-look__hero" href="{{ section_data.look_url | default: '/products' }}">
19
+ <div class="shop-the-look__hero-visual">
20
+ {% if section_data.look_image != blank %}
21
+ <img
22
+ class="shop-the-look__hero-img"
23
+ src="{{ section_data.look_image }}"
24
+ alt="{{ section_data.look_title | default: 'Look' }}"
25
+ loading="lazy"
26
+ width="900"
27
+ height="1120"
28
+ >
29
+ {% else %}
30
+ <div class="shop-the-look__hero-placeholder" aria-hidden="true"></div>
31
+ {% endif %}
32
+ <div class="shop-the-look__hero-shade" aria-hidden="true"></div>
33
+ </div>
34
+ <div class="shop-the-look__hero-copy">
35
+ {% if section_data.look_title != blank %}
36
+ <span class="shop-the-look__hero-title">{{ section_data.look_title }}</span>
37
+ {% endif %}
38
+ {% if section_data.look_caption != blank %}
39
+ <span class="shop-the-look__hero-caption">{{ section_data.look_caption }}</span>
40
+ {% endif %}
41
+ {% if section_data.look_cta_label != blank %}
42
+ <span class="shop-the-look__hero-cta">{{ section_data.look_cta_label }}</span>
43
+ {% endif %}
44
+ </div>
45
+ </a>
46
+
47
+ <div
48
+ class="shop-the-look__picks eo-hs{% if section_data.pick_product_ids == blank or section_data.pick_product_ids.size == 0 %} eo-hs--empty{% endif %}"
49
+ data-eo-hs-entity="products"
50
+ data-eo-hs-ids="{{ section_data.pick_product_ids | join: ',' | strip }}"
51
+ >
52
+ <div class="shop-the-look__picks-inner" data-eo-hs-mount>
53
+ {% if section_data.pick_product_ids and section_data.pick_product_ids.size > 0 %}
54
+ {% for id in section_data.pick_product_ids %}
55
+ <div class="eo-hs-skeleton eo-hs-skeleton--product" aria-hidden="true"></div>
56
+ {% endfor %}
57
+ {% else %}
58
+ <p class="shop-the-look__picks-empty">Add products in the section settings to list pieces from this look.</p>
59
+ {% endif %}
60
+ </div>
61
+ </div>
62
+ </div>
63
+ </section>
64
+
65
+ <style>
66
+ .shop-the-look {
67
+ padding: clamp(2.5rem, 5vw, 4rem) 1.25rem;
68
+ }
69
+ .shop-the-look--cream {
70
+ background: #f3efe8;
71
+ color: #1c1a17;
72
+ }
73
+ .shop-the-look--charcoal {
74
+ background: #1e1c24;
75
+ color: #f4eee6;
76
+ }
77
+ .shop-the-look__head {
78
+ max-width: 40rem;
79
+ margin-bottom: clamp(1.75rem, 3vw, 2.5rem);
80
+ }
81
+ .shop-the-look__eyebrow {
82
+ margin: 0 0 0.4rem;
83
+ font-size: 0.7rem;
84
+ font-weight: 600;
85
+ letter-spacing: 0.28em;
86
+ text-transform: uppercase;
87
+ color: var(--stl-accent, #c9a962);
88
+ }
89
+ .shop-the-look__title {
90
+ margin: 0 0 0.5rem;
91
+ font-family: ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif;
92
+ font-weight: 500;
93
+ font-size: clamp(1.75rem, 4vw, 2.35rem);
94
+ line-height: 1.15;
95
+ }
96
+ .shop-the-look__subtitle {
97
+ margin: 0;
98
+ font-size: 1rem;
99
+ line-height: 1.65;
100
+ opacity: 0.82;
101
+ }
102
+ .shop-the-look__layout {
103
+ max-width: 1160px;
104
+ margin: 0 auto;
105
+ display: grid;
106
+ gap: clamp(1.25rem, 3vw, 2rem);
107
+ align-items: stretch;
108
+ }
109
+ @media (min-width: 960px) {
110
+ .shop-the-look__layout {
111
+ grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
112
+ }
113
+ }
114
+ .shop-the-look__hero {
115
+ position: relative;
116
+ display: block;
117
+ border-radius: 8px;
118
+ overflow: hidden;
119
+ text-decoration: none;
120
+ color: inherit;
121
+ min-height: clamp(300px, 52vh, 540px);
122
+ box-shadow: 0 24px 60px rgba(0, 0, 0, 0.12);
123
+ transition: transform 0.25s ease, box-shadow 0.25s ease;
124
+ }
125
+ .shop-the-look--charcoal .shop-the-look__hero {
126
+ box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
127
+ }
128
+ .shop-the-look__hero:hover {
129
+ transform: translateY(-3px);
130
+ box-shadow: 0 32px 72px rgba(0, 0, 0, 0.18);
131
+ }
132
+ .shop-the-look__hero-visual {
133
+ position: absolute;
134
+ inset: 0;
135
+ }
136
+ .shop-the-look__hero-img {
137
+ width: 100%;
138
+ height: 100%;
139
+ object-fit: cover;
140
+ display: block;
141
+ }
142
+ .shop-the-look__hero-placeholder {
143
+ width: 100%;
144
+ height: 100%;
145
+ background: linear-gradient(135deg, #c4bbb0, #8a8278);
146
+ }
147
+ .shop-the-look--charcoal .shop-the-look__hero-placeholder {
148
+ background: linear-gradient(135deg, #3d3848, #1a1820);
149
+ }
150
+ .shop-the-look__hero-shade {
151
+ position: absolute;
152
+ inset: 0;
153
+ background: linear-gradient(to top, rgba(12, 10, 14, 0.88) 0%, transparent 55%);
154
+ pointer-events: none;
155
+ }
156
+ .shop-the-look__hero-copy {
157
+ position: relative;
158
+ z-index: 1;
159
+ padding: clamp(1.25rem, 3vw, 2rem);
160
+ display: flex;
161
+ flex-direction: column;
162
+ gap: 0.35rem;
163
+ align-items: flex-start;
164
+ justify-content: flex-end;
165
+ min-height: 100%;
166
+ color: #faf7f2;
167
+ }
168
+ .shop-the-look__hero-title {
169
+ font-family: ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif;
170
+ font-size: clamp(1.35rem, 3vw, 1.85rem);
171
+ font-weight: 500;
172
+ }
173
+ .shop-the-look__hero-caption {
174
+ font-size: 0.92rem;
175
+ line-height: 1.5;
176
+ opacity: 0.88;
177
+ max-width: 26rem;
178
+ }
179
+ .shop-the-look__hero-cta {
180
+ margin-top: 0.5rem;
181
+ display: inline-flex;
182
+ padding: 0.55rem 1.2rem;
183
+ border-radius: 999px;
184
+ font-size: 0.68rem;
185
+ font-weight: 700;
186
+ letter-spacing: 0.14em;
187
+ text-transform: uppercase;
188
+ background: var(--stl-accent, #c9a962);
189
+ color: #141218;
190
+ }
191
+ .shop-the-look__picks {
192
+ min-width: 0;
193
+ }
194
+ .shop-the-look__picks-empty {
195
+ margin: 0;
196
+ font-size: 0.88rem;
197
+ line-height: 1.5;
198
+ opacity: 0.75;
199
+ padding: 0.5rem 0;
200
+ }
201
+ .shop-the-look__picks-inner {
202
+ display: flex;
203
+ flex-direction: column;
204
+ gap: 0.85rem;
205
+ }
206
+ .shop-the-look__picks-inner.eo-hs-loading {
207
+ opacity: 0.85;
208
+ }
209
+ @media (max-width: 959px) {
210
+ .shop-the-look__picks-inner {
211
+ flex-flow: row nowrap;
212
+ overflow-x: auto;
213
+ padding-bottom: 0.35rem;
214
+ scroll-snap-type: x mandatory;
215
+ -webkit-overflow-scrolling: touch;
216
+ }
217
+ .shop-the-look__picks-inner .eo-hs-card--product {
218
+ flex: 0 0 min(220px, 72vw);
219
+ scroll-snap-align: start;
220
+ }
221
+ }
222
+ .shop-the-look__picks-inner .eo-hs-skeleton--product {
223
+ min-height: 96px;
224
+ border-radius: 8px;
225
+ background: linear-gradient(110deg, #ece8e2 8%, #f5f2ee 18%, #ece8e2 33%);
226
+ background-size: 200% 100%;
227
+ animation: shop-the-look-shimmer 1.2s ease-in-out infinite;
228
+ }
229
+ .shop-the-look--charcoal .shop-the-look__picks-inner .eo-hs-skeleton--product {
230
+ background: linear-gradient(110deg, #2a2630 8%, #3a3540 18%, #2a2630 33%);
231
+ background-size: 200% 100%;
232
+ }
233
+ .shop-the-look__picks-inner .eo-hs-card--product {
234
+ display: flex;
235
+ flex-direction: row;
236
+ align-items: center;
237
+ gap: 0.85rem;
238
+ text-decoration: none;
239
+ color: inherit;
240
+ padding: 0.65rem;
241
+ border-radius: 8px;
242
+ background: rgba(255, 255, 255, 0.55);
243
+ border: 1px solid rgba(28, 26, 23, 0.06);
244
+ transition: background 0.2s ease, transform 0.2s ease;
245
+ }
246
+ .shop-the-look--charcoal .shop-the-look__picks-inner .eo-hs-card--product {
247
+ background: rgba(255, 255, 255, 0.05);
248
+ border-color: rgba(255, 255, 255, 0.08);
249
+ }
250
+ .shop-the-look__picks-inner .eo-hs-card--product:hover {
251
+ background: rgba(255, 255, 255, 0.85);
252
+ transform: translateX(2px);
253
+ }
254
+ .shop-the-look--charcoal .shop-the-look__picks-inner .eo-hs-card--product:hover {
255
+ background: rgba(255, 255, 255, 0.1);
256
+ }
257
+ .shop-the-look__picks-inner .eo-hs-card--product .eo-hs-card__media {
258
+ flex-shrink: 0;
259
+ width: 76px;
260
+ height: 96px;
261
+ border-radius: 4px;
262
+ overflow: hidden;
263
+ aspect-ratio: unset;
264
+ }
265
+ .shop-the-look__picks-inner .eo-hs-card--product .eo-hs-card__media--empty {
266
+ min-height: 96px;
267
+ background: #ddd8d0;
268
+ }
269
+ .shop-the-look--charcoal .shop-the-look__picks-inner .eo-hs-card--product .eo-hs-card__media--empty {
270
+ background: #2a2630;
271
+ }
272
+ .shop-the-look__picks-inner .eo-hs-card--product .eo-hs-card__body {
273
+ display: flex;
274
+ flex-direction: column;
275
+ gap: 0.2rem;
276
+ min-width: 0;
277
+ padding: 0;
278
+ }
279
+ .shop-the-look__picks-inner .eo-hs-card--product .eo-hs-card__title {
280
+ font-size: 0.9rem;
281
+ font-weight: 600;
282
+ line-height: 1.35;
283
+ }
284
+ .shop-the-look__picks-inner .eo-hs-card--product .eo-hs-card__meta {
285
+ font-size: 0.82rem;
286
+ opacity: 0.75;
287
+ letter-spacing: 0.03em;
288
+ }
289
+ .shop-the-look__picks .eo-hs-error {
290
+ margin: 0;
291
+ font-size: 0.86rem;
292
+ color: #8b3225;
293
+ text-align: center;
294
+ padding: 0.5rem 0;
295
+ }
296
+ @keyframes shop-the-look-shimmer {
297
+ 0% {
298
+ background-position: 100% 0;
299
+ }
300
+ 100% {
301
+ background-position: -100% 0;
302
+ }
303
+ }
304
+ </style>
@@ -0,0 +1,47 @@
1
+ {
2
+ "icon": "https://api.iconify.design/lucide:shield-check.svg",
3
+ "label": "Trust promise strip",
4
+ "section_schema": [
5
+ {
6
+ "name": "style",
7
+ "type": "select",
8
+ "default": "soft",
9
+ "description": "Background treatment",
10
+ "options": [
11
+ { "label": "Soft neutral", "value": "soft" },
12
+ { "label": "High contrast", "value": "contrast" }
13
+ ]
14
+ },
15
+ {
16
+ "name": "accent_color",
17
+ "type": "color",
18
+ "default": "#C9A962",
19
+ "description": "Icon tint and highlights"
20
+ },
21
+ {
22
+ "name": "promises",
23
+ "type": "object_array",
24
+ "description": "Service promises",
25
+ "fields": [
26
+ {
27
+ "name": "icon",
28
+ "type": "image",
29
+ "default": "",
30
+ "description": "Optional small icon or logo"
31
+ },
32
+ {
33
+ "name": "title",
34
+ "type": "string",
35
+ "default": "Complimentary shipping",
36
+ "description": "Promise title"
37
+ },
38
+ {
39
+ "name": "text",
40
+ "type": "string",
41
+ "default": "On all orders over a threshold—tracked and insured.",
42
+ "description": "Short supporting copy"
43
+ }
44
+ ]
45
+ }
46
+ ]
47
+ }
@@ -0,0 +1,96 @@
1
+ <section
2
+ class="trust-promise trust-promise--{{ section_data.style | default: 'soft' }}"
3
+ style="--tp-accent: {{ section_data.accent_color | default: '#C9A962' }};"
4
+ >
5
+ {% if section_data.promises and section_data.promises.size > 0 %}
6
+ <div class="trust-promise__row">
7
+ {% for item in section_data.promises %}
8
+ <div class="trust-promise__item">
9
+ <div class="trust-promise__icon-wrap" aria-hidden="true">
10
+ {% if item.icon != blank %}
11
+ <img class="trust-promise__icon" src="{{ item.icon }}" alt="" width="36" height="36" loading="lazy" />
12
+ {% else %}
13
+ <span class="trust-promise__icon-fallback"></span>
14
+ {% endif %}
15
+ </div>
16
+ <div class="trust-promise__text">
17
+ {% if item.title != blank %}
18
+ <h3 class="trust-promise__title">{{ item.title }}</h3>
19
+ {% endif %}
20
+ {% if item.text != blank %}
21
+ <p class="trust-promise__desc">{{ item.text }}</p>
22
+ {% endif %}
23
+ </div>
24
+ </div>
25
+ {% endfor %}
26
+ </div>
27
+ {% endif %}
28
+ </section>
29
+
30
+ <style>
31
+ .trust-promise {
32
+ padding: 1.75rem 1.25rem;
33
+ border-block: 1px solid rgba(20, 18, 24, 0.06);
34
+ }
35
+ .trust-promise--soft {
36
+ background: #faf8f5;
37
+ color: #2a2622;
38
+ }
39
+ .trust-promise--contrast {
40
+ background: #141218;
41
+ color: #f4eee6;
42
+ border-color: rgba(255, 255, 255, 0.08);
43
+ }
44
+ .trust-promise__row {
45
+ max-width: 1100px;
46
+ margin: 0 auto;
47
+ display: grid;
48
+ gap: 1.5rem 2rem;
49
+ grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
50
+ align-items: flex-start;
51
+ }
52
+ .trust-promise__item {
53
+ display: flex;
54
+ gap: 1rem;
55
+ align-items: flex-start;
56
+ }
57
+ .trust-promise__icon-wrap {
58
+ flex-shrink: 0;
59
+ width: 44px;
60
+ height: 44px;
61
+ border-radius: 50%;
62
+ display: flex;
63
+ align-items: center;
64
+ justify-content: center;
65
+ background: color-mix(in srgb, var(--tp-accent, #c9a962) 16%, transparent);
66
+ border: 1px solid color-mix(in srgb, var(--tp-accent, #c9a962) 35%, transparent);
67
+ }
68
+ .trust-promise--contrast .trust-promise__icon-wrap {
69
+ background: rgba(255, 255, 255, 0.06);
70
+ border-color: rgba(255, 255, 255, 0.12);
71
+ }
72
+ .trust-promise__icon {
73
+ width: 22px;
74
+ height: 22px;
75
+ object-fit: contain;
76
+ }
77
+ .trust-promise__icon-fallback {
78
+ width: 10px;
79
+ height: 10px;
80
+ border-radius: 50%;
81
+ background: var(--tp-accent, #c9a962);
82
+ box-shadow: 0 0 0 3px color-mix(in srgb, var(--tp-accent, #c9a962) 35%, transparent);
83
+ }
84
+ .trust-promise__title {
85
+ margin: 0 0 0.35rem;
86
+ font-size: 0.95rem;
87
+ font-weight: 600;
88
+ letter-spacing: 0.02em;
89
+ }
90
+ .trust-promise__desc {
91
+ margin: 0;
92
+ font-size: 0.88rem;
93
+ line-height: 1.55;
94
+ opacity: 0.82;
95
+ }
96
+ </style>
@@ -75,6 +75,12 @@
75
75
  "name": "hero_slides",
76
76
  "type": "object_array",
77
77
  "fields": [
78
+ {
79
+ "name": "image",
80
+ "type": "image",
81
+ "default": "",
82
+ "description": "Slide background image"
83
+ },
78
84
  {
79
85
  "name": "title",
80
86
  "type": "string",
@@ -373,6 +373,178 @@
373
373
  }
374
374
  });
375
375
  }
376
+ function h() {
377
+ function m(root) {
378
+ var wrap = root.closest("[data-eo-api-base]");
379
+ if (wrap && wrap.getAttribute("data-eo-api-base")) {
380
+ return wrap.getAttribute("data-eo-api-base").replace(/\/$/, "");
381
+ }
382
+ if (typeof window.__EO_STORE_API_BASE__ === "string" && window.__EO_STORE_API_BASE__) {
383
+ return window.__EO_STORE_API_BASE__.replace(/\/$/, "");
384
+ }
385
+ return "https://api.easyorders.dev/api/v1";
386
+ }
387
+ function p(body) {
388
+ if (Array.isArray(body)) return body;
389
+ if (body && Array.isArray(body.data)) return body.data;
390
+ return [];
391
+ }
392
+ document.querySelectorAll("[data-eo-hs-entity]:not([data-eo-hs-done])").forEach(function (root) {
393
+ var base = m(root);
394
+ var mount = root.querySelector("[data-eo-hs-mount]");
395
+ var idsStr = root.getAttribute("data-eo-hs-ids") || "";
396
+ var ids = idsStr
397
+ .split(",")
398
+ .map(function (s) {
399
+ return s.trim();
400
+ })
401
+ .filter(Boolean);
402
+ if (!base || !mount || ids.length === 0) {
403
+ root.setAttribute("data-eo-hs-done", "1");
404
+ return;
405
+ }
406
+ root.setAttribute("data-eo-hs-done", "1");
407
+ var entity = root.getAttribute("data-eo-hs-entity") || "";
408
+ var path =
409
+ entity === "categories"
410
+ ? "categories"
411
+ : entity === "pages"
412
+ ? "simple-pages"
413
+ : "products";
414
+ var url =
415
+ base.replace(/\/$/, "") +
416
+ "/" +
417
+ path +
418
+ "?filter=id||$in||" +
419
+ ids.join(",") +
420
+ "&limit=" +
421
+ ids.length;
422
+ mount.classList.add("eo-hs-loading");
423
+ fetch(url, { credentials: "omit", headers: { Accept: "application/json" } })
424
+ .then(function (res) {
425
+ return res.ok ? res.json() : Promise.reject(new Error(String(res.status)));
426
+ })
427
+ .then(function (body) {
428
+ var rows = p(body);
429
+ var byId = {};
430
+ rows.forEach(function (row) {
431
+ if (row && row.id != null) byId[String(row.id)] = row;
432
+ });
433
+ var frag = document.createDocumentFragment();
434
+ ids.forEach(function (id) {
435
+ var row = byId[id];
436
+ if (!row) return;
437
+ if (entity === "products") {
438
+ var slug = row.slug || "";
439
+ var name = row.name || "";
440
+ var thumb = row.thumb || "";
441
+ var price =
442
+ row.sale_price != null && row.price != null && row.sale_price < row.price
443
+ ? row.sale_price
444
+ : row.price;
445
+ var el = document.createElement("a");
446
+ el.className = "eo-hs-card eo-hs-card--product";
447
+ el.href = slug ? "/products/" + encodeURIComponent(slug) : "#";
448
+ el.innerHTML =
449
+ (thumb
450
+ ? '<span class="eo-hs-card__media"><img src="' +
451
+ String(thumb).replace(/"/g, "") +
452
+ '" alt="" loading="lazy" width="280" height="350" /></span>'
453
+ : '<span class="eo-hs-card__media eo-hs-card__media--empty"></span>') +
454
+ '<span class="eo-hs-card__body"><span class="eo-hs-card__title">' +
455
+ String(name || "").replace(/</g, "&lt;") +
456
+ "</span>" +
457
+ (price != null
458
+ ? '<span class="eo-hs-card__meta">' + String(price) + "</span>"
459
+ : "") +
460
+ "</span>";
461
+ frag.appendChild(el);
462
+ } else if (entity === "categories") {
463
+ var cslug = row.slug || "";
464
+ var cname = row.name || "";
465
+ var cthumb = row.thumb || "";
466
+ var ca = document.createElement("a");
467
+ ca.className = "eo-hs-card eo-hs-card--category";
468
+ ca.href = cslug ? "/collections/" + encodeURIComponent(cslug) : "#";
469
+ ca.innerHTML =
470
+ (cthumb
471
+ ? '<span class="eo-hs-card__media"><img src="' +
472
+ String(cthumb).replace(/"/g, "") +
473
+ '" alt="" loading="lazy" width="320" height="200" /></span>'
474
+ : '<span class="eo-hs-card__media eo-hs-card__media--empty"></span>') +
475
+ '<span class="eo-hs-card__body"><span class="eo-hs-card__title">' +
476
+ String(cname || "").replace(/</g, "&lt;") +
477
+ "</span></span>";
478
+ frag.appendChild(ca);
479
+ } else {
480
+ var pslug = row.slug || "";
481
+ var ptitle = row.title || "";
482
+ var pa = document.createElement("a");
483
+ pa.className = "eo-hs-card eo-hs-card--page";
484
+ pa.href = pslug ? "/pages/" + encodeURIComponent(pslug) : "#";
485
+ pa.innerHTML =
486
+ '<span class="eo-hs-card__body"><span class="eo-hs-card__title">' +
487
+ String(ptitle || "").replace(/</g, "&lt;") +
488
+ "</span></span>";
489
+ frag.appendChild(pa);
490
+ }
491
+ });
492
+ mount.textContent = "";
493
+ mount.appendChild(frag);
494
+ mount.classList.remove("eo-hs-loading");
495
+ root.classList.remove("eo-hs--empty");
496
+ })
497
+ .catch(function () {
498
+ mount.classList.remove("eo-hs-loading");
499
+ mount.innerHTML =
500
+ '<p class="eo-hs-error" role="status">Unable to load this block. Check your connection or try again later.</p>';
501
+ });
502
+ });
503
+ }
504
+ function d() {
505
+ function b(el) {
506
+ var wrap = el.closest("[data-eo-api-base]");
507
+ if (wrap && wrap.getAttribute("data-eo-api-base")) {
508
+ return wrap.getAttribute("data-eo-api-base").replace(/\/$/, "");
509
+ }
510
+ if (typeof window.__EO_STORE_API_BASE__ === "string" && window.__EO_STORE_API_BASE__) {
511
+ return window.__EO_STORE_API_BASE__.replace(/\/$/, "");
512
+ }
513
+ return "https://api.easyorders.dev/api/v1";
514
+ }
515
+ document.querySelectorAll("a[data-eo-hs-cta]:not([data-eo-hs-cta-done])").forEach(function (a) {
516
+ var id = String(a.getAttribute("data-eo-hs-cta-id") || "").trim();
517
+ var entity = a.getAttribute("data-eo-hs-cta-entity") || "";
518
+ a.setAttribute("data-eo-hs-cta-done", "1");
519
+ if (!id) return;
520
+ var base = b(a);
521
+ var path =
522
+ entity === "categories"
523
+ ? "categories"
524
+ : entity === "pages"
525
+ ? "simple-pages"
526
+ : "products";
527
+ var url =
528
+ base.replace(/\/$/, "") +
529
+ "/" +
530
+ path +
531
+ "?filter=id||$in||" + id + "&limit=1";
532
+ fetch(url, { credentials: "omit", headers: { Accept: "application/json" } })
533
+ .then(function (res) {
534
+ return res.ok ? res.json() : Promise.reject(new Error(String(res.status)));
535
+ })
536
+ .then(function (body) {
537
+ var rows = Array.isArray(body) ? body : body && Array.isArray(body.data) ? body.data : [];
538
+ var row = rows[0];
539
+ if (!row) return;
540
+ var slug = row.slug || "";
541
+ if (entity === "categories" && slug) a.href = "/collections/" + encodeURIComponent(slug);
542
+ else if (entity === "pages" && slug) a.href = "/pages/" + encodeURIComponent(slug);
543
+ else if (entity === "products" && slug) a.href = "/products/" + encodeURIComponent(slug);
544
+ })
545
+ .catch(function () {});
546
+ });
547
+ }
376
548
  e(),
377
549
  t(),
378
550
  a(),
@@ -381,6 +553,8 @@
381
553
  o(),
382
554
  u(),
383
555
  v(),
556
+ h(),
557
+ d(),
384
558
  window.__abGalleryKeyInit ||
385
559
  ((window.__abGalleryKeyInit = !0),
386
560
  document.addEventListener("keydown", function (e) {
@@ -407,6 +581,6 @@
407
581
  l(),
408
582
  s(),
409
583
  new MutationObserver(function () {
410
- e(), t(), a(), n(), r(), o(), u(), v(), i(), c(), l(), s();
584
+ e(), t(), a(), n(), r(), o(), u(), v(), h(), d(), i(), c(), l(), s();
411
585
  }).observe(document.body, { childList: !0, subtree: !0 });
412
586
  })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easyorders",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
4
4
  "description": "CLI tool for creating and developing Easy Orders themes",
5
5
  "type": "module",
6
6
  "bin": {