veleta-templates 0.0.4 → 0.0.6
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/dist/cjs/veleta-boston-template.cjs.entry.js +36 -5
- package/dist/collection/components/boston-template/boston-template.css +28 -10
- package/dist/collection/components/boston-template/boston-template.js +35 -4
- package/dist/collection/components/boston-template/boston-template.js.map +1 -1
- package/dist/components/veleta-boston-template.js +36 -5
- package/dist/components/veleta-boston-template.js.map +1 -1
- package/dist/esm/veleta-boston-template.entry.js +36 -5
- package/dist/esm/veleta-boston-template.entry.js.map +1 -1
- package/dist/esm-es5/veleta-boston-template.entry.js +1 -1
- package/dist/esm-es5/veleta-boston-template.entry.js.map +1 -1
- package/dist/types/components/boston-template/boston-template.d.ts +5 -0
- package/dist/veleta-templates/p-05409397.entry.js +2 -0
- package/dist/veleta-templates/p-05409397.entry.js.map +1 -0
- package/dist/veleta-templates/p-620b67d2.system.entry.js +2 -0
- package/dist/veleta-templates/p-620b67d2.system.entry.js.map +1 -0
- package/dist/veleta-templates/p-D1BkLoGd.system.js +1 -1
- package/dist/veleta-templates/veleta-templates.esm.js +1 -1
- package/package.json +1 -1
- package/dist/veleta-templates/p-23aa6aa2.entry.js +0 -2
- package/dist/veleta-templates/p-23aa6aa2.entry.js.map +0 -1
- package/dist/veleta-templates/p-83a66176.system.entry.js +0 -2
- package/dist/veleta-templates/p-83a66176.system.entry.js.map +0 -1
|
@@ -65,7 +65,7 @@ function formatPrice(price) {
|
|
|
65
65
|
return (price % 1 === 0 ? price.toString() : price.toFixed(2)) + '€';
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
const bostonTemplateCss = () => `.menu-wrapper{min-height:100vh;width:100%;padding:1.5rem 1rem;font-family:'Merriweather', serif;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;display:block}.menu-wrapper *,.menu-wrapper *::before,.menu-wrapper *::after{-webkit-box-sizing:border-box;box-sizing:border-box}.menu-wrapper h1,.menu-wrapper h2,.menu-wrapper h3,.menu-wrapper h4,.menu-wrapper h5,.menu-wrapper h6,.menu-wrapper p,.menu-wrapper ul,.menu-wrapper ol,.menu-wrapper li,.menu-wrapper header,.menu-wrapper section,.menu-wrapper article,.menu-wrapper aside,.menu-wrapper nav,.menu-wrapper blockquote,.menu-wrapper figure,.menu-wrapper figcaption{margin:0;-webkit-margin-before:0;margin-block-start:0;-webkit-margin-after:0;margin-block-end:0;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:0;margin-inline-end:0}.menu-wrapper ul,.menu-wrapper ol{padding:0}@media (min-width: 640px){.menu-wrapper{padding:2rem 1.5rem}}@media (min-width: 768px){.menu-wrapper{padding:2rem 1rem}}.menu-container{max-width:1280px;margin:0 auto}.menu-header{text-align:center}@media (min-width: 768px){.menu-header{margin-bottom:3rem}}.restaurant-title{font-size:2rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;line-height:1.1;margin:0 0 1.5rem 0!important}@media (min-width: 640px){.restaurant-title{font-size:2.5rem;margin:0 0 3rem 0!important}}@media (min-width: 768px){.restaurant-title{font-size:3rem}}@media (min-width: 1024px){.restaurant-title{font-size:3.5rem}}.sections-container{display:grid;grid-template-columns:1fr;gap:
|
|
68
|
+
const bostonTemplateCss = () => `.menu-wrapper{min-height:100vh;width:100%;padding:1.5rem 1rem;font-family:'Merriweather', serif;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;display:block}.menu-wrapper *,.menu-wrapper *::before,.menu-wrapper *::after{-webkit-box-sizing:border-box;box-sizing:border-box}.animate-item{opacity:0;-webkit-transform:translateY(30px);transform:translateY(30px);-webkit-transition:opacity 0.8s ease-out, -webkit-transform 0.8s ease-out;transition:opacity 0.8s ease-out, -webkit-transform 0.8s ease-out;transition:opacity 0.8s ease-out, transform 0.8s ease-out;transition:opacity 0.8s ease-out, transform 0.8s ease-out, -webkit-transform 0.8s ease-out;will-change:opacity, transform}.animate-item.is-visible{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}.menu-wrapper h1,.menu-wrapper h2,.menu-wrapper h3,.menu-wrapper h4,.menu-wrapper h5,.menu-wrapper h6,.menu-wrapper p,.menu-wrapper ul,.menu-wrapper ol,.menu-wrapper li,.menu-wrapper header,.menu-wrapper section,.menu-wrapper article,.menu-wrapper aside,.menu-wrapper nav,.menu-wrapper blockquote,.menu-wrapper figure,.menu-wrapper figcaption{margin:0;-webkit-margin-before:0;margin-block-start:0;-webkit-margin-after:0;margin-block-end:0;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:0;margin-inline-end:0}.menu-wrapper ul,.menu-wrapper ol{padding:0}@media (min-width: 640px){.menu-wrapper{padding:2rem 1.5rem}}@media (min-width: 768px){.menu-wrapper{padding:2rem 1rem}}.menu-container{max-width:1280px;margin:0 auto}.menu-header{text-align:center}@media (min-width: 768px){.menu-header{margin-bottom:3rem}}.restaurant-title{font-size:2rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;line-height:1.1;margin:0 0 1.5rem 0 !important}@media (min-width: 640px){.restaurant-title{font-size:2.5rem;margin:0 0 3rem 0 !important}}@media (min-width: 768px){.restaurant-title{font-size:3rem}}@media (min-width: 1024px){.restaurant-title{font-size:3.5rem}}.sections-container{display:grid;grid-template-columns:1fr;gap:4rem}@media (min-width: 768px){.sections-container{grid-template-columns:repeat(2, 1fr);gap:3rem}}.menu-section{display:-ms-flexbox;display:flex;width:100%;position:relative}.section-label-wrapper{position:relative;width:3rem;-ms-flex-negative:0;flex-shrink:0;margin-right:1rem;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}.section-label-line{position:absolute;right:0;top:0;bottom:0;width:1px;border-right:1px solid}.section-label{font-weight:700;font-size:1.125rem;text-transform:uppercase;letter-spacing:0.15em;-webkit-writing-mode:vertical-rl;-ms-writing-mode:tb-rl;writing-mode:vertical-rl;-webkit-transform:rotate(180deg);transform:rotate(180deg);text-align:right;white-space:nowrap;margin:0 0 0.5rem 0;-webkit-margin-after:0.5rem;margin-block-end:0.5rem;position:absolute;top:0}@media (min-width: 640px){.section-label{font-size:1.2375rem}}@media (min-width: 768px){.section-label{font-size:1.35rem}}@media (min-width: 1024px){.section-label{font-size:1.51875rem}}.section-content{-ms-flex:1;flex:1;padding-top:0.25rem}.section-description{font-size:0.875rem;font-style:italic;margin:0 0 1rem 0 !important;-webkit-margin-after:1rem;margin-block-end:1rem;opacity:0.75;color:inherit}@media (min-width: 640px){.section-description{font-size:0.9625rem}}@media (min-width: 768px){.section-description{font-size:1.05rem}}@media (min-width: 1024px){.section-description{font-size:1.18125rem}}.dishes-list{list-style:none;padding:0;margin:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:1rem}.dish-item{position:relative}.dish-header{display:-ms-flexbox;display:flex;-ms-flex-align:baseline;align-items:baseline;width:100%;gap:0.5rem}.dish-name{font-size:1rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;-ms-flex-negative:1;flex-shrink:1;min-width:0;overflow-wrap:break-word}@media (min-width: 640px){.dish-name{font-size:1.1rem}}@media (min-width: 768px){.dish-name{font-size:1.2rem}}@media (min-width: 1024px){.dish-name{font-size:1.35rem}}.dish-dots{-ms-flex:1;flex:1;opacity:0.25;border-bottom:2px dotted;margin:0 0.55rem;position:relative;-webkit-transform:translateY(-5px);transform:translateY(-5px);border-color:currentColor;min-width:1rem}.dish-price{font-size:1rem;font-weight:700;-ms-flex-negative:0;flex-shrink:0;text-align:right;min-width:3ch}@media (min-width: 640px){.dish-price{font-size:1.1rem}}@media (min-width: 768px){.dish-price{font-size:1.2rem}}@media (min-width: 1024px){.dish-price{font-size:1.35rem}}.dish-description{font-size:0.8125rem;margin-top:0.25rem;line-height:1.4;opacity:0.7;color:inherit;width:100%}@media (min-width: 640px){.dish-description{font-size:0.9425rem}}`;
|
|
69
69
|
|
|
70
70
|
const BostonTemplate = class {
|
|
71
71
|
constructor(hostRef) {
|
|
@@ -81,6 +81,37 @@ const BostonTemplate = class {
|
|
|
81
81
|
await loadFonts(this.fontConfig);
|
|
82
82
|
applyFontFamily(this.el, 'Merriweather, serif');
|
|
83
83
|
}
|
|
84
|
+
componentDidLoad() {
|
|
85
|
+
this.initObserver();
|
|
86
|
+
}
|
|
87
|
+
componentDidUpdate() {
|
|
88
|
+
this.initObserver();
|
|
89
|
+
}
|
|
90
|
+
disconnectedCallback() {
|
|
91
|
+
if (this.observer) {
|
|
92
|
+
this.observer.disconnect();
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
initObserver() {
|
|
96
|
+
if (this.observer) {
|
|
97
|
+
this.observer.disconnect();
|
|
98
|
+
}
|
|
99
|
+
this.observer = new IntersectionObserver((entries) => {
|
|
100
|
+
entries.forEach((entry) => {
|
|
101
|
+
if (entry.isIntersecting) {
|
|
102
|
+
const target = entry.target;
|
|
103
|
+
target.classList.add('is-visible');
|
|
104
|
+
// Stop observing once visible to avoid re-animating
|
|
105
|
+
this.observer.unobserve(target);
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
}, {
|
|
109
|
+
threshold: 0.1,
|
|
110
|
+
rootMargin: '0px 0px -50px 0px',
|
|
111
|
+
});
|
|
112
|
+
const elements = this.el.querySelectorAll('.animate-item');
|
|
113
|
+
elements.forEach((el) => this.observer.observe(el));
|
|
114
|
+
}
|
|
84
115
|
render() {
|
|
85
116
|
var _a;
|
|
86
117
|
let menuData = null;
|
|
@@ -92,20 +123,20 @@ const BostonTemplate = class {
|
|
|
92
123
|
}
|
|
93
124
|
const theme = (_a = menuData === null || menuData === void 0 ? void 0 : menuData.templateData) === null || _a === void 0 ? void 0 : _a.theme;
|
|
94
125
|
const primary = (theme === null || theme === void 0 ? void 0 : theme.primaryColor) || '#1a365d';
|
|
126
|
+
const background = (theme === null || theme === void 0 ? void 0 : theme.backgroundColor) || '#FFFFFF';
|
|
95
127
|
const fontBody = 'Merriweather, serif';
|
|
96
128
|
const fontTitle = 'Oswald, sans-serif';
|
|
97
129
|
if (!menuData) {
|
|
98
|
-
return index.h("div", { class: "menu-wrapper", style: { color: primary } });
|
|
130
|
+
return index.h("div", { class: "menu-wrapper", style: { color: primary, backgroundColor: background } });
|
|
99
131
|
}
|
|
100
132
|
const { sections, business } = menuData;
|
|
101
133
|
// Ordenar secciones por 'order'
|
|
102
134
|
const sortedSections = (sections || []).sort((a, b) => a.order - b.order);
|
|
103
|
-
return (index.h("div", { class: "menu-wrapper", style: { color: primary } }, index.h("div", { class: "menu-container" }, (business === null || business === void 0 ? void 0 : business.name) && (index.h("header", { class: "menu-header" }, index.h("h1", { class: "restaurant-title", style: { fontFamily: fontTitle } }, business.name))), index.h("div", { class: "sections-container" }, sortedSections.map(section => {
|
|
104
|
-
// Ordenar platos por 'order'
|
|
135
|
+
return (index.h("div", { class: "menu-wrapper", style: { color: primary, backgroundColor: background } }, index.h("div", { class: "menu-container" }, (business === null || business === void 0 ? void 0 : business.name) && (index.h("header", { class: "menu-header" }, index.h("h1", { class: "restaurant-title animate-item", style: { fontFamily: fontTitle } }, business.name))), index.h("div", { class: "sections-container" }, sortedSections.map(section => {
|
|
105
136
|
const sectionDishes = (section.dishes || []).sort((a, b) => a.order - b.order);
|
|
106
137
|
if (!sectionDishes.length)
|
|
107
138
|
return null;
|
|
108
|
-
return (index.h("section", { key: section.id, class: "menu-section" }, index.h("div", { class: "section-label-wrapper" }, index.h("div", { class: "section-label-line", style: { borderColor: primary } }), index.h("h2", { class: "section-label", style: { fontFamily: fontTitle, color: primary } }, section.title)), index.h("div", { class: "section-content" }, section.description && (index.h("p", { class: "section-description", style: { fontFamily: fontBody } }, section.description)), index.h("ul", { class: "dishes-list" }, sectionDishes.map(dish => (index.h("li", { key: dish.id, class: "dish-item" }, index.h("div", { class: "dish-header" }, index.h("h3", { class: "dish-name", style: { fontFamily: fontTitle, color: primary } }, dish.name), index.h("div", { class: "dish-dots" }), index.h("span", { class: "dish-price", style: { fontFamily: fontTitle, color: primary } }, formatPrice(dish.price))), dish.description && (index.h("p", { class: "dish-description", style: { fontFamily: fontBody } }, dish.description)))))))));
|
|
139
|
+
return (index.h("section", { key: section.id, class: "menu-section animate-item" }, index.h("div", { class: "section-label-wrapper" }, index.h("div", { class: "section-label-line", style: { borderColor: primary } }), index.h("h2", { class: "section-label", style: { fontFamily: fontTitle, color: primary } }, section.title)), index.h("div", { class: "section-content" }, section.description && (index.h("p", { class: "section-description", style: { fontFamily: fontBody } }, section.description)), index.h("ul", { class: "dishes-list" }, sectionDishes.map((dish, index$1) => (index.h("li", { key: dish.id, class: "dish-item animate-item", style: { transitionDelay: `${index$1 * 50}ms` } }, index.h("div", { class: "dish-header" }, index.h("h3", { class: "dish-name", style: { fontFamily: fontTitle, color: primary } }, dish.name), index.h("div", { class: "dish-dots" }), index.h("span", { class: "dish-price", style: { fontFamily: fontTitle, color: primary } }, formatPrice(dish.price))), dish.description && (index.h("p", { class: "dish-description", style: { fontFamily: fontBody } }, dish.description)))))))));
|
|
109
140
|
})))));
|
|
110
141
|
}
|
|
111
142
|
get el() { return index.getElement(this); }
|
|
@@ -16,6 +16,19 @@
|
|
|
16
16
|
box-sizing: border-box;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
/* Animaciones Nativas */
|
|
20
|
+
.animate-item {
|
|
21
|
+
opacity: 0;
|
|
22
|
+
transform: translateY(30px);
|
|
23
|
+
transition: opacity 0.8s ease-out, transform 0.8s ease-out;
|
|
24
|
+
will-change: opacity, transform;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.animate-item.is-visible {
|
|
28
|
+
opacity: 1;
|
|
29
|
+
transform: translateY(0);
|
|
30
|
+
}
|
|
31
|
+
|
|
19
32
|
/* Reset completo de márgenes para todos los elementos HTML comunes */
|
|
20
33
|
.menu-wrapper h1,
|
|
21
34
|
.menu-wrapper h2,
|
|
@@ -81,13 +94,13 @@
|
|
|
81
94
|
text-transform: uppercase;
|
|
82
95
|
letter-spacing: 0.05em;
|
|
83
96
|
line-height: 1.1;
|
|
84
|
-
margin: 0 0 1.5rem 0!important;
|
|
97
|
+
margin: 0 0 1.5rem 0 !important;
|
|
85
98
|
}
|
|
86
99
|
|
|
87
100
|
@media (min-width: 640px) {
|
|
88
101
|
.restaurant-title {
|
|
89
102
|
font-size: 2.5rem;
|
|
90
|
-
margin: 0 0 3rem 0!important;
|
|
103
|
+
margin: 0 0 3rem 0 !important;
|
|
91
104
|
}
|
|
92
105
|
}
|
|
93
106
|
|
|
@@ -106,13 +119,13 @@
|
|
|
106
119
|
.sections-container {
|
|
107
120
|
display: grid;
|
|
108
121
|
grid-template-columns: 1fr;
|
|
109
|
-
gap:
|
|
122
|
+
gap: 4rem;
|
|
110
123
|
}
|
|
111
124
|
|
|
112
125
|
@media (min-width: 768px) {
|
|
113
126
|
.sections-container {
|
|
114
127
|
grid-template-columns: repeat(2, 1fr);
|
|
115
|
-
gap:
|
|
128
|
+
gap: 3rem;
|
|
116
129
|
}
|
|
117
130
|
}
|
|
118
131
|
|
|
@@ -185,7 +198,7 @@
|
|
|
185
198
|
.section-description {
|
|
186
199
|
font-size: 0.875rem;
|
|
187
200
|
font-style: italic;
|
|
188
|
-
margin: 0 0 1rem 0!important;
|
|
201
|
+
margin: 0 0 1rem 0 !important;
|
|
189
202
|
margin-block-end: 1rem;
|
|
190
203
|
opacity: 0.75;
|
|
191
204
|
color: inherit;
|
|
@@ -234,7 +247,9 @@
|
|
|
234
247
|
font-weight: 700;
|
|
235
248
|
text-transform: uppercase;
|
|
236
249
|
letter-spacing: 0.05em;
|
|
237
|
-
flex-shrink:
|
|
250
|
+
flex-shrink: 1;
|
|
251
|
+
min-width: 0;
|
|
252
|
+
overflow-wrap: break-word;
|
|
238
253
|
}
|
|
239
254
|
|
|
240
255
|
@media (min-width: 640px) {
|
|
@@ -258,11 +273,12 @@
|
|
|
258
273
|
.dish-dots {
|
|
259
274
|
flex: 1;
|
|
260
275
|
opacity: 0.25;
|
|
261
|
-
border-bottom:
|
|
276
|
+
border-bottom: 2px dotted;
|
|
262
277
|
margin: 0 0.55rem;
|
|
263
278
|
position: relative;
|
|
264
|
-
|
|
279
|
+
transform: translateY(-5px);
|
|
265
280
|
border-color: currentColor;
|
|
281
|
+
min-width: 1rem;
|
|
266
282
|
}
|
|
267
283
|
|
|
268
284
|
.dish-price {
|
|
@@ -270,6 +286,7 @@
|
|
|
270
286
|
font-weight: 700;
|
|
271
287
|
flex-shrink: 0;
|
|
272
288
|
text-align: right;
|
|
289
|
+
min-width: 3ch;
|
|
273
290
|
}
|
|
274
291
|
|
|
275
292
|
@media (min-width: 640px) {
|
|
@@ -292,14 +309,15 @@
|
|
|
292
309
|
|
|
293
310
|
.dish-description {
|
|
294
311
|
font-size: 0.8125rem;
|
|
295
|
-
margin-top:
|
|
312
|
+
margin-top: 0.25rem;
|
|
296
313
|
line-height: 1.4;
|
|
297
314
|
opacity: 0.7;
|
|
298
315
|
color: inherit;
|
|
316
|
+
width: 100%;
|
|
299
317
|
}
|
|
300
318
|
|
|
301
319
|
@media (min-width: 640px) {
|
|
302
320
|
.dish-description {
|
|
303
321
|
font-size: 0.9425rem;
|
|
304
322
|
}
|
|
305
|
-
}
|
|
323
|
+
}
|
|
@@ -14,6 +14,37 @@ export class BostonTemplate {
|
|
|
14
14
|
await loadFonts(this.fontConfig);
|
|
15
15
|
applyFontFamily(this.el, 'Merriweather, serif');
|
|
16
16
|
}
|
|
17
|
+
componentDidLoad() {
|
|
18
|
+
this.initObserver();
|
|
19
|
+
}
|
|
20
|
+
componentDidUpdate() {
|
|
21
|
+
this.initObserver();
|
|
22
|
+
}
|
|
23
|
+
disconnectedCallback() {
|
|
24
|
+
if (this.observer) {
|
|
25
|
+
this.observer.disconnect();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
initObserver() {
|
|
29
|
+
if (this.observer) {
|
|
30
|
+
this.observer.disconnect();
|
|
31
|
+
}
|
|
32
|
+
this.observer = new IntersectionObserver((entries) => {
|
|
33
|
+
entries.forEach((entry) => {
|
|
34
|
+
if (entry.isIntersecting) {
|
|
35
|
+
const target = entry.target;
|
|
36
|
+
target.classList.add('is-visible');
|
|
37
|
+
// Stop observing once visible to avoid re-animating
|
|
38
|
+
this.observer.unobserve(target);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}, {
|
|
42
|
+
threshold: 0.1,
|
|
43
|
+
rootMargin: '0px 0px -50px 0px',
|
|
44
|
+
});
|
|
45
|
+
const elements = this.el.querySelectorAll('.animate-item');
|
|
46
|
+
elements.forEach((el) => this.observer.observe(el));
|
|
47
|
+
}
|
|
17
48
|
render() {
|
|
18
49
|
var _a;
|
|
19
50
|
let menuData = null;
|
|
@@ -25,20 +56,20 @@ export class BostonTemplate {
|
|
|
25
56
|
}
|
|
26
57
|
const theme = (_a = menuData === null || menuData === void 0 ? void 0 : menuData.templateData) === null || _a === void 0 ? void 0 : _a.theme;
|
|
27
58
|
const primary = (theme === null || theme === void 0 ? void 0 : theme.primaryColor) || '#1a365d';
|
|
59
|
+
const background = (theme === null || theme === void 0 ? void 0 : theme.backgroundColor) || '#FFFFFF';
|
|
28
60
|
const fontBody = 'Merriweather, serif';
|
|
29
61
|
const fontTitle = 'Oswald, sans-serif';
|
|
30
62
|
if (!menuData) {
|
|
31
|
-
return h("div", { class: "menu-wrapper", style: { color: primary } });
|
|
63
|
+
return h("div", { class: "menu-wrapper", style: { color: primary, backgroundColor: background } });
|
|
32
64
|
}
|
|
33
65
|
const { sections, business } = menuData;
|
|
34
66
|
// Ordenar secciones por 'order'
|
|
35
67
|
const sortedSections = (sections || []).sort((a, b) => a.order - b.order);
|
|
36
|
-
return (h("div", { class: "menu-wrapper", style: { color: primary } }, h("div", { class: "menu-container" }, (business === null || business === void 0 ? void 0 : business.name) && (h("header", { class: "menu-header" }, h("h1", { class: "restaurant-title", style: { fontFamily: fontTitle } }, business.name))), h("div", { class: "sections-container" }, sortedSections.map(section => {
|
|
37
|
-
// Ordenar platos por 'order'
|
|
68
|
+
return (h("div", { class: "menu-wrapper", style: { color: primary, backgroundColor: background } }, h("div", { class: "menu-container" }, (business === null || business === void 0 ? void 0 : business.name) && (h("header", { class: "menu-header" }, h("h1", { class: "restaurant-title animate-item", style: { fontFamily: fontTitle } }, business.name))), h("div", { class: "sections-container" }, sortedSections.map(section => {
|
|
38
69
|
const sectionDishes = (section.dishes || []).sort((a, b) => a.order - b.order);
|
|
39
70
|
if (!sectionDishes.length)
|
|
40
71
|
return null;
|
|
41
|
-
return (h("section", { key: section.id, class: "menu-section" }, h("div", { class: "section-label-wrapper" }, h("div", { class: "section-label-line", style: { borderColor: primary } }), h("h2", { class: "section-label", style: { fontFamily: fontTitle, color: primary } }, section.title)), h("div", { class: "section-content" }, section.description && (h("p", { class: "section-description", style: { fontFamily: fontBody } }, section.description)), h("ul", { class: "dishes-list" }, sectionDishes.map(dish => (h("li", { key: dish.id, class: "dish-item" }, h("div", { class: "dish-header" }, h("h3", { class: "dish-name", style: { fontFamily: fontTitle, color: primary } }, dish.name), h("div", { class: "dish-dots" }), h("span", { class: "dish-price", style: { fontFamily: fontTitle, color: primary } }, formatPrice(dish.price))), dish.description && (h("p", { class: "dish-description", style: { fontFamily: fontBody } }, dish.description)))))))));
|
|
72
|
+
return (h("section", { key: section.id, class: "menu-section animate-item" }, h("div", { class: "section-label-wrapper" }, h("div", { class: "section-label-line", style: { borderColor: primary } }), h("h2", { class: "section-label", style: { fontFamily: fontTitle, color: primary } }, section.title)), h("div", { class: "section-content" }, section.description && (h("p", { class: "section-description", style: { fontFamily: fontBody } }, section.description)), h("ul", { class: "dishes-list" }, sectionDishes.map((dish, index) => (h("li", { key: dish.id, class: "dish-item animate-item", style: { transitionDelay: `${index * 50}ms` } }, h("div", { class: "dish-header" }, h("h3", { class: "dish-name", style: { fontFamily: fontTitle, color: primary } }, dish.name), h("div", { class: "dish-dots" }), h("span", { class: "dish-price", style: { fontFamily: fontTitle, color: primary } }, formatPrice(dish.price))), dish.description && (h("p", { class: "dish-description", style: { fontFamily: fontBody } }, dish.description)))))))));
|
|
42
73
|
})))));
|
|
43
74
|
}
|
|
44
75
|
static get is() { return "veleta-boston-template"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boston-template.js","sourceRoot":"","sources":["../../../src/components/boston-template/boston-template.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE5D,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAOvD,MAAM,OAAO,cAAc;IAL3B;QAQU,aAAQ,GAAW,IAAI,CAAC;QAEf,eAAU,GAAG;YAC5B,MAAM,EAAE;gBACN,QAAQ,EAAE,CAAC,oBAAoB,EAAE,0BAA0B,CAAC;aAC7D;SACF,CAAC;
|
|
1
|
+
{"version":3,"file":"boston-template.js","sourceRoot":"","sources":["../../../src/components/boston-template/boston-template.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE5D,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAOvD,MAAM,OAAO,cAAc;IAL3B;QAQU,aAAQ,GAAW,IAAI,CAAC;QAEf,eAAU,GAAG;YAC5B,MAAM,EAAE;gBACN,QAAQ,EAAE,CAAC,oBAAoB,EAAE,0BAA0B,CAAC;aAC7D;SACF,CAAC;KAyJH;IArJC,KAAK,CAAC,iBAAiB;QACrB,MAAM,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACjC,eAAe,CAAC,IAAI,CAAC,EAAE,EAAE,qBAAqB,CAAC,CAAC;IAClD,CAAC;IAED,gBAAgB;QACd,IAAI,CAAC,YAAY,EAAE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AAW,GACZ;oCACP,YACE,KAAK,EAAC,YAAY,EAClB,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,IAE/C,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CACnB,CACH;gCACL,IAAI,CAAC,WAAW,IAAI,CACnB,SAAG,KAAK,EAAC,kBAAkB,EAAC,KAAK,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,IACxD,IAAI,CAAC,WAAW,CACf,CACL,CACE,CACN,CAAC,CACC,CACD,CACE,CACX,CAAC;gBACJ,CAAC,CAAC,CACE,CACF,CACF,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, h, Element } from '@stencil/core';\nimport { Menu } from '../../types/interfaces';\nimport { loadFonts, applyFontFamily } from '../../utils/font-loader';\nimport { formatPrice } from '../../utils/data-helpers';\n\n@Component({\n tag: 'veleta-boston-template',\n styleUrl: 'boston-template.css',\n shadow: false,\n})\nexport class BostonTemplate {\n @Element() el: HTMLElement;\n\n @Prop() dataJson: string = '{}';\n\n private readonly fontConfig = {\n google: {\n families: ['Oswald:400,600,700', 'Merriweather:300,400,700'],\n },\n };\n\n private observer: IntersectionObserver;\n\n async componentWillLoad() {\n await loadFonts(this.fontConfig);\n applyFontFamily(this.el, 'Merriweather, serif');\n }\n\n componentDidLoad() {\n this.initObserver();\n }\n\n componentDidUpdate() {\n this.initObserver();\n }\n\n disconnectedCallback() {\n if (this.observer) {\n this.observer.disconnect();\n }\n }\n\n private initObserver() {\n if (this.observer) {\n this.observer.disconnect();\n }\n\n this.observer = new IntersectionObserver(\n (entries) => {\n entries.forEach((entry) => {\n if (entry.isIntersecting) {\n const target = entry.target as HTMLElement;\n target.classList.add('is-visible');\n // Stop observing once visible to avoid re-animating\n this.observer.unobserve(target);\n }\n });\n },\n {\n threshold: 0.1,\n rootMargin: '0px 0px -50px 0px',\n }\n );\n\n const elements = this.el.querySelectorAll('.animate-item');\n elements.forEach((el) => this.observer.observe(el));\n }\n\n render() {\n let menuData: Menu | null = null;\n try {\n menuData = JSON.parse(this.dataJson);\n } catch (e) {\n console.warn('Invalid dataJson provided to veleta-boston-template');\n }\n\n const theme = menuData?.templateData?.theme;\n const primary = theme?.primaryColor || '#1a365d';\n const background = theme?.backgroundColor || '#FFFFFF';\n const fontBody = 'Merriweather, serif';\n const fontTitle = 'Oswald, sans-serif';\n\n if (!menuData) {\n return <div class=\"menu-wrapper\" style={{ color: primary, backgroundColor: background }}></div>;\n }\n\n const { sections, business } = menuData;\n // Ordenar secciones por 'order'\n const sortedSections = (sections || []).sort((a, b) => a.order - b.order);\n\n return (\n <div\n class=\"menu-wrapper\"\n style={{ color: primary, backgroundColor: background }}\n >\n <div class=\"menu-container\">\n {business?.name && (\n <header class=\"menu-header\">\n <h1\n class=\"restaurant-title animate-item\"\n style={{ fontFamily: fontTitle }}\n >\n {business.name}\n </h1>\n </header>\n )}\n\n <div class=\"sections-container\">\n {sortedSections.map(section => {\n const sectionDishes = (section.dishes || []).sort((a, b) => a.order - b.order);\n if (!sectionDishes.length) return null;\n\n return (\n <section key={section.id} class=\"menu-section animate-item\">\n <div class=\"section-label-wrapper\">\n <div class=\"section-label-line\" style={{ borderColor: primary }}></div>\n <h2\n class=\"section-label\"\n style={{ fontFamily: fontTitle, color: primary }}\n >\n {section.title}\n </h2>\n </div>\n\n <div class=\"section-content\">\n {section.description && (\n <p class=\"section-description\" style={{ fontFamily: fontBody }}>\n {section.description}\n </p>\n )}\n\n <ul class=\"dishes-list\">\n {sectionDishes.map((dish, index) => (\n <li\n key={dish.id}\n class=\"dish-item animate-item\"\n style={{ transitionDelay: `${index * 50}ms` }}\n >\n <div class=\"dish-header\">\n <h3\n class=\"dish-name\"\n style={{ fontFamily: fontTitle, color: primary }}\n >\n {dish.name}\n </h3>\n <div\n class=\"dish-dots\"\n ></div>\n <span\n class=\"dish-price\"\n style={{ fontFamily: fontTitle, color: primary }}\n >\n {formatPrice(dish.price)}\n </span>\n </div>\n {dish.description && (\n <p class=\"dish-description\" style={{ fontFamily: fontBody }}>\n {dish.description}\n </p>\n )}\n </li>\n ))}\n </ul>\n </div>\n </section>\n );\n })}\n </div>\n </div>\n </div>\n );\n }\n}"]}
|
|
@@ -63,7 +63,7 @@ function formatPrice(price) {
|
|
|
63
63
|
return (price % 1 === 0 ? price.toString() : price.toFixed(2)) + '€';
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
const bostonTemplateCss = () => `.menu-wrapper{min-height:100vh;width:100%;padding:1.5rem 1rem;font-family:'Merriweather', serif;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;display:block}.menu-wrapper *,.menu-wrapper *::before,.menu-wrapper *::after{-webkit-box-sizing:border-box;box-sizing:border-box}.menu-wrapper h1,.menu-wrapper h2,.menu-wrapper h3,.menu-wrapper h4,.menu-wrapper h5,.menu-wrapper h6,.menu-wrapper p,.menu-wrapper ul,.menu-wrapper ol,.menu-wrapper li,.menu-wrapper header,.menu-wrapper section,.menu-wrapper article,.menu-wrapper aside,.menu-wrapper nav,.menu-wrapper blockquote,.menu-wrapper figure,.menu-wrapper figcaption{margin:0;-webkit-margin-before:0;margin-block-start:0;-webkit-margin-after:0;margin-block-end:0;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:0;margin-inline-end:0}.menu-wrapper ul,.menu-wrapper ol{padding:0}@media (min-width: 640px){.menu-wrapper{padding:2rem 1.5rem}}@media (min-width: 768px){.menu-wrapper{padding:2rem 1rem}}.menu-container{max-width:1280px;margin:0 auto}.menu-header{text-align:center}@media (min-width: 768px){.menu-header{margin-bottom:3rem}}.restaurant-title{font-size:2rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;line-height:1.1;margin:0 0 1.5rem 0!important}@media (min-width: 640px){.restaurant-title{font-size:2.5rem;margin:0 0 3rem 0!important}}@media (min-width: 768px){.restaurant-title{font-size:3rem}}@media (min-width: 1024px){.restaurant-title{font-size:3.5rem}}.sections-container{display:grid;grid-template-columns:1fr;gap:
|
|
66
|
+
const bostonTemplateCss = () => `.menu-wrapper{min-height:100vh;width:100%;padding:1.5rem 1rem;font-family:'Merriweather', serif;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;display:block}.menu-wrapper *,.menu-wrapper *::before,.menu-wrapper *::after{-webkit-box-sizing:border-box;box-sizing:border-box}.animate-item{opacity:0;-webkit-transform:translateY(30px);transform:translateY(30px);-webkit-transition:opacity 0.8s ease-out, -webkit-transform 0.8s ease-out;transition:opacity 0.8s ease-out, -webkit-transform 0.8s ease-out;transition:opacity 0.8s ease-out, transform 0.8s ease-out;transition:opacity 0.8s ease-out, transform 0.8s ease-out, -webkit-transform 0.8s ease-out;will-change:opacity, transform}.animate-item.is-visible{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}.menu-wrapper h1,.menu-wrapper h2,.menu-wrapper h3,.menu-wrapper h4,.menu-wrapper h5,.menu-wrapper h6,.menu-wrapper p,.menu-wrapper ul,.menu-wrapper ol,.menu-wrapper li,.menu-wrapper header,.menu-wrapper section,.menu-wrapper article,.menu-wrapper aside,.menu-wrapper nav,.menu-wrapper blockquote,.menu-wrapper figure,.menu-wrapper figcaption{margin:0;-webkit-margin-before:0;margin-block-start:0;-webkit-margin-after:0;margin-block-end:0;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:0;margin-inline-end:0}.menu-wrapper ul,.menu-wrapper ol{padding:0}@media (min-width: 640px){.menu-wrapper{padding:2rem 1.5rem}}@media (min-width: 768px){.menu-wrapper{padding:2rem 1rem}}.menu-container{max-width:1280px;margin:0 auto}.menu-header{text-align:center}@media (min-width: 768px){.menu-header{margin-bottom:3rem}}.restaurant-title{font-size:2rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;line-height:1.1;margin:0 0 1.5rem 0 !important}@media (min-width: 640px){.restaurant-title{font-size:2.5rem;margin:0 0 3rem 0 !important}}@media (min-width: 768px){.restaurant-title{font-size:3rem}}@media (min-width: 1024px){.restaurant-title{font-size:3.5rem}}.sections-container{display:grid;grid-template-columns:1fr;gap:4rem}@media (min-width: 768px){.sections-container{grid-template-columns:repeat(2, 1fr);gap:3rem}}.menu-section{display:-ms-flexbox;display:flex;width:100%;position:relative}.section-label-wrapper{position:relative;width:3rem;-ms-flex-negative:0;flex-shrink:0;margin-right:1rem;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}.section-label-line{position:absolute;right:0;top:0;bottom:0;width:1px;border-right:1px solid}.section-label{font-weight:700;font-size:1.125rem;text-transform:uppercase;letter-spacing:0.15em;-webkit-writing-mode:vertical-rl;-ms-writing-mode:tb-rl;writing-mode:vertical-rl;-webkit-transform:rotate(180deg);transform:rotate(180deg);text-align:right;white-space:nowrap;margin:0 0 0.5rem 0;-webkit-margin-after:0.5rem;margin-block-end:0.5rem;position:absolute;top:0}@media (min-width: 640px){.section-label{font-size:1.2375rem}}@media (min-width: 768px){.section-label{font-size:1.35rem}}@media (min-width: 1024px){.section-label{font-size:1.51875rem}}.section-content{-ms-flex:1;flex:1;padding-top:0.25rem}.section-description{font-size:0.875rem;font-style:italic;margin:0 0 1rem 0 !important;-webkit-margin-after:1rem;margin-block-end:1rem;opacity:0.75;color:inherit}@media (min-width: 640px){.section-description{font-size:0.9625rem}}@media (min-width: 768px){.section-description{font-size:1.05rem}}@media (min-width: 1024px){.section-description{font-size:1.18125rem}}.dishes-list{list-style:none;padding:0;margin:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:1rem}.dish-item{position:relative}.dish-header{display:-ms-flexbox;display:flex;-ms-flex-align:baseline;align-items:baseline;width:100%;gap:0.5rem}.dish-name{font-size:1rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;-ms-flex-negative:1;flex-shrink:1;min-width:0;overflow-wrap:break-word}@media (min-width: 640px){.dish-name{font-size:1.1rem}}@media (min-width: 768px){.dish-name{font-size:1.2rem}}@media (min-width: 1024px){.dish-name{font-size:1.35rem}}.dish-dots{-ms-flex:1;flex:1;opacity:0.25;border-bottom:2px dotted;margin:0 0.55rem;position:relative;-webkit-transform:translateY(-5px);transform:translateY(-5px);border-color:currentColor;min-width:1rem}.dish-price{font-size:1rem;font-weight:700;-ms-flex-negative:0;flex-shrink:0;text-align:right;min-width:3ch}@media (min-width: 640px){.dish-price{font-size:1.1rem}}@media (min-width: 768px){.dish-price{font-size:1.2rem}}@media (min-width: 1024px){.dish-price{font-size:1.35rem}}.dish-description{font-size:0.8125rem;margin-top:0.25rem;line-height:1.4;opacity:0.7;color:inherit;width:100%}@media (min-width: 640px){.dish-description{font-size:0.9425rem}}`;
|
|
67
67
|
|
|
68
68
|
const BostonTemplate = /*@__PURE__*/ proxyCustomElement(class BostonTemplate extends H {
|
|
69
69
|
constructor(registerHost) {
|
|
@@ -82,6 +82,37 @@ const BostonTemplate = /*@__PURE__*/ proxyCustomElement(class BostonTemplate ext
|
|
|
82
82
|
await loadFonts(this.fontConfig);
|
|
83
83
|
applyFontFamily(this.el, 'Merriweather, serif');
|
|
84
84
|
}
|
|
85
|
+
componentDidLoad() {
|
|
86
|
+
this.initObserver();
|
|
87
|
+
}
|
|
88
|
+
componentDidUpdate() {
|
|
89
|
+
this.initObserver();
|
|
90
|
+
}
|
|
91
|
+
disconnectedCallback() {
|
|
92
|
+
if (this.observer) {
|
|
93
|
+
this.observer.disconnect();
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
initObserver() {
|
|
97
|
+
if (this.observer) {
|
|
98
|
+
this.observer.disconnect();
|
|
99
|
+
}
|
|
100
|
+
this.observer = new IntersectionObserver((entries) => {
|
|
101
|
+
entries.forEach((entry) => {
|
|
102
|
+
if (entry.isIntersecting) {
|
|
103
|
+
const target = entry.target;
|
|
104
|
+
target.classList.add('is-visible');
|
|
105
|
+
// Stop observing once visible to avoid re-animating
|
|
106
|
+
this.observer.unobserve(target);
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
}, {
|
|
110
|
+
threshold: 0.1,
|
|
111
|
+
rootMargin: '0px 0px -50px 0px',
|
|
112
|
+
});
|
|
113
|
+
const elements = this.el.querySelectorAll('.animate-item');
|
|
114
|
+
elements.forEach((el) => this.observer.observe(el));
|
|
115
|
+
}
|
|
85
116
|
render() {
|
|
86
117
|
var _a;
|
|
87
118
|
let menuData = null;
|
|
@@ -93,20 +124,20 @@ const BostonTemplate = /*@__PURE__*/ proxyCustomElement(class BostonTemplate ext
|
|
|
93
124
|
}
|
|
94
125
|
const theme = (_a = menuData === null || menuData === void 0 ? void 0 : menuData.templateData) === null || _a === void 0 ? void 0 : _a.theme;
|
|
95
126
|
const primary = (theme === null || theme === void 0 ? void 0 : theme.primaryColor) || '#1a365d';
|
|
127
|
+
const background = (theme === null || theme === void 0 ? void 0 : theme.backgroundColor) || '#FFFFFF';
|
|
96
128
|
const fontBody = 'Merriweather, serif';
|
|
97
129
|
const fontTitle = 'Oswald, sans-serif';
|
|
98
130
|
if (!menuData) {
|
|
99
|
-
return h("div", { class: "menu-wrapper", style: { color: primary } });
|
|
131
|
+
return h("div", { class: "menu-wrapper", style: { color: primary, backgroundColor: background } });
|
|
100
132
|
}
|
|
101
133
|
const { sections, business } = menuData;
|
|
102
134
|
// Ordenar secciones por 'order'
|
|
103
135
|
const sortedSections = (sections || []).sort((a, b) => a.order - b.order);
|
|
104
|
-
return (h("div", { class: "menu-wrapper", style: { color: primary } }, h("div", { class: "menu-container" }, (business === null || business === void 0 ? void 0 : business.name) && (h("header", { class: "menu-header" }, h("h1", { class: "restaurant-title", style: { fontFamily: fontTitle } }, business.name))), h("div", { class: "sections-container" }, sortedSections.map(section => {
|
|
105
|
-
// Ordenar platos por 'order'
|
|
136
|
+
return (h("div", { class: "menu-wrapper", style: { color: primary, backgroundColor: background } }, h("div", { class: "menu-container" }, (business === null || business === void 0 ? void 0 : business.name) && (h("header", { class: "menu-header" }, h("h1", { class: "restaurant-title animate-item", style: { fontFamily: fontTitle } }, business.name))), h("div", { class: "sections-container" }, sortedSections.map(section => {
|
|
106
137
|
const sectionDishes = (section.dishes || []).sort((a, b) => a.order - b.order);
|
|
107
138
|
if (!sectionDishes.length)
|
|
108
139
|
return null;
|
|
109
|
-
return (h("section", { key: section.id, class: "menu-section" }, h("div", { class: "section-label-wrapper" }, h("div", { class: "section-label-line", style: { borderColor: primary } }), h("h2", { class: "section-label", style: { fontFamily: fontTitle, color: primary } }, section.title)), h("div", { class: "section-content" }, section.description && (h("p", { class: "section-description", style: { fontFamily: fontBody } }, section.description)), h("ul", { class: "dishes-list" }, sectionDishes.map(dish => (h("li", { key: dish.id, class: "dish-item" }, h("div", { class: "dish-header" }, h("h3", { class: "dish-name", style: { fontFamily: fontTitle, color: primary } }, dish.name), h("div", { class: "dish-dots" }), h("span", { class: "dish-price", style: { fontFamily: fontTitle, color: primary } }, formatPrice(dish.price))), dish.description && (h("p", { class: "dish-description", style: { fontFamily: fontBody } }, dish.description)))))))));
|
|
140
|
+
return (h("section", { key: section.id, class: "menu-section animate-item" }, h("div", { class: "section-label-wrapper" }, h("div", { class: "section-label-line", style: { borderColor: primary } }), h("h2", { class: "section-label", style: { fontFamily: fontTitle, color: primary } }, section.title)), h("div", { class: "section-content" }, section.description && (h("p", { class: "section-description", style: { fontFamily: fontBody } }, section.description)), h("ul", { class: "dishes-list" }, sectionDishes.map((dish, index) => (h("li", { key: dish.id, class: "dish-item animate-item", style: { transitionDelay: `${index * 50}ms` } }, h("div", { class: "dish-header" }, h("h3", { class: "dish-name", style: { fontFamily: fontTitle, color: primary } }, dish.name), h("div", { class: "dish-dots" }), h("span", { class: "dish-price", style: { fontFamily: fontTitle, color: primary } }, formatPrice(dish.price))), dish.description && (h("p", { class: "dish-description", style: { fontFamily: fontBody } }, dish.description)))))))));
|
|
110
141
|
})))));
|
|
111
142
|
}
|
|
112
143
|
get el() { return this; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"veleta-boston-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E,CAAA,MAAA,EAAA,EAAA,KAAK,EAAC,YAAY,EAClB,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,EAAA,EAE/C,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CACnB,CACH,EACL,IAAI,CAAC,WAAW,KACf,CAAG,CAAA,GAAA,EAAA,EAAA,KAAK,EAAC,kBAAkB,EAAC,KAAK,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,EACxD,EAAA,IAAI,CAAC,WAAW,CACf,CACL,CACE,CACN,CAAC,CACC,CACD,CACE;AAEd,SAAC,CAAC,CACE,CACF,CACF;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/utils/font-loader.ts","src/utils/data-helpers.ts","src/components/boston-template/boston-template.css?tag=veleta-boston-template","src/components/boston-template/boston-template.tsx"],"sourcesContent":["/**\n * Configuración de fuente para webfontloader.\n * Tipo local usado solo en este módulo.\n */\ninterface FontConfig {\n google?: {\n families: string[];\n };\n custom?: {\n families: string[];\n urls?: string[];\n };\n fontactive?: (familyName: string, fvd: string) => void;\n fontinactive?: (familyName: string, fvd: string) => void;\n active?: () => void;\n inactive?: () => void;\n}\n\n/**\n * Carga fuentes usando webfontloader de forma dinámica.\n * Esta función carga el módulo webfontloader solo cuando es necesario.\n * \n * @param fontConfig Configuración de fuentes para webfontloader\n * @returns Promise que se resuelve cuando las fuentes se cargan\n */\nexport async function loadFonts(fontConfig: FontConfig): Promise<void> {\n if (!fontConfig || (!fontConfig.google && !fontConfig.custom)) {\n return Promise.resolve();\n }\n\n try {\n // Importación dinámica de webfontloader\n // webfontloader puede exportar de diferentes formas según el entorno\n const webfontloaderModule = await import('webfontloader');\n const WebFont = webfontloaderModule.default || webfontloaderModule;\n \n if (!WebFont || typeof WebFont.load !== 'function') {\n console.warn('webfontloader no está disponible o no tiene el método load');\n return Promise.resolve();\n }\n \n return new Promise<void>((resolve) => {\n const config: any = {\n ...fontConfig,\n active: () => {\n if (fontConfig.active) {\n fontConfig.active();\n }\n resolve();\n },\n inactive: () => {\n if (fontConfig.inactive) {\n fontConfig.inactive();\n }\n // No rechazamos la promesa, solo resolvemos\n // para que el template pueda renderizarse con fuentes por defecto\n resolve();\n },\n };\n\n WebFont.load(config);\n });\n } catch (error) {\n console.error('Error loading webfontloader:', error);\n // Resolvemos en lugar de rechazar para que el template pueda renderizarse\n return Promise.resolve();\n }\n}\n\n/**\n * Aplica la familia de fuente al elemento raíz del componente.\n * \n * @param element Elemento HTML al que aplicar la fuente\n * @param fontFamily Familia de fuente CSS (ej: \"Roboto, sans-serif\")\n */\nexport function applyFontFamily(element: HTMLElement, fontFamily: string): void {\n if (fontFamily && element) {\n element.style.fontFamily = fontFamily;\n }\n}\n\n","/**\n * Formatea un precio como string con símbolo de euro.\n * Si es un número entero, no muestra decimales.\n */\nexport function formatPrice(price: number): string {\n return (price % 1 === 0 ? price.toString() : price.toFixed(2)) + '€';\n}\n\n\n\n",".menu-wrapper {\n min-height: 100vh;\n width: 100%;\n padding: 1.5rem 1rem;\n font-family: 'Merriweather', serif;\n /* Reset para aislar de estilos globales */\n box-sizing: border-box;\n margin: 0;\n display: block;\n}\n\n/* Asegurar que todos los elementos hijos usen border-box */\n.menu-wrapper *,\n.menu-wrapper *::before,\n.menu-wrapper *::after {\n box-sizing: border-box;\n}\n\n/* Reset completo de márgenes para todos los elementos HTML comunes */\n.menu-wrapper h1,\n.menu-wrapper h2,\n.menu-wrapper h3,\n.menu-wrapper h4,\n.menu-wrapper h5,\n.menu-wrapper h6,\n.menu-wrapper p,\n.menu-wrapper ul,\n.menu-wrapper ol,\n.menu-wrapper li,\n.menu-wrapper header,\n.menu-wrapper section,\n.menu-wrapper article,\n.menu-wrapper aside,\n.menu-wrapper nav,\n.menu-wrapper blockquote,\n.menu-wrapper figure,\n.menu-wrapper figcaption {\n margin: 0;\n margin-block-start: 0;\n margin-block-end: 0;\n margin-inline-start: 0;\n margin-inline-end: 0;\n}\n\n/* Reset adicional para padding en listas */\n.menu-wrapper ul,\n.menu-wrapper ol {\n padding: 0;\n}\n\n@media (min-width: 640px) {\n .menu-wrapper {\n padding: 2rem 1.5rem;\n }\n}\n\n@media (min-width: 768px) {\n .menu-wrapper {\n padding: 2rem 1rem;\n }\n}\n\n.menu-container {\n max-width: 1280px;\n margin: 0 auto;\n}\n\n.menu-header {\n text-align: center;\n}\n\n@media (min-width: 768px) {\n .menu-header {\n margin-bottom: 3rem;\n }\n}\n\n.restaurant-title {\n font-size: 2rem;\n font-weight: 700;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n line-height: 1.1;\n margin: 0 0 1.5rem 0!important;\n}\n\n@media (min-width: 640px) {\n .restaurant-title {\n font-size: 2.5rem;\n margin: 0 0 3rem 0!important;\n }\n}\n\n@media (min-width: 768px) {\n .restaurant-title {\n font-size: 3rem;\n }\n}\n\n@media (min-width: 1024px) {\n .restaurant-title {\n font-size: 3.5rem;\n }\n}\n\n.sections-container {\n display: grid;\n grid-template-columns: 1fr;\n gap: 3rem;\n}\n\n@media (min-width: 768px) {\n .sections-container {\n grid-template-columns: repeat(2, 1fr);\n gap: 4rem;\n }\n}\n\n.menu-section {\n display: flex;\n width: 100%;\n position: relative;\n}\n\n/* Título vertical izquierdo */\n.section-label-wrapper {\n position: relative;\n width: 3rem;\n flex-shrink: 0;\n margin-right: 1rem;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: flex-end;\n}\n\n.section-label-line {\n position: absolute;\n right: 0;\n top: 0;\n bottom: 0;\n width: 1px;\n border-right: 1px solid;\n}\n\n.section-label {\n font-weight: 700;\n font-size: 1.125rem;\n text-transform: uppercase;\n letter-spacing: 0.15em;\n writing-mode: vertical-rl;\n transform: rotate(180deg);\n text-align: right;\n white-space: nowrap;\n margin: 0 0 0.5rem 0;\n margin-block-end: 0.5rem;\n position: absolute;\n top: 0;\n}\n\n@media (min-width: 640px) {\n .section-label {\n font-size: 1.2375rem;\n }\n}\n\n@media (min-width: 768px) {\n .section-label {\n font-size: 1.35rem;\n }\n}\n\n@media (min-width: 1024px) {\n .section-label {\n font-size: 1.51875rem;\n }\n}\n\n/* Contenido de la sección */\n.section-content {\n flex: 1;\n padding-top: 0.25rem;\n}\n\n.section-description {\n font-size: 0.875rem;\n font-style: italic;\n margin: 0 0 1rem 0!important;\n margin-block-end: 1rem;\n opacity: 0.75;\n color: inherit;\n}\n\n@media (min-width: 640px) {\n .section-description {\n font-size: 0.9625rem;\n }\n}\n\n@media (min-width: 768px) {\n .section-description {\n font-size: 1.05rem;\n }\n}\n\n@media (min-width: 1024px) {\n .section-description {\n font-size: 1.18125rem;\n }\n}\n\n.dishes-list {\n list-style: none;\n padding: 0;\n margin: 0;\n display: flex;\n flex-direction: column;\n gap: 1rem;\n}\n\n.dish-item {\n position: relative;\n}\n\n.dish-header {\n display: flex;\n align-items: baseline;\n width: 100%;\n gap: 0.5rem;\n}\n\n.dish-name {\n font-size: 1rem;\n font-weight: 700;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n flex-shrink: 0;\n}\n\n@media (min-width: 640px) {\n .dish-name {\n font-size: 1.1rem;\n }\n}\n\n@media (min-width: 768px) {\n .dish-name {\n font-size: 1.2rem;\n }\n}\n\n@media (min-width: 1024px) {\n .dish-name {\n font-size: 1.35rem;\n }\n}\n\n.dish-dots {\n flex: 1;\n opacity: 0.25;\n border-bottom: 1px dotted;\n margin: 0 0.55rem;\n position: relative;\n top: -5px;\n border-color: currentColor;\n}\n\n.dish-price {\n font-size: 1rem;\n font-weight: 700;\n flex-shrink: 0;\n text-align: right;\n}\n\n@media (min-width: 640px) {\n .dish-price {\n font-size: 1.1rem;\n }\n}\n\n@media (min-width: 768px) {\n .dish-price {\n font-size: 1.2rem;\n }\n}\n\n@media (min-width: 1024px) {\n .dish-price {\n font-size: 1.35rem;\n }\n}\n\n.dish-description {\n font-size: 0.8125rem;\n margin-top: -0.9rem;\n line-height: 1.4;\n opacity: 0.7;\n color: inherit;\n}\n\n@media (min-width: 640px) {\n .dish-description {\n font-size: 0.9425rem;\n }\n}\n","import { Component, Prop, h, Element } from '@stencil/core';\nimport { Menu } from '../../types/interfaces';\nimport { loadFonts, applyFontFamily } from '../../utils/font-loader';\nimport { formatPrice } from '../../utils/data-helpers';\n\n@Component({\n tag: 'veleta-boston-template',\n styleUrl: 'boston-template.css',\n shadow: false,\n})\nexport class BostonTemplate {\n @Element() el: HTMLElement;\n\n @Prop() dataJson: string = '{}';\n\n private readonly fontConfig = {\n google: {\n families: ['Oswald:400,600,700', 'Merriweather:300,400,700'],\n },\n };\n\n async componentWillLoad() {\n await loadFonts(this.fontConfig);\n applyFontFamily(this.el, 'Merriweather, serif');\n }\n\n render() {\n let menuData: Menu | null = null;\n try {\n menuData = JSON.parse(this.dataJson);\n } catch (e) {\n console.warn('Invalid dataJson provided to veleta-boston-template');\n }\n\n const theme = menuData?.templateData?.theme;\n const primary = theme?.primaryColor || '#1a365d';\n const fontBody = 'Merriweather, serif';\n const fontTitle = 'Oswald, sans-serif';\n\n if (!menuData) {\n return <div class=\"menu-wrapper\" style={{ color: primary }}></div>;\n }\n\n const { sections, business } = menuData;\n // Ordenar secciones por 'order'\n const sortedSections = (sections || []).sort((a, b) => a.order - b.order);\n\n return (\n <div\n class=\"menu-wrapper\"\n style={{ color: primary }}\n >\n <div class=\"menu-container\">\n {business?.name && (\n <header class=\"menu-header\">\n <h1 class=\"restaurant-title\" style={{ fontFamily: fontTitle }}>\n {business.name}\n </h1>\n </header>\n )}\n\n {/* Layout: 1 columna mobile, 2 columnas tablet/desktop */}\n <div class=\"sections-container\">\n {sortedSections.map(section => {\n // Ordenar platos por 'order'\n const sectionDishes = (section.dishes || []).sort((a, b) => a.order - b.order);\n if (!sectionDishes.length) return null;\n\n return (\n <section key={section.id} class=\"menu-section\">\n {/* Título vertical izquierdo */}\n <div class=\"section-label-wrapper\">\n <div class=\"section-label-line\" style={{ borderColor: primary }}></div>\n <h2\n class=\"section-label\"\n style={{ fontFamily: fontTitle, color: primary }}\n >\n {section.title}\n </h2>\n </div>\n\n {/* Contenido de platos */}\n <div class=\"section-content\">\n {section.description && (\n <p class=\"section-description\" style={{ fontFamily: fontBody }}>\n {section.description}\n </p>\n )}\n\n <ul class=\"dishes-list\">\n {sectionDishes.map(dish => (\n <li key={dish.id} class=\"dish-item\">\n <div class=\"dish-header\">\n <h3\n class=\"dish-name\"\n style={{ fontFamily: fontTitle, color: primary }}\n >\n {dish.name}\n </h3>\n <div\n class=\"dish-dots\"\n ></div>\n <span\n class=\"dish-price\"\n style={{ fontFamily: fontTitle, color: primary }}\n >\n {formatPrice(dish.price)}\n </span>\n </div>\n {dish.description && (\n <p class=\"dish-description\" style={{ fontFamily: fontBody }}>\n {dish.description}\n </p>\n )}\n </li>\n ))}\n </ul>\n </div>\n </section>\n );\n })}\n </div>\n </div>\n </div>\n );\n }\n}"],"version":3}
|
|
1
|
+
{"file":"veleta-boston-template.js","mappings":";;AAkBA;;;;;;AAMG;AACI,eAAe,SAAS,CAAC,UAAsB,EAAA;AACpD,IAAA,IAAI,CAAC,UAAU,KAAK,CAAC,UAAU,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;AAC7D,QAAA,OAAO,OAAO,CAAC,OAAO,EAAE;;AAG1B,IAAA,IAAI;;;AAGF,QAAA,MAAM,mBAAmB,GAAG,MAAM,OAAO,iBAAe,oCAAC;AACzD,QAAA,MAAM,OAAO,GAAG,mBAAmB,CAAC,OAAO,IAAI,mBAAmB;QAElE,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,CAAC,IAAI,KAAK,UAAU,EAAE;AAClD,YAAA,OAAO,CAAC,IAAI,CAAC,4DAA4D,CAAC;AAC1E,YAAA,OAAO,OAAO,CAAC,OAAO,EAAE;;AAG1B,QAAA,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,KAAI;AACnC,YAAA,MAAM,MAAM,GACP,MAAA,CAAA,MAAA,CAAA,MAAA,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AED,CAAA,CAAA,IAAA,EAAA,EAAI,KAAK,EAAC,aAAa,EACpB,EAAA,aAAa,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,MAC7B,CACE,CAAA,IAAA,EAAA,EAAA,GAAG,EAAE,IAAI,CAAC,EAAE,EACZ,KAAK,EAAC,wBAAwB,EAC9B,KAAK,EAAE,EAAE,eAAe,EAAE,CAAG,EAAA,KAAK,GAAG,EAAE,CAAI,EAAA,CAAA,EAAE,EAAA,EAE7C,CAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAC,aAAa,EAAA,EACtB,CAAA,CAAA,IAAA,EAAA,EACE,KAAK,EAAC,WAAW,EACjB,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,IAE/C,IAAI,CAAC,IAAI,CACP,EACL,CACE,CAAA,KAAA,EAAA,EAAA,KAAK,EAAC,WAAW,EACZ,CAAA,EACP,CACE,CAAA,MAAA,EAAA,EAAA,KAAK,EAAC,YAAY,EAClB,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,EAAA,EAE/C,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CACnB,CACH,EACL,IAAI,CAAC,WAAW,KACf,CAAG,CAAA,GAAA,EAAA,EAAA,KAAK,EAAC,kBAAkB,EAAC,KAAK,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,EACxD,EAAA,IAAI,CAAC,WAAW,CACf,CACL,CACE,CACN,CAAC,CACC,CACD,CACE;AAEd,SAAC,CAAC,CACE,CACF,CACF;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/utils/font-loader.ts","src/utils/data-helpers.ts","src/components/boston-template/boston-template.css?tag=veleta-boston-template","src/components/boston-template/boston-template.tsx"],"sourcesContent":["/**\n * Configuración de fuente para webfontloader.\n * Tipo local usado solo en este módulo.\n */\ninterface FontConfig {\n google?: {\n families: string[];\n };\n custom?: {\n families: string[];\n urls?: string[];\n };\n fontactive?: (familyName: string, fvd: string) => void;\n fontinactive?: (familyName: string, fvd: string) => void;\n active?: () => void;\n inactive?: () => void;\n}\n\n/**\n * Carga fuentes usando webfontloader de forma dinámica.\n * Esta función carga el módulo webfontloader solo cuando es necesario.\n * \n * @param fontConfig Configuración de fuentes para webfontloader\n * @returns Promise que se resuelve cuando las fuentes se cargan\n */\nexport async function loadFonts(fontConfig: FontConfig): Promise<void> {\n if (!fontConfig || (!fontConfig.google && !fontConfig.custom)) {\n return Promise.resolve();\n }\n\n try {\n // Importación dinámica de webfontloader\n // webfontloader puede exportar de diferentes formas según el entorno\n const webfontloaderModule = await import('webfontloader');\n const WebFont = webfontloaderModule.default || webfontloaderModule;\n \n if (!WebFont || typeof WebFont.load !== 'function') {\n console.warn('webfontloader no está disponible o no tiene el método load');\n return Promise.resolve();\n }\n \n return new Promise<void>((resolve) => {\n const config: any = {\n ...fontConfig,\n active: () => {\n if (fontConfig.active) {\n fontConfig.active();\n }\n resolve();\n },\n inactive: () => {\n if (fontConfig.inactive) {\n fontConfig.inactive();\n }\n // No rechazamos la promesa, solo resolvemos\n // para que el template pueda renderizarse con fuentes por defecto\n resolve();\n },\n };\n\n WebFont.load(config);\n });\n } catch (error) {\n console.error('Error loading webfontloader:', error);\n // Resolvemos en lugar de rechazar para que el template pueda renderizarse\n return Promise.resolve();\n }\n}\n\n/**\n * Aplica la familia de fuente al elemento raíz del componente.\n * \n * @param element Elemento HTML al que aplicar la fuente\n * @param fontFamily Familia de fuente CSS (ej: \"Roboto, sans-serif\")\n */\nexport function applyFontFamily(element: HTMLElement, fontFamily: string): void {\n if (fontFamily && element) {\n element.style.fontFamily = fontFamily;\n }\n}\n\n","/**\n * Formatea un precio como string con símbolo de euro.\n * Si es un número entero, no muestra decimales.\n */\nexport function formatPrice(price: number): string {\n return (price % 1 === 0 ? price.toString() : price.toFixed(2)) + '€';\n}\n\n\n\n",".menu-wrapper {\n min-height: 100vh;\n width: 100%;\n padding: 1.5rem 1rem;\n font-family: 'Merriweather', serif;\n /* Reset para aislar de estilos globales */\n box-sizing: border-box;\n margin: 0;\n display: block;\n}\n\n/* Asegurar que todos los elementos hijos usen border-box */\n.menu-wrapper *,\n.menu-wrapper *::before,\n.menu-wrapper *::after {\n box-sizing: border-box;\n}\n\n/* Animaciones Nativas */\n.animate-item {\n opacity: 0;\n transform: translateY(30px);\n transition: opacity 0.8s ease-out, transform 0.8s ease-out;\n will-change: opacity, transform;\n}\n\n.animate-item.is-visible {\n opacity: 1;\n transform: translateY(0);\n}\n\n/* Reset completo de márgenes para todos los elementos HTML comunes */\n.menu-wrapper h1,\n.menu-wrapper h2,\n.menu-wrapper h3,\n.menu-wrapper h4,\n.menu-wrapper h5,\n.menu-wrapper h6,\n.menu-wrapper p,\n.menu-wrapper ul,\n.menu-wrapper ol,\n.menu-wrapper li,\n.menu-wrapper header,\n.menu-wrapper section,\n.menu-wrapper article,\n.menu-wrapper aside,\n.menu-wrapper nav,\n.menu-wrapper blockquote,\n.menu-wrapper figure,\n.menu-wrapper figcaption {\n margin: 0;\n margin-block-start: 0;\n margin-block-end: 0;\n margin-inline-start: 0;\n margin-inline-end: 0;\n}\n\n/* Reset adicional para padding en listas */\n.menu-wrapper ul,\n.menu-wrapper ol {\n padding: 0;\n}\n\n@media (min-width: 640px) {\n .menu-wrapper {\n padding: 2rem 1.5rem;\n }\n}\n\n@media (min-width: 768px) {\n .menu-wrapper {\n padding: 2rem 1rem;\n }\n}\n\n.menu-container {\n max-width: 1280px;\n margin: 0 auto;\n}\n\n.menu-header {\n text-align: center;\n}\n\n@media (min-width: 768px) {\n .menu-header {\n margin-bottom: 3rem;\n }\n}\n\n.restaurant-title {\n font-size: 2rem;\n font-weight: 700;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n line-height: 1.1;\n margin: 0 0 1.5rem 0 !important;\n}\n\n@media (min-width: 640px) {\n .restaurant-title {\n font-size: 2.5rem;\n margin: 0 0 3rem 0 !important;\n }\n}\n\n@media (min-width: 768px) {\n .restaurant-title {\n font-size: 3rem;\n }\n}\n\n@media (min-width: 1024px) {\n .restaurant-title {\n font-size: 3.5rem;\n }\n}\n\n.sections-container {\n display: grid;\n grid-template-columns: 1fr;\n gap: 4rem;\n}\n\n@media (min-width: 768px) {\n .sections-container {\n grid-template-columns: repeat(2, 1fr);\n gap: 3rem;\n }\n}\n\n.menu-section {\n display: flex;\n width: 100%;\n position: relative;\n}\n\n/* Título vertical izquierdo */\n.section-label-wrapper {\n position: relative;\n width: 3rem;\n flex-shrink: 0;\n margin-right: 1rem;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: flex-end;\n}\n\n.section-label-line {\n position: absolute;\n right: 0;\n top: 0;\n bottom: 0;\n width: 1px;\n border-right: 1px solid;\n}\n\n.section-label {\n font-weight: 700;\n font-size: 1.125rem;\n text-transform: uppercase;\n letter-spacing: 0.15em;\n writing-mode: vertical-rl;\n transform: rotate(180deg);\n text-align: right;\n white-space: nowrap;\n margin: 0 0 0.5rem 0;\n margin-block-end: 0.5rem;\n position: absolute;\n top: 0;\n}\n\n@media (min-width: 640px) {\n .section-label {\n font-size: 1.2375rem;\n }\n}\n\n@media (min-width: 768px) {\n .section-label {\n font-size: 1.35rem;\n }\n}\n\n@media (min-width: 1024px) {\n .section-label {\n font-size: 1.51875rem;\n }\n}\n\n/* Contenido de la sección */\n.section-content {\n flex: 1;\n padding-top: 0.25rem;\n}\n\n.section-description {\n font-size: 0.875rem;\n font-style: italic;\n margin: 0 0 1rem 0 !important;\n margin-block-end: 1rem;\n opacity: 0.75;\n color: inherit;\n}\n\n@media (min-width: 640px) {\n .section-description {\n font-size: 0.9625rem;\n }\n}\n\n@media (min-width: 768px) {\n .section-description {\n font-size: 1.05rem;\n }\n}\n\n@media (min-width: 1024px) {\n .section-description {\n font-size: 1.18125rem;\n }\n}\n\n.dishes-list {\n list-style: none;\n padding: 0;\n margin: 0;\n display: flex;\n flex-direction: column;\n gap: 1rem;\n}\n\n.dish-item {\n position: relative;\n}\n\n.dish-header {\n display: flex;\n align-items: baseline;\n width: 100%;\n gap: 0.5rem;\n}\n\n.dish-name {\n font-size: 1rem;\n font-weight: 700;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n flex-shrink: 1;\n min-width: 0;\n overflow-wrap: break-word;\n}\n\n@media (min-width: 640px) {\n .dish-name {\n font-size: 1.1rem;\n }\n}\n\n@media (min-width: 768px) {\n .dish-name {\n font-size: 1.2rem;\n }\n}\n\n@media (min-width: 1024px) {\n .dish-name {\n font-size: 1.35rem;\n }\n}\n\n.dish-dots {\n flex: 1;\n opacity: 0.25;\n border-bottom: 2px dotted;\n margin: 0 0.55rem;\n position: relative;\n transform: translateY(-5px);\n border-color: currentColor;\n min-width: 1rem;\n}\n\n.dish-price {\n font-size: 1rem;\n font-weight: 700;\n flex-shrink: 0;\n text-align: right;\n min-width: 3ch;\n}\n\n@media (min-width: 640px) {\n .dish-price {\n font-size: 1.1rem;\n }\n}\n\n@media (min-width: 768px) {\n .dish-price {\n font-size: 1.2rem;\n }\n}\n\n@media (min-width: 1024px) {\n .dish-price {\n font-size: 1.35rem;\n }\n}\n\n.dish-description {\n font-size: 0.8125rem;\n margin-top: 0.25rem;\n line-height: 1.4;\n opacity: 0.7;\n color: inherit;\n width: 100%;\n}\n\n@media (min-width: 640px) {\n .dish-description {\n font-size: 0.9425rem;\n }\n}","import { Component, Prop, h, Element } from '@stencil/core';\nimport { Menu } from '../../types/interfaces';\nimport { loadFonts, applyFontFamily } from '../../utils/font-loader';\nimport { formatPrice } from '../../utils/data-helpers';\n\n@Component({\n tag: 'veleta-boston-template',\n styleUrl: 'boston-template.css',\n shadow: false,\n})\nexport class BostonTemplate {\n @Element() el: HTMLElement;\n\n @Prop() dataJson: string = '{}';\n\n private readonly fontConfig = {\n google: {\n families: ['Oswald:400,600,700', 'Merriweather:300,400,700'],\n },\n };\n\n private observer: IntersectionObserver;\n\n async componentWillLoad() {\n await loadFonts(this.fontConfig);\n applyFontFamily(this.el, 'Merriweather, serif');\n }\n\n componentDidLoad() {\n this.initObserver();\n }\n\n componentDidUpdate() {\n this.initObserver();\n }\n\n disconnectedCallback() {\n if (this.observer) {\n this.observer.disconnect();\n }\n }\n\n private initObserver() {\n if (this.observer) {\n this.observer.disconnect();\n }\n\n this.observer = new IntersectionObserver(\n (entries) => {\n entries.forEach((entry) => {\n if (entry.isIntersecting) {\n const target = entry.target as HTMLElement;\n target.classList.add('is-visible');\n // Stop observing once visible to avoid re-animating\n this.observer.unobserve(target);\n }\n });\n },\n {\n threshold: 0.1,\n rootMargin: '0px 0px -50px 0px',\n }\n );\n\n const elements = this.el.querySelectorAll('.animate-item');\n elements.forEach((el) => this.observer.observe(el));\n }\n\n render() {\n let menuData: Menu | null = null;\n try {\n menuData = JSON.parse(this.dataJson);\n } catch (e) {\n console.warn('Invalid dataJson provided to veleta-boston-template');\n }\n\n const theme = menuData?.templateData?.theme;\n const primary = theme?.primaryColor || '#1a365d';\n const background = theme?.backgroundColor || '#FFFFFF';\n const fontBody = 'Merriweather, serif';\n const fontTitle = 'Oswald, sans-serif';\n\n if (!menuData) {\n return <div class=\"menu-wrapper\" style={{ color: primary, backgroundColor: background }}></div>;\n }\n\n const { sections, business } = menuData;\n // Ordenar secciones por 'order'\n const sortedSections = (sections || []).sort((a, b) => a.order - b.order);\n\n return (\n <div\n class=\"menu-wrapper\"\n style={{ color: primary, backgroundColor: background }}\n >\n <div class=\"menu-container\">\n {business?.name && (\n <header class=\"menu-header\">\n <h1\n class=\"restaurant-title animate-item\"\n style={{ fontFamily: fontTitle }}\n >\n {business.name}\n </h1>\n </header>\n )}\n\n <div class=\"sections-container\">\n {sortedSections.map(section => {\n const sectionDishes = (section.dishes || []).sort((a, b) => a.order - b.order);\n if (!sectionDishes.length) return null;\n\n return (\n <section key={section.id} class=\"menu-section animate-item\">\n <div class=\"section-label-wrapper\">\n <div class=\"section-label-line\" style={{ borderColor: primary }}></div>\n <h2\n class=\"section-label\"\n style={{ fontFamily: fontTitle, color: primary }}\n >\n {section.title}\n </h2>\n </div>\n\n <div class=\"section-content\">\n {section.description && (\n <p class=\"section-description\" style={{ fontFamily: fontBody }}>\n {section.description}\n </p>\n )}\n\n <ul class=\"dishes-list\">\n {sectionDishes.map((dish, index) => (\n <li\n key={dish.id}\n class=\"dish-item animate-item\"\n style={{ transitionDelay: `${index * 50}ms` }}\n >\n <div class=\"dish-header\">\n <h3\n class=\"dish-name\"\n style={{ fontFamily: fontTitle, color: primary }}\n >\n {dish.name}\n </h3>\n <div\n class=\"dish-dots\"\n ></div>\n <span\n class=\"dish-price\"\n style={{ fontFamily: fontTitle, color: primary }}\n >\n {formatPrice(dish.price)}\n </span>\n </div>\n {dish.description && (\n <p class=\"dish-description\" style={{ fontFamily: fontBody }}>\n {dish.description}\n </p>\n )}\n </li>\n ))}\n </ul>\n </div>\n </section>\n );\n })}\n </div>\n </div>\n </div>\n );\n }\n}"],"version":3}
|
|
@@ -63,7 +63,7 @@ function formatPrice(price) {
|
|
|
63
63
|
return (price % 1 === 0 ? price.toString() : price.toFixed(2)) + '€';
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
const bostonTemplateCss = () => `.menu-wrapper{min-height:100vh;width:100%;padding:1.5rem 1rem;font-family:'Merriweather', serif;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;display:block}.menu-wrapper *,.menu-wrapper *::before,.menu-wrapper *::after{-webkit-box-sizing:border-box;box-sizing:border-box}.menu-wrapper h1,.menu-wrapper h2,.menu-wrapper h3,.menu-wrapper h4,.menu-wrapper h5,.menu-wrapper h6,.menu-wrapper p,.menu-wrapper ul,.menu-wrapper ol,.menu-wrapper li,.menu-wrapper header,.menu-wrapper section,.menu-wrapper article,.menu-wrapper aside,.menu-wrapper nav,.menu-wrapper blockquote,.menu-wrapper figure,.menu-wrapper figcaption{margin:0;-webkit-margin-before:0;margin-block-start:0;-webkit-margin-after:0;margin-block-end:0;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:0;margin-inline-end:0}.menu-wrapper ul,.menu-wrapper ol{padding:0}@media (min-width: 640px){.menu-wrapper{padding:2rem 1.5rem}}@media (min-width: 768px){.menu-wrapper{padding:2rem 1rem}}.menu-container{max-width:1280px;margin:0 auto}.menu-header{text-align:center}@media (min-width: 768px){.menu-header{margin-bottom:3rem}}.restaurant-title{font-size:2rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;line-height:1.1;margin:0 0 1.5rem 0!important}@media (min-width: 640px){.restaurant-title{font-size:2.5rem;margin:0 0 3rem 0!important}}@media (min-width: 768px){.restaurant-title{font-size:3rem}}@media (min-width: 1024px){.restaurant-title{font-size:3.5rem}}.sections-container{display:grid;grid-template-columns:1fr;gap:
|
|
66
|
+
const bostonTemplateCss = () => `.menu-wrapper{min-height:100vh;width:100%;padding:1.5rem 1rem;font-family:'Merriweather', serif;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;display:block}.menu-wrapper *,.menu-wrapper *::before,.menu-wrapper *::after{-webkit-box-sizing:border-box;box-sizing:border-box}.animate-item{opacity:0;-webkit-transform:translateY(30px);transform:translateY(30px);-webkit-transition:opacity 0.8s ease-out, -webkit-transform 0.8s ease-out;transition:opacity 0.8s ease-out, -webkit-transform 0.8s ease-out;transition:opacity 0.8s ease-out, transform 0.8s ease-out;transition:opacity 0.8s ease-out, transform 0.8s ease-out, -webkit-transform 0.8s ease-out;will-change:opacity, transform}.animate-item.is-visible{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}.menu-wrapper h1,.menu-wrapper h2,.menu-wrapper h3,.menu-wrapper h4,.menu-wrapper h5,.menu-wrapper h6,.menu-wrapper p,.menu-wrapper ul,.menu-wrapper ol,.menu-wrapper li,.menu-wrapper header,.menu-wrapper section,.menu-wrapper article,.menu-wrapper aside,.menu-wrapper nav,.menu-wrapper blockquote,.menu-wrapper figure,.menu-wrapper figcaption{margin:0;-webkit-margin-before:0;margin-block-start:0;-webkit-margin-after:0;margin-block-end:0;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:0;margin-inline-end:0}.menu-wrapper ul,.menu-wrapper ol{padding:0}@media (min-width: 640px){.menu-wrapper{padding:2rem 1.5rem}}@media (min-width: 768px){.menu-wrapper{padding:2rem 1rem}}.menu-container{max-width:1280px;margin:0 auto}.menu-header{text-align:center}@media (min-width: 768px){.menu-header{margin-bottom:3rem}}.restaurant-title{font-size:2rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;line-height:1.1;margin:0 0 1.5rem 0 !important}@media (min-width: 640px){.restaurant-title{font-size:2.5rem;margin:0 0 3rem 0 !important}}@media (min-width: 768px){.restaurant-title{font-size:3rem}}@media (min-width: 1024px){.restaurant-title{font-size:3.5rem}}.sections-container{display:grid;grid-template-columns:1fr;gap:4rem}@media (min-width: 768px){.sections-container{grid-template-columns:repeat(2, 1fr);gap:3rem}}.menu-section{display:-ms-flexbox;display:flex;width:100%;position:relative}.section-label-wrapper{position:relative;width:3rem;-ms-flex-negative:0;flex-shrink:0;margin-right:1rem;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}.section-label-line{position:absolute;right:0;top:0;bottom:0;width:1px;border-right:1px solid}.section-label{font-weight:700;font-size:1.125rem;text-transform:uppercase;letter-spacing:0.15em;-webkit-writing-mode:vertical-rl;-ms-writing-mode:tb-rl;writing-mode:vertical-rl;-webkit-transform:rotate(180deg);transform:rotate(180deg);text-align:right;white-space:nowrap;margin:0 0 0.5rem 0;-webkit-margin-after:0.5rem;margin-block-end:0.5rem;position:absolute;top:0}@media (min-width: 640px){.section-label{font-size:1.2375rem}}@media (min-width: 768px){.section-label{font-size:1.35rem}}@media (min-width: 1024px){.section-label{font-size:1.51875rem}}.section-content{-ms-flex:1;flex:1;padding-top:0.25rem}.section-description{font-size:0.875rem;font-style:italic;margin:0 0 1rem 0 !important;-webkit-margin-after:1rem;margin-block-end:1rem;opacity:0.75;color:inherit}@media (min-width: 640px){.section-description{font-size:0.9625rem}}@media (min-width: 768px){.section-description{font-size:1.05rem}}@media (min-width: 1024px){.section-description{font-size:1.18125rem}}.dishes-list{list-style:none;padding:0;margin:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:1rem}.dish-item{position:relative}.dish-header{display:-ms-flexbox;display:flex;-ms-flex-align:baseline;align-items:baseline;width:100%;gap:0.5rem}.dish-name{font-size:1rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;-ms-flex-negative:1;flex-shrink:1;min-width:0;overflow-wrap:break-word}@media (min-width: 640px){.dish-name{font-size:1.1rem}}@media (min-width: 768px){.dish-name{font-size:1.2rem}}@media (min-width: 1024px){.dish-name{font-size:1.35rem}}.dish-dots{-ms-flex:1;flex:1;opacity:0.25;border-bottom:2px dotted;margin:0 0.55rem;position:relative;-webkit-transform:translateY(-5px);transform:translateY(-5px);border-color:currentColor;min-width:1rem}.dish-price{font-size:1rem;font-weight:700;-ms-flex-negative:0;flex-shrink:0;text-align:right;min-width:3ch}@media (min-width: 640px){.dish-price{font-size:1.1rem}}@media (min-width: 768px){.dish-price{font-size:1.2rem}}@media (min-width: 1024px){.dish-price{font-size:1.35rem}}.dish-description{font-size:0.8125rem;margin-top:0.25rem;line-height:1.4;opacity:0.7;color:inherit;width:100%}@media (min-width: 640px){.dish-description{font-size:0.9425rem}}`;
|
|
67
67
|
|
|
68
68
|
const BostonTemplate = class {
|
|
69
69
|
constructor(hostRef) {
|
|
@@ -79,6 +79,37 @@ const BostonTemplate = class {
|
|
|
79
79
|
await loadFonts(this.fontConfig);
|
|
80
80
|
applyFontFamily(this.el, 'Merriweather, serif');
|
|
81
81
|
}
|
|
82
|
+
componentDidLoad() {
|
|
83
|
+
this.initObserver();
|
|
84
|
+
}
|
|
85
|
+
componentDidUpdate() {
|
|
86
|
+
this.initObserver();
|
|
87
|
+
}
|
|
88
|
+
disconnectedCallback() {
|
|
89
|
+
if (this.observer) {
|
|
90
|
+
this.observer.disconnect();
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
initObserver() {
|
|
94
|
+
if (this.observer) {
|
|
95
|
+
this.observer.disconnect();
|
|
96
|
+
}
|
|
97
|
+
this.observer = new IntersectionObserver((entries) => {
|
|
98
|
+
entries.forEach((entry) => {
|
|
99
|
+
if (entry.isIntersecting) {
|
|
100
|
+
const target = entry.target;
|
|
101
|
+
target.classList.add('is-visible');
|
|
102
|
+
// Stop observing once visible to avoid re-animating
|
|
103
|
+
this.observer.unobserve(target);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
}, {
|
|
107
|
+
threshold: 0.1,
|
|
108
|
+
rootMargin: '0px 0px -50px 0px',
|
|
109
|
+
});
|
|
110
|
+
const elements = this.el.querySelectorAll('.animate-item');
|
|
111
|
+
elements.forEach((el) => this.observer.observe(el));
|
|
112
|
+
}
|
|
82
113
|
render() {
|
|
83
114
|
var _a;
|
|
84
115
|
let menuData = null;
|
|
@@ -90,20 +121,20 @@ const BostonTemplate = class {
|
|
|
90
121
|
}
|
|
91
122
|
const theme = (_a = menuData === null || menuData === void 0 ? void 0 : menuData.templateData) === null || _a === void 0 ? void 0 : _a.theme;
|
|
92
123
|
const primary = (theme === null || theme === void 0 ? void 0 : theme.primaryColor) || '#1a365d';
|
|
124
|
+
const background = (theme === null || theme === void 0 ? void 0 : theme.backgroundColor) || '#FFFFFF';
|
|
93
125
|
const fontBody = 'Merriweather, serif';
|
|
94
126
|
const fontTitle = 'Oswald, sans-serif';
|
|
95
127
|
if (!menuData) {
|
|
96
|
-
return h("div", { class: "menu-wrapper", style: { color: primary } });
|
|
128
|
+
return h("div", { class: "menu-wrapper", style: { color: primary, backgroundColor: background } });
|
|
97
129
|
}
|
|
98
130
|
const { sections, business } = menuData;
|
|
99
131
|
// Ordenar secciones por 'order'
|
|
100
132
|
const sortedSections = (sections || []).sort((a, b) => a.order - b.order);
|
|
101
|
-
return (h("div", { class: "menu-wrapper", style: { color: primary } }, h("div", { class: "menu-container" }, (business === null || business === void 0 ? void 0 : business.name) && (h("header", { class: "menu-header" }, h("h1", { class: "restaurant-title", style: { fontFamily: fontTitle } }, business.name))), h("div", { class: "sections-container" }, sortedSections.map(section => {
|
|
102
|
-
// Ordenar platos por 'order'
|
|
133
|
+
return (h("div", { class: "menu-wrapper", style: { color: primary, backgroundColor: background } }, h("div", { class: "menu-container" }, (business === null || business === void 0 ? void 0 : business.name) && (h("header", { class: "menu-header" }, h("h1", { class: "restaurant-title animate-item", style: { fontFamily: fontTitle } }, business.name))), h("div", { class: "sections-container" }, sortedSections.map(section => {
|
|
103
134
|
const sectionDishes = (section.dishes || []).sort((a, b) => a.order - b.order);
|
|
104
135
|
if (!sectionDishes.length)
|
|
105
136
|
return null;
|
|
106
|
-
return (h("section", { key: section.id, class: "menu-section" }, h("div", { class: "section-label-wrapper" }, h("div", { class: "section-label-line", style: { borderColor: primary } }), h("h2", { class: "section-label", style: { fontFamily: fontTitle, color: primary } }, section.title)), h("div", { class: "section-content" }, section.description && (h("p", { class: "section-description", style: { fontFamily: fontBody } }, section.description)), h("ul", { class: "dishes-list" }, sectionDishes.map(dish => (h("li", { key: dish.id, class: "dish-item" }, h("div", { class: "dish-header" }, h("h3", { class: "dish-name", style: { fontFamily: fontTitle, color: primary } }, dish.name), h("div", { class: "dish-dots" }), h("span", { class: "dish-price", style: { fontFamily: fontTitle, color: primary } }, formatPrice(dish.price))), dish.description && (h("p", { class: "dish-description", style: { fontFamily: fontBody } }, dish.description)))))))));
|
|
137
|
+
return (h("section", { key: section.id, class: "menu-section animate-item" }, h("div", { class: "section-label-wrapper" }, h("div", { class: "section-label-line", style: { borderColor: primary } }), h("h2", { class: "section-label", style: { fontFamily: fontTitle, color: primary } }, section.title)), h("div", { class: "section-content" }, section.description && (h("p", { class: "section-description", style: { fontFamily: fontBody } }, section.description)), h("ul", { class: "dishes-list" }, sectionDishes.map((dish, index) => (h("li", { key: dish.id, class: "dish-item animate-item", style: { transitionDelay: `${index * 50}ms` } }, h("div", { class: "dish-header" }, h("h3", { class: "dish-name", style: { fontFamily: fontTitle, color: primary } }, dish.name), h("div", { class: "dish-dots" }), h("span", { class: "dish-price", style: { fontFamily: fontTitle, color: primary } }, formatPrice(dish.price))), dish.description && (h("p", { class: "dish-description", style: { fontFamily: fontBody } }, dish.description)))))))));
|
|
107
138
|
})))));
|
|
108
139
|
}
|
|
109
140
|
get el() { return getElement(this); }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"veleta-boston-template.entry.js","sources":["src/utils/font-loader.ts","src/utils/data-helpers.ts","src/components/boston-template/boston-template.css?tag=veleta-boston-template","src/components/boston-template/boston-template.tsx"],"sourcesContent":["/**\n * Configuración de fuente para webfontloader.\n * Tipo local usado solo en este módulo.\n */\ninterface FontConfig {\n google?: {\n families: string[];\n };\n custom?: {\n families: string[];\n urls?: string[];\n };\n fontactive?: (familyName: string, fvd: string) => void;\n fontinactive?: (familyName: string, fvd: string) => void;\n active?: () => void;\n inactive?: () => void;\n}\n\n/**\n * Carga fuentes usando webfontloader de forma dinámica.\n * Esta función carga el módulo webfontloader solo cuando es necesario.\n * \n * @param fontConfig Configuración de fuentes para webfontloader\n * @returns Promise que se resuelve cuando las fuentes se cargan\n */\nexport async function loadFonts(fontConfig: FontConfig): Promise<void> {\n if (!fontConfig || (!fontConfig.google && !fontConfig.custom)) {\n return Promise.resolve();\n }\n\n try {\n // Importación dinámica de webfontloader\n // webfontloader puede exportar de diferentes formas según el entorno\n const webfontloaderModule = await import('webfontloader');\n const WebFont = webfontloaderModule.default || webfontloaderModule;\n \n if (!WebFont || typeof WebFont.load !== 'function') {\n console.warn('webfontloader no está disponible o no tiene el método load');\n return Promise.resolve();\n }\n \n return new Promise<void>((resolve) => {\n const config: any = {\n ...fontConfig,\n active: () => {\n if (fontConfig.active) {\n fontConfig.active();\n }\n resolve();\n },\n inactive: () => {\n if (fontConfig.inactive) {\n fontConfig.inactive();\n }\n // No rechazamos la promesa, solo resolvemos\n // para que el template pueda renderizarse con fuentes por defecto\n resolve();\n },\n };\n\n WebFont.load(config);\n });\n } catch (error) {\n console.error('Error loading webfontloader:', error);\n // Resolvemos en lugar de rechazar para que el template pueda renderizarse\n return Promise.resolve();\n }\n}\n\n/**\n * Aplica la familia de fuente al elemento raíz del componente.\n * \n * @param element Elemento HTML al que aplicar la fuente\n * @param fontFamily Familia de fuente CSS (ej: \"Roboto, sans-serif\")\n */\nexport function applyFontFamily(element: HTMLElement, fontFamily: string): void {\n if (fontFamily && element) {\n element.style.fontFamily = fontFamily;\n }\n}\n\n","/**\n * Formatea un precio como string con símbolo de euro.\n * Si es un número entero, no muestra decimales.\n */\nexport function formatPrice(price: number): string {\n return (price % 1 === 0 ? price.toString() : price.toFixed(2)) + '€';\n}\n\n\n\n",".menu-wrapper {\n min-height: 100vh;\n width: 100%;\n padding: 1.5rem 1rem;\n font-family: 'Merriweather', serif;\n /* Reset para aislar de estilos globales */\n box-sizing: border-box;\n margin: 0;\n display: block;\n}\n\n/* Asegurar que todos los elementos hijos usen border-box */\n.menu-wrapper *,\n.menu-wrapper *::before,\n.menu-wrapper *::after {\n box-sizing: border-box;\n}\n\n/* Reset completo de márgenes para todos los elementos HTML comunes */\n.menu-wrapper h1,\n.menu-wrapper h2,\n.menu-wrapper h3,\n.menu-wrapper h4,\n.menu-wrapper h5,\n.menu-wrapper h6,\n.menu-wrapper p,\n.menu-wrapper ul,\n.menu-wrapper ol,\n.menu-wrapper li,\n.menu-wrapper header,\n.menu-wrapper section,\n.menu-wrapper article,\n.menu-wrapper aside,\n.menu-wrapper nav,\n.menu-wrapper blockquote,\n.menu-wrapper figure,\n.menu-wrapper figcaption {\n margin: 0;\n margin-block-start: 0;\n margin-block-end: 0;\n margin-inline-start: 0;\n margin-inline-end: 0;\n}\n\n/* Reset adicional para padding en listas */\n.menu-wrapper ul,\n.menu-wrapper ol {\n padding: 0;\n}\n\n@media (min-width: 640px) {\n .menu-wrapper {\n padding: 2rem 1.5rem;\n }\n}\n\n@media (min-width: 768px) {\n .menu-wrapper {\n padding: 2rem 1rem;\n }\n}\n\n.menu-container {\n max-width: 1280px;\n margin: 0 auto;\n}\n\n.menu-header {\n text-align: center;\n}\n\n@media (min-width: 768px) {\n .menu-header {\n margin-bottom: 3rem;\n }\n}\n\n.restaurant-title {\n font-size: 2rem;\n font-weight: 700;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n line-height: 1.1;\n margin: 0 0 1.5rem 0!important;\n}\n\n@media (min-width: 640px) {\n .restaurant-title {\n font-size: 2.5rem;\n margin: 0 0 3rem 0!important;\n }\n}\n\n@media (min-width: 768px) {\n .restaurant-title {\n font-size: 3rem;\n }\n}\n\n@media (min-width: 1024px) {\n .restaurant-title {\n font-size: 3.5rem;\n }\n}\n\n.sections-container {\n display: grid;\n grid-template-columns: 1fr;\n gap: 3rem;\n}\n\n@media (min-width: 768px) {\n .sections-container {\n grid-template-columns: repeat(2, 1fr);\n gap: 4rem;\n }\n}\n\n.menu-section {\n display: flex;\n width: 100%;\n position: relative;\n}\n\n/* Título vertical izquierdo */\n.section-label-wrapper {\n position: relative;\n width: 3rem;\n flex-shrink: 0;\n margin-right: 1rem;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: flex-end;\n}\n\n.section-label-line {\n position: absolute;\n right: 0;\n top: 0;\n bottom: 0;\n width: 1px;\n border-right: 1px solid;\n}\n\n.section-label {\n font-weight: 700;\n font-size: 1.125rem;\n text-transform: uppercase;\n letter-spacing: 0.15em;\n writing-mode: vertical-rl;\n transform: rotate(180deg);\n text-align: right;\n white-space: nowrap;\n margin: 0 0 0.5rem 0;\n margin-block-end: 0.5rem;\n position: absolute;\n top: 0;\n}\n\n@media (min-width: 640px) {\n .section-label {\n font-size: 1.2375rem;\n }\n}\n\n@media (min-width: 768px) {\n .section-label {\n font-size: 1.35rem;\n }\n}\n\n@media (min-width: 1024px) {\n .section-label {\n font-size: 1.51875rem;\n }\n}\n\n/* Contenido de la sección */\n.section-content {\n flex: 1;\n padding-top: 0.25rem;\n}\n\n.section-description {\n font-size: 0.875rem;\n font-style: italic;\n margin: 0 0 1rem 0!important;\n margin-block-end: 1rem;\n opacity: 0.75;\n color: inherit;\n}\n\n@media (min-width: 640px) {\n .section-description {\n font-size: 0.9625rem;\n }\n}\n\n@media (min-width: 768px) {\n .section-description {\n font-size: 1.05rem;\n }\n}\n\n@media (min-width: 1024px) {\n .section-description {\n font-size: 1.18125rem;\n }\n}\n\n.dishes-list {\n list-style: none;\n padding: 0;\n margin: 0;\n display: flex;\n flex-direction: column;\n gap: 1rem;\n}\n\n.dish-item {\n position: relative;\n}\n\n.dish-header {\n display: flex;\n align-items: baseline;\n width: 100%;\n gap: 0.5rem;\n}\n\n.dish-name {\n font-size: 1rem;\n font-weight: 700;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n flex-shrink: 0;\n}\n\n@media (min-width: 640px) {\n .dish-name {\n font-size: 1.1rem;\n }\n}\n\n@media (min-width: 768px) {\n .dish-name {\n font-size: 1.2rem;\n }\n}\n\n@media (min-width: 1024px) {\n .dish-name {\n font-size: 1.35rem;\n }\n}\n\n.dish-dots {\n flex: 1;\n opacity: 0.25;\n border-bottom: 1px dotted;\n margin: 0 0.55rem;\n position: relative;\n top: -5px;\n border-color: currentColor;\n}\n\n.dish-price {\n font-size: 1rem;\n font-weight: 700;\n flex-shrink: 0;\n text-align: right;\n}\n\n@media (min-width: 640px) {\n .dish-price {\n font-size: 1.1rem;\n }\n}\n\n@media (min-width: 768px) {\n .dish-price {\n font-size: 1.2rem;\n }\n}\n\n@media (min-width: 1024px) {\n .dish-price {\n font-size: 1.35rem;\n }\n}\n\n.dish-description {\n font-size: 0.8125rem;\n margin-top: -0.9rem;\n line-height: 1.4;\n opacity: 0.7;\n color: inherit;\n}\n\n@media (min-width: 640px) {\n .dish-description {\n font-size: 0.9425rem;\n }\n}\n","import { Component, Prop, h, Element } from '@stencil/core';\nimport { Menu } from '../../types/interfaces';\nimport { loadFonts, applyFontFamily } from '../../utils/font-loader';\nimport { formatPrice } from '../../utils/data-helpers';\n\n@Component({\n tag: 'veleta-boston-template',\n styleUrl: 'boston-template.css',\n shadow: false,\n})\nexport class BostonTemplate {\n @Element() el: HTMLElement;\n\n @Prop() dataJson: string = '{}';\n\n private readonly fontConfig = {\n google: {\n families: ['Oswald:400,600,700', 'Merriweather:300,400,700'],\n },\n };\n\n async componentWillLoad() {\n await loadFonts(this.fontConfig);\n applyFontFamily(this.el, 'Merriweather, serif');\n }\n\n render() {\n let menuData: Menu | null = null;\n try {\n menuData = JSON.parse(this.dataJson);\n } catch (e) {\n console.warn('Invalid dataJson provided to veleta-boston-template');\n }\n\n const theme = menuData?.templateData?.theme;\n const primary = theme?.primaryColor || '#1a365d';\n const fontBody = 'Merriweather, serif';\n const fontTitle = 'Oswald, sans-serif';\n\n if (!menuData) {\n return <div class=\"menu-wrapper\" style={{ color: primary }}></div>;\n }\n\n const { sections, business } = menuData;\n // Ordenar secciones por 'order'\n const sortedSections = (sections || []).sort((a, b) => a.order - b.order);\n\n return (\n <div\n class=\"menu-wrapper\"\n style={{ color: primary }}\n >\n <div class=\"menu-container\">\n {business?.name && (\n <header class=\"menu-header\">\n <h1 class=\"restaurant-title\" style={{ fontFamily: fontTitle }}>\n {business.name}\n </h1>\n </header>\n )}\n\n {/* Layout: 1 columna mobile, 2 columnas tablet/desktop */}\n <div class=\"sections-container\">\n {sortedSections.map(section => {\n // Ordenar platos por 'order'\n const sectionDishes = (section.dishes || []).sort((a, b) => a.order - b.order);\n if (!sectionDishes.length) return null;\n\n return (\n <section key={section.id} class=\"menu-section\">\n {/* Título vertical izquierdo */}\n <div class=\"section-label-wrapper\">\n <div class=\"section-label-line\" style={{ borderColor: primary }}></div>\n <h2\n class=\"section-label\"\n style={{ fontFamily: fontTitle, color: primary }}\n >\n {section.title}\n </h2>\n </div>\n\n {/* Contenido de platos */}\n <div class=\"section-content\">\n {section.description && (\n <p class=\"section-description\" style={{ fontFamily: fontBody }}>\n {section.description}\n </p>\n )}\n\n <ul class=\"dishes-list\">\n {sectionDishes.map(dish => (\n <li key={dish.id} class=\"dish-item\">\n <div class=\"dish-header\">\n <h3\n class=\"dish-name\"\n style={{ fontFamily: fontTitle, color: primary }}\n >\n {dish.name}\n </h3>\n <div\n class=\"dish-dots\"\n ></div>\n <span\n class=\"dish-price\"\n style={{ fontFamily: fontTitle, color: primary }}\n >\n {formatPrice(dish.price)}\n </span>\n </div>\n {dish.description && (\n <p class=\"dish-description\" style={{ fontFamily: fontBody }}>\n {dish.description}\n </p>\n )}\n </li>\n ))}\n </ul>\n </div>\n </section>\n );\n })}\n </div>\n </div>\n </div>\n );\n }\n}"],"names":[],"mappings":";;AAkBA;;;;;;AAMG;AACI,eAAe,SAAS,CAAC,UAAsB,EAAA;AACpD,IAAA,IAAI,CAAC,UAAU,KAAK,CAAC,UAAU,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;AAC7D,QAAA,OAAO,OAAO,CAAC,OAAO,EAAE;;AAG1B,IAAA,IAAI;;;AAGF,QAAA,MAAM,mBAAmB,GAAG,MAAM,OAAO,6BAAe,oCAAC;AACzD,QAAA,MAAM,OAAO,GAAG,mBAAmB,CAAC,OAAO,IAAI,mBAAmB;QAElE,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,CAAC,IAAI,KAAK,UAAU,EAAE;AAClD,YAAA,OAAO,CAAC,IAAI,CAAC,4DAA4D,CAAC;AAC1E,YAAA,OAAO,OAAO,CAAC,OAAO,EAAE;;AAG1B,QAAA,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,KAAI;AACnC,YAAA,MAAM,MAAM,GACP,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,UAAU,KACb,MAAM,EAAE,MAAK;AACX,oBAAA,IAAI,UAAU,CAAC,MAAM,EAAE;wBACrB,UAAU,CAAC,MAAM,EAAE;;AAErB,oBAAA,OAAO,EAA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,IAAI,KACrB,CAAA,CAAA,IAAA,EAAA,EAAI,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE,KAAK,EAAC,WAAW,EAAA,EACjC,CAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAC,aAAa,EAAA,EACtB,CAAA,CAAA,IAAA,EAAA,EACE,KAAK,EAAC,WAAW,EACjB,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,IAE/C,IAAI,CAAC,IAAI,CACP,EACL,CACE,CAAA,KAAA,EAAA,EAAA,KAAK,EAAC,WAAW,EACZ,CAAA,EACP,CACE,CAAA,MAAA,EAAA,EAAA,KAAK,EAAC,YAAY,EAClB,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,EAAA,EAE/C,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CACnB,CACH,EACL,IAAI,CAAC,WAAW,KACf,CAAG,CAAA,GAAA,EAAA,EAAA,KAAK,EAAC,kBAAkB,EAAC,KAAK,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,EACxD,EAAA,IAAI,CAAC,WAAW,CACf,CACL,CACE,CACN,CAAC,CACC,CACD,CACE;AAEd,SAAC,CAAC,CACE,CACF,CACF;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"veleta-boston-template.entry.js","sources":["src/utils/font-loader.ts","src/utils/data-helpers.ts","src/components/boston-template/boston-template.css?tag=veleta-boston-template","src/components/boston-template/boston-template.tsx"],"sourcesContent":["/**\n * Configuración de fuente para webfontloader.\n * Tipo local usado solo en este módulo.\n */\ninterface FontConfig {\n google?: {\n families: string[];\n };\n custom?: {\n families: string[];\n urls?: string[];\n };\n fontactive?: (familyName: string, fvd: string) => void;\n fontinactive?: (familyName: string, fvd: string) => void;\n active?: () => void;\n inactive?: () => void;\n}\n\n/**\n * Carga fuentes usando webfontloader de forma dinámica.\n * Esta función carga el módulo webfontloader solo cuando es necesario.\n * \n * @param fontConfig Configuración de fuentes para webfontloader\n * @returns Promise que se resuelve cuando las fuentes se cargan\n */\nexport async function loadFonts(fontConfig: FontConfig): Promise<void> {\n if (!fontConfig || (!fontConfig.google && !fontConfig.custom)) {\n return Promise.resolve();\n }\n\n try {\n // Importación dinámica de webfontloader\n // webfontloader puede exportar de diferentes formas según el entorno\n const webfontloaderModule = await import('webfontloader');\n const WebFont = webfontloaderModule.default || webfontloaderModule;\n \n if (!WebFont || typeof WebFont.load !== 'function') {\n console.warn('webfontloader no está disponible o no tiene el método load');\n return Promise.resolve();\n }\n \n return new Promise<void>((resolve) => {\n const config: any = {\n ...fontConfig,\n active: () => {\n if (fontConfig.active) {\n fontConfig.active();\n }\n resolve();\n },\n inactive: () => {\n if (fontConfig.inactive) {\n fontConfig.inactive();\n }\n // No rechazamos la promesa, solo resolvemos\n // para que el template pueda renderizarse con fuentes por defecto\n resolve();\n },\n };\n\n WebFont.load(config);\n });\n } catch (error) {\n console.error('Error loading webfontloader:', error);\n // Resolvemos en lugar de rechazar para que el template pueda renderizarse\n return Promise.resolve();\n }\n}\n\n/**\n * Aplica la familia de fuente al elemento raíz del componente.\n * \n * @param element Elemento HTML al que aplicar la fuente\n * @param fontFamily Familia de fuente CSS (ej: \"Roboto, sans-serif\")\n */\nexport function applyFontFamily(element: HTMLElement, fontFamily: string): void {\n if (fontFamily && element) {\n element.style.fontFamily = fontFamily;\n }\n}\n\n","/**\n * Formatea un precio como string con símbolo de euro.\n * Si es un número entero, no muestra decimales.\n */\nexport function formatPrice(price: number): string {\n return (price % 1 === 0 ? price.toString() : price.toFixed(2)) + '€';\n}\n\n\n\n",".menu-wrapper {\n min-height: 100vh;\n width: 100%;\n padding: 1.5rem 1rem;\n font-family: 'Merriweather', serif;\n /* Reset para aislar de estilos globales */\n box-sizing: border-box;\n margin: 0;\n display: block;\n}\n\n/* Asegurar que todos los elementos hijos usen border-box */\n.menu-wrapper *,\n.menu-wrapper *::before,\n.menu-wrapper *::after {\n box-sizing: border-box;\n}\n\n/* Animaciones Nativas */\n.animate-item {\n opacity: 0;\n transform: translateY(30px);\n transition: opacity 0.8s ease-out, transform 0.8s ease-out;\n will-change: opacity, transform;\n}\n\n.animate-item.is-visible {\n opacity: 1;\n transform: translateY(0);\n}\n\n/* Reset completo de márgenes para todos los elementos HTML comunes */\n.menu-wrapper h1,\n.menu-wrapper h2,\n.menu-wrapper h3,\n.menu-wrapper h4,\n.menu-wrapper h5,\n.menu-wrapper h6,\n.menu-wrapper p,\n.menu-wrapper ul,\n.menu-wrapper ol,\n.menu-wrapper li,\n.menu-wrapper header,\n.menu-wrapper section,\n.menu-wrapper article,\n.menu-wrapper aside,\n.menu-wrapper nav,\n.menu-wrapper blockquote,\n.menu-wrapper figure,\n.menu-wrapper figcaption {\n margin: 0;\n margin-block-start: 0;\n margin-block-end: 0;\n margin-inline-start: 0;\n margin-inline-end: 0;\n}\n\n/* Reset adicional para padding en listas */\n.menu-wrapper ul,\n.menu-wrapper ol {\n padding: 0;\n}\n\n@media (min-width: 640px) {\n .menu-wrapper {\n padding: 2rem 1.5rem;\n }\n}\n\n@media (min-width: 768px) {\n .menu-wrapper {\n padding: 2rem 1rem;\n }\n}\n\n.menu-container {\n max-width: 1280px;\n margin: 0 auto;\n}\n\n.menu-header {\n text-align: center;\n}\n\n@media (min-width: 768px) {\n .menu-header {\n margin-bottom: 3rem;\n }\n}\n\n.restaurant-title {\n font-size: 2rem;\n font-weight: 700;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n line-height: 1.1;\n margin: 0 0 1.5rem 0 !important;\n}\n\n@media (min-width: 640px) {\n .restaurant-title {\n font-size: 2.5rem;\n margin: 0 0 3rem 0 !important;\n }\n}\n\n@media (min-width: 768px) {\n .restaurant-title {\n font-size: 3rem;\n }\n}\n\n@media (min-width: 1024px) {\n .restaurant-title {\n font-size: 3.5rem;\n }\n}\n\n.sections-container {\n display: grid;\n grid-template-columns: 1fr;\n gap: 4rem;\n}\n\n@media (min-width: 768px) {\n .sections-container {\n grid-template-columns: repeat(2, 1fr);\n gap: 3rem;\n }\n}\n\n.menu-section {\n display: flex;\n width: 100%;\n position: relative;\n}\n\n/* Título vertical izquierdo */\n.section-label-wrapper {\n position: relative;\n width: 3rem;\n flex-shrink: 0;\n margin-right: 1rem;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: flex-end;\n}\n\n.section-label-line {\n position: absolute;\n right: 0;\n top: 0;\n bottom: 0;\n width: 1px;\n border-right: 1px solid;\n}\n\n.section-label {\n font-weight: 700;\n font-size: 1.125rem;\n text-transform: uppercase;\n letter-spacing: 0.15em;\n writing-mode: vertical-rl;\n transform: rotate(180deg);\n text-align: right;\n white-space: nowrap;\n margin: 0 0 0.5rem 0;\n margin-block-end: 0.5rem;\n position: absolute;\n top: 0;\n}\n\n@media (min-width: 640px) {\n .section-label {\n font-size: 1.2375rem;\n }\n}\n\n@media (min-width: 768px) {\n .section-label {\n font-size: 1.35rem;\n }\n}\n\n@media (min-width: 1024px) {\n .section-label {\n font-size: 1.51875rem;\n }\n}\n\n/* Contenido de la sección */\n.section-content {\n flex: 1;\n padding-top: 0.25rem;\n}\n\n.section-description {\n font-size: 0.875rem;\n font-style: italic;\n margin: 0 0 1rem 0 !important;\n margin-block-end: 1rem;\n opacity: 0.75;\n color: inherit;\n}\n\n@media (min-width: 640px) {\n .section-description {\n font-size: 0.9625rem;\n }\n}\n\n@media (min-width: 768px) {\n .section-description {\n font-size: 1.05rem;\n }\n}\n\n@media (min-width: 1024px) {\n .section-description {\n font-size: 1.18125rem;\n }\n}\n\n.dishes-list {\n list-style: none;\n padding: 0;\n margin: 0;\n display: flex;\n flex-direction: column;\n gap: 1rem;\n}\n\n.dish-item {\n position: relative;\n}\n\n.dish-header {\n display: flex;\n align-items: baseline;\n width: 100%;\n gap: 0.5rem;\n}\n\n.dish-name {\n font-size: 1rem;\n font-weight: 700;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n flex-shrink: 1;\n min-width: 0;\n overflow-wrap: break-word;\n}\n\n@media (min-width: 640px) {\n .dish-name {\n font-size: 1.1rem;\n }\n}\n\n@media (min-width: 768px) {\n .dish-name {\n font-size: 1.2rem;\n }\n}\n\n@media (min-width: 1024px) {\n .dish-name {\n font-size: 1.35rem;\n }\n}\n\n.dish-dots {\n flex: 1;\n opacity: 0.25;\n border-bottom: 2px dotted;\n margin: 0 0.55rem;\n position: relative;\n transform: translateY(-5px);\n border-color: currentColor;\n min-width: 1rem;\n}\n\n.dish-price {\n font-size: 1rem;\n font-weight: 700;\n flex-shrink: 0;\n text-align: right;\n min-width: 3ch;\n}\n\n@media (min-width: 640px) {\n .dish-price {\n font-size: 1.1rem;\n }\n}\n\n@media (min-width: 768px) {\n .dish-price {\n font-size: 1.2rem;\n }\n}\n\n@media (min-width: 1024px) {\n .dish-price {\n font-size: 1.35rem;\n }\n}\n\n.dish-description {\n font-size: 0.8125rem;\n margin-top: 0.25rem;\n line-height: 1.4;\n opacity: 0.7;\n color: inherit;\n width: 100%;\n}\n\n@media (min-width: 640px) {\n .dish-description {\n font-size: 0.9425rem;\n }\n}","import { Component, Prop, h, Element } from '@stencil/core';\nimport { Menu } from '../../types/interfaces';\nimport { loadFonts, applyFontFamily } from '../../utils/font-loader';\nimport { formatPrice } from '../../utils/data-helpers';\n\n@Component({\n tag: 'veleta-boston-template',\n styleUrl: 'boston-template.css',\n shadow: false,\n})\nexport class BostonTemplate {\n @Element() el: HTMLElement;\n\n @Prop() dataJson: string = '{}';\n\n private readonly fontConfig = {\n google: {\n families: ['Oswald:400,600,700', 'Merriweather:300,400,700'],\n },\n };\n\n private observer: IntersectionObserver;\n\n async componentWillLoad() {\n await loadFonts(this.fontConfig);\n applyFontFamily(this.el, 'Merriweather, serif');\n }\n\n componentDidLoad() {\n this.initObserver();\n }\n\n componentDidUpdate() {\n this.initObserver();\n }\n\n disconnectedCallback() {\n if (this.observer) {\n this.observer.disconnect();\n }\n }\n\n private initObserver() {\n if (this.observer) {\n this.observer.disconnect();\n }\n\n this.observer = new IntersectionObserver(\n (entries) => {\n entries.forEach((entry) => {\n if (entry.isIntersecting) {\n const target = entry.target as HTMLElement;\n target.classList.add('is-visible');\n // Stop observing once visible to avoid re-animating\n this.observer.unobserve(target);\n }\n });\n },\n {\n threshold: 0.1,\n rootMargin: '0px 0px -50px 0px',\n }\n );\n\n const elements = this.el.querySelectorAll('.animate-item');\n elements.forEach((el) => this.observer.observe(el));\n }\n\n render() {\n let menuData: Menu | null = null;\n try {\n menuData = JSON.parse(this.dataJson);\n } catch (e) {\n console.warn('Invalid dataJson provided to veleta-boston-template');\n }\n\n const theme = menuData?.templateData?.theme;\n const primary = theme?.primaryColor || '#1a365d';\n const background = theme?.backgroundColor || '#FFFFFF';\n const fontBody = 'Merriweather, serif';\n const fontTitle = 'Oswald, sans-serif';\n\n if (!menuData) {\n return <div class=\"menu-wrapper\" style={{ color: primary, backgroundColor: background }}></div>;\n }\n\n const { sections, business } = menuData;\n // Ordenar secciones por 'order'\n const sortedSections = (sections || []).sort((a, b) => a.order - b.order);\n\n return (\n <div\n class=\"menu-wrapper\"\n style={{ color: primary, backgroundColor: background }}\n >\n <div class=\"menu-container\">\n {business?.name && (\n <header class=\"menu-header\">\n <h1\n class=\"restaurant-title animate-item\"\n style={{ fontFamily: fontTitle }}\n >\n {business.name}\n </h1>\n </header>\n )}\n\n <div class=\"sections-container\">\n {sortedSections.map(section => {\n const sectionDishes = (section.dishes || []).sort((a, b) => a.order - b.order);\n if (!sectionDishes.length) return null;\n\n return (\n <section key={section.id} class=\"menu-section animate-item\">\n <div class=\"section-label-wrapper\">\n <div class=\"section-label-line\" style={{ borderColor: primary }}></div>\n <h2\n class=\"section-label\"\n style={{ fontFamily: fontTitle, color: primary }}\n >\n {section.title}\n </h2>\n </div>\n\n <div class=\"section-content\">\n {section.description && (\n <p class=\"section-description\" style={{ fontFamily: fontBody }}>\n {section.description}\n </p>\n )}\n\n <ul class=\"dishes-list\">\n {sectionDishes.map((dish, index) => (\n <li\n key={dish.id}\n class=\"dish-item animate-item\"\n style={{ transitionDelay: `${index * 50}ms` }}\n >\n <div class=\"dish-header\">\n <h3\n class=\"dish-name\"\n style={{ fontFamily: fontTitle, color: primary }}\n >\n {dish.name}\n </h3>\n <div\n class=\"dish-dots\"\n ></div>\n <span\n class=\"dish-price\"\n style={{ fontFamily: fontTitle, color: primary }}\n >\n {formatPrice(dish.price)}\n </span>\n </div>\n {dish.description && (\n <p class=\"dish-description\" style={{ fontFamily: fontBody }}>\n {dish.description}\n </p>\n )}\n </li>\n ))}\n </ul>\n </div>\n </section>\n );\n })}\n </div>\n </div>\n </div>\n );\n }\n}"],"names":[],"mappings":";;AAkBA;;;;;;AAMG;AACI,eAAe,SAAS,CAAC,UAAsB,EAAA;AACpD,IAAA,IAAI,CAAC,UAAU,KAAK,CAAC,UAAU,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;AAC7D,QAAA,OAAO,OAAO,CAAC,OAAO,EAAE;;AAG1B,IAAA,IAAI;;;AAGF,QAAA,MAAM,mBAAmB,GAAG,MAAM,OAAO,6BAAe,oCAAC;AACzD,QAAA,MAAM,OAAO,GAAG,mBAAmB,CAAC,OAAO,IAAI,mBAAmB;QAElE,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,CAAC,IAAI,KAAK,UAAU,EAAE;AAClD,YAAA,OAAO,CAAC,IAAI,CAAC,4DAA4D,CAAC;AAC1E,YAAA,OAAO,OAAO,CAAC,OAAO,EAAE;;AAG1B,QAAA,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,KAAI;AACnC,YAAA,MAAM,MAAM,GACP,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,UAAU,KACb,MAAM,EAAE,MAAK;AACX,oBAAA,IAAI,UAAU,CAAC,MAAM,EAAE;wBACrB,UAAU,CAAC,MAAM,EAAE;;AAErB,oBAAA,OAAO,EAAE;AACX,iBAAC,EACD,QAAQ,EAAE,MAAK;AAC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CAAG,EAAA,KAAK,GAAG,EAAE,CAAI,EAAA,CAAA,EAAE,EAAA,EAE7C,CAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAC,aAAa,EAAA,EACtB,CAAA,CAAA,IAAA,EAAA,EACE,KAAK,EAAC,WAAW,EACjB,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,IAE/C,IAAI,CAAC,IAAI,CACP,EACL,CACE,CAAA,KAAA,EAAA,EAAA,KAAK,EAAC,WAAW,EACZ,CAAA,EACP,CACE,CAAA,MAAA,EAAA,EAAA,KAAK,EAAC,YAAY,EAClB,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,EAAA,EAE/C,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CACnB,CACH,EACL,IAAI,CAAC,WAAW,KACf,CAAG,CAAA,GAAA,EAAA,EAAA,KAAK,EAAC,kBAAkB,EAAC,KAAK,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,EACxD,EAAA,IAAI,CAAC,WAAW,CACf,CACL,CACE,CACN,CAAC,CACC,CACD,CACE;AAEd,SAAC,CAAC,CACE,CACF,CACF;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,i,t,n){function r(e){return e instanceof t?e:new t((function(i){i(e)}))}return new(t||(t=Promise))((function(t,a){function o(e){try{m(n.next(e))}catch(e){a(e)}}function s(e){try{m(n["throw"](e))}catch(e){a(e)}}function m(e){e.done?t(e.value):r(e.value).then(o,s)}m((n=n.apply(e,i||[])).next())}))};var __generator=this&&this.__generator||function(e,i){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,r,a,o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=s(0),o["throw"]=s(1),o["return"]=s(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(i){return m([e,i])}}function m(s){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(t=0)),t)try{if(n=1,r&&(a=s[0]&2?r["return"]:s[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;if(r=0,a)s=[s[0]&2,a.value];switch(s[0]){case 0:case 1:a=s;break;case 4:t.label++;return{value:s[1],done:false};case 5:t.label++;r=s[1];s=[0];continue;case 7:s=t.ops.pop();t.trys.pop();continue;default:if(!(a=t.trys,a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){t=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){t.label=s[1];break}if(s[0]===6&&t.label<a[1]){t.label=a[1];a=s;break}if(a&&t.label<a[2]){t.label=a[2];t.ops.push(s);break}if(a[2])t.ops.pop();t.trys.pop();continue}s=i.call(e,t)}catch(e){s=[6,e];r=0}finally{n=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,h,g as getElement}from"./index-zOTWMTLj.js";function loadFonts(e){return __awaiter(this,void 0,void 0,(function(){var i,t,n;return __generator(this,(function(r){switch(r.label){case 0:if(!e||!e.google&&!e.custom){return[2,Promise.resolve()]}r.label=1;case 1:r.trys.push([1,3,,4]);return[4,import("./webfontloader-DjUJwx0S.js").then((function(e){return e.w}))];case 2:i=r.sent();t=i.default||i;if(!t||typeof t.load!=="function"){console.warn("webfontloader no está disponible o no tiene el método load");return[2,Promise.resolve()]}return[2,new Promise((function(i){var n=Object.assign(Object.assign({},e),{active:function(){if(e.active){e.active()}i()},inactive:function(){if(e.inactive){e.inactive()}i()}});t.load(n)}))];case 3:n=r.sent();console.error("Error loading webfontloader:",n);return[2,Promise.resolve()];case 4:return[2]}}))}))}function applyFontFamily(e,i){if(e){e.style.fontFamily=i}}function formatPrice(e){return(e%1===0?e.toString():e.toFixed(2))+"€"}var bostonTemplateCss=function(){return".menu-wrapper{min-height:100vh;width:100%;padding:1.5rem 1rem;font-family:'Merriweather', serif;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;display:block}.menu-wrapper *,.menu-wrapper *::before,.menu-wrapper *::after{-webkit-box-sizing:border-box;box-sizing:border-box}.menu-wrapper h1,.menu-wrapper h2,.menu-wrapper h3,.menu-wrapper h4,.menu-wrapper h5,.menu-wrapper h6,.menu-wrapper p,.menu-wrapper ul,.menu-wrapper ol,.menu-wrapper li,.menu-wrapper header,.menu-wrapper section,.menu-wrapper article,.menu-wrapper aside,.menu-wrapper nav,.menu-wrapper blockquote,.menu-wrapper figure,.menu-wrapper figcaption{margin:0;-webkit-margin-before:0;margin-block-start:0;-webkit-margin-after:0;margin-block-end:0;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:0;margin-inline-end:0}.menu-wrapper ul,.menu-wrapper ol{padding:0}@media (min-width: 640px){.menu-wrapper{padding:2rem 1.5rem}}@media (min-width: 768px){.menu-wrapper{padding:2rem 1rem}}.menu-container{max-width:1280px;margin:0 auto}.menu-header{text-align:center}@media (min-width: 768px){.menu-header{margin-bottom:3rem}}.restaurant-title{font-size:2rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;line-height:1.1;margin:0 0 1.5rem 0!important}@media (min-width: 640px){.restaurant-title{font-size:2.5rem;margin:0 0 3rem 0!important}}@media (min-width: 768px){.restaurant-title{font-size:3rem}}@media (min-width: 1024px){.restaurant-title{font-size:3.5rem}}.sections-container{display:grid;grid-template-columns:1fr;gap:3rem}@media (min-width: 768px){.sections-container{grid-template-columns:repeat(2, 1fr);gap:4rem}}.menu-section{display:-ms-flexbox;display:flex;width:100%;position:relative}.section-label-wrapper{position:relative;width:3rem;-ms-flex-negative:0;flex-shrink:0;margin-right:1rem;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}.section-label-line{position:absolute;right:0;top:0;bottom:0;width:1px;border-right:1px solid}.section-label{font-weight:700;font-size:1.125rem;text-transform:uppercase;letter-spacing:0.15em;-webkit-writing-mode:vertical-rl;-ms-writing-mode:tb-rl;writing-mode:vertical-rl;-webkit-transform:rotate(180deg);transform:rotate(180deg);text-align:right;white-space:nowrap;margin:0 0 0.5rem 0;-webkit-margin-after:0.5rem;margin-block-end:0.5rem;position:absolute;top:0}@media (min-width: 640px){.section-label{font-size:1.2375rem}}@media (min-width: 768px){.section-label{font-size:1.35rem}}@media (min-width: 1024px){.section-label{font-size:1.51875rem}}.section-content{-ms-flex:1;flex:1;padding-top:0.25rem}.section-description{font-size:0.875rem;font-style:italic;margin:0 0 1rem 0!important;-webkit-margin-after:1rem;margin-block-end:1rem;opacity:0.75;color:inherit}@media (min-width: 640px){.section-description{font-size:0.9625rem}}@media (min-width: 768px){.section-description{font-size:1.05rem}}@media (min-width: 1024px){.section-description{font-size:1.18125rem}}.dishes-list{list-style:none;padding:0;margin:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:1rem}.dish-item{position:relative}.dish-header{display:-ms-flexbox;display:flex;-ms-flex-align:baseline;align-items:baseline;width:100%;gap:0.5rem}.dish-name{font-size:1rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;-ms-flex-negative:0;flex-shrink:0}@media (min-width: 640px){.dish-name{font-size:1.1rem}}@media (min-width: 768px){.dish-name{font-size:1.2rem}}@media (min-width: 1024px){.dish-name{font-size:1.35rem}}.dish-dots{-ms-flex:1;flex:1;opacity:0.25;border-bottom:1px dotted;margin:0 0.55rem;position:relative;top:-5px;border-color:currentColor}.dish-price{font-size:1rem;font-weight:700;-ms-flex-negative:0;flex-shrink:0;text-align:right}@media (min-width: 640px){.dish-price{font-size:1.1rem}}@media (min-width: 768px){.dish-price{font-size:1.2rem}}@media (min-width: 1024px){.dish-price{font-size:1.35rem}}.dish-description{font-size:0.8125rem;margin-top:-0.9rem;line-height:1.4;opacity:0.7;color:inherit}@media (min-width: 640px){.dish-description{font-size:0.9425rem}}"};var BostonTemplate=function(){function e(e){registerInstance(this,e);this.dataJson="{}";this.fontConfig={google:{families:["Oswald:400,600,700","Merriweather:300,400,700"]}}}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,loadFonts(this.fontConfig)];case 1:e.sent();applyFontFamily(this.el,"Merriweather, serif");return[2]}}))}))};e.prototype.render=function(){var e;var i=null;try{i=JSON.parse(this.dataJson)}catch(e){console.warn("Invalid dataJson provided to veleta-boston-template")}var t=(e=i===null||i===void 0?void 0:i.templateData)===null||e===void 0?void 0:e.theme;var n=(t===null||t===void 0?void 0:t.primaryColor)||"#1a365d";var r="Merriweather, serif";var a="Oswald, sans-serif";if(!i){return h("div",{class:"menu-wrapper",style:{color:n}})}var o=i.sections,s=i.business;var m=(o||[]).sort((function(e,i){return e.order-i.order}));return h("div",{class:"menu-wrapper",style:{color:n}},h("div",{class:"menu-container"},(s===null||s===void 0?void 0:s.name)&&h("header",{class:"menu-header"},h("h1",{class:"restaurant-title",style:{fontFamily:a}},s.name)),h("div",{class:"sections-container"},m.map((function(e){var i=(e.dishes||[]).sort((function(e,i){return e.order-i.order}));if(!i.length)return null;return h("section",{key:e.id,class:"menu-section"},h("div",{class:"section-label-wrapper"},h("div",{class:"section-label-line",style:{borderColor:n}}),h("h2",{class:"section-label",style:{fontFamily:a,color:n}},e.title)),h("div",{class:"section-content"},e.description&&h("p",{class:"section-description",style:{fontFamily:r}},e.description),h("ul",{class:"dishes-list"},i.map((function(e){return h("li",{key:e.id,class:"dish-item"},h("div",{class:"dish-header"},h("h3",{class:"dish-name",style:{fontFamily:a,color:n}},e.name),h("div",{class:"dish-dots"}),h("span",{class:"dish-price",style:{fontFamily:a,color:n}},formatPrice(e.price))),e.description&&h("p",{class:"dish-description",style:{fontFamily:r}},e.description))})))))})))))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();BostonTemplate.style=bostonTemplateCss();export{BostonTemplate as veleta_boston_template};
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,i,t,n){function r(e){return e instanceof t?e:new t((function(i){i(e)}))}return new(t||(t=Promise))((function(t,a){function o(e){try{m(n.next(e))}catch(e){a(e)}}function s(e){try{m(n["throw"](e))}catch(e){a(e)}}function m(e){e.done?t(e.value):r(e.value).then(o,s)}m((n=n.apply(e,i||[])).next())}))};var __generator=this&&this.__generator||function(e,i){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,r,a,o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=s(0),o["throw"]=s(1),o["return"]=s(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(i){return m([e,i])}}function m(s){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(t=0)),t)try{if(n=1,r&&(a=s[0]&2?r["return"]:s[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;if(r=0,a)s=[s[0]&2,a.value];switch(s[0]){case 0:case 1:a=s;break;case 4:t.label++;return{value:s[1],done:false};case 5:t.label++;r=s[1];s=[0];continue;case 7:s=t.ops.pop();t.trys.pop();continue;default:if(!(a=t.trys,a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){t=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){t.label=s[1];break}if(s[0]===6&&t.label<a[1]){t.label=a[1];a=s;break}if(a&&t.label<a[2]){t.label=a[2];t.ops.push(s);break}if(a[2])t.ops.pop();t.trys.pop();continue}s=i.call(e,t)}catch(e){s=[6,e];r=0}finally{n=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,h,g as getElement}from"./index-zOTWMTLj.js";function loadFonts(e){return __awaiter(this,void 0,void 0,(function(){var i,t,n;return __generator(this,(function(r){switch(r.label){case 0:if(!e||!e.google&&!e.custom){return[2,Promise.resolve()]}r.label=1;case 1:r.trys.push([1,3,,4]);return[4,import("./webfontloader-DjUJwx0S.js").then((function(e){return e.w}))];case 2:i=r.sent();t=i.default||i;if(!t||typeof t.load!=="function"){console.warn("webfontloader no está disponible o no tiene el método load");return[2,Promise.resolve()]}return[2,new Promise((function(i){var n=Object.assign(Object.assign({},e),{active:function(){if(e.active){e.active()}i()},inactive:function(){if(e.inactive){e.inactive()}i()}});t.load(n)}))];case 3:n=r.sent();console.error("Error loading webfontloader:",n);return[2,Promise.resolve()];case 4:return[2]}}))}))}function applyFontFamily(e,i){if(e){e.style.fontFamily=i}}function formatPrice(e){return(e%1===0?e.toString():e.toFixed(2))+"€"}var bostonTemplateCss=function(){return".menu-wrapper{min-height:100vh;width:100%;padding:1.5rem 1rem;font-family:'Merriweather', serif;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;display:block}.menu-wrapper *,.menu-wrapper *::before,.menu-wrapper *::after{-webkit-box-sizing:border-box;box-sizing:border-box}.animate-item{opacity:0;-webkit-transform:translateY(30px);transform:translateY(30px);-webkit-transition:opacity 0.8s ease-out, -webkit-transform 0.8s ease-out;transition:opacity 0.8s ease-out, -webkit-transform 0.8s ease-out;transition:opacity 0.8s ease-out, transform 0.8s ease-out;transition:opacity 0.8s ease-out, transform 0.8s ease-out, -webkit-transform 0.8s ease-out;will-change:opacity, transform}.animate-item.is-visible{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}.menu-wrapper h1,.menu-wrapper h2,.menu-wrapper h3,.menu-wrapper h4,.menu-wrapper h5,.menu-wrapper h6,.menu-wrapper p,.menu-wrapper ul,.menu-wrapper ol,.menu-wrapper li,.menu-wrapper header,.menu-wrapper section,.menu-wrapper article,.menu-wrapper aside,.menu-wrapper nav,.menu-wrapper blockquote,.menu-wrapper figure,.menu-wrapper figcaption{margin:0;-webkit-margin-before:0;margin-block-start:0;-webkit-margin-after:0;margin-block-end:0;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:0;margin-inline-end:0}.menu-wrapper ul,.menu-wrapper ol{padding:0}@media (min-width: 640px){.menu-wrapper{padding:2rem 1.5rem}}@media (min-width: 768px){.menu-wrapper{padding:2rem 1rem}}.menu-container{max-width:1280px;margin:0 auto}.menu-header{text-align:center}@media (min-width: 768px){.menu-header{margin-bottom:3rem}}.restaurant-title{font-size:2rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;line-height:1.1;margin:0 0 1.5rem 0 !important}@media (min-width: 640px){.restaurant-title{font-size:2.5rem;margin:0 0 3rem 0 !important}}@media (min-width: 768px){.restaurant-title{font-size:3rem}}@media (min-width: 1024px){.restaurant-title{font-size:3.5rem}}.sections-container{display:grid;grid-template-columns:1fr;gap:4rem}@media (min-width: 768px){.sections-container{grid-template-columns:repeat(2, 1fr);gap:3rem}}.menu-section{display:-ms-flexbox;display:flex;width:100%;position:relative}.section-label-wrapper{position:relative;width:3rem;-ms-flex-negative:0;flex-shrink:0;margin-right:1rem;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}.section-label-line{position:absolute;right:0;top:0;bottom:0;width:1px;border-right:1px solid}.section-label{font-weight:700;font-size:1.125rem;text-transform:uppercase;letter-spacing:0.15em;-webkit-writing-mode:vertical-rl;-ms-writing-mode:tb-rl;writing-mode:vertical-rl;-webkit-transform:rotate(180deg);transform:rotate(180deg);text-align:right;white-space:nowrap;margin:0 0 0.5rem 0;-webkit-margin-after:0.5rem;margin-block-end:0.5rem;position:absolute;top:0}@media (min-width: 640px){.section-label{font-size:1.2375rem}}@media (min-width: 768px){.section-label{font-size:1.35rem}}@media (min-width: 1024px){.section-label{font-size:1.51875rem}}.section-content{-ms-flex:1;flex:1;padding-top:0.25rem}.section-description{font-size:0.875rem;font-style:italic;margin:0 0 1rem 0 !important;-webkit-margin-after:1rem;margin-block-end:1rem;opacity:0.75;color:inherit}@media (min-width: 640px){.section-description{font-size:0.9625rem}}@media (min-width: 768px){.section-description{font-size:1.05rem}}@media (min-width: 1024px){.section-description{font-size:1.18125rem}}.dishes-list{list-style:none;padding:0;margin:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:1rem}.dish-item{position:relative}.dish-header{display:-ms-flexbox;display:flex;-ms-flex-align:baseline;align-items:baseline;width:100%;gap:0.5rem}.dish-name{font-size:1rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;-ms-flex-negative:1;flex-shrink:1;min-width:0;overflow-wrap:break-word}@media (min-width: 640px){.dish-name{font-size:1.1rem}}@media (min-width: 768px){.dish-name{font-size:1.2rem}}@media (min-width: 1024px){.dish-name{font-size:1.35rem}}.dish-dots{-ms-flex:1;flex:1;opacity:0.25;border-bottom:2px dotted;margin:0 0.55rem;position:relative;-webkit-transform:translateY(-5px);transform:translateY(-5px);border-color:currentColor;min-width:1rem}.dish-price{font-size:1rem;font-weight:700;-ms-flex-negative:0;flex-shrink:0;text-align:right;min-width:3ch}@media (min-width: 640px){.dish-price{font-size:1.1rem}}@media (min-width: 768px){.dish-price{font-size:1.2rem}}@media (min-width: 1024px){.dish-price{font-size:1.35rem}}.dish-description{font-size:0.8125rem;margin-top:0.25rem;line-height:1.4;opacity:0.7;color:inherit;width:100%}@media (min-width: 640px){.dish-description{font-size:0.9425rem}}"};var BostonTemplate=function(){function e(e){registerInstance(this,e);this.dataJson="{}";this.fontConfig={google:{families:["Oswald:400,600,700","Merriweather:300,400,700"]}}}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,loadFonts(this.fontConfig)];case 1:e.sent();applyFontFamily(this.el,"Merriweather, serif");return[2]}}))}))};e.prototype.componentDidLoad=function(){this.initObserver()};e.prototype.componentDidUpdate=function(){this.initObserver()};e.prototype.disconnectedCallback=function(){if(this.observer){this.observer.disconnect()}};e.prototype.initObserver=function(){var e=this;if(this.observer){this.observer.disconnect()}this.observer=new IntersectionObserver((function(i){i.forEach((function(i){if(i.isIntersecting){var t=i.target;t.classList.add("is-visible");e.observer.unobserve(t)}}))}),{threshold:.1,rootMargin:"0px 0px -50px 0px"});var i=this.el.querySelectorAll(".animate-item");i.forEach((function(i){return e.observer.observe(i)}))};e.prototype.render=function(){var e;var i=null;try{i=JSON.parse(this.dataJson)}catch(e){console.warn("Invalid dataJson provided to veleta-boston-template")}var t=(e=i===null||i===void 0?void 0:i.templateData)===null||e===void 0?void 0:e.theme;var n=(t===null||t===void 0?void 0:t.primaryColor)||"#1a365d";var r=(t===null||t===void 0?void 0:t.backgroundColor)||"#FFFFFF";var a="Merriweather, serif";var o="Oswald, sans-serif";if(!i){return h("div",{class:"menu-wrapper",style:{color:n,backgroundColor:r}})}var s=i.sections,m=i.business;var l=(s||[]).sort((function(e,i){return e.order-i.order}));return h("div",{class:"menu-wrapper",style:{color:n,backgroundColor:r}},h("div",{class:"menu-container"},(m===null||m===void 0?void 0:m.name)&&h("header",{class:"menu-header"},h("h1",{class:"restaurant-title animate-item",style:{fontFamily:o}},m.name)),h("div",{class:"sections-container"},l.map((function(e){var i=(e.dishes||[]).sort((function(e,i){return e.order-i.order}));if(!i.length)return null;return h("section",{key:e.id,class:"menu-section animate-item"},h("div",{class:"section-label-wrapper"},h("div",{class:"section-label-line",style:{borderColor:n}}),h("h2",{class:"section-label",style:{fontFamily:o,color:n}},e.title)),h("div",{class:"section-content"},e.description&&h("p",{class:"section-description",style:{fontFamily:a}},e.description),h("ul",{class:"dishes-list"},i.map((function(e,i){return h("li",{key:e.id,class:"dish-item animate-item",style:{transitionDelay:"".concat(i*50,"ms")}},h("div",{class:"dish-header"},h("h3",{class:"dish-name",style:{fontFamily:o,color:n}},e.name),h("div",{class:"dish-dots"}),h("span",{class:"dish-price",style:{fontFamily:o,color:n}},formatPrice(e.price))),e.description&&h("p",{class:"dish-description",style:{fontFamily:a}},e.description))})))))})))))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();BostonTemplate.style=bostonTemplateCss();export{BostonTemplate as veleta_boston_template};
|
|
2
2
|
//# sourceMappingURL=veleta-boston-template.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"veleta-boston-template.entry.js","sources":["src/utils/font-loader.ts","src/utils/data-helpers.ts","src/components/boston-template/boston-template.css?tag=veleta-boston-template","src/components/boston-template/boston-template.tsx"],"sourcesContent":["/**\n * Configuración de fuente para webfontloader.\n * Tipo local usado solo en este módulo.\n */\ninterface FontConfig {\n google?: {\n families: string[];\n };\n custom?: {\n families: string[];\n urls?: string[];\n };\n fontactive?: (familyName: string, fvd: string) => void;\n fontinactive?: (familyName: string, fvd: string) => void;\n active?: () => void;\n inactive?: () => void;\n}\n\n/**\n * Carga fuentes usando webfontloader de forma dinámica.\n * Esta función carga el módulo webfontloader solo cuando es necesario.\n * \n * @param fontConfig Configuración de fuentes para webfontloader\n * @returns Promise que se resuelve cuando las fuentes se cargan\n */\nexport async function loadFonts(fontConfig: FontConfig): Promise<void> {\n if (!fontConfig || (!fontConfig.google && !fontConfig.custom)) {\n return Promise.resolve();\n }\n\n try {\n // Importación dinámica de webfontloader\n // webfontloader puede exportar de diferentes formas según el entorno\n const webfontloaderModule = await import('webfontloader');\n const WebFont = webfontloaderModule.default || webfontloaderModule;\n \n if (!WebFont || typeof WebFont.load !== 'function') {\n console.warn('webfontloader no está disponible o no tiene el método load');\n return Promise.resolve();\n }\n \n return new Promise<void>((resolve) => {\n const config: any = {\n ...fontConfig,\n active: () => {\n if (fontConfig.active) {\n fontConfig.active();\n }\n resolve();\n },\n inactive: () => {\n if (fontConfig.inactive) {\n fontConfig.inactive();\n }\n // No rechazamos la promesa, solo resolvemos\n // para que el template pueda renderizarse con fuentes por defecto\n resolve();\n },\n };\n\n WebFont.load(config);\n });\n } catch (error) {\n console.error('Error loading webfontloader:', error);\n // Resolvemos en lugar de rechazar para que el template pueda renderizarse\n return Promise.resolve();\n }\n}\n\n/**\n * Aplica la familia de fuente al elemento raíz del componente.\n * \n * @param element Elemento HTML al que aplicar la fuente\n * @param fontFamily Familia de fuente CSS (ej: \"Roboto, sans-serif\")\n */\nexport function applyFontFamily(element: HTMLElement, fontFamily: string): void {\n if (fontFamily && element) {\n element.style.fontFamily = fontFamily;\n }\n}\n\n","/**\n * Formatea un precio como string con símbolo de euro.\n * Si es un número entero, no muestra decimales.\n */\nexport function formatPrice(price: number): string {\n return (price % 1 === 0 ? price.toString() : price.toFixed(2)) + '€';\n}\n\n\n\n",".menu-wrapper {\n min-height: 100vh;\n width: 100%;\n padding: 1.5rem 1rem;\n font-family: 'Merriweather', serif;\n /* Reset para aislar de estilos globales */\n box-sizing: border-box;\n margin: 0;\n display: block;\n}\n\n/* Asegurar que todos los elementos hijos usen border-box */\n.menu-wrapper *,\n.menu-wrapper *::before,\n.menu-wrapper *::after {\n box-sizing: border-box;\n}\n\n/* Reset completo de márgenes para todos los elementos HTML comunes */\n.menu-wrapper h1,\n.menu-wrapper h2,\n.menu-wrapper h3,\n.menu-wrapper h4,\n.menu-wrapper h5,\n.menu-wrapper h6,\n.menu-wrapper p,\n.menu-wrapper ul,\n.menu-wrapper ol,\n.menu-wrapper li,\n.menu-wrapper header,\n.menu-wrapper section,\n.menu-wrapper article,\n.menu-wrapper aside,\n.menu-wrapper nav,\n.menu-wrapper blockquote,\n.menu-wrapper figure,\n.menu-wrapper figcaption {\n margin: 0;\n margin-block-start: 0;\n margin-block-end: 0;\n margin-inline-start: 0;\n margin-inline-end: 0;\n}\n\n/* Reset adicional para padding en listas */\n.menu-wrapper ul,\n.menu-wrapper ol {\n padding: 0;\n}\n\n@media (min-width: 640px) {\n .menu-wrapper {\n padding: 2rem 1.5rem;\n }\n}\n\n@media (min-width: 768px) {\n .menu-wrapper {\n padding: 2rem 1rem;\n }\n}\n\n.menu-container {\n max-width: 1280px;\n margin: 0 auto;\n}\n\n.menu-header {\n text-align: center;\n}\n\n@media (min-width: 768px) {\n .menu-header {\n margin-bottom: 3rem;\n }\n}\n\n.restaurant-title {\n font-size: 2rem;\n font-weight: 700;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n line-height: 1.1;\n margin: 0 0 1.5rem 0!important;\n}\n\n@media (min-width: 640px) {\n .restaurant-title {\n font-size: 2.5rem;\n margin: 0 0 3rem 0!important;\n }\n}\n\n@media (min-width: 768px) {\n .restaurant-title {\n font-size: 3rem;\n }\n}\n\n@media (min-width: 1024px) {\n .restaurant-title {\n font-size: 3.5rem;\n }\n}\n\n.sections-container {\n display: grid;\n grid-template-columns: 1fr;\n gap: 3rem;\n}\n\n@media (min-width: 768px) {\n .sections-container {\n grid-template-columns: repeat(2, 1fr);\n gap: 4rem;\n }\n}\n\n.menu-section {\n display: flex;\n width: 100%;\n position: relative;\n}\n\n/* Título vertical izquierdo */\n.section-label-wrapper {\n position: relative;\n width: 3rem;\n flex-shrink: 0;\n margin-right: 1rem;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: flex-end;\n}\n\n.section-label-line {\n position: absolute;\n right: 0;\n top: 0;\n bottom: 0;\n width: 1px;\n border-right: 1px solid;\n}\n\n.section-label {\n font-weight: 700;\n font-size: 1.125rem;\n text-transform: uppercase;\n letter-spacing: 0.15em;\n writing-mode: vertical-rl;\n transform: rotate(180deg);\n text-align: right;\n white-space: nowrap;\n margin: 0 0 0.5rem 0;\n margin-block-end: 0.5rem;\n position: absolute;\n top: 0;\n}\n\n@media (min-width: 640px) {\n .section-label {\n font-size: 1.2375rem;\n }\n}\n\n@media (min-width: 768px) {\n .section-label {\n font-size: 1.35rem;\n }\n}\n\n@media (min-width: 1024px) {\n .section-label {\n font-size: 1.51875rem;\n }\n}\n\n/* Contenido de la sección */\n.section-content {\n flex: 1;\n padding-top: 0.25rem;\n}\n\n.section-description {\n font-size: 0.875rem;\n font-style: italic;\n margin: 0 0 1rem 0!important;\n margin-block-end: 1rem;\n opacity: 0.75;\n color: inherit;\n}\n\n@media (min-width: 640px) {\n .section-description {\n font-size: 0.9625rem;\n }\n}\n\n@media (min-width: 768px) {\n .section-description {\n font-size: 1.05rem;\n }\n}\n\n@media (min-width: 1024px) {\n .section-description {\n font-size: 1.18125rem;\n }\n}\n\n.dishes-list {\n list-style: none;\n padding: 0;\n margin: 0;\n display: flex;\n flex-direction: column;\n gap: 1rem;\n}\n\n.dish-item {\n position: relative;\n}\n\n.dish-header {\n display: flex;\n align-items: baseline;\n width: 100%;\n gap: 0.5rem;\n}\n\n.dish-name {\n font-size: 1rem;\n font-weight: 700;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n flex-shrink: 0;\n}\n\n@media (min-width: 640px) {\n .dish-name {\n font-size: 1.1rem;\n }\n}\n\n@media (min-width: 768px) {\n .dish-name {\n font-size: 1.2rem;\n }\n}\n\n@media (min-width: 1024px) {\n .dish-name {\n font-size: 1.35rem;\n }\n}\n\n.dish-dots {\n flex: 1;\n opacity: 0.25;\n border-bottom: 1px dotted;\n margin: 0 0.55rem;\n position: relative;\n top: -5px;\n border-color: currentColor;\n}\n\n.dish-price {\n font-size: 1rem;\n font-weight: 700;\n flex-shrink: 0;\n text-align: right;\n}\n\n@media (min-width: 640px) {\n .dish-price {\n font-size: 1.1rem;\n }\n}\n\n@media (min-width: 768px) {\n .dish-price {\n font-size: 1.2rem;\n }\n}\n\n@media (min-width: 1024px) {\n .dish-price {\n font-size: 1.35rem;\n }\n}\n\n.dish-description {\n font-size: 0.8125rem;\n margin-top: -0.9rem;\n line-height: 1.4;\n opacity: 0.7;\n color: inherit;\n}\n\n@media (min-width: 640px) {\n .dish-description {\n font-size: 0.9425rem;\n }\n}\n","import { Component, Prop, h, Element } from '@stencil/core';\nimport { Menu } from '../../types/interfaces';\nimport { loadFonts, applyFontFamily } from '../../utils/font-loader';\nimport { formatPrice } from '../../utils/data-helpers';\n\n@Component({\n tag: 'veleta-boston-template',\n styleUrl: 'boston-template.css',\n shadow: false,\n})\nexport class BostonTemplate {\n @Element() el: HTMLElement;\n\n @Prop() dataJson: string = '{}';\n\n private readonly fontConfig = {\n google: {\n families: ['Oswald:400,600,700', 'Merriweather:300,400,700'],\n },\n };\n\n async componentWillLoad() {\n await loadFonts(this.fontConfig);\n applyFontFamily(this.el, 'Merriweather, serif');\n }\n\n render() {\n let menuData: Menu | null = null;\n try {\n menuData = JSON.parse(this.dataJson);\n } catch (e) {\n console.warn('Invalid dataJson provided to veleta-boston-template');\n }\n\n const theme = menuData?.templateData?.theme;\n const primary = theme?.primaryColor || '#1a365d';\n const fontBody = 'Merriweather, serif';\n const fontTitle = 'Oswald, sans-serif';\n\n if (!menuData) {\n return <div class=\"menu-wrapper\" style={{ color: primary }}></div>;\n }\n\n const { sections, business } = menuData;\n // Ordenar secciones por 'order'\n const sortedSections = (sections || []).sort((a, b) => a.order - b.order);\n\n return (\n <div\n class=\"menu-wrapper\"\n style={{ color: primary }}\n >\n <div class=\"menu-container\">\n {business?.name && (\n <header class=\"menu-header\">\n <h1 class=\"restaurant-title\" style={{ fontFamily: fontTitle }}>\n {business.name}\n </h1>\n </header>\n )}\n\n {/* Layout: 1 columna mobile, 2 columnas tablet/desktop */}\n <div class=\"sections-container\">\n {sortedSections.map(section => {\n // Ordenar platos por 'order'\n const sectionDishes = (section.dishes || []).sort((a, b) => a.order - b.order);\n if (!sectionDishes.length) return null;\n\n return (\n <section key={section.id} class=\"menu-section\">\n {/* Título vertical izquierdo */}\n <div class=\"section-label-wrapper\">\n <div class=\"section-label-line\" style={{ borderColor: primary }}></div>\n <h2\n class=\"section-label\"\n style={{ fontFamily: fontTitle, color: primary }}\n >\n {section.title}\n </h2>\n </div>\n\n {/* Contenido de platos */}\n <div class=\"section-content\">\n {section.description && (\n <p class=\"section-description\" style={{ fontFamily: fontBody }}>\n {section.description}\n </p>\n )}\n\n <ul class=\"dishes-list\">\n {sectionDishes.map(dish => (\n <li key={dish.id} class=\"dish-item\">\n <div class=\"dish-header\">\n <h3\n class=\"dish-name\"\n style={{ fontFamily: fontTitle, color: primary }}\n >\n {dish.name}\n </h3>\n <div\n class=\"dish-dots\"\n ></div>\n <span\n class=\"dish-price\"\n style={{ fontFamily: fontTitle, color: primary }}\n >\n {formatPrice(dish.price)}\n </span>\n </div>\n {dish.description && (\n <p class=\"dish-description\" style={{ fontFamily: fontBody }}>\n {dish.description}\n </p>\n )}\n </li>\n ))}\n </ul>\n </div>\n </section>\n );\n })}\n </div>\n </div>\n </div>\n );\n }\n}"],"names":[],"mappings":";;AAkBA;;;;;;AAMG;AACI,eAAe,SAAS,CAAC,UAAsB,EAAA;AACpD,IAAA,IAAI,CAAC,UAAU,KAAK,CAAC,UAAU,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;AAC7D,QAAA,OAAO,OAAO,CAAC,OAAO,EAAE;;AAG1B,IAAA,IAAI;;;AAGF,QAAA,MAAM,mBAAmB,GAAG,MAAM,OAAO,6BAAe,oCAAC;AACzD,QAAA,MAAM,OAAO,GAAG,mBAAmB,CAAC,OAAO,IAAI,mBAAmB;QAElE,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,CAAC,IAAI,KAAK,UAAU,EAAE;AAClD,YAAA,OAAO,CAAC,IAAI,CAAC,4DAA4D,CAAC;AAC1E,YAAA,OAAO,OAAO,CAAC,OAAO,EAAE;;AAG1B,QAAA,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,KAAI;AACnC,YAAA,MAAM,MAAM,GACP,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,UAAU,KACb,MAAM,EAAE,MAAK;AACX,oBAAA,IAAI,UAAU,CAAC,MAAM,EAAE;wBACrB,UAAU,CAAC,MAAM,EAAE;;AAErB,oBAAA,OAAO,EAAE;AACX,iBAAC,EACD,QAAQ,EAAE,MAAK;AACb,oBAAA,IAAI,UAAU,CAAC,QAAQ,EAAE;wBACvB,UAAU,CAAC,QAAQ,EAAE;;;;AAIvB,oBAAA,OAAO,EAAE;iBACV,GACF;AAED,YAAA,OAAO,CAAC,IAAI,CAAC,MAAM,CA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KAAK,EAAC,WAAW,EACjB,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,IAE/C,IAAI,CAAC,IAAI,CACP,EACL,CACE,CAAA,KAAA,EAAA,EAAA,KAAK,EAAC,WAAW,EACZ,CAAA,EACP,CACE,CAAA,MAAA,EAAA,EAAA,KAAK,EAAC,YAAY,EAClB,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,EAAA,EAE/C,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CACnB,CACH,EACL,IAAI,CAAC,WAAW,KACf,CAAG,CAAA,GAAA,EAAA,EAAA,KAAK,EAAC,kBAAkB,EAAC,KAAK,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,EACxD,EAAA,IAAI,CAAC,WAAW,CACf,CACL,CACE,CACN,CAAC,CACC,CACD,CACE;AAEd,SAAC,CAAC,CACE,CACF,CACF;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"veleta-boston-template.entry.js","sources":["src/utils/font-loader.ts","src/utils/data-helpers.ts","src/components/boston-template/boston-template.css?tag=veleta-boston-template","src/components/boston-template/boston-template.tsx"],"sourcesContent":["/**\n * Configuración de fuente para webfontloader.\n * Tipo local usado solo en este módulo.\n */\ninterface FontConfig {\n google?: {\n families: string[];\n };\n custom?: {\n families: string[];\n urls?: string[];\n };\n fontactive?: (familyName: string, fvd: string) => void;\n fontinactive?: (familyName: string, fvd: string) => void;\n active?: () => void;\n inactive?: () => void;\n}\n\n/**\n * Carga fuentes usando webfontloader de forma dinámica.\n * Esta función carga el módulo webfontloader solo cuando es necesario.\n * \n * @param fontConfig Configuración de fuentes para webfontloader\n * @returns Promise que se resuelve cuando las fuentes se cargan\n */\nexport async function loadFonts(fontConfig: FontConfig): Promise<void> {\n if (!fontConfig || (!fontConfig.google && !fontConfig.custom)) {\n return Promise.resolve();\n }\n\n try {\n // Importación dinámica de webfontloader\n // webfontloader puede exportar de diferentes formas según el entorno\n const webfontloaderModule = await import('webfontloader');\n const WebFont = webfontloaderModule.default || webfontloaderModule;\n \n if (!WebFont || typeof WebFont.load !== 'function') {\n console.warn('webfontloader no está disponible o no tiene el método load');\n return Promise.resolve();\n }\n \n return new Promise<void>((resolve) => {\n const config: any = {\n ...fontConfig,\n active: () => {\n if (fontConfig.active) {\n fontConfig.active();\n }\n resolve();\n },\n inactive: () => {\n if (fontConfig.inactive) {\n fontConfig.inactive();\n }\n // No rechazamos la promesa, solo resolvemos\n // para que el template pueda renderizarse con fuentes por defecto\n resolve();\n },\n };\n\n WebFont.load(config);\n });\n } catch (error) {\n console.error('Error loading webfontloader:', error);\n // Resolvemos en lugar de rechazar para que el template pueda renderizarse\n return Promise.resolve();\n }\n}\n\n/**\n * Aplica la familia de fuente al elemento raíz del componente.\n * \n * @param element Elemento HTML al que aplicar la fuente\n * @param fontFamily Familia de fuente CSS (ej: \"Roboto, sans-serif\")\n */\nexport function applyFontFamily(element: HTMLElement, fontFamily: string): void {\n if (fontFamily && element) {\n element.style.fontFamily = fontFamily;\n }\n}\n\n","/**\n * Formatea un precio como string con símbolo de euro.\n * Si es un número entero, no muestra decimales.\n */\nexport function formatPrice(price: number): string {\n return (price % 1 === 0 ? price.toString() : price.toFixed(2)) + '€';\n}\n\n\n\n",".menu-wrapper {\n min-height: 100vh;\n width: 100%;\n padding: 1.5rem 1rem;\n font-family: 'Merriweather', serif;\n /* Reset para aislar de estilos globales */\n box-sizing: border-box;\n margin: 0;\n display: block;\n}\n\n/* Asegurar que todos los elementos hijos usen border-box */\n.menu-wrapper *,\n.menu-wrapper *::before,\n.menu-wrapper *::after {\n box-sizing: border-box;\n}\n\n/* Animaciones Nativas */\n.animate-item {\n opacity: 0;\n transform: translateY(30px);\n transition: opacity 0.8s ease-out, transform 0.8s ease-out;\n will-change: opacity, transform;\n}\n\n.animate-item.is-visible {\n opacity: 1;\n transform: translateY(0);\n}\n\n/* Reset completo de márgenes para todos los elementos HTML comunes */\n.menu-wrapper h1,\n.menu-wrapper h2,\n.menu-wrapper h3,\n.menu-wrapper h4,\n.menu-wrapper h5,\n.menu-wrapper h6,\n.menu-wrapper p,\n.menu-wrapper ul,\n.menu-wrapper ol,\n.menu-wrapper li,\n.menu-wrapper header,\n.menu-wrapper section,\n.menu-wrapper article,\n.menu-wrapper aside,\n.menu-wrapper nav,\n.menu-wrapper blockquote,\n.menu-wrapper figure,\n.menu-wrapper figcaption {\n margin: 0;\n margin-block-start: 0;\n margin-block-end: 0;\n margin-inline-start: 0;\n margin-inline-end: 0;\n}\n\n/* Reset adicional para padding en listas */\n.menu-wrapper ul,\n.menu-wrapper ol {\n padding: 0;\n}\n\n@media (min-width: 640px) {\n .menu-wrapper {\n padding: 2rem 1.5rem;\n }\n}\n\n@media (min-width: 768px) {\n .menu-wrapper {\n padding: 2rem 1rem;\n }\n}\n\n.menu-container {\n max-width: 1280px;\n margin: 0 auto;\n}\n\n.menu-header {\n text-align: center;\n}\n\n@media (min-width: 768px) {\n .menu-header {\n margin-bottom: 3rem;\n }\n}\n\n.restaurant-title {\n font-size: 2rem;\n font-weight: 700;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n line-height: 1.1;\n margin: 0 0 1.5rem 0 !important;\n}\n\n@media (min-width: 640px) {\n .restaurant-title {\n font-size: 2.5rem;\n margin: 0 0 3rem 0 !important;\n }\n}\n\n@media (min-width: 768px) {\n .restaurant-title {\n font-size: 3rem;\n }\n}\n\n@media (min-width: 1024px) {\n .restaurant-title {\n font-size: 3.5rem;\n }\n}\n\n.sections-container {\n display: grid;\n grid-template-columns: 1fr;\n gap: 4rem;\n}\n\n@media (min-width: 768px) {\n .sections-container {\n grid-template-columns: repeat(2, 1fr);\n gap: 3rem;\n }\n}\n\n.menu-section {\n display: flex;\n width: 100%;\n position: relative;\n}\n\n/* Título vertical izquierdo */\n.section-label-wrapper {\n position: relative;\n width: 3rem;\n flex-shrink: 0;\n margin-right: 1rem;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: flex-end;\n}\n\n.section-label-line {\n position: absolute;\n right: 0;\n top: 0;\n bottom: 0;\n width: 1px;\n border-right: 1px solid;\n}\n\n.section-label {\n font-weight: 700;\n font-size: 1.125rem;\n text-transform: uppercase;\n letter-spacing: 0.15em;\n writing-mode: vertical-rl;\n transform: rotate(180deg);\n text-align: right;\n white-space: nowrap;\n margin: 0 0 0.5rem 0;\n margin-block-end: 0.5rem;\n position: absolute;\n top: 0;\n}\n\n@media (min-width: 640px) {\n .section-label {\n font-size: 1.2375rem;\n }\n}\n\n@media (min-width: 768px) {\n .section-label {\n font-size: 1.35rem;\n }\n}\n\n@media (min-width: 1024px) {\n .section-label {\n font-size: 1.51875rem;\n }\n}\n\n/* Contenido de la sección */\n.section-content {\n flex: 1;\n padding-top: 0.25rem;\n}\n\n.section-description {\n font-size: 0.875rem;\n font-style: italic;\n margin: 0 0 1rem 0 !important;\n margin-block-end: 1rem;\n opacity: 0.75;\n color: inherit;\n}\n\n@media (min-width: 640px) {\n .section-description {\n font-size: 0.9625rem;\n }\n}\n\n@media (min-width: 768px) {\n .section-description {\n font-size: 1.05rem;\n }\n}\n\n@media (min-width: 1024px) {\n .section-description {\n font-size: 1.18125rem;\n }\n}\n\n.dishes-list {\n list-style: none;\n padding: 0;\n margin: 0;\n display: flex;\n flex-direction: column;\n gap: 1rem;\n}\n\n.dish-item {\n position: relative;\n}\n\n.dish-header {\n display: flex;\n align-items: baseline;\n width: 100%;\n gap: 0.5rem;\n}\n\n.dish-name {\n font-size: 1rem;\n font-weight: 700;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n flex-shrink: 1;\n min-width: 0;\n overflow-wrap: break-word;\n}\n\n@media (min-width: 640px) {\n .dish-name {\n font-size: 1.1rem;\n }\n}\n\n@media (min-width: 768px) {\n .dish-name {\n font-size: 1.2rem;\n }\n}\n\n@media (min-width: 1024px) {\n .dish-name {\n font-size: 1.35rem;\n }\n}\n\n.dish-dots {\n flex: 1;\n opacity: 0.25;\n border-bottom: 2px dotted;\n margin: 0 0.55rem;\n position: relative;\n transform: translateY(-5px);\n border-color: currentColor;\n min-width: 1rem;\n}\n\n.dish-price {\n font-size: 1rem;\n font-weight: 700;\n flex-shrink: 0;\n text-align: right;\n min-width: 3ch;\n}\n\n@media (min-width: 640px) {\n .dish-price {\n font-size: 1.1rem;\n }\n}\n\n@media (min-width: 768px) {\n .dish-price {\n font-size: 1.2rem;\n }\n}\n\n@media (min-width: 1024px) {\n .dish-price {\n font-size: 1.35rem;\n }\n}\n\n.dish-description {\n font-size: 0.8125rem;\n margin-top: 0.25rem;\n line-height: 1.4;\n opacity: 0.7;\n color: inherit;\n width: 100%;\n}\n\n@media (min-width: 640px) {\n .dish-description {\n font-size: 0.9425rem;\n }\n}","import { Component, Prop, h, Element } from '@stencil/core';\nimport { Menu } from '../../types/interfaces';\nimport { loadFonts, applyFontFamily } from '../../utils/font-loader';\nimport { formatPrice } from '../../utils/data-helpers';\n\n@Component({\n tag: 'veleta-boston-template',\n styleUrl: 'boston-template.css',\n shadow: false,\n})\nexport class BostonTemplate {\n @Element() el: HTMLElement;\n\n @Prop() dataJson: string = '{}';\n\n private readonly fontConfig = {\n google: {\n families: ['Oswald:400,600,700', 'Merriweather:300,400,700'],\n },\n };\n\n private observer: IntersectionObserver;\n\n async componentWillLoad() {\n await loadFonts(this.fontConfig);\n applyFontFamily(this.el, 'Merriweather, serif');\n }\n\n componentDidLoad() {\n this.initObserver();\n }\n\n componentDidUpdate() {\n this.initObserver();\n }\n\n disconnectedCallback() {\n if (this.observer) {\n this.observer.disconnect();\n }\n }\n\n private initObserver() {\n if (this.observer) {\n this.observer.disconnect();\n }\n\n this.observer = new IntersectionObserver(\n (entries) => {\n entries.forEach((entry) => {\n if (entry.isIntersecting) {\n const target = entry.target as HTMLElement;\n target.classList.add('is-visible');\n // Stop observing once visible to avoid re-animating\n this.observer.unobserve(target);\n }\n });\n },\n {\n threshold: 0.1,\n rootMargin: '0px 0px -50px 0px',\n }\n );\n\n const elements = this.el.querySelectorAll('.animate-item');\n elements.forEach((el) => this.observer.observe(el));\n }\n\n render() {\n let menuData: Menu | null = null;\n try {\n menuData = JSON.parse(this.dataJson);\n } catch (e) {\n console.warn('Invalid dataJson provided to veleta-boston-template');\n }\n\n const theme = menuData?.templateData?.theme;\n const primary = theme?.primaryColor || '#1a365d';\n const background = theme?.backgroundColor || '#FFFFFF';\n const fontBody = 'Merriweather, serif';\n const fontTitle = 'Oswald, sans-serif';\n\n if (!menuData) {\n return <div class=\"menu-wrapper\" style={{ color: primary, backgroundColor: background }}></div>;\n }\n\n const { sections, business } = menuData;\n // Ordenar secciones por 'order'\n const sortedSections = (sections || []).sort((a, b) => a.order - b.order);\n\n return (\n <div\n class=\"menu-wrapper\"\n style={{ color: primary, backgroundColor: background }}\n >\n <div class=\"menu-container\">\n {business?.name && (\n <header class=\"menu-header\">\n <h1\n class=\"restaurant-title animate-item\"\n style={{ fontFamily: fontTitle }}\n >\n {business.name}\n </h1>\n </header>\n )}\n\n <div class=\"sections-container\">\n {sortedSections.map(section => {\n const sectionDishes = (section.dishes || []).sort((a, b) => a.order - b.order);\n if (!sectionDishes.length) return null;\n\n return (\n <section key={section.id} class=\"menu-section animate-item\">\n <div class=\"section-label-wrapper\">\n <div class=\"section-label-line\" style={{ borderColor: primary }}></div>\n <h2\n class=\"section-label\"\n style={{ fontFamily: fontTitle, color: primary }}\n >\n {section.title}\n </h2>\n </div>\n\n <div class=\"section-content\">\n {section.description && (\n <p class=\"section-description\" style={{ fontFamily: fontBody }}>\n {section.description}\n </p>\n )}\n\n <ul class=\"dishes-list\">\n {sectionDishes.map((dish, index) => (\n <li\n key={dish.id}\n class=\"dish-item animate-item\"\n style={{ transitionDelay: `${index * 50}ms` }}\n >\n <div class=\"dish-header\">\n <h3\n class=\"dish-name\"\n style={{ fontFamily: fontTitle, color: primary }}\n >\n {dish.name}\n </h3>\n <div\n class=\"dish-dots\"\n ></div>\n <span\n class=\"dish-price\"\n style={{ fontFamily: fontTitle, color: primary }}\n >\n {formatPrice(dish.price)}\n </span>\n </div>\n {dish.description && (\n <p class=\"dish-description\" style={{ fontFamily: fontBody }}>\n {dish.description}\n </p>\n )}\n </li>\n ))}\n </ul>\n </div>\n </section>\n );\n })}\n </div>\n </div>\n </div>\n );\n }\n}"],"names":[],"mappings":";;AAkBA;;;;;;AAMG;AACI,eAAe,SAAS,CAAC,UAAsB,EAAA;AACpD,IAAA,IAAI,CAAC,UAAU,KAAK,CAAC,UAAU,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;AAC7D,QAAA,OAAO,OAAO,CAAC,OAAO,EAAE;;AAG1B,IAAA,IAAI;;;AAGF,QAAA,MAAM,mBAAmB,GAAG,MAAM,OAAO,6BAAe,oCAAC;AACzD,QAAA,MAAM,OAAO,GAAG,mBAAmB,CAAC,OAAO,IAAI,mBAAmB;QAElE,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,CAAC,IAAI,KAAK,UAAU,EAAE;AAClD,YAAA,OAAO,CAAC,IAAI,CAAC,4DAA4D,CAAC;AAC1E,YAAA,OAAO,OAAO,CAAC,OAAO,EAAE;;AAG1B,QAAA,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,KAAI;AACnC,YAAA,MAAM,MAAM,GACP,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,UAAU,KACb,MAAM,EAAE,MAAK;AACX,oBAAA,IAAI,UAAU,CAAC,MAAM,EAAE;wBACrB,UAAU,CAAC,MAAM,EAAE;;AAErB,oBAAA,OAAO,EAAE;AACX,iBAAC,EACD,QAAQ,EAAE,MAAK;AACb,oBAAA,IAAI,UAAU,CAAC,QAAQ,EAAE;wBACvB,UAAU,CAAC,QAAQ,EAAE;;;;AAIvB,oBAAA,OAAO,EAAE;iBACV,GACF;AAED,YAAA,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC;AACtB,SAAC,CAAC;;IACF,OAAO,KAAK,E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UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,IAE/C,IAAI,CAAC,IAAI,CACP,EACL,CACE,CAAA,KAAA,EAAA,EAAA,KAAK,EAAC,WAAW,EACZ,CAAA,EACP,CACE,CAAA,MAAA,EAAA,EAAA,KAAK,EAAC,YAAY,EAClB,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,EAAA,EAE/C,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CACnB,CACH,EACL,IAAI,CAAC,WAAW,KACf,CAAG,CAAA,GAAA,EAAA,EAAA,KAAK,EAAC,kBAAkB,EAAC,KAAK,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,EACxD,EAAA,IAAI,CAAC,WAAW,CACf,CACL,CACE,CACN,CAAC,CACC,CACD,CACE;AAEd,SAAC,CAAC,CACE,CACF,CACF;;;;;;;;"}
|
|
@@ -2,6 +2,11 @@ export declare class BostonTemplate {
|
|
|
2
2
|
el: HTMLElement;
|
|
3
3
|
dataJson: string;
|
|
4
4
|
private readonly fontConfig;
|
|
5
|
+
private observer;
|
|
5
6
|
componentWillLoad(): Promise<void>;
|
|
7
|
+
componentDidLoad(): void;
|
|
8
|
+
componentDidUpdate(): void;
|
|
9
|
+
disconnectedCallback(): void;
|
|
10
|
+
private initObserver;
|
|
6
11
|
render(): any;
|
|
7
12
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e,h as i,g as t}from"./p-zOTWMTLj.js";async function r(e){if(!e||!e.google&&!e.custom){return Promise.resolve()}try{const i=await import("./p-DjUJwx0S.js").then((function(e){return e.w}));const t=i.default||i;if(!t||typeof t.load!=="function"){console.warn("webfontloader no está disponible o no tiene el método load");return Promise.resolve()}return new Promise((i=>{const r=Object.assign(Object.assign({},e),{active:()=>{if(e.active){e.active()}i()},inactive:()=>{if(e.inactive){e.inactive()}i()}});t.load(r)}))}catch(e){console.error("Error loading webfontloader:",e);return Promise.resolve()}}function n(e,i){if(e){e.style.fontFamily=i}}function s(e){return(e%1===0?e.toString():e.toFixed(2))+"€"}const a=()=>`.menu-wrapper{min-height:100vh;width:100%;padding:1.5rem 1rem;font-family:'Merriweather', serif;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;display:block}.menu-wrapper *,.menu-wrapper *::before,.menu-wrapper *::after{-webkit-box-sizing:border-box;box-sizing:border-box}.animate-item{opacity:0;-webkit-transform:translateY(30px);transform:translateY(30px);-webkit-transition:opacity 0.8s ease-out, -webkit-transform 0.8s ease-out;transition:opacity 0.8s ease-out, -webkit-transform 0.8s ease-out;transition:opacity 0.8s ease-out, transform 0.8s ease-out;transition:opacity 0.8s ease-out, transform 0.8s ease-out, -webkit-transform 0.8s ease-out;will-change:opacity, transform}.animate-item.is-visible{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}.menu-wrapper h1,.menu-wrapper h2,.menu-wrapper h3,.menu-wrapper h4,.menu-wrapper h5,.menu-wrapper h6,.menu-wrapper p,.menu-wrapper ul,.menu-wrapper ol,.menu-wrapper li,.menu-wrapper header,.menu-wrapper section,.menu-wrapper article,.menu-wrapper aside,.menu-wrapper nav,.menu-wrapper blockquote,.menu-wrapper figure,.menu-wrapper figcaption{margin:0;-webkit-margin-before:0;margin-block-start:0;-webkit-margin-after:0;margin-block-end:0;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:0;margin-inline-end:0}.menu-wrapper ul,.menu-wrapper ol{padding:0}@media (min-width: 640px){.menu-wrapper{padding:2rem 1.5rem}}@media (min-width: 768px){.menu-wrapper{padding:2rem 1rem}}.menu-container{max-width:1280px;margin:0 auto}.menu-header{text-align:center}@media (min-width: 768px){.menu-header{margin-bottom:3rem}}.restaurant-title{font-size:2rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;line-height:1.1;margin:0 0 1.5rem 0 !important}@media (min-width: 640px){.restaurant-title{font-size:2.5rem;margin:0 0 3rem 0 !important}}@media (min-width: 768px){.restaurant-title{font-size:3rem}}@media (min-width: 1024px){.restaurant-title{font-size:3.5rem}}.sections-container{display:grid;grid-template-columns:1fr;gap:4rem}@media (min-width: 768px){.sections-container{grid-template-columns:repeat(2, 1fr);gap:3rem}}.menu-section{display:-ms-flexbox;display:flex;width:100%;position:relative}.section-label-wrapper{position:relative;width:3rem;-ms-flex-negative:0;flex-shrink:0;margin-right:1rem;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}.section-label-line{position:absolute;right:0;top:0;bottom:0;width:1px;border-right:1px solid}.section-label{font-weight:700;font-size:1.125rem;text-transform:uppercase;letter-spacing:0.15em;-webkit-writing-mode:vertical-rl;-ms-writing-mode:tb-rl;writing-mode:vertical-rl;-webkit-transform:rotate(180deg);transform:rotate(180deg);text-align:right;white-space:nowrap;margin:0 0 0.5rem 0;-webkit-margin-after:0.5rem;margin-block-end:0.5rem;position:absolute;top:0}@media (min-width: 640px){.section-label{font-size:1.2375rem}}@media (min-width: 768px){.section-label{font-size:1.35rem}}@media (min-width: 1024px){.section-label{font-size:1.51875rem}}.section-content{-ms-flex:1;flex:1;padding-top:0.25rem}.section-description{font-size:0.875rem;font-style:italic;margin:0 0 1rem 0 !important;-webkit-margin-after:1rem;margin-block-end:1rem;opacity:0.75;color:inherit}@media (min-width: 640px){.section-description{font-size:0.9625rem}}@media (min-width: 768px){.section-description{font-size:1.05rem}}@media (min-width: 1024px){.section-description{font-size:1.18125rem}}.dishes-list{list-style:none;padding:0;margin:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:1rem}.dish-item{position:relative}.dish-header{display:-ms-flexbox;display:flex;-ms-flex-align:baseline;align-items:baseline;width:100%;gap:0.5rem}.dish-name{font-size:1rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;-ms-flex-negative:1;flex-shrink:1;min-width:0;overflow-wrap:break-word}@media (min-width: 640px){.dish-name{font-size:1.1rem}}@media (min-width: 768px){.dish-name{font-size:1.2rem}}@media (min-width: 1024px){.dish-name{font-size:1.35rem}}.dish-dots{-ms-flex:1;flex:1;opacity:0.25;border-bottom:2px dotted;margin:0 0.55rem;position:relative;-webkit-transform:translateY(-5px);transform:translateY(-5px);border-color:currentColor;min-width:1rem}.dish-price{font-size:1rem;font-weight:700;-ms-flex-negative:0;flex-shrink:0;text-align:right;min-width:3ch}@media (min-width: 640px){.dish-price{font-size:1.1rem}}@media (min-width: 768px){.dish-price{font-size:1.2rem}}@media (min-width: 1024px){.dish-price{font-size:1.35rem}}.dish-description{font-size:0.8125rem;margin-top:0.25rem;line-height:1.4;opacity:0.7;color:inherit;width:100%}@media (min-width: 640px){.dish-description{font-size:0.9425rem}}`;const o=class{constructor(i){e(this,i);this.dataJson="{}";this.fontConfig={google:{families:["Oswald:400,600,700","Merriweather:300,400,700"]}}}async componentWillLoad(){await r(this.fontConfig);n(this.el,"Merriweather, serif")}componentDidLoad(){this.initObserver()}componentDidUpdate(){this.initObserver()}disconnectedCallback(){if(this.observer){this.observer.disconnect()}}initObserver(){if(this.observer){this.observer.disconnect()}this.observer=new IntersectionObserver((e=>{e.forEach((e=>{if(e.isIntersecting){const i=e.target;i.classList.add("is-visible");this.observer.unobserve(i)}}))}),{threshold:.1,rootMargin:"0px 0px -50px 0px"});const e=this.el.querySelectorAll(".animate-item");e.forEach((e=>this.observer.observe(e)))}render(){var e;let t=null;try{t=JSON.parse(this.dataJson)}catch(e){console.warn("Invalid dataJson provided to veleta-boston-template")}const r=(e=t===null||t===void 0?void 0:t.templateData)===null||e===void 0?void 0:e.theme;const n=(r===null||r===void 0?void 0:r.primaryColor)||"#1a365d";const a=(r===null||r===void 0?void 0:r.backgroundColor)||"#FFFFFF";const o="Merriweather, serif";const m="Oswald, sans-serif";if(!t){return i("div",{class:"menu-wrapper",style:{color:n,backgroundColor:a}})}const{sections:l,business:d}=t;const p=(l||[]).sort(((e,i)=>e.order-i.order));return i("div",{class:"menu-wrapper",style:{color:n,backgroundColor:a}},i("div",{class:"menu-container"},(d===null||d===void 0?void 0:d.name)&&i("header",{class:"menu-header"},i("h1",{class:"restaurant-title animate-item",style:{fontFamily:m}},d.name)),i("div",{class:"sections-container"},p.map((e=>{const t=(e.dishes||[]).sort(((e,i)=>e.order-i.order));if(!t.length)return null;return i("section",{key:e.id,class:"menu-section animate-item"},i("div",{class:"section-label-wrapper"},i("div",{class:"section-label-line",style:{borderColor:n}}),i("h2",{class:"section-label",style:{fontFamily:m,color:n}},e.title)),i("div",{class:"section-content"},e.description&&i("p",{class:"section-description",style:{fontFamily:o}},e.description),i("ul",{class:"dishes-list"},t.map(((e,t)=>i("li",{key:e.id,class:"dish-item animate-item",style:{transitionDelay:`${t*50}ms`}},i("div",{class:"dish-header"},i("h3",{class:"dish-name",style:{fontFamily:m,color:n}},e.name),i("div",{class:"dish-dots"}),i("span",{class:"dish-price",style:{fontFamily:m,color:n}},s(e.price))),e.description&&i("p",{class:"dish-description",style:{fontFamily:o}},e.description)))))))})))))}get el(){return t(this)}};o.style=a();export{o as veleta_boston_template};
|
|
2
|
+
//# sourceMappingURL=p-05409397.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["registerInstance","h","getElement","async","loadFonts","fontConfig","google","custom","Promise","resolve","webfontloaderModule","import","then","n","w","WebFont","default","load","console","warn","config","Object","assign","active","inactive","error","applyFontFamily","element","fontFamily","style","formatPrice","price","toString","toFixed","bostonTemplateCss","BostonTemplate","constructor","hostRef","this","dataJson","families","componentWillLoad","el","componentDidLoad","initObserver","componentDidUpdate","disconnectedCallback","observer","disconnect","IntersectionObserver","entries","forEach","entry","isIntersecting","target","classList","add","unobserve","threshold","rootMargin","elements","querySelectorAll","observe","render","_a","menuData","JSON","parse","e","theme","templateData","primary","primaryColor","background","backgroundColor","fontBody","fontTitle","class","color","sections","business","sortedSections","sort","a","b","order","name","map","section","sectionDishes","dishes","length","key","id","borderColor","title","description","dish","index","transitionDelay"],"sources":["0"],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ED,WAAY+C,IAAcsB,EAAKD,kBAAoB,MAE9gC,CACA,MAAItD,GAAO,OAAOxC,EAAWoC,KAAO,GAExCH,EAAeN,MAAQK,WAEdC","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,i,t,n){function r(e){return e instanceof t?e:new t((function(i){i(e)}))}return new(t||(t=Promise))((function(t,a){function o(e){try{m(n.next(e))}catch(e){a(e)}}function s(e){try{m(n["throw"](e))}catch(e){a(e)}}function m(e){e.done?t(e.value):r(e.value).then(o,s)}m((n=n.apply(e,i||[])).next())}))};var __generator=this&&this.__generator||function(e,i){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,r,a,o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=s(0),o["throw"]=s(1),o["return"]=s(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(i){return m([e,i])}}function m(s){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(t=0)),t)try{if(n=1,r&&(a=s[0]&2?r["return"]:s[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;if(r=0,a)s=[s[0]&2,a.value];switch(s[0]){case 0:case 1:a=s;break;case 4:t.label++;return{value:s[1],done:false};case 5:t.label++;r=s[1];s=[0];continue;case 7:s=t.ops.pop();t.trys.pop();continue;default:if(!(a=t.trys,a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){t=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){t.label=s[1];break}if(s[0]===6&&t.label<a[1]){t.label=a[1];a=s;break}if(a&&t.label<a[2]){t.label=a[2];t.ops.push(s);break}if(a[2])t.ops.pop();t.trys.pop();continue}s=i.call(e,t)}catch(e){s=[6,e];r=0}finally{n=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-D3ESHVSd.system.js"],(function(e,i){"use strict";var t,n,r;return{setters:[function(e){t=e.r;n=e.h;r=e.g}],execute:function(){function a(e){return __awaiter(this,void 0,void 0,(function(){var t,n,r;return __generator(this,(function(a){switch(a.label){case 0:if(!e||!e.google&&!e.custom){return[2,Promise.resolve()]}a.label=1;case 1:a.trys.push([1,3,,4]);return[4,i.import("./p-6tMTQRgb.system.js").then((function(e){return e.w}))];case 2:t=a.sent();n=t.default||t;if(!n||typeof n.load!=="function"){console.warn("webfontloader no está disponible o no tiene el método load");return[2,Promise.resolve()]}return[2,new Promise((function(i){var t=Object.assign(Object.assign({},e),{active:function(){if(e.active){e.active()}i()},inactive:function(){if(e.inactive){e.inactive()}i()}});n.load(t)}))];case 3:r=a.sent();console.error("Error loading webfontloader:",r);return[2,Promise.resolve()];case 4:return[2]}}))}))}function o(e,i){if(e){e.style.fontFamily=i}}function s(e){return(e%1===0?e.toString():e.toFixed(2))+"€"}var m=function(){return".menu-wrapper{min-height:100vh;width:100%;padding:1.5rem 1rem;font-family:'Merriweather', serif;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;display:block}.menu-wrapper *,.menu-wrapper *::before,.menu-wrapper *::after{-webkit-box-sizing:border-box;box-sizing:border-box}.animate-item{opacity:0;-webkit-transform:translateY(30px);transform:translateY(30px);-webkit-transition:opacity 0.8s ease-out, -webkit-transform 0.8s ease-out;transition:opacity 0.8s ease-out, -webkit-transform 0.8s ease-out;transition:opacity 0.8s ease-out, transform 0.8s ease-out;transition:opacity 0.8s ease-out, transform 0.8s ease-out, -webkit-transform 0.8s ease-out;will-change:opacity, transform}.animate-item.is-visible{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}.menu-wrapper h1,.menu-wrapper h2,.menu-wrapper h3,.menu-wrapper h4,.menu-wrapper h5,.menu-wrapper h6,.menu-wrapper p,.menu-wrapper ul,.menu-wrapper ol,.menu-wrapper li,.menu-wrapper header,.menu-wrapper section,.menu-wrapper article,.menu-wrapper aside,.menu-wrapper nav,.menu-wrapper blockquote,.menu-wrapper figure,.menu-wrapper figcaption{margin:0;-webkit-margin-before:0;margin-block-start:0;-webkit-margin-after:0;margin-block-end:0;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:0;margin-inline-end:0}.menu-wrapper ul,.menu-wrapper ol{padding:0}@media (min-width: 640px){.menu-wrapper{padding:2rem 1.5rem}}@media (min-width: 768px){.menu-wrapper{padding:2rem 1rem}}.menu-container{max-width:1280px;margin:0 auto}.menu-header{text-align:center}@media (min-width: 768px){.menu-header{margin-bottom:3rem}}.restaurant-title{font-size:2rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;line-height:1.1;margin:0 0 1.5rem 0 !important}@media (min-width: 640px){.restaurant-title{font-size:2.5rem;margin:0 0 3rem 0 !important}}@media (min-width: 768px){.restaurant-title{font-size:3rem}}@media (min-width: 1024px){.restaurant-title{font-size:3.5rem}}.sections-container{display:grid;grid-template-columns:1fr;gap:4rem}@media (min-width: 768px){.sections-container{grid-template-columns:repeat(2, 1fr);gap:3rem}}.menu-section{display:-ms-flexbox;display:flex;width:100%;position:relative}.section-label-wrapper{position:relative;width:3rem;-ms-flex-negative:0;flex-shrink:0;margin-right:1rem;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}.section-label-line{position:absolute;right:0;top:0;bottom:0;width:1px;border-right:1px solid}.section-label{font-weight:700;font-size:1.125rem;text-transform:uppercase;letter-spacing:0.15em;-webkit-writing-mode:vertical-rl;-ms-writing-mode:tb-rl;writing-mode:vertical-rl;-webkit-transform:rotate(180deg);transform:rotate(180deg);text-align:right;white-space:nowrap;margin:0 0 0.5rem 0;-webkit-margin-after:0.5rem;margin-block-end:0.5rem;position:absolute;top:0}@media (min-width: 640px){.section-label{font-size:1.2375rem}}@media (min-width: 768px){.section-label{font-size:1.35rem}}@media (min-width: 1024px){.section-label{font-size:1.51875rem}}.section-content{-ms-flex:1;flex:1;padding-top:0.25rem}.section-description{font-size:0.875rem;font-style:italic;margin:0 0 1rem 0 !important;-webkit-margin-after:1rem;margin-block-end:1rem;opacity:0.75;color:inherit}@media (min-width: 640px){.section-description{font-size:0.9625rem}}@media (min-width: 768px){.section-description{font-size:1.05rem}}@media (min-width: 1024px){.section-description{font-size:1.18125rem}}.dishes-list{list-style:none;padding:0;margin:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:1rem}.dish-item{position:relative}.dish-header{display:-ms-flexbox;display:flex;-ms-flex-align:baseline;align-items:baseline;width:100%;gap:0.5rem}.dish-name{font-size:1rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;-ms-flex-negative:1;flex-shrink:1;min-width:0;overflow-wrap:break-word}@media (min-width: 640px){.dish-name{font-size:1.1rem}}@media (min-width: 768px){.dish-name{font-size:1.2rem}}@media (min-width: 1024px){.dish-name{font-size:1.35rem}}.dish-dots{-ms-flex:1;flex:1;opacity:0.25;border-bottom:2px dotted;margin:0 0.55rem;position:relative;-webkit-transform:translateY(-5px);transform:translateY(-5px);border-color:currentColor;min-width:1rem}.dish-price{font-size:1rem;font-weight:700;-ms-flex-negative:0;flex-shrink:0;text-align:right;min-width:3ch}@media (min-width: 640px){.dish-price{font-size:1.1rem}}@media (min-width: 768px){.dish-price{font-size:1.2rem}}@media (min-width: 1024px){.dish-price{font-size:1.35rem}}.dish-description{font-size:0.8125rem;margin-top:0.25rem;line-height:1.4;opacity:0.7;color:inherit;width:100%}@media (min-width: 640px){.dish-description{font-size:0.9425rem}}"};var l=e("veleta_boston_template",function(){function e(e){t(this,e);this.dataJson="{}";this.fontConfig={google:{families:["Oswald:400,600,700","Merriweather:300,400,700"]}}}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,a(this.fontConfig)];case 1:e.sent();o(this.el,"Merriweather, serif");return[2]}}))}))};e.prototype.componentDidLoad=function(){this.initObserver()};e.prototype.componentDidUpdate=function(){this.initObserver()};e.prototype.disconnectedCallback=function(){if(this.observer){this.observer.disconnect()}};e.prototype.initObserver=function(){var e=this;if(this.observer){this.observer.disconnect()}this.observer=new IntersectionObserver((function(i){i.forEach((function(i){if(i.isIntersecting){var t=i.target;t.classList.add("is-visible");e.observer.unobserve(t)}}))}),{threshold:.1,rootMargin:"0px 0px -50px 0px"});var i=this.el.querySelectorAll(".animate-item");i.forEach((function(i){return e.observer.observe(i)}))};e.prototype.render=function(){var e;var i=null;try{i=JSON.parse(this.dataJson)}catch(e){console.warn("Invalid dataJson provided to veleta-boston-template")}var t=(e=i===null||i===void 0?void 0:i.templateData)===null||e===void 0?void 0:e.theme;var r=(t===null||t===void 0?void 0:t.primaryColor)||"#1a365d";var a=(t===null||t===void 0?void 0:t.backgroundColor)||"#FFFFFF";var o="Merriweather, serif";var m="Oswald, sans-serif";if(!i){return n("div",{class:"menu-wrapper",style:{color:r,backgroundColor:a}})}var l=i.sections,c=i.business;var d=(l||[]).sort((function(e,i){return e.order-i.order}));return n("div",{class:"menu-wrapper",style:{color:r,backgroundColor:a}},n("div",{class:"menu-container"},(c===null||c===void 0?void 0:c.name)&&n("header",{class:"menu-header"},n("h1",{class:"restaurant-title animate-item",style:{fontFamily:m}},c.name)),n("div",{class:"sections-container"},d.map((function(e){var i=(e.dishes||[]).sort((function(e,i){return e.order-i.order}));if(!i.length)return null;return n("section",{key:e.id,class:"menu-section animate-item"},n("div",{class:"section-label-wrapper"},n("div",{class:"section-label-line",style:{borderColor:r}}),n("h2",{class:"section-label",style:{fontFamily:m,color:r}},e.title)),n("div",{class:"section-content"},e.description&&n("p",{class:"section-description",style:{fontFamily:o}},e.description),n("ul",{class:"dishes-list"},i.map((function(e,i){return n("li",{key:e.id,class:"dish-item animate-item",style:{transitionDelay:"".concat(i*50,"ms")}},n("div",{class:"dish-header"},n("h3",{class:"dish-name",style:{fontFamily:m,color:r}},e.name),n("div",{class:"dish-dots"}),n("span",{class:"dish-price",style:{fontFamily:m,color:r}},s(e.price))),e.description&&n("p",{class:"dish-description",style:{fontFamily:o}},e.description))})))))})))))};Object.defineProperty(e.prototype,"el",{get:function(){return r(this)},enumerable:false,configurable:true});return e}());l.style=m()}}}));
|
|
2
|
+
//# sourceMappingURL=p-620b67d2.system.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["System","register","exports","module","registerInstance","h","getElement","setters","r","g","execute","loadFonts","fontConfig","google","custom","Promise","resolve","import","then","n","w","webfontloaderModule","_b","sent","WebFont_1","default","load","console","warn","config","Object","assign","active","inactive","error","error_1","applyFontFamily","element","fontFamily","style","formatPrice","price","toString","toFixed","bostonTemplateCss","BostonTemplate","class_1","hostRef","this","dataJson","families","prototype","componentWillLoad","el","componentDidLoad","initObserver","componentDidUpdate","disconnectedCallback","observer","disconnect","_this","IntersectionObserver","entries","forEach","entry","isIntersecting","target","classList","add","unobserve","threshold","rootMargin","elements","querySelectorAll","observe","render","_a","menuData","JSON","parse","e","theme","templateData","primary","primaryColor","background","backgroundColor","fontBody","fontTitle","class","color","sections","business","sortedSections","sort","a","b","order","name","map","section","sectionDishes","dishes","length","key","id","borderColor","title","description","dish","index","transitionDelay","concat","defineProperty"],"sources":["module.ts"],"mappings":"8hDAAAA,OAAOC,SAAS,CAAC,2BAA2B,SAAWC,EAASC,GAC5D,aACA,IAAIC,EAAkBC,EAAGC,EACzB,MAAO,CACHC,QAAS,CAAC,SAAUJ,GAChBC,EAAmBD,EAAOK,EAC1BH,EAAIF,EAAOE,EACXC,EAAaH,EAAOM,CACxB,GACAC,QAAS,WASL,SAAeC,EAAUC,G,sHACrB,IAAKA,IAAgBA,EAAWC,SAAWD,EAAWE,OAAS,CAC3D,SAAOC,QAAQC,UACnB,C,uCAIgC,SAAMb,EAAOc,OAAO,0BAA0BC,MAAK,SAAUC,GAAK,OAAOA,EAAEC,CAAG,K,OAApGC,EAAsBC,EAAAC,OACtBC,EAAUH,EAAoBI,SAAWJ,EAC/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,MACvhB,MACJ,EACA9E,OAAAmF,eAAInE,EAAAK,UAAA,KAAE,C,IAAN,WAAW,OAAO7C,EAAW0C,KAAO,E,qCACxC,OAAAF,CAAA,CAzEuD,IA0EvDD,EAAeN,MAAQK,GAE1B,EAER","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,n,e,r){function i(t){return t instanceof e?t:new e((function(n){n(t)}))}return new(e||(e=Promise))((function(e,o){function u(t){try{a(r.next(t))}catch(t){o(t)}}function c(t){try{a(r["throw"](t))}catch(t){o(t)}}function a(t){t.done?e(t.value):i(t.value).then(u,c)}a((r=r.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,u=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return u.next=c(0),u["throw"]=c(1),u["return"]=c(2),typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function c(t){return function(n){return a([t,n])}}function a(c){if(r)throw new TypeError("Generator is already executing.");while(u&&(u=0,c[0]&&(e=0)),e)try{if(r=1,i&&(o=c[0]&2?i["return"]:c[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;if(i=0,o)c=[c[0]&2,o.value];switch(c[0]){case 0:case 1:o=c;break;case 4:e.label++;return{value:c[1],done:false};case 5:e.label++;i=c[1];c=[0];continue;case 7:c=e.ops.pop();e.trys.pop();continue;default:if(!(o=e.trys,o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){e=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){e.label=c[1];break}if(c[0]===6&&e.label<o[1]){e.label=o[1];o=c;break}if(o&&e.label<o[2]){e.label=o[2];e.ops.push(c);break}if(o[2])e.ops.pop();e.trys.pop();continue}c=n.call(t,e)}catch(t){c=[6,t];i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};System.register(["./p-D3ESHVSd.system.js","./p-BbPAtVJG.system.js"],(function(t,n){"use strict";var e,r,i;return{setters:[function(n){e=n.p;r=n.b;t("setNonce",n.s)},function(t){i=t.g}],execute:function(){var t=this;var o=function(){var t=n.meta.url;var r={};if(t!==""){r.resourcesUrl=new URL(".",t).href}return e(r)};o().then((function(n){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,i()];case 1:t.sent();return[2,r([["p-
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,n,e,r){function i(t){return t instanceof e?t:new e((function(n){n(t)}))}return new(e||(e=Promise))((function(e,o){function u(t){try{a(r.next(t))}catch(t){o(t)}}function c(t){try{a(r["throw"](t))}catch(t){o(t)}}function a(t){t.done?e(t.value):i(t.value).then(u,c)}a((r=r.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,u=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return u.next=c(0),u["throw"]=c(1),u["return"]=c(2),typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function c(t){return function(n){return a([t,n])}}function a(c){if(r)throw new TypeError("Generator is already executing.");while(u&&(u=0,c[0]&&(e=0)),e)try{if(r=1,i&&(o=c[0]&2?i["return"]:c[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;if(i=0,o)c=[c[0]&2,o.value];switch(c[0]){case 0:case 1:o=c;break;case 4:e.label++;return{value:c[1],done:false};case 5:e.label++;i=c[1];c=[0];continue;case 7:c=e.ops.pop();e.trys.pop();continue;default:if(!(o=e.trys,o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){e=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){e.label=c[1];break}if(c[0]===6&&e.label<o[1]){e.label=o[1];o=c;break}if(o&&e.label<o[2]){e.label=o[2];e.ops.push(c);break}if(o[2])e.ops.pop();e.trys.pop();continue}c=n.call(t,e)}catch(t){c=[6,t];i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};System.register(["./p-D3ESHVSd.system.js","./p-BbPAtVJG.system.js"],(function(t,n){"use strict";var e,r,i;return{setters:[function(n){e=n.p;r=n.b;t("setNonce",n.s)},function(t){i=t.g}],execute:function(){var t=this;var o=function(){var t=n.meta.url;var r={};if(t!==""){r.resourcesUrl=new URL(".",t).href}return e(r)};o().then((function(n){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,i()];case 1:t.sent();return[2,r([["p-620b67d2.system",[[256,"veleta-boston-template",{dataJson:[1,"data-json"]}]]]],n)]}}))}))}))}}}));
|
|
2
2
|
//# sourceMappingURL=p-D1BkLoGd.system.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as
|
|
1
|
+
import{p as t,b as a}from"./p-zOTWMTLj.js";export{s as setNonce}from"./p-zOTWMTLj.js";import{g as o}from"./p-DQuL1Twl.js";var r=()=>{const a=import.meta.url;const s={};if(a!==""){s.resourcesUrl=new URL(".",a).href}return t(s)};r().then((async t=>{await o();return a([["p-05409397",[[256,"veleta-boston-template",{dataJson:[1,"data-json"]}]]]],t)}));
|
|
2
2
|
//# sourceMappingURL=veleta-templates.esm.js.map
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as e,h as i,g as t}from"./p-zOTWMTLj.js";async function r(e){if(!e||!e.google&&!e.custom){return Promise.resolve()}try{const i=await import("./p-DjUJwx0S.js").then((function(e){return e.w}));const t=i.default||i;if(!t||typeof t.load!=="function"){console.warn("webfontloader no está disponible o no tiene el método load");return Promise.resolve()}return new Promise((i=>{const r=Object.assign(Object.assign({},e),{active:()=>{if(e.active){e.active()}i()},inactive:()=>{if(e.inactive){e.inactive()}i()}});t.load(r)}))}catch(e){console.error("Error loading webfontloader:",e);return Promise.resolve()}}function n(e,i){if(e){e.style.fontFamily=i}}function s(e){return(e%1===0?e.toString():e.toFixed(2))+"€"}const a=()=>`.menu-wrapper{min-height:100vh;width:100%;padding:1.5rem 1rem;font-family:'Merriweather', serif;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;display:block}.menu-wrapper *,.menu-wrapper *::before,.menu-wrapper *::after{-webkit-box-sizing:border-box;box-sizing:border-box}.menu-wrapper h1,.menu-wrapper h2,.menu-wrapper h3,.menu-wrapper h4,.menu-wrapper h5,.menu-wrapper h6,.menu-wrapper p,.menu-wrapper ul,.menu-wrapper ol,.menu-wrapper li,.menu-wrapper header,.menu-wrapper section,.menu-wrapper article,.menu-wrapper aside,.menu-wrapper nav,.menu-wrapper blockquote,.menu-wrapper figure,.menu-wrapper figcaption{margin:0;-webkit-margin-before:0;margin-block-start:0;-webkit-margin-after:0;margin-block-end:0;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:0;margin-inline-end:0}.menu-wrapper ul,.menu-wrapper ol{padding:0}@media (min-width: 640px){.menu-wrapper{padding:2rem 1.5rem}}@media (min-width: 768px){.menu-wrapper{padding:2rem 1rem}}.menu-container{max-width:1280px;margin:0 auto}.menu-header{text-align:center}@media (min-width: 768px){.menu-header{margin-bottom:3rem}}.restaurant-title{font-size:2rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;line-height:1.1;margin:0 0 1.5rem 0!important}@media (min-width: 640px){.restaurant-title{font-size:2.5rem;margin:0 0 3rem 0!important}}@media (min-width: 768px){.restaurant-title{font-size:3rem}}@media (min-width: 1024px){.restaurant-title{font-size:3.5rem}}.sections-container{display:grid;grid-template-columns:1fr;gap:3rem}@media (min-width: 768px){.sections-container{grid-template-columns:repeat(2, 1fr);gap:4rem}}.menu-section{display:-ms-flexbox;display:flex;width:100%;position:relative}.section-label-wrapper{position:relative;width:3rem;-ms-flex-negative:0;flex-shrink:0;margin-right:1rem;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}.section-label-line{position:absolute;right:0;top:0;bottom:0;width:1px;border-right:1px solid}.section-label{font-weight:700;font-size:1.125rem;text-transform:uppercase;letter-spacing:0.15em;-webkit-writing-mode:vertical-rl;-ms-writing-mode:tb-rl;writing-mode:vertical-rl;-webkit-transform:rotate(180deg);transform:rotate(180deg);text-align:right;white-space:nowrap;margin:0 0 0.5rem 0;-webkit-margin-after:0.5rem;margin-block-end:0.5rem;position:absolute;top:0}@media (min-width: 640px){.section-label{font-size:1.2375rem}}@media (min-width: 768px){.section-label{font-size:1.35rem}}@media (min-width: 1024px){.section-label{font-size:1.51875rem}}.section-content{-ms-flex:1;flex:1;padding-top:0.25rem}.section-description{font-size:0.875rem;font-style:italic;margin:0 0 1rem 0!important;-webkit-margin-after:1rem;margin-block-end:1rem;opacity:0.75;color:inherit}@media (min-width: 640px){.section-description{font-size:0.9625rem}}@media (min-width: 768px){.section-description{font-size:1.05rem}}@media (min-width: 1024px){.section-description{font-size:1.18125rem}}.dishes-list{list-style:none;padding:0;margin:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:1rem}.dish-item{position:relative}.dish-header{display:-ms-flexbox;display:flex;-ms-flex-align:baseline;align-items:baseline;width:100%;gap:0.5rem}.dish-name{font-size:1rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;-ms-flex-negative:0;flex-shrink:0}@media (min-width: 640px){.dish-name{font-size:1.1rem}}@media (min-width: 768px){.dish-name{font-size:1.2rem}}@media (min-width: 1024px){.dish-name{font-size:1.35rem}}.dish-dots{-ms-flex:1;flex:1;opacity:0.25;border-bottom:1px dotted;margin:0 0.55rem;position:relative;top:-5px;border-color:currentColor}.dish-price{font-size:1rem;font-weight:700;-ms-flex-negative:0;flex-shrink:0;text-align:right}@media (min-width: 640px){.dish-price{font-size:1.1rem}}@media (min-width: 768px){.dish-price{font-size:1.2rem}}@media (min-width: 1024px){.dish-price{font-size:1.35rem}}.dish-description{font-size:0.8125rem;margin-top:-0.9rem;line-height:1.4;opacity:0.7;color:inherit}@media (min-width: 640px){.dish-description{font-size:0.9425rem}}`;const o=class{constructor(i){e(this,i);this.dataJson="{}";this.fontConfig={google:{families:["Oswald:400,600,700","Merriweather:300,400,700"]}}}async componentWillLoad(){await r(this.fontConfig);n(this.el,"Merriweather, serif")}render(){var e;let t=null;try{t=JSON.parse(this.dataJson)}catch(e){console.warn("Invalid dataJson provided to veleta-boston-template")}const r=(e=t===null||t===void 0?void 0:t.templateData)===null||e===void 0?void 0:e.theme;const n=(r===null||r===void 0?void 0:r.primaryColor)||"#1a365d";const a="Merriweather, serif";const o="Oswald, sans-serif";if(!t){return i("div",{class:"menu-wrapper",style:{color:n}})}const{sections:m,business:l}=t;const d=(m||[]).sort(((e,i)=>e.order-i.order));return i("div",{class:"menu-wrapper",style:{color:n}},i("div",{class:"menu-container"},(l===null||l===void 0?void 0:l.name)&&i("header",{class:"menu-header"},i("h1",{class:"restaurant-title",style:{fontFamily:o}},l.name)),i("div",{class:"sections-container"},d.map((e=>{const t=(e.dishes||[]).sort(((e,i)=>e.order-i.order));if(!t.length)return null;return i("section",{key:e.id,class:"menu-section"},i("div",{class:"section-label-wrapper"},i("div",{class:"section-label-line",style:{borderColor:n}}),i("h2",{class:"section-label",style:{fontFamily:o,color:n}},e.title)),i("div",{class:"section-content"},e.description&&i("p",{class:"section-description",style:{fontFamily:a}},e.description),i("ul",{class:"dishes-list"},t.map((e=>i("li",{key:e.id,class:"dish-item"},i("div",{class:"dish-header"},i("h3",{class:"dish-name",style:{fontFamily:o,color:n}},e.name),i("div",{class:"dish-dots"}),i("span",{class:"dish-price",style:{fontFamily:o,color:n}},s(e.price))),e.description&&i("p",{class:"dish-description",style:{fontFamily:a}},e.description)))))))})))))}get el(){return t(this)}};o.style=a();export{o as veleta_boston_template};
|
|
2
|
-
//# sourceMappingURL=p-23aa6aa2.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["registerInstance","h","getElement","async","loadFonts","fontConfig","google","custom","Promise","resolve","webfontloaderModule","import","then","n","w","WebFont","default","load","console","warn","config","Object","assign","active","inactive","error","applyFontFamily","element","fontFamily","style","formatPrice","price","toString","toFixed","bostonTemplateCss","BostonTemplate","constructor","hostRef","this","dataJson","families","componentWillLoad","el","render","_a","menuData","JSON","parse","e","theme","templateData","primary","primaryColor","fontBody","fontTitle","class","color","sections","business","sortedSections","sort","a","b","order","name","map","section","sectionDishes","dishes","length","key","id","borderColor","title","description","dish"],"sources":["0"],"mappings":"YAAcA,OAAkBC,OAAQC,MAAkB,kBAS1DC,eAAeC,EAAUC,GACrB,IAAKA,IAAgBA,EAAWC,SAAWD,EAAWE,OAAS,CAC3D,OAAOC,QAAQC,SACnB,CACA,IAGI,MAAMC,QAA4BC,OAAO,mBAAmBC,MAAK,SAAUC,GAAK,OAAOA,EAAEC,CAAG,IAC5F,MAAMC,EAAUL,EAAoBM,SAAWN,EAC/C,IAAKK,UAAkBA,EAAQE,OAAS,WAAY,CAChDC,QAAQC,KAAK,8DACb,OAAOX,QAAQC,SACnB,CACA,OAAO,IAAID,SAASC,IAChB,MAAMW,EAASC,OAAOC,OAAOD,OAAOC,OAAO,CAAC,EAAGjB,GAAa,CAAEkB,OAAQ,KAC9D,GAAIlB,EAAWkB,OAAQ,CACnBlB,EAAWkB,QACf,CACAd,GAAS,EACVe,SAAU,KACT,GAAInB,EAAWmB,SAAU,CACrBnB,EAAWmB,UACf,CAGAf,GAAS,IAEjBM,EAAQE,KAAKG,EAAO,GAE5B,CACA,MAAOK,GACHP,QAAQO,MAAM,+BAAgCA,GAE9C,OAAOjB,QAAQC,SACnB,CACJ,CAOA,SAASiB,EAAgBC,EAASC,GAC9B,GAAID,EAAS,CACTA,EAAQE,MAAMD,WAAaA,CAC/B,CACJ,CAMA,SAASE,EAAYC,GACjB,OAAQA,EAAQ,IAAM,E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QE,QAAU,IAAIR,MAAK,CAACC,EAAGC,IAAMD,EAAEE,MAAQD,EAAEC,QACxE,IAAKI,EAAcE,OACf,OAAO,KACX,OAAQpE,EAAE,UAAW,CAAEqE,IAAKJ,EAAQK,GAAIhB,MAAO,gBAAkBtD,EAAE,MAAO,CAAEsD,MAAO,yBAA2BtD,EAAE,MAAO,CAAEsD,MAAO,qBAAsB1B,MAAO,CAAE2C,YAAarB,KAAclD,EAAE,KAAM,CAAEsD,MAAO,gBAAiB1B,MAAO,CAAED,WAAY0B,EAAWE,MAAOL,IAAae,EAAQO,QAASxE,EAAE,MAAO,CAAEsD,MAAO,mBAAqBW,EAAQQ,aAAgBzE,EAAE,IAAK,CAAEsD,MAAO,sBAAuB1B,MAAO,CAAED,WAAYyB,IAAca,EAAQQ,aAAezE,EAAE,KAAM,CAAEsD,MAAO,eAAiBY,EAAcF,KAAIU,GAAS1E,EAAE,KAAM,CAAEqE,IAAKK,EAAKJ,GAAIhB,MAAO,aAAetD,EAAE,MAAO,CAAEsD,MAAO,eAAiBtD,EAAE,KAAM,CAAEsD,MAAO,YAAa1B,MAAO,CAAED,WAAY0B,EAAWE,MAAOL,IAAawB,EAAKX,MAAO/D,EAAE,MAAO,CAAEsD,MAAO,cAAgBtD,EAAE,OAAQ,CAAEsD,MAAO,aAAc1B,MAAO,CAAED,WAAY0B,EAAWE,MAAOL,IAAarB,EAAY6C,EAAK5C,SAAU4C,EAAKD,aAAgBzE,EAAE,IAAK,CAAEsD,MAAO,mBAAoB1B,MAAO,CAAED,WAAYyB,IAAcsB,EAAKD,kBAAoB,MAE57B,CACA,MAAIhC,GAAO,OAAOxC,EAAWoC,KAAO,GAExCH,EAAeN,MAAQK,WAEdC","ignoreList":[]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,i,t,n){function r(e){return e instanceof t?e:new t((function(i){i(e)}))}return new(t||(t=Promise))((function(t,a){function o(e){try{m(n.next(e))}catch(e){a(e)}}function s(e){try{m(n["throw"](e))}catch(e){a(e)}}function m(e){e.done?t(e.value):r(e.value).then(o,s)}m((n=n.apply(e,i||[])).next())}))};var __generator=this&&this.__generator||function(e,i){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,r,a,o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=s(0),o["throw"]=s(1),o["return"]=s(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(i){return m([e,i])}}function m(s){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(t=0)),t)try{if(n=1,r&&(a=s[0]&2?r["return"]:s[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;if(r=0,a)s=[s[0]&2,a.value];switch(s[0]){case 0:case 1:a=s;break;case 4:t.label++;return{value:s[1],done:false};case 5:t.label++;r=s[1];s=[0];continue;case 7:s=t.ops.pop();t.trys.pop();continue;default:if(!(a=t.trys,a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){t=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){t.label=s[1];break}if(s[0]===6&&t.label<a[1]){t.label=a[1];a=s;break}if(a&&t.label<a[2]){t.label=a[2];t.ops.push(s);break}if(a[2])t.ops.pop();t.trys.pop();continue}s=i.call(e,t)}catch(e){s=[6,e];r=0}finally{n=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-D3ESHVSd.system.js"],(function(e,i){"use strict";var t,n,r;return{setters:[function(e){t=e.r;n=e.h;r=e.g}],execute:function(){function a(e){return __awaiter(this,void 0,void 0,(function(){var t,n,r;return __generator(this,(function(a){switch(a.label){case 0:if(!e||!e.google&&!e.custom){return[2,Promise.resolve()]}a.label=1;case 1:a.trys.push([1,3,,4]);return[4,i.import("./p-6tMTQRgb.system.js").then((function(e){return e.w}))];case 2:t=a.sent();n=t.default||t;if(!n||typeof n.load!=="function"){console.warn("webfontloader no está disponible o no tiene el método load");return[2,Promise.resolve()]}return[2,new Promise((function(i){var t=Object.assign(Object.assign({},e),{active:function(){if(e.active){e.active()}i()},inactive:function(){if(e.inactive){e.inactive()}i()}});n.load(t)}))];case 3:r=a.sent();console.error("Error loading webfontloader:",r);return[2,Promise.resolve()];case 4:return[2]}}))}))}function o(e,i){if(e){e.style.fontFamily=i}}function s(e){return(e%1===0?e.toString():e.toFixed(2))+"€"}var m=function(){return".menu-wrapper{min-height:100vh;width:100%;padding:1.5rem 1rem;font-family:'Merriweather', serif;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;display:block}.menu-wrapper *,.menu-wrapper *::before,.menu-wrapper *::after{-webkit-box-sizing:border-box;box-sizing:border-box}.menu-wrapper h1,.menu-wrapper h2,.menu-wrapper h3,.menu-wrapper h4,.menu-wrapper h5,.menu-wrapper h6,.menu-wrapper p,.menu-wrapper ul,.menu-wrapper ol,.menu-wrapper li,.menu-wrapper header,.menu-wrapper section,.menu-wrapper article,.menu-wrapper aside,.menu-wrapper nav,.menu-wrapper blockquote,.menu-wrapper figure,.menu-wrapper figcaption{margin:0;-webkit-margin-before:0;margin-block-start:0;-webkit-margin-after:0;margin-block-end:0;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:0;margin-inline-end:0}.menu-wrapper ul,.menu-wrapper ol{padding:0}@media (min-width: 640px){.menu-wrapper{padding:2rem 1.5rem}}@media (min-width: 768px){.menu-wrapper{padding:2rem 1rem}}.menu-container{max-width:1280px;margin:0 auto}.menu-header{text-align:center}@media (min-width: 768px){.menu-header{margin-bottom:3rem}}.restaurant-title{font-size:2rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;line-height:1.1;margin:0 0 1.5rem 0!important}@media (min-width: 640px){.restaurant-title{font-size:2.5rem;margin:0 0 3rem 0!important}}@media (min-width: 768px){.restaurant-title{font-size:3rem}}@media (min-width: 1024px){.restaurant-title{font-size:3.5rem}}.sections-container{display:grid;grid-template-columns:1fr;gap:3rem}@media (min-width: 768px){.sections-container{grid-template-columns:repeat(2, 1fr);gap:4rem}}.menu-section{display:-ms-flexbox;display:flex;width:100%;position:relative}.section-label-wrapper{position:relative;width:3rem;-ms-flex-negative:0;flex-shrink:0;margin-right:1rem;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}.section-label-line{position:absolute;right:0;top:0;bottom:0;width:1px;border-right:1px solid}.section-label{font-weight:700;font-size:1.125rem;text-transform:uppercase;letter-spacing:0.15em;-webkit-writing-mode:vertical-rl;-ms-writing-mode:tb-rl;writing-mode:vertical-rl;-webkit-transform:rotate(180deg);transform:rotate(180deg);text-align:right;white-space:nowrap;margin:0 0 0.5rem 0;-webkit-margin-after:0.5rem;margin-block-end:0.5rem;position:absolute;top:0}@media (min-width: 640px){.section-label{font-size:1.2375rem}}@media (min-width: 768px){.section-label{font-size:1.35rem}}@media (min-width: 1024px){.section-label{font-size:1.51875rem}}.section-content{-ms-flex:1;flex:1;padding-top:0.25rem}.section-description{font-size:0.875rem;font-style:italic;margin:0 0 1rem 0!important;-webkit-margin-after:1rem;margin-block-end:1rem;opacity:0.75;color:inherit}@media (min-width: 640px){.section-description{font-size:0.9625rem}}@media (min-width: 768px){.section-description{font-size:1.05rem}}@media (min-width: 1024px){.section-description{font-size:1.18125rem}}.dishes-list{list-style:none;padding:0;margin:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:1rem}.dish-item{position:relative}.dish-header{display:-ms-flexbox;display:flex;-ms-flex-align:baseline;align-items:baseline;width:100%;gap:0.5rem}.dish-name{font-size:1rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;-ms-flex-negative:0;flex-shrink:0}@media (min-width: 640px){.dish-name{font-size:1.1rem}}@media (min-width: 768px){.dish-name{font-size:1.2rem}}@media (min-width: 1024px){.dish-name{font-size:1.35rem}}.dish-dots{-ms-flex:1;flex:1;opacity:0.25;border-bottom:1px dotted;margin:0 0.55rem;position:relative;top:-5px;border-color:currentColor}.dish-price{font-size:1rem;font-weight:700;-ms-flex-negative:0;flex-shrink:0;text-align:right}@media (min-width: 640px){.dish-price{font-size:1.1rem}}@media (min-width: 768px){.dish-price{font-size:1.2rem}}@media (min-width: 1024px){.dish-price{font-size:1.35rem}}.dish-description{font-size:0.8125rem;margin-top:-0.9rem;line-height:1.4;opacity:0.7;color:inherit}@media (min-width: 640px){.dish-description{font-size:0.9425rem}}"};var l=e("veleta_boston_template",function(){function e(e){t(this,e);this.dataJson="{}";this.fontConfig={google:{families:["Oswald:400,600,700","Merriweather:300,400,700"]}}}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,a(this.fontConfig)];case 1:e.sent();o(this.el,"Merriweather, serif");return[2]}}))}))};e.prototype.render=function(){var e;var i=null;try{i=JSON.parse(this.dataJson)}catch(e){console.warn("Invalid dataJson provided to veleta-boston-template")}var t=(e=i===null||i===void 0?void 0:i.templateData)===null||e===void 0?void 0:e.theme;var r=(t===null||t===void 0?void 0:t.primaryColor)||"#1a365d";var a="Merriweather, serif";var o="Oswald, sans-serif";if(!i){return n("div",{class:"menu-wrapper",style:{color:r}})}var m=i.sections,l=i.business;var c=(m||[]).sort((function(e,i){return e.order-i.order}));return n("div",{class:"menu-wrapper",style:{color:r}},n("div",{class:"menu-container"},(l===null||l===void 0?void 0:l.name)&&n("header",{class:"menu-header"},n("h1",{class:"restaurant-title",style:{fontFamily:o}},l.name)),n("div",{class:"sections-container"},c.map((function(e){var i=(e.dishes||[]).sort((function(e,i){return e.order-i.order}));if(!i.length)return null;return n("section",{key:e.id,class:"menu-section"},n("div",{class:"section-label-wrapper"},n("div",{class:"section-label-line",style:{borderColor:r}}),n("h2",{class:"section-label",style:{fontFamily:o,color:r}},e.title)),n("div",{class:"section-content"},e.description&&n("p",{class:"section-description",style:{fontFamily:a}},e.description),n("ul",{class:"dishes-list"},i.map((function(e){return n("li",{key:e.id,class:"dish-item"},n("div",{class:"dish-header"},n("h3",{class:"dish-name",style:{fontFamily:o,color:r}},e.name),n("div",{class:"dish-dots"}),n("span",{class:"dish-price",style:{fontFamily:o,color:r}},s(e.price))),e.description&&n("p",{class:"dish-description",style:{fontFamily:a}},e.description))})))))})))))};Object.defineProperty(e.prototype,"el",{get:function(){return r(this)},enumerable:false,configurable:true});return e}());l.style=m()}}}));
|
|
2
|
-
//# sourceMappingURL=p-83a66176.system.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["System","register","exports","module","registerInstance","h","getElement","setters","r","g","execute","loadFonts","fontConfig","google","custom","Promise","resolve","import","then","n","w","webfontloaderModule","_b","sent","WebFont_1","default","load","console","warn","config","Object","assign","active","inactive","error","error_1","applyFontFamily","element","fontFamily","style","formatPrice","price","toString","toFixed","bostonTemplateCss","BostonTemplate","class_1","hostRef","this","dataJson","families","prototype","componentWillLoad","el","render","_a","menuData","JSON","parse","e","theme","templateData","primary","primaryColor","fontBody","fontTitle","class","color","sections","business","sortedSections","sort","a","b","order","name","map","section","sectionDishes","dishes","length","key","id","borderColor","title","description","dish","defineProperty"],"sources":["module.ts"],"mappings":"8hDAAAA,OAAOC,SAAS,CAAC,2BAA2B,SAAWC,EAASC,GAC5D,aACA,IAAIC,EAAkBC,EAAGC,EACzB,MAAO,CACHC,QAAS,CAAC,SAAUJ,GAChBC,EAAmBD,EAAOK,EAC1BH,EAAIF,EAAOE,EACXC,EAAaH,EAAOM,CACxB,GACAC,QAAS,WASL,SAAeC,EAAUC,G,sHACrB,IAAKA,IAAgBA,EAAWC,SAAWD,EAAWE,OAAS,CAC3D,SAAOC,QAAQC,UACnB,C,uCAIgC,SAAMb,EAAOc,OAAO,0BAA0BC,MAAK,SAAUC,GAAK,OAAOA,EAAEC,CAAG,K,OAApGC,EAAsBC,EAAAC,OACtBC,EAAUH,EAAoBI,SAAWJ,EAC/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