veleta-templates 0.0.8 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dist/cjs/data-helpers-Dv_PXPva.js +68 -0
  2. package/dist/cjs/{index-rvPH40G4.js → index-Q72R0i75.js} +78 -9
  3. package/dist/cjs/loader.cjs.js +2 -2
  4. package/dist/cjs/veleta-brooklyn-template.cjs.entry.js +93 -0
  5. package/dist/cjs/veleta-templates.cjs.js +2 -2
  6. package/dist/cjs/veleta-umami-template.cjs.entry.js +95 -0
  7. package/dist/collection/collection-manifest.json +2 -1
  8. package/dist/collection/components/brooklyn-template/brooklyn-template.css +217 -0
  9. package/dist/collection/components/brooklyn-template/brooklyn-template.js +140 -0
  10. package/dist/collection/components/umami-template/umami-template.css +392 -0
  11. package/dist/collection/components/{boston-template/boston-template.js → umami-template/umami-template.js} +8 -8
  12. package/dist/collection/components.js +1 -1
  13. package/dist/components/index.js +72 -7
  14. package/dist/components/p-1I-eujUE.js +64 -0
  15. package/dist/components/veleta-brooklyn-template.d.ts +11 -0
  16. package/dist/components/veleta-brooklyn-template.js +114 -0
  17. package/dist/components/veleta-umami-template.d.ts +11 -0
  18. package/dist/components/veleta-umami-template.js +116 -0
  19. package/dist/esm/data-helpers-CMnPLI2F.js +64 -0
  20. package/dist/esm/{index-zOTWMTLj.js → index-Bd-RqEyq.js} +78 -9
  21. package/dist/esm/loader.js +3 -3
  22. package/dist/esm/veleta-brooklyn-template.entry.js +91 -0
  23. package/dist/esm/veleta-templates.js +3 -3
  24. package/dist/esm/veleta-umami-template.entry.js +93 -0
  25. package/dist/esm-es5/data-helpers-CMnPLI2F.js +1 -0
  26. package/dist/esm-es5/index-Bd-RqEyq.js +1 -0
  27. package/dist/esm-es5/loader.js +1 -1
  28. package/dist/esm-es5/veleta-brooklyn-template.entry.js +1 -0
  29. package/dist/esm-es5/veleta-templates.js +1 -1
  30. package/dist/esm-es5/veleta-umami-template.entry.js +1 -0
  31. package/dist/types/components/brooklyn-template/brooklyn-template.d.ts +19 -0
  32. package/dist/types/components/{boston-template/boston-template.d.ts → umami-template/umami-template.d.ts} +1 -1
  33. package/dist/types/components.d.ts +40 -9
  34. package/dist/veleta-templates/p-1I-eujUE.js +1 -0
  35. package/dist/veleta-templates/p-6d9d006c.system.entry.js +1 -0
  36. package/dist/veleta-templates/p-BK_Xoawn.system.js +1 -0
  37. package/dist/veleta-templates/p-Bd-RqEyq.js +2 -0
  38. package/dist/veleta-templates/p-Bqdj2gqf.system.js +1 -0
  39. package/dist/veleta-templates/p-DgwkUF2J.system.js +2 -0
  40. package/dist/veleta-templates/p-cebfae03.entry.js +1 -0
  41. package/dist/veleta-templates/p-d999def7.entry.js +1 -0
  42. package/dist/veleta-templates/p-ee014e72.system.entry.js +1 -0
  43. package/dist/veleta-templates/veleta-templates.esm.js +1 -1
  44. package/dist/veleta-templates/veleta-templates.js +1 -1
  45. package/package.json +1 -1
  46. package/dist/cjs/veleta-boston-template.cjs.entry.js +0 -157
  47. package/dist/collection/components/boston-template/boston-template.css +0 -323
  48. package/dist/components/veleta-boston-template.d.ts +0 -11
  49. package/dist/components/veleta-boston-template.js +0 -178
  50. package/dist/esm/veleta-boston-template.entry.js +0 -155
  51. package/dist/esm-es5/index-zOTWMTLj.js +0 -1
  52. package/dist/esm-es5/veleta-boston-template.entry.js +0 -1
  53. package/dist/veleta-templates/p-2a61ffe8.system.entry.js +0 -1
  54. package/dist/veleta-templates/p-64db36d4.entry.js +0 -1
  55. package/dist/veleta-templates/p-D1BkLoGd.system.js +0 -1
  56. package/dist/veleta-templates/p-D3ESHVSd.system.js +0 -2
  57. package/dist/veleta-templates/p-zOTWMTLj.js +0 -2
@@ -0,0 +1,68 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * Carga fuentes usando webfontloader de forma dinámica.
5
+ * Esta función carga el módulo webfontloader solo cuando es necesario.
6
+ *
7
+ * @param fontConfig Configuración de fuentes para webfontloader
8
+ * @returns Promise que se resuelve cuando las fuentes se cargan
9
+ */
10
+ async function loadFonts(fontConfig) {
11
+ if (!fontConfig || (!fontConfig.google && !fontConfig.custom)) {
12
+ return Promise.resolve();
13
+ }
14
+ try {
15
+ // Importación dinámica de webfontloader
16
+ // webfontloader puede exportar de diferentes formas según el entorno
17
+ const webfontloaderModule = await Promise.resolve().then(function () { return require('./webfontloader-CDgRDOZ3.js'); }).then(function (n) { return n.webfontloader; });
18
+ const WebFont = webfontloaderModule.default || webfontloaderModule;
19
+ if (!WebFont || typeof WebFont.load !== 'function') {
20
+ console.warn('webfontloader no está disponible o no tiene el método load');
21
+ return Promise.resolve();
22
+ }
23
+ return new Promise((resolve) => {
24
+ const config = Object.assign(Object.assign({}, fontConfig), { active: () => {
25
+ if (fontConfig.active) {
26
+ fontConfig.active();
27
+ }
28
+ resolve();
29
+ }, inactive: () => {
30
+ if (fontConfig.inactive) {
31
+ fontConfig.inactive();
32
+ }
33
+ // No rechazamos la promesa, solo resolvemos
34
+ // para que el template pueda renderizarse con fuentes por defecto
35
+ resolve();
36
+ } });
37
+ WebFont.load(config);
38
+ });
39
+ }
40
+ catch (error) {
41
+ console.error('Error loading webfontloader:', error);
42
+ // Resolvemos en lugar de rechazar para que el template pueda renderizarse
43
+ return Promise.resolve();
44
+ }
45
+ }
46
+ /**
47
+ * Aplica la familia de fuente al elemento raíz del componente.
48
+ *
49
+ * @param element Elemento HTML al que aplicar la fuente
50
+ * @param fontFamily Familia de fuente CSS (ej: "Roboto, sans-serif")
51
+ */
52
+ function applyFontFamily(element, fontFamily) {
53
+ if (fontFamily && element) {
54
+ element.style.fontFamily = fontFamily;
55
+ }
56
+ }
57
+
58
+ /**
59
+ * Formatea un precio como string con símbolo de euro.
60
+ * Si es un número entero, no muestra decimales.
61
+ */
62
+ function formatPrice(price) {
63
+ return (price % 1 === 0 ? price.toString() : price.toFixed(2)) + '€';
64
+ }
65
+
66
+ exports.applyFontFamily = applyFontFamily;
67
+ exports.formatPrice = formatPrice;
68
+ exports.loadFonts = loadFonts;
@@ -29,6 +29,10 @@ var __export = (target, all) => {
29
29
  for (var name in all)
30
30
  __defProp(target, name, { get: all[name], enumerable: true });
31
31
  };
32
+
33
+ // src/utils/constants.ts
34
+ var SVG_NS = "http://www.w3.org/2000/svg";
35
+ var HTML_NS = "http://www.w3.org/1999/xhtml";
32
36
  var reWireGetterSetter = (instance, hostRef) => {
33
37
  var _a;
34
38
  const cmpMeta = hostRef.$cmpMeta$;
@@ -97,6 +101,7 @@ var registerHost = (hostElement, cmpMeta) => {
97
101
  hostElement.__stencil__getHostRef = () => ref;
98
102
  return ref;
99
103
  };
104
+ var isMemberInElement = (elm, memberName) => memberName in elm;
100
105
  var consoleError = (e, el) => (0, console.error)(e, el);
101
106
 
102
107
  // src/client/client-load-module.ts
@@ -119,10 +124,14 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
119
124
  }
120
125
  switch(bundleId) {
121
126
 
122
- case 'veleta-boston-template.cjs':
127
+ case 'veleta-brooklyn-template.cjs':
128
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
129
+ /* webpackMode: "lazy" */
130
+ './veleta-brooklyn-template.cjs.entry.js')); }).then(processMod, consoleError);
131
+ case 'veleta-umami-template.cjs':
123
132
  return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
124
133
  /* webpackMode: "lazy" */
125
- './veleta-boston-template.cjs.entry.js')); }).then(processMod, consoleError);
134
+ './veleta-umami-template.cjs.entry.js')); }).then(processMod, consoleError);
126
135
  }
127
136
  }
128
137
  return (function (t) { return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(t)); }); })(
@@ -481,6 +490,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
481
490
  if (oldValue === newValue) {
482
491
  return;
483
492
  }
493
+ let isProp = isMemberInElement(elm, memberName);
484
494
  memberName.toLowerCase();
485
495
  if (memberName === "class") {
486
496
  const classList = elm.classList;
@@ -511,7 +521,40 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
511
521
  }
512
522
  }
513
523
  }
514
- } else ;
524
+ } else if (memberName === "key") ; else {
525
+ const isComplex = isComplexType(newValue);
526
+ if ((isProp || isComplex && newValue !== null) && !isSvg) {
527
+ try {
528
+ if (!elm.tagName.includes("-")) {
529
+ const n = newValue == null ? "" : newValue;
530
+ if (memberName === "list") {
531
+ isProp = false;
532
+ } else if (oldValue == null || elm[memberName] != n) {
533
+ if (typeof elm.__lookupSetter__(memberName) === "function") {
534
+ elm[memberName] = n;
535
+ } else {
536
+ elm.setAttribute(memberName, n);
537
+ }
538
+ }
539
+ } else if (elm[memberName] !== newValue) {
540
+ elm[memberName] = newValue;
541
+ }
542
+ } catch (e) {
543
+ }
544
+ }
545
+ if (newValue == null || newValue === false) {
546
+ if (newValue !== false || elm.getAttribute(memberName) === "") {
547
+ {
548
+ elm.removeAttribute(memberName);
549
+ }
550
+ }
551
+ } else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex && elm.nodeType === 1 /* ElementNode */) {
552
+ newValue = newValue === true ? "" : newValue;
553
+ {
554
+ elm.setAttribute(memberName, newValue);
555
+ }
556
+ }
557
+ }
515
558
  };
516
559
  var parseClassListRegex = /\s/;
517
560
  var parseClassList = (value) => {
@@ -536,7 +579,9 @@ var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
536
579
  elm,
537
580
  memberName,
538
581
  oldVnodeAttrs[memberName],
539
- void 0);
582
+ void 0,
583
+ isSvgMode2,
584
+ newVnode.$flags$);
540
585
  }
541
586
  }
542
587
  }
@@ -545,7 +590,9 @@ var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
545
590
  elm,
546
591
  memberName,
547
592
  oldVnodeAttrs[memberName],
548
- newVnodeAttrs[memberName]);
593
+ newVnodeAttrs[memberName],
594
+ isSvgMode2,
595
+ newVnode.$flags$);
549
596
  }
550
597
  };
551
598
  function sortedAttrNames(attrNames) {
@@ -558,6 +605,7 @@ function sortedAttrNames(attrNames) {
558
605
  );
559
606
  }
560
607
  var hostTagName;
608
+ var isSvgMode = false;
561
609
  var createElm = (oldParentVNode, newParentVNode, childIndex) => {
562
610
  const newVNode2 = newParentVNode.$children$[childIndex];
563
611
  let i2 = 0;
@@ -566,16 +614,23 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
566
614
  if (newVNode2.$text$ !== null) {
567
615
  elm = newVNode2.$elm$ = win.document.createTextNode(newVNode2.$text$);
568
616
  } else {
617
+ if (!isSvgMode) {
618
+ isSvgMode = newVNode2.$tag$ === "svg";
619
+ }
569
620
  if (!win.document) {
570
621
  throw new Error(
571
622
  "You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component."
572
623
  );
573
624
  }
574
- elm = newVNode2.$elm$ = win.document.createElement(
625
+ elm = newVNode2.$elm$ = win.document.createElementNS(
626
+ isSvgMode ? SVG_NS : HTML_NS,
575
627
  newVNode2.$tag$
576
- );
628
+ ) ;
629
+ if (isSvgMode && newVNode2.$tag$ === "foreignObject") {
630
+ isSvgMode = false;
631
+ }
577
632
  {
578
- updateElement(null, newVNode2);
633
+ updateElement(null, newVNode2, isSvgMode);
579
634
  }
580
635
  if (newVNode2.$children$) {
581
636
  for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
@@ -585,6 +640,13 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
585
640
  }
586
641
  }
587
642
  }
643
+ {
644
+ if (newVNode2.$tag$ === "svg") {
645
+ isSvgMode = false;
646
+ } else if (elm.tagName === "foreignObject") {
647
+ isSvgMode = true;
648
+ }
649
+ }
588
650
  }
589
651
  elm["s-hn"] = hostTagName;
590
652
  return elm;
@@ -713,10 +775,14 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
713
775
  const elm = newVNode2.$elm$ = oldVNode.$elm$;
714
776
  const oldChildren = oldVNode.$children$;
715
777
  const newChildren = newVNode2.$children$;
778
+ const tag = newVNode2.$tag$;
716
779
  const text = newVNode2.$text$;
717
780
  if (text === null) {
718
781
  {
719
- updateElement(oldVNode, newVNode2);
782
+ isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
783
+ }
784
+ {
785
+ updateElement(oldVNode, newVNode2, isSvgMode);
720
786
  }
721
787
  if (oldChildren !== null && newChildren !== null) {
722
788
  updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
@@ -731,6 +797,9 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
731
797
  ) {
732
798
  removeVnodes(oldChildren, 0, oldChildren.length - 1);
733
799
  } else ;
800
+ if (isSvgMode && tag === "svg") {
801
+ isSvgMode = false;
802
+ }
734
803
  } else if (oldVNode.$text$ !== text) {
735
804
  elm.data = text;
736
805
  }
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-rvPH40G4.js');
3
+ var index = require('./index-Q72R0i75.js');
4
4
  var appGlobals = require('./app-globals-V2Kpy_OQ.js');
5
5
 
6
6
  const defineCustomElements = async (win, options) => {
7
7
  if (typeof window === 'undefined') return undefined;
8
8
  await appGlobals.globalScripts();
9
- return index.bootstrapLazy([["veleta-boston-template.cjs",[[256,"veleta-boston-template",{"dataJson":[1,"data-json"],"data":[16]}]]]], options);
9
+ return index.bootstrapLazy([["veleta-brooklyn-template.cjs",[[256,"veleta-brooklyn-template",{"dataJson":[1,"data-json"],"data":[16]}]]],["veleta-umami-template.cjs",[[256,"veleta-umami-template",{"dataJson":[1,"data-json"],"data":[16]}]]]], options);
10
10
  };
11
11
 
12
12
  exports.setNonce = index.setNonce;
@@ -0,0 +1,93 @@
1
+ 'use strict';
2
+
3
+ var index = require('./index-Q72R0i75.js');
4
+ var dataHelpers = require('./data-helpers-Dv_PXPva.js');
5
+
6
+ const brooklynTemplateCss = () => `.bk-wrapper{min-height:100vh;width:100%;padding:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.bk-wrapper *{-webkit-box-sizing:border-box;box-sizing:border-box}.bk-container{max-width:1280px;margin:0 auto;position:relative;z-index:10;padding:3rem 1.5rem;-ms-flex:1;flex:1;width:100%}.bk-insta-header{margin-top:0.5rem;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;gap:0.2rem}.bk-instagram-link{display:-ms-flexbox;display:flex;gap:0.8rem;text-decoration:none;color:currentColor;font-weight:700;font-size:.9rem;text-transform:lowercase;letter-spacing:0;border-bottom:none;opacity:0.8;-webkit-transition:opacity 0.3s;transition:opacity 0.3s;text-decoration:underline}@media (min-width: 768px){.bk-instagram-link{font-size:1.1rem}}.bk-instagram-link:hover{opacity:1}.bk-checkerboard{width:100%;height:80px;background-image:conic-gradient(currentColor 90deg,
7
+ transparent 90deg 180deg,
8
+ currentColor 180deg 270deg,
9
+ transparent 270deg);background-size:80px 80px;opacity:1}.bk-header{text-align:center;margin-bottom:3rem}.bk-header h1{font-size:3rem;text-transform:uppercase;font-weight:700;margin:0;letter-spacing:-2px;line-height:1}@media (min-width: 768px){.bk-header h1{font-size:3.5rem}}.bk-sections{display:grid;grid-template-columns:1fr;gap:3rem}@media (min-width: 768px){.bk-sections{grid-template-columns:repeat(2, 1fr);-moz-column-gap:4rem;-webkit-column-gap:4rem;column-gap:4rem;-ms-flex-align:start;align-items:start}}.bk-section{text-align:center;-moz-column-break-inside:avoid;-webkit-column-break-inside:avoid;break-inside:avoid}.bk-section-heading{background-color:currentColor;display:inline-block;padding:0.5rem 2rem;margin-bottom:2rem;min-width:250px;max-width:100%}.bk-section-heading h2{color:#fff;margin:0;text-transform:uppercase;font-size:1.2rem;font-weight:700;letter-spacing:0.2em}.bk-section-desc{color:currentColor;font-size:0.95rem;line-height:1.5;text-align:start}.bk-dishes-grid{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:1.5rem;width:100%}.bk-dish{text-align:left}.bk-dish-row{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:baseline;align-items:baseline;padding-bottom:0;}.bk-dish-name{font-weight:700;text-transform:uppercase;font-size:1rem}.bk-dish-price{font-weight:700;font-size:1rem;}.bk-dish-desc{margin:0.25rem 0 0 0;color:var(--bk-secondary);font-size:0.85rem;line-height:1.4}@media (min-width: 768px){.bk-section-heading h2{font-size:1.5rem}.bk-dish-name,.bk-dish-price{font-size:1.2rem}.bk-section-desc{font-size:1.1rem}.bk-dish-desc{font-size:1rem}}.animate-item{opacity:1;-webkit-transform:none;transform:none;}.is-visible{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}`;
10
+
11
+ const BrooklynTemplate = class {
12
+ constructor(hostRef) {
13
+ index.registerInstance(this, hostRef);
14
+ /**
15
+ * Menu data as JSON string
16
+ */
17
+ this.dataJson = '{}';
18
+ this.fontConfig = {
19
+ google: {
20
+ families: ['Oswald:700', 'Courier Prime:400,700'],
21
+ },
22
+ };
23
+ }
24
+ async componentWillLoad() {
25
+ await dataHelpers.loadFonts(this.fontConfig);
26
+ // Courier Prime será la base por defecto
27
+ dataHelpers.applyFontFamily(this.el, 'Courier Prime, monospace');
28
+ }
29
+ componentDidLoad() {
30
+ this.initObserver();
31
+ }
32
+ disconnectedCallback() {
33
+ if (this.observer) {
34
+ this.observer.disconnect();
35
+ }
36
+ }
37
+ initObserver() {
38
+ if (this.observer) {
39
+ this.observer.disconnect();
40
+ }
41
+ this.observer = new IntersectionObserver((entries) => {
42
+ entries.forEach((entry) => {
43
+ if (entry.isIntersecting) {
44
+ entry.target.classList.add('is-visible');
45
+ this.observer.unobserve(entry.target);
46
+ }
47
+ });
48
+ }, { threshold: 0.1 });
49
+ const elements = this.el.querySelectorAll('.animate-item');
50
+ elements.forEach((el) => this.observer.observe(el));
51
+ }
52
+ render() {
53
+ var _a;
54
+ let menuData = null;
55
+ if (this.data) {
56
+ menuData = this.data;
57
+ }
58
+ else if (this.dataJson && this.dataJson !== '{}') {
59
+ try {
60
+ menuData = JSON.parse(this.dataJson);
61
+ }
62
+ catch (e) {
63
+ console.warn('Invalid dataJson provided:', e);
64
+ }
65
+ }
66
+ const theme = (_a = menuData === null || menuData === void 0 ? void 0 : menuData.templateData) === null || _a === void 0 ? void 0 : _a.theme;
67
+ const primary = (theme === null || theme === void 0 ? void 0 : theme.primaryColor) || '#000000';
68
+ const secondary = (theme === null || theme === void 0 ? void 0 : theme.secondaryColor) || '#000000';
69
+ const background = (theme === null || theme === void 0 ? void 0 : theme.backgroundColor) || '#ffffff';
70
+ if (!menuData)
71
+ return index.h("div", { class: "bk-wrapper" });
72
+ // Data setup
73
+ const { business, sections } = menuData;
74
+ const sortedSections = (sections || []).sort((a, b) => a.order - b.order);
75
+ // Tipografías
76
+ const fontHeader = 'Oswald, sans-serif'; // Solo para el restaurante
77
+ const fontTypewriter = 'Courier Prime, monospace'; // Para todo lo demás
78
+ return (index.h("div", { class: "bk-wrapper", style: {
79
+ backgroundColor: background,
80
+ color: primary,
81
+ '--bk-secondary': secondary,
82
+ } }, index.h("div", { class: "bk-checkerboard top" }), index.h("div", { class: "bk-container" }, (business === null || business === void 0 ? void 0 : business.name) && (index.h("header", { class: "bk-header" }, (business === null || business === void 0 ? void 0 : business.instagramUrl) && (index.h("div", { class: "bk-insta-header" }, index.h("h1", { style: { fontFamily: fontHeader } }, business.name), index.h("a", { href: business.instagramUrl, target: "_blank", rel: "noopener noreferrer", class: "bk-instagram-link", style: { fontFamily: fontTypewriter } }, "S\u00EDguenos en Instagram", index.h("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 14 14", id: "Instagram--Streamline-Core", height: "14", width: "14" }, index.h("desc", null, "Instagram Streamline Icon: https://streamlinehq.com"), index.h("g", { id: "instagram" }, index.h("g", { id: "Group 4546" }, index.h("path", { id: "Vector", stroke: primary, "stroke-linecap": "round", "stroke-linejoin": "round", d: "M10.3332 3.64404c-0.1381 0 -0.25 -0.11193 -0.25 -0.25s0.1119 -0.25 0.25 -0.25", "stroke-width": "1" }), index.h("path", { id: "Vector_2", stroke: primary, "stroke-linecap": "round", "stroke-linejoin": "round", d: "M10.3332 3.64404c0.1381 0 0.25 -0.11193 0.25 -0.25s-0.1119 -0.25 -0.25 -0.25", "stroke-width": "1" })), index.h("path", { id: "Rectangle 2", stroke: primary, "stroke-linecap": "round", "stroke-linejoin": "round", d: "M0.858276 3.43141c0 -1.42103 1.151974 -2.573012 2.573014 -2.573012h6.86141c1.421 0 2.573 1.151982 2.573 2.573012v6.86139c0 1.421 -1.152 2.573 -2.573 2.573H3.43129c-1.42104 0 -2.573014 -1.152 -2.573014 -2.573V3.43141Z", "stroke-width": "1" }), index.h("path", { id: "Ellipse 11", stroke: primary, "stroke-linecap": "round", "stroke-linejoin": "round", d: "M4.312 6.862a2.55 2.55 0 1 0 5.1 0 2.55 2.55 0 1 0 -5.1 0", "stroke-width": "1" })))))))), index.h("div", { class: "bk-sections" }, sortedSections.map((section) => {
83
+ const sectionDishes = (section.dishes || []).sort((a, b) => a.order - b.order);
84
+ if (!sectionDishes.length)
85
+ return null;
86
+ return (index.h("section", { key: section.id, class: "bk-section animate-item" }, index.h("div", { class: "bk-section-heading" }, index.h("h2", { style: { fontFamily: fontTypewriter } }, section.title)), section.description && (index.h("p", { class: "bk-section-desc", style: { fontFamily: fontTypewriter } }, section.description)), index.h("div", { class: "bk-dishes-grid" }, sectionDishes.map((dish) => (index.h("div", { key: dish.id, class: "bk-dish" }, index.h("div", { class: "bk-dish-row" }, index.h("span", { class: "bk-dish-name", style: { fontFamily: fontTypewriter } }, dish.name), index.h("span", { class: "bk-dish-price", style: { fontFamily: fontTypewriter } }, dataHelpers.formatPrice(dish.price))), dish.description && (index.h("p", { class: "bk-dish-desc", style: { fontFamily: fontTypewriter } }, dish.description))))))));
87
+ }))), index.h("div", { class: "bk-checkerboard bottom" })));
88
+ }
89
+ get el() { return index.getElement(this); }
90
+ };
91
+ BrooklynTemplate.style = brooklynTemplateCss();
92
+
93
+ exports.veleta_brooklyn_template = BrooklynTemplate;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-rvPH40G4.js');
3
+ var index = require('./index-Q72R0i75.js');
4
4
  var appGlobals = require('./app-globals-V2Kpy_OQ.js');
5
5
 
6
6
  var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
@@ -19,7 +19,7 @@ var patchBrowser = () => {
19
19
 
20
20
  patchBrowser().then(async (options) => {
21
21
  await appGlobals.globalScripts();
22
- return index.bootstrapLazy([["veleta-boston-template.cjs",[[256,"veleta-boston-template",{"dataJson":[1,"data-json"],"data":[16]}]]]], options);
22
+ return index.bootstrapLazy([["veleta-brooklyn-template.cjs",[[256,"veleta-brooklyn-template",{"dataJson":[1,"data-json"],"data":[16]}]]],["veleta-umami-template.cjs",[[256,"veleta-umami-template",{"dataJson":[1,"data-json"],"data":[16]}]]]], options);
23
23
  });
24
24
 
25
25
  exports.setNonce = index.setNonce;
@@ -0,0 +1,95 @@
1
+ 'use strict';
2
+
3
+ var index = require('./index-Q72R0i75.js');
4
+ var dataHelpers = require('./data-helpers-Dv_PXPva.js');
5
+
6
+ const umamiTemplateCss = () => `.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{padding-top:1rem;font-size:2rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;line-height:1.1;margin:0 0 2rem 0 !important}@media (min-width: 640px){.restaurant-title{text-align:start;font-size:2.5rem;margin:0 0 3.5rem 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}}.menu-footer{margin-top:4rem;padding-top:2rem;text-align:center;border-top:1px solid currentColor;opacity:0.8}@media (min-width: 768px){.menu-footer{margin-top:5rem;padding-top:2.5rem}}.instagram-link{display:inline-block;font-size:.8rem;font-weight:600;text-transform:uppercase;letter-spacing:0.1em;text-decoration:none;color:inherit;padding:0.75rem 1.5rem;border:2px solid currentColor;border-radius:0.25rem;-webkit-transition:all 0.3s ease;transition:all 0.3s ease;position:relative;overflow:hidden}.instagram-link::before{content:'';position:absolute;top:0;left:-100%;width:100%;height:100%;background-color:currentColor;opacity:0.1;-webkit-transition:left 0.3s ease;transition:left 0.3s ease;z-index:-1}.instagram-link:hover::before{left:0}.instagram-link:hover{-webkit-transform:translateY(-2px);transform:translateY(-2px);-webkit-box-shadow:0 4px 8px rgba(0, 0, 0, 0.15);box-shadow:0 4px 8px rgba(0, 0, 0, 0.15)}@media (min-width: 640px){.instagram-link{font-size:1.1rem;padding:0.875rem 2rem}}@media (min-width: 768px){.instagram-link{font-size:1.125rem}}`;
7
+
8
+ const UmamiTemplate = class {
9
+ constructor(hostRef) {
10
+ index.registerInstance(this, hostRef);
11
+ /**
12
+ * Menu data as JSON string (for compatibility with HTML attributes)
13
+ * @deprecated Use `data` prop instead for better type safety
14
+ */
15
+ this.dataJson = '{}';
16
+ this.fontConfig = {
17
+ google: {
18
+ families: ['Oswald:400,600,700', 'Merriweather:300,400,700'],
19
+ },
20
+ };
21
+ }
22
+ async componentWillLoad() {
23
+ await dataHelpers.loadFonts(this.fontConfig);
24
+ dataHelpers.applyFontFamily(this.el, 'Merriweather, serif');
25
+ }
26
+ componentDidLoad() {
27
+ this.initObserver();
28
+ }
29
+ componentDidUpdate() {
30
+ this.initObserver();
31
+ }
32
+ disconnectedCallback() {
33
+ if (this.observer) {
34
+ this.observer.disconnect();
35
+ }
36
+ }
37
+ initObserver() {
38
+ if (this.observer) {
39
+ this.observer.disconnect();
40
+ }
41
+ this.observer = new IntersectionObserver((entries) => {
42
+ entries.forEach((entry) => {
43
+ if (entry.isIntersecting) {
44
+ const target = entry.target;
45
+ target.classList.add('is-visible');
46
+ // Stop observing once visible to avoid re-animating
47
+ this.observer.unobserve(target);
48
+ }
49
+ });
50
+ }, {
51
+ threshold: 0.1,
52
+ rootMargin: '0px 0px -50px 0px',
53
+ });
54
+ const elements = this.el.querySelectorAll('.animate-item');
55
+ elements.forEach((el) => this.observer.observe(el));
56
+ }
57
+ render() {
58
+ var _a;
59
+ let menuData = null;
60
+ // Priority 1: Use object data if provided
61
+ if (this.data) {
62
+ menuData = this.data;
63
+ }
64
+ // Priority 2: Parse JSON string
65
+ else if (this.dataJson && this.dataJson !== '{}') {
66
+ try {
67
+ menuData = JSON.parse(this.dataJson);
68
+ }
69
+ catch (e) {
70
+ console.warn('Invalid dataJson provided to veleta-umami-template:', e);
71
+ }
72
+ }
73
+ const theme = (_a = menuData === null || menuData === void 0 ? void 0 : menuData.templateData) === null || _a === void 0 ? void 0 : _a.theme;
74
+ const primary = (theme === null || theme === void 0 ? void 0 : theme.primaryColor) || '#1a365d';
75
+ const background = (theme === null || theme === void 0 ? void 0 : theme.backgroundColor) || '#FFFFFF';
76
+ const fontBody = 'Merriweather, serif';
77
+ const fontTitle = 'Oswald, sans-serif';
78
+ if (!menuData) {
79
+ return (index.h("div", { class: "menu-wrapper", style: { color: primary, backgroundColor: background } }));
80
+ }
81
+ const { sections, business } = menuData;
82
+ // Ordenar secciones por 'order'
83
+ const sortedSections = (sections || []).sort((a, b) => a.order - b.order);
84
+ 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) => {
85
+ const sectionDishes = (section.dishes || []).sort((a, b) => a.order - b.order);
86
+ if (!sectionDishes.length)
87
+ return null;
88
+ 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 } }, dataHelpers.formatPrice(dish.price))), dish.description && (index.h("p", { class: "dish-description", style: { fontFamily: fontBody } }, dish.description)))))))));
89
+ })), (business === null || business === void 0 ? void 0 : business.instagramUrl) && (index.h("footer", { class: "menu-footer animate-item" }, index.h("a", { href: business.instagramUrl, target: "_blank", rel: "noopener noreferrer", class: "instagram-link", style: { fontFamily: fontTitle, color: primary } }, "S\u00EDguenos en Instagram"))))));
90
+ }
91
+ get el() { return index.getElement(this); }
92
+ };
93
+ UmamiTemplate.style = umamiTemplateCss();
94
+
95
+ exports.veleta_umami_template = UmamiTemplate;
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "entries": [
3
- "components/boston-template/boston-template.js"
3
+ "components/umami-template/umami-template.js",
4
+ "components/brooklyn-template/brooklyn-template.js"
4
5
  ],
5
6
  "compiler": {
6
7
  "name": "@stencil/core",