veleta-templates 0.0.17 → 0.0.19

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 (58) hide show
  1. package/dist/cjs/{index-Q72R0i75.js → index-DgFTJj_U.js} +29 -34
  2. package/dist/cjs/loader.cjs.js +2 -2
  3. package/dist/cjs/veleta-default-template.cjs.entry.js +62 -0
  4. package/dist/cjs/veleta-templates.cjs.js +2 -2
  5. package/dist/cjs/veleta-umami-template.cjs.entry.js +67 -5
  6. package/dist/collection/collection-manifest.json +1 -1
  7. package/dist/collection/components/default-template/default-template.css +17 -0
  8. package/dist/collection/components/default-template/default-template.js +117 -0
  9. package/dist/collection/components.js +1 -0
  10. package/dist/components/index.js +27 -32
  11. package/dist/components/veleta-default-template.d.ts +11 -0
  12. package/dist/components/veleta-default-template.js +85 -0
  13. package/dist/components/veleta-umami-template.js +63 -1
  14. package/dist/esm/{index-Bd-RqEyq.js → index-RSrs046A.js} +29 -34
  15. package/dist/esm/loader.js +3 -3
  16. package/dist/esm/veleta-default-template.entry.js +60 -0
  17. package/dist/esm/veleta-templates.js +3 -3
  18. package/dist/esm/veleta-umami-template.entry.js +64 -2
  19. package/dist/esm-es5/index-RSrs046A.js +1 -0
  20. package/dist/esm-es5/loader.js +1 -1
  21. package/dist/esm-es5/veleta-default-template.entry.js +1 -0
  22. package/dist/esm-es5/veleta-templates.js +1 -1
  23. package/dist/esm-es5/veleta-umami-template.entry.js +1 -1
  24. package/dist/types/components/default-template/default-template.d.ts +16 -0
  25. package/dist/types/components.d.ts +13 -13
  26. package/dist/veleta-templates/p-3aa8e836.system.entry.js +1 -0
  27. package/dist/veleta-templates/p-5kwxBi5X.system.js +2 -0
  28. package/dist/veleta-templates/p-87346103.system.entry.js +1 -0
  29. package/dist/veleta-templates/p-RSrs046A.js +2 -0
  30. package/dist/veleta-templates/p-b7927a21.entry.js +1 -0
  31. package/dist/veleta-templates/p-c4921741.entry.js +1 -0
  32. package/dist/veleta-templates/p-fzDonYKG.system.js +1 -0
  33. package/dist/veleta-templates/veleta-templates.css +13 -0
  34. package/dist/veleta-templates/veleta-templates.esm.js +1 -1
  35. package/dist/veleta-templates/veleta-templates.js +1 -1
  36. package/package.json +11 -5
  37. package/dist/cjs/data-helpers-Dv_PXPva.js +0 -68
  38. package/dist/cjs/veleta-brooklyn-template.cjs.entry.js +0 -93
  39. package/dist/collection/components/brooklyn-template/brooklyn-template.css +0 -217
  40. package/dist/collection/components/brooklyn-template/brooklyn-template.js +0 -140
  41. package/dist/components/p-1I-eujUE.js +0 -64
  42. package/dist/components/veleta-brooklyn-template.d.ts +0 -11
  43. package/dist/components/veleta-brooklyn-template.js +0 -114
  44. package/dist/esm/data-helpers-CMnPLI2F.js +0 -64
  45. package/dist/esm/veleta-brooklyn-template.entry.js +0 -91
  46. package/dist/esm-es5/data-helpers-CMnPLI2F.js +0 -1
  47. package/dist/esm-es5/index-Bd-RqEyq.js +0 -1
  48. package/dist/esm-es5/veleta-brooklyn-template.entry.js +0 -1
  49. package/dist/types/components/brooklyn-template/brooklyn-template.d.ts +0 -19
  50. package/dist/veleta-templates/p-1580fe83.entry.js +0 -1
  51. package/dist/veleta-templates/p-1I-eujUE.js +0 -1
  52. package/dist/veleta-templates/p-1c0474e1.entry.js +0 -1
  53. package/dist/veleta-templates/p-41eb138e.system.entry.js +0 -1
  54. package/dist/veleta-templates/p-BK_Xoawn.system.js +0 -1
  55. package/dist/veleta-templates/p-Bd-RqEyq.js +0 -2
  56. package/dist/veleta-templates/p-Bqdj2gqf.system.js +0 -1
  57. package/dist/veleta-templates/p-DgwkUF2J.system.js +0 -2
  58. package/dist/veleta-templates/p-aeb17573.system.entry.js +0 -1
@@ -19,7 +19,7 @@ function _interopNamespace(e) {
19
19
  }
20
20
 
21
21
  const NAMESPACE = 'veleta-templates';
22
- const BUILD = /* veleta-templates */ { hydratedSelectorName: "hydrated", lazyLoad: true, prop: true, propChangeCallback: false, updatable: true};
22
+ const BUILD = /* veleta-templates */ { hydratedSelectorName: "hydrated", lazyLoad: true, propChangeCallback: false, state: true, updatable: true};
23
23
 
24
24
  /*
25
25
  Stencil Client Platform v4.39.0 | MIT Licensed | https://stenciljs.com
@@ -29,10 +29,6 @@ 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";
36
32
  var reWireGetterSetter = (instance, hostRef) => {
37
33
  var _a;
38
34
  const cmpMeta = hostRef.$cmpMeta$;
@@ -77,7 +73,7 @@ var registerInstance = (lazyInstance, hostRef) => {
77
73
  if (!hostRef) return;
78
74
  lazyInstance.__stencil__getHostRef = () => hostRef;
79
75
  hostRef.$lazyInstance$ = lazyInstance;
80
- if (hostRef.$cmpMeta$.$flags$ & 512 /* hasModernPropertyDecls */ && (BUILD.prop)) {
76
+ if (hostRef.$cmpMeta$.$flags$ & 512 /* hasModernPropertyDecls */ && (BUILD.state)) {
81
77
  reWireGetterSetter(lazyInstance, hostRef);
82
78
  }
83
79
  };
@@ -124,10 +120,10 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
124
120
  }
125
121
  switch(bundleId) {
126
122
 
127
- case 'veleta-brooklyn-template.cjs':
123
+ case 'veleta-default-template.cjs':
128
124
  return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
129
125
  /* webpackMode: "lazy" */
130
- './veleta-brooklyn-template.cjs.entry.js')); }).then(processMod, consoleError);
126
+ './veleta-default-template.cjs.entry.js')); }).then(processMod, consoleError);
131
127
  case 'veleta-umami-template.cjs':
132
128
  return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
133
129
  /* webpackMode: "lazy" */
@@ -491,7 +487,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
491
487
  return;
492
488
  }
493
489
  let isProp = isMemberInElement(elm, memberName);
494
- memberName.toLowerCase();
490
+ let ln = memberName.toLowerCase();
495
491
  if (memberName === "class") {
496
492
  const classList = elm.classList;
497
493
  const oldClasses = parseClassList(oldValue);
@@ -521,9 +517,27 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
521
517
  }
522
518
  }
523
519
  }
524
- } else if (memberName === "key") ; else {
520
+ } else if (memberName === "key") ; else if ((!isProp ) && memberName[0] === "o" && memberName[1] === "n") {
521
+ if (memberName[2] === "-") {
522
+ memberName = memberName.slice(3);
523
+ } else if (isMemberInElement(win, ln)) {
524
+ memberName = ln.slice(2);
525
+ } else {
526
+ memberName = ln[2] + memberName.slice(3);
527
+ }
528
+ if (oldValue || newValue) {
529
+ const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
530
+ memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
531
+ if (oldValue) {
532
+ plt.rel(elm, memberName, oldValue, capture);
533
+ }
534
+ if (newValue) {
535
+ plt.ael(elm, memberName, newValue, capture);
536
+ }
537
+ }
538
+ } else {
525
539
  const isComplex = isComplexType(newValue);
526
- if ((isProp || isComplex && newValue !== null) && !isSvg) {
540
+ if ((isProp || isComplex && newValue !== null) && true) {
527
541
  try {
528
542
  if (!elm.tagName.includes("-")) {
529
543
  const n = newValue == null ? "" : newValue;
@@ -566,6 +580,8 @@ var parseClassList = (value) => {
566
580
  }
567
581
  return value.split(parseClassListRegex);
568
582
  };
583
+ var CAPTURE_EVENT_SUFFIX = "Capture";
584
+ var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
569
585
 
570
586
  // src/runtime/vdom/update-element.ts
571
587
  var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
@@ -614,21 +630,14 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
614
630
  if (newVNode2.$text$ !== null) {
615
631
  elm = newVNode2.$elm$ = win.document.createTextNode(newVNode2.$text$);
616
632
  } else {
617
- if (!isSvgMode) {
618
- isSvgMode = newVNode2.$tag$ === "svg";
619
- }
620
633
  if (!win.document) {
621
634
  throw new Error(
622
635
  "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."
623
636
  );
624
637
  }
625
- elm = newVNode2.$elm$ = win.document.createElementNS(
626
- isSvgMode ? SVG_NS : HTML_NS,
638
+ elm = newVNode2.$elm$ = win.document.createElement(
627
639
  newVNode2.$tag$
628
- ) ;
629
- if (isSvgMode && newVNode2.$tag$ === "foreignObject") {
630
- isSvgMode = false;
631
- }
640
+ );
632
641
  {
633
642
  updateElement(null, newVNode2, isSvgMode);
634
643
  }
@@ -640,13 +649,6 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
640
649
  }
641
650
  }
642
651
  }
643
- {
644
- if (newVNode2.$tag$ === "svg") {
645
- isSvgMode = false;
646
- } else if (elm.tagName === "foreignObject") {
647
- isSvgMode = true;
648
- }
649
- }
650
652
  }
651
653
  elm["s-hn"] = hostTagName;
652
654
  return elm;
@@ -775,12 +777,8 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
775
777
  const elm = newVNode2.$elm$ = oldVNode.$elm$;
776
778
  const oldChildren = oldVNode.$children$;
777
779
  const newChildren = newVNode2.$children$;
778
- const tag = newVNode2.$tag$;
779
780
  const text = newVNode2.$text$;
780
781
  if (text === null) {
781
- {
782
- isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
783
- }
784
782
  {
785
783
  updateElement(oldVNode, newVNode2, isSvgMode);
786
784
  }
@@ -797,9 +795,6 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
797
795
  ) {
798
796
  removeVnodes(oldChildren, 0, oldChildren.length - 1);
799
797
  } else ;
800
- if (isSvgMode && tag === "svg") {
801
- isSvgMode = false;
802
- }
803
798
  } else if (oldVNode.$text$ !== text) {
804
799
  elm.data = text;
805
800
  }
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-Q72R0i75.js');
3
+ var index = require('./index-DgFTJj_U.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-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);
9
+ return index.bootstrapLazy([["veleta-default-template.cjs",[[256,"veleta-default-template",{"data":[16],"dataJson":[1,"data-json"],"expandedDishes":[32],"searchQuery":[32]}]]],["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,62 @@
1
+ 'use strict';
2
+
3
+ var index = require('./index-DgFTJj_U.js');
4
+
5
+ const defaultTemplateCss = () => `.dish-desc-smooth{display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden;transition:max-height 0.8s cubic-bezier(0.25, 1, 0.5, 1), -webkit-line-clamp 0.8s cubic-bezier(0.25, 1, 0.5, 1);will-change:max-height}.dish-desc-smooth.collapsed{-webkit-line-clamp:1;max-height:1.5rem}.dish-desc-smooth.expanded{-webkit-line-clamp:15;max-height:12rem}`;
6
+
7
+ const DefaultTemplate = class {
8
+ constructor(hostRef) {
9
+ index.registerInstance(this, hostRef);
10
+ this.expandedDishes = {};
11
+ this.searchQuery = '';
12
+ /**
13
+ * Menu data as JSON string (for compatibility with HTML attributes)
14
+ */
15
+ this.dataJson = '{}';
16
+ }
17
+ toggleDish(id) {
18
+ this.expandedDishes = Object.assign(Object.assign({}, this.expandedDishes), { [id]: !this.expandedDishes[id] });
19
+ }
20
+ render() {
21
+ let menuData = null;
22
+ if (this.data) {
23
+ menuData = this.data;
24
+ }
25
+ else if (this.dataJson && this.dataJson !== '{}') {
26
+ try {
27
+ menuData = JSON.parse(this.dataJson);
28
+ }
29
+ catch (e) {
30
+ console.warn('Invalid dataJson provided to veleta-default-template:', e);
31
+ }
32
+ }
33
+ if (!menuData) {
34
+ return (index.h("div", { class: "default-template-empty" }, "No data provided for Default Template"));
35
+ }
36
+ const { sections, business } = menuData;
37
+ const sortedSections = (sections || []).sort((a, b) => a.order - b.order);
38
+ return (index.h("div", { class: "default-template-wrapper p-4 bg-gray-100 flex flex-col gap-4 min-h-screen", "data-theme": "light" }, business && (index.h("header", { class: "text-center mt-6 mb-2" }, index.h("h1", { class: "text-4xl font-bold uppercase" }, business.name))), sortedSections.map((section) => {
39
+ const sectionDishes = (section.dishes || [])
40
+ // .filter((dish) => {
41
+ // if (!this.searchQuery) return true;
42
+ // const term = this.searchQuery;
43
+ // return (
44
+ // dish.name.toLowerCase().includes(term) ||
45
+ // (dish.description &&
46
+ // dish.description.toLowerCase().includes(term))
47
+ // );
48
+ // })
49
+ .sort((a, b) => a.order - b.order);
50
+ if (!sectionDishes.length)
51
+ return null;
52
+ return (index.h("div", { key: section.id, class: "flex flex-col gap-3 w-96 mx-auto mb-4" }, index.h("div", { class: "divider text-lg" }, section.title), sectionDishes.map((dish) => {
53
+ const isOpen = !!this.expandedDishes[dish.id];
54
+ return (index.h("div", { key: dish.id, class: "card w-96 bg-base-100 card-xs shadow-sm cursor-pointer", onClick: () => this.toggleDish(dish.id) }, index.h("div", { class: "card-body p-4" }, index.h("div", { class: "flex justify-between items-center w-full" }, index.h("h2", { class: "card-title min-w-0 flex-1 mr-2" }, index.h("span", { class: "truncate block w-full" }, dish.name)), index.h("div", { class: "badge badge-primary text-xs shrink-0" }, dish.price, " \u20AC")), index.h("p", { class: `dish-desc-smooth ${isOpen ? 'expanded' : 'collapsed'}` }, dish.description))));
55
+ })));
56
+ })));
57
+ }
58
+ get el() { return index.getElement(this); }
59
+ };
60
+ DefaultTemplate.style = defaultTemplateCss();
61
+
62
+ exports.veleta_default_template = DefaultTemplate;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-Q72R0i75.js');
3
+ var index = require('./index-DgFTJj_U.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-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);
22
+ return index.bootstrapLazy([["veleta-default-template.cjs",[[256,"veleta-default-template",{"data":[16],"dataJson":[1,"data-json"],"expandedDishes":[32],"searchQuery":[32]}]]],["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;
@@ -1,7 +1,69 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-Q72R0i75.js');
4
- var dataHelpers = require('./data-helpers-Dv_PXPva.js');
3
+ var index = require('./index-DgFTJj_U.js');
4
+
5
+ /**
6
+ * Carga fuentes usando webfontloader de forma dinámica.
7
+ * Esta función carga el módulo webfontloader solo cuando es necesario.
8
+ *
9
+ * @param fontConfig Configuración de fuentes para webfontloader
10
+ * @returns Promise que se resuelve cuando las fuentes se cargan
11
+ */
12
+ async function loadFonts(fontConfig) {
13
+ if (!fontConfig || (!fontConfig.google && !fontConfig.custom)) {
14
+ return Promise.resolve();
15
+ }
16
+ try {
17
+ // Importación dinámica de webfontloader
18
+ // webfontloader puede exportar de diferentes formas según el entorno
19
+ const webfontloaderModule = await Promise.resolve().then(function () { return require('./webfontloader-CDgRDOZ3.js'); }).then(function (n) { return n.webfontloader; });
20
+ const WebFont = webfontloaderModule.default || webfontloaderModule;
21
+ if (!WebFont || typeof WebFont.load !== 'function') {
22
+ console.warn('webfontloader no está disponible o no tiene el método load');
23
+ return Promise.resolve();
24
+ }
25
+ return new Promise((resolve) => {
26
+ const config = Object.assign(Object.assign({}, fontConfig), { active: () => {
27
+ if (fontConfig.active) {
28
+ fontConfig.active();
29
+ }
30
+ resolve();
31
+ }, inactive: () => {
32
+ if (fontConfig.inactive) {
33
+ fontConfig.inactive();
34
+ }
35
+ // No rechazamos la promesa, solo resolvemos
36
+ // para que el template pueda renderizarse con fuentes por defecto
37
+ resolve();
38
+ } });
39
+ WebFont.load(config);
40
+ });
41
+ }
42
+ catch (error) {
43
+ console.error('Error loading webfontloader:', error);
44
+ // Resolvemos en lugar de rechazar para que el template pueda renderizarse
45
+ return Promise.resolve();
46
+ }
47
+ }
48
+ /**
49
+ * Aplica la familia de fuente al elemento raíz del componente.
50
+ *
51
+ * @param element Elemento HTML al que aplicar la fuente
52
+ * @param fontFamily Familia de fuente CSS (ej: "Roboto, sans-serif")
53
+ */
54
+ function applyFontFamily(element, fontFamily) {
55
+ if (element) {
56
+ element.style.fontFamily = fontFamily;
57
+ }
58
+ }
59
+
60
+ /**
61
+ * Formatea un precio como string con símbolo de euro.
62
+ * Si es un número entero, no muestra decimales.
63
+ */
64
+ function formatPrice(price) {
65
+ return (price % 1 === 0 ? price.toString() : price.toFixed(2)) + '€';
66
+ }
5
67
 
6
68
  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}.umami-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}.umami-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
69
 
@@ -20,8 +82,8 @@ const UmamiTemplate = class {
20
82
  };
21
83
  }
22
84
  async componentWillLoad() {
23
- await dataHelpers.loadFonts(this.fontConfig);
24
- dataHelpers.applyFontFamily(this.el, 'Merriweather, serif');
85
+ await loadFonts(this.fontConfig);
86
+ applyFontFamily(this.el, 'Merriweather, serif');
25
87
  }
26
88
  componentDidLoad() {
27
89
  this.initObserver();
@@ -85,7 +147,7 @@ const UmamiTemplate = class {
85
147
  const sectionDishes = (section.dishes || []).sort((a, b) => a.order - b.order);
86
148
  if (!sectionDishes.length)
87
149
  return null;
88
- return (index.h("section", { key: section.id, class: "menu-section umami-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 umami-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)))))))));
150
+ return (index.h("section", { key: section.id, class: "menu-section umami-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 umami-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)))))))));
89
151
  })), (business === null || business === void 0 ? void 0 : business.instagramUrl) && (index.h("footer", { class: "menu-footer umami-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
152
  }
91
153
  get el() { return index.getElement(this); }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "entries": [
3
3
  "components/umami-template/umami-template.js",
4
- "components/brooklyn-template/brooklyn-template.js"
4
+ "components/default-template/default-template.js"
5
5
  ],
6
6
  "compiler": {
7
7
  "name": "@stencil/core",
@@ -0,0 +1,17 @@
1
+ .dish-desc-smooth {
2
+ display: -webkit-box;
3
+ -webkit-box-orient: vertical;
4
+ overflow: hidden;
5
+ transition: max-height 0.8s cubic-bezier(0.25, 1, 0.5, 1), -webkit-line-clamp 0.8s cubic-bezier(0.25, 1, 0.5, 1);
6
+ will-change: max-height;
7
+ }
8
+
9
+ .dish-desc-smooth.collapsed {
10
+ -webkit-line-clamp: 1;
11
+ max-height: 1.5rem;
12
+ }
13
+
14
+ .dish-desc-smooth.expanded {
15
+ -webkit-line-clamp: 15;
16
+ max-height: 12rem;
17
+ }
@@ -0,0 +1,117 @@
1
+ import { h } from "@stencil/core";
2
+ export class DefaultTemplate {
3
+ constructor() {
4
+ this.expandedDishes = {};
5
+ this.searchQuery = '';
6
+ /**
7
+ * Menu data as JSON string (for compatibility with HTML attributes)
8
+ */
9
+ this.dataJson = '{}';
10
+ }
11
+ toggleDish(id) {
12
+ this.expandedDishes = Object.assign(Object.assign({}, this.expandedDishes), { [id]: !this.expandedDishes[id] });
13
+ }
14
+ render() {
15
+ let menuData = null;
16
+ if (this.data) {
17
+ menuData = this.data;
18
+ }
19
+ else if (this.dataJson && this.dataJson !== '{}') {
20
+ try {
21
+ menuData = JSON.parse(this.dataJson);
22
+ }
23
+ catch (e) {
24
+ console.warn('Invalid dataJson provided to veleta-default-template:', e);
25
+ }
26
+ }
27
+ if (!menuData) {
28
+ return (h("div", { class: "default-template-empty" }, "No data provided for Default Template"));
29
+ }
30
+ const { sections, business } = menuData;
31
+ const sortedSections = (sections || []).sort((a, b) => a.order - b.order);
32
+ return (h("div", { class: "default-template-wrapper p-4 bg-gray-100 flex flex-col gap-4 min-h-screen", "data-theme": "light" }, business && (h("header", { class: "text-center mt-6 mb-2" }, h("h1", { class: "text-4xl font-bold uppercase" }, business.name))), sortedSections.map((section) => {
33
+ const sectionDishes = (section.dishes || [])
34
+ // .filter((dish) => {
35
+ // if (!this.searchQuery) return true;
36
+ // const term = this.searchQuery;
37
+ // return (
38
+ // dish.name.toLowerCase().includes(term) ||
39
+ // (dish.description &&
40
+ // dish.description.toLowerCase().includes(term))
41
+ // );
42
+ // })
43
+ .sort((a, b) => a.order - b.order);
44
+ if (!sectionDishes.length)
45
+ return null;
46
+ return (h("div", { key: section.id, class: "flex flex-col gap-3 w-96 mx-auto mb-4" }, h("div", { class: "divider text-lg" }, section.title), sectionDishes.map((dish) => {
47
+ const isOpen = !!this.expandedDishes[dish.id];
48
+ return (h("div", { key: dish.id, class: "card w-96 bg-base-100 card-xs shadow-sm cursor-pointer", onClick: () => this.toggleDish(dish.id) }, h("div", { class: "card-body p-4" }, h("div", { class: "flex justify-between items-center w-full" }, h("h2", { class: "card-title min-w-0 flex-1 mr-2" }, h("span", { class: "truncate block w-full" }, dish.name)), h("div", { class: "badge badge-primary text-xs shrink-0" }, dish.price, " \u20AC")), h("p", { class: `dish-desc-smooth ${isOpen ? 'expanded' : 'collapsed'}` }, dish.description))));
49
+ })));
50
+ })));
51
+ }
52
+ static get is() { return "veleta-default-template"; }
53
+ static get originalStyleUrls() {
54
+ return {
55
+ "$": ["default-template.css"]
56
+ };
57
+ }
58
+ static get styleUrls() {
59
+ return {
60
+ "$": ["default-template.css"]
61
+ };
62
+ }
63
+ static get properties() {
64
+ return {
65
+ "data": {
66
+ "type": "unknown",
67
+ "mutable": false,
68
+ "complexType": {
69
+ "original": "Menu",
70
+ "resolved": "Menu",
71
+ "references": {
72
+ "Menu": {
73
+ "location": "import",
74
+ "path": "../../types/interfaces",
75
+ "id": "src/types/interfaces.ts::Menu"
76
+ }
77
+ }
78
+ },
79
+ "required": false,
80
+ "optional": true,
81
+ "docs": {
82
+ "tags": [],
83
+ "text": "Menu data as object (recommended for frameworks like Angular, React, Vue)"
84
+ },
85
+ "getter": false,
86
+ "setter": false
87
+ },
88
+ "dataJson": {
89
+ "type": "string",
90
+ "mutable": false,
91
+ "complexType": {
92
+ "original": "string",
93
+ "resolved": "string",
94
+ "references": {}
95
+ },
96
+ "required": false,
97
+ "optional": false,
98
+ "docs": {
99
+ "tags": [],
100
+ "text": "Menu data as JSON string (for compatibility with HTML attributes)"
101
+ },
102
+ "getter": false,
103
+ "setter": false,
104
+ "reflect": false,
105
+ "attribute": "data-json",
106
+ "defaultValue": "'{}'"
107
+ }
108
+ };
109
+ }
110
+ static get states() {
111
+ return {
112
+ "expandedDishes": {},
113
+ "searchQuery": {}
114
+ };
115
+ }
116
+ static get elementRef() { return "el"; }
117
+ }
@@ -1 +1,2 @@
1
1
  export * from './components/umami-template/umami-template';
2
+ export * from './components/default-template/default-template';
@@ -1,5 +1,5 @@
1
1
  const NAMESPACE = 'veleta-templates';
2
- const BUILD = /* veleta-templates */ { hydratedSelectorName: "hydrated", lazyLoad: false, prop: true, propChangeCallback: false, updatable: true};
2
+ const BUILD = /* veleta-templates */ { hydratedSelectorName: "hydrated", lazyLoad: false, propChangeCallback: false, state: true, updatable: true};
3
3
 
4
4
  /*
5
5
  Stencil Client Platform v4.39.0 | MIT Licensed | https://stenciljs.com
@@ -9,10 +9,6 @@ var __export = (target, all) => {
9
9
  for (var name in all)
10
10
  __defProp(target, name, { get: all[name], enumerable: true });
11
11
  };
12
-
13
- // src/utils/constants.ts
14
- var SVG_NS = "http://www.w3.org/2000/svg";
15
- var HTML_NS = "http://www.w3.org/1999/xhtml";
16
12
  var reWireGetterSetter = (instance, hostRef) => {
17
13
  var _a;
18
14
  const cmpMeta = hostRef.$cmpMeta$;
@@ -68,7 +64,7 @@ var registerHost = (hostElement, cmpMeta) => {
68
64
  }
69
65
  const ref = hostRef;
70
66
  hostElement.__stencil__getHostRef = () => ref;
71
- if (cmpMeta.$flags$ & 512 /* hasModernPropertyDecls */ && (BUILD.prop)) {
67
+ if (cmpMeta.$flags$ & 512 /* hasModernPropertyDecls */ && (BUILD.state)) {
72
68
  reWireGetterSetter(hostElement, hostRef);
73
69
  }
74
70
  return ref;
@@ -411,7 +407,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
411
407
  return;
412
408
  }
413
409
  let isProp = isMemberInElement(elm, memberName);
414
- memberName.toLowerCase();
410
+ let ln = memberName.toLowerCase();
415
411
  if (memberName === "class") {
416
412
  const classList = elm.classList;
417
413
  const oldClasses = parseClassList(oldValue);
@@ -441,9 +437,27 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
441
437
  }
442
438
  }
443
439
  }
444
- } else if (memberName === "key") ; else {
440
+ } else if (memberName === "key") ; else if ((!elm.__lookupSetter__(memberName)) && memberName[0] === "o" && memberName[1] === "n") {
441
+ if (memberName[2] === "-") {
442
+ memberName = memberName.slice(3);
443
+ } else if (isMemberInElement(win, ln)) {
444
+ memberName = ln.slice(2);
445
+ } else {
446
+ memberName = ln[2] + memberName.slice(3);
447
+ }
448
+ if (oldValue || newValue) {
449
+ const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
450
+ memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
451
+ if (oldValue) {
452
+ plt.rel(elm, memberName, oldValue, capture);
453
+ }
454
+ if (newValue) {
455
+ plt.ael(elm, memberName, newValue, capture);
456
+ }
457
+ }
458
+ } else {
445
459
  const isComplex = isComplexType(newValue);
446
- if ((isProp || isComplex && newValue !== null) && !isSvg) {
460
+ if ((isProp || isComplex && newValue !== null) && true) {
447
461
  try {
448
462
  if (!elm.tagName.includes("-")) {
449
463
  const n = newValue == null ? "" : newValue;
@@ -486,6 +500,8 @@ var parseClassList = (value) => {
486
500
  }
487
501
  return value.split(parseClassListRegex);
488
502
  };
503
+ var CAPTURE_EVENT_SUFFIX = "Capture";
504
+ var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
489
505
 
490
506
  // src/runtime/vdom/update-element.ts
491
507
  var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
@@ -534,21 +550,14 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
534
550
  if (newVNode2.$text$ !== null) {
535
551
  elm = newVNode2.$elm$ = win.document.createTextNode(newVNode2.$text$);
536
552
  } else {
537
- if (!isSvgMode) {
538
- isSvgMode = newVNode2.$tag$ === "svg";
539
- }
540
553
  if (!win.document) {
541
554
  throw new Error(
542
555
  "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."
543
556
  );
544
557
  }
545
- elm = newVNode2.$elm$ = win.document.createElementNS(
546
- isSvgMode ? SVG_NS : HTML_NS,
558
+ elm = newVNode2.$elm$ = win.document.createElement(
547
559
  newVNode2.$tag$
548
- ) ;
549
- if (isSvgMode && newVNode2.$tag$ === "foreignObject") {
550
- isSvgMode = false;
551
- }
560
+ );
552
561
  {
553
562
  updateElement(null, newVNode2, isSvgMode);
554
563
  }
@@ -560,13 +569,6 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
560
569
  }
561
570
  }
562
571
  }
563
- {
564
- if (newVNode2.$tag$ === "svg") {
565
- isSvgMode = false;
566
- } else if (elm.tagName === "foreignObject") {
567
- isSvgMode = true;
568
- }
569
- }
570
572
  }
571
573
  elm["s-hn"] = hostTagName;
572
574
  return elm;
@@ -695,12 +697,8 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
695
697
  const elm = newVNode2.$elm$ = oldVNode.$elm$;
696
698
  const oldChildren = oldVNode.$children$;
697
699
  const newChildren = newVNode2.$children$;
698
- const tag = newVNode2.$tag$;
699
700
  const text = newVNode2.$text$;
700
701
  if (text === null) {
701
- {
702
- isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
703
- }
704
702
  {
705
703
  updateElement(oldVNode, newVNode2, isSvgMode);
706
704
  }
@@ -717,9 +715,6 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
717
715
  ) {
718
716
  removeVnodes(oldChildren, 0, oldChildren.length - 1);
719
717
  } else ;
720
- if (isSvgMode && tag === "svg") {
721
- isSvgMode = false;
722
- }
723
718
  } else if (oldVNode.$text$ !== text) {
724
719
  elm.data = text;
725
720
  }
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface VeletaDefaultTemplate extends Components.VeletaDefaultTemplate, HTMLElement {}
4
+ export const VeletaDefaultTemplate: {
5
+ prototype: VeletaDefaultTemplate;
6
+ new (): VeletaDefaultTemplate;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;